delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/16/17:44:30

Date: Fri, 16 Apr 1999 18:43:41 -0400
Message-Id: <199904162243.SAA22026@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <01be883c$2b6e0b40$LocalHost@thendren> (paradox@gye.satnet.net)
Subject: Re: RELOC_REL32
References: <01be883c$2b6e0b40$LocalHost AT thendren>
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> *(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;

With a DIR32 reloc, you don't do the subtraction part.

> 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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019