aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorJulian Brown <julian@codesourcery.com>2007-01-29 16:28:40 +0000
committerJulian Brown <julian@codesourcery.com>2007-01-29 16:28:40 +0000
commitc6dd86c69582aa64a638c2ddef7cd6a6ae769a71 (patch)
tree98f878eeede475506c4cbaa03c4ed2223d1d5296 /ld/emultempl
parentb785d0e12194800df53b5efca6b6dc47c73e975e (diff)
downloadgdb-c6dd86c69582aa64a638c2ddef7cd6a6ae769a71.zip
gdb-c6dd86c69582aa64a638c2ddef7cd6a6ae769a71.tar.gz
gdb-c6dd86c69582aa64a638c2ddef7cd6a6ae769a71.tar.bz2
* NEWS: Mention --vfp11-denorm-fix option.
* ld.texinfo: Document above. * emulparams/armelf_linux.sh (OTHER_TEXT_SECTIONS): Add .vfp11_veneer section. * emulparams/armelf.sh (OTHER_TEXT_SECTIONS): Likewise. * emultempl/armelf.em (vfp11_denorm_fix): New static variable. (arm_elf_before_allocation): Call bfd_elf32_arm_set_vfp11_fix, bfd_elf32_arm_init_maps and bfd_elf32_arm_vfp11_erratum_scan. (arm_elf_after_allocation): New function. Call bfd_elf32_arm_vfp11_fix_veneer_locations for all input statements. (arm_elf_create_output_section_statements): Pass vfp11 fix command line option to BFD. (OPTION_VFP11_DENORM_FIX): New option. (PARSE_AND_LIST_LONGOPTS): Handle new option. (PARSE_AND_LIST_OPTIONS): Likewise. (PARSE_AND_LIST_ARGS_CASES): Likewise. (LDEMUL_AFTER_ALLOCATION): Define.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/armelf.em44
1 files changed, 42 insertions, 2 deletions
diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em
index d52d387..4522a8b 100644
--- a/ld/emultempl/armelf.em
+++ b/ld/emultempl/armelf.em
@@ -35,6 +35,7 @@ static int target1_is_rel = 0${TARGET1_IS_REL};
static char *target2_type = "${TARGET2_TYPE}";
static int fix_v4bx = 0;
static int use_blx = 0;
+static bfd_arm_vfp11_fix vfp11_denorm_fix = BFD_ARM_VFP11_FIX_DEFAULT;
static void
gld${EMULATION_NAME}_before_parse (void)
@@ -124,6 +125,10 @@ arm_elf_before_allocation (void)
bfd_elf32_arm_set_byteswap_code (&link_info, byteswap_code);
+ /* Choose type of VFP11 erratum fix, or warn if specified fix is unnecessary
+ due to architecture version. */
+ bfd_elf32_arm_set_vfp11_fix (output_bfd, &link_info);
+
/* We should be able to set the size of the interworking stub section. We
can't do it until later if we have dynamic sections, though. */
if (! elf_hash_table (&link_info)->dynamic_sections_created)
@@ -131,8 +136,12 @@ arm_elf_before_allocation (void)
/* Here we rummage through the found bfds to collect glue information. */
LANG_FOR_EACH_INPUT_STATEMENT (is)
{
+ /* Initialise mapping tables for code/data. */
+ bfd_elf32_arm_init_maps (is->the_bfd);
+
if (!bfd_elf32_arm_process_before_allocation (is->the_bfd,
- &link_info))
+ &link_info)
+ || !bfd_elf32_arm_vfp11_erratum_scan (is->the_bfd, &link_info))
/* xgettext:c-format */
einfo (_("Errors encountered processing file %s"), is->filename);
}
@@ -146,6 +155,22 @@ arm_elf_before_allocation (void)
}
static void
+arm_elf_after_allocation (void)
+{
+ /* Call the standard elf routine. */
+ after_allocation_default ();
+
+ {
+ LANG_FOR_EACH_INPUT_STATEMENT (is)
+ {
+ /* Figure out where VFP11 erratum veneers (and the labels returning
+ from same) have been placed. */
+ bfd_elf32_arm_vfp11_fix_veneer_locations (is->the_bfd, &link_info);
+ }
+ }
+}
+
+static void
arm_elf_finish (void)
{
struct bfd_link_hash_entry * h;
@@ -214,7 +239,7 @@ static void
arm_elf_create_output_section_statements (void)
{
bfd_elf32_arm_set_target_relocs (&link_info, target1_is_rel, target2_type,
- fix_v4bx, use_blx);
+ fix_v4bx, use_blx, vfp11_denorm_fix);
}
EOF
@@ -230,6 +255,7 @@ PARSE_AND_LIST_PROLOGUE='
#define OPTION_TARGET2 305
#define OPTION_FIX_V4BX 306
#define OPTION_USE_BLX 307
+#define OPTION_VFP11_DENORM_FIX 308
'
PARSE_AND_LIST_SHORTOPTS=p
@@ -243,6 +269,7 @@ PARSE_AND_LIST_LONGOPTS='
{ "target2", required_argument, NULL, OPTION_TARGET2},
{ "fix-v4bx", no_argument, NULL, OPTION_FIX_V4BX},
{ "use-blx", no_argument, NULL, OPTION_USE_BLX},
+ { "vfp11-denorm-fix", required_argument, NULL, OPTION_VFP11_DENORM_FIX},
'
PARSE_AND_LIST_OPTIONS='
@@ -253,6 +280,7 @@ PARSE_AND_LIST_OPTIONS='
fprintf (file, _(" --target2=<type> Specify definition of R_ARM_TARGET2\n"));
fprintf (file, _(" --fix-v4bx Rewrite BX rn as MOV pc, rn for ARMv4\n"));
fprintf (file, _(" --use-blx Enable use of BLX instructions\n"));
+ fprintf (file, _(" --vfp11-denorm-fix Specify how to fix VFP11 denorm erratum\n"));
'
PARSE_AND_LIST_ARGS_CASES='
@@ -287,12 +315,24 @@ PARSE_AND_LIST_ARGS_CASES='
case OPTION_USE_BLX:
use_blx = 1;
break;
+
+ case OPTION_VFP11_DENORM_FIX:
+ if (strcmp (optarg, "none") == 0)
+ vfp11_denorm_fix = BFD_ARM_VFP11_FIX_NONE;
+ else if (strcmp (optarg, "scalar") == 0)
+ vfp11_denorm_fix = BFD_ARM_VFP11_FIX_SCALAR;
+ else if (strcmp (optarg, "vector") == 0)
+ vfp11_denorm_fix = BFD_ARM_VFP11_FIX_VECTOR;
+ else
+ einfo (_("Unrecognized VFP11 fix type '\''%s'\''.\n"), optarg);
+ break;
'
# We have our own after_open and before_allocation functions, but they call
# the standard routines, so give them a different name.
LDEMUL_AFTER_OPEN=arm_elf_after_open
LDEMUL_BEFORE_ALLOCATION=arm_elf_before_allocation
+LDEMUL_AFTER_ALLOCATION=arm_elf_after_allocation
LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=arm_elf_create_output_section_statements
# Replace the elf before_parse function with our own.