This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PowerPC32 .gnu.attributes in crt files
- From: Alan Modra <amodra at gmail dot com>
- To: Andreas Schwab <schwab at redhat dot com>
- Cc: libc-alpha at sourceware dot org, "Ryan S. Arnold" <rsa at us dot ibm dot com>
- Date: Fri, 18 Feb 2011 10:52:28 +1030
- Subject: Re: PowerPC32 .gnu.attributes in crt files
- References: <20110217141040.GA7651@bubble.grove.modra.org><m34o82bsd7.fsf@redhat.com>
On Thu, Feb 17, 2011 at 04:20:04PM +0100, Andreas Schwab wrote:
> Alan Modra <amodra@gmail.com> writes:
>
> > +# crt1.o, crti.o, crtn.o and similar files are used when building -msoft-float
> > +# binaries as well hardware floating point binaries. gcc always emits
> > +# a .gnu.attributes section, marking the startup files as hard-float.
> > +# This results in linker warnings when building soft-float binaries.
> > +# The crt files really are compatible with both hard and soft-float,
> > +# and similarly for the other .gnu.attributes.
>
> Then there should be a compiler option to suppress the attribute.
Yes, I think so too.
> > +postclean-generated += stamp-attr
> > +subdir_lib: $(objpfx)stamp-attr
> > +$(objpfx)stamp-attr: $(extra-objs:%=$(objpfx)%)
> > + for x in $?; do \
> > + objcopy -R .gnu.attributes $$x; \
>
> This uses the wrong objcopy when cross compiling.
Oops. That will need some configure magic.
I did originally have a patch that just fixed crti.o and crtn.o using
# Remove pesky .gnu_attribute on crti.o and crtn.o
CPPFLAGS-crti.o = -Dgnu_attribute=spc
CPPFLAGS-crtn.o = -Dgnu_attribute=spc
Works due to these files being compiled via .s, and .spc is a
do-nothin assembler directive that's been around forever.
--
Alan Modra
Australia Development Lab, IBM