[PATCH] D42797: [LLD][ELF] Implement --[no-]apply-dynamic-relocs option.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 12:32:33 PST 2018


ruiu added inline comments.


================
Comment at: ELF/Options.td:52
+def apply_dynamic_relocs: F<"apply-dynamic-relocs">,
+  HelpText<"Apply dynamic relocations to place.">;
+
----------------
Remove the full stop.


================
Comment at: ELF/Options.td:179
+def no_apply_dynamic_relocs: F<"no-apply-dynamic-relocs">,
+  HelpText<"Do not apply dynamic relocations to place.">;
+
----------------
Ditto


================
Comment at: ELF/SyntheticSections.cpp:1210-1214
   // REL type relocations don't have addend fields unlike RELAs, and
   // their addends are stored to the section to which they are applied.
-  // So, store addends if we need to.
-  if (!Config->IsRela && UseSymVA)
+  // In theory we do not need to write addends for RELAs however some system
+  // software like dynamic linkers can use this information prior to relocation.
+  // The --[no-]apply-dynamic-relocations flag.
----------------
Can you rewrite entire comment to say that we basically store addends both to RELA relocations and to the locations where the relocations are applied, even though it is redundant, because that's what GNU linkers do, and some dynamic linkers such as Bionic's depend on it.


https://reviews.llvm.org/D42797





More information about the llvm-commits mailing list