[patch] remove .size directives from libc/sysdeps/linux/powerpc/crtn.S
GNU as used to accept (and ignore?) .size directives which referred to undefined symbols. In binutils 2.21, these are treated as errors: AS lib/crti.o AS lib/crtn.o initfini.c: Assembler messages: initfini.c:23: Error: .size expression with symbol `_init' does not evaluate to a constant initfini.c:23: Error: .size expression with symbol `_fini' does not evaluate to a constant make: *** [lib/crtn.o] Error 1 So here's the patch: --- evil/libc/sysdeps/linux/powerpc/crtn.S +++ good/libc/sysdeps/linux/powerpc/crtn.S @@ -9,7 +9,6 @@ addi 1,1,32 mtlr 0 blr - .size _init, .-_init .section .fini .align 2 @@ -20,4 +19,3 @@ addi 1,1,32 mtlr 0 blr - .size _fini, .-_fini http://ftp.osuosl.org/pub/manulix/scripts/build-scripts/PPFILES/ppfiles-uclibc/powerpc-crtn.patch After applying, the problem is gone: $ make V=1 AS lib/crti.o -DHAVE_ASM_PPC_REL16 -DHAVE_FORCED_UNWIND -DNDEBUG -D__USE_STDIO_FUTEXES__ -D__ASSEMBLER__ -DUSE___THREAD AS lib/crtn.o -DHAVE_ASM_PPC_REL16 -DHAVE_FORCED_UNWIND -DNDEBUG -D__USE_STDIO_FUTEXES__ -D__ASSEMBLER__ -DUSE___THREAD CC ldso/ldso/ldso.oS -DHAVE_ASM_PPC_REL16 -DHAVE_FORCED_UNWIND -DNDEBUG -D__USE_STDIO_FUTEXES__ -DSHARED -DNOT_IN_libc -DIS_IN_rtld -DUCLIBC_RUNTIME_PREFIX="/" -DUCLIBC_LDSO="ld-uClibc.so.0" -DLDSO_ELFINTERP="powerpc/elfinterp.c" -DNOT_IN_libc -DIS_IN_rtld -DUCLIBC_RUNTIME_PREFIX="/" -DUCLIBC_LDSO="ld-uClibc.so.0" AS ldso/ldso/powerpc/resolve.oS -DHAVE_ASM_PPC_REL16 -DHAVE_FORCED_UNWIND -DNDEBUG -D__USE_STDIO_FUTEXES__ -DSHARED -DNOT_IN_libc -DIS_IN_rtld -DUCLIBC_RUNTIME_PREFIX="/" -DUCLIBC_LDSO="ld-uClibc.so.0" -D__ASSEMBLER__ -DUSE___THREAD AR cr ldso/ldso/ld-uClibc_so.a STRIP -x -R .note -R .comment ldso/ldso/ld-uClibc_so.a ... ___ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc
Re: [patch] remove .size directives from libc/sysdeps/linux/powerpc/crtn.S
On 3/20/2011 1:32 PM, Douglas Mencken wrote: GNU as used to accept (and ignore?) .size directives which referred to undefined symbols. In binutils 2.21, these are treated as errors: AS lib/crti.o AS lib/crtn.o initfini.c: Assembler messages: initfini.c:23: Error: .size expression with symbol `_init' does not evaluate to a constant initfini.c:23: Error: .size expression with symbol `_fini' does not evaluate to a constant make: *** [lib/crtn.o] Error 1 So here's the patch: --- evil/libc/sysdeps/linux/powerpc/crtn.S +++ good/libc/sysdeps/linux/powerpc/crtn.S @@ -9,7 +9,6 @@ addi 1,1,32 mtlr 0 blr - .size _init, .-_init .section .fini .align 2 @@ -20,4 +19,3 @@ addi 1,1,32 mtlr 0 blr - .size _fini, .-_fini the problem is because one of those two labels is missing can you figure out why http://ftp.osuosl.org/pub/manulix/scripts/build-scripts/PPFILES/ppfiles-uclibc/powerpc-crtn.patch After applying, the problem is gone: $ make V=1 AS lib/crti.o -DHAVE_ASM_PPC_REL16 -DHAVE_FORCED_UNWIND -DNDEBUG -D__USE_STDIO_FUTEXES__ -D__ASSEMBLER__ -DUSE___THREAD AS lib/crtn.o -DHAVE_ASM_PPC_REL16 -DHAVE_FORCED_UNWIND -DNDEBUG -D__USE_STDIO_FUTEXES__ -D__ASSEMBLER__ -DUSE___THREAD CC ldso/ldso/ldso.oS -DHAVE_ASM_PPC_REL16 -DHAVE_FORCED_UNWIND -DNDEBUG -D__USE_STDIO_FUTEXES__ -DSHARED -DNOT_IN_libc -DIS_IN_rtld -DUCLIBC_RUNTIME_PREFIX="/" -DUCLIBC_LDSO="ld-uClibc.so.0" -DLDSO_ELFINTERP="powerpc/elfinterp.c" -DNOT_IN_libc -DIS_IN_rtld -DUCLIBC_RUNTIME_PREFIX="/" -DUCLIBC_LDSO="ld-uClibc.so.0" AS ldso/ldso/powerpc/resolve.oS -DHAVE_ASM_PPC_REL16 -DHAVE_FORCED_UNWIND -DNDEBUG -D__USE_STDIO_FUTEXES__ -DSHARED -DNOT_IN_libc -DIS_IN_rtld -DUCLIBC_RUNTIME_PREFIX="/" -DUCLIBC_LDSO="ld-uClibc.so.0" -D__ASSEMBLER__ -DUSE___THREAD AR cr ldso/ldso/ld-uClibc_so.a STRIP -x -R .note -R .comment ldso/ldso/ld-uClibc_so.a ... ___ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc ___ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc
Re: [patch] remove .size directives from libc/sysdeps/linux/powerpc/crtn.S
Oops, forgot to CC to uclibc. On Wed, Mar 23, 2011 at 8:57 PM, Douglas Mencken wrote: >> shouldn't also .globl and .type be removed? > > No, it's used by 'as' to generate proper ELF entries. > > $ readelf -a crtn.o | grep FUNC > 8: 16 FUNC GLOBAL DEFAULT UND _init > 9: 16 FUNC GLOBAL DEFAULT UND _fini > > .size was never used, it's useless, and now binutils does right job as > forcing them to be an error. > At least, for powerpc assembly. Well, it's only time for you to figure that out. When your team got binutils 2.21 (would it happen after a month, a year or 1000 years?). By the way, linux the kernel guys do actively removing .size directives from assembly source files. ___ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc
Re: [patch] remove .size directives from libc/sysdeps/linux/powerpc/crtn.S
> crti.o has these already, why would we need references in crtn.o as well? > When we link some app/lib, crti.o and crtn.o are used together, so the > functions are around, I think we need only the .section init/fini. This requires some testing. I may perform that tomorrow. > Does the ppc assembler fail on all *.S files that use .size or only if the > function is not also defined in the same file? So .size would be correct > (assembly-wise in crti.S, but not crtn.S), I know that we should not need it > at all (glibc compiles these *initfini* with inhibit-size-directive) Currently, 'as' fails on any .size directive. crti.S doesn't have any .size at all. ___ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc
Re: [patch] remove .size directives from libc/sysdeps/linux/powerpc/crtn.S
On Mar 23, 2011 9:27 PM, "Douglas Mencken" wrote: > > > crti.o has these already, why would we need references in crtn.o as well? When we link some app/lib, crti.o and crtn.o are used together, so the functions are around, I think we need only the .section init/fini. > > This requires some testing. I may perform that tomorrow. > > > Does the ppc assembler fail on all *.S files that use .size or only if the function is not also defined in the same file? So .size would be correct (assembly-wise in crti.S, but not crtn.S), I know that we should not need it at all (glibc compiles these *initfini* with inhibit-size-directive) X86_64/crtn.c should do .size _init,.-.init if anything (I.e. use the size of the section, not a non-existing function name). Since that would conflict with the previous size in crti, I guess that we should remove it from crtn altogether -- manually setting the size of the section is of no use, isn't it. > > Currently, 'as' fails on any .size directive. crti.S doesn't have any > .size at all. > ___ > uClibc mailing list > uClibc@uclibc.org > http://lists.busybox.net/mailman/listinfo/uclibc ___ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc
Re: [patch] remove .size directives from libc/sysdeps/linux/powerpc/crtn.S
Original-Nachricht > Datum: Tue, 3 May 2011 21:33:45 +0200 > Von: Bernhard Reutner-Fischer > An: Douglas Mencken > CC: uclibc@uclibc.org, Peter Mazinger > Betreff: Re: [patch] remove .size directives from > libc/sysdeps/linux/powerpc/crtn.S > On Mar 23, 2011 9:27 PM, "Douglas Mencken" wrote: > > > > > crti.o has these already, why would we need references in crtn.o as > well? When we link some app/lib, crti.o and crtn.o are used together, so > the > functions are around, I think we need only the .section init/fini. > > > > This requires some testing. I may perform that tomorrow. > > > > > Does the ppc assembler fail on all *.S files that use .size or only if > the function is not also defined in the same file? So .size would be > correct > (assembly-wise in crti.S, but not crtn.S), I know that we should not need > it > at all (glibc compiles these *initfini* with inhibit-size-directive) > > X86_64/crtn.c should do > .size _init,.-.init > if anything (I.e. use the size of the section, not a non-existing function > name). Since that would conflict with the previous size in crti, I guess > that we should remove it from crtn altogether -- manually setting the size > of the section is of no use, isn't it. I am for removing all .size directive in crt*.S files (one of my later patches for the future branch would do that, but do it in master if you want to Peter > > > > > Currently, 'as' fails on any .size directive. crti.S doesn't have any > > .size at all. > > ___ > > uClibc mailing list > > uClibc@uclibc.org > > http://lists.busybox.net/mailman/listinfo/uclibc -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone ___ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc