summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objdump/MachODump.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-06-24 10:20:30 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-06-24 10:20:30 +0000
commitd7a32ea4b86c04ba0c4736f803527eb393a40867 (patch)
tree1b09dcd2e51416a33c0b030346842e8ea6dd3e38 /llvm/tools/llvm-objdump/MachODump.cpp
parent595348228569c587e14bf8cea1c4fdf1b503c104 (diff)
downloadbcm5719-llvm-d7a32ea4b86c04ba0c4736f803527eb393a40867.tar.gz
bcm5719-llvm-d7a32ea4b86c04ba0c4736f803527eb393a40867.zip
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
Diffstat (limited to 'llvm/tools/llvm-objdump/MachODump.cpp')
-rw-r--r--llvm/tools/llvm-objdump/MachODump.cpp11
1 files changed, 5 insertions, 6 deletions
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;
OpenPOWER on IntegriCloud