Add support for a .base64 pseudo-op to gas

Nick Clifton nickc@redhat.com
Thu Jul 11 12:03:46 GMT 2024


Hi Alan,

> Fixes a failure on rx-elf where the standard data section isn't .data.
> run_dump_test has machinery to translate .data in both options and
> expected results for objdump, but not for readelf -x.

Thanks for doing this.  I had totally forgotten about objdump's -s option...

> Running the test on all targets shows failures on tic4x-coff and
> tic54x-coff.  I haven't looked into exactly why the test failed, I'm
> leaving that to Nick; The last octet in section contents is missing,
> the rest is OK.  (These targets have octets != bytes)

That is indeed the problem. If the last octet(s) of a .base64 string do
not fill up a byte, they do not get emitted.

I have checked in a small patch to fix this problem - by generating padding
octets at the end of the string.  But there is an issue - when should these
padding octets be generated ?  I have chosen to put them at the end of the
octets generated by all of the string(s) for one .base64 directive.  This
ensures that if a single directive has multiple strings, there will be no
padding between the strings, which is probably what the user is expecting,
but it does also mean that a single .byte64 directive with multiple arguments
can produce different results to multiple .base64 directives.

Cheers
   Nick





More information about the Binutils mailing list