Commit: Fix example of using TYPE keyword in linker scripts

Message ID 87frmihb6r.fsf@redhat.com
State New
Headers
Series Commit: Fix example of using TYPE keyword in linker scripts |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 fail Patch failed to apply

Commit Message

Nick Clifton Dec. 20, 2024, 10:59 a.m. UTC
  Hi Guys,

  I am applying the patch below as an obvious fix to the linker manual.
  The section describing how the TYPE keyword works included several
  example script fragments, but these examples were using incorrect
  syntax.  This patch fixes that problem.

Cheers
  Nick
  

Patch

diff --git a/ld/ld.texi b/ld/ld.texi
index 6f88b7940a2..f1e06992b50 100644
--- a/ld/ld.texi
+++ b/ld/ld.texi
@@ -5970,19 +5970,19 @@  special requirements of the section type are met.
 Note - the TYPE only is used if some or all of the contents of the
 section do not have an implicit type of their own.  So for example:
 @smallexample
-  .foo . TYPE = SHT_PROGBITS @{ *(.bar) @}
+  .foo . (TYPE = SHT_PROGBITS) : @{ *(.bar) @}
 @end smallexample
 will set the type of section @samp{.foo} to the type of the section
 @samp{.bar} in the input files, which may not be the SHT_PROGBITS
 type.  Whereas:
 @smallexample
-  .foo . TYPE = SHT_PROGBITS @{ BYTE(1) @}
+  .foo . (TYPE = SHT_PROGBITS) : @{ BYTE(1) @}
 @end smallexample
 will set the type of @samp{.foo} to SHT_PROGBBITS.  If it is necessary
 to override the type of incoming sections and force the output section
 type then an extra piece of untyped data will be needed:
 @smallexample
-  .foo . TYPE = SHT_PROGBITS @{ BYTE(1); *(.bar) @}
+  .foo . (TYPE = SHT_PROGBITS) : @{ BYTE(1); *(.bar) @}
 @end smallexample
 
 @item READONLY ( TYPE = @var{type} )