[libc-commits] [libc] [libc] add dl_iterate_phdr and dladdr (PR #121179)

Sam James via libc-commits libc-commits at lists.llvm.org
Sat Dec 28 10:10:08 PST 2024


================
@@ -0,0 +1,57 @@
+//===-- Implementation of dl_iterate_phdr ---------------------------------===//
+//
+// 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 "src/link/dl_iterate_phdr.h"
+#include "config/linux/app.h"
+#include "include/llvm-libc-macros/sys-auxv-macros.h"
+#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
+
+[[gnu::weak,
+  gnu::visibility("hidden")]] extern const ElfW(Dyn) _DYNAMIC[]; // NOLINT
+
+#define AUX_CNT 38
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(int, dl_iterate_phdr,
----------------
thesamesam wrote:

Please research the topic before making further PRs to (any) projects -- it's important that you understand licencing and using code derived from another project without honouring their licence. I don't think I can explain the whole topic in a succinct comment here but there's a lot of resources online about it.

https://github.com/llvm/llvm-project/pull/121179


More information about the libc-commits mailing list