aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Harmstone <mark@harmstone.com>2024-11-30 22:35:24 +0000
committerMark Harmstone <mark@harmstone.com>2024-12-16 02:13:00 +0000
commita895642e230456c183b80202c68a959aa4aabea6 (patch)
tree03e15ef36db5bc83a3c1bd38dcbfff69192e2513
parent43377649ba6600cb0eff740b87d08460274c511b (diff)
downloadgcc-a895642e230456c183b80202c68a959aa4aabea6.zip
gcc-a895642e230456c183b80202c68a959aa4aabea6.tar.gz
gcc-a895642e230456c183b80202c68a959aa4aabea6.tar.bz2
Fix non-aligned CodeView symbols
CodeView symbols in PDB files are aligned to four-byte boundaries. It's not really clear what logic MSVC uses to enforce this; sometimes the symbols are padded in the object file, sometimes the linker seems to do the work. It makes more sense to do this in the compiler, so fix the two instances where we can write symbols with a non-aligned length. S_FRAMEPROC is unusually not a multiple of 4, so will always have 2 bytes padding. S_INLINESITE is followed by variable-length "binary annotations", so will also usually have padding. gcc/ * dwarf2codeview.cc (write_s_frameproc): Align output. (write_s_inlinesite): Align output.
-rw-r--r--gcc/dwarf2codeview.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/dwarf2codeview.cc b/gcc/dwarf2codeview.cc
index 19ec58d..a50fcdf 100644
--- a/gcc/dwarf2codeview.cc
+++ b/gcc/dwarf2codeview.cc
@@ -3208,6 +3208,8 @@ write_s_frameproc (void)
fprint_whex (asm_out_file, 0);
putc ('\n', asm_out_file);
+ ASM_OUTPUT_ALIGN (asm_out_file, 2);
+
targetm.asm_out.internal_label (asm_out_file, SYMBOL_END_LABEL, label_num);
}
@@ -3576,7 +3578,10 @@ write_s_inlinesite (dw_die_ref parent_func, dw_die_ref die)
line_func = find_line_function (parent_func, die);
if (line_func)
- write_binary_annotations (line_func, func_id);
+ {
+ write_binary_annotations (line_func, func_id);
+ ASM_OUTPUT_ALIGN (asm_out_file, 2);
+ }
#else
(void) line_func;
#endif