Bug 12499 - Changes to .init_array support breaks eglibc-2.11.2 on hppa-linux
Summary: Changes to .init_array support breaks eglibc-2.11.2 on hppa-linux
Status: RESOLVED DUPLICATE of bug 12343
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.22
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-18 03:49 UTC by John David Anglin
Modified: 2011-03-17 02:52 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John David Anglin 2011-02-18 03:49:27 UTC
...
CPP='gcc-4.4 -E -x c-header'    /home2/dave/debian/glibc/eglibc-2.11.2/build-tre
e/hppa-libc/elf/ld.so.1 --library-path /home2/dave/debian/glibc/eglibc-2.11.2/bu
ild-tree/hppa-libc:/home2/dave/debian/glibc/eglibc-2.11.2/build-tree/hppa-libc/m
ath:/home2/dave/debian/glibc/eglibc-2.11.2/build-tree/hppa-libc/elf:/home2/dave/
debian/glibc/eglibc-2.11.2/build-tree/hppa-libc/dlfcn:/home2/dave/debian/glibc/e
glibc-2.11.2/build-tree/hppa-libc/nss:/home2/dave/debian/glibc/eglibc-2.11.2/bui
ld-tree/hppa-libc/nis:/home2/dave/debian/glibc/eglibc-2.11.2/build-tree/hppa-lib
c/rt:/home2/dave/debian/glibc/eglibc-2.11.2/build-tree/hppa-libc/resolv:/home2/d
ave/debian/glibc/eglibc-2.11.2/build-tree/hppa-libc/crypt:/home2/dave/debian/gli
bc/eglibc-2.11.2/build-tree/hppa-libc/nptl /home2/dave/debian/glibc/eglibc-2.11.
2/build-tree/hppa-libc/sunrpc/rpcgen -Y ../scripts -c rpcsvc/bootparam_prot.x -o
 /home2/dave/debian/glibc/eglibc-2.11.2/build-tree/hppa-libc/sunrpc/xbootparam_p
rot.T
make[3]: *** [/home2/dave/debian/glibc/eglibc-2.11.2/build-tree/hppa-libc/sunrpc
/xbootparam_prot.stmp] Segmentation fault (core dumped)

Problem occurs in call_init trying to run constructors for newly built libc.so.6.

/home2/dave/debian/glibc/eglibc-2.11.2/build-tree/hppa-libc/libc.so.6:
+file 
format elf32-hppa-linux

Contents of section .init_array:
159008 ffffffff 0015bee2 00000000           ............    

The ffffffff and 00000000 appear to come from merging .ctors into .init_array.
Calling 0xffffffff causes the segv.  ffffffff and 00000000 mark the limits
of .ctors as generated by crtstuff.c.

Building binutils with --disable-initfini-array avoids the error.

Not much documentation on this...
Comment 1 H.J. Lu 2011-02-21 18:13:42 UTC
Dup.

*** This bug has been marked as a duplicate of bug 12343 ***
Comment 2 John David Anglin 2011-03-11 02:09:24 UTC
Irrespective of the closing of bug 12343, I still believe this is a binutils bug.  .ctors is incorrectly merged.  binutils should understand the markers
that GCC has used for years.
Comment 3 H.J. Lu 2011-03-17 02:52:38 UTC
(In reply to comment #2)
> Irrespective of the closing of bug 12343, I still believe this is a binutils
> bug.  .ctors is incorrectly merged.  binutils should understand the markers
> that GCC has used for years.

There is no problem with the markers that GCC has used for years.
The problem is the custom markers used by glibc. There is no plan
to support the custom markers used by glibc. If you want to use the
new linker, you need to fix glibc.

*** This bug has been marked as a duplicate of bug 12343 ***