From: Hemant Kulkarni Date: Tue, 30 Aug 2016 19:50:02 +0000 (+0000) Subject: ELFDumper: Unversioned symbols must not have trailing @ X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b2081648b2364db17042a6e8e399f663ea8cdcb7;p=platform%2Fupstream%2Fllvm.git ELFDumper: Unversioned symbols must not have trailing @ llvm-svn: 280140 --- diff --git a/llvm/test/tools/llvm-readobj/elf-versioninfo.test b/llvm/test/tools/llvm-readobj/elf-versioninfo.test index 919120e..618ac79 100644 --- a/llvm/test/tools/llvm-readobj/elf-versioninfo.test +++ b/llvm/test/tools/llvm-readobj/elf-versioninfo.test @@ -14,15 +14,15 @@ CHECK-NEXT: Link: 1 CHECK-NEXT: Symbols [ CHECK-NEXT: Symbol { CHECK-NEXT: Version: 0 -CHECK-NEXT: Name: @ +CHECK-NEXT: Name: CHECK-NEXT: } CHECK-NEXT: Symbol { CHECK-NEXT: Version: 1 -CHECK-NEXT: Name: _end@ +CHECK-NEXT: Name: _end CHECK-NEXT: } CHECK-NEXT: Symbol { CHECK-NEXT: Version: 1 -CHECK-NEXT: Name: _edata@ +CHECK-NEXT: Name: _edata CHECK-NEXT: } CHECK-NEXT: Symbol { CHECK-NEXT: Version: 3 @@ -30,7 +30,7 @@ CHECK-NEXT: Name: goo@@VERSION2 CHECK-NEXT: } CHECK-NEXT: Symbol { CHECK-NEXT: Version: 1 -CHECK-NEXT: Name: __bss_start@ +CHECK-NEXT: Name: __bss_start CHECK-NEXT: } CHECK-NEXT: Symbol { CHECK-NEXT: Version: 2 diff --git a/llvm/test/tools/llvm-readobj/mips-got.test b/llvm/test/tools/llvm-readobj/mips-got.test index 2021587..599be75 100644 --- a/llvm/test/tools/llvm-readobj/mips-got.test +++ b/llvm/test/tools/llvm-readobj/mips-got.test @@ -52,7 +52,7 @@ GOT-EXE-NEXT: Initial: 0x0 GOT-EXE-NEXT: Value: 0x0 GOT-EXE-NEXT: Type: Function (0x2) GOT-EXE-NEXT: Section: Undefined (0x0) -GOT-EXE-NEXT: Name: __gmon_start__@ (1) +GOT-EXE-NEXT: Name: __gmon_start__ (1) GOT-EXE-NEXT: } GOT-EXE-NEXT: ] GOT-EXE-NEXT: Number of TLS and multi-GOT entries: 0 @@ -124,7 +124,7 @@ GOT-SO-NEXT: Initial: 0x0 GOT-SO-NEXT: Value: 0x0 GOT-SO-NEXT: Type: None (0x0) GOT-SO-NEXT: Section: Undefined (0x0) -GOT-SO-NEXT: Name: _ITM_registerTMCloneTable@ (87) +GOT-SO-NEXT: Name: _ITM_registerTMCloneTable (87) GOT-SO-NEXT: } GOT-SO-NEXT: Entry { GOT-SO-NEXT: Address: 0x1090C @@ -133,7 +133,7 @@ GOT-SO-NEXT: Initial: 0x0 GOT-SO-NEXT: Value: 0x0 GOT-SO-NEXT: Type: None (0x0) GOT-SO-NEXT: Section: Undefined (0x0) -GOT-SO-NEXT: Name: _Jv_RegisterClasses@ (128) +GOT-SO-NEXT: Name: _Jv_RegisterClasses (128) GOT-SO-NEXT: } GOT-SO-NEXT: Entry { GOT-SO-NEXT: Address: 0x10910 @@ -142,7 +142,7 @@ GOT-SO-NEXT: Initial: 0x0 GOT-SO-NEXT: Value: 0x0 GOT-SO-NEXT: Type: Function (0x2) GOT-SO-NEXT: Section: Undefined (0x0) -GOT-SO-NEXT: Name: __gmon_start__@ (23) +GOT-SO-NEXT: Name: __gmon_start__ (23) GOT-SO-NEXT: } GOT-SO-NEXT: Entry { GOT-SO-NEXT: Address: 0x10914 @@ -160,7 +160,7 @@ GOT-SO-NEXT: Initial: 0x0 GOT-SO-NEXT: Value: 0x0 GOT-SO-NEXT: Type: None (0x0) GOT-SO-NEXT: Section: Undefined (0x0) -GOT-SO-NEXT: Name: _ITM_deregisterTMCloneTable@ (59) +GOT-SO-NEXT: Name: _ITM_deregisterTMCloneTable (59) GOT-SO-NEXT: } GOT-SO-NEXT: Entry { GOT-SO-NEXT: Address: 0x1091C @@ -256,7 +256,7 @@ GOT-TLS-NEXT: Initial: 0x0 GOT-TLS-NEXT: Value: 0x0 GOT-TLS-NEXT: Type: None (0x0) GOT-TLS-NEXT: Section: Undefined (0x0) -GOT-TLS-NEXT: Name: _ITM_registerTMCloneTable@ (78) +GOT-TLS-NEXT: Name: _ITM_registerTMCloneTable (78) GOT-TLS-NEXT: } GOT-TLS-NEXT: Entry { GOT-TLS-NEXT: Address: 0x10C70 @@ -265,7 +265,7 @@ GOT-TLS-NEXT: Initial: 0x0 GOT-TLS-NEXT: Value: 0x0 GOT-TLS-NEXT: Type: None (0x0) GOT-TLS-NEXT: Section: Undefined (0x0) -GOT-TLS-NEXT: Name: _Jv_RegisterClasses@ (119) +GOT-TLS-NEXT: Name: _Jv_RegisterClasses (119) GOT-TLS-NEXT: } GOT-TLS-NEXT: Entry { GOT-TLS-NEXT: Address: 0x10C78 @@ -274,7 +274,7 @@ GOT-TLS-NEXT: Initial: 0x0 GOT-TLS-NEXT: Value: 0x0 GOT-TLS-NEXT: Type: Function (0x2) GOT-TLS-NEXT: Section: Undefined (0x0) -GOT-TLS-NEXT: Name: __gmon_start__@ (23) +GOT-TLS-NEXT: Name: __gmon_start__ (23) GOT-TLS-NEXT: } GOT-TLS-NEXT: Entry { GOT-TLS-NEXT: Address: 0x10C80 @@ -292,7 +292,7 @@ GOT-TLS-NEXT: Initial: 0x0 GOT-TLS-NEXT: Value: 0x0 GOT-TLS-NEXT: Type: None (0x0) GOT-TLS-NEXT: Section: Undefined (0x0) -GOT-TLS-NEXT: Name: _ITM_deregisterTMCloneTable@ (50) +GOT-TLS-NEXT: Name: _ITM_deregisterTMCloneTable (50) GOT-TLS-NEXT: } GOT-TLS-NEXT: Entry { GOT-TLS-NEXT: Address: 0x10C90 diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp index 7e3394b..5fcf6a0 100644 --- a/llvm/tools/llvm-readobj/ELFDumper.cpp +++ b/llvm/tools/llvm-readobj/ELFDumper.cpp @@ -705,6 +705,9 @@ std::string ELFDumper::getFullSymbolName(const Elf_Sym *Symbol, bool IsDefault; StringRef Version = getSymbolVersion(StrTable, &*Symbol, IsDefault); + // Unversioned symbol must not have any suffix @ + if (!IsDefault && Version == "") + return FullSymbolName; FullSymbolName += (IsDefault ? "@@" : "@"); FullSymbolName += Version; return FullSymbolName;