This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFA: pseudo-relocations for pe targets
- From: Pedro Alves <pedro at codesourcery dot com>
- To: binutils at sourceware dot org
- Cc: Kai Tietz <Kai dot Tietz at onevision dot com>, Nick Clifton <nickc at redhat dot com>
- Date: Tue, 11 Nov 2008 15:41:25 +0000
- Subject: Re: RFA: pseudo-relocations for pe targets
- References: <OFF2DAF91D.213DB7B4-ONC12574FE.0052FB51-C12574FE.00538AB1@onevision.de>
On Tuesday 11 November 2008 15:12:29, Kai Tietz wrote:
> Well, I thought about the noop version, but deceided not todo so. The
> problem is that __image_base__+0 is not necessarily writeable, but old
> relocator tries to add then zero there and may raise a PF. So I want to
> implement it by checking that the size for the entries modulo
> sizeof(pseudo_reloc_v1) is zero for v2 and check that the flags (the
> reloc-size) field has just values of 8,16,32,64. Otherwise version one is
> assumed.
>
> If you have an better idea, please let me know. I think this check is a
> hack, but should work.
Why not just have two lists?
extern char __RUNTIME_PSEUDO_RELOC_LIST___;
extern char __RUNTIME_PSEUDO_RELOC_LIST__END__;
extern char __RUNTIME_PSEUDO_RELOC_LIST_V2__;
extern char __RUNTIME_PSEUDO_RELOC_LIST_V2_END__;
?
This way, it could also be possible to mix v2 relocs with v1 relocs.
In the new v2 case, you could add some reloc-type marker, for
future extension, so that when a v3 (or vNNN) is added, an old v2
relocator can detect it, and bail out.
--
Pedro Alves