mirror of
https://git.musl-libc.org/git/musl
synced 2025-01-23 06:32:05 +03:00
ldso: fix non-functional fix to early dynamic PAGE_SIZE access
commit f47a8cdd25
introduced an
alternate mechanism for access to runtime page size for compatibility
with early stages of dynamic linking, but because pthread_impl.h
indirectly includes libc.h, the condition #ifndef PAGE_SIZE was never
satisfied.
rather than depend on order of inclusion, use the (baseline POSIX)
macro PAGESIZE, not the (XSI) macro PAGE_SIZE, to determine whether
page size is dynamic. our internal libc.h only provides a dynamic
definition for PAGE_SIZE, not for PAGESIZE.
This commit is contained in:
parent
fced99e93d
commit
6f666231bf
@ -21,15 +21,17 @@
|
|||||||
#include <sys/membarrier.h>
|
#include <sys/membarrier.h>
|
||||||
#include "pthread_impl.h"
|
#include "pthread_impl.h"
|
||||||
#include "fork_impl.h"
|
#include "fork_impl.h"
|
||||||
|
#include "libc.h"
|
||||||
#include "dynlink.h"
|
#include "dynlink.h"
|
||||||
|
|
||||||
static size_t ldso_page_size;
|
static size_t ldso_page_size;
|
||||||
#ifndef PAGE_SIZE
|
/* libc.h may have defined a macro for dynamic PAGE_SIZE already, but
|
||||||
|
* PAGESIZE is only defined if it's constant for the arch. */
|
||||||
|
#ifndef PAGESIZE
|
||||||
|
#undef PAGE_SIZE
|
||||||
#define PAGE_SIZE ldso_page_size
|
#define PAGE_SIZE ldso_page_size
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "libc.h"
|
|
||||||
|
|
||||||
#define malloc __libc_malloc
|
#define malloc __libc_malloc
|
||||||
#define calloc __libc_calloc
|
#define calloc __libc_calloc
|
||||||
#define realloc __libc_realloc
|
#define realloc __libc_realloc
|
||||||
|
Loading…
Reference in New Issue
Block a user