[PATCH] D83264: [ELF] Add -z dead-reloc-in-nonalloc=<section_glob>=<value>

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 7 02:09:01 PDT 2020


psmith added a comment.

I think an option makes sense. I have a small reservation about making users order their matches on the command line. We should make it more explicit in the help and the manual, or try and sort the matches using a heuristic order of specificity, for example no wildcards is more specific than wildcards, longer text is more specific than shorter. Other than that I think it looks OK.



================
Comment at: lld/ELF/Options.td:127
 
+defm dead_nonalloc_reloc_value : EEq<"dead-nonalloc-reloc-value",
+  "Resolve a relocation from a matched non-SHF_ALLOC section to a discarded "
----------------
I think it will be worth mentioning that the there can be multiple occurrences and that the last takes precedence.
"Resolve a relocation from a matched non-SHF_ALLOC section to a discarded symbol to the specified value. Accepts wildcards, in the event of a section matching more than one instance of this option, the last instance on the command-line takes precedence."


================
Comment at: lld/docs/ld.lld.1:626
 .Pp
+.It Cm dead-reloc-in-nonalloc Ns = Ns Ar section_glob=value
+Resolve a relocation in a matched non-SHF_ALLOC section referencing a discarded symbol to
----------------
Similar to the comment above. Although as the man-page we can elaborate a bit.
"Resolve a relocation from a matched non-SHF_ALLOC section to a discarded symbol to the specified value. Accepts wildcards, in the event of a section matching more than one instance of this option, the last instance on the command-line takes precedence. An order of least specific
to most specific match is recommended."


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83264/new/

https://reviews.llvm.org/D83264





More information about the llvm-commits mailing list