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.
This commit is contained in:
parent
3a1380120d
commit
5dadff3de5
5 changed files with 7 additions and 3 deletions
|
|
@ -163,6 +163,7 @@ static CType float_type, double_type, func_float_type, func_double_type;
|
||||||
|
|
||||||
/* relocation type for 32 bit data relocation */
|
/* relocation type for 32 bit data relocation */
|
||||||
#define R_DATA_32 R_ARM_ABS32
|
#define R_DATA_32 R_ARM_ABS32
|
||||||
|
#define R_DATA_PTR R_ARM_ABS32
|
||||||
#define R_JMP_SLOT R_ARM_JUMP_SLOT
|
#define R_JMP_SLOT R_ARM_JUMP_SLOT
|
||||||
#define R_COPY R_ARM_COPY
|
#define R_COPY R_ARM_COPY
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,7 @@ int TotalBytesPushedOnStack;
|
||||||
|
|
||||||
/* relocation type for 32 bit data relocation */
|
/* relocation type for 32 bit data relocation */
|
||||||
#define R_DATA_32 R_C60_32
|
#define R_DATA_32 R_C60_32
|
||||||
|
#define R_DATA_PTR R_C60_32
|
||||||
#define R_JMP_SLOT R_C60_JMP_SLOT
|
#define R_JMP_SLOT R_C60_JMP_SLOT
|
||||||
#define R_COPY R_C60_COPY
|
#define R_COPY R_C60_COPY
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ const int reg_classes[NB_REGS] = {
|
||||||
|
|
||||||
/* relocation type for 32 bit data relocation */
|
/* relocation type for 32 bit data relocation */
|
||||||
#define R_DATA_32 R_386_32
|
#define R_DATA_32 R_386_32
|
||||||
|
#define R_DATA_PTR R_386_32
|
||||||
#define R_JMP_SLOT R_386_JMP_SLOT
|
#define R_JMP_SLOT R_386_JMP_SLOT
|
||||||
#define R_COPY R_386_COPY
|
#define R_COPY R_386_COPY
|
||||||
|
|
||||||
|
|
|
||||||
4
tccgen.c
4
tccgen.c
|
|
@ -4346,7 +4346,7 @@ static void init_putv(CType *type, Section *sec, unsigned long c,
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (vtop->r & VT_SYM) {
|
if (vtop->r & VT_SYM) {
|
||||||
greloc(sec, vtop->sym, c, R_DATA_32);
|
greloc(sec, vtop->sym, c, R_DATA_PTR);
|
||||||
}
|
}
|
||||||
*(int *)ptr |= (vtop->c.i & bit_mask) << bit_pos;
|
*(int *)ptr |= (vtop->c.i & bit_mask) << bit_pos;
|
||||||
break;
|
break;
|
||||||
|
|
@ -4796,7 +4796,7 @@ static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r,
|
||||||
if (tcc_state->do_bounds_check) {
|
if (tcc_state->do_bounds_check) {
|
||||||
unsigned long *bounds_ptr;
|
unsigned long *bounds_ptr;
|
||||||
|
|
||||||
greloc(bounds_section, sym, bounds_section->data_offset, R_DATA_32);
|
greloc(bounds_section, sym, bounds_section->data_offset, R_DATA_PTR);
|
||||||
/* then add global bound info */
|
/* then add global bound info */
|
||||||
bounds_ptr = section_ptr_add(bounds_section, 2 * sizeof(long));
|
bounds_ptr = section_ptr_add(bounds_section, 2 * sizeof(long));
|
||||||
bounds_ptr[0] = 0; /* relocated */
|
bounds_ptr[0] = 0; /* relocated */
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,8 @@ const int reg_classes[NB_REGS] = {
|
||||||
#define EM_TCC_TARGET EM_X86_64
|
#define EM_TCC_TARGET EM_X86_64
|
||||||
|
|
||||||
/* relocation type for 32 bit data relocation */
|
/* relocation type for 32 bit data relocation */
|
||||||
#define R_DATA_32 R_X86_64_64
|
#define R_DATA_32 R_X86_64_32
|
||||||
|
#define R_DATA_PTR R_X86_64_64
|
||||||
#define R_JMP_SLOT R_X86_64_JUMP_SLOT
|
#define R_JMP_SLOT R_X86_64_JUMP_SLOT
|
||||||
#define R_COPY R_X86_64_COPY
|
#define R_COPY R_X86_64_COPY
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue