[PATCH] D48247: lld: add experimental support for SHT_RELR sections.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 29 16:17:44 PDT 2018


pcc added a comment.

Thanks, this is closer to what I had in mind. But I was imagining that `addRelativeReloc` would be a free function so that you can move the rest of the logic into it. I wrote a patch on top of yours with what I had in mind and attached it to the review. I also made a number of smaller changes as well. F6531889: 0001-Changes.patch <https://reviews.llvm.org/F6531889>



================
Comment at: ELF/Driver.cpp:883
+      Config->RelrPackDynRelocs = true;
+      Config->UseAndroidRelrTags = true;
+    } else if (S == "none") {
----------------
I was imagining that `--use-android-relr-tags` would be orthogonal to `--pack-dyn-relocs=android+relr`, so that you get the standard relr tags unless the user specifically asks otherwise.


================
Comment at: ELF/Driver.cpp:884-887
+    } else if (S == "none") {
+      Config->AndroidPackDynRelocs = false;
+      Config->RelrPackDynRelocs = false;
+    } else {
----------------
You don't need this part because the flags are initialized to false.


================
Comment at: ELF/SyntheticSections.cpp:1500
+  // is the case, just use 0 as the link.
+  Link = InX::DynSymTab ? InX::DynSymTab->getParent()->SectionIndex : 0;
+
----------------
As the comment says there is no need for a link if all relocations are relative. In my patch I just removed this function.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D48247





More information about the llvm-commits mailing list