gold linker manual describes them as:
-z text Do not permit relocations in read-only segments
-z notext Permit relocations in read-only segments (default)
In LLD default is to not permit them. Patch implements -z notext.
Paths
| Differential D30530
[ELF] - Implemented -znotext ClosedPublic Authored by grimar on Mar 2 2017, 2:52 AM.
Details Summary gold linker manual describes them as: -z text Do not permit relocations in read-only segments In LLD default is to not permit them. Patch implements -z notext.
Diff Detail Event TimelineComment Actions
Linux kernel uses text relocations when KASLR (Kernel address space layout randomization) is enabled. Comment Actions
No, we have no way not to fail with text relocations now. grimar added a parent revision: D30570: Option parsing: implement decrement operators for arg_iterator.Mar 3 2017, 5:38 AM grimar added inline comments. grimar removed a parent revision: D30570: Option parsing: implement decrement operators for arg_iterator.Mar 6 2017, 2:55 AM grimar added inline comments.
grimar retitled this revision from [ELF] - Implemented -z text/-znotext to [ELF] - Implemented -znotext. Comment Actions
This revision is now accepted and ready to land.Mar 7 2017, 9:47 AM Closed by commit rL297366: [ELF] - Implemented -znotext (authored by grimar). · Explain WhyMar 9 2017, 1:00 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 90305 ELF/Config.h
ELF/Driver.cpp
ELF/Relocations.cpp
ELF/SyntheticSections.cpp
test/ELF/ztext-text-notext.s
|
This can be reused, for example for "relro" vs "norelro", "execstack" vs "noexecstack" etc.