[PATCH v1 4/7] ld.texi: Add ASCII to info file
Andreas Schwab
schwab@suse.de
Mon Jul 8 11:18:34 GMT 2024
On Jul 08 2024, Ulf Samuelsson wrote:
> Given *ASCII 16, "This is 16 bytes*" size == 16 and strlen("This is 16
> bytes") == 16,
> the linker should add a 16 byte area without a terminating NUL,
>
> If the string is shorter, then the linker should pad with NUL.
>
> If the string is longer, then the linker should truncate the string adding
> a NUL
> at the end, still fitting in the area. A warning should be issued.
This inonsistency is confusing. The directive should either always use
the first size characters from the string, only padding with nulls when
the string is shorter, or reject longer strings at all.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
More information about the Binutils
mailing list