aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite/binutils-all
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2020-05-04 17:04:25 +0100
committerNick Clifton <nickc@redhat.com>2020-05-04 17:04:25 +0100
commite052e2ba295a65b6ea80cbc3f90495beca299c42 (patch)
tree8e1fe52512a6257c597917d47cc2cd5731dc1dfe /binutils/testsuite/binutils-all
parent7242fa8aa7596b4e154ca96ddf5ce49353bf2e5d (diff)
downloadgdb-e052e2ba295a65b6ea80cbc3f90495beca299c42.zip
gdb-e052e2ba295a65b6ea80cbc3f90495beca299c42.tar.gz
gdb-e052e2ba295a65b6ea80cbc3f90495beca299c42.tar.bz2
[PATCH] objcopy: Allow --dump-section to dump an empty SEC_HAS_CONTENTS section
* objcopy.c (copy_object): Allow empty section. * testsuite/binutils-all/update-section.exp: Add test.
Diffstat (limited to 'binutils/testsuite/binutils-all')
-rw-r--r--binutils/testsuite/binutils-all/update-section.exp7
1 files changed, 7 insertions, 0 deletions
diff --git a/binutils/testsuite/binutils-all/update-section.exp b/binutils/testsuite/binutils-all/update-section.exp
index 4fd6a77..81a01b0 100644
--- a/binutils/testsuite/binutils-all/update-section.exp
+++ b/binutils/testsuite/binutils-all/update-section.exp
@@ -82,6 +82,13 @@ foreach f [list update-1.s update-2.s update-3.s update-4.s] {
}
}
+# Check that we can dump empty sections.
+if { ![do_objcopy update-1.o "--dump-section .text=tmpdir/empty"] } {
+ fail "objcopy (dump empty section)"
+} else {
+ pass "objcopy (dump empty section)"
+}
+
if { ![do_objcopy update-1.o \
"--dump-section .foo=tmpdir/dumped-contents"]
|| ![do_objcopy update-2.o \