Author: Georgii Rymar Date: 2020-12-02T13:09:47+03:00 New Revision: 1daace3fbb307d09ef8445bede5559143da1712d
URL: https://github.com/llvm/llvm-project/commit/1daace3fbb307d09ef8445bede5559143da1712d DIFF: https://github.com/llvm/llvm-project/commit/1daace3fbb307d09ef8445bede5559143da1712d.diff LOG: [llvm-readelf/obj] - Lowercase the warning message reported. Our warnings/errors reported are using lowercase normally. This addresses one of review comments from D92382. Added: Modified: llvm/test/Object/invalid.test llvm/test/tools/llvm-readobj/ELF/dyn-symbols.test llvm/test/tools/llvm-readobj/ELF/dynamic-malformed.test llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test llvm/test/tools/llvm-readobj/ELF/loadname.test llvm/tools/llvm-readobj/ELFDumper.cpp Removed: ################################################################################ diff --git a/llvm/test/Object/invalid.test b/llvm/test/Object/invalid.test index 74ad8fcc9c72..57fb006351eb 100644 --- a/llvm/test/Object/invalid.test +++ b/llvm/test/Object/invalid.test @@ -437,7 +437,7 @@ DynamicSymbols: # RUN: yaml2obj %s --docnum=20 -o %t20 # RUN: llvm-readobj --dynamic-table %t20 2>&1 | FileCheck -DFILE=%t20 --check-prefix=INVALID-DTSTRTAB %s -# INVALID-DTSTRTAB: warning: '[[FILE]]': Unable to parse DT_STRTAB: virtual address is not in any segment: 0xffff0000 +# INVALID-DTSTRTAB: warning: '[[FILE]]': unable to parse DT_STRTAB: virtual address is not in any segment: 0xffff0000 --- !ELF FileHeader: diff --git a/llvm/test/tools/llvm-readobj/ELF/dyn-symbols.test b/llvm/test/tools/llvm-readobj/ELF/dyn-symbols.test index 43ca57a80b61..4b4a4bed4c8b 100644 --- a/llvm/test/tools/llvm-readobj/ELF/dyn-symbols.test +++ b/llvm/test/tools/llvm-readobj/ELF/dyn-symbols.test @@ -90,7 +90,7 @@ ProgramHeaders: # RUN: llvm-readelf %t2.so --dyn-symbols 2>&1 | \ # RUN: FileCheck %s -DFILE=%t2.so --implicit-check-not=warning: -DNAME=.dynsym --check-prefix=NOPHDRS-GNU -# NOPHDRS-LLVM: warning: '[[FILE]]': Unable to parse DT_SYMTAB: virtual address is not in any segment: 0xffff1234 +# NOPHDRS-LLVM: warning: '[[FILE]]': unable to parse DT_SYMTAB: virtual address is not in any segment: 0xffff1234 # NOPHDRS-LLVM: DynamicSymbols [ # NOPHDRS-LLVM-NEXT: Symbol { # NOPHDRS-LLVM-NEXT: Name: (0) @@ -112,7 +112,7 @@ ProgramHeaders: # NOPHDRS-LLVM-NEXT: } # NOPHDRS-LLVM-NEXT: ] -# NOPHDRS-GNU: warning: '[[FILE]]': Unable to parse DT_SYMTAB: virtual address is not in any segment: 0xffff1234 +# NOPHDRS-GNU: warning: '[[FILE]]': unable to parse DT_SYMTAB: virtual address is not in any segment: 0xffff1234 # NOPHDRS-NAMEWARN: warning: '[[FILE]]': unable to get the name of SHT_DYNSYM section with index 2: a section [index 2] has an invalid sh_name (0xffffffff) offset which goes past the end of the section name string table # NOPHDRS-GNU: Symbol table '[[NAME]]' contains 2 entries: # NOPHDRS-GNU-NEXT: Num: Value Size Type Bind Vis Ndx Name @@ -153,7 +153,7 @@ DynamicSymbols: # RUN: llvm-readobj %t3.so --dyn-symbols 2>&1 | FileCheck %s -DFILE=%t3.so --check-prefixes=NOSHT-DYNSYM,NOSHT-DYNSYM-LLVM # RUN: llvm-readelf %t3.so --dyn-symbols 2>&1 | FileCheck %s -DFILE=%t3.so --check-prefix=NOSHT-DYNSYM -# NOSHT-DYNSYM: warning: '[[FILE]]': Unable to parse DT_SYMTAB: virtual address is not in any segment: 0x0 +# NOSHT-DYNSYM: warning: '[[FILE]]': unable to parse DT_SYMTAB: virtual address is not in any segment: 0x0 # NOSHT-DYNSYM-LLVM: DynamicSymbols [ # NOSHT-DYNSYM-LLVM-NEXT: ] @@ -181,7 +181,7 @@ DynamicSymbols: # RUN: llvm-readobj %t4.so --dyn-symbols 2>&1 | FileCheck -DFILE=%t4.so %s --check-prefixes=BROKEN-DTSYMTAB,BROKEN-DTSYMTAB-LLVM # RUN: llvm-readelf %t4.so --dyn-symbols 2>&1 | FileCheck -DFILE=%t4.so %s --check-prefixes=BROKEN-DTSYMTAB,BROKEN-DTSYMTAB-GNU -# BROKEN-DTSYMTAB: warning: '[[FILE]]': Unable to parse DT_SYMTAB: virtual address is not in any segment: 0xffff1234 +# BROKEN-DTSYMTAB: warning: '[[FILE]]': unable to parse DT_SYMTAB: virtual address is not in any segment: 0xffff1234 # BROKEN-DTSYMTAB-LLVM: Name: foo # BROKEN-DTSYMTAB-GNU: 1: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND foo diff --git a/llvm/test/tools/llvm-readobj/ELF/dynamic-malformed.test b/llvm/test/tools/llvm-readobj/ELF/dynamic-malformed.test index bb12ce80d9e2..6bcf890949c8 100644 --- a/llvm/test/tools/llvm-readobj/ELF/dynamic-malformed.test +++ b/llvm/test/tools/llvm-readobj/ELF/dynamic-malformed.test @@ -187,7 +187,7 @@ ProgramHeaders: # RUN: FileCheck -DFILE=%t.bad-strtab %s --implicit-check-not=warning: --check-prefix=BAD-STRTAB-ERR # RUN: llvm-readelf --dynamic-table %t.bad-strtab 2>&1 >/dev/null | \ # RUN: FileCheck -DFILE=%t.bad-strtab %s --implicit-check-not=warning: --check-prefix=BAD-STRTAB-ERR -# BAD-STRTAB-ERR: warning: '[[FILE]]': Unable to parse DT_STRTAB: virtual address is not in any segment: 0x2000000 +# BAD-STRTAB-ERR: warning: '[[FILE]]': unable to parse DT_STRTAB: virtual address is not in any segment: 0x2000000 # BAD-STRTAB-ERR: warning: '[[FILE]]': string table was not found # BAD-STRTAB-ERR-NOT:{{.}} @@ -196,7 +196,7 @@ ProgramHeaders: # RUN: llvm-readelf --dynamic-table --needed-libs %t.bad-strtab 2>&1 | \ # RUN: FileCheck -DFILE=%t.bad-strtab %s --check-prefixes=BAD-STRTAB-ERR2,BAD-STRTAB,BAD-STRTAB-GNU -# BAD-STRTAB-ERR2: warning: '[[FILE]]': Unable to parse DT_STRTAB: virtual address is not in any segment: 0x2000000 +# BAD-STRTAB-ERR2: warning: '[[FILE]]': unable to parse DT_STRTAB: virtual address is not in any segment: 0x2000000 # BAD-STRTAB-LLVM: LoadName: <Not found> # BAD-STRTAB: warning: '[[FILE]]': string table was not found # BAD-STRTAB-LLVM-NEXT: 0x0000000000000001 NEEDED Shared library: [<?>] @@ -242,7 +242,7 @@ ProgramHeaders: # RUN: llvm-readobj --dynamic-table %t.bad-rela 2>&1 | FileCheck -DFILE=%t.bad-rela %s --check-prefixes=CHECK,BAD-RELA # RUN: llvm-readelf --dynamic-table %t.bad-rela 2>&1 | FileCheck -DFILE=%t.bad-rela %s --check-prefixes=CHECK,BAD-RELA-GNU -# CHECK: warning: '[[FILE]]': Unable to parse DT_RELA: virtual address is not in any segment: 0x1000000 +# CHECK: warning: '[[FILE]]': unable to parse DT_RELA: virtual address is not in any segment: 0x1000000 # BAD-RELA: DynamicSection [ (2 entries) # BAD-RELA-NEXT: Tag Type Name/Value diff --git a/llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test b/llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test index f1d7b6c4f494..49ea8631a4ba 100644 --- a/llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test +++ b/llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test @@ -480,16 +480,16 @@ Sections: # RUN: --check-prefixes=PHENTSIZE-WARN,PHENTSIZE-GNU # PHENTSIZE-WARN: warning: '[[FILE]]': unable to read program headers to locate the PT_DYNAMIC segment: invalid e_phentsize: 1 -# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': Unable to parse DT_HASH: invalid e_phentsize: 1 -# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': Unable to parse DT_STRTAB: invalid e_phentsize: 1 -# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': Unable to parse DT_SYMTAB: invalid e_phentsize: 1 -# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': Unable to parse DT_RELA: invalid e_phentsize: 1 +# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': unable to parse DT_HASH: invalid e_phentsize: 1 +# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': unable to parse DT_STRTAB: invalid e_phentsize: 1 +# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': unable to parse DT_SYMTAB: invalid e_phentsize: 1 +# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': unable to parse DT_RELA: invalid e_phentsize: 1 # PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': DT_SYMENT value of 0x987 is not the size of a symbol (0x18) -# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': Unable to parse DT_REL: invalid e_phentsize: 1 -# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': Unable to parse DT_JMPREL: invalid e_phentsize: 1 -# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': Unable to parse DT_RELR: invalid e_phentsize: 1 -# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': Unable to parse DT_ANDROID_RELR: invalid e_phentsize: 1 -# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': Unable to parse DT_GNU_HASH: invalid e_phentsize: 1 +# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': unable to parse DT_REL: invalid e_phentsize: 1 +# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': unable to parse DT_JMPREL: invalid e_phentsize: 1 +# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': unable to parse DT_RELR: invalid e_phentsize: 1 +# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': unable to parse DT_ANDROID_RELR: invalid e_phentsize: 1 +# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': unable to parse DT_GNU_HASH: invalid e_phentsize: 1 # PHENTSIZE-LLVM: warning: '[[FILE]]': string table was not found # PHENTSIZE-LLVM-NEXT: LoadName: <?> diff --git a/llvm/test/tools/llvm-readobj/ELF/loadname.test b/llvm/test/tools/llvm-readobj/ELF/loadname.test index b0a028d3d641..18db00845e00 100644 --- a/llvm/test/tools/llvm-readobj/ELF/loadname.test +++ b/llvm/test/tools/llvm-readobj/ELF/loadname.test @@ -59,7 +59,7 @@ ProgramHeaders: # RUN: llvm-readobj %t.err.1.o 2>&1 | FileCheck %s -DFILE=%t.err.1.o --check-prefixes=BROKEN-OFFSET,BROKEN-OFFSET-LLVM # RUN: llvm-readelf --dynamic-table %t.err.1.o 2>&1 | FileCheck %s -DFILE=%t.err.1.o --check-prefixes=BROKEN-OFFSET,BROKEN-OFFSET-GNU -# BROKEN-OFFSET: warning: '[[FILE]]': Unable to parse DT_STRTAB: can't map virtual address 0xfffe to the segment with index 1: the segment ends at 0x10077, which is greater than the file size (0x228) +# BROKEN-OFFSET: warning: '[[FILE]]': unable to parse DT_STRTAB: can't map virtual address 0xfffe to the segment with index 1: the segment ends at 0x10077, which is greater than the file size (0x228) # BROKEN-OFFSET: warning: '[[FILE]]': string table was not found # BROKEN-OFFSET-LLVM: LoadName: <?> # BROKEN-OFFSET-GNU: 0x000000000000000e (SONAME) Library soname: [<?>] diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp index 8a774da52772..d5313d6c182a 100644 --- a/llvm/tools/llvm-readobj/ELFDumper.cpp +++ b/llvm/tools/llvm-readobj/ELFDumper.cpp @@ -2085,12 +2085,11 @@ ELFDumper<ELFT>::ELFDumper(const object::ELFObjectFile<ELFT> &O, loadDynamicTable(); } -template <typename ELFT> -void ELFDumper<ELFT>::parseDynamicTable() { +template <typename ELFT> void ELFDumper<ELFT>::parseDynamicTable() { auto toMappedAddr = [&](uint64_t Tag, uint64_t VAddr) -> const uint8_t * { auto MappedAddrOrError = Obj.toMappedAddr(VAddr); if (!MappedAddrOrError) { - this->reportUniqueWarning("Unable to parse DT_" + + this->reportUniqueWarning("unable to parse DT_" + Obj.getDynamicTagAsString(Tag) + ": " + llvm::toString(MappedAddrOrError.takeError())); return nullptr; _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits