[clang] [compiler-rt] [llvm] [AIX] Implement the ifunc attribute. (PR #153049)

Sean Fertile via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 25 07:35:41 PDT 2025


================
@@ -0,0 +1,22 @@
+typedef void* Ptr;
+typedef struct { Ptr addr, toc, env; } Descr;
+typedef struct { Descr* desc; Ptr (*resolver)(); } IFUNC_PAIR;
+
+// A zero-length entry in section "ifunc_sec" to satisfy the __start_ifunc_sec
+// and __stop_ifunc_sec references in this file, when no user code has any.
+__attribute__((section("ifunc_sec"))) static int dummy_ifunc_sec[0];
+
+extern IFUNC_PAIR __start_ifunc_sec, __stop_ifunc_sec;
+
+__attribute__((constructor))
----------------
mandlebug wrote:

Is the contsructor attribute guaranteed to work when compiling a c program? IIRC at one time it wouldn't as the crt startup files needed to be different when using constructors (or maybe it was a linker option we only used for C++)?

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


More information about the cfe-commits mailing list