This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: pseudo-relocations for pe targets


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]