summaryrefslogtreecommitdiff
path: root/binutils/doc
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2020-03-06 10:09:22 +0000
committerNick Clifton <nickc@redhat.com>2020-03-06 10:09:22 +0000
commita0dcf2970562c19140460a07b2c987714639cd7b (patch)
tree67161a1ca585012f45c4b117bb9ecbd8bbc17740 /binutils/doc
parentbc49bfd849a9291b61bbe314505a35d07e130347 (diff)
Fix an abort triggered when objcopy is used to set the "share" section flag on an ELF section.
binutils* objcopy.c (check_new_section_flags): New function. Reject the SEC_COFF_SHARED flag if the target is not a COFF binary. (copy_object): Call check_new_section_flags. (setup_section): Likewise. * doc/binutils.texi (objcopy): Add a note that the 'share' section flag cannot be applied to ELF binaries. bfd * elf.c (_bfd_elf_set_section_contents): Replace call to abort with error messages and failure return values.
Diffstat (limited to 'binutils/doc')
-rw-r--r--binutils/doc/binutils.texi7
1 files changed, 5 insertions, 2 deletions
diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi
index 3099e3f545..de3f1babb2 100644
--- a/binutils/doc/binutils.texi
+++ b/binutils/doc/binutils.texi
@@ -1648,7 +1648,9 @@ recognized names are @samp{alloc}, @samp{contents}, @samp{load},
@samp{contents} flag for a section which does not have contents, but it
is not meaningful to clear the @samp{contents} flag of a section which
does have contents--just remove the section instead. Not all flags are
-meaningful for all object file formats.
+meaningful for all object file formats. In particular the
+@samp{share} flag is only meaningful for COFF format files and not for
+ELF format files.
@item --set-section-alignment @var{sectionpattern}=@var{align}
Set the alignment for any sections matching @var{sectionpattern}.
@@ -1704,7 +1706,8 @@ Rename a section from @var{oldname} to @var{newname}, optionally
changing the section's flags to @var{flags} in the process. This has
the advantage over using a linker script to perform the rename in that
the output stays as an object file and does not become a linked
-executable.
+executable. This option accepts the same set of flags as the
+@option{--sect-section-flags} option.
This option is particularly helpful when the input format is binary,
since this will always create a section called .data. If for example,