[libc-commits] [libc] [libc][linux] add support to parse PT_GNU_PROPERTY (PR #174772)
Schrodinger ZHU Yifan via libc-commits
libc-commits at lists.llvm.org
Wed Jan 14 07:19:57 PST 2026
================
@@ -0,0 +1,116 @@
+//===-- Implementation file of gnu_property_section -----------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#include "startup/linux/gnu_property_section.h"
+
+#include "include/llvm-libc-macros/link-macros.h"
+#include "src/__support/CPP/string_view.h"
+#include "src/__support/macros/config.h"
+#include "src/string/memory_utils/utils.h"
+
+#include <linux/elf.h>
+
+#ifdef LIBC_TARGET_ARCH_IS_X86_64
+
+// Property types used in GNU_PROPERTY_TYPE_0 notes
+// (currently only X86_FEATURE_1_AND required).
+#define GNU_PROPERTY_X86_FEATURE_1_AND 0xc0000002
+
+// x86 processor feature bits (currently only SHSTK required).
+#define GNU_PROPERTY_X86_FEATURE_1_SHSTK (1U << 1)
+
+#endif
+
+namespace LIBC_NAMESPACE_DECL {
+
+bool GnuPropertySection::Parse(const ElfW(Phdr) * gnu_property_phdr,
----------------
SchrodingerZhu wrote:
Oh, I see. It is good. Sorry for missing it.
https://github.com/llvm/llvm-project/pull/174772
More information about the libc-commits
mailing list