Skip to content

Commit

Permalink
um: Switch to large mcmodel on x86_64
Browse files Browse the repository at this point in the history
x86_64 UML is unable to load modules if more than 504MiB
of memory are used.
This happens because on x86_64 the UML process has a quite high
start address (typically around 0x6000000).
If UML's memory is larger than 504MiB VMALLOC_START happens to be after
0x8000000. This is no problem unless one loads a module which was built
with R_X86_64_32S relocations.
Symbols with a location > 0x8000000 cannot be used with R_X86_64_32S

To deal with this x86_64 UML has to be compiled with -mcmodel=large
such that no R_X86_64_32S relocations are used.

Signed-off-by: Richard Weinberger <richard@nod.at>
Reported-by: 전하늘 <allskyee@gmail.com>
  • Loading branch information
Richard Weinberger committed Mar 24, 2012
1 parent 9310da0 commit 12783aa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/um/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ifeq ($(SUBARCH),i386)
endif
ifeq ($(SUBARCH),x86_64)
HEADER_ARCH := x86
KBUILD_CFLAGS += -mcmodel=large
endif

HOST_DIR := arch/$(HEADER_ARCH)
Expand Down

0 comments on commit 12783aa

Please sign in to comment.