All of lore.kernel.org
 help / color / mirror / Atom feed
* [parisc-linux] new g++/exceptions problem
@ 2001-06-16  0:50 Paul Bame
  2001-06-16  0:57 ` Paul Bame
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Paul Bame @ 2001-06-16  0:50 UTC (permalink / raw)
  To: amodra; +Cc: parisc-linux

I built apt against the new exception-handling
compilers (pehc:~taggart/newcompilers-20010615)
and now all the apt utilities bus error right away.  This stuff can
be found installed on gsyprf11 built from ~bame/apt.  So far I know

!!die_if_kernel: apt-get(7797): Unaligned data reference 28

IAOQ: 000000004000ccab IIR: 0cc41280
ldd says this code in ld.so.1:

libapt-pkg-libc6.2-3.so.3.2 => /usr/lib/libapt-pkg-libc6.2-3.so.3.2 (0x4002b000)
libstdc++.so.3 => /usr/lib/libstdc++.so.3 (0x40120000)
libm.so.6 => /lib/libm.so.6 (0x40201000)
libc.so.6 => /lib/libc.so.6 (0x40291000)
/lib/ld.so.1 => /lib/ld.so.1 (0x40000000)

The offending code is:

0000c7a0 <_dl_relocate_object>:
...
    cbf8:       0a cc 0a 16     add,l r12,r22,r22
    cbfc:       0c a0 10 97     ldw  0(sr0,r5),r23
...
    cc04:       0c e0 10 94     ldw  0(sr0,r7),r20
...
    cc9c:       2a 60 00 00     addil 0,r19,%r1
    cca0:       48 21 0a f0     ldw 578(sr0,r1),r1
    cca4:       08 a1 28 80     cmpclr,= r1,r5,r0
--> cca8:       0c c4 12 80     stw  r4,0(sr0,r6)
    cc14:       0a 97 0a 06     add,l r23,r20,r6

r6 is 00000000401e51ee which refers to libstdc++ offset c51ee:

 16 .data         00002f2c  000c22b0  000c22b0  000b22b0  2**4
                  CONTENTS, ALLOC, LOAD, DATA
 17 .eh_frame     0001254c  000c51dc  000c51dc  000b51dc  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 18 .gcc_except_table 0000298c  000d7728  000d7728  000c7728  2**2
                  CONTENTS, ALLOC, LOAD, DATA

so it's inside the exception-handler frame.  My wild guess is the
dynamic linker is trying to handle a new type of symbol which refers
to the new exception stuff which is for some reason not 4-byte
aligned, but this surely ain't my expertise area!

	-P

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [parisc-linux] new g++/exceptions problem
  2001-06-16  0:50 [parisc-linux] new g++/exceptions problem Paul Bame
@ 2001-06-16  0:57 ` Paul Bame
  2001-06-16  1:16 ` John David Anglin
  2001-06-17  5:43 ` [parisc-linux] " Alan Modra
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Bame @ 2001-06-16  0:57 UTC (permalink / raw)
  Cc: amodra, parisc-linux

= 
= I built apt against the new exception-handling

The following shows what appears to be the same problem:
$ cat hello.c
#include <stdio.h>
int main() {printf("hello world\n");}
$ g++ -o hello hello.c
$ ./hello
Bus error
$

which makes me think something in the C++ exception initialization is
the culprit -- another wild guess

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [parisc-linux] new g++/exceptions problem
  2001-06-16  0:50 [parisc-linux] new g++/exceptions problem Paul Bame
  2001-06-16  0:57 ` Paul Bame
@ 2001-06-16  1:16 ` John David Anglin
  2001-06-17  5:43 ` [parisc-linux] " Alan Modra
  2 siblings, 0 replies; 4+ messages in thread
From: John David Anglin @ 2001-06-16  1:16 UTC (permalink / raw)
  To: Paul Bame; +Cc: amodra, parisc-linux

> I built apt against the new exception-handling
> compilers (pehc:~taggart/newcompilers-20010615)
> and now all the apt utilities bus error right away.  This stuff can

There is a known issue with gcc 3.0 and glibc:
<http://gcc.gnu.org/ml/gcc-bugs/2001-06/msg00770.html>.  It involves
the change in exception handling.  Possibly, this is what is bitting.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [parisc-linux] Re: new g++/exceptions problem
  2001-06-16  0:50 [parisc-linux] new g++/exceptions problem Paul Bame
  2001-06-16  0:57 ` Paul Bame
  2001-06-16  1:16 ` John David Anglin
@ 2001-06-17  5:43 ` Alan Modra
  2 siblings, 0 replies; 4+ messages in thread
From: Alan Modra @ 2001-06-17  5:43 UTC (permalink / raw)
  To: Paul Bame; +Cc: parisc-linux

On Fri, Jun 15, 2001 at 06:50:36PM -0600, Paul Bame wrote:
> 
> so it's inside the exception-handler frame.  My wild guess is the
> dynamic linker is trying to handle a new type of symbol which refers
> to the new exception stuff which is for some reason not 4-byte
> aligned

Yes, the new exception code puts R_PARISC_DIR32 relocs at unaligned
addresses.  "objdump -r libstdc++.so" reveals

Relocation section '.rela.eh_frame' at offset 0x37024 contains 1611 entries:
  Offset    Info  Type            Symbol's Value  Symbol's Name          Addend
  000c167e  4da01 R_PARISC_DIR32        00056914  __gxx_personality_v0      + 0
  000c1690  00d01 R_PARISC_DIR32        0003fe40  .text                     + 5114
  000c1699  01301 R_PARISC_DIR32        000cede4  .gcc_except_table         + 0
etc.

Seems like a change in the dynamic linker is needed to handle this
situation.  Something like the following should do it for you.

--- sysdeps/hppa/dl-machine.h~	Sun Jun 17 15:03:59 2001
+++ sysdeps/hppa/dl-machine.h	Sun Jun 17 15:05:11 2001
@@ -536,7 +536,16 @@
       if (map == &_dl_rtld_map)
 	return;
 #endif
-      /* Otherwise, nothing more to do here. */
+      /* .eh_frame can have unaligned relocs.  */
+      if (reloc_addr & 3)
+	{
+	  char *rel_addr = (char *) reloc_addr;
+	  rel_addr[0] = value >> 24;
+	  rel_addr[1] = value >> 16;
+	  rel_addr[2] = value >> 8;
+	  rel_addr[3] = value >> 0;
+	  return;
+	}
       break;
 
     case R_PARISC_PLABEL32:

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-06-17  5:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-06-16  0:50 [parisc-linux] new g++/exceptions problem Paul Bame
2001-06-16  0:57 ` Paul Bame
2001-06-16  1:16 ` John David Anglin
2001-06-17  5:43 ` [parisc-linux] " Alan Modra

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.