[PATCH] D116946: [ELF] Use tombstone values for discarded symbols in relocatable output

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 11 09:24:24 PST 2022


MaskRay added a comment.

Sacrificing the performance for -r seems fine.



================
Comment at: lld/ELF/InputSection.cpp:1001
+  if (config->relocatable)
     relocateNonAllocForRelocatable(sec, buf);
+
----------------
This needs a comment with something like: for a relocatable link, call relocateNonAlloc to rewrite applicable locations with the tombstone value.


================
Comment at: lld/test/ELF/debug-dead-reloc-relocatable.s:7
+# RUN: ld.lld -r %t1.o %t1.o -o %t2.o
+# RUN: llvm-objdump -r -s %t2.o | FileCheck %s
+
----------------
Super nit: llvm-readelf -r -x .debug_ranges  or llvm-objdump -r -s -j .debug_ranges


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

https://reviews.llvm.org/D116946



More information about the llvm-commits mailing list