gdb_compile_shlib: Only consider shlib= options when building executables
[deliverable/binutils-gdb.git] / gdb / testsuite / lib / gdb.exp
index 7702d9c238379be568b026e8a5b90767cc4660cd..a4bde724bec0c519d56b5d9931f145a0fc1e9807 100644 (file)
@@ -3513,7 +3513,8 @@ proc gdb_compile {source dest type options} {
     set shlib_found 0
     set shlib_load 0
     foreach opt $options {
-        if [regexp {^shlib=(.*)} $opt dummy_var shlib_name] {
+        if {[regexp {^shlib=(.*)} $opt dummy_var shlib_name]
+           && $type == "executable"} {
             if [test_compiler_info "xlc-*"] {
                # IBM xlc compiler doesn't accept shared library named other
                # than .so: use "-Wl," to bypass this
@@ -3539,7 +3540,7 @@ proc gdb_compile {source dest type options} {
                    lappend new_options "early_flags=-Wl,--no-as-needed"
                }
             }
-       } elseif { $opt == "shlib_load" } {
+       } elseif { $opt == "shlib_load" && $type == "executable" } {
            set shlib_load 1
         } else {
             lappend new_options $opt
This page took 0.02521 seconds and 4 git commands to generate.