Discussion:
Adding -z nonow to complement -z now
(too old to reply)
Kevin F. Quinn
2006-06-12 18:00:03 UTC
Permalink
Hi.

Attached is a little patch that adds '-z nonow' as the opposite of '-z
now'. Could it be considered for inclusion, please?

Although some might consider it pointless, it would be very useful to
us (Gentoo Hardened project). We flip the default when building with
gcc to set -z now by default. Our current method of undoing this
(which we need to do very occasionally) is via an extra option handled
in a gcc specs file; the downside here is that libtool in particular
filters our option because it doesn't recognise it. With this, we can
pass '-Wl,-z,nonow' in LDFLAGS and libtool pays attention.

If there's anything further I need to do to make this acceptable,
please let me know.

Thanks
--
Kevin F. Quinn
Olivier Galibert
2006-06-12 18:48:10 UTC
Permalink
Post by Kevin F. Quinn
Although some might consider it pointless, it would be very useful to
us (Gentoo Hardened project). We flip the default when building with
gcc to set -z now by default. Our current method of undoing this
(which we need to do very occasionally) is via an extra option handled
in a gcc specs file; the downside here is that libtool in particular
filters our option because it doesn't recognise it. With this, we can
pass '-Wl,-z,nonow' in LDFLAGS and libtool pays attention.
Why don't you fix libtool?

OG.
Kevin F. Quinn
2006-06-12 19:22:04 UTC
Permalink
On Mon, 12 Jun 2006 20:48:10 +0200
Post by Olivier Galibert
Post by Kevin F. Quinn
Although some might consider it pointless, it would be very useful
to us (Gentoo Hardened project). We flip the default when building
with gcc to set -z now by default. Our current method of undoing
this (which we need to do very occasionally) is via an extra option
handled in a gcc specs file; the downside here is that libtool in
particular filters our option because it doesn't recognise it.
With this, we can pass '-Wl,-z,nonow' in LDFLAGS and libtool pays
attention.
Why don't you fix libtool?
The essential problem for us is that ld doesn't provide a switch-off
option to go with the switch-on option. There are other downsides that
go with this. I prefer to tackle that essential issue, especially as
it's trivial to do.

Is there a good reason why this shouldn't be added to ld?
--
Kevin F. Quinn
Alan Modra
2006-06-13 01:11:36 UTC
Permalink
Post by Kevin F. Quinn
Attached is a little patch that adds '-z nonow' as the opposite of '-z
now'. Could it be considered for inclusion, please?
You need to provide a proper changelog entry, and describe the option in
both elf32.em:gld${EMULATION_NAME}_list_options and ld.texinfo. With
those details fixed, this patch is fine.
--
Alan Modra
IBM OzLabs - Linux Technology Centre
Ulrich Drepper
2006-06-13 17:23:21 UTC
Permalink
Post by Alan Modra
Post by Kevin F. Quinn
Attached is a little patch that adds '-z nonow' as the opposite of '-z
now'. Could it be considered for inclusion, please?
You need to provide a proper changelog entry, and describe the option in
[...]
You cannot honestly consider allowing a patch introducing -z nonow.
What is the opposite to 'now' in ELF terms? It's not 'nonow', it's 'lazy'.
--
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
Kevin F. Quinn
2006-06-13 18:08:03 UTC
Permalink
On Tue, 13 Jun 2006 10:23:21 -0700
Post by Ulrich Drepper
You cannot honestly consider allowing a patch introducing -z nonow.
What is the opposite to 'now' in ELF terms? It's not 'nonow', it's 'lazy'.
Good point, I agree - nonow is a legacy name from our side hence I never
thought to change it. I'll work that in with the other changes Alan
asked for.
--
Kevin F. Quinn
Kevin F. Quinn
2006-06-13 20:54:28 UTC
Permalink
On Tue, 13 Jun 2006 10:23:21 -0700
Post by Ulrich Drepper
Post by Alan Modra
Post by Kevin F. Quinn
Attached is a little patch that adds '-z nonow' as the opposite of
'-z now'. Could it be considered for inclusion, please?
You need to provide a proper changelog entry, and describe the
option in [...]
You cannot honestly consider allowing a patch introducing -z nonow.
What is the opposite to 'now' in ELF terms? It's not 'nonow', it's 'lazy'.
Ok; attached is an updated patch, hopefully I've addressed issues as
required so far. Anything more, please say.

Thanks,
--
Kevin F. Quinn
Alan Modra
2006-06-14 02:44:35 UTC
Permalink
Post by Kevin F. Quinn
Ok; attached is an updated patch, hopefully I've addressed issues as
required so far. Anything more, please say.
Applied.
--
Alan Modra
IBM OzLabs - Linux Technology Centre
Loading...