PR26580, Size and alignment of commons vs as-needed shared lib
[deliverable/binutils-gdb.git] / ld / testsuite / ld-elf / comm-data.exp
index 87ae3b299124e615e5b876e4570165a5b79619e8..16b8e2b8ed2587cf715286b9c6687c9f29eb4cef 100644 (file)
@@ -48,6 +48,16 @@ if { [istarget "mips*vr4100*-*-elf*"] \
     append LFLAGS " -call_shared"
 }
 
+# Set the pointer size according to the ELF flavor.
+set AFLAGS ""
+if [is_elf64 "tmpdir/libcomm-data.so"] {
+    append AFLAGS " --defsym ELF64=1"
+}
+# HPUX targets use a different .comm syntax.
+if [istarget "*-*-hpux*"] {
+    append AFLAGS " --defsym HPUX=1"
+}
+
 set testname "Common symbol override test"
 
 # Define a global symbol.
@@ -62,18 +72,16 @@ run_ld_link_tests [list \
        } \
        "libcomm-data.so" \
     ] \
+    [list \
+       "libpr26580-1.so" \
+       "$LFLAGS -shared" "" \
+       "$AFLAGS_PIC $AFLAGS" \
+       { pr26580-b.s } \
+       { } \
+       "libpr26580-1.so" \
+    ] \
 ]
 
-# Set the pointer size according to the ELF flavor.
-set AFLAGS ""
-if [is_elf64 "tmpdir/libcomm-data.so"] {
-    append AFLAGS " --defsym ELF64=1"
-}
-# HPUX targets use a different .comm syntax.
-if [istarget "*-*-hpux*"] {
-    append AFLAGS " --defsym HPUX=1"
-}
-
 # bfin-elf does not currently support copy relocs.
 setup_xfail "bfin-*-*"
 clear_xfail "bfin-*-linux-uclibc*"
@@ -113,4 +121,20 @@ run_ld_link_tests [list \
        } \
        "comm-data3b" \
     ] \
+    [list \
+       "pr26580-1" \
+       "$LFLAGS --as-needed -Ltmpdir -lpr26580-1" "" \
+       "$AFLAGS" \
+       { pr26580-a.s } \
+       { {readelf -s pr26580-1.sd} } \
+       "pr26580-1" \
+    ] \
+    [list \
+       "pr26580-2" \
+       "$LFLAGS --no-as-needed -Ltmpdir -lpr26580-1" "" \
+       "$AFLAGS" \
+       { pr26580-a.s } \
+       { {readelf -s pr26580-2.sd} } \
+       "pr26580-2" \
+    ] \
 ]
This page took 0.023841 seconds and 4 git commands to generate.