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

Unified · Split

tools/objtool/klp-diff.c+4−3
@@ -1030,14 +1030,15 @@ found_sym: · 1029 unmodified lines
1030}1030}
1031 1031
1032/*1032/*
1033 * Sections with anonymous or uncorrelated data (strings, UBSAN data)1033 * Sections with anonymous or uncorrelated data (strings, UBSAN data, Clang
1034 * need section symbol references.1034 * anonymous constants) need section symbol references.
1035 */1035 */
1036static bool is_uncorrelated_section(struct section *sec)1036static bool is_uncorrelated_section(struct section *sec)
1037{1037{
1038 return is_string_sec(sec) ||1038 return is_string_sec(sec) ||
1039 strstarts(sec->name, ".data..Lubsan") || /* GCC */1039 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 */
1041}1042}
1042 1043
1043/*1044/*

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