From owner-svn-src-all@freebsd.org Tue May 19 22:17:32 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 6DA782F6D9E; Tue, 19 May 2020 22:17:32 +0000 (UTC) (envelope-from emaste@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 49RVcX2NVcz4Dg2; Tue, 19 May 2020 22:17:32 +0000 (UTC) (envelope-from emaste@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 C880411A55; Tue, 19 May 2020 22:10:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JMA04p026039; Tue, 19 May 2020 22:10:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JM9xOR025995; Tue, 19 May 2020 22:09:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005192209.04JM9xOR025995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 19 May 2020 22:09:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361269 - in stable/12/contrib/elftoolchain: elfcopy libelftc X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/12/contrib/elftoolchain: elfcopy libelftc X-SVN-Commit-Revision: 361269 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.33 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, 19 May 2020 22:17:32 -0000 Author: emaste Date: Tue May 19 22:09:59 2020 New Revision: 361269 URL: https://svnweb.freebsd.org/changeset/base/361269 Log: MFC r357826: elfcopy: set ELF OS/ABI field when converting from binary PR: 228934 Submitted by: Tiger Gao Sponsored by: The FreeBSD Foundation Modified: stable/12/contrib/elftoolchain/elfcopy/main.c stable/12/contrib/elftoolchain/libelftc/elftc.3 stable/12/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 stable/12/contrib/elftoolchain/libelftc/elftc_bfdtarget.c stable/12/contrib/elftoolchain/libelftc/libelftc.h Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- stable/12/contrib/elftoolchain/elfcopy/main.c Tue May 19 21:55:29 2020 (r361268) +++ stable/12/contrib/elftoolchain/elfcopy/main.c Tue May 19 22:09:59 2020 (r361269) @@ -1394,6 +1394,7 @@ set_output_target(struct elfcopy *ecp, const char *tar ecp->oec = elftc_bfd_target_class(tgt); ecp->oed = elftc_bfd_target_byteorder(tgt); ecp->oem = elftc_bfd_target_machine(tgt); + ecp->abi = elftc_bfd_target_osabi(tgt); } if (ecp->otf == ETF_EFI || ecp->otf == ETF_PE) ecp->oem = elftc_bfd_target_machine(tgt); Modified: stable/12/contrib/elftoolchain/libelftc/elftc.3 ============================================================================== --- stable/12/contrib/elftoolchain/libelftc/elftc.3 Tue May 19 21:55:29 2020 (r361268) +++ stable/12/contrib/elftoolchain/libelftc/elftc.3 Tue May 19 22:09:59 2020 (r361269) @@ -23,7 +23,7 @@ .\" .\" $Id: elftc.3 3645 2018-10-15 20:17:14Z jkoshy $ .\" -.Dd December 24, 2012 +.Dd February 12, 2020 .Dt ELFTC 3 .Os .Sh NAME @@ -57,6 +57,8 @@ Query the byte order for a binary object descriptor. Query the object format for a binary object descriptor. .It Fn elftc_bfd_target_machine Query the target machine for a binary object descriptor. +.It Fn elftc_bfd_target_osabi +Query the target osabi for a binary object descriptor. .El .It "C++ support" .Bl -tag -compact -width indent Modified: stable/12/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 ============================================================================== --- stable/12/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Tue May 19 21:55:29 2020 (r361268) +++ stable/12/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Tue May 19 22:09:59 2020 (r361269) @@ -23,7 +23,7 @@ .\" .\" $Id: elftc_bfd_find_target.3 3752 2019-06-28 01:12:53Z emaste $ .\" -.Dd June 27, 2019 +.Dd February 12, 2020 .Dt ELFTC_BFD_FIND_TARGET 3 .Os .Sh NAME @@ -48,6 +48,8 @@ .Fn elftc_bfd_target_flavor "Elftc_Bfd_Target *target" .Ft "unsigned int" .Fn elftc_bfd_target_machine "Elftc_Bfd_Target *target" +.Ft "unsigned int" +.Fn elftc_bfd_target_osabi "Elftc_Bfd_Target *target" .Sh DESCRIPTION Function .Fn elftc_bfd_find_target Modified: stable/12/contrib/elftoolchain/libelftc/elftc_bfdtarget.c ============================================================================== --- stable/12/contrib/elftoolchain/libelftc/elftc_bfdtarget.c Tue May 19 21:55:29 2020 (r361268) +++ stable/12/contrib/elftoolchain/libelftc/elftc_bfdtarget.c Tue May 19 22:09:59 2020 (r361269) @@ -71,3 +71,10 @@ elftc_bfd_target_machine(Elftc_Bfd_Target *tgt) return (tgt->bt_machine); } + +unsigned int +elftc_bfd_target_osabi(Elftc_Bfd_Target *tgt) +{ + + return (tgt->bt_osabi); +} Modified: stable/12/contrib/elftoolchain/libelftc/libelftc.h ============================================================================== --- stable/12/contrib/elftoolchain/libelftc/libelftc.h Tue May 19 21:55:29 2020 (r361268) +++ stable/12/contrib/elftoolchain/libelftc/libelftc.h Tue May 19 22:09:59 2020 (r361269) @@ -72,6 +72,7 @@ Elftc_Bfd_Target_Flavor elftc_bfd_target_flavor(Elftc unsigned int elftc_bfd_target_byteorder(Elftc_Bfd_Target *_tgt); unsigned int elftc_bfd_target_class(Elftc_Bfd_Target *_tgt); unsigned int elftc_bfd_target_machine(Elftc_Bfd_Target *_tgt); +unsigned int elftc_bfd_target_osabi(Elftc_Bfd_Target *_tgt); int elftc_copyfile(int _srcfd, int _dstfd); int elftc_demangle(const char *_mangledname, char *_buffer, size_t _bufsize, unsigned int _flags);