[linker] Fix out of range relocations.
mmap may return address all over the place. mmap_next will ensure we get the next free page after the requested address. This is especially important for linking on aarch64, where the memory model with PIC admits relocations in the +-4GB range, and as such we can't work with arbitrary object locations in memory. Of note: we map the rts into process space, so any mapped objects must not be ouside of the 4GB from the processes address space.
Showing
- rts/Linker.c 77 additions, 8 deletionsrts/Linker.c
- rts/LinkerInternals.h 2 additions, 1 deletionrts/LinkerInternals.h
- rts/linker/Elf.c 34 additions, 10 deletionsrts/linker/Elf.c
- rts/linker/LoadArchive.c 2 additions, 2 deletionsrts/linker/LoadArchive.c
- rts/linker/M32Alloc.c 3 additions, 3 deletionsrts/linker/M32Alloc.c
- rts/linker/MachO.c 2 additions, 2 deletionsrts/linker/MachO.c
- rts/linker/SymbolExtras.c 1 addition, 1 deletionrts/linker/SymbolExtras.c
- rts/linker/elf_got.c 1 addition, 1 deletionrts/linker/elf_got.c
Loading
Please register or sign in to comment