[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 2.15 binutils ld --emit-relocs generates corrupt ELF
From: |
Alan Modra |
Subject: |
Re: 2.15 binutils ld --emit-relocs generates corrupt ELF |
Date: |
Tue, 10 Aug 2004 12:40:17 +0930 |
User-agent: |
Mutt/1.4i |
On Mon, Aug 09, 2004 at 05:18:29PM -0700, Kyle McKay wrote:
> Please notice the values in the "Off" column for sections 2,4,6,8,10,15
> & 16. They are all the same value. It turns out the ELF file is
Yes, known bug. I expect this was caused by an accidental commit of
code to binutils-2.15 CVS. The following should fix the problem.
* elf.c (assign_file_positions_except_relocs): Revert unintended
change from 2004-04-08.
Index: bfd/elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.217.4.2
diff -u -p -r1.217.4.2 elf.c
--- bfd/elf.c 8 Apr 2004 12:41:36 -0000 1.217.4.2
+++ bfd/elf.c 10 Aug 2004 03:09:39 -0000
@@ -4265,7 +4265,9 @@ assign_file_positions_except_relocs (bfd
off = _bfd_elf_assign_file_position_for_section (hdr, off,
FALSE);
}
- else if (hdr == i_shdrpp[tdata->symtab_section]
+ else if (hdr->sh_type == SHT_REL
+ || hdr->sh_type == SHT_RELA
+ || hdr == i_shdrpp[tdata->symtab_section]
|| hdr == i_shdrpp[tdata->symtab_shndx_section]
|| hdr == i_shdrpp[tdata->strtab_section])
hdr->sh_offset = -1;
--
Alan Modra
IBM OzLabs - Linux Technology Centre