[patch] Fix relocation version two
Kai Tietz
Kai.Tietz@onevision.com
Thu Jan 22 15:49:00 GMT 2009
binutils-owner@sourceware.org wrote on 22.01.2009 15:48:56:
> Hello,
>
> This patch fixes relocation version 2. There was a thinko in relocation
> schema for v2. v1 relocates directly to the instruction at fixup_name,
but
> version two does this in pseudo relocator code. This difference is
> necessary for 64-bit systems, because the relocation is mostly
> pc-relative, so a special treating has do be done here.
> The part in pe_create_runtime_relocator_reference () is more to ensure
> that element has pointer width. I used for this the PE_IDATA5_SIZE
macro,
> but this part is not really necessary, but makes it a bit more consitant
> to read.
Additionally I eliminate the generation of an new import table
for pseudo-relocation version 2, if the _nm_thnk_<name> and _imp_<name>
is already present.
ChangeLog
2009-01-22 Kai Tietz <kai.tietz@onevision.com>
* pe-dll.c (tmp_seq2): New static variable.
(make_singleton_name_imp): New.
(make_import_fixup_entry): Use for v2 the _imp_<name> symbol and
avoid duplicate import table generation for same symbol.
(pe_create_runtime_relocator_reference): Make reference for
64-bit 8 bytes.
Tested on x86_64-pc-mingw32 and for i686-pc-mingw32
Is this patch ok to apply?
Cheers,
i.A. Kai Tietz
| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixrlv2.diff
Type: application/octet-stream
Size: 7005 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20090122/79886398/attachment.obj>
More information about the Binutils
mailing list