aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorGavin Romig-Koch <gavin@redhat.com>1998-12-15 14:10:46 +0000
committerGavin Romig-Koch <gavin@redhat.com>1998-12-15 14:10:46 +0000
commit02650bd0a97e811838a207da56505e16f1209ae9 (patch)
tree398f4e5620b0cf6c712d3d061566f1e2169968f0 /gas
parent759181e384bb9bda3b8f0219384d42866474ef49 (diff)
downloadgdb-02650bd0a97e811838a207da56505e16f1209ae9.zip
gdb-02650bd0a97e811838a207da56505e16f1209ae9.tar.gz
gdb-02650bd0a97e811838a207da56505e16f1209ae9.tar.bz2
This adds ABI flags to MIPS/ELF object files.
For bfd: * elf32-mips.c (elf_mips_abi_name): New. (_bfd_mips_elf_merge_private_bfd_data): Compare EF_MIPS_ABI flags. For gas: * config/tc-mips.c (mips_abi_string): New. (md_parse_option,md_longopts): Add mabi. (mips_elf_final_processing): Set e_flags based on mabi flag. For gcc: * config/mips/mips.h (GAS_ASM_SPEC): Pass mabi to gas. (ABI_GAS_ASM_SPEC,abi_gas_asm_spec): New. (EXTRA_SPECS): Added ABI_GAS_ASM_SPEC,abi_gas_asm_spec. For include/elf: * mips.h (EF_MIPS_ABI,E_MIPS_ABI_O32,E_MIPS_ABI_O64, E_MIPS_ABI_EABI32,E_MIPS_ABI_EABI64):
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-mips.c33
2 files changed, 38 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 3a6a5ec..253c061 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+1998-12-15 Gavin Romig-Koch <gavin@cygnus.com>
+
+ * config/tc-mips.c (mips_abi_string): New.
+ (md_parse_option,md_longopts): Add mabi.
+ (mips_elf_final_processing): Set e_flags based on mabi flag.
+
start-sanitize-vr4xxx
1998-12-15 Gavin Romig-Koch <gavin@cygnus.com>
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 674464e..3de536d 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -198,6 +198,9 @@ static int file_mips_isa;
/* The CPU type as a number: 2000, 3000, 4000, 4400, etc. */
static int mips_cpu = -1;
+/* The argument of the -mabi= flag. */
+static char* mips_abi_string = 0;
+
/* Whether the 4650 instructions (mad/madu) are permitted. */
static int mips_4650 = -1;
@@ -9449,8 +9452,8 @@ struct option md_longopts[] = {
{"fix-4011-branch-bug", no_argument, NULL, OPTION_FIX_4011_BRANCH_BUG},
#define OPTION_NO_FIX_4011_BRANCH_BUG (OPTION_MD_BASE + 35)
{"no-fix-4011-branch-bug", no_argument, NULL, OPTION_NO_FIX_4011_BRANCH_BUG},
- /* end-sanitize-branchbug4011 */
+ /* end-sanitize-branchbug4011 */
/* start-sanitize-vr4xxx */
#define OPTION_M4121 (OPTION_MD_BASE + 36)
{"m4121", no_argument, NULL, OPTION_M4121},
@@ -9458,6 +9461,9 @@ struct option md_longopts[] = {
{"no-m4121", no_argument, NULL, OPTION_NO_M4121},
/* end-sanitize-vr4xxx */
+#define OPTION_MABI (OPTION_MD_BASE + 38)
+ {"mabi", required_argument, NULL, OPTION_MABI},
+
#define OPTION_CALL_SHARED (OPTION_MD_BASE + 7)
#define OPTION_NON_SHARED (OPTION_MD_BASE + 8)
#define OPTION_XGOT (OPTION_MD_BASE + 19)
@@ -9868,6 +9874,16 @@ md_parse_option (c, arg)
break;
/* end-sanitize-branchbug4011 */
+
+ case OPTION_MABI:
+ if (strcmp (arg,"32") == 0
+ || strcmp (arg,"n32") == 0
+ || strcmp (arg,"64") == 0
+ || strcmp (arg,"o64") == 0
+ || strcmp (arg,"eabi") == 0)
+ mips_abi_string = arg;
+ break;
+
default:
return 0;
}
@@ -12066,6 +12082,21 @@ mips_elf_final_processing ()
elf_elfheader (stdoutput)->e_flags |= EF_MIPS_NOREORDER;
if (mips_pic != NO_PIC)
elf_elfheader (stdoutput)->e_flags |= EF_MIPS_PIC;
+
+ /* Set the MIPS ELF ABI flags. */
+ if (mips_abi_string == 0)
+ ;
+ else if (strcmp (mips_abi_string,"32") == 0)
+ elf_elfheader (stdoutput)->e_flags |= E_MIPS_ABI_O32;
+ else if (strcmp (mips_abi_string,"o64") == 0)
+ elf_elfheader (stdoutput)->e_flags |= E_MIPS_ABI_O64;
+ else if (strcmp (mips_abi_string,"eabi") == 0)
+ {
+ if (mips_opts.isa > 2)
+ elf_elfheader (stdoutput)->e_flags |= E_MIPS_ABI_EABI32;
+ else
+ elf_elfheader (stdoutput)->e_flags |= E_MIPS_ABI_EABI64;
+ }
}
#endif /* OBJ_ELF || OBJ_MAYBE_ELF */