This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[TRUNK/3.4.2] Export __trampoline_setup/__transfer_from_trampoline
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>, Mark Mitchell <mark at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Alan Modra <amodra at bigpond dot net dot au>
- Date: Wed, 1 Sep 2004 04:10:07 -0400
- Subject: [TRUNK/3.4.2] Export __trampoline_setup/__transfer_from_trampoline
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
This patch fixes bootstrap problem with Ada on ppc32, but it can be reproduced
with plain C code too:
cat > shlib.c <<EOF
void abort (void);
void
__attribute__((noinline))
foo (void (*fn) (void))
{
fn ();
fn ();
fn ();
}
void
test (void)
{
int i = 26;
void bar (void) { ++i; }
foo (bar);
if (i != 29)
abort ();
}
EOF
cat > test.c <<EOF
extern void test (void);
int
main (void)
{
test ();
return 0;
}
EOF
gcc -shared -shared-libgcc -O2 -fpic -o shlib.so shlib.c
gcc -O2 -o test test.c ./shlib.so
results in:
/usr/bin/ld: test: hidden symbol `__trampoline_setup' in /usr/lib/gcc/ppc64-redhat-linux/3.4.1/libgcc.a(tramp.oS) is referenced by DSO
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
Looking at it, FRV probably wants to export __trampoline_setup too and
m68k/ns32k __transfer_from_trampoline.
Here is the patch.
Is it ok for 3.4.2? If not, a different symbol version will need to be used.
2004-09-01 Jakub Jelinek <jakub@redhat.com>
* libgcc-std.ver (GCC_3.4.2): Export also __trampoline_setup and
__transfer_from_trampoline.
--- gcc/libgcc-std.ver.jj 2004-07-21 08:55:08.000000000 +0200
+++ gcc/libgcc-std.ver 2004-09-01 09:57:55.681611932 +0200
@@ -222,4 +222,6 @@ GCC_3.4 {
GCC_3.4.2 {
# Used to deal with trampoline initialization on some platforms
__enable_execute_stack
+ __trampoline_setup
+ __transfer_from_trampoline
}
Jakub