From owner-svn-src-all@freebsd.org Tue May 5 11:14:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13DCE2E2422; Tue, 5 May 2020 11:14:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49GcYx6ptPz3Jy0; Tue, 5 May 2020 11:14:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4DE2D055; Tue, 5 May 2020 11:14:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 045BETwx015886; Tue, 5 May 2020 11:14:29 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 045BETMD015882; Tue, 5 May 2020 11:14:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005051114.045BETMD015882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 5 May 2020 11:14:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r360656 - stable/11/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/11/sys/conf X-SVN-Commit-Revision: 360656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2020 11:14:30 -0000 Author: dim Date: Tue May 5 11:14:28 2020 New Revision: 360656 URL: https://svnweb.freebsd.org/changeset/base/360656 Log: MFC r316513 (by jhb): Sync SYSTEM_LD in Makefile.arm with kern.pre.mk. - Add --no-warn-mismatch. - Use same whitespace to make future updates simpler. Reviewed by: imp (part of a larger change) Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D10085 MFC r316514 (by jhb): Always pass the linker emulation via -m when linking modules and kernels. Previously the linker emulation was only passed when building binary objects for firmware modules. This change always passes the desired output format for kernel modules and kernels rather than requiring the toolchain's default output format to match the desired output format. This in turn permits use of external toolchains whose default output format does not match the desired output format. Reviewed by: imp, emaste Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D10085 MFC r320179 (by emaste): add -znotext to kernel module link invocation ARM kernel modules require .text relocations (DT_TEXTREL) in shared object ouptut, which is not allowed by default by lld. Add the -znotext option to enable this. For simplicity add it unconditionally: it is already default and thus either redundant (GNU BFD ld and gold from ports) or ignored as an unknown option (GNU BFD ld 2.17.50 in the base system). Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11250 Modified: stable/11/sys/conf/Makefile.arm stable/11/sys/conf/kern.mk stable/11/sys/conf/kern.pre.mk stable/11/sys/conf/kmod.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/Makefile.arm ============================================================================== --- stable/11/sys/conf/Makefile.arm Tue May 5 10:01:10 2020 (r360655) +++ stable/11/sys/conf/Makefile.arm Tue May 5 11:14:28 2020 (r360656) @@ -61,9 +61,10 @@ KERNVIRTADDR= 0xc0000000 # hack because genassym.c includes sys/bus.h which includes these. genassym.o: bus_if.h device_if.h -SYSTEM_LD_ = ${LD} -Bdynamic -T ldscript.$M.noheader ${_LDFLAGS} \ - -warn-common -export-dynamic -dynamic-linker /red/herring -o \ - ${FULLKERNEL}.noheader -X ${SYSTEM_OBJS} vers.o +SYSTEM_LD_ = ${LD} -m ${LD_EMULATION} -Bdynamic -T ldscript.$M.noheader \ + ${_LDFLAGS} --no-warn-mismatch --warn-common --export-dynamic \ + --dynamic-linker /red/herring \ + -o ${FULLKERNEL}.noheader -X ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL +=;sed s/" + SIZEOF_HEADERS"// ldscript.$M\ >ldscript.$M.noheader; \ ${SYSTEM_LD_}; \ Modified: stable/11/sys/conf/kern.mk ============================================================================== --- stable/11/sys/conf/kern.mk Tue May 5 10:01:10 2020 (r360655) +++ stable/11/sys/conf/kern.mk Tue May 5 11:14:28 2020 (r360656) @@ -256,8 +256,7 @@ CFLAGS+= -std=iso9899:1999 CFLAGS+= -std=${CSTD} .endif # CSTD -# Set target-specific linker emulation name. Used by ld -b binary to convert -# binary files into ELF objects. +# Set target-specific linker emulation name. LD_EMULATION_aarch64=aarch64elf LD_EMULATION_amd64=elf_x86_64_fbsd LD_EMULATION_arm=armelf_fbsd Modified: stable/11/sys/conf/kern.pre.mk ============================================================================== --- stable/11/sys/conf/kern.pre.mk Tue May 5 10:01:10 2020 (r360655) +++ stable/11/sys/conf/kern.pre.mk Tue May 5 11:14:28 2020 (r360656) @@ -206,8 +206,9 @@ MD_ROOT_SIZE_CONFIGURED!= grep MD_ROOT_SIZE opt_md.h | SYSTEM_OBJS+= embedfs_${MFS_IMAGE:T:R}.o .endif .endif -SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} --no-warn-mismatch \ - --warn-common --export-dynamic --dynamic-linker /red/herring \ +SYSTEM_LD= @${LD} -m ${LD_EMULATION} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} \ + --no-warn-mismatch --warn-common --export-dynamic \ + --dynamic-linker /red/herring \ -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \ ${SIZE} ${.TARGET} ; chmod 755 ${.TARGET} Modified: stable/11/sys/conf/kmod.mk ============================================================================== --- stable/11/sys/conf/kmod.mk Tue May 5 10:01:10 2020 (r360655) +++ stable/11/sys/conf/kmod.mk Tue May 5 11:14:28 2020 (r360656) @@ -228,7 +228,8 @@ ${PROG}.debug: ${FULLPROG} .if ${__KLD_SHARED} == yes ${FULLPROG}: ${KMOD}.kld - ${LD} -Bshareable ${_LDFLAGS} -o ${.TARGET} ${KMOD}.kld + ${LD} -m ${LD_EMULATION} -Bshareable -znotext ${_LDFLAGS} \ + -o ${.TARGET} ${KMOD}.kld .if !defined(DEBUG_FLAGS) ${OBJCOPY} --strip-debug ${.TARGET} .endif @@ -244,7 +245,7 @@ ${KMOD}.kld: ${OBJS} .else ${FULLPROG}: ${OBJS} .endif - ${LD} ${_LDFLAGS} -r -d -o ${.TARGET} ${OBJS} + ${LD} -m ${LD_EMULATION} ${_LDFLAGS} -r -d -o ${.TARGET} ${OBJS} .if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} .endif