git: c10e56732217 - stable/13 - lib/csu: do not compile the body of handle_static_init() for PIC build at all

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Mon, 12 Jun 2023 12:22:31 UTC
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=c10e567322179989c611b4f488b754108d174d5c

commit c10e567322179989c611b4f488b754108d174d5c
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-03-12 01:45:37 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-06-12 12:19:38 +0000

    lib/csu: do not compile the body of handle_static_init() for PIC build at all
    
    (cherry picked from commit c383f4857f1696c4beb782db36323f46f0c4f6de)
---
 lib/libc/csu/libc_start1.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/libc/csu/libc_start1.c b/lib/libc/csu/libc_start1.c
index 346409e3f370..d6a973bf0fe0 100644
--- a/lib/libc/csu/libc_start1.c
+++ b/lib/libc/csu/libc_start1.c
@@ -94,6 +94,7 @@ finalizer(void)
 static void
 handle_static_init(int argc, char **argv, char **env)
 {
+#ifndef PIC
 	void (*fn)(int, char **, char **);
 	size_t array_size, n;
 
@@ -115,6 +116,7 @@ handle_static_init(int argc, char **argv, char **env)
 		if ((uintptr_t)fn != 0 && (uintptr_t)fn != 1)
 			fn(argc, argv, env);
 	}
+#endif
 }
 
 static void