llvm-6502/lib/Object
Rafael Espindola c2966a3ac7 Remove getRelocationAddress.
Originally added in r139314.

Back then it didn't actually get the address, it got whatever value the
relocation used: address or offset.

The values in different object formats are:

* MachO: Always an offset.
* COFF: Always an address, but when talking about the virtual address of
  sections it says: "for simplicity, compilers should set this to zero".
* ELF: An offset for .o files and and address for .so files. In the case of the
  .so, the relocation in not linked to any section (sh_info is 0). We can't
  really compute an offset.

Some API mappings would be:

* Use getAddress for everything. It would be quite cumbersome. To compute the
  address elf has to follow sh_info, which can be corrupted and therefore the
  method has to return an ErrorOr. The address of the section is also the same
  for every relocation in a section, so we shouldn't have to check the error
  and fetch the value for every relocation.

* Use a getValue and make it up to the user to know what it is getting.

* Use a getOffset and:
 * Assert for dynamic ELF objects. That is a very peculiar case and it is
   probably fair to ask any tool that wants to support it to use ELF.h. The
   only tool we have that reads those (llvm-readobj) already does that. The
   only other use case I can think of is a dynamic linker.
 * Check that COFF .obj files have sections with zero virtual address spaces. If
   it turns out that some assembler/compiler produces these, we can change
   COFFObjectFile::getRelocationOffset to subtract it. Given COFF format,
   this can be done without the need for ErrorOr.

The getRelocationAddress method was never implemented for COFF. It also
had exactly one use in a very peculiar case: a shortcut for adding the
section value to a pcrel reloc on MachO.

Given that, I don't expect that there is any use out there of the C API. If
that is not the case, let me know and I will add it back with the implementation
inlined and do a proper deprecation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241450 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 14:55:37 +00:00
..
Archive.cpp Remove object_error::success and use std::error_code() instead 2015-06-09 15:20:42 +00:00
ArchiveWriter.cpp [ArchiveWriter] Use EndianStream. No functional change intended. 2015-06-17 16:02:56 +00:00
Binary.cpp Object: Handle Mach-O kext bundle files 2015-02-25 22:59:20 +00:00
CMakeLists.txt Revert "[FaultMaps] Move FaultMapParser to Object/" 2015-06-23 20:09:03 +00:00
COFFObjectFile.cpp Remove getRelocationAddress. 2015-07-06 14:55:37 +00:00
COFFYAML.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
ELF.cpp Remove duplication of relocation names in lib/Object/ELF.cpp 2014-11-21 20:16:07 +00:00
ELFObjectFile.cpp [Object, ELF] Don't assert on invalid magic in createELFObjectFile. 2015-06-04 23:14:43 +00:00
ELFYAML.cpp [ELFYAML] Fix handling SHT_NOBITS sections by obj2yaml/yaml2obj tools 2015-07-03 23:00:54 +00:00
Error.cpp Return ErrorOr from getSection. 2015-07-01 12:56:27 +00:00
IRObjectFile.cpp Simplify the Mangler interface now that DataLayout is mandatory. 2015-06-23 13:59:29 +00:00
LLVMBuild.txt Object/LLVMBuild.txt: Sort required_libraries by alphabetical order. 2014-07-14 02:52:08 +00:00
MachOObjectFile.cpp Remove getRelocationAddress. 2015-07-06 14:55:37 +00:00
MachOUniversal.cpp [Object] Search for architecures by name in MachOUniversalBinary::getObjectForArch() 2015-06-22 21:33:24 +00:00
Makefile
Object.cpp Remove getRelocationAddress. 2015-07-06 14:55:37 +00:00
ObjectFile.cpp Return ErrorOr from SymbolRef::getName. 2015-07-02 20:55:21 +00:00
RecordStreamer.cpp Move alignment from MCSectionData to MCSection. 2015-05-21 19:20:38 +00:00
RecordStreamer.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
SymbolicFile.cpp Object: Handle Mach-O kext bundle files 2015-02-25 22:59:20 +00:00
SymbolSize.cpp [SymbolSize] Skip sorting by index, just assign by index. 2015-06-29 16:05:00 +00:00