Commit 8c862c07 authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Ben Gamari
Browse files

rts/linker: Use mmapForLinker to map PLT

The PLT needs to be located within a close distance of
the code calling it under the small memory model.

Fixes #16784.

(cherry picked from commit 0b7f81f5)
parent 5e6f261a
......@@ -732,12 +732,8 @@ ocGetNames_ELF ( ObjectCode* oc )
unsigned nstubs = numberOfStubsForSection(oc, i);
unsigned stub_space = STUB_SIZE * nstubs;
void * mem = mmap(NULL, size+stub_space,
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_ANON | MAP_PRIVATE,
-1, 0);
if( mem == MAP_FAILED ) {
void * mem = mmapForLinker(size+stub_space, MAP_ANON, -1, 0);
if( mem == NULL ) {
barf("failed to mmap allocated memory to load section %d. "
"errno = %d", i, errno);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment