From d7a32ea4b86c04ba0c4736f803527eb393a40867 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 24 Jun 2015 10:20:30 +0000 Subject: Change how symbol sizes are handled in lib/Object. COFF and MachO only define symbol sizes for common symbols. Reflect that in the class hierarchy by having a method for common symbols only in the base and a general one in ELF. This avoids the need of using a magic value for the size, which had a few problems * Most callers didn't check for it. * The ones that did could not tell the magic value from a file actually having that value. llvm-svn: 240529 --- llvm/tools/llvm-objdump/MachODump.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'llvm/tools/llvm-objdump/MachODump.cpp') diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp index 1730bf3859f..bc743bcd067 100644 --- a/llvm/tools/llvm-objdump/MachODump.cpp +++ b/llvm/tools/llvm-objdump/MachODump.cpp @@ -2417,10 +2417,9 @@ static const char *get_pointer_32(uint32_t Address, uint32_t &offset, // for the specified section offset in the specified section reference. // If no relocation information is found and a non-zero ReferenceValue for the // symbol is passed, look up that address in the info's AddrMap. -static const char * -get_symbol_64(uint32_t sect_offset, SectionRef S, DisassembleInfo *info, - uint64_t &n_value, - uint64_t ReferenceValue = UnknownAddressOrSize) { +static const char *get_symbol_64(uint32_t sect_offset, SectionRef S, + DisassembleInfo *info, uint64_t &n_value, + uint64_t ReferenceValue = UnknownAddress) { n_value = 0; if (!info->verbose) return nullptr; @@ -2454,7 +2453,7 @@ get_symbol_64(uint32_t sect_offset, SectionRef S, DisassembleInfo *info, const char *SymbolName = nullptr; if (reloc_found && isExtern) { Symbol.getAddress(n_value); - if (n_value == UnknownAddressOrSize) + if (n_value == UnknownAddress) n_value = 0; StringRef name; Symbol.getName(name); @@ -2475,7 +2474,7 @@ get_symbol_64(uint32_t sect_offset, SectionRef S, DisassembleInfo *info, // We did not find an external relocation entry so look up the ReferenceValue // as an address of a symbol and if found return that symbol's name. - if (ReferenceValue != UnknownAddressOrSize) + if (ReferenceValue != UnknownAddress) SymbolName = GuessSymbolName(ReferenceValue, info->AddrMap); return SymbolName; -- cgit v1.2.3