This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Add the "ld -r" test for ELF visibility.
On Wed, Oct 31, 2001 at 02:12:10PM -0500, Hans-Peter Nilsson wrote:
> On Wed, 31 Oct 2001, H . J . Lu wrote:
> > Here is the new test.
> >
> > * ld-elfvsb/elfvsb.exp: Add the "ld -r" test.
> >
> > * ld-elfvsb/visibility.s: New.
>
> This looks like it could use the run_dump_test framework. See
> ld-linkonce for an example (change "objdump" to "readelf", and
> weed out everything but the HIDDEN and PROTECTED lines with #...
> and #pass). Much less footwork per test.
>
How about this patch? Tested on Linux/x86 and Linux/alpha.
H.J.
----
--- ld-elfvsb/define.d.vsb Wed Oct 31 12:39:27 2001
+++ ld-elfvsb/define.d Wed Oct 31 13:14:16 2001
@@ -0,0 +1,13 @@
+#source: undef.s
+#source: define.s
+#ld: -r
+#readelf: -s
+#target: *-*-*
+
+Symbol table '.symtab' contains .* entries:
+ Num: Value[ ]+Size Type Bind Vis Ndx Name
+#...
+ .: [0-9a-fA-F]* 0 NOTYPE GLOBAL HIDDEN . hidden
+ .: [0-9a-fA-F]* 0 NOTYPE GLOBAL INTERNAL . internal
+ .: [0-9a-fA-F]* 0 NOTYPE GLOBAL PROTECTED . protected
+#...
--- ld-elfvsb/define.s.vsb Wed Oct 31 12:39:24 2001
+++ ld-elfvsb/define.s Wed Oct 31 12:39:07 2001
@@ -0,0 +1,6 @@
+ .globl protected
+protected:
+ .globl hidden
+hidden:
+ .globl internal
+internal:
--- ld-elfvsb/elfvsb.exp.vsb Wed Jun 6 15:07:50 2001
+++ ld-elfvsb/elfvsb.exp Wed Oct 31 12:04:59 2001
@@ -42,6 +42,13 @@ if { [istarget *-*-linux*aout*] \
return
}
+set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
+foreach t $test_list {
+ # We need to strip the ".d", but can leave the dirname.
+ verbose [file rootname $t]
+ run_dump_test [file rootname $t]
+}
+
set tmpdir tmpdir
set SHCFLAG ""
--- ld-elfvsb/undef.d.vsb Wed Oct 31 11:49:47 2001
+++ ld-elfvsb/undef.d Wed Oct 31 13:14:27 2001
@@ -0,0 +1,12 @@
+#source: undef.s
+#ld: -r
+#readelf: -s
+#target: *-*-*
+
+Symbol table '.symtab' contains .* entries:
+ Num: Value[ ]+Size Type Bind Vis Ndx Name
+#...
+ .: [0-9a-fA-F]* 0 NOTYPE GLOBAL HIDDEN UND hidden
+ .: [0-9a-fA-F]* 0 NOTYPE GLOBAL INTERNAL UND internal
+ .: [0-9a-fA-F]* 0 NOTYPE GLOBAL PROTECTED UND protected
+#...
--- ld-elfvsb/undef.s.vsb Wed Oct 31 11:47:24 2001
+++ ld-elfvsb/undef.s Wed Oct 31 11:47:24 2001
@@ -0,0 +1,3 @@
+ .protected protected
+ .hidden hidden
+ .internal internal