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
163 163
164/* relocation type for 32 bit data relocation */164/* relocation type for 32 bit data relocation */
165#define R_DATA_32 R_ARM_ABS32165#define R_DATA_32 R_ARM_ABS32
166#define R_DATA_PTR R_ARM_ABS32
166#define R_JMP_SLOT R_ARM_JUMP_SLOT167#define R_JMP_SLOT R_ARM_JUMP_SLOT
167#define R_COPY R_ARM_COPY168#define R_COPY R_ARM_COPY
168 169
c67-gen.c+1−0
@@ -163,6 +163,7 @@ int TotalBytesPushedOnStack; · 162 unmodified lines
163 163
164/* relocation type for 32 bit data relocation */164/* relocation type for 32 bit data relocation */
165#define R_DATA_32 R_C60_32165#define R_DATA_32 R_C60_32
166#define R_DATA_PTR R_C60_32
166#define R_JMP_SLOT R_C60_JMP_SLOT167#define R_JMP_SLOT R_C60_JMP_SLOT
167#define R_COPY R_C60_COPY168#define R_COPY R_C60_COPY
168 169
i386-gen.c+1−0
@@ -77,6 +77,7 @@ const int reg_classes[NB_REGS] = { · 76 unmodified lines
77 77
78/* relocation type for 32 bit data relocation */78/* relocation type for 32 bit data relocation */
79#define R_DATA_32 R_386_3279#define R_DATA_32 R_386_32
80#define R_DATA_PTR R_386_32
80#define R_JMP_SLOT R_386_JMP_SLOT81#define R_JMP_SLOT R_386_JMP_SLOT
81#define R_COPY R_386_COPY82#define R_COPY R_386_COPY
82 83
tccgen.c+2−2
@@ -4346,7 +4346,7 @@ static void init_putv(CType *type, Section *sec, unsigned long c, · 4345 unmodified lines
4346 break;4346 break;
4347 default:4347 default:
4348 if (vtop->r & VT_SYM) {4348 if (vtop->r & VT_SYM) {
4349 greloc(sec, vtop->sym, c, R_DATA_32);4349 greloc(sec, vtop->sym, c, R_DATA_PTR);
4350 }4350 }
4351 *(int *)ptr |= (vtop->c.i & bit_mask) << bit_pos;4351 *(int *)ptr |= (vtop->c.i & bit_mask) << bit_pos;
4352 break;4352 break;
@@ -4796,7 +4796,7 @@ static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r, · 443 unmodified lines
4796 if (tcc_state->do_bounds_check) {4796 if (tcc_state->do_bounds_check) {
4797 unsigned long *bounds_ptr;4797 unsigned long *bounds_ptr;
4798 4798
4799 greloc(bounds_section, sym, bounds_section->data_offset, R_DATA_32);4799 greloc(bounds_section, sym, bounds_section->data_offset, R_DATA_PTR);
4800 /* then add global bound info */4800 /* then add global bound info */
4801 bounds_ptr = section_ptr_add(bounds_section, 2 * sizeof(long));4801 bounds_ptr = section_ptr_add(bounds_section, 2 * sizeof(long));
4802 bounds_ptr[0] = 0; /* relocated */4802 bounds_ptr[0] = 0; /* relocated */
x86_64-gen.c+2−1
@@ -91,7 +91,8 @@ const int reg_classes[NB_REGS] = { · 90 unmodified lines
91#define EM_TCC_TARGET EM_X86_6491#define EM_TCC_TARGET EM_X86_64
92 92
93/* relocation type for 32 bit data relocation */93/* relocation type for 32 bit data relocation */
94#define R_DATA_32 R_X86_64_6494#define R_DATA_32 R_X86_64_32
95#define R_DATA_PTR R_X86_64_64
95#define R_JMP_SLOT R_X86_64_JUMP_SLOT96#define R_JMP_SLOT R_X86_64_JUMP_SLOT
96#define R_COPY R_X86_64_COPY97#define R_COPY R_X86_64_COPY
97 98

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