public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/13391] New: AIX: crash on throw/catch between shared objects
@ 2003-12-12 19:13 greed at pobox dot com
  2003-12-12 19:18 ` [Bug target/13391] " greed at pobox dot com
                   ` (42 more replies)
  0 siblings, 43 replies; 44+ messages in thread
From: greed at pobox dot com @ 2003-12-12 19:13 UTC (permalink / raw)
  To: gcc-bugs

The attached testcase, while quite contrived, illustrates a problem we are
experiencing on AIX with GCC 3.3.2.  Tests suggest that the problem actually
goes back to GCC 2.95.3 or earlier on AIX 4.3, and is not unique to AIX 5.2.

When run, the program fails to catch the exception, and instead aborts.  The
stack trace after the abort is:

#0  0xd005d1c0 in pthread_kill () from /usr/lib/libpthreads.a(shr_xpg5.o)
#1  0xd005cc4c in _p_raise () from /usr/lib/libpthreads.a(shr_xpg5.o)
#2  0xd01e6508 in raise () from /usr/lib/libc.a(shr.o)
#3  0xd0206400 in abort () from /usr/lib/libc.a(shr.o)
#4  0xd49ec01c in __cxxabiv1::__terminate(void (*)()) (handler=<incomplete
type>) at  _start_ :47
#5  0xd49ebfd0 in std::terminate() () at  _start_ :57
#6  0xd49f2bc4 in __cxa_throw (obj=<incomplete type>, tinfo=<incomplete type>, 
    dest=<incomplete type>) at  _start_ :80
#7  0xd47f8630 in TestFun2::foo() (this=0x2ff223a5) at TestThreadFunction2.C:9
#8  0xd460620c in AixThreadFn::execute() (this=0x2ff223f0) at
TestThreadFunction.C:12
#9  0x100005bc in main () at aixtest2.C:11
#10 0x100001dc in __start ()

If you compile without -pthread, you get a very similar traceback:
#0  0xd01e6514 in raise () from /usr/lib/libc.a(shr.o)
#1  0xd0206400 in abort () from /usr/lib/libc.a(shr.o)
#2  0xdc87e01c in __cxxabiv1::__terminate(void (*)()) (handler=<incomplete
type>) at  _start_ :47
#3  0xdc87dfd0 in std::terminate() () at  _start_ :57
#4  0xdc8847d4 in __cxa_throw (obj=<incomplete type>, tinfo=<incomplete type>, 
    dest=<incomplete type>) at  _start_ :80
#5  0xdc68b630 in TestFun2::foo() (this=0x2ff223a5) at TestThreadFunction2.C:9
#6  0xdc49920c in AixThreadFn::execute() (this=0x2ff223f0) at
TestThreadFunction.C:12
#7  0x1000053c in main () at aixtest2.C:11
#8  0x100001dc in __start ()

...only without the pthread signal propagation.

The testcase contains a template which calculates a factorial, in order to
produce very large shared objects.  This is to simulate the size of the shared
objects in our production code; if the shared objects are small, the fault is
not reliably reproducable.

-- 
           Summary: AIX: crash on throw/catch between shared objects
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: greed at pobox dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powerpc-ibm-aix5.2.0.0
  GCC host triplet: powerpc-ibm-aix5.2.0.0
GCC target triplet: powerpc-ibm-aix5.2.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: crash on throw/catch between shared objects
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
@ 2003-12-12 19:18 ` greed at pobox dot com
  2003-12-12 19:19 ` greed at pobox dot com
                   ` (41 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: greed at pobox dot com @ 2003-12-12 19:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From greed at pobox dot com  2003-12-12 19:18 -------
Created an attachment (id=5319)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5319&action=view)
Makefile for testcase


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: crash on throw/catch between shared objects
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
  2003-12-12 19:18 ` [Bug target/13391] " greed at pobox dot com
@ 2003-12-12 19:19 ` greed at pobox dot com
  2003-12-12 19:19 ` greed at pobox dot com
                   ` (40 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: greed at pobox dot com @ 2003-12-12 19:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From greed at pobox dot com  2003-12-12 19:19 -------
Created an attachment (id=5321)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5321&action=view)
Code for first shared lib


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: crash on throw/catch between shared objects
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
  2003-12-12 19:18 ` [Bug target/13391] " greed at pobox dot com
  2003-12-12 19:19 ` greed at pobox dot com
@ 2003-12-12 19:19 ` greed at pobox dot com
  2003-12-12 19:20 ` greed at pobox dot com
                   ` (39 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: greed at pobox dot com @ 2003-12-12 19:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From greed at pobox dot com  2003-12-12 19:19 -------
Created an attachment (id=5320)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5320&action=view)
Main program for testcase


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: crash on throw/catch between shared objects
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (3 preceding siblings ...)
  2003-12-12 19:20 ` greed at pobox dot com
@ 2003-12-12 19:20 ` greed at pobox dot com
  2003-12-12 19:20 ` greed at pobox dot com
                   ` (37 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: greed at pobox dot com @ 2003-12-12 19:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From greed at pobox dot com  2003-12-12 19:20 -------
Created an attachment (id=5324)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5324&action=view)
Header for second shared lib


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: crash on throw/catch between shared objects
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (4 preceding siblings ...)
  2003-12-12 19:20 ` greed at pobox dot com
@ 2003-12-12 19:20 ` greed at pobox dot com
  2003-12-24  2:46 ` ddurham_gcc_bz at davyandbeth dot com
                   ` (36 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: greed at pobox dot com @ 2003-12-12 19:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From greed at pobox dot com  2003-12-12 19:20 -------
Created an attachment (id=5322)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5322&action=view)
Code for second shared lib


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: crash on throw/catch between shared objects
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (2 preceding siblings ...)
  2003-12-12 19:19 ` greed at pobox dot com
@ 2003-12-12 19:20 ` greed at pobox dot com
  2003-12-12 19:20 ` greed at pobox dot com
                   ` (38 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: greed at pobox dot com @ 2003-12-12 19:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From greed at pobox dot com  2003-12-12 19:20 -------
Created an attachment (id=5323)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5323&action=view)
Header for first shared lib


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: crash on throw/catch between shared objects
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (5 preceding siblings ...)
  2003-12-12 19:20 ` greed at pobox dot com
@ 2003-12-24  2:46 ` ddurham_gcc_bz at davyandbeth dot com
  2003-12-26  3:20 ` dje at gcc dot gnu dot org
                   ` (35 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: ddurham_gcc_bz at davyandbeth dot com @ 2003-12-24  2:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ddurham_gcc_bz at davyandbeth dot com  2003-12-23 23:48 -------
Hi,
  I'm experiencing this too... Except I've discovered it doesn't have anything
to do with shared libs...

I'm using gcc-3.3.2 on AIX 4.3.3.0



Try this:

---- main.cpp ----

#include <stdexcept>

extern void foo();

int bogus;

int main()
{
        try
        {
                foo();
        }
        catch(std::exception &e)
        {
        }
        catch(...)
        {
        }

        return 0;
}

---- foo.cpp ----

#include <stdexcept>

int bogus;

void foo()
{
        throw std::runtime_error("test");
}

---- now compile it with:
	g++ main.cpp foo.cpp  

You may need to add "-Xlinker --allow-multiple-definition" if you're using GNU's ld.

For me, a.out will produce

	IOT/Abort trap (core dumped)


Now comment out the definition of bogus() in either source file.  Then I get no
problem.  I never use bogus.. it's just if it's there, then the problem exists. 
The same think will occur if you make 'bogus' not an int but a function.  I
guess it's just that if there are any duplicate symbols the problem occurs.

I really need to get this resolved.  Please let me know if you find out anything.

Thanks,
   Davy

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: crash on throw/catch between shared objects
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (6 preceding siblings ...)
  2003-12-24  2:46 ` ddurham_gcc_bz at davyandbeth dot com
@ 2003-12-26  3:20 ` dje at gcc dot gnu dot org
  2003-12-29 16:24 ` ddurham_gcc_bz at davyandbeth dot com
                   ` (34 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: dje at gcc dot gnu dot org @ 2003-12-26  3:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dje at gcc dot gnu dot org  2003-12-26 02:30 -------
The first testcase does not build and the second testcase is invalid due to 
duplicte definitions.  Resolving the duplicate fixes the bug.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: crash on throw/catch between shared objects
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (7 preceding siblings ...)
  2003-12-26  3:20 ` dje at gcc dot gnu dot org
@ 2003-12-29 16:24 ` ddurham_gcc_bz at davyandbeth dot com
  2003-12-29 20:51 ` greed at pobox dot com
                   ` (33 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: ddurham_gcc_bz at davyandbeth dot com @ 2003-12-29 16:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ddurham_gcc_bz at davyandbeth dot com  2003-12-29 16:16 -------
(In reply to comment #8)
> ... the second testcase is invalid due to 
> duplicte definitions.  Resolving the duplicate fixes the bug.

Are you refering to my main&foo example as testcase 2?

Resolving the dups in my example does in fact 'fix the bug'.  However, I'm
linking against existing libraries that have duplicate symbols that I have no
control over and I can't use exceptions because of it.  I could say, "well ugh,
I won't use exceptions."  However using dynamic_cast to a reference may throw
and exception which will now abort the process.

Do you have any idea why a duplicate symbol would cause exceptions to miss being
caught?  Is it the compiler or the linker?  I've tried AIX's ld and GNU's ld and
both have identical problems.  That leads me to believe it's either the
compiler, the assembler or maybe some runtime lib.  Any ideas?

Thanks

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: crash on throw/catch between shared objects
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (8 preceding siblings ...)
  2003-12-29 16:24 ` ddurham_gcc_bz at davyandbeth dot com
@ 2003-12-29 20:51 ` greed at pobox dot com
  2004-01-18 17:58 ` dhazeghi at yahoo dot com
                   ` (32 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: greed at pobox dot com @ 2003-12-29 20:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From greed at pobox dot com  2003-12-29 19:46 -------
(In reply to comment #8)
> The first testcase does not build ...

How does it not build?  It is a degenerate and huge tescase, you will need lots
of /tmp and swap to link it.

OOOOPS, my fault, I'm sorry, I forgot to say, you have to use
-ftemplate-depth-10000 to get it to compile.  I think that's probably the problem.

I've been trying to follow the stack unwind code, but I don't know enough about
Dwarf2 to make sense of it.

I'd be more than happy to just ditch AIX, but it isn't up to me.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: crash on throw/catch between shared objects
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (9 preceding siblings ...)
  2003-12-29 20:51 ` greed at pobox dot com
@ 2004-01-18 17:58 ` dhazeghi at yahoo dot com
  2004-01-19  4:32 ` dje at watson dot ibm dot com
                   ` (31 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: dhazeghi at yahoo dot com @ 2004-01-18 17:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dhazeghi at yahoo dot com  2004-01-18 17:58 -------
David, can you comment as to whether there is in fact still a bug? Thanks.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dje at watson dot ibm dot
                   |                            |com
           Keywords|                            |wrong-code


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: crash on throw/catch between shared objects
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (10 preceding siblings ...)
  2004-01-18 17:58 ` dhazeghi at yahoo dot com
@ 2004-01-19  4:32 ` dje at watson dot ibm dot com
  2004-01-19 17:36 ` [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols dhazeghi at yahoo dot com
                   ` (30 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: dje at watson dot ibm dot com @ 2004-01-19  4:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dje at watson dot ibm dot com  2004-01-19 04:32 -------
Subject: Re:  AIX: crash on throw/catch between shared objects 

	GCC scans object files and libraries to find constructors,
destructors, and EH frames using a wrapper around the linker called
collect2.  In some cases, such as this one, the duplicate symbols causes
collect2 to become confused.  

	The library is broken if it is generating duplicate symbols.  This
problem report really is an enhancement request that GCC on AIX be more
robust in the face of source code that produces duplicate symbols.

David



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (11 preceding siblings ...)
  2004-01-19  4:32 ` dje at watson dot ibm dot com
@ 2004-01-19 17:36 ` dhazeghi at yahoo dot com
  2004-01-20 21:13 ` greed at pobox dot com
                   ` (29 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: dhazeghi at yahoo dot com @ 2004-01-19 17:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dhazeghi at yahoo dot com  2004-01-19 17:36 -------
Thanks for the analsysis David. Based on that, I'm confirming this report and adjusting the 
summary and severity accordingl.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-01-19 17:36:28
               date|                            |
            Summary|AIX: crash on throw/catch   |AIX: collect2 emits bad code
                   |between shared objects      |with duplicated symbols


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (12 preceding siblings ...)
  2004-01-19 17:36 ` [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols dhazeghi at yahoo dot com
@ 2004-01-20 21:13 ` greed at pobox dot com
  2004-03-03  1:11 ` ajd at gentrack dot com
                   ` (28 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: greed at pobox dot com @ 2004-01-20 21:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From greed at pobox dot com  2004-01-20 21:13 -------
OK, if I update:
- TestThreadFunction2.H so that it defines templates A_Factorial and
B_Factorial, which differ in name only are are identical to the original
Factorial template,
- TestThreadFunction.C so that it instantiates A_Factorial,
- TestThreadFunction2.C so that it instantiates B_Factorial,
- collect2.c so that it does NOT emit a definition of _GLOBAL__DI or
_GLOBAL__DD, and also does not emit an export for those symbols,
- the linker flags to include -Wl,-bH:0 (so that link warnings result in a
failed link)

the program still abort()s.

Sometimes it doesn't abort, however running slibclean will cause the next
invocation to abort.  I haven't figured out what needs to be done to guarantee
success or failure.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (13 preceding siblings ...)
  2004-01-20 21:13 ` greed at pobox dot com
@ 2004-03-03  1:11 ` ajd at gentrack dot com
  2004-03-03 22:48 ` dje at watson dot ibm dot com
                   ` (27 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: ajd at gentrack dot com @ 2004-03-03  1:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ajd at gentrack dot com  2004-03-03 01:11 -------
I think there are two separate issues here.
The issue reported by Davy Durham does not relate to shared libraries and may 
be an enhancement request for duplicate symbol handling.

But the original report is a problem throwing exceptions across a shared 
library boundary.

I am having the same problem as the original reporter.

A simple testcase:
a1.cpp:
extern void mycall();

int main()
{
        try {
                mycall();
        } catch (int i) {
                return i;
        }
        return 1;
}

a2.cpp:
void mycall()
{
        throw 0;
}

$ g++ -fPIC -DPIC -shared -o liba2.a a2.cpp
$ g++ -fPIC -DPIC -o a1 a1.cpp -L. -la2    

Sometimes it aborts, sometimes it succeeds.

I debugged through and in unwind-dw2-fde.c, the seen_objects element that 
represents liba2 contains FDE's for both liba2 and libstdc++.a.

As a consequence of this, when liba2.a is located in memory at a higher 
address than libstdc++.a, then the seen_objects list is not sorted correctly 
and the function _Unwind_Find_FDE will never search liba2 for fde's.

By disassembling liba2, I can see that it's local table does indeed import all 
the FDE's from libstdc++.

Could this be an installation problem?
Could this be a problem with collect2 picking up frames from imported 
libraries?

Configured with: --disable-symvers --without-gnu-as --without-gnu-ld --enable-
languages=c,c++


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (14 preceding siblings ...)
  2004-03-03  1:11 ` ajd at gentrack dot com
@ 2004-03-03 22:48 ` dje at watson dot ibm dot com
  2004-03-04  0:00 ` ajd at gentrack dot com
                   ` (26 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: dje at watson dot ibm dot com @ 2004-03-03 22:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dje at watson dot ibm dot com  2004-03-03 22:48 -------
Subject: Re:  AIX: collect2 emits bad code with duplicated symbols 

AJD,

	Can you try the appended patch that disables exporting _GLOBAL_*
symbols in AIX shared libraries?

Thanks, David

Index: collect2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/collect2.c,v
retrieving revision 1.160
diff -c -p -r1.160 collect2.c
*** collect2.c	21 Jan 2004 20:39:52 -0000	1.160
--- collect2.c	3 Mar 2004 22:38:31 -0000
*************** main (int argc, char **argv)
*** 1398,1407 ****
--- 1398,1409 ----
        if (! exports.first)
  	*ld2++ = concat ("-bE:", export_file, NULL);
  
+ #ifndef LD_INIT_SWITCH
        add_to_list (&exports, initname);
        add_to_list (&exports, fininame);
        add_to_list (&exports, "_GLOBAL__DI");
        add_to_list (&exports, "_GLOBAL__DD");
+ #endif
        exportf = fopen (export_file, "w");
        if (exportf == (FILE *) 0)
  	fatal_perror ("fopen %s", export_file);
*************** scan_prog_file (const char *prog_name, e
*** 2720,2726 ****
  			  if (! is_shared)
  			    add_to_list (&constructors, name);
  #ifdef COLLECT_EXPORT_LIST
! 			  if (which_pass == PASS_OBJ)
  			    add_to_list (&exports, name);
  #endif
  			  break;
--- 2722,2728 ----
  			  if (! is_shared)
  			    add_to_list (&constructors, name);
  #ifdef COLLECT_EXPORT_LIST
! 			  if (!shared_obj && which_pass == PASS_OBJ)
  			    add_to_list (&exports, name);
  #endif
  			  break;
*************** scan_prog_file (const char *prog_name, e
*** 2729,2735 ****
  			  if (! is_shared)
  			    add_to_list (&destructors, name);
  #ifdef COLLECT_EXPORT_LIST
! 			  if (which_pass == PASS_OBJ)
  			    add_to_list (&exports, name);
  #endif
  			  break;
--- 2731,2737 ----
  			  if (! is_shared)
  			    add_to_list (&destructors, name);
  #ifdef COLLECT_EXPORT_LIST
! 			  if (!shared_obj && which_pass == PASS_OBJ)
  			    add_to_list (&exports, name);
  #endif
  			  break;
*************** scan_prog_file (const char *prog_name, e
*** 2754,2760 ****
  			  if (! is_shared)
  			    add_to_list (&frame_tables, name);
  #ifdef COLLECT_EXPORT_LIST
! 			  if (which_pass == PASS_OBJ)
  			    add_to_list (&exports, name);
  #endif
  			  break;
--- 2756,2762 ----
  			  if (! is_shared)
  			    add_to_list (&frame_tables, name);
  #ifdef COLLECT_EXPORT_LIST
! 			  if (!shared_obj && which_pass == PASS_OBJ)
  			    add_to_list (&exports, name);
  #endif
  			  break;


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (15 preceding siblings ...)
  2004-03-03 22:48 ` dje at watson dot ibm dot com
@ 2004-03-04  0:00 ` ajd at gentrack dot com
  2004-03-04  1:56 ` ajd at gentrack dot com
                   ` (25 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: ajd at gentrack dot com @ 2004-03-04  0:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ajd at gentrack dot com  2004-03-04 00:00 -------
(In reply to comment #16)
> 	Can you try the appended patch that disables exporting _GLOBAL_*
> symbols in AIX shared libraries?
> Thanks, David

David,

I have not done a full bootstrap and I am still testing, so treat these as 
prelimary findings:

The patch appears not to fix the abort on try/catch.

However with the patch, I am not getting imports of __GLOBAL__F* from 
libstdc++ into my shared library. So maybe it is a fix to part of the problem?

I'm not sure if the original problem is that the libstdc++ library exports the 
__GLOBAL__F symbols or that the user library imports and uses them?

In the patch, should it be checking the variable shared_obj or is_shared?
I think that it would depend where you class the problem: shared_obj to fix 
libstdc++, is_shared to fix user library.

Thanks for your help.
I will update again when I feel I have properly tested the patch.

Regards,
Andrew.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (16 preceding siblings ...)
  2004-03-04  0:00 ` ajd at gentrack dot com
@ 2004-03-04  1:56 ` ajd at gentrack dot com
  2004-03-04  2:40 ` greed at pobox dot com
                   ` (24 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: ajd at gentrack dot com @ 2004-03-04  1:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ajd at gentrack dot com  2004-03-04 01:56 -------
(In reply to comment #17)
> > 	Can you try the appended patch that disables exporting _GLOBAL_*
> > symbols in AIX shared libraries?
> > Thanks, David

I still have not managed a full bootstrap with your patch (ETA 12hours -- but 
that is a separate issue).

However I applied the following patch (in all it's glory) to collect2 and used 
this version with a previously complied gcc.
I did not relink libstdc++.a.

After relinking my libraries with this new collect, my exceptions are working 
perfectly.

Thanks,
Andrew

*** gcc-3.3.2/gcc/collect2.c    Thu Oct  2 02:08:34 2003
--- ../gcc-3.3.2/gcc/collect2.c Fri Mar  5 04:20:56 2004
***************
*** 1435,1444 ****
--- 1435,1446 ----
        if (! exports.first)
        *ld2++ = concat ("-bE:", export_file, NULL);
  
+ #ifndef LD_INIT_SWITCH
        add_to_list (&exports, initname);
        add_to_list (&exports, fininame);
        add_to_list (&exports, "_GLOBAL__DI");
        add_to_list (&exports, "_GLOBAL__DD");
+ #endif
        exportf = fopen (export_file, "w");
        if (exportf == (FILE *) 0)
        fatal_perror ("fopen %s", export_file);
***************
*** 2733,2743 ****
--- 2735,2755 ----
  #ifdef COLLECT_EXPORT_LIST
              /* Is current archive member a shared object?  */
              is_shared = HEADER (ldptr).f_flags & F_SHROBJ;
+               /* On aix we get a second object in libstdc++.a which is 
+                  in the shared library, but not marked with F_SHROBJ.
+ 
+                  Should we only set is_shared the first time through 
+                  this loop?
+                 */
+               if (!is_shared && strstr(prog_name, "libstdc++")) {
+                       is_shared = 1;
+               }
  #endif
  
              while (sym_index < sym_count)
                {
                  GCC_SYMENT symbol;
+               int t;
  
                  if (ldtbread (ldptr, sym_index, &symbol) <= 0)
                    break;
***************
*** 2757,2769 ****
                        ++name;
  #endif
  
!                     switch (is_ctor_dtor (name))
                        {
                        case 1:
                          if (! is_shared)
                            add_to_list (&constructors, name);
  #ifdef COLLECT_EXPORT_LIST
!                         if (which_pass == PASS_OBJ)
                            add_to_list (&exports, name);
  #endif
                          break;
--- 2769,2784 ----
                        ++name;
  #endif
  
!                     t = (is_ctor_dtor (name));
!               if (debug)      printf("symbol:%s type:%i is_shared:%i 
prog_name:%s\n", name, t, is_shared, prog_name);
! 
!                     switch (t)
                        {
                        case 1:
                          if (! is_shared)
                            add_to_list (&constructors, name);
  #ifdef COLLECT_EXPORT_LIST
!                         if ((!is_shared) && which_pass == PASS_OBJ)
                            add_to_list (&exports, name);
  #endif
                          break;
***************
*** 2772,2778 ****
                          if (! is_shared)
                            add_to_list (&destructors, name);
  #ifdef COLLECT_EXPORT_LIST
!                         if (which_pass == PASS_OBJ)
                            add_to_list (&exports, name);
  #endif
                          break;
--- 2787,2793 ----
                          if (! is_shared)
                            add_to_list (&destructors, name);
  #ifdef COLLECT_EXPORT_LIST
!                         if ((!is_shared) && which_pass == PASS_OBJ)
                            add_to_list (&exports, name);
  #endif
                          break;
***************
*** 2797,2803 ****
                          if (! is_shared)
                            add_to_list (&frame_tables, name);
  #ifdef COLLECT_EXPORT_LIST
!                         if (which_pass == PASS_OBJ)
                            add_to_list (&exports, name);
  #endif
                          break;
--- 2812,2818 ----
                          if (! is_shared)
                            add_to_list (&frame_tables, name);
  #ifdef COLLECT_EXPORT_LIST
!                         if ((!is_shared) && which_pass == PASS_OBJ)
                            add_to_list (&exports, name);
  #endif
                          break;
***************
*** 2806,2812 ****
  #ifdef COLLECT_EXPORT_LIST
                          /* If we are building a shared object on AIX we need
                             to explicitly export all global symbols.  */
!                         if (shared_obj) 
                            {
                              if (which_pass == PASS_OBJ && (! export_flag))
                                add_to_list (&exports, name);
--- 2821,2827 ----
  #ifdef COLLECT_EXPORT_LIST
                          /* If we are building a shared object on AIX we need
                             to explicitly export all global symbols.  */
!                         if (shared_obj && !is_shared) 
                            {
                              if (which_pass == PASS_OBJ && (! export_flag))
                                add_to_list (&exports, name);

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (17 preceding siblings ...)
  2004-03-04  1:56 ` ajd at gentrack dot com
@ 2004-03-04  2:40 ` greed at pobox dot com
  2004-03-04  2:47 ` dje at watson dot ibm dot com
                   ` (23 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: greed at pobox dot com @ 2004-03-04  2:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From greed at pobox dot com  2004-03-04 02:40 -------
Andrew; if you're having the problem I was having with bootstrap on AIX
(libstdc++ taking days to configure), the problem is IBM's shell gets into a
state where it dup()s and closes several hundred /tmp files each time it runs a
shell command.  (I love truss....)  Using bash instead fixes it, but you have to
twiddle configure in libstdc++-v3 to use it instead of /bin/sh in config.status.

I'll open a bug for that one tomorrow when I'm at work... not really a bug in
gcc, but if configure allowed you to use ${CONFIG_SHELL} it would be a trivial
workaround.  Now that I think about it it, it's an autoconf issue actually.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (18 preceding siblings ...)
  2004-03-04  2:40 ` greed at pobox dot com
@ 2004-03-04  2:47 ` dje at watson dot ibm dot com
  2004-03-04  3:01 ` greed at pobox dot com
                   ` (22 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: dje at watson dot ibm dot com @ 2004-03-04  2:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dje at watson dot ibm dot com  2004-03-04 02:46 -------
Subject: Re:  AIX: collect2 emits bad code with duplicated symbols 

	Any bug report about configure will be closed immediately.

	Please use 

make SHELL=.../bash CONFIG_SHELL=.../bash bootstrap

to bootstrap GCC on AIX.

David


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (19 preceding siblings ...)
  2004-03-04  2:47 ` dje at watson dot ibm dot com
@ 2004-03-04  3:01 ` greed at pobox dot com
  2004-03-04  4:01 ` ajd at gentrack dot com
                   ` (21 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: greed at pobox dot com @ 2004-03-04  3:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From greed at pobox dot com  2004-03-04 03:01 -------
The setting of SHELL and CONFIG_SHELL doesn't work when config.status gets run
with #!/bin/sh at the top.  But that's off topic for this bug.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (20 preceding siblings ...)
  2004-03-04  3:01 ` greed at pobox dot com
@ 2004-03-04  4:01 ` ajd at gentrack dot com
  2004-03-04  4:06 ` dje at watson dot ibm dot com
                   ` (20 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: ajd at gentrack dot com @ 2004-03-04  4:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ajd at gentrack dot com  2004-03-04 04:01 -------
(In reply to comment #20)
> make SHELL=.../bash CONFIG_SHELL=.../bash bootstrap
> to bootstrap GCC on AIX.
> David

Wow that certainly speeds the process.

Can that be listed at:
http://gcc.gnu.org/install/specific.html#*-ibm-aix*

(In reply to comment #16)
> 	Can you try the appended patch that disables exporting _GLOBAL_*
> symbols in AIX shared libraries?
> Thanks, David

I have done a full bootstrap.
I can confirm that this patch (in comment 16) does NOT fix the exception 
problem.
My testcase still aborts.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (21 preceding siblings ...)
  2004-03-04  4:01 ` ajd at gentrack dot com
@ 2004-03-04  4:06 ` dje at watson dot ibm dot com
  2004-03-04  4:16 ` ajd at gentrack dot com
                   ` (19 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: dje at watson dot ibm dot com @ 2004-03-04  4:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dje at watson dot ibm dot com  2004-03-04 04:06 -------
Subject: Re:  AIX: collect2 emits bad code with duplicated symbols 

>>>>> ajd at gentrack dot com writes:

ajd> I have done a full bootstrap.
ajd> I can confirm that this patch (in comment 16) does NOT fix the exception 
ajd> problem.
ajd> My testcase still aborts.

	Please make sure that you run AIX command slibclean to clear out
the old version of the shared libraries before testing.

Thanks, David


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (22 preceding siblings ...)
  2004-03-04  4:06 ` dje at watson dot ibm dot com
@ 2004-03-04  4:16 ` ajd at gentrack dot com
  2004-03-04  5:35 ` dje at watson dot ibm dot com
                   ` (18 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: ajd at gentrack dot com @ 2004-03-04  4:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ajd at gentrack dot com  2004-03-04 04:16 -------
(In reply to comment #23)
> Subject: Re:  AIX: collect2 emits bad code with duplicated symbols 
> >>>>> ajd at gentrack dot com writes:
> ajd> I have done a full bootstrap.
> ajd> I can confirm that this patch (in comment 16) does NOT fix the exception 
> ajd> problem.
> ajd> My testcase still aborts.
> 	Please make sure that you run AIX command slibclean to clear out
> the old version of the shared libraries before testing.
> Thanks, David

Did that:

$ g++ -fPIC -dPIC -shared -o liba2.a a2.cpp 
$ g++ -fPIC -dPIC -o a1 -L. -la2 a1.cpp  
$ g++ -fPIC -dPIC -shared -o libb2.a a2.cpp 
$ g++ -fPIC -dPIC -o b1 -L. -lb2 a1.cpp  
$ g++ -fPIC -dPIC -shared -o libc2.a a2.cpp 
$ g++ -fPIC -dPIC -o c1 -L. -lc2 a1.cpp  
$ g++ -fPIC -dPIC -shared -o libd2.a a2.cpp 
$ g++ -fPIC -dPIC -o d1 -L. -ld2 a1.cpp  
$ su -c slibclean
root's Password: 
$ ./a1
$ ./b1
$ ./c1
IOT/Abort trap (core dumped)
$ ./d1
IOT/Abort trap (core dumped)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (23 preceding siblings ...)
  2004-03-04  4:16 ` ajd at gentrack dot com
@ 2004-03-04  5:35 ` dje at watson dot ibm dot com
  2004-03-04  5:56 ` ajd at gentrack dot com
                   ` (17 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: dje at watson dot ibm dot com @ 2004-03-04  5:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dje at watson dot ibm dot com  2004-03-04 05:35 -------
Subject: Re:  AIX: collect2 emits bad code with duplicated symbols 

	libstdc++.a archive only contains one file: the shared object.

	If one upgrades GCC and the library major version number changes,
one can place both shared objects in the archive, with the older shared
object marked F_LOADONLY so that it is not used for linking.  However,
both shared objects are marked F_SHROBJ.

	What other files are you seeing in the libstdc++.a archive?

David


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (24 preceding siblings ...)
  2004-03-04  5:35 ` dje at watson dot ibm dot com
@ 2004-03-04  5:56 ` ajd at gentrack dot com
  2004-03-04  6:11 ` dje at watson dot ibm dot com
                   ` (16 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: ajd at gentrack dot com @ 2004-03-04  5:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ajd at gentrack dot com  2004-03-04 05:56 -------
(In reply to comment #25)
> 	libstdc++.a archive only contains one file: the shared object.
> 	If one upgrades GCC and the library major version number changes,
> one can place both shared objects in the archive, with the older shared
> object marked F_LOADONLY so that it is not used for linking.  However,
> both shared objects are marked F_SHROBJ.
> 	What other files are you seeing in the libstdc++.a archive?
> David

dump -a /gencore/gcc-3.3.2-p2g/lib/libstdc++.a  

                        ***Archive Header***
Member Name            Date                Uid        Gid     Mode      Size
libstdc++.so.5 Mar 05 06:20:59 2004          0          0    000755  0x00870f78
bitset.o       Mar 05 06:15:16 2004          7          0    000644  0x0002cd18
codecvt.o      Mar 05 06:15:19 2004          7          0    000644  0x00030b1a
complex_io.o   Mar 05 06:15:25 2004          7          0    000644  0x0006ff3a
concept-inst.o Mar 05 06:15:30 2004          7          0    000644  0x00061aee
ctype.o        Mar 05 06:15:33 2004          7          0    000644  0x00035f8a
ext-inst.o     Mar 05 06:15:38 2004          7          0    000644  0x00051e08
fstream.o      Mar 05 06:15:41 2004          7          0    000644  0x00033056
fstream-inst.o Mar 05 06:15:51 2004          7          0    000644  0x000b8690
functexcept.o  Mar 05 06:15:54 2004          7          0    000644  0x0002e72c
globals.o      Mar 05 06:15:57 2004          7          0    000644  0x0002d738
io-inst.o      Mar 05 06:16:02 2004          7          0    000644  0x000588ec
ios.o          Mar 05 06:16:06 2004          7          0    000644  0x000409c6
istream-inst.o Mar 05 06:16:15 2004          7          0    000644  0x000e62e8
limits.o       Mar 05 06:16:16 2004          7          0    000644  0x00018afc
locale.o       Mar 05 06:16:20 2004          7          0    000644  0x000533f6
locale-inst.o  Mar 05 06:16:52 2004          7          0    000644  0x0032c0e0
localename.o   Mar 05 06:16:58 2004          7          0    000644  0x0006317c
misc-inst.o    Mar 05 06:17:02 2004          7          0    000644  0x0004c6d4
ostream-inst.o Mar 05 06:17:09 2004          7          0    000644  0x000965d6
sstream-inst.o Mar 05 06:17:20 2004          7          0    000644  0x000f6dd0
stdexcept.o    Mar 05 06:17:22 2004          7          0    000644  0x0002c624
stl-inst.o     Mar 05 06:17:24 2004          7          0    000644  0x0002014c
streambuf-inst Mar 05 06:17:28 2004          7          0    000644  0x0004d1cc
string-inst.o  Mar 05 06:17:33 2004          7          0    000644  0x0008f094
strstream.o    Mar 05 06:17:40 2004          7          0    000644  0x0006dbf8
valarray-inst. Mar 05 06:17:44 2004          7          0    000644  0x0003d644
vterminate.o   Mar 05 06:17:44 2004          7          0    000644  0x0000fc8a
wstring-inst.o Mar 05 06:17:50 2004          7          0    000644  0x0009af18
codecvt_member Mar 05 06:17:52 2004          7          0    000644  0x0002b330
collate_member Mar 05 06:17:55 2004          7          0    000644  0x0002a770
ctype_members. Mar 05 06:17:58 2004          7          0    000644  0x0002daaa
messages_membe Mar 05 06:18:00 2004          7          0    000644  0x0002a1d6
monetary_membe Mar 05 06:18:03 2004          7          0    000644  0x0002ce3a
numeric_member Mar 05 06:18:05 2004          7          0    000644  0x0002b210
time_members.o Mar 05 06:18:08 2004          7          0    000644  0x0002c826
basic_file.o   Mar 05 06:18:11 2004          7          0    000644  0x00026b80
c++locale.o    Mar 05 06:18:13 2004          7          0    000644  0x0002f1ea
stubs.o        Mar 05 06:21:00 2004          0          0    000644  0x000071d2
signbit.o      Mar 05 06:21:00 2004          0          0    000644  0x0000778e
signbitf.o     Mar 05 06:21:00 2004          0          0    000644  0x0000778c
signbitl.o     Mar 05 06:21:00 2004          0          0    000644  0x000077f8
del_op.o       Mar 05 06:21:00 2004          0          0    000644  0x000007e8
del_opnt.o     Mar 05 06:21:00 2004          0          0    000644  0x00000860
del_opv.o      Mar 05 06:21:00 2004          0          0    000644  0x000007ca
del_opvnt.o    Mar 05 06:21:00 2004          0          0    000644  0x00000842
eh_alloc.o     Mar 05 06:21:00 2004          0          0    000644  0x0000fe68
eh_aux_runtime Mar 05 06:21:00 2004          0          0    000644  0x0000fd16
eh_catch.o     Mar 05 06:21:00 2004          0          0    000644  0x0000fe7e
eh_exception.o Mar 05 06:21:00 2004          0          0    000644  0x00002900
eh_globals.o   Mar 05 06:21:00 2004          0          0    000644  0x0000f6be
eh_personality Mar 05 06:21:00 2004          0          0    000644  0x00014b34
eh_terminate.o Mar 05 06:21:00 2004          0          0    000644  0x000102b0
eh_throw.o     Mar 05 06:21:00 2004          0          0    000644  0x00001e04
eh_type.o      Mar 05 06:21:00 2004          0          0    000644  0x000010da
guard.o        Mar 05 06:21:00 2004          0          0    000644  0x00000ffc
new_handler.o  Mar 05 06:21:00 2004          0          0    000644  0x000015aa
new_op.o       Mar 05 06:21:00 2004          0          0    000644  0x0000f218
new_opnt.o     Mar 05 06:21:00 2004          0          0    000644  0x00000e0a
new_opv.o      Mar 05 06:21:00 2004          0          0    000644  0x00000996
new_opvnt.o    Mar 05 06:21:00 2004          0          0    000644  0x00000868
pure.o         Mar 05 06:21:00 2004          0          0    000644  0x00005726
tinfo.o        Mar 05 06:21:00 2004          0          0    000644  0x000111ac
tinfo2.o       Mar 05 06:21:00 2004          0          0    000644  0x0000d6d8
vec.o          Mar 05 06:21:00 2004          0          0    000644  0x0000692c
cxa_demangle.o Mar 05 06:21:00 2004          0          0    000644  0x0001f088
dyn-string.o   Mar 05 06:21:00 2004          0          0    000644  0x00009d5c

---

This was the section of bootstrap where it was built:
...
generating symbol list for `libstdc++.la'
nm -B -X32_64 -
BCpg  .libs/bitset.o .libs/codecvt.o .libs/complex_io.o .libs/concept-
inst.o .libs/ctype.o .libs/ext-inst.o .libs/fstream.o .libs/fstream-
inst.o .libs/functexcept.o .libs/globals.o .libs/io-
inst.o .libs/ios.o .libs/istream-
inst.o .libs/limits.o .libs/locale.o .libs/locale-
inst.o .libs/localename.o .libs/misc-inst.o .libs/ostream-inst.o .libs/sstream-
inst.o .libs/stdexcept.o .libs/stl-inst.o .libs/streambuf-inst.o .libs/string-
inst.o .libs/strstream.o .libs/valarray-inst.o .libs/vterminate.o .libs/wstring-
inst.o .libs/codecvt_members.o .libs/collate_members.o .libs/ctype_members.o .li
bs/messages_members.o .libs/monetary_members.o .libs/numeric_members.o .libs/tim
e_members.o .libs/basic_file.o .libs/c++locale.o  ../libmath/.libs/libmath.a ../
libsupc++/.libs/libsupc++convenience.a | awk '{ if ((($2 == "T") || ($2 == "D") 
|| ($2 == "B")) && (substr($3,1,1) != ".")) { print $3 } }' | sort -u 
> .libs/libstdc++.exp
/data/ad/gcc-3.3.2-p2g-build/gcc/xgcc -shared-libgcc -B/data/ad/gcc-3.3.2-p2g-
build/gcc/ -nostdinc++ -L/data/ad/gcc-3.3.2-p2g-build/powerpc-ibm-
aix5.2.0.0/pthread/libstdc++-v3/src -L/data/ad/gcc-3.3.2-p2g-build/powerpc-ibm-
aix5.2.0.0/pthread/libstdc++-v3/src/.libs -B/gencore/gcc-3.3.2-p2g/powerpc-ibm-
aix5.2.0.0/bin/ -B/gencore/gcc-3.3.2-p2g/powerpc-ibm-aix5.2.0.0/lib/ -
isystem /gencore/gcc-3.3.2-p2g/powerpc-ibm-aix5.2.0.0/include  -pthread -
shared -
o .libs/libstdc++.so.5  .libs/bitset.o .libs/codecvt.o .libs/complex_io.o .libs/
concept-inst.o .libs/ctype.o .libs/ext-inst.o .libs/fstream.o .libs/fstream-
inst.o .libs/functexcept.o .libs/globals.o .libs/io-
inst.o .libs/ios.o .libs/istream-
inst.o .libs/limits.o .libs/locale.o .libs/locale-
inst.o .libs/localename.o .libs/misc-inst.o .libs/ostream-inst.o .libs/sstream-
inst.o .libs/stdexcept.o .libs/stl-inst.o .libs/streambuf-inst.o .libs/string-
inst.o .libs/strstream.o .libs/valarray-inst.o .libs/vterminate.o .libs/wstring-
inst.o .libs/codecvt_members.o .libs/collate_members.o .libs/ctype_members.o .li
bs/messages_members.o .libs/monetary_members.o .libs/numeric_members.o .libs/tim
e_members.o .libs/basic_file.o .libs/c++locale.o   -L/data/ad/gcc-3.3.2-p2g-
build/powerpc-ibm-aix5.2.0.0/pthread/libstdc++-v3/src -L/data/ad/gcc-3.3.2-p2g-
build/powerpc-ibm-aix5.2.0.0/pthread/libstdc++-v3/src/.libs -
lm ../libmath/.libs/libmath.a -lm ../libsupc++/.libs/libsupc++convenience.a -
lm -L/data/ad/gcc-3.3.2-p2g-build/gcc/pthread -L/data/ad/gcc-3.3.2-p2g-
build/gcc -lgcc_s_pthread -lpthreads -lc -lgcc_s_pthread -lm -lgcc_s_pthread -
lpthreads -lc -lgcc_s_pthread    -Wl,-G -Wl,-bE:.libs/libstdc++.exp -Wl,-
bnoentry ${wl}-berok
ar -X32_64 rc .libs/libstdc++.a .libs/libstdc++.so.5
rm -fr .libs/libstdc++.lax
mkdir .libs/libstdc++.lax
rm -fr .libs/libstdc++.lax/libmath.a
mkdir .libs/libstdc++.lax/libmath.a
(cd .libs/libstdc++.lax/libmath.a && ar -X32_64 x /data/ad/gcc-3.3.2-p2g-
build/powerpc-ibm-aix5.2.0.0/pthread/libstdc++-
v3/src/../libmath/.libs/libmath.a)
rm -fr .libs/libstdc++.lax/libsupc++convenience.a
mkdir .libs/libstdc++.lax/libsupc++convenience.a
(cd .libs/libstdc++.lax/libsupc++convenience.a && ar -X32_64 x /data/ad/gcc-
3.3.2-p2g-build/powerpc-ibm-aix5.2.0.0/pthread/libstdc++-
v3/src/../libsupc++/.libs/libsupc++convenience.a)
ar -X32_64 rc .libs/libstdc++.a  bitset.o codecvt.o complex_io.o concept-inst.o 
ctype.o ext-inst.o fstream.o fstream-inst.o functexcept.o globals.o io-inst.o 
ios.o istream-inst.o limits.o locale.o locale-inst.o localename.o misc-inst.o 
ostream-inst.o sstream-inst.o stdexcept.o stl-inst.o streambuf-inst.o string-
inst.o strstream.o valarray-inst.o vterminate.o wstring-inst.o 
codecvt_members.o collate_members.o ctype_members.o messages_members.o 
monetary_members.o numeric_members.o time_members.o basic_file.o 
c++locale.o .libs/libstdc++.lax/libmath.a/stubs.o .libs/libstdc++.lax/libmath.a/
signbit.o .libs/libstdc++.lax/libmath.a/signbitf.o .libs/libstdc++.lax/libmath.a
/signbitl.o  .libs/libstdc++.lax/libsupc++convenience.a/del_op.o .libs/libstdc++
.lax/libsupc++convenience.a/del_opnt.o .libs/libstdc++.lax/libsupc++convenience.
a/del_opv.o .libs/libstdc++.lax/libsupc++convenience.a/del_opvnt.o .libs/libstdc
++.lax/libsupc++convenience.a/eh_alloc.o .libs/libstdc++.lax/libsupc++convenienc
e.a/eh_aux_runtime.o .libs/libstdc++.lax/libsupc++convenience.a/eh_catch.o .libs
/libstdc++.lax/libsupc++convenience.a/eh_exception.o .libs/libstdc++.lax/libsupc
++convenience.a/eh_globals.o .libs/libstdc++.lax/libsupc++convenience.a/eh_perso
nality.o .libs/libstdc++.lax/libsupc++convenience.a/eh_terminate.o .libs/libstdc
++.lax/libsupc++convenience.a/eh_throw.o .libs/libstdc++.lax/libsupc++convenienc
e.a/eh_type.o .libs/libstdc++.lax/libsupc++convenience.a/guard.o .libs/libstdc++
.lax/libsupc++convenience.a/new_handler.o .libs/libstdc++.lax/libsupc++convenien
ce.a/new_op.o .libs/libstdc++.lax/libsupc++convenience.a/new_opnt.o .libs/libstd
c++.lax/libsupc++convenience.a/new_opv.o .libs/libstdc++.lax/libsupc++convenienc
e.a/new_opvnt.o .libs/libstdc++.lax/libsupc++convenience.a/pure.o .libs/libstdc+
+.lax/libsupc++convenience.a/tinfo.o .libs/libstdc++.lax/libsupc++convenience.a/
tinfo2.o .libs/libstdc++.lax/libsupc++convenience.a/vec.o .libs/libstdc++.lax/li
bsupc++convenience.a/cxa_demangle.o .libs/libstdc++.lax/libsupc++convenience.a/d
yn-string.o 
ranlib .libs/libstdc++.a
rm -fr .libs/libstdc++.lax
creating libstdc++.la
(cd .libs && rm -f libstdc++.la && ln -s ../libstdc++.la libstdc++.la)
gmake[7]: Leaving directory `/data/ad/gcc-3.3.2-p2g-build/powerpc-ibm-
aix5.2.0.0/pthread/libstdc++-v3/src'
...


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (25 preceding siblings ...)
  2004-03-04  5:56 ` ajd at gentrack dot com
@ 2004-03-04  6:11 ` dje at watson dot ibm dot com
  2004-03-04  6:15 ` ajd at gentrack dot com
                   ` (15 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: dje at watson dot ibm dot com @ 2004-03-04  6:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dje at watson dot ibm dot com  2004-03-04 06:11 -------
Subject: Re:  AIX: collect2 emits bad code with duplicated symbols 

	Something is broken with the build process.  Only the single
shared object should be present.

David


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (26 preceding siblings ...)
  2004-03-04  6:11 ` dje at watson dot ibm dot com
@ 2004-03-04  6:15 ` ajd at gentrack dot com
  2004-03-04 15:34 ` dje at watson dot ibm dot com
                   ` (14 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: ajd at gentrack dot com @ 2004-03-04  6:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ajd at gentrack dot com  2004-03-04 06:15 -------
(In reply to comment #27)
> Subject: Re:  AIX: collect2 emits bad code with duplicated symbols 
> 	Something is broken with the build process.  Only the single
> shared object should be present.
> David

I don't follow the Makefile.am / libtool jaz for libstdc++.

It may be related to --disable-symvers?

I had a build error without this option.
I will try again to see what this error was tomorrow.

From: http://gcc.gnu.org/install/specific.html#*-ibm-aix*
> Building libstdc++.a requires a fix for an AIX Assembler bug APAR IY26685 
(AIX 4.3) or APAR IY25528 (AIX 5.1). 

Does this apply to AIX 5.2 also?

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (27 preceding siblings ...)
  2004-03-04  6:15 ` ajd at gentrack dot com
@ 2004-03-04 15:34 ` dje at watson dot ibm dot com
  2004-03-04 17:17 ` greed at pobox dot com
                   ` (13 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: dje at watson dot ibm dot com @ 2004-03-04 15:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dje at watson dot ibm dot com  2004-03-04 15:34 -------
Subject: Re:  AIX: collect2 emits bad code with duplicated symbols 

>>>>> ajd at gentrack dot com writes:

ajd> From: http://gcc.gnu.org/install/specific.html#*-ibm-aix*
ajd> Building libstdc++.a requires a fix for an AIX Assembler bug APAR IY26685 
(AIX 4.3) or APAR IY25528 (AIX 5.1). 

ajd> Does this apply to AIX 5.2 also?

	The assembler patch should already be present in AIX 5.2.

David


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (28 preceding siblings ...)
  2004-03-04 15:34 ` dje at watson dot ibm dot com
@ 2004-03-04 17:17 ` greed at pobox dot com
  2004-03-04 17:24 ` dje at watson dot ibm dot com
                   ` (12 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: greed at pobox dot com @ 2004-03-04 17:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From greed at pobox dot com  2004-03-04 17:17 -------
(In reply to comment #21)
> The setting of SHELL and CONFIG_SHELL doesn't work when config.status gets run
> with #!/bin/sh at the top.  But that's off topic for this bug.

It doesn't work if the environment is used for CONFIG_SHELL.  It works just fine
from the make command line.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (29 preceding siblings ...)
  2004-03-04 17:17 ` greed at pobox dot com
@ 2004-03-04 17:24 ` dje at watson dot ibm dot com
  2004-03-04 17:28 ` dje at watson dot ibm dot com
                   ` (11 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: dje at watson dot ibm dot com @ 2004-03-04 17:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dje at watson dot ibm dot com  2004-03-04 17:24 -------
Subject: Re:  AIX: collect2 emits bad code with duplicated symbols 

>>>>> greed at pobox dot com writes:

greed> It doesn't work if the environment is used for CONFIG_SHELL.  It works just fine
greed> from the make command line.

	It should work if one sets the environment variable before running
top-level configure or defining it on the make invocation line, where it
is overriding Make variables, not Shell environment variables.

David


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (30 preceding siblings ...)
  2004-03-04 17:24 ` dje at watson dot ibm dot com
@ 2004-03-04 17:28 ` dje at watson dot ibm dot com
  2004-03-04 17:36 ` greed at pobox dot com
                   ` (10 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: dje at watson dot ibm dot com @ 2004-03-04 17:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dje at watson dot ibm dot com  2004-03-04 17:28 -------
Subject: Re:  AIX: collect2 emits bad code with duplicated symbols 

	The static libraries are being included in the libstc++ archive
because of a bug in ltconfig.  Please try the following patch.

	* ltconfig: Disable building static libraries if building shared
	libraries on AIX 5L.

Index: ltconfig
===================================================================
RCS file: /cvs/gcc/gcc/ltconfig,v
retrieving revision 1.29
diff -c -p -r1.29 ltconfig
*** ltconfig	19 Nov 2003 05:29:32 -0000	1.29
--- ltconfig	4 Mar 2004 17:19:42 -0000
*************** aix3*)
*** 1592,1598 ****
    fi
    ;;
  
! aix4*)
    test "$enable_shared" = yes && enable_static=no
    ;;
  esac
--- 1593,1599 ----
    fi
    ;;
  
! aix4* | aix5*)
    test "$enable_shared" = yes && enable_static=no
    ;;
  esac



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (31 preceding siblings ...)
  2004-03-04 17:28 ` dje at watson dot ibm dot com
@ 2004-03-04 17:36 ` greed at pobox dot com
  2004-03-04 18:46 ` dje at watson dot ibm dot com
                   ` (9 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: greed at pobox dot com @ 2004-03-04 17:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From greed at pobox dot com  2004-03-04 17:36 -------
(In reply to comment #16)
> Index: collect2.c
> *** collect2.c	21 Jan 2004 20:39:52 -0000	1.160
> --- collect2.c	3 Mar 2004 22:38:31 -0000

Using the patch in comment #16, my testcase passes as well.  Next step is to
build RogueWave SourcePro and see how that turns out.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (32 preceding siblings ...)
  2004-03-04 17:36 ` greed at pobox dot com
@ 2004-03-04 18:46 ` dje at watson dot ibm dot com
  2004-03-04 21:02 ` ajd at gentrack dot com
                   ` (8 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: dje at watson dot ibm dot com @ 2004-03-04 18:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dje at watson dot ibm dot com  2004-03-04 18:46 -------
Subject: Re:  AIX: collect2 emits bad code with duplicated symbols 

	I believe that the following patch is a more correct fix to
collect2 unecessarily exporting ctors and dtors.  This patch, combined
with the ltconfig patch, should address the EH problems.

David

Index: collect2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/collect2.c,v
retrieving revision 1.160
diff -c -p -u -r1.160 collect2.c
--- collect2.c	21 Jan 2004 20:39:52 -0000	1.160
+++ collect2.c	4 Mar 2004 18:40:41 -0000
@@ -1398,10 +1398,12 @@ main (int argc, char **argv)
       if (! exports.first)
 	*ld2++ = concat ("-bE:", export_file, NULL);
 
+#ifndef LD_INIT_SWITCH
       add_to_list (&exports, initname);
       add_to_list (&exports, fininame);
       add_to_list (&exports, "_GLOBAL__DI");
       add_to_list (&exports, "_GLOBAL__DD");
+#endif
       exportf = fopen (export_file, "w");
       if (exportf == (FILE *) 0)
 	fatal_perror ("fopen %s", export_file);
@@ -2719,7 +2721,7 @@ scan_prog_file (const char *prog_name, e
 			case 1:
 			  if (! is_shared)
 			    add_to_list (&constructors, name);
-#ifdef COLLECT_EXPORT_LIST
+#if defined (COLLECT_EXPORT_LIST) && !defined (LD_INIT_SWITCH)
 			  if (which_pass == PASS_OBJ)
 			    add_to_list (&exports, name);
 #endif
@@ -2728,7 +2730,7 @@ scan_prog_file (const char *prog_name, e
 			case 2:
 			  if (! is_shared)
 			    add_to_list (&destructors, name);
-#ifdef COLLECT_EXPORT_LIST
+#if defined (COLLECT_EXPORT_LIST) && !defined (LD_INIT_SWITCH)
 			  if (which_pass == PASS_OBJ)
 			    add_to_list (&exports, name);
 #endif
@@ -2753,7 +2755,7 @@ scan_prog_file (const char *prog_name, e
 			case 5:
 			  if (! is_shared)
 			    add_to_list (&frame_tables, name);
-#ifdef COLLECT_EXPORT_LIST
+#if defined (COLLECT_EXPORT_LIST) && !defined (LD_INIT_SWITCH)
 			  if (which_pass == PASS_OBJ)
 			    add_to_list (&exports, name);
 #endif
@@ -2761,13 +2763,14 @@ scan_prog_file (const char *prog_name, e
 
 			default:	/* not a constructor or destructor */
 #ifdef COLLECT_EXPORT_LIST
-			  /* If we are building a shared object on AIX we need
-			     to explicitly export all global symbols.  */
-			  if (shared_obj)
-			    {
-			      if (which_pass == PASS_OBJ && (! export_flag))
-				add_to_list (&exports, name);
-			    }
+			  /* Explicitly export all global symbols when
+			     building a shared object on AIX, but do not
+			     re-export symbols from another shared object
+			     and do not export symbols if the user
+			     provides an explicit export list.  */
+			  if (shared_obj && !is_shared
+			      && which_pass == PASS_OBJ && !export_flag)
+			    add_to_list (&exports, name);
 #endif
 			  continue;
 			}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (33 preceding siblings ...)
  2004-03-04 18:46 ` dje at watson dot ibm dot com
@ 2004-03-04 21:02 ` ajd at gentrack dot com
  2004-03-05 15:44 ` greed at pobox dot com
                   ` (7 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: ajd at gentrack dot com @ 2004-03-04 21:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ajd at gentrack dot com  2004-03-04 21:01 -------
(In reply to comment #32)
> 	The static libraries are being included in the libstc++ archive
> because of a bug in ltconfig.  Please try the following patch.
> 	* ltconfig: Disable building static libraries if building shared
> 	libraries on AIX 5L.
> Index: ltconfig

After all this, this single line change is ALL that is required to fix the 
exception problem.

(In reply to comment #34)
> Subject: Re:  AIX: collect2 emits bad code with duplicated symbols 
> 	I believe that the following patch is a more correct fix to
> collect2 unecessarily exporting ctors and dtors.  This patch, combined
> with the ltconfig patch, should address the EH problems.
> David
> Index: collect2.c

This patch is not necessary to fix the exception problem.
However it is an optimization on exported symbols and fixes the duplicate 
_GLOBAL_* symbol linker warnings.

--

Thank you very much for your help, David.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (34 preceding siblings ...)
  2004-03-04 21:02 ` ajd at gentrack dot com
@ 2004-03-05 15:44 ` greed at pobox dot com
  2004-03-05 18:55 ` greed at pobox dot com
                   ` (6 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: greed at pobox dot com @ 2004-03-05 15:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From greed at pobox dot com  2004-03-05 15:44 -------
(In reply to comment #35)
> After all this, this single line change is ALL that is required to fix the 
> exception problem.

Yes, getting rid of the static members of libstdc++.a does the trick.  (Using
the contrived testcase in this bug.)

> This patch is not necessary to fix the exception problem.
> However it is an optimization on exported symbols and fixes the duplicate 
> _GLOBAL_* symbol linker warnings.

...which is a good thing all by itself.

> Thank you very much for your help, David.

I agree, thank you.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (35 preceding siblings ...)
  2004-03-05 15:44 ` greed at pobox dot com
@ 2004-03-05 18:55 ` greed at pobox dot com
  2004-03-05 19:51 ` dje at watson dot ibm dot com
                   ` (5 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: greed at pobox dot com @ 2004-03-05 18:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From greed at pobox dot com  2004-03-05 18:55 -------
I'm not sure if it's the ltconfig patch or the "reduce exports" patch, but there
seems to be a reduction--sometimes large--in the size of libraries generated
with the patched compiler compared to the stock 3.3.3 and 3.3.2 compilers.

Library bloat is also a concern for us (as it usually means there's duplicate
definitions around); so I'm going to run our production builds with both patches
in, and investigate more next week as to which patch cause the improvement.

(My "testcase" for this one is the RogueWave SourcePro suite.)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (36 preceding siblings ...)
  2004-03-05 18:55 ` greed at pobox dot com
@ 2004-03-05 19:51 ` dje at watson dot ibm dot com
  2004-03-05 21:08 ` greed at pobox dot com
                   ` (4 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: dje at watson dot ibm dot com @ 2004-03-05 19:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dje at watson dot ibm dot com  2004-03-05 19:51 -------
Subject: Re:  AIX: collect2 emits bad code with duplicated symbols 

	The decrease in size of libstdc++ (and all GCC libraries generated
with libtool) is due to the ltconfig change only placing the shared object
in the library.

	If other libraries are decreased, then I worry that the other
patch decreasing exports allowed the AIX linker garbage collector to be
too aggressive because it found less symbol roots.  Hopefully everything
still works correctly.

David


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (37 preceding siblings ...)
  2004-03-05 19:51 ` dje at watson dot ibm dot com
@ 2004-03-05 21:08 ` greed at pobox dot com
  2004-03-06 20:56 ` dje at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: greed at pobox dot com @ 2004-03-05 21:08 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From greed at pobox dot com  2004-03-05 21:08 -------
(In reply to comment #38)
> 	If other libraries are decreased, then I worry that the other
> patch decreasing exports allowed the AIX linker garbage collector to be
> too aggressive because it found less symbol roots.  Hopefully everything
> still works correctly.

Yes, link and execute are both going well.

The non-GCC libraries have returned to the sizes we were getting from GCC 3.3.0.
 I never really investigated what happened between 3.3.0 and 3.3.2 to make the
libraries explode in size, as they seemed to run just fine--the libraries in
question weren't using exceptions.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (38 preceding siblings ...)
  2004-03-05 21:08 ` greed at pobox dot com
@ 2004-03-06 20:56 ` dje at gcc dot gnu dot org
  2004-03-06 23:31 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: dje at gcc dot gnu dot org @ 2004-03-06 20:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dje at gcc dot gnu dot org  2004-03-06 20:56 -------
patches committed

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (39 preceding siblings ...)
  2004-03-06 20:56 ` dje at gcc dot gnu dot org
@ 2004-03-06 23:31 ` pinskia at gcc dot gnu dot org
  2004-03-07 22:35 ` dje at gcc dot gnu dot org
  2004-11-24 18:42 ` pinskia at gcc dot gnu dot org
  42 siblings, 0 replies; 44+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-06 23:31 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (40 preceding siblings ...)
  2004-03-06 23:31 ` pinskia at gcc dot gnu dot org
@ 2004-03-07 22:35 ` dje at gcc dot gnu dot org
  2004-11-24 18:42 ` pinskia at gcc dot gnu dot org
  42 siblings, 0 replies; 44+ messages in thread
From: dje at gcc dot gnu dot org @ 2004-03-07 22:35 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.5.0                       |3.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

* [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols
  2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
                   ` (41 preceding siblings ...)
  2004-03-07 22:35 ` dje at gcc dot gnu dot org
@ 2004-11-24 18:42 ` pinskia at gcc dot gnu dot org
  42 siblings, 0 replies; 44+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-24 18:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-24 18:42 -------
*** Bug 18649 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |askees at appfluent dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13391


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

end of thread, other threads:[~2004-11-24 18:42 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-12 19:13 [Bug target/13391] New: AIX: crash on throw/catch between shared objects greed at pobox dot com
2003-12-12 19:18 ` [Bug target/13391] " greed at pobox dot com
2003-12-12 19:19 ` greed at pobox dot com
2003-12-12 19:19 ` greed at pobox dot com
2003-12-12 19:20 ` greed at pobox dot com
2003-12-12 19:20 ` greed at pobox dot com
2003-12-12 19:20 ` greed at pobox dot com
2003-12-24  2:46 ` ddurham_gcc_bz at davyandbeth dot com
2003-12-26  3:20 ` dje at gcc dot gnu dot org
2003-12-29 16:24 ` ddurham_gcc_bz at davyandbeth dot com
2003-12-29 20:51 ` greed at pobox dot com
2004-01-18 17:58 ` dhazeghi at yahoo dot com
2004-01-19  4:32 ` dje at watson dot ibm dot com
2004-01-19 17:36 ` [Bug target/13391] AIX: collect2 emits bad code with duplicated symbols dhazeghi at yahoo dot com
2004-01-20 21:13 ` greed at pobox dot com
2004-03-03  1:11 ` ajd at gentrack dot com
2004-03-03 22:48 ` dje at watson dot ibm dot com
2004-03-04  0:00 ` ajd at gentrack dot com
2004-03-04  1:56 ` ajd at gentrack dot com
2004-03-04  2:40 ` greed at pobox dot com
2004-03-04  2:47 ` dje at watson dot ibm dot com
2004-03-04  3:01 ` greed at pobox dot com
2004-03-04  4:01 ` ajd at gentrack dot com
2004-03-04  4:06 ` dje at watson dot ibm dot com
2004-03-04  4:16 ` ajd at gentrack dot com
2004-03-04  5:35 ` dje at watson dot ibm dot com
2004-03-04  5:56 ` ajd at gentrack dot com
2004-03-04  6:11 ` dje at watson dot ibm dot com
2004-03-04  6:15 ` ajd at gentrack dot com
2004-03-04 15:34 ` dje at watson dot ibm dot com
2004-03-04 17:17 ` greed at pobox dot com
2004-03-04 17:24 ` dje at watson dot ibm dot com
2004-03-04 17:28 ` dje at watson dot ibm dot com
2004-03-04 17:36 ` greed at pobox dot com
2004-03-04 18:46 ` dje at watson dot ibm dot com
2004-03-04 21:02 ` ajd at gentrack dot com
2004-03-05 15:44 ` greed at pobox dot com
2004-03-05 18:55 ` greed at pobox dot com
2004-03-05 19:51 ` dje at watson dot ibm dot com
2004-03-05 21:08 ` greed at pobox dot com
2004-03-06 20:56 ` dje at gcc dot gnu dot org
2004-03-06 23:31 ` pinskia at gcc dot gnu dot org
2004-03-07 22:35 ` dje at gcc dot gnu dot org
2004-11-24 18:42 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).