This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH for PR 20824] enable --warn-shared-textrel by default
- From: Nick Clifton <nickc at redhat dot com>
- To: ma dot jiang at zte dot com dot cn, binutils at sourceware dot org
- Date: Fri, 18 Nov 2016 10:20:57 +0000
- Subject: Re: [PATCH for PR 20824] enable --warn-shared-textrel by default
- Authentication-results: sourceware.org; auth=none
- References: <OF4BC5672C.E813E028-ON4825806E.003EBC41-4825806E.003EC89C@zte.com.cn>
Hi Ma,
> GNU-ld now disabled --warn-shared-textrel by default. IMO, it should be
> enabled by default,
Just to be clear - why do you feel that this should be the default ?
> I'm told to send the patch here for discussions, sorry if this make
> troubles for you.
The patch as it stands is a good start, but it does not go far enough.
To be specific you need to add the following features:
* A configure option to select the default behaviour. IE enabled
or disabled shared-textrel warnings. This way package maintainers
can choose what the default behaviour should be. Enabling the
warnings by default should only be done if the configure option
was not used, or was used and explicitly requested this behaviour.
See the support for --enable-compressed-debug-sections in the
linker's configure.ac file for an example similar to this one.
* The linker's --help output must make it clear which option is the
default. That way a user with no knowledge of how the linker was
configured can still find out what the default option will be.
* The linker's documentation must be updated to indicate the new
default, and to explain that this can be overridden by a configure
time option as well as a linker command line option.
* The linker's NEWS file should be updated to mention the new
behaviour. That way the announcement will be included in the
release notes when the next release occurs.
* As mentioned by Mike Frysinger you also need to include a patch
to the gold linker to add a similar configure option/behaviour
change. We want to keep the two linkers in sync.
Also - I presume that you have run the linker testsuite with the patch
applied and verified that it does not introduce any regressions. If
not then please do so, and if there are regressions then the patch needs
to include fixes for them.
Cheers
Nick