mirror of
https://github.com/frida/tinycc
synced 2025-02-04 17:34:02 +03: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);
|
||||
}
|
||||
|
||||
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 */
|
||||
void gsym_addr(int t, int a)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user