From fa7678c8ff77774b0a3aae101bf42da035f42a56 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sat, 2 Apr 2011 23:31:17 +0200 Subject: [PATCH] Remove the hack for loading x86_64 kernels linked with binutils >=2.20. Now that both our binutils support CONSTANT, MAXPAGESIZE and COMMONPAGESIZE, use those in the ldscript. --- sys/conf/kern.pre.mk | 5 ----- sys/platform/pc64/conf/ldscript.x86_64 | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index 21fa48638a..d203b80a98 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -95,11 +95,6 @@ SYSTEM_OBJS= locore.o ${OBJS} ioconf.o config.o hack.So SYSTEM_LD= @${LD} -Bdynamic -T $S/platform/$P/conf/ldscript.$M \ -export-dynamic -dynamic-linker /red/herring \ -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o -.if ${P} == "pc64" -# XXX swildner: Workaround to make kernels linked with binutils221 boot. -# -SYSTEM_LD+= -z max-page-size=1048576 -.endif SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \ ${SIZE} ${.TARGET} ; chmod 755 ${.TARGET} SYSTEM_DEP+= $S/platform/$P/conf/ldscript.$M diff --git a/sys/platform/pc64/conf/ldscript.x86_64 b/sys/platform/pc64/conf/ldscript.x86_64 index 9e85d79592..d8dcdc1763 100644 --- a/sys/platform/pc64/conf/ldscript.x86_64 +++ b/sys/platform/pc64/conf/ldscript.x86_64 @@ -8,7 +8,7 @@ SEARCH_DIR("/usr/lib"); SECTIONS { /* Read-only sections, merged into text segment: */ - . = kernbase + 0x00100000 + SIZEOF_HEADERS; + . = kernbase + CONSTANT (MAXPAGESIZE) + SIZEOF_HEADERS; .interp : { *(.interp) } .hash : { *(.hash) } .dynsym : { *(.dynsym) } @@ -63,7 +63,7 @@ SECTIONS .eh_frame_hdr : { *(.eh_frame_hdr) } /* Adjust the address for the data segment. We want to adjust up to the same address within the page on the next page up. */ - . = DATA_SEGMENT_ALIGN(0x100000, 0x1000); + . = DATA_SEGMENT_ALIGN(CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); /* Ensure the __preinit_array_start label is properly aligned. We could instead move the label definition inside the section, but the linker would then create the section even if it turns out to -- 2.41.0