This is the mail archive of the
mailing list for the binutils project.
Re: Question on use of relro, now, and nodlopen
On Mon, Sep 12, 2011 at 1:02 AM, Ian Lance Taylor <firstname.lastname@example.org> wrote:
> Jeffrey Walton <email@example.com> writes:
>> How does the team recommend determining the availability of relro,
>> now, and nodlopen?
>> Formerly, I was using the following in my makefile (which I suspect is
>> wrong even though there's a tight coupling between GCC and Binutils).
>> OpenSolaris proved that its possible to ship a 2004 compiler with a
>> 2010 distribution.
>> GCC_COMPILER = $(shell $(CXX) -v 2>&1 | $(EGREP) -i -c "^gcc version")
>> ifneq ($(GCC_COMPILER),0)
>> ? LDFLAGS += ?-Wl,-z,relro -Wl,-z,now -Wl,-z,nodlopen
>> Is there a matrix of tool/feature/version that would help determine
>> when the flags made it into ld?
> I didn't quite get that that was your question earlier.
> To determine whether the linker supports a particular option, look at
> the output of ld --help.
> Ideally each new option would be listed in the ld/NEWS file in the
> source code. ?Unfortunately I checked each of the options you mentioned,
> and none are listed. ?As far as I know, the only other source of this
> kind of information is the ld ChangeLog files.
Thanks Ian. I found -relro and -now in the 2004 change logs, which
puts them around GCC 3.4.1 and 3.4.3 depending on the month cited in
the log and http://gcc.gnu.org/releases.html.
I did not find -nodlopen mentioned. Does -nodlopen seem to be an
ancient flag (ie, use GCC_COMPILER), or a relatively new flag (ie, use
(ie, use GCC40_COMPILER). I understand tuning will probably be
necessary - I just want to get in the ball park.