Revert "Fix a nomenclature error in llvm-nm."

This reverts commit r205479.

It turns out that nm does use addresses, it is just that every reasonable
relocatable ELF object has sections with address 0. I have no idea if those
exist in reality, but it at least it shows that llvm-nm should use the name
address.

The added test was includes an unusual .o file with non 0 section addresses. I
created it by hacking ELFObjectWriter.cpp.

Really sorry for the churn.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205493 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-04-03 00:19:35 +00:00
parent 1498ceee9e
commit 14ae43449c
6 changed files with 41 additions and 47 deletions

View File

@@ -417,15 +417,7 @@ template <class ELFT>
error_code ELFObjectFile<ELFT>::getSymbolValue(DataRefImpl Symb,
uint64_t &Val) const {
const Elf_Sym *ESym = getSymbol(Symb);
switch (EF.getSymbolTableIndex(ESym)) {
default:
Val = ESym->st_value;
break;
case ELF::SHN_COMMON:
case ELF::SHN_UNDEF:
Val = UnknownAddressOrSize;
break;
}
Val = ESym->st_value;
return object_error::success;
}