Change how we apply relocations.
Audit RequiredrL266158

Description

Change how we apply relocations.

With this patch we use the first scan over the relocations to remember
the information we found about them: will them be relaxed, will a plt be
used, etc.

With that the actual relocation application becomes much simpler. That
is particularly true for the interfaces in Target.h.

This unfortunately means that we now do two passes over relocations for
non SHF_ALLOC sections. I think this can be solved by factoring out the
code that scans a single relocation. It can then be used both as a scan
that record info and for a dedicated direct relocation of non SHF_ALLOC
sections.

I also think it is possible to reduce the number of enum values by
representing a target with just an OutputSection and an offset (which
can be from the start or end).

This should unblock adding features like relocation optimizations.

Details

Auditors
Bigcheese
Committed
rafaelApr 12 2016, 6:40 PM
Parents
rL266157: [analyzer] Nullability: Treat nil _Nonnull ivar as invariant violation.
Branches
Unknown
Tags
Unknown
grimar added a subscriber: grimar.Apr 14 2016, 9:31 AM
grimar added inline comments.
/lld/trunk/ELF/Target.cpp
708

I think R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX should be here either.

grimar added inline comments.Apr 14 2016, 9:35 AM
/lld/trunk/ELF/Target.cpp
708

Commented at wrong review page, sorry.