This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Linkerscript: ignore DATA_SEGMENT_RELRO_END expression
AbandonedPublic

Authored by grimar on Jul 22 2016, 7:05 AM.

Details

Reviewers
ruiu
rafael
Summary

DATA_SEGMENT_RELRO_END expression is used to protect first 3 entries of
.got.plt with relro technologie.
Since we decided not to support this in lld, I also see no reasons to try implement this in LS,
therefore expression is just ignored.

Diff Detail

Event Timeline

grimar updated this revision to Diff 65071.Jul 22 2016, 7:05 AM
grimar retitled this revision from to [ELF] - Linkerscript: ignore DATA_SEGMENT_RELRO_END expression.
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar, evgeny777.
grimar updated this object.Jul 22 2016, 1:21 PM
grimar abandoned this revision.Jul 22 2016, 1:51 PM

I just realized that is not so simple. Even if DATA_SEGMENT_RELRO_END functionality itself mostly can be ignored, it still should do alignment of location counter to page boundaries if -z relro is used I think.

grimar added a subscriber: emaste.Jul 22 2016, 11:49 PM

I think we can support this in a next way:

  1. DATA_SEGMENT_ALIGN is always just ignored.
  2. When -z relro is not present then DATA_SEGMENT_RELRO_END is ignored.
  3. When -z relro is present, DATA_SEGMENT_RELRO_END just aligns the location counter position to the page boundary.

That way we will have the same behavior we have now without the script. Any opinions ?

ruiu edited edge metadata.Jul 23 2016, 4:18 AM

Can you give me a pointer to a real-world use of DATA_SEGMENT_RELRO_END?

davide added a subscriber: davide.Jul 23 2016, 3:19 PM
In D22676#493843, @ruiu wrote:

Can you give me a pointer to a real-world use of DATA_SEGMENT_RELRO_END?

https://svnweb.freebsd.org/base/head/sys/conf/ldscript.amd64?revision=284870&view=markup#l146