History

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

Christian Jullien committed 5 years ago

Commit 760024b1 parent f9c3b612 files · +5 −1Browse files

Unified · Split

2 files
  1. arm-link.c +4 −1
  2. elf.h +1 −0
arm-link.c+4−1
@@ -45,6 +45,7 @@ int code_reloc (int reloc_type) · 44 unmodified lines
45 case R_ARM_COPY:45 case R_ARM_COPY:
46 case R_ARM_GLOB_DAT:46 case R_ARM_GLOB_DAT:
47 case R_ARM_NONE:47 case R_ARM_NONE:
48 case R_ARM_TARGET1:
48 return 0;49 return 0;
49 50
50 case R_ARM_PC24:51 case R_ARM_PC24:
@@ -87,6 +88,7 @@ int gotplt_entry_type (int reloc_type) · 36 unmodified lines
87 case R_ARM_ABS32:88 case R_ARM_ABS32:
88 case R_ARM_REL32:89 case R_ARM_REL32:
89 case R_ARM_V4BX:90 case R_ARM_V4BX:
91 case R_ARM_TARGET1:
90 return AUTO_GOTPLT_ENTRY;92 return AUTO_GOTPLT_ENTRY;
91 93
92 case R_ARM_GOTPC:94 case R_ARM_GOTPC:
@@ -359,11 +361,12 @@ void relocate(TCCState *s1, ElfW_Rel *rel, int type, unsigned char *ptr, addr_t · 266 unmodified lines
359 (*(int *)ptr) |= x & 0x7fffffff;361 (*(int *)ptr) |= x & 0x7fffffff;
360 }362 }
361 case R_ARM_ABS32:363 case R_ARM_ABS32:
364 // case R_ARM_TARGET1: /* ??? as seen on NetBSD - FIXME! */
362 if (s1->output_type == TCC_OUTPUT_DLL) {365 if (s1->output_type == TCC_OUTPUT_DLL) {
363 esym_index = get_sym_attr(s1, sym_index, 0)->dyn_index;366 esym_index = get_sym_attr(s1, sym_index, 0)->dyn_index;
364 qrel->r_offset = rel->r_offset;367 qrel->r_offset = rel->r_offset;
365 if (esym_index) {368 if (esym_index) {
366 qrel->r_info = ELFW(R_INFO)(esym_index, R_ARM_ABS32);369 qrel->r_info = ELFW(R_INFO)(esym_index, type);
367 qrel++;370 qrel++;
368 return;371 return;
369 } else {372 } else {
elf.h+1−0
@@ -2501,6 +2501,7 @@ typedef Elf32_Addr Elf32_Conflict; · 2500 unmodified lines
2501#define R_ARM_LDR_SBREL_11_0 352501#define R_ARM_LDR_SBREL_11_0 35
2502#define R_ARM_ALU_SBREL_19_12 362502#define R_ARM_ALU_SBREL_19_12 36
2503#define R_ARM_ALU_SBREL_27_20 372503#define R_ARM_ALU_SBREL_27_20 37
2504#define R_ARM_TARGET1 38
2504#define R_ARM_V4BX 402505#define R_ARM_V4BX 40
2505#define R_ARM_PREL31 422506#define R_ARM_PREL31 42
2506#define R_ARM_MOVW_ABS_NC 432507#define R_ARM_MOVW_ABS_NC 43

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t