Don't use C++ comments in assembly

Jan Beulich jbeulich@suse.com
Thu Jan 13 07:58:25 GMT 2022


On 13.01.2022 04:38, Alan Modra via Binutils wrote:
> It might seem to work, but only if '/' is a start of comment char.
> 
> 	* testsuite/ld-elf/dt-relr-1.s: Use # for comment.
> 	* testsuite/ld-elf/dt-relr-2.s: Likewise.
> 	* testsuite/ld-elf/dt-relr-3.s: Likewise.
> 
> diff --git a/ld/testsuite/ld-elf/dt-relr-1.s b/ld/testsuite/ld-elf/dt-relr-1.s
> index 1eb34588160..ce1a876b1e8 100644
> --- a/ld/testsuite/ld-elf/dt-relr-1.s
> +++ b/ld/testsuite/ld-elf/dt-relr-1.s
> @@ -9,5 +9,5 @@ _start:
>  	.globl data
>  data:
>  	.byte 0
> -	// Offset is not a multiple of 2.  Don't use DT_RELR.
> +# Offset is not a multiple of 2.  Don't use DT_RELR.

Just for my own education, since I've been wondering how to write comments
in tests suitable for all (or at least most) targets: # isn't a universal
comment char either (having a different meaning e.g. on Arm). In
gas/testsuite/gas/all/quoted-sym-names.s I did use /**/ which looks to
have worked quite well ... Elsewhere I find ";#" in use.

Jan



More information about the Binutils mailing list