RFC: PR 31964: Add .base64 pseudo-op to gas

Nick Clifton nickc@redhat.com
Wed Jul 10 14:01:10 GMT 2024


Hi Jan,

>>> further wonder
>>> in how far it is necessary to require comma separated arguments. This
>>> is because of me observing, in the doc change, that e.g. .ascii and
>>> .asciz don't require commas as separators.
>>
>> Actually they do, although this is not indicated in their one-line description
>> in the menu section of the document.
> 
> I'm confused now, since ...
> 
>>     .asciz "hello" "world"

> ... here you confirm they don't. The comma is optional there. 

Ah sorry - the point I was trying to make is that the .asciz directive shown
only produces *one* zero-terminated string and not *two*.  Whereas:

   .asciz "hello", "world"

will produce two strings.

But you are right, for the .base64 pseudo-op this distinction would be moot as
it does not append anything to the end of the decoded strings.  So:

   .base64 "foo=" "bar="
   .base64 "foo=", "bar="

might in theory be acceptable.  But ... the base64 encoding says that the = character
should only appear as padding at the end of a base64 encoded string.  So treating the
two strings:

   "foo=" "bar="

as if they were:

   "foo=bar="

is technically wrong.  Of course if that first padding character was not there then
the concatenation would be accpetable.

Anyway - I am going to go ahead and apply my patch.  If at some point in the future
we decide that the comma can be optional we can always make that change.

Cheers
   Nick



More information about the Binutils mailing list