mirror of
https://github.com/mirror/tinycc.git
synced 2025-03-02 08:20:06 +08:00
moved relocation handling to elf generator
This commit is contained in:
parent
9051cc21af
commit
3d902af1a9
18
i386-gen.c
18
i386-gen.c
@ -104,24 +104,6 @@ void gen_le32(int c)
|
|||||||
g(c >> 24);
|
g(c >> 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
void greloc_patch(unsigned char *ptr,
|
|
||||||
unsigned long addr, unsigned long val, int type)
|
|
||||||
{
|
|
||||||
switch(type) {
|
|
||||||
case R_386_32:
|
|
||||||
*(int *)ptr += val;
|
|
||||||
break;
|
|
||||||
case R_386_PC32:
|
|
||||||
*(int *)ptr += val - addr;
|
|
||||||
break;
|
|
||||||
case R_386_GOTPC:
|
|
||||||
*(int *)ptr += val - addr; /* XXX: use GOT address directly
|
|
||||||
instead of relying on
|
|
||||||
_GLOBAL_OFFSET_TABLE symbol ? */
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* output a symbol and patch all calls to it */
|
/* output a symbol and patch all calls to it */
|
||||||
void gsym_addr(int t, int a)
|
void gsym_addr(int t, int a)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user