mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
Compute the correct symbol size in llvm-nm even without --print-size
In llvm-nm, the symbol size was being computed only with --print-size option, even though it was being printed in other cases, such as with --format=posix. This patch simply removes the guard, so that the size is computed independently of the later decision to print it or not. Fixes PR39997. Differential Revision: https://reviews.llvm.org/D57599 llvm-svn: 353011
This commit is contained in:
parent
acab453d6b
commit
10930d44a1
@ -1,4 +1,4 @@
|
|||||||
# RUN: llvm-nm -P %p/Inputs/hello.obj.elf-x86_64 | FileCheck %s
|
# RUN: llvm-nm -P %p/Inputs/hello.obj.elf-x86_64 | FileCheck %s
|
||||||
|
|
||||||
CHECK: main T 0 0
|
CHECK: main T 0 15
|
||||||
CHECK: puts U 0 0
|
CHECK: puts U 0 0
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# RUN: echo "-P %p/Inputs/hello.obj.elf-x86_64" > %t-response
|
# RUN: echo "-P %p/Inputs/hello.obj.elf-x86_64" > %t-response
|
||||||
# RUN: llvm-nm @%t-response | FileCheck %s
|
# RUN: llvm-nm @%t-response | FileCheck %s
|
||||||
|
|
||||||
CHECK: main T 0 0
|
CHECK: main T 0 15
|
||||||
CHECK: puts U 0 0
|
CHECK: puts U 0 0
|
||||||
|
@ -1190,10 +1190,8 @@ dumpSymbolNamesFromObject(SymbolicFile &Obj, bool printName,
|
|||||||
NMSymbol S = {};
|
NMSymbol S = {};
|
||||||
S.Size = 0;
|
S.Size = 0;
|
||||||
S.Address = 0;
|
S.Address = 0;
|
||||||
if (PrintSize) {
|
if (isa<ELFObjectFileBase>(&Obj))
|
||||||
if (isa<ELFObjectFileBase>(&Obj))
|
S.Size = ELFSymbolRef(Sym).getSize();
|
||||||
S.Size = ELFSymbolRef(Sym).getSize();
|
|
||||||
}
|
|
||||||
if (PrintAddress && isa<ObjectFile>(Obj)) {
|
if (PrintAddress && isa<ObjectFile>(Obj)) {
|
||||||
SymbolRef SymRef(Sym);
|
SymbolRef SymRef(Sym);
|
||||||
Expected<uint64_t> AddressOrErr = SymRef.getAddress();
|
Expected<uint64_t> AddressOrErr = SymRef.getAddress();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user