From f0e2980b88a1ffe60cd48c2b777ca44e9f46b06f Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 26 Feb 2024 17:27:08 +0000 Subject: [PATCH] gcc plugin: Use .dc.a instead of .quad for address expressions in ELF format notes. (.quad on MIPS64 adds extra alignment) --- gcc-plugin/annobin.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc-plugin/annobin.cc b/gcc-plugin/annobin.cc index 2e9886d..440029e 100644 --- a/gcc-plugin/annobin.cc +++ b/gcc-plugin/annobin.cc @@ -466,7 +466,11 @@ annobin_output_note (const char * name, if (info->start_sym != NULL) { - const char * pointer_decl = annobin_is_64bit ? "\t.quad %s" : "\t.dc.l %s"; + // Note: For 64-bit addresses using .quad is problematic for MIPS64, since + // it causes unneeded alignment operations. The .ds.d and .dcb.d directives + // do not accept an expression as an argument and .dc.d generates a floating + // point value, rather than an integer. So we use .dc.a. + const char * pointer_decl = annobin_is_64bit ? "\t.dc.a %s" : "\t.dc.l %s"; fprintf (asm_out_file, pointer_decl, (char *) info->start_sym); -- 2.43.5