This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Embellishing fbsd_* emulations
All of the header is zeroed in bfd_elf_mkobject, so don't bother here.
* elf.c (prep_headers): Don't zero EI_OSABI, EI_ABIVERSION or
header pad.
Besides removing some redundant code, this allows people who want to
do weird things with EI_OSABI to make changes any time after ld opens
the output file.
--
Alan Modra
IBM OzLabs - Linux Technology Centre
Index: bfd/elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.136
diff -u -p -r1.136 elf.c
--- bfd/elf.c 4 Apr 2002 19:53:35 -0000 1.136
+++ bfd/elf.c 12 Apr 2002 03:09:59 -0000
@@ -3881,7 +3881,6 @@ prep_headers (abfd)
Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */
Elf_Internal_Phdr *i_phdrp = 0; /* Program header table, internal form */
Elf_Internal_Shdr **i_shdrp; /* Section header table, internal form */
- int count;
struct elf_strtab_hash *shstrtab;
struct elf_backend_data *bed = get_elf_backend_data (abfd);
@@ -3903,12 +3902,6 @@ prep_headers (abfd)
i_ehdrp->e_ident[EI_DATA] =
bfd_big_endian (abfd) ? ELFDATA2MSB : ELFDATA2LSB;
i_ehdrp->e_ident[EI_VERSION] = bed->s->ev_current;
-
- i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_NONE;
- i_ehdrp->e_ident[EI_ABIVERSION] = 0;
-
- for (count = EI_PAD; count < EI_NIDENT; count++)
- i_ehdrp->e_ident[count] = 0;
if ((abfd->flags & DYNAMIC) != 0)
i_ehdrp->e_type = ET_DYN;