This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH/RFC] Fix LD test FAIL: weak symbols on Cygwin
- From: Kai Tietz <Kai dot Tietz at onevision dot com>
- To: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- Cc: "Aaron W. LaFramboise" <aaron98wiridge9 at aaronwl dot com>, binutils at sourceware dot org, Dave Korn <dave dot korn dot cygwin at googlemail dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>
- Date: Wed, 18 Mar 2009 09:31:55 +0100
- Subject: Re: [PATCH/RFC] Fix LD test FAIL: weak symbols on Cygwin
binutils-owner@sourceware.org wrote on 18.03.2009 05:52:05:
> Dave Korn wrote:
>
> > ... and here's the difference in the generated object file;
'badobj.txt' is
> > the objdump output from the version of attrib5.o generated by my
patched
> > assembler, 'goodobj.txt' from a clean build of gas:
>
> *facepalm* No they aren't. They are mislabelled. In the diff,
>
>
> > - 1b: e8 e4 ff ff ff call 4 <__f+0x4>
>
> This is correct, and from unpatched gas, and works when executed.
>
> > + 1b: e8 00 00 00 00 call 20 <_main+0x1b>
>
> And this one is incorrect, and jumps to the wrong address at runtime
and
> asplode.
>
> > 1c: DISP32 _f
>
> However I think I was still right about saying I'll have to adjust
> pc-relative relocs specially.
>
> cheers,
> DaveK
As far as I see the weak support for pe(p)-coff targets isn't complete.
The comdat stuff is half implemented and bfd uses internally just
C_NT_WEAK, but it should use C_WEAKEXT in most cases instead.
I think there is much work left to support weak in a better way.
Cheers,
Kai
| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.