This is the mail archive of the
mailing list for the GCC project.
[committed] Record the -mlong option used for MIPS EABI
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 22 May 2004 20:46:03 +0100
- Subject: [committed] Record the -mlong option used for MIPS EABI
The MIPS EABI32 has 32-bit longs and the EABI64 has 64-bit longs. However,
as an extension, gcc has traditionally allowed both variants to use either
size of long, i.e. -mgp32/-mlong64 and -mgp64/-mlong32. The latter is very
useful, the former... less so.
Anyway, these variations are not recorded in the executable, which makes life
difficult for tools like GDB. This patch therefore adds a special GCC-specific
section to record the size of longs.
Tested on mipsisa64-elf, applied to head.
* config/mips/mips.c (mips_file_start): Emit a .gcc_compiled_longXX
section when generating EABI code.
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.c,v
retrieving revision 1.415
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.415 mips.c
*** config/mips/mips.c 13 May 2004 06:40:01 -0000 1.415
--- config/mips/mips.c 22 May 2004 19:30:27 -0000
*************** mips_file_start (void)
*** 5873,5878 ****
--- 5873,5885 ----
fprintf (asm_out_file, "\t.section .mdebug.%s\n", abi_string);
+ /* There is no ELF header flag to distinguish long32 forms of the
+ EABI from long64 forms. Emit a special section to help tools
+ such as GDB. */
+ if (mips_abi == ABI_EABI)
+ fprintf (asm_out_file, "\t.section .gcc_compiled_long%d\n",
+ TARGET_LONG64 ? 64 : 32);
/* Restore the default section. */
fprintf (asm_out_file, "\t.previous\n");