LD: cannot use LONG() outside of a section description
Nick Clifton
nickc@cygnus.com
Mon Apr 24 17:27:00 GMT 2000
Hi Guys,
I am checking in the small patch below to add an extra paragraph to
the linker's documentation of the output section data commands
(BYTE, SHORT, LONG, etc). This paragraph explains that the
commands can only be used inside a output section description and
not between output section descriptions. [One of customers was
confused by this distinction.]
Cheers
Nick
2000-04-24 Nick Clifton <nickc@cygnus.com>
* ld.texinfo (Output Section Data): Add note that section data
commands cannot appear outside of section directives.
Index: ld/ld.texinfo
===================================================================
RCS file: /cvs/src//src/ld/ld.texinfo,v
retrieving revision 1.13
diff -p -r1.13 ld.texinfo
*** ld.texinfo 2000/04/11 11:39:38 1.13
--- ld.texinfo 2000/04/25 00:25:13
*************** When the object file format does not hav
*** 2486,2491 ****
--- 2486,2501 ----
true of, for example, S-records, the value will be stored in the
endianness of the first input object file.
+ Note - these commands only work inside a section description and not
+ between them, so the following will produce an error from the linker:
+ @smallexample
+ SECTIONS @{@ .text : @{@ *(.text) @}@ LONG(1) .data : @{@ *(.data) @}@ @}@
+ @end smallexample
+ whereas this will work:
+ @smallexample
+ SECTIONS @{@ .text : @{@ *(.text) ; LONG(1) @}@ .data : @{@ *(.data) @}@ @}@
+ @end smallexample
+
@kindex FILL(@var{expression})
@cindex holes, filling
@cindex unspecified memory
More information about the Binutils
mailing list