+2020-05-24 Fangrui Song <maskray@google.com>
+
+ PR ld/26018
+ * lexsup.c (parse_args): Simplify.
+ * testsuite/ld-elf/dl4e.out: New.
+ * testsuite/ld-elf/shared.exp: Updated for PR ld/26018 tests.
+
2020-05-23 H.J. Lu <hongjiu.lu@intel.com>
PR ld/26018
break;
case OPTION_DYNAMIC_LIST_DATA:
opt_dynamic_list = dynamic_list_data;
- if (opt_symbolic == symbolic)
- opt_symbolic = symbolic_unset;
break;
case OPTION_DYNAMIC_LIST_CPP_TYPEINFO:
lang_append_dynamic_list_cpp_typeinfo ();
if (opt_dynamic_list != dynamic_list_data)
opt_dynamic_list = dynamic_list;
- if (opt_symbolic == symbolic)
- opt_symbolic = symbolic_unset;
break;
case OPTION_DYNAMIC_LIST_CPP_NEW:
lang_append_dynamic_list_cpp_new ();
if (opt_dynamic_list != dynamic_list_data)
opt_dynamic_list = dynamic_list;
- if (opt_symbolic == symbolic)
- opt_symbolic = symbolic_unset;
break;
case OPTION_DYNAMIC_LIST:
/* This option indicates a small script that only specifies
}
if (opt_dynamic_list != dynamic_list_data)
opt_dynamic_list = dynamic_list;
- if (opt_symbolic == symbolic)
- opt_symbolic = symbolic_unset;
break;
case OPTION_WARN_COMMON:
config.warn_common = TRUE;
&& command_line.check_section_addresses < 0)
command_line.check_section_addresses = 0;
+ switch (opt_dynamic_list)
+ {
+ case dynamic_list_unset:
+ break;
+ case dynamic_list_data:
+ link_info.dynamic_data = TRUE;
+ /* Fall through. */
+ case dynamic_list:
+ link_info.dynamic = TRUE;
+ opt_symbolic = symbolic_unset;
+ break;
+ }
+
/* -Bsymbolic and -Bsymbols-functions are for shared library output. */
if (bfd_link_dll (&link_info))
switch (opt_symbolic)
free (link_info.dynamic_list);
link_info.dynamic_list = NULL;
}
- opt_dynamic_list = dynamic_list_unset;
break;
case symbolic_functions:
- opt_dynamic_list = dynamic_list_data;
+ link_info.dynamic = TRUE;
+ link_info.dynamic_data = TRUE;
break;
}
- switch (opt_dynamic_list)
- {
- case dynamic_list_unset:
- break;
- case dynamic_list_data:
- link_info.dynamic_data = TRUE;
- /* Fall through. */
- case dynamic_list:
- link_info.dynamic = TRUE;
- break;
- }
-
if (!bfd_link_dll (&link_info))
{
if (command_line.filter_shlib)
--- /dev/null
+bar OK2
+bar OK4
+DSO1
+DSO2
+OK2
+OK4
{"Build libdl2c.so with --dynamic-list-data and dl2xxx.list"
"-shared -Wl,--dynamic-list-data,--dynamic-list=dl2xxx.list" "-fPIC"
{dl2.c dl2xxx.c} {} "libdl2c.so"}
+ {"Build libdl2d.so with --dynamic-list-data -Bsymbolic"
+ "-shared -Wl,-Bsymbolic,--dynamic-list-data" "-fPIC"
+ {dl2.c dl2xxx.c} {} "libdl2d.so"}
{"Build libdl4a.so with --dynamic-list=dl4.list"
"-shared -Wl,--dynamic-list=dl4.list" "-fPIC"
{dl4.c dl4xxx.c} {} "libdl4a.so"}
[list "Run with libdl2c.so" \
"-Wl,--no-as-needed tmpdir/libdl2c.so" "" \
{dl2main.c} "dl2c" "dl2b.out" ] \
+ [list "Run with libdl2d.so" \
+ "-Wl,--no-as-needed tmpdir/libdl2d.so" "" \
+ {dl2main.c} "dl2d" "dl2a.out" ] \
[list "Run with libdl4a.so" \
"-Wl,--no-as-needed tmpdir/libdl4a.so" "" \
{dl4main.c} "dl4a" "dl4a.out" ] \
{dl4main.c} "dl4d" "dl4b.out" ] \
[list "Run with libdl4e.so" \
"-Wl,--no-as-needed tmpdir/libdl4e.so" "" \
- {dl4main.c} "dl4e" "dl4a.out" ] \
+ {dl4main.c} "dl4e" "dl4e.out" ] \
[list "Run with libdl4f.so" \
"-Wl,--no-as-needed tmpdir/libdl4f.so" "" \
- {dl4main.c} "dl4f" "dl4a.out" ] \
+ {dl4main.c} "dl4f" "dl4e.out" ] \
[list "Run with libdata1.so" \
"-Wl,--no-as-needed tmpdir/libdata1.so" "" \
{dynbss1.c} "dynbss1" "pass.out" ] \
{dl6cmain.c} "dl6c1" "dl6b.out" ] \
[list "Run dl6d1 with --dynamic-list-data and dlopen on libdl6d.so" \
"-Wl,--no-as-needed,--dynamic-list-data $extralibs" "" \
- {dl6dmain.c} "dl6d1" "dl6b.out" ] \
+ {dl6dmain.c} "dl6d1" "dl6a.out" ] \
[list "Run pr21964-2" \
"-Wl,--no-as-needed,-rpath,tmpdir tmpdir/pr21964-2a.so $extralibs" "" \
{pr21964-2c.c} "pr21964-2" "pass.out" ] \