This is an archive of the discontinued LLVM Phabricator instance.

ELF: Ignore --long-plt flag.
ClosedPublic

Authored by pcc on Dec 8 2017, 10:34 AM.

Details

Summary

This flag causes bfd and gold to use a longer PLT format on ARM that
allows for the offset between the PLT and the GOT to exceed 256MB.
It seems unlikely that we would need to implement long PLTs because
by default we lay out .plt at the end of the executable segment (as
opposed to the other linkers, which lay it out at the beginning),
which means that the size of the non-relro part of the r/w segment
would need to exceed 256MB before a long PLT becomes necessary.

Even if we did implement long PLTs, I think it should be done by
recalculating the size of .plt as part of our convergent address
assignment loop, rather than requiring the user to request a long
PLT explicitly.

In any event, we would end up ignoring the flag, so this patch does so.

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

pcc created this revision.Dec 8 2017, 10:34 AM

LLD actually doesn't need --long-plt because its PLT entries already always use the long format. See https://bugs.llvm.org/show_bug.cgi?id=34734#c2

ruiu accepted this revision.Dec 8 2017, 11:27 AM

LGTM

This revision is now accepted and ready to land.Dec 8 2017, 11:27 AM
pcc added a comment.Dec 8 2017, 11:36 AM

LLD actually doesn't need --long-plt because its PLT entries already always use the long format. See https://bugs.llvm.org/show_bug.cgi?id=34734#c2

I see, thanks. I will reword the commit message.

This revision was automatically updated to reflect the committed changes.