[lld] r177875 - [ELF] fix dynamic symbol table entries and update tests

Shankar Easwaran shankare at codeaurora.org
Mon Mar 25 09:41:15 PDT 2013


Author: shankare
Date: Mon Mar 25 11:41:14 2013
New Revision: 177875

URL: http://llvm.org/viewvc/llvm-project?rev=177875&view=rev
Log:
[ELF] fix dynamic symbol table entries and update tests

Modified:
    lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h
    lld/trunk/test/elf/Hexagon/dynlib.test
    lld/trunk/test/elf/sections.objtxt

Modified: lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h?rev=177875&r1=177874&r2=177875&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h Mon Mar 25 11:41:14 2013
@@ -248,21 +248,23 @@ template <class ELFT>
 error_code OutputELFWriter<ELFT>::buildOutput(const File &file) {
   buildChunks(file);
 
-  // Call the preFlight callbacks to modify the sections and the atoms
-  // contained in them, in anyway the targets may want
-  _layout->doPreFlight();
-
   // Create the default sections like the symbol table, string table, and the
   // section string table
   createDefaultSections();
 
+  // Set the Layout
+  _layout->assignSectionsToSegments();
+
+  // Create the dynamic table entries
   if (_targetInfo.isDynamic()) {
     _dynamicTable->createDefaultEntries();
     buildDynamicSymbolTable(file);
   }
 
-  // Set the Layout
-  _layout->assignSectionsToSegments();
+  // Call the preFlight callbacks to modify the sections and the atoms
+  // contained in them, in anyway the targets may want
+  _layout->doPreFlight();
+
   _layout->assignFileOffsets();
   _layout->assignVirtualAddress();
 

Modified: lld/trunk/test/elf/Hexagon/dynlib.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Hexagon/dynlib.test?rev=177875&r1=177874&r2=177875&view=diff
==============================================================================
--- lld/trunk/test/elf/Hexagon/dynlib.test (original)
+++ lld/trunk/test/elf/Hexagon/dynlib.test Mon Mar 25 11:41:14 2013
@@ -4,8 +4,8 @@ RUN: llvm-readobj %t1 > %t2
 RUN: FileCheck -check-prefix=DYNSYMS %s < %t2
 
 DYNSYMS: Dynamic Symbols:
-DYNSYMS: Name Type Address Size FileOffset Flags                     
-DYNSYMS: fn2 FUNC {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global
-DYNSYMS: fn1 FUNC {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global
-DYNSYMS: fn3 FUNC {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global
+DYNSYMS: Name Type Section Address Size FileOffset Flags                     
+DYNSYMS: fn2 FUNC .text {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global
+DYNSYMS: fn1 FUNC .text {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global
+DYNSYMS: fn3 FUNC .text {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global
 DYNSYMS: Total: 3

Modified: lld/trunk/test/elf/sections.objtxt
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/sections.objtxt?rev=177875&r1=177874&r2=177875&view=diff
==============================================================================
--- lld/trunk/test/elf/sections.objtxt (original)
+++ lld/trunk/test/elf/sections.objtxt Mon Mar 25 11:41:14 2013
@@ -17,8 +17,8 @@ READOBJ: File Format : ELF32-i386
 READOBJ: Arch        : i386
 READOBJ: Address Size: 32 bits
 READOBJ: Symbols
-READOBJ: baz FUNC   74 a   e8 global
-READOBJ: y   DATA 1004 4 2008 global
+READOBJ: baz FUNC .text   74 a   e8 global
+READOBJ: y   DATA .special 1004 4 2008 global
 
 ED: 'e_indent[EI_DATA]', 0x01
 ED: 'e_machine', 0x0003





More information about the llvm-commits mailing list