aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@imgtec.com>2017-10-23 15:39:46 +0100
committerMaciej W. Rozycki <macro@imgtec.com>2017-10-23 15:39:46 +0100
commitdefc8e2b3576c28fd5651763348ae23c18a94170 (patch)
treecba196c96f3af1293b8d9140c53f48187bcdc0c0 /gas
parentee6872beb1912af41a506c8aea34af7d2f873d04 (diff)
downloadfsf-binutils-gdb-defc8e2b3576c28fd5651763348ae23c18a94170.zip
fsf-binutils-gdb-defc8e2b3576c28fd5651763348ae23c18a94170.tar.gz
fsf-binutils-gdb-defc8e2b3576c28fd5651763348ae23c18a94170.tar.bz2
MIPS: Preset EF_MIPS_ABI2 with n32 ELF objects
Fix a bug in MIPS n32 ELF object file generation and make such objects consistent with the n32 BFD requested, by presetting the EF_MIPS_ABI2 flag in the `e_flags' member of the newly created ELF file header, as it is this flag that tells n32 objects apart from o32 objects. This flag will then stay set through to output file generation for writers such as GAS or GDB's `generate-core-file' command. Readers will overwrite the whole of `e_flags' along with the rest of the ELF file header in `elf_swap_ehdr_in' and then verify in `mips_elf_n32_object_p' that the flag is still set before accepting an input file as an n32 object. The issue was discovered with GDB's `generate-core-file' command making o32 core files out of n32 debuggees. bfd/ * elfn32-mips.c (mips_elf_n32_mkobject): New prototype and function. (bfd_elf32_mkobject): Use `mips_elf_n32_mkobject' rather than `_bfd_mips_elf_mkobject'. gas/ * config/tc-mips.c (mips_elf_final_processing): Don't set EF_MIPS_ABI2 in `e_flags'.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-mips.c4
2 files changed, 6 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index af915ff..44debdc 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2017-10-23 Maciej W. Rozycki <macro@imgtec.com>
+
+ * config/tc-mips.c (mips_elf_final_processing): Don't set
+ EF_MIPS_ABI2 in `e_flags'.
+
2017-10-22 Hans-Peter Nilsson <hp@axis.com>
PR gas/22304
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index e4351f7..040a373 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -19140,10 +19140,8 @@ mips_elf_final_processing (void)
else
elf_elfheader (stdoutput)->e_flags |= E_MIPS_ABI_EABI32;
}
- else if (mips_abi == N32_ABI)
- elf_elfheader (stdoutput)->e_flags |= EF_MIPS_ABI2;
- /* Nothing to do for N64_ABI. */
+ /* Nothing to do for N32_ABI or N64_ABI. */
if (mips_32bitmode)
elf_elfheader (stdoutput)->e_flags |= EF_MIPS_32BITMODE;