History

x86-64: Fix stab debug information.

We need 32bit relocations for code and 64bit for debug info. Introduce a new macro R_DATA_PTR to distinguish the two usages.

Shinichiro Hamaji committed 17 years ago

Commit 5dadff31 parent 3a138015 files · +7 −3Browse files

Unified · Split

5 files
  1. arm-gen.c +1 −0
  2. c67-gen.c +1 −0
  3. i386-gen.c +1 −0
  4. tccgen.c +2 −2
  5. x86_64-gen.c +2 −1
arm-gen.c+1−0
@@ -163,6 +163,7 @@ static CType float_type, double_type, func_float_type, func_double_type; · 162 unmodified lines
163163
164164 /* relocation type for 32 bit data relocation */
165165 #define R_DATA_32 R_ARM_ABS32
166+#define R_DATA_PTR R_ARM_ABS32
166167 #define R_JMP_SLOT R_ARM_JUMP_SLOT
167168 #define R_COPY R_ARM_COPY
168169
c67-gen.c+1−0
@@ -163,6 +163,7 @@ int TotalBytesPushedOnStack; · 162 unmodified lines
163163
164164 /* relocation type for 32 bit data relocation */
165165 #define R_DATA_32 R_C60_32
166+#define R_DATA_PTR R_C60_32
166167 #define R_JMP_SLOT R_C60_JMP_SLOT
167168 #define R_COPY R_C60_COPY
168169
i386-gen.c+1−0
@@ -77,6 +77,7 @@ const int reg_classes[NB_REGS] = { · 76 unmodified lines
7777
7878 /* relocation type for 32 bit data relocation */
7979 #define R_DATA_32 R_386_32
80+#define R_DATA_PTR R_386_32
8081 #define R_JMP_SLOT R_386_JMP_SLOT
8182 #define R_COPY R_386_COPY
8283
tccgen.c+2−2
@@ -4346,7 +4346,7 @@ static void init_putv(CType *type, Section *sec, unsigned long c, · 4345 unmodified lines
43464346 break;
43474347 default:
43484348 if (vtop->r & VT_SYM) {
4349− greloc(sec, vtop->sym, c, R_DATA_32);
4349+ greloc(sec, vtop->sym, c, R_DATA_PTR);
43504350 }
43514351 *(int *)ptr |= (vtop->c.i & bit_mask) << bit_pos;
43524352 break;
@@ -4796,7 +4796,7 @@ static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r, · 443 unmodified lines
47964796 if (tcc_state->do_bounds_check) {
47974797 unsigned long *bounds_ptr;
47984798
4799− greloc(bounds_section, sym, bounds_section->data_offset, R_DATA_32);
4799+ greloc(bounds_section, sym, bounds_section->data_offset, R_DATA_PTR);
48004800 /* then add global bound info */
48014801 bounds_ptr = section_ptr_add(bounds_section, 2 * sizeof(long));
48024802 bounds_ptr[0] = 0; /* relocated */
x86_64-gen.c+2−1
@@ -91,7 +91,8 @@ const int reg_classes[NB_REGS] = { · 90 unmodified lines
9191 #define EM_TCC_TARGET EM_X86_64
9292
9393 /* relocation type for 32 bit data relocation */
94−#define R_DATA_32 R_X86_64_64
94+#define R_DATA_32 R_X86_64_32
95+#define R_DATA_PTR R_X86_64_64
9596 #define R_JMP_SLOT R_X86_64_JUMP_SLOT
9697 #define R_COPY R_X86_64_COPY
9798

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