This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix objdump -d on ppc64 without dot syms (take 2)


On Tue, Aug 17, 2004 at 09:21:57AM +0930, Alan Modra wrote:
> On Sat, Aug 14, 2004 at 05:47:43PM +0200, Jakub Jelinek wrote:
> > With unpatched gcc 3.4.1 I'm getting:
> > FAIL: visibility (hidden_undef_def) (non PIC)
> > FAIL: visibility (hidden_undef_def) (non PIC, load offset)
> > FAIL: visibility (hidden_undef_def)
> > FAIL: visibility (hidden_undef_def) (PIC main, non PIC so)
> > FAIL: visibility (hidden_undef_def) (PIC main)
> > (see the above URL for details), when using gcc 3.4.1 with your dot syms
> > patch these failures go away, but there are 4 new ones:
> 
> The fact that they go away indicates I have a problem in the linker.
> I'll look into it today.

I think these failures are due to the testsuite's use of asm statements
to change symbol visibility.  With the old ABI, PowerPC64 functions
define two symbols, so it is necessary to mark both syms hidden or
protected.  A patch like the following allows all these tests to pass
when using the old ABI.  Unfortunately, this makes all the visibility
tests fail with the new ABI, because no dot-symbols are defined for
functions and the asm introduces undefined hidden symbols.

I suppose I could do something in the linker for old ABI objects that
have a mismatch between code entry and function descriptor symbols..

Index: ld/testsuite/ld-elfvsb/elfvsb.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-elfvsb/elfvsb.exp,v
retrieving revision 1.25
diff -u -p -r1.25 elfvsb.exp
--- ld/testsuite/ld-elfvsb/elfvsb.exp	11 May 2004 17:08:37 -0000	1.25
+++ ld/testsuite/ld-elfvsb/elfvsb.exp	17 Aug 2004 03:38:29 -0000
@@ -117,11 +117,11 @@ proc visibility_test { visibility progna
     }
     if {![ld_simple_link $CC $tmpdir/$progname.so "$shared $shldflags $tmpdir/$sh1 $tmpdir/$sh2"]} {
 	if { [ string match $visibility "hidden_undef" ]
-	     && [regexp ".*/sh1.c.*: undefined reference to \`visibility\'" $link_output]
+	     && [regexp ".*/sh1.c.*: undefined reference to \`\.?visibility\'" $link_output]
 	     && [regexp ".*/sh1.c.*: undefined reference to \`visibility_var\'" $link_output] } {
     	    pass "$testname"
 	} else { if { [ string match $visibility "protected_undef" ]
-	     && [regexp ".*/sh1.c.*: undefined reference to \`visibility\'" $link_output]
+	     && [regexp ".*/sh1.c.*: undefined reference to \`\.?visibility\'" $link_output]
 	     && [regexp ".*/sh1.c.*: undefined reference to \`visibility_var\'" $link_output] } {
     	    pass "$testname"
 	} else {
@@ -140,13 +140,13 @@ proc visibility_test { visibility progna
     }
     if ![ld_simple_link $CC $tmpdir/$progname "-Wl,-rpath,$rpath $tmpdir/$main $tmpdir/$progname.so"] {
 	if { [ string match $visibility "hidden" ]
-	     && [regexp ".*/main.c.*: undefined reference to \`visibility\'" $link_output]
+	     && [regexp ".*/main.c.*: undefined reference to \`\.?visibility\'" $link_output]
 	     && [regexp ".*/main.c.*: undefined reference to \`visibility_var\'" $link_output] } {
     	    pass "$testname"
 	} else { if { [ string match $visibility "hidden_undef_def" ]
-	     && [regexp ".*/main.c.*: undefined reference to \`visibility\'" $link_output]
+	     && [regexp ".*/main.c.*: undefined reference to \`\.?visibility\'" $link_output]
 	     && [regexp ".*/main.c.*: undefined reference to \`visibility_def\'" $link_output]
-	     && [regexp ".*/main.c.*: undefined reference to \`visibility_func\'" $link_output]
+	     && [regexp ".*/main.c.*: undefined reference to \`\.?visibility_func\'" $link_output]
 	     && [regexp ".*/main.c.*: undefined reference to \`visibility_var\'" $link_output] } {
     	    pass "$testname"
 	} else {
Index: ld/testsuite/ld-elfvsb/main.c
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-elfvsb/main.c,v
retrieving revision 1.10
diff -u -p -r1.10 main.c
--- ld/testsuite/ld-elfvsb/main.c	18 Jun 2004 15:41:47 -0000	1.10
+++ ld/testsuite/ld-elfvsb/main.c	17 Aug 2004 03:38:29 -0000
@@ -105,6 +105,9 @@ shared_func (void)
 }
 
 asm (".protected shared_func");
+#ifdef __powerpc64__
+asm (".protected .shared_func");
+#endif
 
 extern int * shared_data_p ();
 typedef int (*func) ();
@@ -179,6 +182,9 @@ asm (".hidden visibility_undef_var_weak"
 #pragma weak visibility_undef_func_weak
 extern int visibility_undef_func_weak ();
 asm (".hidden visibility_undef_func_weak");
+#ifdef __powerpc64__
+asm (".hidden .visibility_undef_func_weak");
+#endif
 
 #pragma weak visibility_var_weak
 extern int visibility_var_weak;
@@ -187,6 +193,9 @@ asm (".hidden visibility_var_weak");
 #pragma weak visibility_func_weak
 extern int visibility_func_weak ();
 asm (".hidden visibility_func_weak");
+#ifdef __powerpc64__
+asm (".hidden .visibility_func_weak");
+#endif
 
 int
 main_visibility_checkweak ()
@@ -201,6 +210,9 @@ extern int visibility_def;
 asm (".hidden visibility_def");
 extern int visibility_func ();
 asm (".hidden visibility_func");
+#ifdef __powerpc64__
+asm (".hidden .visibility_func");
+#endif
 
 int
 main_visibility_checkcom (void)
Index: ld/testsuite/ld-elfvsb/sh1.c
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-elfvsb/sh1.c,v
retrieving revision 1.7
diff -u -p -r1.7 sh1.c
--- ld/testsuite/ld-elfvsb/sh1.c	5 May 2003 05:46:53 -0000	1.7
+++ ld/testsuite/ld-elfvsb/sh1.c	17 Aug 2004 03:38:29 -0000
@@ -194,6 +194,9 @@ visibility ()
 
 #ifdef HIDDEN_NORMAL_TEST
 asm (".hidden visibility_normal");
+#ifdef __powerpc64__
+asm (".hidden .visibility_normal");
+#endif
 
 int
 visibility_normal ()
@@ -316,10 +319,16 @@ visibility_varval ()
 
 #if defined (HIDDEN_TEST) || defined (HIDDEN_UNDEF_TEST)
 asm (".hidden visibility");
+#ifdef __powerpc64__
+asm (".hidden .visibility");
+#endif
 asm (".hidden visibility_var");
 #else
 #if defined (PROTECTED_TEST) || defined (PROTECTED_UNDEF_TEST) || defined (PROTECTED_WEAK_TEST)
 asm (".protected visibility");
+#ifdef __powerpc64__
+asm (".protected .visibility");
+#endif
 asm (".protected visibility_var");
 #endif
 #endif
@@ -347,6 +356,9 @@ asm (".hidden shlib_visibility_undef_var
 #pragma weak shlib_visibility_undef_func_weak
 extern int shlib_visibility_undef_func_weak ();
 asm (".hidden shlib_visibility_undef_func_weak");
+#ifdef __powerpc64__
+asm (".hidden .shlib_visibility_undef_func_weak");
+#endif
 
 #pragma weak shlib_visibility_var_weak
 extern int shlib_visibility_var_weak;
@@ -355,6 +367,9 @@ asm (".hidden shlib_visibility_var_weak"
 #pragma weak shlib_visibility_func_weak
 extern int shlib_visibility_func_weak ();
 asm (".hidden shlib_visibility_func_weak");
+#ifdef __powerpc64__
+asm (".hidden .shlib_visibility_func_weak");
+#endif
 
 int
 shlib_visibility_checkcom ()
Index: ld/testsuite/ld-elfvsb/test.c
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-elfvsb/test.c,v
retrieving revision 1.1
diff -u -p -r1.1 test.c
--- ld/testsuite/ld-elfvsb/test.c	20 May 2003 14:35:01 -0000	1.1
+++ ld/testsuite/ld-elfvsb/test.c	17 Aug 2004 03:38:29 -0000
@@ -5,6 +5,9 @@ asm (".hidden main_hidden_data");
 #pragma weak main_hidden_func
 extern int main_hidden_func ();
 asm (".hidden main_hidden_func");
+#ifdef __powerpc64__
+asm (".hidden .main_hidden_func");
+#endif
 
 int
 _start (void)


-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]