[PATCH] PR ld/19636: [x86] Resolve undefweak and defined symbols in executable
H.J. Lu
hjl.tools@gmail.com
Wed Feb 24 14:47:00 GMT 2016
More information about the Binutils mailing list
Wed Feb 24 14:47:00 GMT 2016
- Previous message (by thread): [PATCH] PR ld/19636: [x86] Resolve undefweak and defined symbols in executable
- Next message (by thread): [PATCH] PR ld/19636: [x86] Resolve undefweak and defined symbols in executable
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, Feb 24, 2016 at 6:45 AM, Michael Matz <matz@suse.de> wrote: > Hi, > > On Tue, 23 Feb 2016, H.J. Lu wrote: > >> For i386 and x86-64, undefined weak and defined symbols are resolved >> without dynamic relocation when creating executable. Undefined weak >> symbols aren't needed in the dynamic symbol table in executable. One >> exception is on i386, we need undefined weak symbols in the dynamic >> symbol table in PIE if input relocatable files contain branchs without >> PLT so that we can branch to 0 with dynamic relocation in text section. > > Um, wait. Have you now changed it so that this program won't work anymore > (no matter if PIC or non-PIC)?: It never worked correctly: https://sourceware.org/bugzilla/show_bug.cgi?id=19719 > extern void undef() __attribute__((weak)); > int main() > { > if (undef) > undef (); > return 0; > } > >> This makes behaviors of static excutable, dynamic excutable and position >> independent executable consistent with references to undefined weak and >> defined symbols, regardless if the relocatable input is compiled with >> PIC or not. > > Because, while consistence is good, it's more important that the above > program keeps working (and if only under PIC). > I will add -z dynamic-undefined-weak Treat undefined weak symbol as dynamic to enable the old behavior. -- H.J.
- Previous message (by thread): [PATCH] PR ld/19636: [x86] Resolve undefweak and defined symbols in executable
- Next message (by thread): [PATCH] PR ld/19636: [x86] Resolve undefweak and defined symbols in executable
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list