aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2004-10-26 13:46:05 +0000
committerPaul Brook <paul@codesourcery.com>2004-10-26 13:46:05 +0000
commit3e3b46e5c8d9d578ea136983b5dd1de82dbff86b (patch)
treea13b75dade8cca9fa4f7c3a28053364ae1787145 /ld
parentb3f21e4a58cbbeca439d4270f4234ef565a59030 (diff)
downloadfsf-binutils-gdb-3e3b46e5c8d9d578ea136983b5dd1de82dbff86b.zip
fsf-binutils-gdb-3e3b46e5c8d9d578ea136983b5dd1de82dbff86b.tar.gz
fsf-binutils-gdb-3e3b46e5c8d9d578ea136983b5dd1de82dbff86b.tar.bz2
bfd/
* elflink.c (elf_finalize_dynstr): Skip shared aux structure. (bfd_elf_size_dynamic_sections): Create default version definition. (elf_link_output_extsym): Adjust for default symbol version. include/ * bfdlink.h (struct bfd_link_info): Add create_default_symver. ld/ * ld.texinfo: Document --default-symver. * ldmain.c (main): Set link_info.create_default_symver. * lexsup.c (enum option_values): Add OPTION_DEFAULT_SYMVER. (ld_options): Add default-symver. (parse_args): Handle OPTION_DEFAULT_SYMVER. ld/testsuite/ * ld-elfvers/vers.exp (build_binary): Add ldargs parameter. (build_vers_lib_pic_flags): New function. Add vers29 test. * ld-elfvers/vers29.c: New file. * ld-elfvers/vers29.dsym: New file. * ld-elfvers/vers29.ver: New file.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog8
-rw-r--r--ld/ld.texinfo5
-rw-r--r--ld/ldmain.c1
-rw-r--r--ld/lexsup.c6
-rw-r--r--ld/testsuite/ChangeLog9
-rw-r--r--ld/testsuite/ld-elfvers/vers.exp17
6 files changed, 41 insertions, 5 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index c8f0caa..8641359 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,11 @@
+2004-10-26 Paul Brook <paul@codesourcery.com>
+
+ * ld.texinfo: Document --default-symver.
+ * ldmain.c (main): Set link_info.create_default_symver.
+ * lexsup.c (enum option_values): Add OPTION_DEFAULT_SYMVER.
+ (ld_options): Add default-symver.
+ (parse_args): Handle OPTION_DEFAULT_SYMVER.
+
2004-10-24 Danny Smith <dannysmith@users.sourceforge.net>
* pe-dll.c (process_def_file): Don't export all symbols by default if
diff --git a/ld/ld.texinfo b/ld/ld.texinfo
index 5a494c2..5944f44 100644
--- a/ld/ld.texinfo
+++ b/ld/ld.texinfo
@@ -1234,6 +1234,11 @@ Normally when a symbol has an undefined version, the linker will ignore
it. This option disallows symbols with undefined version and a fatal error
will be issued instead.
+@kindex --default-symver
+@item --default-symver
+Create and use a default symbol version (the soname) for unversioned
+symbols.
+
@kindex --no-warn-mismatch
@item --no-warn-mismatch
Normally @command{ld} will give an error if you try to link together input
diff --git a/ld/ldmain.c b/ld/ldmain.c
index 7344da2..6eb3774 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -306,6 +306,7 @@ main (int argc, char **argv)
link_info.unresolved_syms_in_shared_libs = RM_NOT_YET_SET;
link_info.allow_multiple_definition = FALSE;
link_info.allow_undefined_version = TRUE;
+ link_info.create_default_symver = FALSE;
link_info.keep_memory = TRUE;
link_info.notice_all = FALSE;
link_info.nocopyreloc = FALSE;
diff --git a/ld/lexsup.c b/ld/lexsup.c
index e40cf62..be7c0a9 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -134,6 +134,7 @@ enum option_values
OPTION_NO_ALLOW_SHLIB_UNDEFINED,
OPTION_ALLOW_MULTIPLE_DEFINITION,
OPTION_NO_UNDEFINED_VERSION,
+ OPTION_DEFAULT_SYMVER,
OPTION_DISCARD_NONE,
OPTION_SPARE_DYNAMIC_TAGS,
OPTION_NO_DEFINE_COMMON,
@@ -393,6 +394,8 @@ static const struct ld_option ld_options[] =
'\0', NULL, N_("Allow multiple definitions"), TWO_DASHES },
{ {"no-undefined-version", no_argument, NULL, OPTION_NO_UNDEFINED_VERSION},
'\0', NULL, N_("Disallow undefined version"), TWO_DASHES },
+ { {"default-symver", no_argument, NULL, OPTION_DEFAULT_SYMVER},
+ '\0', NULL, N_("Create default symbol version"), TWO_DASHES },
{ {"no-warn-mismatch", no_argument, NULL, OPTION_NO_WARN_MISMATCH},
'\0', NULL, N_("Don't warn about mismatched input files"), TWO_DASHES},
{ {"no-whole-archive", no_argument, NULL, OPTION_NO_WHOLE_ARCHIVE},
@@ -902,6 +905,9 @@ parse_args (unsigned argc, char **argv)
case OPTION_NO_UNDEFINED_VERSION:
link_info.allow_undefined_version = FALSE;
break;
+ case OPTION_DEFAULT_SYMVER:
+ link_info.create_default_symver = TRUE;
+ break;
case OPTION_NO_WARN_MISMATCH:
command_line.warn_mismatch = FALSE;
break;
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 880ce85..d41972d 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2004-10-26 Paul Brook <paul@codesourcery.com>
+
+ * ld-elfvers/vers.exp (build_binary): Add ldargs parameter.
+ (build_vers_lib_pic_flags): New function.
+ Add vers29 test.
+ * ld-elfvers/vers29.c: New file.
+ * ld-elfvers/vers29.dsym: New file.
+ * ld-elfvers/vers29.ver: New file.
+
2004-10-24 Hans-Peter Nilsson <hp@bitrange.com>
* ld-mmix/sec-8m.d: Adjust test for dump using correct section
diff --git a/ld/testsuite/ld-elfvers/vers.exp b/ld/testsuite/ld-elfvers/vers.exp
index 3ee42e8..9662a6b 100644
--- a/ld/testsuite/ld-elfvers/vers.exp
+++ b/ld/testsuite/ld-elfvers/vers.exp
@@ -498,7 +498,7 @@ proc objdump_versionstuff { objdump object expectfile } {
}
}
-proc build_binary { shared pic test source libname other mapfile verexp versymexp symexp } {
+proc build_binary { shared pic test source libname other mapfile verexp versymexp symexp ldargs } {
global ld
global srcdir
global subdir
@@ -534,7 +534,7 @@ proc build_binary { shared pic test source libname other mapfile verexp versymex
set script_arg "$script $srcdir/$subdir/$mapfile"
}
- if {![ld_simple_link $ld $tmpdir/$libname.so "$shared $tmpdir/$libname.o $other_lib $script_arg"]} {
+ if {![ld_simple_link $ld $tmpdir/$libname.so "$shared $tmpdir/$libname.o $other_lib $script_arg $ldargs"]} {
fail "$test"
return
}
@@ -566,18 +566,24 @@ proc build_binary { shared pic test source libname other mapfile verexp versymex
}
proc build_executable { test source libname other mapfile verexp versymexp symexp } {
- build_binary "" "" $test $source $libname $other $mapfile $verexp $versymexp $symexp
+ build_binary "" "" $test $source $libname $other $mapfile $verexp $versymexp $symexp ""
}
proc build_vers_lib_no_pic { test source libname other mapfile verexp versymexp symexp } {
global shared
- build_binary $shared "" $test $source $libname $other $mapfile $verexp $versymexp $symexp
+ build_binary $shared "" $test $source $libname $other $mapfile $verexp $versymexp $symexp ""
}
proc build_vers_lib_pic { test source libname other mapfile verexp versymexp symexp } {
global picflag
global shared
- build_binary $shared $picflag $test $source $libname $other $mapfile $verexp $versymexp $symexp
+ build_binary $shared $picflag $test $source $libname $other $mapfile $verexp $versymexp $symexp ""
+}
+
+proc build_vers_lib_pic_flags { test source libname other mapfile verexp versymexp symexp ldargs } {
+ global picflag
+ global shared
+ build_binary $shared $picflag $test $source $libname $other $mapfile $verexp $versymexp $symexp $ldargs
}
proc test_ldfail { test flag source execname other mapfile whyfail } {
@@ -944,3 +950,4 @@ build_executable "vers27d5" vers27d3.c vers27d5 "vers27d4.so vers27b.o vers27a.s
build_vers_lib_pic "vers28a" vers28a.c vers28a "" "" vers28a.ver vers28a.dsym ""
build_vers_lib_pic "vers28b" vers28b.c vers28b "" vers28b.map vers28b.ver vers28b.dsym ""
build_vers_lib_pic "vers28c" vers28c.c vers28c "vers28b.so vers28a.so" "" vers28c.ver vers28c.dsym ""
+build_vers_lib_pic_flags "vers29" vers29.c vers29 "" "" vers29.ver vers29.dsym "" "--default-symver"