diff options
-rw-r--r-- | elf/elf.h | 29 | ||||
-rw-r--r-- | scripts/glibcelf.py | 3 | ||||
-rw-r--r-- | sysdeps/arc/dl-machine.h | 8 |
3 files changed, 31 insertions, 9 deletions
@@ -4159,6 +4159,15 @@ enum #define R_LARCH_GNU_VTINHERIT 57 #define R_LARCH_GNU_VTENTRY 58 +/* ARC specific declarations. */ + +/* Processor specific flags for the Ehdr e_flags field. */ +#define EF_ARC_MACH_MSK 0x000000ff +#define EF_ARC_OSABI_MSK 0x00000f00 +#define EF_ARC_ALL_MSK (EF_ARC_MACH_MSK | EF_ARC_OSABI_MSK) + +/* Processor specific values for the Shdr sh_type field. */ +#define SHT_ARC_ATTRIBUTES (SHT_LOPROC + 1) /* ARC attributes section. */ /* ARCompact/ARCv2 specific relocs. */ #define R_ARC_NONE 0x0 @@ -4166,7 +4175,7 @@ enum #define R_ARC_16 0x2 #define R_ARC_24 0x3 #define R_ARC_32 0x4 -#define R_ARC_B26 0x5 + #define R_ARC_B22_PCREL 0x6 #define R_ARC_H30 0x7 #define R_ARC_N8 0x8 @@ -4206,16 +4215,23 @@ enum #define R_ARC_SECTOFF_ME_2 0x2A #define R_ARC_SECTOFF_1 0x2B #define R_ARC_SECTOFF_2 0x2C +#define R_ARC_SDA_12 0x2D +#define R_ARC_SDA16_ST2 0x30 +#define R_ARC_32_PCREL 0x31 #define R_ARC_PC32 0x32 #define R_ARC_GOTPC32 0x33 #define R_ARC_PLT32 0x34 #define R_ARC_COPY 0x35 #define R_ARC_GLOB_DAT 0x36 -#define R_ARC_JUMP_SLOT 0x37 +#define R_ARC_JMP_SLOT 0x37 #define R_ARC_RELATIVE 0x38 #define R_ARC_GOTOFF 0x39 #define R_ARC_GOTPC 0x3A #define R_ARC_GOT32 0x3B +#define R_ARC_S21W_PCREL_PLT 0x3C +#define R_ARC_S25H_PCREL_PLT 0x3D + +#define R_ARC_JLI_SECTOFF 0x3F #define R_ARC_TLS_DTPMOD 0x42 #define R_ARC_TLS_DTPOFF 0x43 @@ -4224,9 +4240,12 @@ enum #define R_ARC_TLS_GD_LD 0x46 #define R_ARC_TLS_GD_CALL 0x47 #define R_ARC_TLS_IE_GOT 0x48 -#define R_ARC_TLS_DTPOFF_S9 0x4a -#define R_ARC_TLS_LE_S9 0x4a -#define R_ARC_TLS_LE_32 0x4b +#define R_ARC_TLS_DTPOFF_S9 0x49 +#define R_ARC_TLS_LE_S9 0x4A +#define R_ARC_TLS_LE_32 0x4B +#define R_ARC_S25W_PCREL_PLT 0x4C +#define R_ARC_S21H_PCREL_PLT 0x4D +#define R_ARC_NPS_CMEM16 0x4E /* OpenRISC 1000 specific relocs. */ #define R_OR1K_NONE 0 diff --git a/scripts/glibcelf.py b/scripts/glibcelf.py index 59aab56ecf..a85594c3d9 100644 --- a/scripts/glibcelf.py +++ b/scripts/glibcelf.py @@ -304,6 +304,8 @@ class Sht(_TypedConstant): prefix = 'SHT_' class ShtALPHA(Sht): """Supplemental SHT_* constants for EM_ALPHA.""" +class ShtARC(Sht): + """Supplemental SHT_* constants for EM_ARC.""" class ShtARM(Sht): """Supplemental SHT_* constants for EM_ARM.""" class ShtCSKY(Sht): @@ -317,6 +319,7 @@ class ShtPARISC(Sht): class ShtRISCV(Sht): """Supplemental SHT_* constants for EM_RISCV.""" _register_elf_h(ShtALPHA, prefix='SHT_ALPHA_', parent=Sht) +_register_elf_h(ShtARC, prefix='SHT_ARC_', parent=Sht) _register_elf_h(ShtARM, prefix='SHT_ARM_', parent=Sht) _register_elf_h(ShtCSKY, prefix='SHT_CSKY_', parent=Sht) _register_elf_h(ShtIA_64, prefix='SHT_IA_64_', parent=Sht) diff --git a/sysdeps/arc/dl-machine.h b/sysdeps/arc/dl-machine.h index c6ad232384..8420cd0006 100644 --- a/sysdeps/arc/dl-machine.h +++ b/sysdeps/arc/dl-machine.h @@ -183,14 +183,14 @@ __start: \n\ ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one of the main executable's symbols, as for a COPY reloc. */ #define elf_machine_type_class(type) \ - ((((type) == R_ARC_JUMP_SLOT \ + ((((type) == R_ARC_JMP_SLOT \ || (type) == R_ARC_TLS_DTPMOD \ || (type) == R_ARC_TLS_DTPOFF \ || (type) == R_ARC_TLS_TPOFF) * ELF_RTYPE_CLASS_PLT) \ | (((type) == R_ARC_COPY) * ELF_RTYPE_CLASS_COPY)) /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */ -#define ELF_MACHINE_JMP_SLOT R_ARC_JUMP_SLOT +#define ELF_MACHINE_JMP_SLOT R_ARC_JMP_SLOT /* Fixup a PLT entry to bounce directly to the function at VALUE. */ @@ -261,7 +261,7 @@ elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[], break; case R_ARC_GLOB_DAT: - case R_ARC_JUMP_SLOT: + case R_ARC_JMP_SLOT: *reloc_addr = value; break; @@ -321,7 +321,7 @@ elf_machine_lazy_rel (struct link_map *map, struct r_scope_elem *scope[], ElfW(Addr) *const reloc_addr = (void *) (l_addr + reloc->r_offset); const unsigned int r_type = ELFW (R_TYPE) (reloc->r_info); - if (r_type == R_ARC_JUMP_SLOT) + if (r_type == R_ARC_JMP_SLOT) *reloc_addr += l_addr; else _dl_reloc_bad_type (map, r_type, 1); |