This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PowerPC32 .gnu.attributes in crt files


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]