This is the mail archive of the binutils@sources.redhat.com 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]

pe-i386 reloc overflow


Hi,

I'm currently trying to get to the bottom of why 'ld -r' appears
to generate ill-formed object files when the number of relocations
in the output exceed the WORD-sized limit in the COFF section
header using the pe-i386 backend. My grasp of the internals of
BFD and the COFF / PE backend is limited (to say the least),
but here's my take on what's (failing) to happen:

The linker calls bfd_coff_final_link(), which after having prepared
the output BFD, finally sets the 'symcount' field of the output BFD
to zero. When that BFD is then finally closed, and the relocation
overflow handling code in coff_write_relocs() is supposed to
be called via coff_write_object_contents(), this never happens
as it is conditional on 'symcount' being non-zero. (line 3815
of coffcode.h - binutils version 2.11.92 20011112 on a
i386-pc-mingw32 platform). So, as far as I can tell, the
reloc overflow handling code never kicks in, with the upshot
that an ill-formed object file is generated via the following
'ld' invocation:

   ld -r -x -o out.o <bunch of object files>

('ill-formed' in the sense that objdump / nm crashes when being
passed out.o as input).

Apologies for being so verbose; anyone know / have an
inkling as to what might be going wrong here?

cheers,
--sigbjorn  http://www.galois.com/~sof/

If it helps, I can make available a repro case which shows up the
problem.



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