From b71702f1c01052b70b4fd8157982eadc2132fc24 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 5 Oct 2020 10:40:07 +0100 Subject: GAS: Update the .section directive so that a numeric section index can be provided when the "o" flag is used. PR 26253 gas * config/obj-elf.c (obj_elf_section): Accept a numeric value for the "o" section flag. Interpret it as a section index. Allow an index of zero. * doc/as.texi: Document the new behaviour. * NEWS: Mention the new feature. Tidy entries. * testsuite/gas/elf/sh-link-zero.s: New test. * testsuite/gas/elf/sh-link-zero.d: New test driver. * testsuite/gas/elf/elf.exp: Run the new test. * testsuite/gas/elf/section21.l: Updated expected assembler output. bfd * elf.c (_bfd_elf_setup_sections): Do not complain about an sh_link value of zero when the SLF_LINK_ORDER flag is set. (assign_section_numbers): Likewise. --- gas/doc/as.texi | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gas/doc') diff --git a/gas/doc/as.texi b/gas/doc/as.texi index c0baa94..2ba101c 100644 --- a/gas/doc/as.texi +++ b/gas/doc/as.texi @@ -6728,11 +6728,14 @@ If @var{flags} contains the @code{o} flag, then the @var{type} argument must be present along with an additional field like this: @smallexample -.section @var{name},"@var{flags}"o,@@@var{type},@var{SymbolName} +.section @var{name},"@var{flags}"o,@@@var{type},@var{SymbolName}|@var{SectionIndex} @end smallexample The @var{SymbolName} field specifies the symbol name which the section -references. +references. Alternatively a numeric @var{SectionIndex} can be provided. This +is not generally a good idea as section indicies are rarely known at assembly +time, but the facility is provided for testing purposes. An index of zero is +allowed. It indicates that the linked-to section has already been discarded. Note: If both the @var{M} and @var{o} flags are present, then the fields for the Merge flag should come first, like this: -- cgit v1.1