[PATCH] D63768: [ELF] Don't create Undefined for discarded .debug* sections

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 25 07:07:23 PDT 2019


MaskRay created this revision.
MaskRay added a reviewer: hans.
Herald added subscribers: llvm-commits, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

A hypothetical work around of
https://bugs.chromium.org/p/chromium/issues/detail?id=978067


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D63768

Files:
  ELF/InputFiles.cpp


Index: ELF/InputFiles.cpp
===================================================================
--- ELF/InputFiles.cpp
+++ ELF/InputFiles.cpp
@@ -1080,7 +1080,8 @@
 
       if (ESym.st_shndx == SHN_UNDEF)
         this->Symbols[I] = make<Undefined>(this, Name, Binding, StOther, Type);
-      else if (Sec == &InputSection::Discarded)
+      else if (Sec == &InputSection::Discarded &&
+               !Sec->Name.startswith(".debug"))
         this->Symbols[I] = make<Undefined>(this, Name, Binding, StOther, Type,
                                            /*DiscardedSecIdx=*/SecIdx);
       else


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63768.206438.patch
Type: text/x-patch
Size: 598 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190625/5b2f5531/attachment.bin>


More information about the llvm-commits mailing list