1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00
llvm-mirror/include/llvm-c
Rafael Espindola 94aac821b6 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.

llvm-svn: 241450
2015-07-06 14:55:37 +00:00
..
Transforms [BDCE] Add a bit-tracking DCE pass 2015-02-17 01:36:59 +00:00
Analysis.h Organize LLVM C API docs into doxygen modules; add docs 2012-03-21 03:54:29 +00:00
BitReader.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
BitWriter.h Introduce LLVMWriteBitcodeToMemoryBuffer C API function. 2014-10-14 00:30:59 +00:00
Core.h Update LLVM bindings after r239940. Apparently these aren't included in 2015-06-18 11:51:16 +00:00
Disassembler.h Extend C disassembler API to allow specifying target features 2014-09-30 16:31:40 +00:00
ExecutionEngine.h [C API] Expose LLVMGetGlobalValueAddress and LLVMGetFunctionAddress. 2014-12-22 18:53:11 +00:00
Initialization.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
IRReader.h Fix known typos 2014-01-24 17:20:08 +00:00
Linker.h Restore LLVMLinkModules C API until it is properly deprecated. 2015-03-02 18:59:38 +00:00
LinkTimeOptimizer.h include/llvm-c: Whitespace. 2013-10-23 17:56:29 +00:00
lto.h LTO: expose LTO_SYMBOL_ALIAS, which indicates that the symbol is an alias. 2015-07-04 03:42:35 +00:00
module.modulemap [modules] The LLVM C API does not require C++! 2014-06-12 22:09:39 +00:00
Object.h Remove getRelocationAddress. 2015-07-06 14:55:37 +00:00
Support.h Add more wrappers for symbol APIs to the C API. 2015-06-09 15:57:30 +00:00
Target.h [llvm-c] Remove dead typedef 2013-11-11 14:47:01 +00:00
TargetMachine.h Add target analysis passes to the codegen pipeline for MCJIT. 2014-01-23 19:23:28 +00:00