This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: section .init_array not working on ppc32
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Olaf Hering <olh at suse dot de>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 13 Mar 2003 21:49:52 +1030
- Subject: Re: section .init_array not working on ppc32
- References: <20030313110100.A10160@suse.de>
On Thu, Mar 13, 2003 at 11:01:00AM +0100, Olaf Hering wrote:
> I'm not sure if that is a binutils or gcc bug, testcase is from glibc
> configure:
>
> nectarine:~# gcc -o conftest conftest.c -static -nostartfiles -nostdlib
> nectarine:~# ./conftest
> Segmentation fault
> nectarine:~# cat conftest.c
> int _start (void) { return 0; }
> int __start (void) { return 0; }
> int foo (void) { return 1; }
> int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
It's a glibc configure bug. You can make this obvious by reducing
your conftest.c to just the first line, when the testcase compiles
and links to just
_start:
li r3,0
blr
Since lr is initialized by the kernel to zero, the blr jumps to
zero. Boom.
--
Alan Modra
IBM OzLabs - Linux Technology Centre