summaryrefslogtreecommitdiff
path: root/ld/ld.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2009-11-26 13:45:25 +0000
committerNick Clifton <nickc@redhat.com>2009-11-26 13:45:25 +0000
commit28d5f6774058f4c7d5141b1dda8b76ee81f8cf4f (patch)
treed2a5b9ce35ec5ae61d04c98564ff51460d3ec818 /ld/ld.h
parentf1b9c60a8f8a6471f328fd1e1744c8592f63dd59 (diff)
PR ld/10956
* ld.h (struct args_type): Rename 'relax' field to 'disable_target_specific_optimizations' and turn it into a tri-state variable. (RELAXATION_DISABLED_BY_DEFAULT): New macro. (RELAXATION_DISABLED_BY_USER): New macro. (RELAXATION_ENABLED): New macro. (DISABLE_RELAXATION): New macro. (ENABLE_RELAXATION): New macro. * lexsup (enum option_values): Add OPTION_NO_RELAX. (struct ld_options): Add --no-relax. (parse_args): Handle OPTION_NO_RELAX. Use DISABLE_RELAXATION and ENABLE_RELAXATION macros. * ldlang.c (lang_relax_sections): Use RELAXATION_ENABLED macro. (lang_process): Likewise. * ldmain.c (main): Initialise disable_target_specific_optimizations field. (multiple_definition): Use RELAXATION_ENABLED macro. * ld.texinfo: Document new command line option. * emultempl/alphaelf.em: Remove --no-relax option. (before_allocation): Test RELAXATION_DISABLED_BY_USER macro. Use ENABLE_RELAXATION macro. * emultempl/avrelf.em: (after_allocation): Test RELAXATION_ENABLED macro. * emultempl/cr16elf.em: Remove --no-relax option. (before_allocation): Test RELAXATION_DISABLED_BY_USER macro. Use ENABLE_RELAXATION macro. * emultempl/crxelf.em: Remove --no-relax option. (before_allocation): Test RELAXATION_DISABLED_BY_USER macro. Use ENABLE_RELAXATION macro. * emultempl/mmix-elfnmmo.em: (before_allocation): Use ENABLE_RELAXATION macro. * emultempl/needrelax.em: (before_allocation): Use ENABLE_RELAXATION macro. * emultempl/ppc32elf.em: (before_allocation): Test RELAXATION_DISABLED_BY_DEFAULT macro. Use ENABLE_RELAXATION macro. * emultempl/sh64elf.em: (before_allocation): Test RELAXATION_ENABLED macro. Use DISABLE_RELAXATION macro. * emultempl/xtensaelf.em: Remove --no-relax option. (before_allocation): Test RELAXATION_ENABLED macro. Use ENABLE_RELAXATION macro.
Diffstat (limited to 'ld/ld.h')
-rw-r--r--ld/ld.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/ld/ld.h b/ld/ld.h
index 10d2b33827..aa0979d6f2 100644
--- a/ld/ld.h
+++ b/ld/ld.h
@@ -146,7 +146,29 @@ typedef struct {
/* 1 => do not assign addresses to common symbols. */
bfd_boolean inhibit_common_definition;
- bfd_boolean relax;
+
+ /* Enable or disable target specific optimizations.
+
+ Not all targets have optimizations to enable.
+
+ Normally these optimizations are disabled by default but some targets
+ prefer to enable them by default. So this field is a tri-state variable.
+ The values are:
+
+ zero: Enable the optimizations (either from --relax being specified on
+ the command line or the backend's before_allocation emulation function.
+
+ positive: The user has requested that these optimizations be disabled.
+ (Via the --no-relax command line option).
+
+ negative: The optimizations are disabled. (Set when initializing the
+ args_type structure in ldmain.c:main. */
+ signed int disable_target_specific_optimizations;
+#define RELAXATION_DISABLED_BY_DEFAULT (command_line.disable_target_specific_optimizations < 0)
+#define RELAXATION_DISABLED_BY_USER (command_line.disable_target_specific_optimizations > 0)
+#define RELAXATION_ENABLED (command_line.disable_target_specific_optimizations == 0)
+#define DISABLE_RELAXATION do { command_line.disable_target_specific_optimizations = 1; } while (0)
+#define ENABLE_RELAXATION do { command_line.disable_target_specific_optimizations = 0; } while (0)
/* If TRUE, build MIPS embedded PIC relocation tables in the output
file. */