[llvm-dev] ELF relocations (original) (raw)

Friedman, Eli via llvm-dev llvm-dev at lists.llvm.org
Fri Oct 12 17:25:30 PDT 2018


On 10/12/2018 4:32 PM, Hassan ELMADI via llvm-dev wrote:

Hi, In the include/llvm/Support/ELFRelocs directory, there is a bunch of .def files defining enums that are to be included in ELF.h. For example, in ARM.def, there is this record:

ELFRELOC(RARMPC24,                   0x01) What does 'RARMPC24' mean and where does the value 0x01 come from?

See http://refspecs.linuxbase.org/elf/gabi4+/ch4.reloc.html for a general description of ELF relocations.  The names, values, and meanings are all CPU-specific because it depends on the instruction encoding.  For commonly used CPUs, there are standard ELF relocations, so different compilers and linkers for a given CPU are compatible.  For example, the ARM ELF relocations are defined in http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044f/IHI0044F_aaelf.pdf .

If you're defining your own CPU architecture, it doesn't really matter what the names or values are, as long as the compiler and linker agree what they mean.

-Eli

-- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181012/95e19427/attachment.html>



More information about the llvm-dev mailing list