# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/lld/hotfix-gnu-prop-section.patch # Copyright (C) 2023 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License version 2 as used by the T2 SDE. # --- T2-COPYRIGHT-NOTE-END --- --- lld-17.0.1.src/ELF/InputFiles.cpp 2023-09-19 11:05:13.000000000 +0200 +++ lld-16.0.6.src/ELF/InputFiles.cpp 2023-06-11 00:58:16.000000000 +0200 @@ -902,13 +862,12 @@ 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)) reportFatal(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; } @@ -917,7 +876,7 @@ : GNU_PROPERTY_X86_FEATURE_1_AND; // 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); while (!desc.empty()) { const uint8_t *place = desc.data(); if (desc.size() < 8) @@ -942,7 +901,7 @@ } // 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)); } return featuresSet;