[PATCH] PR ld/19636: [x86] Resolve undefweak and defined symbols in executable

H.J. Lu hjl.tools@gmail.com
Thu Feb 25 18:59:00 GMT 2016
Here is the updated patch I am testing.  The linker behavior is changed
in 2 cases when creating executable:

1. When there are mixed PIC and non-PIC references to undefined
weak symbols, undefined weak symbols are resolved to 0 at link-time.
2. If all references to undefined weak symbols are PIC, dynamic
relocations against undefined weak symbols will be generated unless
-z nodynamic-undefined-weak is passed to linker.

BTW,  We have to resolve R_X86_64_32/R_X86_64_PC32 relocations
against undefined weak symbols to zero.  Otherwise, we will get run-time
relocation overflow for dynamic R_X86_64_32/R_X86_64_PC32 relocations.

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-x86-Resolve-non-PIC-undefweak-symbols-in-executable.patch
Type: text/x-patch
Size: 123562 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20160225/6806b2cf/attachment.bin>


More information about the Binutils mailing list