This is the mail archive of the libc-alpha@sources.redhat.com 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]

HAVE_INITFINI_ARRAY check broken?


Hi,

it seems the check for HAVE_INITFINI_ARRAY is probably broken in 2.3.2,
on powerpc-linux:

configure:4802: checking for .preinit_array/.init_array/.fini_array support
configure:4815: gcc -o conftest conftest.c
                     -static -nostartfiles -nostdlib 1>&5
configure:4818: $? = 0
configure:4831: result: yes

The functionality is only implemented on ia64. The only package that
breaks is emacs:

gcc -nostdlib  -G 0 -Xlinker -rpath-link -Xlinker /usr/X11R6/lib -Xlinker -m -Xlinker elf32ppc -Xlinker -znocombreloc -s -o temacs pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o dispnew.o frame.o scroll.o xdisp.o xmenu.o window.o charset.o coding.o category.o ccl.o cm.o term.o xfaces.o  emacs.o keyboard.o macros.o keymap.o sysdep.o buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o dired.o filemode.o cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o alloc.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o print.o lread.o abbrev.o syntax.o unexelf.o mocklisp.o bytecode.o process.o callproc.o region-cache.o sound.o atimer.o doprnt.o strftime.o intervals.o textprop.o composite.o md5.o  terminfo.o lastfile.o vm-limit.o        -lncurses   -lm -lgcc -lc -lgcc /usr/lib/crtn.o  -Wl,-T,/usr/src/packages/BUILD/emacs-21.2/src/ppc.ldscript
/usr/lib/libc_nonshared.a(elf-init.oS)(.text+0x1e): In function `__libc_csu_init':
/usr/src/packages/BUILD/glibc-2.3.2/csu/elf-init.c:66: undefined reference to `__init_array_start'
/usr/lib/libc_nonshared.a(elf-init.oS)(.text+0x22):/usr/src/packages/BUILD/glibc-2.3.2/csu/elf-init.c:66: undefined reference to `__init_array_end'
/usr/lib/libc_nonshared.a(elf-init.oS)(.text+0x26):/usr/src/packages/BUILD/glibc-2.3.2/csu/elf-init.c:66: undefined reference to `__init_array_start'
/usr/lib/libc_nonshared.a(elf-init.oS)(.text+0x2a):/usr/src/packages/BUILD/glibc-2.3.2/csu/elf-init.c:66: undefined reference to `__init_array_end'
/usr/lib/libc_nonshared.a(elf-init.oS)(.text+0x82): In function `__libc_csu_fini':
/usr/src/packages/BUILD/glibc-2.3.2/csu/elf-init.c:76: undefined reference to `__fini_array_start'
/usr/lib/libc_nonshared.a(elf-init.oS)(.text+0x86):/usr/src/packages/BUILD/glibc-2.3.2/csu/elf-init.c:76: undefined reference to `__fini_array_end'
/usr/lib/libc_nonshared.a(elf-init.oS)(.text+0x8e):/usr/src/packages/BUILD/glibc-2.3.2/csu/elf-init.c:76: undefined reference to `__fini_array_start'
/usr/lib/libc_nonshared.a(elf-init.oS)(.text+0x92):/usr/src/packages/BUILD/glibc-2.3.2/csu/elf-init.c:76: undefined reference to `__fini_array_end'
collect2: ld returned 1 exit status
make[1]: *** [temacs] Error 1
make[1]: Leaving directory `/usr/src/packages/BUILD/emacs-21.2/src'

The configure gcc run prints only a warning with gcc3.2.2, and succeeds
silently with gcc-3.3, the resulting conftest segfaults.
The string is there anyway:

mandarine:~ #     cat > conftest.c <<EOF
> int _start (void) { return 0; }
> int __start (void) { return 0; }
> int foo (void) { return 1; }
> int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
> EOF
mandarine:~ # gcc -o conftest conftest.c -static -nostartfiles -nostdlib
mandarine:~ # readelf -S conftest | fgrep INIT_ARRAY
  [ 3] .init_array       INIT_ARRAY      100100e0 0000e0 000004 00  WA  0   0  4
mandarine:~ # readelf -S conftest | fgrep INIT_ARRAY ; echo $?
  [ 3] .init_array       INIT_ARRAY      100100e0 0000e0 000004 00  WA  0   0  4
0


What can be done?

-- 
A: No.
Q: Should I include quotations after my reply?


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