[llvm] r373587 - [llvm-readobj][mips] Do not show an error if GOT is missed
Simon Atanasyan via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 3 05:06:56 PDT 2019
Author: atanasyan
Date: Thu Oct 3 05:06:56 2019
New Revision: 373587
URL: http://llvm.org/viewvc/llvm-project?rev=373587&view=rev
Log:
[llvm-readobj][mips] Do not show an error if GOT is missed
It is not an error if a file does not contain GOT.
Modified:
llvm/trunk/test/tools/llvm-readobj/mips-got.test
llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
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=373587&r1=373586&r2=373587&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/mips-got.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/mips-got.test Thu Oct 3 05:06:56 2019
@@ -1,5 +1,3 @@
-RUN: not llvm-readobj --mips-plt-got %p/Inputs/relocs.obj.elf-mips 2>&1 | \
-RUN: FileCheck %s -DFILE=%p/Inputs/relocs.obj.elf-mips -check-prefix GOT-OBJ
RUN: llvm-readobj --mips-plt-got %p/Inputs/dynamic-table-exe.mips | \
RUN: FileCheck %s -check-prefix GOT-EXE
RUN: llvm-readobj --mips-plt-got %p/Inputs/dynamic-table-so.mips | \
@@ -11,8 +9,6 @@ RUN: FileCheck %s -check-prefix GOT-EM
RUN: llvm-readobj --mips-plt-got %p/Inputs/got-static.exe.mips | \
RUN: FileCheck %s -check-prefix GOT-STATIC
-RUN: not llvm-readelf --mips-plt-got %p/Inputs/relocs.obj.elf-mips 2>&1 | \
-RUN: FileCheck %s -DFILE=%p/Inputs/relocs.obj.elf-mips -check-prefix GNU-GOT-OBJ
RUN: llvm-readelf --mips-plt-got %p/Inputs/dynamic-table-exe.mips | \
RUN: FileCheck %s --strict-whitespace -check-prefix GNU-GOT-EXE
RUN: llvm-readelf --mips-plt-got %p/Inputs/dynamic-table-so.mips | \
@@ -24,8 +20,6 @@ RUN: FileCheck %s --strict-whitespace
RUN: llvm-readelf --mips-plt-got %p/Inputs/got-static.exe.mips | \
RUN: FileCheck %s --strict-whitespace -check-prefix GNU-GOT-STATIC
-GOT-OBJ: error: '[[FILE]]': Cannot find .got section
-
GOT-EXE: Primary GOT {
GOT-EXE-NEXT: Canonical gp value: 0x418880
GOT-EXE-NEXT: Reserved entries [
@@ -380,8 +374,6 @@ GOT-STATIC-NEXT: }
GOT-STATIC-NEXT: ]
GOT-STATIC-NEXT: }
-GNU-GOT-OBJ: error: '[[FILE]]': Cannot find .got section
-
GNU-GOT-EXE: Primary GOT:
GNU-GOT-EXE-NEXT: Canonical gp value: 00418880
Modified: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ELFDumper.cpp?rev=373587&r1=373586&r2=373587&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp Thu Oct 3 05:06:56 2019
@@ -2315,7 +2315,7 @@ MipsGOTParser<ELFT>::MipsGOTParser(const
if (IsStatic) {
GotSec = findSectionByName(*Obj, FileName, ".got");
if (!GotSec)
- reportError(createError("Cannot find .got section"), FileName);
+ return;
ArrayRef<uint8_t> Content =
unwrapOrError(FileName, Obj->getSectionContents(GotSec));
More information about the llvm-commits
mailing list