2 #define HAVE_SECTION_RELOC
4 void relocate_init(Section
*sr
) {}
6 void relocate(TCCState
*s1
, ElfW_Rel
*rel
, int type
, char *ptr
, addr_t addr
, addr_t val
)
16 /* put the low 16 bits of the absolute address add to what is
18 orig
= ((*(int *)(ptr
)) >> 7) & 0xffff;
19 orig
|= (((*(int *)(ptr
+4)) >> 7) & 0xffff) << 16;
21 /* patch both at once - assumes always in pairs Low - High */
22 *(int *) ptr
= (*(int *) ptr
& (~(0xffff << 7)) ) |
23 (((val
+orig
) & 0xffff) << 7);
24 *(int *)(ptr
+4) = (*(int *)(ptr
+4) & (~(0xffff << 7)) ) |
25 ((((val
+orig
)>>16) & 0xffff) << 7);
31 fprintf(stderr
,"FIXME: handle reloc type %x at %x [%p] to %x\n",
32 type
, (unsigned) addr
, ptr
, (unsigned) val
);