NetBSD: Trying to fix reloc error 38 on arm - WIP

This commit is contained in:
Christian Jullien 2021-01-06 07:02:19 +01:00 committed by Ole André Vadla Ravnås
parent c3b596afb7
commit 48bc44c5e6
2 changed files with 5 additions and 1 deletions

View File

@ -44,6 +44,7 @@ int code_reloc (int reloc_type)
case R_ARM_COPY:
case R_ARM_GLOB_DAT:
case R_ARM_NONE:
case R_ARM_TARGET1:
return 0;
case R_ARM_PC24:
@ -86,6 +87,7 @@ int gotplt_entry_type (int reloc_type)
case R_ARM_ABS32:
case R_ARM_REL32:
case R_ARM_V4BX:
case R_ARM_TARGET1:
return AUTO_GOTPLT_ENTRY;
case R_ARM_GOTPC:
@ -345,11 +347,12 @@ void relocate(TCCState *s1, ElfW_Rel *rel, int type, unsigned char *ptr, addr_t
(*(int *)ptr) |= x & 0x7fffffff;
}
case R_ARM_ABS32:
// case R_ARM_TARGET1: /* ??? as seen on NetBSD - FIXME! */
if (s1->output_type == TCC_OUTPUT_DLL) {
esym_index = get_sym_attr(s1, sym_index, 0)->dyn_index;
qrel->r_offset = rel->r_offset;
if (esym_index) {
qrel->r_info = ELFW(R_INFO)(esym_index, R_ARM_ABS32);
qrel->r_info = ELFW(R_INFO)(esym_index, type);
qrel++;
return;
} else {

View File

@ -2501,6 +2501,7 @@ typedef Elf32_Addr Elf32_Conflict;
#define R_ARM_LDR_SBREL_11_0 35
#define R_ARM_ALU_SBREL_19_12 36
#define R_ARM_ALU_SBREL_27_20 37
#define R_ARM_TARGET1 38
#define R_ARM_V4BX 40
#define R_ARM_PREL31 42
#define R_ARM_MOVW_ABS_NC 43