summaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-07-28 11:44:16 +0930
committerAlan Modra <amodra@gmail.com>2020-07-28 13:09:20 +0930
commitf437dadd89944254165d076f55f29f7290c00aed (patch)
treef67be6dbca9843685e20604420bad60abf78f4e0 /ld
parentc38166b376b03dc967b2715a09db0b5667fa9e49 (diff)
downloadbinutils-gdb-f437dadd89944254165d076f55f29f7290c00aed.tar.gz
More just-syms changes
* ldlang.c (lang_check): Don't complain about relocs or merge attributes from --just-symbols input. * testsuite/ld-misc/just-symbols.exp: Just dump .data section. Don't run test on a number of targets.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/ldlang.c10
-rw-r--r--ld/testsuite/ld-misc/just-symbols.exp12
3 files changed, 22 insertions, 7 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 7ef623c1b57..9cee3ca275b 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,12 @@
2020-07-28 Alan Modra <amodra@gmail.com>
+ * ldlang.c (lang_check): Don't complain about relocs or merge
+ attributes from --just-symbols input.
+ * testsuite/ld-misc/just-symbols.exp: Just dump .data section.
+ Don't run test on a number of targets.
+
+2020-07-28 Alan Modra <amodra@gmail.com>
+
* testsuite/ld-misc/just-symbols-1.dd: Revert last change.
2020-07-27 Alan Modra <amodra@gmail.com>
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 6943adfdc31..1dd17ffff22 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -7001,8 +7001,9 @@ lang_check (void)
input format may not have equivalent representations in
the output format (and besides BFD does not translate
relocs for other link purposes than a final link). */
- if ((bfd_link_relocatable (&link_info)
- || link_info.emitrelocations)
+ if (!file->flags.just_syms
+ && (bfd_link_relocatable (&link_info)
+ || link_info.emitrelocations)
&& (compatible == NULL
|| (bfd_get_flavour (input_bfd)
!= bfd_get_flavour (link_info.output_bfd)))
@@ -7026,8 +7027,9 @@ lang_check (void)
/* If the input bfd has no contents, it shouldn't set the
private data of the output bfd. */
- else if ((input_bfd->flags & DYNAMIC) != 0
- || bfd_count_sections (input_bfd) != 0)
+ else if (!file->flags.just_syms
+ && ((input_bfd->flags & DYNAMIC) != 0
+ || bfd_count_sections (input_bfd) != 0))
{
bfd_error_handler_type pfn = NULL;
diff --git a/ld/testsuite/ld-misc/just-symbols.exp b/ld/testsuite/ld-misc/just-symbols.exp
index 59c725d0d2c..e3c012f0f6e 100644
--- a/ld/testsuite/ld-misc/just-symbols.exp
+++ b/ld/testsuite/ld-misc/just-symbols.exp
@@ -20,7 +20,13 @@
#
# SH/PE targets complain about zero VMA.
-if { [istarget sh-*-pe] } {
+# i386-msdos doesn't have .data
+# tic30-coff has a weird 32-bit reloc that divides sym value by four
+# alpha-dec-vms wants a bunch of libs to link
+if { [istarget sh-*-pe]
+ || [istarget *-*-msdos]
+ || [istarget *c30-*-*]
+ || [istarget alpha-*-vms] } {
return
}
@@ -49,13 +55,13 @@ run_ld_link_tests [list \
"$LDFLAGS -e 0 -T just-symbols.ld --just-symbols=tmpdir/just-symbols-0.o" "" \
"" \
{just-symbols-1.s} \
- {{objdump -s just-symbols-1.dd}} \
+ {{objdump {-s -j .data} just-symbols-1.dd}} \
"just-symbols-1obj"] \
[list "Executable with --just-symbols test" \
"$LDFLAGS -e 0 -T just-symbols.ld --just-symbols=tmpdir/just-symbols-0" "" \
"" \
{just-symbols-1.s} \
- {{objdump -s just-symbols-1.dd}} \
+ {{objdump {-s -j .data} just-symbols-1.dd}} \
"just-symbols-1exe"] \
]