Files
Nick Clifton 9fe129a410 Add support for the ASCII directive inside linker scripts.
* ldlex.l: Add ASCII token.
 * ldgram.y: Add parsing of the ASCII command.
 * ldlang.c (lang_add_string): Add maximum size parameter.  Move escape character handling code into separate function.
 * ldlang.h (lang_add_string): Update prototype.
 * NEWS: Mention the new feature.
 * ld.texi (Output Section Data): Document the new directives.
 * testsuite/ld-scripts/asciz.t: Adjust to work on more architectures and to test more aspects of the ASCIZ directive.
 * testsuite/ld-scripts/asciz.d: Adjust to match the changes to the test linker script.
 * testsuite/ld-scripts/ascii.d: New test driver.
 * testsuite/ld-scripts/ascii.s: New test assembler source.
 * testsuite/ld-scripts/ascii.t: New test script.
 * testsuite/ld-scripts/script.exp: Run the new test.
2023-02-16 16:27:08 +00:00

39 lines
538 B
Raku

_start = 0x000000;
SECTIONS
{
. = 0x1000 + SIZEOF_HEADERS;
.header ALIGN (0x100) (READONLY) :
{
ASCII (16) "program name"
ASCII (64) "empty"
ASCII (4 * 8) "comment 1\n"
ASCII (32) "comment 2\n"
ASCII (32) "comment 3\n"
ASCII (24) "comment 4\n"
ASCII (64) "I meant to say: This is way too long"
}
.text ALIGN (0x100) :
{
entry = .;
*(.text)
}
.data : AT (0x400000)
{
*(.data)
}
. = ALIGN(0x20);
.bss :
{
*(.bss)
}
/DISCARD/ : { *(*) }
}