# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/lld/hotfix-gnu-prop-section.patch # Copyright (C) 2023 - 2025 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 or patched project license # --- T2-COPYRIGHT-END --- --- lld-21.1.1.src/ELF/InputFiles.cpp.orig 2025-09-09 10:37:15.000000000 +0200 +++ lld-21.1.1.src/ELF/InputFiles.cpp 2025-09-16 20:50:02.339565575 +0200 @@ -1006,23 +1006,22 @@ while (!data.empty()) { // Read one NOTE record. auto *nhdr = reinterpret_cast(data.data()); - if (data.size() < sizeof(Elf_Nhdr) || - data.size() < nhdr->getSize(sec.addralign)) + if (data.size() < sizeof(Elf_Nhdr) || data.size() < nhdr->getSize(1)) return void(err(data.data()) << "data is too short"); Elf_Note note(*nhdr); if (nhdr->n_type != NT_GNU_PROPERTY_TYPE_0 || note.getName() != "GNU") { - data = data.slice(nhdr->getSize(sec.addralign)); + data = data.slice(nhdr->getSize(1)); continue; } // Read a body of a NOTE record, which consists of type-length-value fields. - ArrayRef desc = note.getDesc(sec.addralign); + ArrayRef desc = note.getDesc(1); const uint8_t *base = sec.content().data(); parseGnuPropertyNote(ctx, f, featureAndType, desc, base, &data); // Go to next NOTE record to look for more FEATURE_1_AND descriptions. - data = data.slice(nhdr->getSize(sec.addralign)); + data = data.slice(nhdr->getSize(1)); } }