Regarding ELF_RELOC

In llvm/include/llvm/BinaryFormat/ELFRelocs/ directory, we have many .def files for each architecture like X86_64.def, Mips.def etc

How to write ELF_RELOC defines for a new architecture (64 bit and little endian)? I understand that these defines are a handshake between the compiler and the linker. But I couldn’t find any information related to this anywhere on the internet. Any pointers would help.


And a handshake with the shared libraries, so it’s usually part of the ABI. Take 68k as an example, relocations are defined as part of its SysV ABI (page 6 of this PDF).
Not sure if there is any guide to creating relocs for new architectures though. Maybe you can copy from a similar architecture and start from there.

1 Like

Thank you very much for your suggestions.