This is an archive of the discontinued LLVM Phabricator instance.

Don't make _gp absolute
ClosedPublic

Authored by rafael on Sep 12 2017, 9:59 AM.

Details

Reviewers
atanasyan
Summary

_gp points to a position in the file, so it is not really absolute. It is also simpler to not force it to be absolute, so if there is no strong ABI requirement we should not do it.

Diff Detail

Event Timeline

rafael created this revision.Sep 12 2017, 9:59 AM
atanasyan edited edge metadata.Sep 12 2017, 2:45 PM

Is it still possible to assign _gp an arbitrary value using a linker script? For example, point into the middle of .sdata section?

grimar added a subscriber: grimar.Sep 13 2017, 12:38 AM
atanasyan accepted this revision.Sep 14 2017, 6:44 AM

Is it still possible to assign _gp an arbitrary value using a linker script? For example, point into the middle of .sdata section?

test/ELF/mips-gp-ext.s tests that, no?

You are right. The patch is LGTM.

This revision is now accepted and ready to land.Sep 14 2017, 6:44 AM
atanasyan closed this revision.Sep 21 2017, 6:58 AM

Closed by commit rL313333.