This is the mail archive of the
cygwin-developers
mailing list for the Cygwin project.
Re: CFA: pseudo-reloc v2
- From: Kai Tietz <Kai dot Tietz at onevision dot com>
- To: Charles Wilson <cygwin at cwilson dot fastmail dot fm>
- Cc: cygwin-developers at cygwin dot com
- Date: Wed, 7 Oct 2009 09:29:47 +0200
- Subject: Re: CFA: pseudo-reloc v2
cygwin-developers-owner@cygwin.com wrote on 06.10.2009 16:50:18:
> Charles Wilson wrote:
> > v2 relocs will look like this:
> >
> > __RUNTIME_PSEUDO_RELOC_LIST__:
> > .dword 0 ; .magic1
> > .dword 0 ; .magic2
> > .dword 0 ; .version = RP_VERSION_N
> > .dword ? ; .addend (first actual reloc entry)
> > .dword ? ; .target
> > .dword ? ; .addend (second reloc entry)
> > .dword ? ; .target
> > ...
> > .dword ? ; .addend (last reloc entry)
> > .dword ? ; .target
> > __RUNTIME_PSEUDO_RELOC_LIST_END__:
>
> AAARGG. Dadgum cut-n-paste. The above structure is what you WOULD get
> if binutils created a v1 reloc list with the "v2" header (and .version
> would be RP_VERSION_1 == 0). It's supported by the runtime code, but no
> existing binutils will create a reloc list of this form. They use either
> the "original" v1 relocation list structure (without the 3-DWORD
> header), OR they create a v2 structure as follows:
>
> __RUNTIME_PSEUDO_RELOC_LIST__:
> .dword 0 ; .magic1
> .dword 0 ; .magic2
> .dword 0 ; .version = RP_VERSION_2
> .dword ? ; .sym (first actual reloc entry)
> .dword ? ; .target
> .dword ? ; .flags
> .dword ? ; .sym (second reloc entry)
> .dword ? ; .target
> .dword ? ; .flags
> ...
> .dword ? ; .sym (last reloc entry)
> .dword ? ; .target
> .dword ? ; .flags
> __RUNTIME_PSEUDO_RELOC_LIST_END__:
>
> Sorry for the confusion.
>
> --
> Chuck
>
Yes, binutils (ld) don't create v1 version prefix. This is reasoned by the
fact, that otherwise old runtimes wouldn't be able to interpret v1
relocation schema anymore. The support in pseudo-relocation code is more
for completness, but as long as older runtime versions are used with newer
binutils version, we shouldn't add the version prefix to ld's generated
code.
Kai Tietz
| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.