This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFA: pseudo-relocations for pe targets
- From: Kai Tietz <Kai dot Tietz at onevision dot com>
- To: "Kai Tietz" <ktietz70 at googlemail dot com>
- Cc: binutils <binutils at sourceware dot org>
- Date: Fri, 14 Nov 2008 14:38:48 +0100
- Subject: Re: RFA: pseudo-relocations for pe targets
> 2008/11/11 Kai Tietz <ktietz70@googlemail.com>:
> > 2008/11/11 Kai Tietz <Kai.Tietz@onevision.com>:
> >>
> >> About this I thought too. I'll modify the patch accordingly to this
and
> >> re-post it here (plus a pseudo-reloc.c variant for test).
> >>
> >
> > Here comes the changed version plus the pseudo-reloc.c file.
> >
> > Is the patch ok for apply on trunk?
>
> I noticed that I sent an older pseudo-reloc.c file, so I attached the
> current one.
>
> I test it on w64 by the following test files:
> a.c: (compiled by gcc -mdll -o a.dll a.c)
> #include <stdio.h>
>
> typedef struct abc {
> int a;
> int b;
> int c;
> } abc;
>
> __declspec(dllexport) abc my_abc = { 1,2,3 };
> __declspec(dllexport) int my_a = 2;
> __declspec(dllexport) void show_a(void)
> {
> printf ("In dll: %d %p, %d %p\n", my_a, &my_a, my_abc.b, &my_abc.b);
> }
> b.c: (compiled by gcc -o b.exe b.c a.dll -Wl,--enable-auto-import)
> #include <stdio.h>
>
> typedef struct abc {
> int a;
> int b;
> int c;
> } abc;
>
> extern abc my_abc;
>
> extern int my_a;
> extern void show_a(void);
>
> int main()
> {
> show_a();
> printf ("In Exe: %d %p, %d %p\n", my_a, &my_a, my_abc.b, &my_abc.b);
> return 1;
> }
> Result on execution on w64:
> $ ./b.exe
> In dll: 2 000000006608200C, 2 0000000066082004
> In Exe: 2 000000006608200C, 2 0000000066082004
Can I assume that the patch for binutils/ld is ok?
Cheers,
Kai