From 55255daec3c2b3f212acfdfe9cefe9fd2899253f Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 7 Sep 2006 17:16:34 +0000 Subject: bfd/ 2006-09-07 H.J. Lu * elf-bfd.h (elf_link_hash_entry): Add a dynamic field. (bfd_elf_link_mark_dynamic_symbol): New. (SYMBOLIC_BIND): New. * elf32-i386.c (elf_i386_check_relocs): Replace info->symbolic with SYMBOLIC_BIND (info, h). (elf_i386_relocate_section): Likewise. * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise. (elf64_x86_64_relocate_section): Likewise. * elfxx-ia64.c (elfNN_ia64_check_relocs): Likewise. * elflink.c (bfd_elf_link_mark_dynamic_symbol): New. (bfd_elf_record_link_assignment): Call bfd_elf_link_mark_dynamic_symbol on new entry. (_bfd_elf_merge_symbol): Likewise. (_bfd_elf_export_symbol): Return if the symbol isn't exported. (_bfd_elf_fix_symbol_flags): Replace info->symbolic with SYMBOLIC_BIND (info, h). (_bfd_elf_dynamic_symbol_p): Likewise. (_bfd_elf_symbol_refs_local_p): Likewise. (bfd_elf_size_dynamic_sections): Updated. include/ 2006-09-07 H.J. Lu * bfdlink.h (bfd_elf_dynamic_list): New. (bfd_link_info): Add a dynamic field. ld/ 2006-09-07 H.J. Lu * Makefile.am (CXX): Set to g++. (CXX_FOR_TARGET): Likewise. * Makefile.in: Regenerated. * NEWS: Mention --dynamic-list. * ld.texinfo: Document --dynamic-list. * ldgram.y: Support dynamic list. * ldlang.c (lang_process): Call lang_finalize_version_expr_head on link_info.dynamic if needed. (lang_append_dynamic_list): New. (lang_append_dynamic_list_cpp_typeinfo): New. * ldlang.h (lang_append_dynamic_list): Likewise. * ldlang.h (lang_append_dynamic_list_cpp_typeinfo): Likewise. * ldlex.h (input_enum): Add input_dynamic_list. * ldlex.l: Handle it. * ldmain.c (main): Initialize link_info.dynamic. * lexsup.c (option_values): Add OPTION_DYNAMIC_LIST and OPTION_DYNAMIC_LIST_CPP_TYPEINFO. (ld_options): Add entries for OPTION_DYNAMIC_LIST and OPTION_DYNAMIC_LIST_CPP_TYPEINFO. (parse_args): Handle OPTION_DYNAMIC_LIST and OPTION_DYNAMIC_LIST_CPP_TYPEINFO. ld/testsuite/ 2006-09-07 H.J. Lu * ld-elf/dl1.c: New file. * ld-elf/dl1.list: Likewise. * ld-elf/dl1.out: Likewise. * ld-elf/dl1main.c: Likewise. * ld-elf/dl2.c: Likewise. * ld-elf/dl2.list: Likewise. * ld-elf/dl2a.out: Likewise. * ld-elf/dl2b.out: Likewise. * ld-elf/dl2main.c: Likewise. * ld-elf/dl2xxx.c: Likewise. * ld-elf/dl2xxx.list: Likewise. * ld-elf/dl3.cc: Likewise. * ld-elf/dl3.list: Likewise. * ld-elf/dl3a.out: Likewise. * ld-elf/dl3b.out: Likewise. * ld-elf/dl3header.h: Likewise. * ld-elf/dl3main.cc: Likewise. * ld-elf/shared.exp: Updated. * lib/ld-lib.exp (run_ld_link_exec_tests): Take an optional argument for source language. Use CC/CXX for link, depending on source language. (run_cc_link_tests): Likewise. --- ld/testsuite/lib/ld-lib.exp | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) (limited to 'ld/testsuite/lib/ld-lib.exp') diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp index 4b69428..566845f 100644 --- a/ld/testsuite/lib/ld-lib.exp +++ b/ld/testsuite/lib/ld-lib.exp @@ -1246,14 +1246,15 @@ if ![string length [info proc prune_warnings]] { # targets_to_xfail is a list of target triplets to be xfailed. # ldtests contains test-items with 3 items followed by 1 lists, 2 items -# and one optional item: +# and 2 optional items: # 0:name # 1:ld options # 2:assembler options -# 3:filenames of assembler files +# 3:filenames of source files # 4:name of output file # 5:expected output # 6:compiler flags (optional) +# 7:language (optional) proc run_ld_link_exec_tests { targets_to_xfail ldtests } { global ld @@ -1262,6 +1263,7 @@ proc run_ld_link_exec_tests { targets_to_xfail ldtests } { global subdir global env global CC + global CXX global CFLAGS global errcnt @@ -1276,6 +1278,7 @@ proc run_ld_link_exec_tests { targets_to_xfail ldtests } { set binfile tmpdir/[lindex $testitem 4] set expfile [lindex $testitem 5] set cflags [lindex $testitem 6] + set lang [lindex $testitem 7] set objfiles {} set failed 0 @@ -1297,7 +1300,13 @@ proc run_ld_link_exec_tests { targets_to_xfail ldtests } { ld_compile "$CC -c $CFLAGS $cflags" $srcdir/$subdir/$src_file $objfile # We have to use $CC to build PIE and shared library. - if { [ string match "-shared" $ld_options ] \ + if { [ string match "c" $lang ] } { + set link_proc ld_simple_link + set link_cmd $CC + } elseif { [ string match "c++" $lang ] } { + set link_proc ld_simple_link + set link_cmd $CXX + } elseif { [ string match "-shared" $ld_options ] \ || [ string match "-pie" $ld_options ] } { set link_proc ld_simple_link set link_cmd $CC @@ -1344,8 +1353,13 @@ proc run_ld_link_exec_tests { targets_to_xfail ldtests } { # List contains test-items with 3 items followed by 2 lists, one item and # one optional item: -# 0:name 1:link options 2:compile options -# 3:filenames of assembler files 4: action and options. 5: name of output file +# 0:name +# 1:link options +# 2:compile options +# 3:filenames of source files +# 4:action and options. +# 5:name of output file +# 6:language (optional) # # Actions: # objdump: Apply objdump options on result. Compare with regex (last arg). @@ -1360,6 +1374,7 @@ proc run_cc_link_tests { ldtests } { global subdir global env global CC + global CXX global CFLAGS foreach testitem $ldtests { @@ -1369,6 +1384,7 @@ proc run_cc_link_tests { ldtests } { set src_files [lindex $testitem 3] set actions [lindex $testitem 4] set binfile tmpdir/[lindex $testitem 5] + set lang [lindex $testitem 6] set objfiles {} set is_unresolved 0 set failed 0 @@ -1387,7 +1403,13 @@ proc run_cc_link_tests { ldtests } { # Clear error and warning counts. reset_vars - if ![ld_simple_link $CC $binfile "-L$srcdir/$subdir $ldflags $objfiles"] { + if { [ string match "c++" $lang ] } { + set cc_cmd $CXX + } else { + set cc_cmd $CC + } + + if ![ld_simple_link $cc_cmd $binfile "-L$srcdir/$subdir $ldflags $objfiles"] { fail $testname } else { set failed 0 -- cgit v1.1