diff options
author | Alan Modra <amodra@gmail.com> | 2014-10-16 09:38:09 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-10-16 11:22:14 +1030 |
commit | 459609d6f8f65d4b4440385499b84cc8c1804f65 (patch) | |
tree | 4d10b3336f05717fd4eb4a5554a3e245b635008b /ld/emultempl/ppc64elf.em | |
parent | 983037647b9ffd052df16fb8e6abfe7e3e8c0683 (diff) | |
download | gdb-459609d6f8f65d4b4440385499b84cc8c1804f65.zip gdb-459609d6f8f65d4b4440385499b84cc8c1804f65.tar.gz gdb-459609d6f8f65d4b4440385499b84cc8c1804f65.tar.bz2 |
PR17488, powerpc64-linux-ld segfault
For binary ouput, we don't have an ELF bfd output so can't access
elf_elfheader. The elf64-ppc.c changes are really just a tidy,
triggered by looking at all places where the abiversion bits are
accessed.
bfd/
* elf64-ppc.c (ppc64_elf_before_check_relocs): Do .opd processing
even when output is not ppc64 ELF. Remove redundant tests on
type of input bfd.
ld/
PR 17488
* emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Don't attempt
to access ELF header e_flags when not ppc64 ELF output.
Diffstat (limited to 'ld/emultempl/ppc64elf.em')
-rw-r--r-- | ld/emultempl/ppc64elf.em | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ld/emultempl/ppc64elf.em b/ld/emultempl/ppc64elf.em index 914fc52..59ea786 100644 --- a/ld/emultempl/ppc64elf.em +++ b/ld/emultempl/ppc64elf.em @@ -531,7 +531,8 @@ gld${EMULATION_NAME}_finish (void) /* e_entry on PowerPC64 points to the function descriptor for _start. If _start is missing, default to the first function descriptor in the .opd section. */ - if ((elf_elfheader (link_info.output_bfd)->e_flags & EF_PPC64_ABI) == 1) + if (stub_file != NULL + && (elf_elfheader (link_info.output_bfd)->e_flags & EF_PPC64_ABI) == 1) entry_section = ".opd"; if (params.emit_stub_syms < 0) |