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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 13 09:19:49 PST 2020


MaskRay marked an inline comment as done.
MaskRay added inline comments.


================
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
----------------
grimar wrote:
> 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.
My clang D61689 was reverted. I think our internal toolchain is still not ready (`-no-integrated-as` uses an old GNU as). I will try fixing the remaining issues so that our internal toolchain will not block `.zdebug` removal. I will start a llvm-dev notification when I want to delete `.zdebug` input support.

Regarding `.gnu.linkonce*`: I also want to delete them. I left a comment on https://sourceware.org/bugzilla/show_bug.cgi?id=20543 half a year ago.


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