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: PR gold/16945: Executable with -fpie and -mcmodel=large gives segfault on start


> I just don't get why got_offset sometimes "unsigned int", sometimes
> "section_offset_type" and now "int". I guess it's just a little mess.
> I believe that the right way is having it as "ptrdiff", which is the
> same "section_offset_type".

Symbol::got_offset() returns an unsigned int, since it's always a
non-negative offset from the beginning of the section. In
Target_xxx::Relocate::relocate(), we change it to be a negative offset
from the end of the section, so it really should be signed at that
point. Whether we use int or section_offset_type or ptrdiff_t is, I
think, a minor point. Without modifying the type throughout, we can't
handle a GOT offset larger than an int anyway, so I think int is fine
here.

-cary


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