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: [PATCH-bfd] i386-mingw32-ld crash on x86_64 linux


On Thu, Apr 16, 2009 at 05:16:24AM +0100, Dave Korn wrote:
 
>   Well, the strcmp->strncmp bit is correct.  The changes to zero out _n_zeroes
> and _n_offsets... no, not really.  I mean, they're not wrong, but I don't
> think we should check in patches that we don't know how or why they work; that
> way cargo-cult programming lies.  If the code requires more than one member of
> a *union* to be initialised in order to work correctly, that means that
> somewhere down the line we're probably actually doing something undefined or
> invalid when it comes to accessing that union.

Thanks for pushing on this, I was tired of looking at ld in gdb, and
wanted it to stop :)

As for using objdump, on the complete test case from the customer, I
get:
% /opt/build/binutils-2.19.1/build-binutils/binutils/objdump -s __test.a
BFD: BFD (GNU Binutils) 2.19.1 internal error, aborting at ../../bfd/coffcode.h line 842 in handle_COMDAT

BFD: Please report this bug.

This version of coffcodegen.h has:
                if (! (isym.n_sclass == C_STAT
                       && isym.n_type == T_NULL
                       && isym.n_value == 0))
                  abort ();

I guess you'll want more details on that too, please let me know what
you need.

Anyway, fixing the next couple of cases of expecting _n_name to be null
terminated fixes the crash, and the output no longer contains the
'0xdabedabe' sequence that I tested with.

It looks like this code does not handle the case where the section name
is longer than 8 bytes and is some kind of ascii representation of a
decimal offset into the string table?

Anyway, crash is gone, and I no longer feel like a cargo-cult
programmer!

Thanks very much!
Peter
-- 
Peter O'Gorman
pogma@thewrittenword.com

Attachment: bfd-peXXgen.c.patch
Description: Text document


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