This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: objcopy test failure on mips-linux
>>>>> Ian Lance Taylor writes:
> From: Andreas Jaeger <aj@suse.de>
> Date: 14 Mar 2000 19:54:31 +0100
> Why is a rela.text section output at all? The section has size 0.
> I have no idea. I am surprised to see one.
The problem seems to these lines in function
_bfd_mips_elf_fake_section of file elf32-mips.c:
/* The generic elf_fake_sections will set up REL_HDR using the
default kind of relocations. But, we may actually need both
kinds of relocations, so we set up the second header here. */
if ((sec->flags & SEC_RELOC) != 0)
{
struct bfd_elf_section_data *esd;
esd = elf_section_data (sec);
BFD_ASSERT (esd->rel_hdr2 == NULL);
esd->rel_hdr2
= (Elf_Internal_Shdr *) bfd_zalloc (abfd, sizeof (Elf_Internal_Shdr));
if (!esd->rel_hdr2)
return false;
_bfd_elf_init_reloc_shdr (abfd, esd->rel_hdr2, sec,
!elf_section_data (sec)->use_rela_p);
}
This has been introduced by Mark Mitchel in revision 1.12 of the file:
1999-07-01 Mark Mitchell <mark@codesourcery.com>
* elf32-mips.c (_bfd_mips_elf_fake_sections): Use
_bfd_elf_init_reloc_shdr to initialize rel_hdr2.
Mark, can you comment on this, please? This part doesn't look correct
to me (read the whole thread for details, I can send it if you need
it). It breaks objcopy and creates empty rea.text sections :-(.
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.rhein-neckar.de