libmach/elf: Add elfrel.h - scc - simple c99 compiler
 (HTM) git clone git://git.simple-cc.org/scc
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Submodules
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 21df8da7aed52515d5149538a9a1c5d622e4a166
 (DIR) parent e776065632d998cb8491dded4d3c809ac272f5fc
 (HTM) Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
       Date:   Thu, 20 Feb 2025 11:39:30 +0100
       
       libmach/elf: Add elfrel.h
       
       This file was missed in a previous commit and the build was broken
       but it was not catched by the developer builds.
       
       Diffstat:
         A include/bits/scc/elf/elfrel.h       |      39 +++++++++++++++++++++++++++++++
       
       1 file changed, 39 insertions(+), 0 deletions(-)
       ---
 (DIR) diff --git a/include/bits/scc/elf/elfrel.h b/include/bits/scc/elf/elfrel.h
       @@ -0,0 +1,39 @@
       +/* See http://www.sco.com/developers/gabi/latest/contents.html */
       +
       +/* Relocation definitions */
       +
       +typedef struct {
       +        Elf32_Addr        r_offset;
       +        Elf32_Word        r_info;
       +} Elf32_Rel;
       +
       +typedef struct {
       +        Elf32_Addr        r_offset;
       +        Elf32_Word        r_info;
       +        Elf32_Sword        r_addend;
       +} Elf32_Rela;
       +
       +typedef struct {
       +        Elf64_Addr        r_offset;
       +        Elf64_Xword        r_info;
       +} Elf64_Rel;
       +
       +typedef struct {
       +        Elf64_Addr        r_offset;
       +        Elf64_Xword        r_info;
       +        Elf64_Sxword        r_addend;
       +} Elf64_Rela;
       +
       +#define ELFR32SZ   8
       +#define ELFRA32SZ  12
       +
       +#define ELFR64SZ  16
       +#define ELFRA64SZ  24
       +
       +#define ELF32_R_SYM(i)        ((i)>>8)
       +#define ELF32_R_TYPE(i)   ((unsigned char)(i))
       +#define ELF32_R_INFO(s,t) (((s)<<8)+(unsigned char)(t))
       +
       +#define ELF64_R_SYM(i)    ((i)>>32)
       +#define ELF64_R_TYPE(i)   ((i)&0xffffffffL)
       +#define ELF64_R_INFO(s,t) (((s)<<32)+((t)&0xffffffffL))