From owner-svn-src-head@freebsd.org Thu Jul 16 21:58:44 2020 Return-Path: Delivered-To: svn-src-head@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 99C0C36EF61; Thu, 16 Jul 2020 21:58:44 +0000 (UTC) (envelope-from jhb@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4B77S43Mg2z4853; Thu, 16 Jul 2020 21:58:44 +0000 (UTC) (envelope-from jhb@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 53303E8FC; Thu, 16 Jul 2020 21:58:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06GLwi9u034512; Thu, 16 Jul 2020 21:58:44 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06GLwh9N034510; Thu, 16 Jul 2020 21:58:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202007162158.06GLwh9N034510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 16 Jul 2020 21:58:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363263 - in head/lib/csu: . common X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/lib/csu: . common X-SVN-Commit-Revision: 363263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jul 2020 21:58:44 -0000 Author: jhb Date: Thu Jul 16 21:58:43 2020 New Revision: 363263 URL: https://svnweb.freebsd.org/changeset/base/363263 Log: Include ABI note tag in shared libraries. Split the ELF feature note into a separate file that is linked into *crt1.o the same as crtbrand.S was before. crtbrand.o is now linked into crti.o on all platforms in addition to *crt1.o. Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25304 Added: head/lib/csu/common/feature_note.S - copied, changed from r363261, head/lib/csu/common/crtbrand.S Modified: head/lib/csu/Makefile.inc head/lib/csu/common/crtbrand.S Modified: head/lib/csu/Makefile.inc ============================================================================== --- head/lib/csu/Makefile.inc Thu Jul 16 21:30:46 2020 (r363262) +++ head/lib/csu/Makefile.inc Thu Jul 16 21:58:43 2020 (r363263) @@ -13,7 +13,7 @@ OBJS+= crtbegin.o crtbeginS.o crtbeginT.o OBJS+= crtend.o crtendS.o OBJS+= crti.o crtn.o -CRT1OBJS+= crtbrand.o ignore_init_note.o +CRT1OBJS+= crtbrand.o feature_note.o ignore_init_note.o ACFLAGS+= -DLOCORE @@ -33,6 +33,7 @@ FILESDIR= ${LIBDIR} .undef LIBRARIES_ONLY CLEANFILES+= ${OBJS} ${CRT1OBJS} crt1_c.o gcrt1_c.o Scrt1_c.o +CLEANFILES+= crti_s.o crt1.o: crt1_c.o ${CRT1OBJS} ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o} @@ -67,6 +68,12 @@ crtbegin.o crtend.o crtbeginT.o: crtbeginS.o crtendS.o: ${CC} ${CFLAGS} -I${.CURDIR} ${CFLAGS_CRTS} -c -o ${.TARGET} \ ${.ALLSRC:N*.h:[1]} + +crti_s.o: crti.S + ${CC} ${CFLAGS} ${ACFLAGS} -c ${.ALLSRC:M*.S} -o ${.TARGET} + +crti.o: crti_s.o crtbrand.o + ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o} .endif Modified: head/lib/csu/common/crtbrand.S ============================================================================== --- head/lib/csu/common/crtbrand.S Thu Jul 16 21:30:46 2020 (r363262) +++ head/lib/csu/common/crtbrand.S Thu Jul 16 21:58:43 2020 (r363263) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); * for more information. */ - .section .note.tag,"a",%note + .section .note.tag,"aG",%note,.freebsd.noteG,comdat .p2align 2 .4byte 2f-1f .4byte 4f-3f @@ -46,14 +46,4 @@ __FBSDID("$FreeBSD$"); 1: .asciz NOTE_FREEBSD_VENDOR 2: .p2align 2 3: .4byte __FreeBSD_version -4: - - .section .note.tag,"a",%note - .p2align 2 - .4byte 2f-1f - .4byte 4f-3f - .4byte NT_FREEBSD_FEATURE_CTL -1: .asciz NOTE_FREEBSD_VENDOR -2: .p2align 2 -3: .4byte 0 4: Copied and modified: head/lib/csu/common/feature_note.S (from r363261, head/lib/csu/common/crtbrand.S) ============================================================================== --- head/lib/csu/common/crtbrand.S Thu Jul 16 20:44:04 2020 (r363261, copy source) +++ head/lib/csu/common/feature_note.S Thu Jul 16 21:58:43 2020 (r363263) @@ -28,25 +28,8 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include "notes.h" - -/* - * Special ".note.tag" entry specifying the ABI version. See - * http://www.netbsd.org/Documentation/kernel/elf-notes.html - * for more information. - */ - - .section .note.tag,"a",%note - .p2align 2 - .4byte 2f-1f - .4byte 4f-3f - .4byte NT_FREEBSD_ABI_TAG -1: .asciz NOTE_FREEBSD_VENDOR -2: .p2align 2 -3: .4byte __FreeBSD_version -4: .section .note.tag,"a",%note .p2align 2