[PATCH] D74510: [ELF] Fix a null pointer dereference when --emit-relocs and --strip-debug are used together

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 13 00:23:34 PST 2020


grimar accepted this revision.
grimar added a comment.

LGTM.



================
Comment at: lld/test/ELF/emit-relocs-debug.s:3
+## Test --emit-relocs handles .debug*
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
----------------
MaskRay wrote:
> I'm a bit reluctant to add another test for the obsoleted feature .zdebug*
> 
We support it though. I have no strong opinion on this as I do not know if it is used in the wild.
Covering all the features can be good when collecting the code coverage. I had experiments
with it before: http://lists.llvm.org/pipermail/llvm-dev/2018-April/122782.html

May be we might think about reporting an error if an object has `.zdebug` and see if people will complain?
We have some places in the linker where we had to introduce some sort of temporary hacks.
E.g:

>   // The linkonce feature is a sort of proto-comdat. Some glibc i386 object
>   // files contain definitions of symbol "__x86.get_pc_thunk.bx" in linkonce
>   // sections. Drop those sections to avoid duplicate symbol errors.
>   // FIXME: This is glibc PR20543, we should remove this hack once that has been
>   // fixed for a while.
>   if (name == ".gnu.linkonce.t.__x86.get_pc_thunk.bx" ||
>       name == ".gnu.linkonce.t.__i686.get_pc_thunk.bx")
>     return &InputSection::discarded;
> 

I guess one day we might want to start removing such things. Perhaps `.zdebug` is a good candidate
for one of the next LLD releases.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74510





More information about the llvm-commits mailing list