From 9e7ed8b080afa19fff25244913594f95af282657 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Thu, 27 Aug 2020 15:25:03 +0000 Subject: Fix PR binutils/26356 on hppa*-*-hpux*. PR 26356 * som.c (som_bfd_copy_private_section_data): Issue error when a subspace is specified without its containing space. * testsuite/binutils-all/objcopy.exp (objcopy --reverse-bytes): Add "-j $PRIVATE$" to command on hppa*-*-hpux*. * testsuite/lib/utils-lib.exp (default_binutils_run): Remove existing dollar-sign quotes before quoting. Do this prior to generating log output. --- bfd/som.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'bfd/som.c') diff --git a/bfd/som.c b/bfd/som.c index 93a0ad8..d3865f0 100644 --- a/bfd/som.c +++ b/bfd/som.c @@ -5455,8 +5455,18 @@ som_bfd_copy_private_section_data (bfd *ibfd, /* Reparent if necessary. */ if (som_section_data (osection)->copy_data->container) - som_section_data (osection)->copy_data->container = - som_section_data (osection)->copy_data->container->output_section; + { + if (som_section_data (osection)->copy_data->container->output_section) + som_section_data (osection)->copy_data->container = + som_section_data (osection)->copy_data->container->output_section; + else + { + /* User has specified a subspace without its containing space. */ + _bfd_error_handler (_("%pB[%pA]: no output section for space %pA"), + obfd, osection, som_section_data (osection)->copy_data->container); + return FALSE; + } + } return TRUE; } -- cgit v1.1