This is the mail archive of the binutils@sourceware.org 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: Fix gold problem with weak undefined symbols


>  > Yep, that appears to be what GNU ld does -- the test case passes for
>  > GNU ld, and I see no dynamic relocation for the weak undef symbol. It
>  > was surprising to me, too, which is why gold didn't do this
>  > originally.
>
>  I think I recall a conversation between Alan and H.J. a month or two
>  ago, in which this was classified as a bug.  Might want to ask them.

I think it needs to be this way. Imagine the can of worms that you'd
open up if you allow weak undefs to be dynamically bound. If the
reference is from non-PIC code, you'd need to generate a COPY
relocation without knowing anything about the definition -- and what
would the dynamic loader do with an unresolved COPY relocation?

Besides all that, I've already seen a couple of cases here that rely
on this behavior. I wouldn't be surprised to find a lot more in the
wild.

Anyone know what Sun does? (I know HP doesn't support weak undefs at all.)

-cary


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