Created attachment 9636 [details]
enable warn-shared-textrel by default
In gnu-ld, warn-shared-textrel is disabled by default. Why not to enable it by default?
One of our customers found that he did not have enough memory to run his application after a recompilation. The root cause turn out to be a silly mistake that he forgot to add "-fPIC" for his shared libraries. Yes yes, the one who make mistakes got to pay the price, it's very reasonable. But there were no warning at all, a normal user(not a expert) probably did not know what was wrong (and how to fix). This does not seem reasonable...
Although some arches(like x86-64) force all shared libraries to be PIC, there are some that does not. In my opinion, the linker should be a good place to make the warnings. So, warn-shared-textrel should be enable by default.
attached patch enable "warn-shared-textrel" and add a new option to close this warning, is that ok?
patches should be sent to the email@example.com mailing list for discussion. there are problems with this particular patch, but that can be ironed out after we discuss whether we want to do this in the first place.
you'll also need to update gold.
(In reply to Mike Frysinger from comment #1)
> patches should be sent to the firstname.lastname@example.org mailing list for
> discussion. there are problems with this particular patch, but that can be
> ironed out after we discuss whether we want to do this in the first place.
> you'll also need to update gold.
Thanks for the reply. I have send a mail to email@example.com.
for the things about gold: we did not use the gold linker,so I am not familiar with it. if this behavior change were accepted by the binutils community, I will pay some time for the gold.