lib/csu: do not compile the body of handle_static_init() for PIC build at all
The referenced symbols that provide init array boundaries are weak, hidden, and undefined. The code that iterates over that arrays is not used for the case when libc is compiled as dso. This should fix linking with ld.bfd. Sponsored by: The FreeBSD Foundation MFC after: 3 weeks
This commit is contained in:
parent
94e3409e2d
commit
c383f4857f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user