[Patch, microblaze, gas] Don't emit reloc for weak symbols

David Holsgrove david.holsgrove@xilinx.com
Wed Oct 24 13:24:00 GMT 2012


Resolves PR gas 14640 - check for weak symbols before emitting relocation

http://sourceware.org/bugzilla/show_bug.cgi?id=14640

Based on original patch by Vasanth Asokan in Xilinx, resolves situation
where gas will generate a jump based on a weak definition, which then
potentially falls outside the jump range if overridden by a strong
definition.

Resultant error resembled;

relocation truncated to fit: R_MICROBLAZE_32_PCREL_LO against symbol
`test_start' defined in .testsection section in reloc_strongsym.o

Add microblaze to gas/testsuite, and include a reloc.exp test for
this bug.


binutils/gas/Changelog

 2012-10-24  David Holsgrove  <david.holsgrove@xilinx.com>

          * config/tc-microblaze.c: Check for weak symbols before
            emitting relocation.

binutils/gas/testsuite/Changelog

 2012-10-24  David Holsgrove  <david.holsgrove@xilinx.com>

          * testsuite/gas/microblaze: New.
          * testsuite/gas/microblaze/reloc_sym.exp: Add test case.
          * testsuite/gas/microblaze/reloc_strongsym.s: Likewise.
          * testsuite/gas/microblaze/reloc_weaksym.s: Likewise.
          * testsuite/gas/microblaze/reloc_sym.d: Likewise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-PR-gas-14640-config-tc-microblaze.c-md_estimate_size.patch
Type: application/octet-stream
Size: 7175 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20121024/bdebc4f4/attachment.obj>


More information about the Binutils mailing list