[lld] r178466 - [ELF] Set the symbol type for undefined atoms properly

Shankar Easwaran shankare at codeaurora.org
Mon Apr 1 08:12:54 PDT 2013


Author: shankare
Date: Mon Apr  1 10:12:54 2013
New Revision: 178466

URL: http://llvm.org/viewvc/llvm-project?rev=178466&view=rev
Log:
[ELF] Set the symbol type for undefined atoms properly

Modified:
    lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h
    lld/trunk/test/elf/entry.objtxt
    lld/trunk/test/elf/symbols.objtxt

Modified: lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h?rev=178466&r1=178465&r2=178466&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h Mon Apr  1 10:12:54 2013
@@ -748,7 +748,10 @@ void SymbolTable<ELFT>::addUndefinedAtom
   unsigned char binding = 0, type = 0;
   sym.st_value = 0;
   type = llvm::ELF::STT_NOTYPE;
-  binding = llvm::ELF::STB_WEAK;
+  if (ua->canBeNull())
+    binding = llvm::ELF::STB_WEAK;
+  else
+    binding = llvm::ELF::STB_GLOBAL;
   sym.setBindingAndType(binding, type);
 }
 

Modified: lld/trunk/test/elf/entry.objtxt
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/entry.objtxt?rev=178466&r1=178465&r2=178466&view=diff
==============================================================================
--- lld/trunk/test/elf/entry.objtxt (original)
+++ lld/trunk/test/elf/entry.objtxt Mon Apr  1 10:12:54 2013
@@ -14,7 +14,7 @@
 # CHECK:  00000080 T main
 # CHECK:  00001000 A _end
 # CHECK:  00001000 A end
-# CHECK:           w _entrypoint
+# CHECK:           U _entrypoint
 
 defined-atoms:   
   - name:            .text

Modified: lld/trunk/test/elf/symbols.objtxt
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/symbols.objtxt?rev=178466&r1=178465&r2=178466&view=diff
==============================================================================
--- lld/trunk/test/elf/symbols.objtxt (original)
+++ lld/trunk/test/elf/symbols.objtxt Mon Apr  1 10:12:54 2013
@@ -24,4 +24,4 @@ CHECKSYMS:  00001000 B a
 CHECKSYMS:  00001004 A __bss_end
 CHECKSYMS:  00001004 A _end
 CHECKSYMS:  00001004 A end
-CHECKSYMS:           w _start
+CHECKSYMS:           U _start





More information about the llvm-commits mailing list