History

objtool/klp: Handle Clang .data..Lanon anonymous data sections

Clang generates anonymous data sections named .data..Lanon.<hash>. These need section-symbol references in the same way as .data..Lubsan (GCC) and .data..L__unnamed_ (Clang UBSAN) sections. Without this, convert_reloc_sym() fails when processing relocations that reference these sections.

Josh Poimboeuf committed 7 months ago

Commit ff0cf5e1 parent 9e4512d1 file · +4 −3Browse files

Showing the changes to tools/objtool (1 of 1 file). Show all

Unified · Split

tools/objtool/klp-diff.c+4−3
@@ -1030,14 +1030,15 @@ found_sym: · 1029 unmodified lines
10301030 }
10311031
10321032 /*
1033− * Sections with anonymous or uncorrelated data (strings, UBSAN data)
1034− * need section symbol references.
1033+ * Sections with anonymous or uncorrelated data (strings, UBSAN data, Clang
1034+ * anonymous constants) need section symbol references.
10351035 */
10361036 static bool is_uncorrelated_section(struct section *sec)
10371037 {
10381038 return is_string_sec(sec) ||
10391039 strstarts(sec->name, ".data..Lubsan") || /* GCC */
1040− strstarts(sec->name, ".data..L__unnamed_"); /* Clang */
1040+ strstarts(sec->name, ".data..L__unnamed_") || /* Clang */
1041+ strstarts(sec->name, ".data..Lanon."); /* Clang */
10411042 }
10421043
10431044 /*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t