Bug 10956 - Missing --no-relax option
Summary: Missing --no-relax option
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.21
: P2 enhancement
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-14 02:24 UTC by Richard Henderson
Modified: 2009-11-26 13:49 UTC (History)
1 user (show)

See Also:
Host:
Target: ia64-*
Build:
Last reconfirmed:


Attachments
Implement --no-relax as a generic linker command line option (5.66 KB, patch)
2009-11-24 15:15 UTC, Nick Clifton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Henderson 2009-11-14 02:24:14 UTC
Other default-to-on relaxation targets have this option,
and it is very useful in order to work around linker bugs.
Comment 1 Nick Clifton 2009-11-24 15:15:22 UTC
Created attachment 4414 [details]
Implement --no-relax as a generic linker command line option
Comment 2 Nick Clifton 2009-11-24 15:16:04 UTC
Hi Richard,

  How about this patch ?

Cheers
  Nick
Comment 3 Richard Henderson 2009-11-24 16:17:36 UTC
-   bfd_boolean relax;
+   signed int disable_target_specific_optimizations;

Why rename it to "target_specific_optimizations"?  It's still relaxation.
I do like the macros though.  You could stand to use them in the main ld
files as well as the target files.

The patch otherwise looks much better.
Comment 4 Sourceware Commits 2009-11-26 13:45:48 UTC
Subject: Bug 10956

CVSROOT:	/cvs/src
Module name:	src
Changes by:	nickc@sourceware.org	2009-11-26 13:45:26

Modified files:
	ld             : ChangeLog ld.h ld.texinfo ldlang.c ldmain.c 
	                 lexsup.c 
	ld/emultempl   : alphaelf.em avrelf.em cr16elf.em crxelf.em 
	                 mmix-elfnmmo.em needrelax.em ppc32elf.em 
	                 sh64elf.em xtensaelf.em 

Log message:
	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.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/ChangeLog.diff?cvsroot=src&r1=1.2085&r2=1.2086
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/ld.h.diff?cvsroot=src&r1=1.45&r2=1.46
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/ld.texinfo.diff?cvsroot=src&r1=1.254&r2=1.255
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/ldlang.c.diff?cvsroot=src&r1=1.325&r2=1.326
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/ldmain.c.diff?cvsroot=src&r1=1.141&r2=1.142
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/lexsup.c.diff?cvsroot=src&r1=1.116&r2=1.117
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/alphaelf.em.diff?cvsroot=src&r1=1.15&r2=1.16
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/avrelf.em.diff?cvsroot=src&r1=1.9&r2=1.10
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/cr16elf.em.diff?cvsroot=src&r1=1.6&r2=1.7
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/crxelf.em.diff?cvsroot=src&r1=1.7&r2=1.8
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/mmix-elfnmmo.em.diff?cvsroot=src&r1=1.17&r2=1.18
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/needrelax.em.diff?cvsroot=src&r1=1.8&r2=1.9
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/ppc32elf.em.diff?cvsroot=src&r1=1.23&r2=1.24
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/sh64elf.em.diff?cvsroot=src&r1=1.16&r2=1.17
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/xtensaelf.em.diff?cvsroot=src&r1=1.23&r2=1.24

Comment 5 Nick Clifton 2009-11-26 13:49:11 UTC
Hi Richard,

> Why rename it to "target_specific_optimizations"?  It's still relaxation.

Because for some targets the command line option is used to enable other
optimizations, not just relaxation.

I have checked the patch in, along with the use of the new macros in the generic
ld files.

Cheers
  Nick