This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

On Tue, Feb 23, 2016 at 09:58:14AM -0800, 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.
> 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.

People know that PIC and non-PIC are different on x86 and many other
architectures.  For example, a quick google search turns up

"On Linux systems, this just works. Compile the program (youâll need
to build it with -fPIC, though)..."

I've seen other references to this feature, which you will break with
your patch.  Quite frankly, if this is new to you, as you say in then you
should not be rushing so quickly into this change.

Alan Modra
Australia Development Lab, IBM

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]