Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 May 2020 22:09:59 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
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
Message-ID:  <202005192209.04JM9xOR025995@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005192209.04JM9xOR025995>