[llvm] r212374 - [llvm-readobj] Fix output of MIPS GOT without local and global entries.
Simon Atanasyan
simon at atanasyan.com
Sat Jul 5 12:28:50 PDT 2014
Author: atanasyan
Date: Sat Jul 5 14:28:49 2014
New Revision: 212374
URL: http://llvm.org/viewvc/llvm-project?rev=212374&view=rev
Log:
[llvm-readobj] Fix output of MIPS GOT without local and global entries.
Added:
llvm/trunk/test/tools/llvm-readobj/Inputs/got-empty.exe.mipsel (with props)
Modified:
llvm/trunk/test/tools/llvm-readobj/mips-got.test
llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
Added: llvm/trunk/test/tools/llvm-readobj/Inputs/got-empty.exe.mipsel
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/Inputs/got-empty.exe.mipsel?rev=212374&view=auto
==============================================================================
Binary files llvm/trunk/test/tools/llvm-readobj/Inputs/got-empty.exe.mipsel (added) and llvm/trunk/test/tools/llvm-readobj/Inputs/got-empty.exe.mipsel Sat Jul 5 14:28:49 2014 differ
Propchange: llvm/trunk/test/tools/llvm-readobj/Inputs/got-empty.exe.mipsel
------------------------------------------------------------------------------
svn:executable = *
Modified: llvm/trunk/test/tools/llvm-readobj/mips-got.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/mips-got.test?rev=212374&r1=212373&r2=212374&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/mips-got.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/mips-got.test Sat Jul 5 14:28:49 2014
@@ -6,6 +6,8 @@ RUN: llvm-readobj -mips-plt-got %p/Input
RUN: FileCheck %s -check-prefix GOT-SO
RUN: llvm-readobj -mips-plt-got %p/Inputs/got-tls.so.elf-mips64el | \
RUN: FileCheck %s -check-prefix GOT-TLS
+RUN: llvm-readobj -mips-plt-got %p/Inputs/got-empty.exe.mipsel | \
+RUN: FileCheck %s -check-prefix GOT-EMPTY
GOT-OBJ: Cannot find PLTGOT dynamic table tag.
@@ -304,3 +306,26 @@ GOT-TLS-NEXT: }
GOT-TLS-NEXT: ]
GOT-TLS-NEXT: Number of TLS and multi-GOT entries: 4
GOT-TLS-NEXT: }
+
+GOT-EMPTY: Primary GOT {
+GOT-EMPTY-NEXT: Canonical gp value: 0x409FF0
+GOT-EMPTY-NEXT: Reserved entries [
+GOT-EMPTY-NEXT: Entry {
+GOT-EMPTY-NEXT: Address: 0x402000
+GOT-EMPTY-NEXT: Access: -32752
+GOT-EMPTY-NEXT: Initial: 0x0
+GOT-EMPTY-NEXT: Purpose: Lazy resolver
+GOT-EMPTY-NEXT: }
+GOT-EMPTY-NEXT: Entry {
+GOT-EMPTY-NEXT: Address: 0x402004
+GOT-EMPTY-NEXT: Access: -32748
+GOT-EMPTY-NEXT: Initial: 0x80000000
+GOT-EMPTY-NEXT: Purpose: Module pointer (GNU extension)
+GOT-EMPTY-NEXT: }
+GOT-EMPTY-NEXT: ]
+GOT-EMPTY-NEXT: Local entries [
+GOT-EMPTY-NEXT: ]
+GOT-EMPTY-NEXT: Global entries [
+GOT-EMPTY-NEXT: ]
+GOT-EMPTY-NEXT: Number of TLS and multi-GOT entries: 2
+GOT-EMPTY-NEXT: }
Modified: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ELFDumper.cpp?rev=212374&r1=212373&r2=212374&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp Sat Jul 5 14:28:49 2014
@@ -1087,7 +1087,7 @@ void MipsGOTParser<ELFT>::parseGOT(const
Elf_Sym_Iter DynSymEnd = Obj->end_dynamic_symbols();
std::size_t DynSymTotal = std::size_t(std::distance(DynSymBegin, DynSymEnd));
- if (DtGotSym + 1 > DynSymTotal) {
+ if (DtGotSym > DynSymTotal) {
W.startLine() << "MIPS_GOTSYM exceeds a number of dynamic symbols.\n";
return;
}
More information about the llvm-commits
mailing list