Skip to content

Commit ac7f682

Browse files
committed
Only the top-level section should be considered for renaming
The Linux kernel first places `jiffies64` in .data, and later refines that to .data..cacheline_aligned. The latter still is within the .data section, though, so just use the .data part for renaming.
1 parent 1a181b1 commit ac7f682

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ansi-c/c_typecheck_base.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,11 @@ void c_typecheck_baset::typecheck_declaration(
722722
else
723723
{
724724
std::string asm_name;
725-
asm_name=id2string(full_spec.section)+"$$";
725+
asm_name = id2string(full_spec.section);
726+
std::string::size_type primary_section = asm_name.find('.', 1);
727+
if(primary_section != std::string::npos)
728+
asm_name.resize(primary_section);
729+
asm_name += "$$";
726730
if(!full_spec.asm_label.empty())
727731
asm_name+=id2string(full_spec.asm_label);
728732
else

0 commit comments

Comments
 (0)