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.
Unified · Split
| @@ -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) | |
| 1034 | − * need section symbol references. | |
| 1033 | + * Sections with anonymous or uncorrelated data (strings, UBSAN data, Clang | |
| 1034 | + * anonymous constants) need section symbol references. | |
| 1035 | 1035 | */ |
| 1036 | 1036 | static bool is_uncorrelated_section(struct section *sec) |
| 1037 | 1037 | { |
| 1038 | 1038 | return is_string_sec(sec) || |
| 1039 | 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 | /* |