Mail Archives: djgpp/1999/04/16/18:38:58
>
>> *(long *)section+r->r_vaddr += section;
>> *(long *)section+r->r_vaddr -= (section - section_header.s_paddr);
>
>more like *(long *)section+r->r_vaddr += symbol_addr -
this_section->new_paddr;
say i allocate the data for "section" at 0x100, and it's original paddr was
0x4. say the symbol has a vaddr of 0x32 in the relocation entry, and in
real-life it's at say 0x200.
then, if i understand this, is should come up with:
address = 0x200 - 0x100;
or,
*(long *)0x100+0x32 += 0x200 - 0x100;
>> One of the functions that gets output to .xptfunc references both
>> _malloc and _memset, but they aren't statically linked into the
>> object, so, what is it that I need to do to get _malloc and
>> _memset's real addresses correctly patched into the file?
>You need to find out their real addresses somehow, or defer those
>relocations until you can know.
allright, so, this sounds like i can do this:
long *p = (long *)malloc;
*(long *)section+r->r_vaddr += p - section;
for symbol malloc.
-={C}=-
- Raw text -