This is an archive of the discontinued LLVM Phabricator instance.

[ELF2] Remove target specific code from GotPltSection.
ClosedPublic

Authored by ikudrin on Nov 16 2015, 6:57 AM.

Details

Summary

The content of reserved entries of the .got.plt section is target specific.

In particular, on x86_64, the zero entry holds the address of the .dynamic section,
but on AArch64 the same info is stored in the zero entry of the .got section.

Diff Detail

Repository
rL LLVM

Event Timeline

ikudrin updated this revision to Diff 40282.Nov 16 2015, 6:57 AM
ikudrin retitled this revision from to [ELF2] Remove target specific code from GotPltSection..
ikudrin updated this object.
ikudrin added reviewers: ruiu, rafael, grimar.
ikudrin added a project: lld.
ikudrin added a subscriber: llvm-commits.
grimar edited edge metadata.Nov 16 2015, 9:03 AM

Patch looks fine for my eye, but have a question:
Did you find out why AArch64 requires 3 reserved entries then ? What is zero got.plt entry for ?

ruiu accepted this revision.Nov 16 2015, 9:09 AM
ruiu edited edge metadata.

LGTM

ELF/Target.h
91 ↗(On Diff #40282)

Remove comment.

This revision is now accepted and ready to land.Nov 16 2015, 9:09 AM

Patch looks fine for my eye, but have a question:
Did you find out why AArch64 requires 3 reserved entries then ? What is zero got.plt entry for ?

I haven't done a deep investigation, but at least gold has the following comment in its aarch64.cc:

// Layout of .got and .got.plt sections.
// .got[0] &_DYNAMIC                          <-_GLOBAL_OFFSET_TABLE_
// ...
// .gotplt[0] reserved for ld.so (&linkmap)   <--DT_PLTGOT
// .gotplt[1] reserved for ld.so (resolver)
// .gotplt[2] reserved
grimar accepted this revision.Nov 16 2015, 9:24 AM
grimar edited edge metadata.

Ok then.

This revision was automatically updated to reflect the committed changes.