ChangeLog rotation
[deliverable/binutils-gdb.git] / ld / testsuite / ld-elf / shared.exp
index 0802fa24c6884f067bc6c98fa06b69217b8ad297..cc145b48cb98c4cbaae463cd1439735354bfd038 100644 (file)
@@ -34,6 +34,8 @@ if ![check_shared_lib_support] {
 # Add $NOPIE_CFLAGS and $NOPIE_LDFLAGS if non-PIE is required.
 global NOPIE_CFLAGS NOPIE_LDFLAGS
 
+set old_ASFLAGS $ASFLAGS
+
 # This target requires extra GAS options when building code for shared
 # libraries.
 set AFLAGS_PIC ""
@@ -47,6 +49,65 @@ if [istarget "tic6x-*-*"] {
     append LFLAGS " -melf32_tic6x_le"
 }
 
+if [is_underscore_target] {
+    set ASFLAGS "$ASFLAGS --defsym UNDERSCORE=1"
+}
+
+run_ld_link_tests [list \
+    [list \
+       "Build pr22471a.so" \
+       "$LFLAGS -shared" \
+       "" \
+       "$AFLAGS_PIC" \
+       {pr22471a.s} \
+       {} \
+       "pr22471a.so" \
+    ] \
+    [list \
+       "Build pr22471b.so" \
+       "$LFLAGS -shared --version-script pr22471.t" \
+       "tmpdir/pr22471a.so" \
+       "$AFLAGS_PIC" \
+       {pr22471a.s} \
+       {} \
+       "pr22471b.so" \
+    ] \
+    [list \
+       "Build pr22471" \
+       "$LFLAGS -rpath-link ." \
+       "tmpdir/pr22471b.so" \
+       "" \
+       {pr22471b.s} \
+       {} \
+       "pr22471" \
+    ] \
+]
+
+run_ld_link_tests [list \
+    [list \
+       "DT_TEXTREL in shared lib" \
+       "$LFLAGS -shared --warn-shared-textrel" \
+       "" \
+       "$AFLAGS_PIC" \
+       {textrel.s} \
+        {{ld textrel.warn} \
+         {readelf {-d --wide} textrel.rd}} \
+       "textrel.so" \
+    ] \
+] "xtensa-*-*"
+
+run_ld_link_tests [list \
+    [list \
+       "DT_TEXTREL map file warning" \
+       "$LFLAGS -shared -M" \
+       "" \
+       "$AFLAGS_PIC" \
+       {textrel.s} \
+        {{ld textrel.map}} \
+       "textrel.so" \
+    ] \
+] "cris*-*-*"
+
 # PR ld/20828 check for correct dynamic symbol table entries where:
 # - symbols have been defined with a linker script,
 # - the same symbols have been seen in shared library used in the link,
@@ -135,8 +196,6 @@ if { [check_gc_sections_available] } {
            {{readelf --dyn-syms pr21233-l.sd}} \
            "libpr21233.so"]]
 
-    setup_kfail "cris*-*-*" "ld/21233"
-
     run_ld_link_tests [list \
        [list \
            "PR ld/21233 dynamic symbols with section GC (--undefined)" \
@@ -146,8 +205,6 @@ if { [check_gc_sections_available] } {
            {{readelf --dyn-syms pr21233.sd}} \
            "pr21233-1"]]
 
-    setup_kfail "cris*-*-*" "ld/21233"
-
     run_ld_link_tests [list \
        [list \
            "PR ld/21233 dynamic symbols with section GC (--require-defined)" \
@@ -158,8 +215,6 @@ if { [check_gc_sections_available] } {
            {{readelf --dyn-syms pr21233.sd}} \
            "pr21233-2"]]
 
-    setup_kfail "cris*-*-*" "ld/21233"
-
     run_ld_link_tests [list \
        [list \
            "PR ld/21233 dynamic symbols with section GC (EXTERN)" \
@@ -170,6 +225,31 @@ if { [check_gc_sections_available] } {
            "pr21233-3"]]
 }
 
+if { [check_gc_sections_available] } {
+    run_ld_link_tests [list \
+       [list \
+           "Build pr22150.so" \
+           "$LFLAGS -shared --version-script pr22150.ver" \
+           "" \
+           "$AFLAGS_PIC" \
+           {pr22150a.s} \
+           {} \
+           "pr22150.so" \
+       ] \
+       [list \
+           "Build pr22150" \
+           "$LFLAGS -e _start --gc-sections" \
+           "tmpdir/pr22150.so" \
+           "" \
+           {pr22150b.s} \
+           {{readelf -V pr22150.vd}} \
+           "pr22150" \
+       ] \
+    ]
+}
+
+set ASFLAGS $old_ASFLAGS
+
 # Check to see if the C compiler works
 if { [which $CC] == 0 } {
     return
@@ -423,16 +503,38 @@ set build_tests {
   {"Build libpr19073.so"
    "-shared -Wl,--version-script=pr19073.map tmpdir/pr19073a.o" "-fPIC"
    {dummy.c} {{readelf {--dyn-syms --wide} pr19073.rd}} "libpr19073.so"}
-  {"Build pr21964-1.so"
+  {"Build pr21964-1a.so"
+   "-shared" "-fPIC"
+   {pr21964-1a.c} {} "pr21964-1a.so"}
+  {"Build pr21964-1b.so"
    "-shared" "-fPIC"
-   {pr21964-1a.c} {} "pr21964-1.so"}
-  {"Build pr21964-2.so"
+   {pr21964-1b.c} {} "pr21964-1b.so"}
+  {"Build pr21964-2a.so"
    "-shared" "-fPIC"
-   {pr21964-2a.c} {} "pr21964-2.so"}
+   {pr21964-2a.c} {} "pr21964-2a.so"}
+  {"Build pr21964-2b.so"
+   "-shared" "-fPIC"
+   {pr21964-2b.c} {} "pr21964-2b.so"}
+  {"Dump pr21978.so"
+   "-shared" "-fPIC -g -O2"
+   {pr21978a.c pr21978b.c} {{objdump {-Sl} pr21978.od}} "pr21978.so"}
 }
 
 run_cc_link_tests $build_tests
 
+run_ld_link_tests [list \
+    [list \
+       "Build pr22269-1" \
+       "-pie -e _start --no-dynamic-linker -z text" \
+       "" \
+       "" \
+       { pr22269-1.c } \
+       {{readelf -rW pr22269-1.rd}} \
+       "pr22269-1" \
+       "-fPIE -O2" \
+    ] \
+]
+
 set run_tests [list \
     [list "Run normal with libfoo.so" \
      "-Wl,--no-as-needed tmpdir/begin.o tmpdir/libfoo.so tmpdir/end.o" "" \
@@ -547,8 +649,8 @@ set run_tests [list \
      "-Wl,--no-as-needed,-z,now tmpdir/libpr18458a.so tmpdir/libpr18458b.so" "" \
      {pr18458c.c} "pr18458" "pass.out" ] \
     [list "Run pr21964-1" \
-     "-Wl,--no-as-needed,-rpath,tmpdir tmpdir/pr21964-1.so" "" \
-     {pr21964-1b.c} "pr21964-1" "pass.out" ] \
+     "-Wl,--no-as-needed,-rpath,tmpdir tmpdir/pr21964-1a.so tmpdir/pr21964-1b.so" "" \
+     {pr21964-1c.c} "pr21964-1" "pass.out" ] \
 ]
 
 # NetBSD ELF systems do not currently support the .*_array sections.
@@ -596,8 +698,8 @@ set dlopen_run_tests [list \
      "-Wl,--no-as-needed,--dynamic-list-data $extralibs" "" \
      {dl6dmain.c} "dl6d1" "dl6b.out" ] \
     [list "Run pr21964-2" \
-     "-Wl,--no-as-needed,-rpath,tmpdir $extralibs" "" \
-     {pr21964-2b.c} "pr21964-2" "pass.out" ] \
+     "-Wl,--no-as-needed,-rpath,tmpdir tmpdir/pr21964-2a.so $extralibs" "" \
+     {pr21964-2c.c} "pr21964-2" "pass.out" ] \
 ]
 
 # Only run them when libdl is available.
This page took 0.025621 seconds and 4 git commands to generate.