aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/mipself.em26
1 files changed, 24 insertions, 2 deletions
diff --git a/ld/emultempl/mipself.em b/ld/emultempl/mipself.em
index d9eeef3..ec908d7 100644
--- a/ld/emultempl/mipself.em
+++ b/ld/emultempl/mipself.em
@@ -44,6 +44,7 @@ static bfd *stub_bfd;
static bfd_boolean insn32;
static bfd_boolean ignore_branch_isa;
+static bfd_boolean compact_branches;
static void
mips_after_parse (void)
@@ -216,7 +217,10 @@ mips_create_output_section_statements (void)
${gnu_target});
if (is_mips_elf (link_info.output_bfd))
- _bfd_mips_elf_init_stubs (&link_info, mips_add_stub_section);
+ {
+ _bfd_mips_elf_compact_branches (&link_info, compact_branches);
+ _bfd_mips_elf_init_stubs (&link_info, mips_add_stub_section);
+ }
}
/* This is called after we have merged the private data of the input bfds. */
@@ -269,7 +273,9 @@ enum
OPTION_INSN32 = 301,
OPTION_NO_INSN32,
OPTION_IGNORE_BRANCH_ISA,
- OPTION_NO_IGNORE_BRANCH_ISA
+ OPTION_NO_IGNORE_BRANCH_ISA,
+ OPTION_COMPACT_BRANCHES,
+ OPTION_NO_COMPACT_BRANCHES
};
'
@@ -278,6 +284,8 @@ PARSE_AND_LIST_LONGOPTS='
{ "no-insn32", no_argument, NULL, OPTION_NO_INSN32 },
{ "ignore-branch-isa", no_argument, NULL, OPTION_IGNORE_BRANCH_ISA },
{ "no-ignore-branch-isa", no_argument, NULL, OPTION_NO_IGNORE_BRANCH_ISA },
+ { "compact-branches", no_argument, NULL, OPTION_COMPACT_BRANCHES },
+ { "no-compact-branches", no_argument, NULL, OPTION_NO_COMPACT_BRANCHES },
'
PARSE_AND_LIST_OPTIONS='
@@ -295,6 +303,12 @@ PARSE_AND_LIST_OPTIONS='
--no-ignore-branch-isa Reject invalid branch relocations requiring\n\
an ISA mode switch\n"
));
+ fprintf (file, _("\
+ --compact-branches Generate compact branches/jumps for MIPS R6\n"
+ ));
+ fprintf (file, _("\
+ --no-compact-branches Generate delay slot branches/jumps for MIPS R6\n"
+ ));
'
PARSE_AND_LIST_ARGS_CASES='
@@ -313,6 +327,14 @@ PARSE_AND_LIST_ARGS_CASES='
case OPTION_NO_IGNORE_BRANCH_ISA:
ignore_branch_isa = FALSE;
break;
+
+ case OPTION_COMPACT_BRANCHES:
+ compact_branches = TRUE;
+ break;
+
+ case OPTION_NO_COMPACT_BRANCHES:
+ compact_branches = FALSE;
+ break;
'
LDEMUL_AFTER_PARSE=mips_after_parse