[PATCH v2 0/4] ASCIZ Command for output section
binutils@emagii.com
binutils@emagii.com
Mon Feb 13 12:22:36 GMT 2023
Introduce an ASCIZ command for an output section
When generating a header for an embedded system
there is often a need to add text information.
There are arguments for generating the header in the linker
instead of compiling the header as part of the program.
The lack of support for strings makes this process a bit unwieldy.
The ASCIZ command allows you to specify a zero-terminated string as a parameter.
Example:
ASCIZ "This is a string"
The string contains 16 characters, but a NUL character is added to the end,
so the areas reserved is 16+1 = 17 characters.
Ideally, there should be a command which reserves a fixed size area.
I:E:
ASCII 20, "This is a string"
but I have failed to get make this work in 'ld',
so this patch series is limited to ASCIZ.
[PATCH 1/5] ldlex.l: Add ASCIZ token
[PATCH 2/5] ldgram.y: Add 'ASCIZ <string>' command
[PATCH 3/5] Parse ASCIZ command
[PATCH 4/5] Document the ASCIZ command
[PATCH 5/5] Use lang_add_data
More information about the Binutils
mailing list