]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Make sure CodeView symbols are aligned
authorMark Harmstone <mark@harmstone.com>
Thu, 27 Jun 2024 23:33:31 +0000 (00:33 +0100)
committerMark Harmstone <mark@harmstone.com>
Sat, 13 Jul 2024 20:53:39 +0000 (21:53 +0100)
CodeView symbols have to be multiples of four bytes; add an alignment
directive to write_data_symbol to ensure this.

Note that these can be zeroes, so we can rely on GAS to do this for us;
it's only types that need f3, f2, f1 values.

gcc/
* dwarf2codeview.cc (write_data_symbol): Add alignment directive.

gcc/dwarf2codeview.cc

index 71049ccf8782cb0e6c854f45190b5dc660ca1d11..5a33b439b145bbc53fca6cef033ec13d86a231ff 100644 (file)
@@ -958,6 +958,8 @@ write_data_symbol (codeview_symbol *s)
   ASM_OUTPUT_ASCII (asm_out_file, s->data_symbol.name,
                    strlen (s->data_symbol.name) + 1);
 
+  ASM_OUTPUT_ALIGN (asm_out_file, 2);
+
   targetm.asm_out.internal_label (asm_out_file, SYMBOL_END_LABEL, label_num);
 
 end: