public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: Test case which displays problem found in libstdc++-v3 effort
@ 2000-06-18  0:12 Benjamin Kosnik
  2000-06-18  4:44 ` Alan Modra
  0 siblings, 1 reply; 12+ messages in thread
From: Benjamin Kosnik @ 2000-06-18  0:12 UTC (permalink / raw)
  To: binutils

More info on this bug can be found on the libstdc++ list, here:

http://sourceware.cygnus.com/ml/libstdc++/2000-06/msg00127.html
http://sourceware.cygnus.com/ml/libstdc++/2000-06/msg00128.html

in which jason says:


Or in a relatively mundane way; as it happens, it's simply discarding all
of the unwind info.  objdump -x a.out shows that the .eh_frame section is
size 0, which would seem to indicate a problem...

Definitely seems like a linker bug.


Can somebody with linker expertise please look at this?

thanks,
benjamin

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: Test case which displays problem found in libstdc++-v3 effort
@ 2000-06-19 15:48 Loren James Rittle
  0 siblings, 0 replies; 12+ messages in thread
From: Loren James Rittle @ 2000-06-19 15:48 UTC (permalink / raw)
  To: binutils; +Cc: libstdc++

Alan,

> It's a linker script bug.  The linker needs to be told to keep the
> .eh_frame contents.  Lack of any reference to symbols defined in a
> section normally causes --gc-sections to discard the section.

Thanks!  I can confirm that your patch fixes the test case when used
with mainline CVS gcc.

Regarding the NEWS file update, I can also confirm that section GC
appears to be working fine on my i386-elf platform.

Regards,
Loren

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: Test case which displays problem found in libstdc++-v3 effort
@ 2000-06-18 21:33 Benjamin Kosnik
  0 siblings, 0 replies; 12+ messages in thread
From: Benjamin Kosnik @ 2000-06-18 21:33 UTC (permalink / raw)
  To: libstdc++, binutils

Great! This works. Can you please check it in? Thanks again,

Benjamin

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Test case which displays problem found in libstdc++-v3 effort
@ 2000-06-16 18:35 Loren James Rittle
  0 siblings, 0 replies; 12+ messages in thread
From: Loren James Rittle @ 2000-06-16 18:35 UTC (permalink / raw)
  To: binutils; +Cc: libstdc++

There is talk of using -ffunction-sections -fdata-sections (to compile
the libstdc++-v3 library code) and to suggest -Wl,--gc-sections (for
any static links against the library) on any platforms which supports
those options.  On those platforms, the test suite for libstdc++-v3
would always add -Wl,--gc-sections for links.

The following small test case fails on:

i686-pc-linux-gnu with gcc 2.95.1 using ld 2.9.5.
i686-unknown-freebsdelf with gcc 2.95.2 (+branch patches) using ld 2.9.5
i686-unknown-freebsd3.4 with mainline CVS gcc using ld 2.10
sparc-sun-solaris2.6 with gcc 2.95.2 using ld 2.10

with this command line (which I tried to capture in the proper place
and manner of the testsuite in the actual patch I am submitting):

g++ -ffunction-sections -fdata-sections -Wl,--gc-sections -static 6.cc; a.out

2000-06-16  Loren J. Rittle  <ljrittle@acm.org>

        * ld-selective/selective.exp:  Add test6.
        * ld-selective/6.cc: New file.

Index: ld-selective/selective.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-selective/selective.exp,v
retrieving revision 1.3.2.1
diff -c -p -r1.3.2.1 selective.exp
*** selective.exp	2000/04/11 23:04:03	1.3.2.1
--- selective.exp	2000/06/17 01:09:45
*************** set test2 "selective2"
*** 32,37 ****
--- 32,38 ----
  set test3 "selective3"
  set test4 "selective4"
  set test5 "selective5"
+ set test6 "selective6"
  
  set cflags "-w -O2 -ffunction-sections -fdata-sections" 
  set cxxflags "-fvtable-gc -fno-exceptions -fno-rtti"
*************** if ![ld_simple_link $ld tmpdir/4.x "$ldf
*** 169,174 ****
--- 170,196 ----
            } else {
  	      pass $test5
               }
+ 	}
+     }
+ }
+ 
+ if [isnative] {
+     if ![ld_compile "$CC $cflags $cxxflags -fexceptions" \
+ 	    $srcdir/$subdir/6.cc tmpdir/6.o] {
+         unresolved $test6
+         return
+     }
+ 
+     if ![ld_link $ld tmpdir/6.x "$ldflags tmpdir/6.o"] {
+         fail $test6
+     } else {
+ 	catch "exec tmpdir/6.x" exec_output
+ 	if ![string match "" $exec_output] then {
+ 	    send_log "$exec_output\n"
+             verbose "$exec_output" 1
+             fail $test6
+ 	} else {
+ 	    pass $test6
  	}
      }
  }
*** /dev/null	Fri Jun 16 19:59:00 2000
--- ld-selective/6.cc	Fri Jun 16 19:19:21 2000
***************
*** 0 ****
--- 1,9 ----
+ int main (void)
+ {
+   try
+     {
+       throw 1;
+     }
+   catch (...) {}
+   return 0;
+ }

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

end of thread, other threads:[~2000-06-24 23:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-18  0:12 Test case which displays problem found in libstdc++-v3 effort Benjamin Kosnik
2000-06-18  4:44 ` Alan Modra
2000-06-19 19:31   ` Jason Merrill
2000-06-19 21:03     ` Alan Modra
2000-06-22 15:29       ` Jason Merrill
2000-06-22 18:12         ` Alan Modra
2000-06-23  7:40           ` Alan Modra
2000-06-24 13:06             ` Jason Merrill
2000-06-24 23:51             ` Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
2000-06-19 15:48 Loren James Rittle
2000-06-18 21:33 Benjamin Kosnik
2000-06-16 18:35 Loren James Rittle

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).