[PATCH] Improved branches to weak symbols
Daniel Gutson
dgutson@codesourcery.com
Fri Dec 25 18:51:00 GMT 2009
Richard Earnshaw wrote:
> On Thu, 2009-08-13 at 17:41 -0300, Daniel Gutson wrote:
>> Hi,
>>
>> the attached patch improves the instructions to generate when
>> branching to weak symbols.
>>
>> Rather than jumping to the next instruction, NOPs are generated, and
>> selected according to the architecture.
>>
>> Please let me know if OK to commit.
>>
>> Thanks!
>> Daniel.
>>
>> -----
>>
>> bfd/
>> * elf32-arm.c (arch_has_thumb2_nop): New function.
>> (arch_has_arm_nop): New function.
>> (elf32_arm_final_link_relocate): NOP opcodes changed.
>>
>> ld/testsuite/
>> * ld-arm/callweak.d: Opcodes updated.
>> * ld-arm/callweak.s: Architecture specified.
>> * ld-arm/callweak-2.d: New test case.
>> * ld-arm/callweak-2.s: New file.
>>
>
> OK
>
Sorry, I forgot to include a change to arm-elf.exp in order to run the
new test case:
Modified: csl/binutils/trunk/ld/testsuite/ld-arm/arm-elf.exp
==============================================================================
--- csl/binutils/trunk/ld/testsuite/ld-arm/arm-elf.exp (original)
+++ csl/binutils/trunk/ld/testsuite/ld-arm/arm-elf.exp Wed Aug 12
10:08:31 2009
@@ -232,6 +232,9 @@
{"callweak" "-static -T arm.ld" "" {callweak.s}
{{objdump -dr callweak.d}}
"callweak"}
+ {"callweak-2" "-static -T arm.ld" "" {callweak-2.s}
+ {{objdump -dr callweak-2.d}}
+ "callweak-2"}
}
Please confirm if OK to commit, and sorry for the inconveniences.
Daniel.
--
Daniel Gutson
CodeSourcery
www.codesourcery.com
More information about the Binutils
mailing list