[ELF] fix dynamic symbol table entries and update tests

llvm-svn: 177875
This commit is contained in:
Shankar Easwaran 2013-03-25 16:41:14 +00:00
parent ace9c5dfaf
commit aec2165123
3 changed files with 14 additions and 12 deletions

View File

@ -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();

View File

@ -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

View File

@ -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