public inbox for gentoo-mips@lists.gentoo.org
 help / color / mirror / Atom feed
From: Jens Seidel <jensseidel@users.sf.net>
To: gentoo-mips@lists.gentoo.org
Subject: [gentoo-mips] hash-style trouble with gcc, binutils and glibc
Date: Thu, 3 Jan 2008 21:16:53 +0100	[thread overview]
Message-ID: <20080103201653.GA29001@imkf-pc073.imkf.tu-freiberg.de> (raw)

Hi,

since the last system upgrade I always get floating point exceptions when I
start self compiled programs or during configure steps (once the gcc compiler
is tested). After some searching I found that ld --hash-style= option is the
reason. Some time ago a new "gnu" method was introduced to speed loading of
dynamic libraries up.

The problem I have is that glibc uses still the old sysv hash whereas
gcc (or/and ld) defaults to gnu. Using -Wl,--hash-style=sysv in CFLAGS,
CXXFLAGS and LDFLAGS improves the situation as I can now continue
compiling C (but no C++) programs. I rebuild gcc (4.1.2), glibc (2.3.6-r5)
and binutils (2.18-r1) but it did not helped.

I assumed that --hash_style=both is the new toolchain default and would put
both old hash and new gnu_hash into binaries and would allow me linking against
my glibc (which still uses old hash). But I was wrong:

$ mips-unknown-linux-gnu-gcc -Wl,--hash-style=sysv main.c
$ ./a.out
Hello world
$ mips-unknown-linux-gnu-gcc -Wl,--hash-style=both main.c
$ ./a.out
Floating point exception
$ mips-unknown-linux-gnu-gcc -Wl,--hash-style=gnu main.c
$ ./a.out
Floating point exception

With sysv I get:
$ readelf -a a.out | grep -i hash
  [ 5] .hash             HASH            004002ac 0002ac 000048 04   A  6   0  4   03     .interp .note.ABI-tag .reginfo .dynamic .hash .dynsym .dynstr .gnu.version .gnu.version_r .init .text .MIPS.stubs .fini .rodata .eh_frame
 0x00000004 (HASH)                       0x4002ac

and with gnu and both I get the same output:
$ cat  /tmp/readelf.both
  [ 5] .gnu.hash         GNU_HASH        004002ac 0002ac 00004c 04   A  6   0  4   03     .interp .note.ABI-tag .reginfo .dynamic .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .init .text .MIPS.stubs .fini .rodata .eh_frame
 0x6ffffef5 (GNU_HASH)                   0x4002ac
     1: 00000000     0 FUNC    WEAK   DEFAULT [GNUHASH]   UND __gmon_start__
     2: 00000000     0 NOTYPE  WEAK   DEFAULT [GNUHASH]   UND _Jv_RegisterClasses
     3: 00400860   476 FUNC    GLOBAL DEFAULT [GNUHASH]   UND puts@GLIBC_2.0 (2)     5: 0040075c   128 FUNC    GLOBAL DEFAULT [GNUHASH]    11 __libc_csu_init
     7: 00400680    88 FUNC    GLOBAL DEFAULT [GNUHASH]    11 main
     8: 0040049c     0 FUNC    GLOBAL DEFAULT [GNUHASH]    10 _init
     9: 004006e0   124 FUNC    GLOBAL DEFAULT [GNUHASH]    11 __libc_csu_fini
    11: 00400880     0 FUNC    GLOBAL DEFAULT [GNUHASH]    13 _fini
    12: 00400850   308 FUNC    GLOBAL DEFAULT [GNUHASH]   UND __libc_start_main@GLIBC_2.0 (2)
    34: 004006e0   124 FUNC    GLOBAL DEFAULT [GNUHASH]    11 __libc_csu_fini
    37: 00000000     0 FUNC    WEAK   DEFAULT [GNUHASH]   UND __gmon_start__
    38: 00000000     0 NOTYPE  WEAK   DEFAULT [GNUHASH]   UND _Jv_RegisterClasses
    39: 00400880     0 FUNC    GLOBAL DEFAULT [GNUHASH]    13 _fini
    41: 00400850   308 FUNC    GLOBAL DEFAULT [GNUHASH]   UND __libc_start_main@@GLIBC_
    47: 0040075c   128 FUNC    GLOBAL DEFAULT [GNUHASH]    11 __libc_csu_init
    52: 00400860   476 FUNC    GLOBAL DEFAULT [GNUHASH]   UND puts@@GLIBC_2.0
    55: 00400680    88 FUNC    GLOBAL DEFAULT [GNUHASH]    11 main
    56: 0040049c     0 FUNC    GLOBAL DEFAULT [GNUHASH]    10 _init
Histogram for `.gnu.hash' bucket list length (total of 3 buckets):

This shows that --hash-style=both is identical to --hash-style=gnu and not
properly working on my system. Why?

I found also an article about hash style in the Gentoo Wiki and tried
rebuilding my toolchain with USE=hashstyle but this did not helped.

Any ideas? Is this a known error on Mips (o32 ABI)?

Jens
-- 
gentoo-mips@gentoo.org mailing list



                 reply	other threads:[~2008-01-03 20:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080103201653.GA29001@imkf-pc073.imkf.tu-freiberg.de \
    --to=jensseidel@users.sf.net \
    --cc=gentoo-mips@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox