aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>1998-04-15 23:09:52 +0000
committerRichard Henderson <rth@redhat.com>1998-04-15 23:09:52 +0000
commitb356d4afd6c3e7a2f5dcf62c91cbd312555ce9e3 (patch)
treeb180c882300e4fa74871986aa28a8110ff472250 /bfd/elf.c
parentc02e446b0b9136116e04e7b24cbda99f263dc793 (diff)
downloadgdb-b356d4afd6c3e7a2f5dcf62c91cbd312555ce9e3.zip
gdb-b356d4afd6c3e7a2f5dcf62c91cbd312555ce9e3.tar.gz
gdb-b356d4afd6c3e7a2f5dcf62c91cbd312555ce9e3.tar.bz2
* elf.c (prep_headers): Use new EM_SPARCV9 symbol.
* elf64-sparc.c (ELF_MACHINE_CODE): Likewise. (ELF_MACHINE_ALT1): New. Set to EM_OLD_SPARC64.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 5ea5107..954207e 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -2855,7 +2855,7 @@ prep_headers (abfd)
break;
case bfd_arch_sparc:
if (bed->s->arch_size == 64)
- i_ehdrp->e_machine = EM_SPARC64;
+ i_ehdrp->e_machine = EM_SPARCV9;
else
i_ehdrp->e_machine = EM_SPARC;
break;
@@ -3274,10 +3274,12 @@ _bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec)
{
asection *s;
- /* Only set up the segments when all the sections have been set
- up. */
- for (s = ibfd->sections; s != NULL; s = s->next)
- if (s->output_section == NULL)
+ /* Only set up the segments if there are no more SEC_ALLOC
+ sections. FIXME: This won't do the right thing if objcopy is
+ used to remove the last SEC_ALLOC section, since objcopy
+ won't call this routine in that case. */
+ for (s = isec->next; s != NULL; s = s->next)
+ if ((s->flags & SEC_ALLOC) != 0)
break;
if (s == NULL)
{