svn commit: r295639 - in projects/release-pkg: . contrib/elftoolchain/addr2line contrib/elftoolchain/ar contrib/elftoolchain/brandelf contrib/elftoolchain/common contrib/elftoolchain/cxxfilt contri...
Glen Barber
gjb at FreeBSD.org
Mon Feb 15 21:58:55 UTC 2016
Author: gjb
Date: Mon Feb 15 21:58:52 2016
New Revision: 295639
URL: https://svnweb.freebsd.org/changeset/base/295639
Log:
MFH
Sponsored by: The FreeBSD Foundation
Added:
projects/release-pkg/contrib/elftoolchain/addr2line/os.NetBSD.mk
- copied unchanged from r295638, head/contrib/elftoolchain/addr2line/os.NetBSD.mk
projects/release-pkg/contrib/elftoolchain/elfcopy/pe.c
- copied unchanged from r295638, head/contrib/elftoolchain/elfcopy/pe.c
projects/release-pkg/contrib/elftoolchain/elfdump/os.NetBSD.mk
- copied unchanged from r295638, head/contrib/elftoolchain/elfdump/os.NetBSD.mk
projects/release-pkg/contrib/elftoolchain/libdwarf/os.NetBSD.mk
- copied unchanged from r295638, head/contrib/elftoolchain/libdwarf/os.NetBSD.mk
projects/release-pkg/contrib/elftoolchain/libelftc/os.NetBSD.mk
- copied unchanged from r295638, head/contrib/elftoolchain/libelftc/os.NetBSD.mk
projects/release-pkg/contrib/elftoolchain/libpe/
- copied from r295638, head/contrib/elftoolchain/libpe/
projects/release-pkg/contrib/elftoolchain/nm/os.NetBSD.mk
- copied unchanged from r295638, head/contrib/elftoolchain/nm/os.NetBSD.mk
projects/release-pkg/contrib/elftoolchain/readelf/os.NetBSD.mk
- copied unchanged from r295638, head/contrib/elftoolchain/readelf/os.NetBSD.mk
projects/release-pkg/contrib/elftoolchain/size/os.NetBSD.mk
- copied unchanged from r295638, head/contrib/elftoolchain/size/os.NetBSD.mk
projects/release-pkg/contrib/elftoolchain/strings/os.NetBSD.mk
- copied unchanged from r295638, head/contrib/elftoolchain/strings/os.NetBSD.mk
projects/release-pkg/contrib/unbound/util/as112.c
- copied unchanged from r295638, head/contrib/unbound/util/as112.c
projects/release-pkg/contrib/unbound/util/as112.h
- copied unchanged from r295638, head/contrib/unbound/util/as112.h
projects/release-pkg/lib/libpe/
- copied from r295638, head/lib/libpe/
projects/release-pkg/share/examples/jails/VIMAGE
- copied unchanged from r295638, head/share/examples/jails/VIMAGE
projects/release-pkg/sys/arm/allwinner/a10_dmac.c
- copied unchanged from r295638, head/sys/arm/allwinner/a10_dmac.c
projects/release-pkg/sys/arm/allwinner/a10_dmac.h
- copied unchanged from r295638, head/sys/arm/allwinner/a10_dmac.h
projects/release-pkg/sys/arm/allwinner/axp209.c
- copied unchanged from r295638, head/sys/arm/allwinner/axp209.c
projects/release-pkg/sys/arm/allwinner/sunxi_dma_if.m
- copied unchanged from r295638, head/sys/arm/allwinner/sunxi_dma_if.m
projects/release-pkg/sys/arm/conf/A10
- copied unchanged from r295638, head/sys/arm/conf/A10
projects/release-pkg/sys/arm/ti/omap4/omap4_wugen.c
- copied unchanged from r295638, head/sys/arm/ti/omap4/omap4_wugen.c
projects/release-pkg/sys/boot/fdt/dts/arm/olimex-a20-som-evb.dts
- copied unchanged from r295638, head/sys/boot/fdt/dts/arm/olimex-a20-som-evb.dts
projects/release-pkg/sys/boot/fdt/dts/arm/olinuxino-lime.dts
- copied unchanged from r295638, head/sys/boot/fdt/dts/arm/olinuxino-lime.dts
projects/release-pkg/sys/boot/fdt/dts/riscv/qemu.dts
- copied unchanged from r295638, head/sys/boot/fdt/dts/riscv/qemu.dts
projects/release-pkg/sys/dev/iicbus/twsi/
- copied from r295638, head/sys/dev/iicbus/twsi/
projects/release-pkg/sys/mips/include/intr.h
- copied unchanged from r295638, head/sys/mips/include/intr.h
projects/release-pkg/sys/mips/mips/mips_pic.c
- copied unchanged from r295638, head/sys/mips/mips/mips_pic.c
projects/release-pkg/sys/riscv/conf/QEMU
- copied unchanged from r295638, head/sys/riscv/conf/QEMU
projects/release-pkg/sys/riscv/conf/SPIKE
- copied unchanged from r295638, head/sys/riscv/conf/SPIKE
projects/release-pkg/sys/sys/_ucontext.h
- copied unchanged from r295638, head/sys/sys/_ucontext.h
projects/release-pkg/sys/sys/intr.h
- copied unchanged from r295638, head/sys/sys/intr.h
projects/release-pkg/tools/build/options/WITHOUT_ELFTOOLCHAIN_BOOTSTRAP
- copied unchanged from r295638, head/tools/build/options/WITHOUT_ELFTOOLCHAIN_BOOTSTRAP
projects/release-pkg/tools/build/options/WITH_BINUTILS
- copied unchanged from r295638, head/tools/build/options/WITH_BINUTILS
projects/release-pkg/tools/build/options/WITH_BINUTILS_BOOTSTRAP
- copied unchanged from r295638, head/tools/build/options/WITH_BINUTILS_BOOTSTRAP
projects/release-pkg/tools/build/options/WITH_GDB
- copied unchanged from r295638, head/tools/build/options/WITH_GDB
Deleted:
projects/release-pkg/contrib/elftoolchain/libelftc/elftc_symbol_table_create.3
projects/release-pkg/sys/arm/mv/twsi.c
projects/release-pkg/sys/arm/xilinx/zedboard/
projects/release-pkg/sys/mips/mips/bus_space_fdt.c
Modified:
projects/release-pkg/Makefile.inc1
projects/release-pkg/ObsoleteFiles.inc
projects/release-pkg/contrib/elftoolchain/addr2line/addr2line.c
projects/release-pkg/contrib/elftoolchain/ar/ar.c
projects/release-pkg/contrib/elftoolchain/brandelf/brandelf.c
projects/release-pkg/contrib/elftoolchain/common/elfdefinitions.h
projects/release-pkg/contrib/elftoolchain/common/native-elf-format
projects/release-pkg/contrib/elftoolchain/cxxfilt/cxxfilt.c
projects/release-pkg/contrib/elftoolchain/elfcopy/Makefile
projects/release-pkg/contrib/elftoolchain/elfcopy/archive.c
projects/release-pkg/contrib/elftoolchain/elfcopy/elfcopy.1
projects/release-pkg/contrib/elftoolchain/elfcopy/elfcopy.h
projects/release-pkg/contrib/elftoolchain/elfcopy/main.c
projects/release-pkg/contrib/elftoolchain/elfcopy/sections.c
projects/release-pkg/contrib/elftoolchain/elfcopy/segments.c
projects/release-pkg/contrib/elftoolchain/elfcopy/symbols.c
projects/release-pkg/contrib/elftoolchain/elfdump/elfdump.c
projects/release-pkg/contrib/elftoolchain/libdwarf/_libdwarf.h
projects/release-pkg/contrib/elftoolchain/libdwarf/dwarf.3
projects/release-pkg/contrib/elftoolchain/libdwarf/dwarf_str.c
projects/release-pkg/contrib/elftoolchain/libdwarf/libdwarf.h
projects/release-pkg/contrib/elftoolchain/libdwarf/libdwarf_rw.c
projects/release-pkg/contrib/elftoolchain/libelf/_libelf_config.h
projects/release-pkg/contrib/elftoolchain/libelftc/Makefile
projects/release-pkg/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3
projects/release-pkg/contrib/elftoolchain/libelftc/elftc_copyfile.c
projects/release-pkg/contrib/elftoolchain/libelftc/elftc_demangle.c
projects/release-pkg/contrib/elftoolchain/libelftc/libelftc.h
projects/release-pkg/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c
projects/release-pkg/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c
projects/release-pkg/contrib/elftoolchain/libelftc/make-toolchain-version
projects/release-pkg/contrib/elftoolchain/readelf/readelf.c
projects/release-pkg/contrib/elftoolchain/strings/strings.1
projects/release-pkg/contrib/elftoolchain/strings/strings.c
projects/release-pkg/contrib/unbound/Makefile.in
projects/release-pkg/contrib/unbound/doc/example.conf
projects/release-pkg/contrib/unbound/doc/example.conf.in
projects/release-pkg/contrib/unbound/doc/unbound.conf.5
projects/release-pkg/contrib/unbound/doc/unbound.conf.5.in
projects/release-pkg/contrib/unbound/services/localzone.c
projects/release-pkg/contrib/unbound/util/config_file.c
projects/release-pkg/contrib/unbound/util/config_file.h
projects/release-pkg/contrib/unbound/util/configlexer.lex
projects/release-pkg/contrib/unbound/util/configparser.y
projects/release-pkg/contrib/unbound/validator/val_anchor.c
projects/release-pkg/etc/defaults/rc.conf
projects/release-pkg/etc/rc.d/jail
projects/release-pkg/etc/rc.d/ntpd
projects/release-pkg/include/signal.h
projects/release-pkg/lib/Makefile
projects/release-pkg/lib/libc/stdio/fgetln.3
projects/release-pkg/lib/libc/stdio/fgetln.c
projects/release-pkg/lib/libc/stdio/fputs.c
projects/release-pkg/lib/libc/sys/jail.2
projects/release-pkg/lib/libelftc/elftc_version.c
projects/release-pkg/lib/libfetch/http.c
projects/release-pkg/lib/libunbound/Makefile
projects/release-pkg/share/examples/jails/README
projects/release-pkg/share/examples/jails/jib
projects/release-pkg/share/examples/jails/jng
projects/release-pkg/share/man/man4/ds3231.4
projects/release-pkg/share/man/man5/rc.conf.5
projects/release-pkg/share/man/man8/uefi.8
projects/release-pkg/share/mk/src.libnames.mk
projects/release-pkg/sys/arm/allwinner/a10_clk.c
projects/release-pkg/sys/arm/allwinner/a10_clk.h
projects/release-pkg/sys/arm/allwinner/a10_common.c
projects/release-pkg/sys/arm/allwinner/a10_ehci.c
projects/release-pkg/sys/arm/allwinner/a10_gpio.c
projects/release-pkg/sys/arm/allwinner/a10_mmc.c
projects/release-pkg/sys/arm/allwinner/a10_wdog.c
projects/release-pkg/sys/arm/allwinner/a20/a20_cpu_cfg.c
projects/release-pkg/sys/arm/allwinner/aintc.c
projects/release-pkg/sys/arm/allwinner/files.a10
projects/release-pkg/sys/arm/allwinner/files.allwinner
projects/release-pkg/sys/arm/allwinner/if_emac.c
projects/release-pkg/sys/arm/allwinner/timer.c
projects/release-pkg/sys/arm/altera/socfpga/socfpga_common.c
projects/release-pkg/sys/arm/amlogic/aml8726/aml8726_machdep.c
projects/release-pkg/sys/arm/annapurna/alpine/common.c
projects/release-pkg/sys/arm/arm/generic_timer.c
projects/release-pkg/sys/arm/arm/syscall.c
projects/release-pkg/sys/arm/at91/at91_common.c
projects/release-pkg/sys/arm/broadcom/bcm2835/bcm2835_common.c
projects/release-pkg/sys/arm/conf/A20
projects/release-pkg/sys/arm/conf/ALPINE
projects/release-pkg/sys/arm/conf/ARMADA38X
projects/release-pkg/sys/arm/conf/ARMADAXP
projects/release-pkg/sys/arm/conf/DB-78XXX
projects/release-pkg/sys/arm/conf/DB-88F5XXX
projects/release-pkg/sys/arm/conf/DB-88F6XXX
projects/release-pkg/sys/arm/conf/DOCKSTAR
projects/release-pkg/sys/arm/conf/DREAMPLUG-1001
projects/release-pkg/sys/arm/conf/EXYNOS5.common
projects/release-pkg/sys/arm/conf/NOTES
projects/release-pkg/sys/arm/conf/ODROIDC1
projects/release-pkg/sys/arm/conf/PANDABOARD
projects/release-pkg/sys/arm/conf/RK3188
projects/release-pkg/sys/arm/conf/SOCKIT.common
projects/release-pkg/sys/arm/conf/VIRT
projects/release-pkg/sys/arm/conf/VSATV102
projects/release-pkg/sys/arm/conf/VYBRID
projects/release-pkg/sys/arm/conf/ZEDBOARD
projects/release-pkg/sys/arm/freescale/imx/imx_common.c
projects/release-pkg/sys/arm/freescale/vybrid/vf_common.c
projects/release-pkg/sys/arm/include/intr.h
projects/release-pkg/sys/arm/lpc/lpc_intc.c
projects/release-pkg/sys/arm/mv/files.mv
projects/release-pkg/sys/arm/mv/mv_common.c
projects/release-pkg/sys/arm/qemu/virt_common.c
projects/release-pkg/sys/arm/rockchip/rk30xx_common.c
projects/release-pkg/sys/arm/samsung/exynos/exynos5_common.c
projects/release-pkg/sys/arm/ti/omap4/files.omap4
projects/release-pkg/sys/arm/versatile/versatile_common.c
projects/release-pkg/sys/arm/xilinx/zy7_machdep.c
projects/release-pkg/sys/arm64/arm64/disassem.c
projects/release-pkg/sys/arm64/arm64/gic.c
projects/release-pkg/sys/arm64/arm64/gic_v3.c
projects/release-pkg/sys/arm64/arm64/gic_v3_its.c
projects/release-pkg/sys/arm64/arm64/gic_v3_reg.h
projects/release-pkg/sys/arm64/arm64/gic_v3_var.h
projects/release-pkg/sys/arm64/arm64/intr_machdep.c
projects/release-pkg/sys/arm64/arm64/nexus.c
projects/release-pkg/sys/arm64/arm64/pic_if.m
projects/release-pkg/sys/arm64/arm64/swtch.S
projects/release-pkg/sys/arm64/include/armreg.h
projects/release-pkg/sys/arm64/include/intr.h
projects/release-pkg/sys/boot/fdt/dts/arm/bananapi.dts
projects/release-pkg/sys/boot/fdt/dts/arm/cubieboard2.dts
projects/release-pkg/sys/boot/fdt/dts/arm/sun4i-a10.dtsi
projects/release-pkg/sys/boot/fdt/dts/arm/sun7i-a20.dtsi
projects/release-pkg/sys/cam/ctl/ctl.c
projects/release-pkg/sys/conf/files.arm
projects/release-pkg/sys/conf/files.mips
projects/release-pkg/sys/dev/cxgb/cxgb_sge.c
projects/release-pkg/sys/dev/cxgbe/common/t4_msg.h
projects/release-pkg/sys/dev/cxgbe/t4_main.c
projects/release-pkg/sys/dev/cxgbe/t4_sge.c
projects/release-pkg/sys/dev/hwpmc/hwpmc_core.c
projects/release-pkg/sys/dev/hwpmc/hwpmc_core.h
projects/release-pkg/sys/dev/hwpmc/hwpmc_mod.c
projects/release-pkg/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
projects/release-pkg/sys/dev/ioat/ioat.c
projects/release-pkg/sys/dev/ioat/ioat_hw.h
projects/release-pkg/sys/dev/ioat/ioat_internal.h
projects/release-pkg/sys/dev/iscsi/icl.c
projects/release-pkg/sys/dev/iscsi/iscsi.h
projects/release-pkg/sys/dev/ntb/ntb_hw/ntb_hw.c
projects/release-pkg/sys/dev/ntb/ntb_hw/ntb_hw.h
projects/release-pkg/sys/dev/ntb/ntb_hw/ntb_regs.h
projects/release-pkg/sys/dev/nvme/nvme_ctrlr.c
projects/release-pkg/sys/dev/sfxge/common/efx.h
projects/release-pkg/sys/dev/sfxge/common/efx_mcdi.c
projects/release-pkg/sys/dev/sfxge/common/efx_mcdi.h
projects/release-pkg/sys/dev/sfxge/common/efx_phy.c
projects/release-pkg/sys/dev/sfxge/sfxge.c
projects/release-pkg/sys/dev/uart/uart_bus_fdt.c
projects/release-pkg/sys/dev/uart/uart_dev_lpc.c
projects/release-pkg/sys/dev/uart/uart_dev_ns8250.c
projects/release-pkg/sys/dev/usb/controller/ehci_pci.c
projects/release-pkg/sys/dev/usb/net/if_smsc.c
projects/release-pkg/sys/dev/usb/wlan/if_rum.c
projects/release-pkg/sys/dev/usb/wlan/if_rumreg.h
projects/release-pkg/sys/dev/xen/blkfront/blkfront.c
projects/release-pkg/sys/dev/xen/netfront/netfront.c
projects/release-pkg/sys/fs/cd9660/cd9660_vfsops.c
projects/release-pkg/sys/fs/ext2fs/ext2_bmap.c
projects/release-pkg/sys/fs/ext2fs/ext2_extents.c
projects/release-pkg/sys/fs/ext2fs/ext2_extents.h
projects/release-pkg/sys/fs/ext2fs/ext2_vnops.c
projects/release-pkg/sys/fs/tmpfs/tmpfs_vnops.c
projects/release-pkg/sys/kern/kern_mbuf.c
projects/release-pkg/sys/kern/link_elf.c
projects/release-pkg/sys/kern/link_elf_obj.c
projects/release-pkg/sys/kern/subr_intr.c
projects/release-pkg/sys/kern/subr_turnstile.c
projects/release-pkg/sys/kern/uipc_mbuf.c
projects/release-pkg/sys/mips/conf/AR71XX_BASE
projects/release-pkg/sys/mips/conf/AR724X_BASE
projects/release-pkg/sys/mips/conf/AR91XX_BASE
projects/release-pkg/sys/mips/conf/QCA953X_BASE
projects/release-pkg/sys/mips/include/bus.h
projects/release-pkg/sys/mips/include/fdt.h
projects/release-pkg/sys/mips/include/smp.h
projects/release-pkg/sys/mips/include/ucontext.h
projects/release-pkg/sys/mips/mips/bus_space_generic.c
projects/release-pkg/sys/mips/mips/exception.S
projects/release-pkg/sys/mips/mips/nexus.c
projects/release-pkg/sys/mips/mips/tick.c
projects/release-pkg/sys/modules/dtb/allwinner/Makefile
projects/release-pkg/sys/net/route.c
projects/release-pkg/sys/netinet/in_rmx.c
projects/release-pkg/sys/netinet/sctp_constants.h
projects/release-pkg/sys/netinet/sctp_sysctl.c
projects/release-pkg/sys/netinet/tcp_lro.c
projects/release-pkg/sys/netinet/tcp_pcap.c
projects/release-pkg/sys/netinet6/in6_rmx.c
projects/release-pkg/sys/netinet6/nd6.c
projects/release-pkg/sys/netinet6/nd6.h
projects/release-pkg/sys/netinet6/nd6_nbr.c
projects/release-pkg/sys/netinet6/nd6_rtr.c
projects/release-pkg/sys/netinet6/scope6.c
projects/release-pkg/sys/powerpc/booke/pmap.c
projects/release-pkg/sys/powerpc/booke/trap_subr.S
projects/release-pkg/sys/powerpc/include/pte.h
projects/release-pkg/sys/powerpc/include/ucontext.h
projects/release-pkg/sys/powerpc/powerpc/genassym.c
projects/release-pkg/sys/riscv/conf/GENERIC
projects/release-pkg/sys/riscv/htif/htif.c
projects/release-pkg/sys/riscv/include/ucontext.h
projects/release-pkg/sys/sparc64/include/ucontext.h
projects/release-pkg/sys/sys/mbuf.h
projects/release-pkg/sys/sys/pmc.h
projects/release-pkg/sys/sys/signal.h
projects/release-pkg/sys/sys/ucontext.h
projects/release-pkg/sys/x86/include/ucontext.h
projects/release-pkg/tests/sys/geom/class/gate/3_test.sh
projects/release-pkg/tools/build/mk/OptionalObsoleteFiles.inc
projects/release-pkg/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP
projects/release-pkg/usr.bin/elfcopy/Makefile
projects/release-pkg/usr.bin/hexdump/display.c
projects/release-pkg/usr.bin/truss/amd64-linux32.c
projects/release-pkg/usr.bin/truss/i386-linux.c
projects/release-pkg/usr.sbin/ctld/login.c
projects/release-pkg/usr.sbin/jail/jail.8
projects/release-pkg/usr.sbin/jail/jail.conf.5
projects/release-pkg/usr.sbin/services_mkdb/services_mkdb.c
projects/release-pkg/usr.sbin/unbound/control/Makefile
projects/release-pkg/usr.sbin/unbound/local-setup/local-unbound-setup.sh
Directory Properties:
projects/release-pkg/ (props changed)
projects/release-pkg/contrib/elftoolchain/ (props changed)
projects/release-pkg/contrib/elftoolchain/ar/ (props changed)
projects/release-pkg/contrib/elftoolchain/brandelf/ (props changed)
projects/release-pkg/contrib/elftoolchain/elfdump/ (props changed)
projects/release-pkg/contrib/unbound/ (props changed)
projects/release-pkg/include/ (props changed)
projects/release-pkg/lib/libc/ (props changed)
projects/release-pkg/share/ (props changed)
projects/release-pkg/share/man/man4/ (props changed)
projects/release-pkg/sys/ (props changed)
projects/release-pkg/sys/boot/ (props changed)
projects/release-pkg/sys/conf/ (props changed)
projects/release-pkg/sys/dev/hyperv/ (props changed)
projects/release-pkg/usr.sbin/jail/ (props changed)
Modified: projects/release-pkg/Makefile.inc1
==============================================================================
--- projects/release-pkg/Makefile.inc1 Mon Feb 15 21:18:52 2016 (r295638)
+++ projects/release-pkg/Makefile.inc1 Mon Feb 15 21:58:52 2016 (r295639)
@@ -1804,6 +1804,7 @@ _binutils= gnu/usr.bin/binutils
.endif
.if ${MK_ELFTOOLCHAIN_BOOTSTRAP} != "no"
_elftctools= lib/libelftc \
+ lib/libpe \
usr.bin/elfcopy \
usr.bin/nm \
usr.bin/size \
@@ -1816,6 +1817,7 @@ _elftctools+= usr.bin/addr2line
# If cross-building with an external binutils we still need to build strip for
# the target (for at least crunchide).
_elftctools= lib/libelftc \
+ lib/libpe \
usr.bin/elfcopy
.endif
Modified: projects/release-pkg/ObsoleteFiles.inc
==============================================================================
--- projects/release-pkg/ObsoleteFiles.inc Mon Feb 15 21:18:52 2016 (r295638)
+++ projects/release-pkg/ObsoleteFiles.inc Mon Feb 15 21:58:52 2016 (r295639)
@@ -38,6 +38,8 @@
# xargs -n1 | sort | uniq -d;
# done
+# 20160211: Remove obsolete unbound-control-setup
+OLD_FILES+=usr/sbin/unbound-control-setup
# 20160116: Update mandoc to cvs snapshot 20160116
OLD_FILES+=usr/share/mdocml/example.style.css
OLD_FILES+=usr/share/mdocml/style.css
Modified: projects/release-pkg/contrib/elftoolchain/addr2line/addr2line.c
==============================================================================
--- projects/release-pkg/contrib/elftoolchain/addr2line/addr2line.c Mon Feb 15 21:18:52 2016 (r295638)
+++ projects/release-pkg/contrib/elftoolchain/addr2line/addr2line.c Mon Feb 15 21:58:52 2016 (r295639)
@@ -40,7 +40,7 @@
#include "uthash.h"
#include "_elftc.h"
-ELFTC_VCSID("$Id: addr2line.c 3264 2015-11-30 05:38:14Z kaiwang27 $");
+ELFTC_VCSID("$Id: addr2line.c 3273 2015-12-11 21:38:57Z kaiwang27 $");
struct Func {
char *name;
@@ -368,7 +368,8 @@ print_inlines(struct CU *cu, struct Func
printf("%s\n", f->name);
}
}
- (void) printf("%s:%ju\n", base ? basename(file) : file, call_line);
+ (void) printf("%s:%ju\n", base ? basename(file) : file,
+ (uintmax_t) call_line);
if (f->inlined_caller != NULL)
print_inlines(cu, f->inlined_caller, f->call_file,
@@ -562,7 +563,8 @@ out:
}
}
- (void) printf("%s:%ju\n", base ? basename(file) : file, lineno);
+ (void) printf("%s:%ju\n", base ? basename(file) : file,
+ (uintmax_t) lineno);
if (ret == DW_DLV_OK && inlines && cu != NULL &&
cu->srcfiles != NULL && f != NULL && f->inlined_caller != NULL)
Copied: projects/release-pkg/contrib/elftoolchain/addr2line/os.NetBSD.mk (from r295638, head/contrib/elftoolchain/addr2line/os.NetBSD.mk)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/release-pkg/contrib/elftoolchain/addr2line/os.NetBSD.mk Mon Feb 15 21:58:52 2016 (r295639, copy of r295638, head/contrib/elftoolchain/addr2line/os.NetBSD.mk)
@@ -0,0 +1,2 @@
+# TODO(#511): Revert after the source tree is -Wconversion clean.
+WARNS=5
Modified: projects/release-pkg/contrib/elftoolchain/ar/ar.c
==============================================================================
--- projects/release-pkg/contrib/elftoolchain/ar/ar.c Mon Feb 15 21:18:52 2016 (r295638)
+++ projects/release-pkg/contrib/elftoolchain/ar/ar.c Mon Feb 15 21:58:52 2016 (r295639)
@@ -72,7 +72,7 @@
#include "ar.h"
-ELFTC_VCSID("$Id: ar.c 3243 2015-08-31 19:28:45Z emaste $");
+ELFTC_VCSID("$Id: ar.c 3319 2016-01-13 21:37:53Z jkoshy $");
enum options
{
@@ -407,7 +407,7 @@ Usage: %s <command> [options] archive fi
-F FORMAT | --flavor=FORMAT\n\
Create archives with the specified format.\n\
-S Do not generate an archive symbol table.\n\
- -U Use original metadata, for unique archive checksums.\n"
+ -U Use original metadata for archive members.\n"
static void
bsdar_usage(void)
Modified: projects/release-pkg/contrib/elftoolchain/brandelf/brandelf.c
==============================================================================
--- projects/release-pkg/contrib/elftoolchain/brandelf/brandelf.c Mon Feb 15 21:18:52 2016 (r295638)
+++ projects/release-pkg/contrib/elftoolchain/brandelf/brandelf.c Mon Feb 15 21:58:52 2016 (r295639)
@@ -44,7 +44,7 @@
#include "_elftc.h"
-ELFTC_VCSID("$Id: brandelf.c 3234 2015-07-31 12:35:09Z emaste $");
+ELFTC_VCSID("$Id: brandelf.c 3354 2016-01-18 21:50:15Z jkoshy $");
static int elftype(const char *);
static const char *iselftype(int);
@@ -212,7 +212,7 @@ main(int argc, char **argv)
/*
* Update the ABI type.
*/
- ehdr.e_ident[EI_OSABI] = type;
+ ehdr.e_ident[EI_OSABI] = (unsigned char) type;
if (gelf_update_ehdr(elf, &ehdr) == 0) {
warnx("gelf_update_ehdr error: %s",
elf_errmsg(-1));
Modified: projects/release-pkg/contrib/elftoolchain/common/elfdefinitions.h
==============================================================================
--- projects/release-pkg/contrib/elftoolchain/common/elfdefinitions.h Mon Feb 15 21:18:52 2016 (r295638)
+++ projects/release-pkg/contrib/elftoolchain/common/elfdefinitions.h Mon Feb 15 21:58:52 2016 (r295639)
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: elfdefinitions.h 3253 2015-10-10 18:31:33Z kaiwang27 $
+ * $Id: elfdefinitions.h 3392 2016-02-05 19:51:22Z emaste $
*/
/*
@@ -1228,6 +1228,7 @@ _ELF_DEFINE_STB(STB_GLOBAL, 1,
_ELF_DEFINE_STB(STB_WEAK, 2, \
"visible across all object files but with low precedence") \
_ELF_DEFINE_STB(STB_LOOS, 10, "start of OS-specific range") \
+_ELF_DEFINE_STB(STB_GNU_UNIQUE, 10, "unique symbol (GNU)") \
_ELF_DEFINE_STB(STB_HIOS, 12, "end of OS-specific range") \
_ELF_DEFINE_STB(STB_LOPROC, 13, \
"start of processor-specific range") \
@@ -1259,6 +1260,7 @@ _ELF_DEFINE_STT(STT_LOPROC, 13,
"start of processor-specific types") \
_ELF_DEFINE_STT(STT_ARM_TFUNC, 13, "Thumb function (GNU)") \
_ELF_DEFINE_STT(STT_ARM_16BIT, 15, "Thumb label (GNU)") \
+_ELF_DEFINE_STT(STT_SPARC_REGISTER, 13, "SPARC register information") \
_ELF_DEFINE_STT(STT_HIPROC, 15, \
"end of processor-specific types")
@@ -1395,7 +1397,7 @@ _ELF_DEFINE_RELOC(R_386_GOT32, 3) \
_ELF_DEFINE_RELOC(R_386_PLT32, 4) \
_ELF_DEFINE_RELOC(R_386_COPY, 5) \
_ELF_DEFINE_RELOC(R_386_GLOB_DAT, 6) \
-_ELF_DEFINE_RELOC(R_386_JMP_SLOT, 7) \
+_ELF_DEFINE_RELOC(R_386_JUMP_SLOT, 7) \
_ELF_DEFINE_RELOC(R_386_RELATIVE, 8) \
_ELF_DEFINE_RELOC(R_386_GOTOFF, 9) \
_ELF_DEFINE_RELOC(R_386_GOTPC, 10) \
@@ -1407,9 +1409,129 @@ _ELF_DEFINE_RELOC(R_386_PC8, 23)
/*
*/
-#define _ELF_DEFINE_AARCH64_RELOCATIONS() \
-_ELF_DEFINE_RELOC(R_AARCH64_ABS64, 257) \
-_ELF_DEFINE_RELOC(R_AARCH64_ABS32, 258) \
+#define _ELF_DEFINE_AARCH64_RELOCATIONS() \
+_ELF_DEFINE_RELOC(R_AARCH64_NONE, 0) \
+_ELF_DEFINE_RELOC(R_AARCH64_ABS64, 257) \
+_ELF_DEFINE_RELOC(R_AARCH64_ABS32, 258) \
+_ELF_DEFINE_RELOC(R_AARCH64_ABS16, 259) \
+_ELF_DEFINE_RELOC(R_AARCH64_PREL64, 260) \
+_ELF_DEFINE_RELOC(R_AARCH64_PREL32, 261) \
+_ELF_DEFINE_RELOC(R_AARCH64_PREL16, 262) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G0, 263) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G0_NC, 264) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G1, 265) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G1_NC, 266) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G2, 267) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G2_NC, 268) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_UABS_G3, 269) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_SABS_G0, 270) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_SABS_G1, 271) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_SABS_G2, 272) \
+_ELF_DEFINE_RELOC(R_AARCH64_LD_PREL_LO19, 273) \
+_ELF_DEFINE_RELOC(R_AARCH64_ADR_PREL_LO21, 274) \
+_ELF_DEFINE_RELOC(R_AARCH64_ADR_PREL_PG_HI21, 275) \
+_ELF_DEFINE_RELOC(R_AARCH64_ADR_PREL_PG_HI21_NC, 276) \
+_ELF_DEFINE_RELOC(R_AARCH64_ADD_ABS_LO12_NC, 277) \
+_ELF_DEFINE_RELOC(R_AARCH64_LDST8_ABS_LO12_NC, 278) \
+_ELF_DEFINE_RELOC(R_AARCH64_TSTBR14, 279) \
+_ELF_DEFINE_RELOC(R_AARCH64_CONDBR19, 280) \
+_ELF_DEFINE_RELOC(R_AARCH64_JUMP26, 282) \
+_ELF_DEFINE_RELOC(R_AARCH64_CALL26, 283) \
+_ELF_DEFINE_RELOC(R_AARCH64_LDST16_ABS_LO12_NC, 284) \
+_ELF_DEFINE_RELOC(R_AARCH64_LDST32_ABS_LO12_NC, 285) \
+_ELF_DEFINE_RELOC(R_AARCH64_LDST64_ABS_LO12_NC, 286) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G0, 287) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G0_NC, 288) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G1, 289) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G1_NC, 290) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G2, 291) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G2_NC, 292) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_PREL_G3, 293) \
+_ELF_DEFINE_RELOC(R_AARCH64_LDST128_ABS_LO12_NC, 299) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G0, 300) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G0_NC, 301) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G1, 302) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G1_NC, 303) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G2, 304) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G2_NC, 305) \
+_ELF_DEFINE_RELOC(R_AARCH64_MOVW_GOTOFF_G3, 306) \
+_ELF_DEFINE_RELOC(R_AARCH64_GOTREL64, 307) \
+_ELF_DEFINE_RELOC(R_AARCH64_GOTREL32, 308) \
+_ELF_DEFINE_RELOC(R_AARCH64_GOT_LD_PREL19, 309) \
+_ELF_DEFINE_RELOC(R_AARCH64_LD64_GOTOFF_LO15, 310) \
+_ELF_DEFINE_RELOC(R_AARCH64_ADR_GOT_PAGE, 311) \
+_ELF_DEFINE_RELOC(R_AARCH64_LD64_GOT_LO12_NC, 312) \
+_ELF_DEFINE_RELOC(R_AARCH64_LD64_GOTPAGE_LO15, 313) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSGD_ADR_PREL21, 512) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSGD_ADR_PAGE21, 513) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSGD_ADD_LO12_NC, 514) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSGD_MOVW_G1, 515) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSGD_MOVW_G0_NC, 516) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_ADR_PREL21, 517) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_ADR_PAGE21, 518) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_ADD_LO12_NC, 519) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_G1, 520) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_G0_NC, 521) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LD_PREL19, 522) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G2, 523) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G1, 524) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, 525) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G0, 526) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, 527) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_ADD_DTPREL_HI12, 529) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, 530) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST8_DTPREL_LO12, 531) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, 532) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST16_DTPREL_LO12, 533) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, 534) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST32_DTPREL_LO12, 535) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, 536) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST64_DTPREL_LO12, 537) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, 538) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSIE_MOVW_GOTTPREL_G1, 539) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, 540) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, 541) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, 542) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSIE_LD_GOTTPREL_PREL19, 543) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G2, 544) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G1, 545) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G1_NC, 546) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G0, 547) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G0_NC, 548) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_ADD_TPREL_HI12, 549) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_ADD_TPREL_LO12, 550) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_ADD_TPREL_LO12_NC, 551) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST8_TPREL_LO12, 552) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, 553) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST16_TPREL_LO12, 554) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, 555) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST32_TPREL_LO12, 556) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, 557) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST64_TPREL_LO12, 558) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, 559) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_LD_PREL19, 560) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_ADR_PREL21, 561) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_ADR_PAGE21, 562) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_LD64_LO12, 563) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_ADD_LO12, 564) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_OFF_G1, 565) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_OFF_G0_NC, 566) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_LDR, 567) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_ADD, 568) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC_CALL, 569) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST128_TPREL_LO12, 570) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC, 571) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST128_DTPREL_LO12, 572) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC, 573) \
+_ELF_DEFINE_RELOC(R_AARCH64_COPY, 1024) \
+_ELF_DEFINE_RELOC(R_AARCH64_GLOB_DAT, 1025) \
+_ELF_DEFINE_RELOC(R_AARCH64_JUMP_SLOT, 1026) \
+_ELF_DEFINE_RELOC(R_AARCH64_RELATIVE, 1027) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLS_DTPREL64, 1028) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLS_DTPMOD64, 1029) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLS_TPREL64, 1030) \
+_ELF_DEFINE_RELOC(R_AARCH64_TLSDESC, 1031) \
+_ELF_DEFINE_RELOC(R_AARCH64_IRELATIVE, 1032)
/*
* These are the symbols used in the Sun ``Linkers and Loaders
@@ -1633,7 +1755,7 @@ _ELF_DEFINE_RELOC(R_IA_64_LTV32MSB, 0x7
_ELF_DEFINE_RELOC(R_IA_64_LTV32LSB, 0x75) \
_ELF_DEFINE_RELOC(R_IA_64_LTV64MSB, 0x76) \
_ELF_DEFINE_RELOC(R_IA_64_LTV64LSB, 0x77) \
-_ELF_DEFINE_RELOC(R_IA_64_PCREL21BIa, 0x79) \
+_ELF_DEFINE_RELOC(R_IA_64_PCREL21BI, 0x79) \
_ELF_DEFINE_RELOC(R_IA_64_PCREL22, 0x7A) \
_ELF_DEFINE_RELOC(R_IA_64_PCREL64I, 0x7B) \
_ELF_DEFINE_RELOC(R_IA_64_IPLTMSB, 0x80) \
@@ -1723,7 +1845,7 @@ _ELF_DEFINE_RELOC(R_PPC_REL32, 26) \
_ELF_DEFINE_RELOC(R_PPC_PLT32, 27) \
_ELF_DEFINE_RELOC(R_PPC_PLTREL32, 28) \
_ELF_DEFINE_RELOC(R_PPC_PLT16_LO, 29) \
-_ELF_DEFINE_RELOC(R_PPL_PLT16_HI, 30) \
+_ELF_DEFINE_RELOC(R_PPC_PLT16_HI, 30) \
_ELF_DEFINE_RELOC(R_PPC_PLT16_HA, 31) \
_ELF_DEFINE_RELOC(R_PPC_SDAREL16, 32) \
_ELF_DEFINE_RELOC(R_PPC_SECTOFF, 33) \
@@ -1926,7 +2048,7 @@ _ELF_DEFINE_RELOC(R_RISCV_SUB32, 39) \
_ELF_DEFINE_RELOC(R_RISCV_SUB64, 40) \
_ELF_DEFINE_RELOC(R_RISCV_GNU_VTINHERIT, 41) \
_ELF_DEFINE_RELOC(R_RISCV_GNU_VTENTRY, 42) \
-_ELF_DEFINE_RELOC(R_RISCV_ALIGN 43) \
+_ELF_DEFINE_RELOC(R_RISCV_ALIGN, 43) \
_ELF_DEFINE_RELOC(R_RISCV_RVC_BRANCH, 44) \
_ELF_DEFINE_RELOC(R_RISCV_RVC_JUMP, 45)
@@ -2042,6 +2164,7 @@ _ELF_DEFINE_IA64_RELOCATIONS() \
_ELF_DEFINE_MIPS_RELOCATIONS() \
_ELF_DEFINE_PPC32_RELOCATIONS() \
_ELF_DEFINE_PPC64_RELOCATIONS() \
+_ELF_DEFINE_RISCV_RELOCATIONS() \
_ELF_DEFINE_SPARC_RELOCATIONS() \
_ELF_DEFINE_X86_64_RELOCATIONS()
Modified: projects/release-pkg/contrib/elftoolchain/common/native-elf-format
==============================================================================
--- projects/release-pkg/contrib/elftoolchain/common/native-elf-format Mon Feb 15 21:18:52 2016 (r295638)
+++ projects/release-pkg/contrib/elftoolchain/common/native-elf-format Mon Feb 15 21:58:52 2016 (r295639)
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $Id: native-elf-format 3186 2015-04-16 22:16:40Z emaste $
+# $Id: native-elf-format 3293 2016-01-07 19:26:27Z emaste $
#
# Find the native ELF format for a host platform by compiling a
# test object and examining the resulting object.
@@ -33,6 +33,8 @@ $1 ~ "Data:" {
$1 ~ "Machine:" {
if (match($0, "Intel.*386")) {
elfarch = "EM_386";
+ } else if (match($0, "MIPS")) {
+ elfarch = "EM_MIPS";
} else if (match($0, ".*[xX]86-64")) {
elfarch = "EM_X86_64";
} else {
Modified: projects/release-pkg/contrib/elftoolchain/cxxfilt/cxxfilt.c
==============================================================================
--- projects/release-pkg/contrib/elftoolchain/cxxfilt/cxxfilt.c Mon Feb 15 21:18:52 2016 (r295638)
+++ projects/release-pkg/contrib/elftoolchain/cxxfilt/cxxfilt.c Mon Feb 15 21:58:52 2016 (r295639)
@@ -35,7 +35,7 @@
#include "_elftc.h"
-ELFTC_VCSID("$Id: cxxfilt.c 3174 2015-03-27 17:13:41Z emaste $");
+ELFTC_VCSID("$Id: cxxfilt.c 3356 2016-01-22 22:31:38Z jkoshy $");
#define STRBUFSZ 8192
@@ -112,11 +112,11 @@ find_format(const char *fstr)
}
static char *
-demangle(char *name, int strict, int *pos)
+demangle(char *name, int strict, size_t *pos)
{
static char dem[STRBUFSZ];
char nb[STRBUFSZ];
- int p, t;
+ size_t p, t;
if (stripus && *name == '_') {
strncpy(nb, name + 1, sizeof(nb) - 1);
@@ -128,10 +128,10 @@ demangle(char *name, int strict, int *po
nb[sizeof(nb) - 1] = '\0';
p = strlen(nb);
- if (p <= 0)
+ if (p == 0)
return NULL;
- while (elftc_demangle(nb, dem, sizeof(dem), format) < 0) {
+ while (elftc_demangle(nb, dem, sizeof(dem), (unsigned) format) < 0) {
if (!strict && p > 1) {
nb[--p] = '\0';
continue;
@@ -149,7 +149,8 @@ int
main(int argc, char **argv)
{
char *dem, buf[STRBUFSZ];
- int c, i, p, s, opt;
+ size_t i, p, s;
+ int c, n, opt;
while ((opt = getopt_long(argc, argv, "_nps:V", longopts, NULL)) !=
-1) {
@@ -182,9 +183,9 @@ main(int argc, char **argv)
argc -= optind;
if (*argv != NULL) {
- for (i = 0; i < argc; i++) {
- if ((dem = demangle(argv[i], 1, NULL)) == NULL)
- fprintf(stderr, "Failed: %s\n", argv[i]);
+ for (n = 0; n < argc; n++) {
+ if ((dem = demangle(argv[n], 1, NULL)) == NULL)
+ fprintf(stderr, "Failed: %s\n", argv[n]);
else
printf("%s\n", dem);
}
@@ -213,7 +214,7 @@ main(int argc, char **argv)
if ((size_t) p >= sizeof(buf) - 1)
warnx("buffer overflowed");
else
- buf[p++] = c;
+ buf[p++] = (char) c;
}
}
Modified: projects/release-pkg/contrib/elftoolchain/elfcopy/Makefile
==============================================================================
--- projects/release-pkg/contrib/elftoolchain/elfcopy/Makefile Mon Feb 15 21:18:52 2016 (r295638)
+++ projects/release-pkg/contrib/elftoolchain/elfcopy/Makefile Mon Feb 15 21:58:52 2016 (r295639)
@@ -1,10 +1,13 @@
-# $Id: Makefile 2290 2011-12-04 07:20:46Z jkoshy $
+# $Id: Makefile 3381 2016-01-30 19:39:47Z jkoshy $
TOP= ..
+.include "${TOP}/mk/elftoolchain.components.mk"
+
PROG= elfcopy
-SRCS= archive.c ascii.c binary.c main.c sections.c segments.c symbols.c
+SRCS= archive.c ascii.c binary.c main.c sections.c segments.c \
+ symbols.c
WARNS?= 5
@@ -15,14 +18,24 @@ LDADD= -lelf -lelftc
LDADD+= -larchive
.endif
+.if defined(WITH_PE) && ${WITH_PE:tl} == "yes"
+SRCS+= pe.c
+CFLAGS+= -DWITH_PE=1
+
+DPADD+= ${LIBPE}
+LDADD+= -lpe
+.endif
+
MAN= elfcopy.1 mcs.1 strip.1
+MLINKS= elfcopy.1 objcopy.1
NO_SHARED?= yes
-LINKS= ${BINDIR}/elfcopy ${BINDIR}/strip \
- ${BINDIR}/elfcopy ${BINDIR}/mcs
+LINKS= ${BINDIR}/elfcopy ${BINDIR}/mcs \
+ ${BINDIR}/elfcopy ${BINDIR}/objcopy \
+ ${BINDIR}/elfcopy ${BINDIR}/strip
-EXTRA_TARGETS= strip mcs
+EXTRA_TARGETS= mcs strip objcopy
CLEANFILES+= ${EXTRA_TARGETS}
Modified: projects/release-pkg/contrib/elftoolchain/elfcopy/archive.c
==============================================================================
--- projects/release-pkg/contrib/elftoolchain/elfcopy/archive.c Mon Feb 15 21:18:52 2016 (r295638)
+++ projects/release-pkg/contrib/elftoolchain/elfcopy/archive.c Mon Feb 15 21:58:52 2016 (r295639)
@@ -38,7 +38,7 @@
#include "elfcopy.h"
-ELFTC_VCSID("$Id: archive.c 3174 2015-03-27 17:13:41Z emaste $");
+ELFTC_VCSID("$Id: archive.c 3287 2015-12-31 16:58:48Z emaste $");
#define _ARMAG_LEN 8 /* length of ar magic string */
#define _ARHDR_LEN 60 /* length of ar header */
@@ -382,7 +382,7 @@ ac_read_objs(struct elfcopy *ecp, int if
if (lseek(ifd, 0, SEEK_SET) == -1)
err(EXIT_FAILURE, "lseek failed");
if ((a = archive_read_new()) == NULL)
- errx(EXIT_FAILURE, "%s", archive_error_string(a));
+ errx(EXIT_FAILURE, "archive_read_new failed");
archive_read_support_format_ar(a);
AC(archive_read_open_fd(a, ifd, 10240));
for(;;) {
@@ -443,7 +443,7 @@ ac_write_objs(struct elfcopy *ecp, int o
int nr;
if ((a = archive_write_new()) == NULL)
- errx(EXIT_FAILURE, "%s", archive_error_string(a));
+ errx(EXIT_FAILURE, "archive_write_new failed");
archive_write_set_format_ar_svr4(a);
AC(archive_write_open_fd(a, ofd));
Modified: projects/release-pkg/contrib/elftoolchain/elfcopy/elfcopy.1
==============================================================================
--- projects/release-pkg/contrib/elftoolchain/elfcopy/elfcopy.1 Mon Feb 15 21:18:52 2016 (r295638)
+++ projects/release-pkg/contrib/elftoolchain/elfcopy/elfcopy.1 Mon Feb 15 21:58:52 2016 (r295639)
@@ -21,13 +21,14 @@
.\" out of the use of this software, even if advised of the possibility of
.\" such damage.
.\"
-.\" $Id: elfcopy.1 3266 2015-12-07 15:38:26Z emaste $
+.\" $Id: elfcopy.1 3381 2016-01-30 19:39:47Z jkoshy $
.\"
-.Dd December 7, 2015
+.Dd January 29, 2016
.Os
.Dt ELFCOPY 1
.Sh NAME
-.Nm elfcopy
+.Nm elfcopy ,
+.Nm objcopy
.Nd copy and translate object files
.Sh SYNOPSIS
.Nm
@@ -85,7 +86,7 @@
.Sh DESCRIPTION
The
.Nm
-utility copies the content of the ELF object named by argument
+utility copies the content of the binary object named by argument
.Ar infile
to that named by argument
.Ar outfile ,
@@ -121,6 +122,10 @@ to the output.
.It Fl O Ar objformat | Fl -output-target= Ns Ar objformat
Write the output file using the object format specified in argument
.Ar objformat .
+The argument
+.Ar objformat
+should be one of the target names recognized by
+.Xr elftc_bfd_find_target 3 .
.It Fl R Ar sectionname | Fl -remove-section= Ns Ar sectionname
Remove any section with name
.Ar sectionname
@@ -330,8 +335,14 @@ Do not copy symbols that are not needed
.Xr mcs 1 ,
.Xr strip 1 ,
.Xr elf 3 ,
+.Xr elftc_bfd_find_target 3 ,
.Xr ar 5 ,
.Xr elf 5
+.Sh COMPATIBILITY
+The
+.Nm
+utility is expected to be option compatible with GNU
+.Nm objcopy .
.Sh HISTORY
.Nm
has been implemented by
Modified: projects/release-pkg/contrib/elftoolchain/elfcopy/elfcopy.h
==============================================================================
--- projects/release-pkg/contrib/elftoolchain/elfcopy/elfcopy.h Mon Feb 15 21:18:52 2016 (r295638)
+++ projects/release-pkg/contrib/elftoolchain/elfcopy/elfcopy.h Mon Feb 15 21:58:52 2016 (r295639)
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: elfcopy.h 3221 2015-05-24 23:42:43Z kaiwang27 $
+ * $Id: elfcopy.h 3310 2016-01-10 09:10:54Z kaiwang27 $
*/
#include <sys/queue.h>
@@ -287,6 +287,7 @@ struct section *create_external_section(
int _loadable);
void create_external_symtab(struct elfcopy *_ecp);
void create_ihex(int _ifd, int _ofd);
+void create_pe(struct elfcopy *_ecp, int _ifd, int _ofd);
void create_scn(struct elfcopy *_ecp);
void create_srec(struct elfcopy *_ecp, int _ifd, int _ofd, const char *_ofn);
void create_symtab(struct elfcopy *_ecp);
Modified: projects/release-pkg/contrib/elftoolchain/elfcopy/main.c
==============================================================================
--- projects/release-pkg/contrib/elftoolchain/elfcopy/main.c Mon Feb 15 21:18:52 2016 (r295638)
+++ projects/release-pkg/contrib/elftoolchain/elfcopy/main.c Mon Feb 15 21:58:52 2016 (r295639)
@@ -39,7 +39,7 @@
#include "elfcopy.h"
-ELFTC_VCSID("$Id: main.c 3268 2015-12-07 20:30:55Z emaste $");
+ELFTC_VCSID("$Id: main.c 3399 2016-02-12 18:07:56Z emaste $");
enum options
{
@@ -316,6 +316,7 @@ create_elf(struct elfcopy *ecp)
oeh.e_entry = ieh.e_entry;
oeh.e_version = ieh.e_version;
+ ecp->flags &= ~(EXECUTABLE | DYNAMIC | RELOCATABLE);
if (ieh.e_type == ET_EXEC)
ecp->flags |= EXECUTABLE;
else if (ieh.e_type == ET_DYN)
@@ -722,6 +723,15 @@ create_file(struct elfcopy *ecp, const c
create_srec(ecp, ofd, ofd0,
dst != NULL ? dst : src);
break;
+ case ETF_PE:
+ case ETF_EFI:
+#if WITH_PE
+ create_pe(ecp, ofd, ofd0);
+#else
+ errx(EXIT_FAILURE, "PE/EFI support not enabled"
+ " at compile time");
+#endif
+ break;
default:
errx(EXIT_FAILURE, "Internal: unsupported"
" output flavour %d", ecp->oec);
@@ -1345,6 +1355,9 @@ set_output_target(struct elfcopy *ecp, c
ecp->oed = elftc_bfd_target_byteorder(tgt);
ecp->oem = elftc_bfd_target_machine(tgt);
}
+ if (ecp->otf == ETF_EFI || ecp->otf == ETF_PE)
+ ecp->oem = elftc_bfd_target_machine(tgt);
+
ecp->otgt = target_name;
}
@@ -1366,7 +1379,7 @@ set_osabi(struct elfcopy *ecp, const cha
#define ELFCOPY_USAGE_MESSAGE "\
Usage: %s [options] infile [outfile]\n\
- Transform an ELF object.\n\n\
+ Transform object files.\n\n\
Options:\n\
-d | -g | --strip-debug Remove debugging information from the output.\n\
-j SECTION | --only-section=SECTION\n\
@@ -1382,6 +1395,8 @@ Usage: %s [options] infile [outfile]\n\
-N SYM | --strip-symbol=SYM Do not copy symbol SYM to the output.\n\
-O FORMAT | --output-target=FORMAT\n\
Specify object format for the output file.\n\
+ FORMAT should be a target name understood by\n\
+ elftc_bfd_find_target(3).\n\
-R NAME | --remove-section=NAME\n\
Remove the named section.\n\
-S | --strip-all Remove all symbol and relocation information\n\
@@ -1471,6 +1486,7 @@ Usage: %s [options] file...\n\
Options:\n\
-d | -g | -S | --strip-debug Remove debugging symbols.\n\
-h | --help Print a help message.\n\
+ -o FILE | --output-file FILE Write output to FILE.\n\
--only-keep-debug Keep debugging information only.\n\
-p | --preserve-dates Preserve access and modification times.\n\
-s | --strip-all Remove all symbols.\n\
Copied: projects/release-pkg/contrib/elftoolchain/elfcopy/pe.c (from r295638, head/contrib/elftoolchain/elfcopy/pe.c)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/release-pkg/contrib/elftoolchain/elfcopy/pe.c Mon Feb 15 21:58:52 2016 (r295639, copy of r295638, head/contrib/elftoolchain/elfcopy/pe.c)
@@ -0,0 +1,233 @@
+/*-
+ * Copyright (c) 2016 Kai Wang
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/param.h>
+#include <err.h>
+#include <gelf.h>
+#include <libpe.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#include "elfcopy.h"
+
+ELFTC_VCSID("$Id: pe.c 3312 2016-01-10 09:23:51Z kaiwang27 $");
+
+/* Convert ELF object to Portable Executable (PE). */
+void
+create_pe(struct elfcopy *ecp, int ifd, int ofd)
+{
+ Elf *e;
+ Elf_Scn *scn;
+ Elf_Data *d;
+ GElf_Ehdr eh;
+ GElf_Shdr sh;
+ PE *pe;
+ PE_Scn *ps;
+ PE_SecHdr psh;
+ PE_CoffHdr pch;
+ PE_OptHdr poh;
+ PE_Object po;
+ PE_Buffer *pb;
+ const char *name;
+ size_t indx;
+ int elferr, i;
+
+ if (ecp->otf == ETF_EFI || ecp->oem == EM_X86_64)
+ po = PE_O_PE32P;
+ else
+ po = PE_O_PE32;
+
+ if ((e = elf_begin(ifd, ELF_C_READ, NULL)) == NULL)
+ errx(EXIT_FAILURE, "elf_begin() failed: %s",
+ elf_errmsg(-1));
+
+ if (gelf_getehdr(e, &eh) == NULL)
+ errx(EXIT_FAILURE, "gelf_getehdr() failed: %s",
+ elf_errmsg(-1));
+
+ if (elf_getshstrndx(ecp->ein, &indx) == 0)
+ errx(EXIT_FAILURE, "elf_getshstrndx() failed: %s",
+ elf_errmsg(-1));
+
+ if ((pe = pe_init(ofd, PE_C_WRITE, po)) == NULL)
+ err(EXIT_FAILURE, "pe_init() failed");
+
+ /* Setup PE COFF header. */
+ memset(&pch, 0, sizeof(pch));
+ switch (ecp->oem) {
+ case EM_386:
+ pch.ch_machine = IMAGE_FILE_MACHINE_I386;
+ break;
+ case EM_X86_64:
+ pch.ch_machine = IMAGE_FILE_MACHINE_AMD64;
+ break;
+ default:
+ pch.ch_machine = IMAGE_FILE_MACHINE_UNKNOWN;
+ break;
+ }
+ pch.ch_timestamp = (uint32_t) time(NULL);
+ if (pe_update_coff_header(pe, &pch) < 0)
+ err(EXIT_FAILURE, "pe_update_coff_header() failed");
+
+ /* Setup PE optional header. */
+ memset(&poh, 0, sizeof(poh));
+ if (ecp->otf == ETF_EFI)
+ poh.oh_subsystem = IMAGE_SUBSYSTEM_EFI_APPLICATION;
+ poh.oh_entry = (uint32_t) eh.e_entry;
+
+ /*
+ * Default section alignment and file alignment. (Here the
+ * section alignment is set to the default page size of the
+ * archs supported. We should use different section alignment
+ * for some arch. (e.g. IA64)
+ */
+ poh.oh_secalign = 0x1000;
+ poh.oh_filealign = 0x200;
+
+ /* Copy sections. */
+ scn = NULL;
+ while ((scn = elf_nextscn(e, scn)) != NULL) {
+
+ /*
+ * Read in ELF section.
+ */
+
+ if (gelf_getshdr(scn, &sh) == NULL) {
+ warnx("gelf_getshdr() failed: %s", elf_errmsg(-1));
+ (void) elf_errno();
+ continue;
+ }
+ if ((name = elf_strptr(ecp->ein, indx, sh.sh_name)) ==
+ NULL) {
+ warnx("elf_strptr() failed: %s", elf_errmsg(-1));
+ (void) elf_errno();
+ continue;
+ }
+
+ /* Skip sections unneeded. */
+ if (strcmp(name, ".shstrtab") == 0 ||
+ strcmp(name, ".symtab") == 0 ||
+ strcmp(name, ".strtab") == 0)
+ continue;
+
+ if ((d = elf_getdata(scn, NULL)) == NULL) {
+ warnx("elf_getdata() failed: %s", elf_errmsg(-1));
+ (void) elf_errno();
+ continue;
+ }
+
+ if (strcmp(name, ".text") == 0) {
+ poh.oh_textbase = (uint32_t) sh.sh_addr;
+ poh.oh_textsize = (uint32_t) roundup(sh.sh_size,
+ poh.oh_filealign);
+ } else {
+ if (po == PE_O_PE32 && strcmp(name, ".data") == 0)
+ poh.oh_database = sh.sh_addr;
+ if (sh.sh_type == SHT_NOBITS)
+ poh.oh_bsssize += (uint32_t)
+ roundup(sh.sh_size, poh.oh_filealign);
+ else if (sh.sh_flags & SHF_ALLOC)
+ poh.oh_datasize += (uint32_t)
+ roundup(sh.sh_size, poh.oh_filealign);
+ }
+
+ /*
+ * Create PE/COFF section.
+ */
+
+ if ((ps = pe_newscn(pe)) == NULL) {
+ warn("pe_newscn() failed");
+ continue;
+ }
+
+ /*
+ * Setup PE/COFF section header. The section name is not
+ * NUL-terminated if its length happens to be 8. Long
+ * section name should be truncated for PE image according
+ * to the PE/COFF specification.
+ */
+ memset(&psh, 0, sizeof(psh));
+ strncpy(psh.sh_name, name, sizeof(psh.sh_name));
+ psh.sh_addr = sh.sh_addr;
+ psh.sh_virtsize = sh.sh_size;
+ if (sh.sh_type != SHT_NOBITS)
+ psh.sh_rawsize = sh.sh_size;
+ else
+ psh.sh_char |= IMAGE_SCN_CNT_UNINITIALIZED_DATA;
+
+ /*
+ * Translate ELF section flags to PE/COFF section flags.
+ */
+ psh.sh_char |= IMAGE_SCN_MEM_READ;
+ if (sh.sh_flags & SHF_WRITE)
+ psh.sh_char |= IMAGE_SCN_MEM_WRITE;
+ if (sh.sh_flags & SHF_EXECINSTR)
+ psh.sh_char |= IMAGE_SCN_MEM_EXECUTE |
+ IMAGE_SCN_CNT_CODE;
+ if ((sh.sh_flags & SHF_ALLOC) && (psh.sh_char & 0xF0) == 0)
+ psh.sh_char |= IMAGE_SCN_CNT_INITIALIZED_DATA;
+ for (i = 0xE; i > 0; i--) {
+ if (sh.sh_addralign & (1U << (i - 1))) {
+ psh.sh_char |= i << 20;
+ break;
+ }
+ }
+
+ /* Mark relocation section "discardable". */
+ if (strcmp(name, ".reloc") == 0)
+ psh.sh_char |= IMAGE_SCN_MEM_DISCARDABLE;
+
+ if (pe_update_section_header(ps, &psh) < 0) {
+ warn("pe_update_section_header() failed");
+ continue;
+ }
+
+ /* Copy section content. */
+ if ((pb = pe_newbuffer(ps)) == NULL) {
+ warn("pe_newbuffer() failed");
+ continue;
+ }
+ pb->pb_align = 1;
+ pb->pb_off = 0;
+ pb->pb_size = sh.sh_size;
+ pb->pb_buf = d->d_buf;
+ }
+ elferr = elf_errno();
+ if (elferr != 0)
+ warnx("elf_nextscn() failed: %s", elf_errmsg(elferr));
+
+ /* Update PE optional header. */
+ if (pe_update_opt_header(pe, &poh) < 0)
+ err(EXIT_FAILURE, "pe_update_opt_header() failed");
+
+ /* Write out PE/COFF object. */
+ if (pe_update(pe) < 0)
+ err(EXIT_FAILURE, "pe_update() failed");
+
+ pe_finish(pe);
+ elf_end(e);
+}
Modified: projects/release-pkg/contrib/elftoolchain/elfcopy/sections.c
==============================================================================
--- projects/release-pkg/contrib/elftoolchain/elfcopy/sections.c Mon Feb 15 21:18:52 2016 (r295638)
+++ projects/release-pkg/contrib/elftoolchain/elfcopy/sections.c Mon Feb 15 21:58:52 2016 (r295639)
@@ -34,7 +34,7 @@
#include "elfcopy.h"
-ELFTC_VCSID("$Id: sections.c 3272 2015-12-11 20:00:54Z kaiwang27 $");
+ELFTC_VCSID("$Id: sections.c 3346 2016-01-17 20:09:15Z kaiwang27 $");
static void add_gnu_debuglink(struct elfcopy *ecp);
static uint32_t calc_crc32(const char *p, size_t len, uint32_t crc);
@@ -223,6 +223,7 @@ static int
is_debug_section(const char *name)
{
const char *dbg_sec[] = {
+ ".apple_",
".debug",
".gnu.linkonce.wi.",
".line",
@@ -369,7 +370,7 @@ create_scn(struct elfcopy *ecp)
is = NULL;
while ((is = elf_nextscn(ecp->ein, is)) != NULL) {
if (gelf_getshdr(is, &ish) == NULL)
- errx(EXIT_FAILURE, "219 gelf_getshdr failed: %s",
+ errx(EXIT_FAILURE, "gelf_getshdr failed: %s",
elf_errmsg(-1));
if ((name = elf_strptr(ecp->ein, indx, ish.sh_name)) == NULL)
errx(EXIT_FAILURE, "elf_strptr failed: %s",
@@ -416,12 +417,19 @@ create_scn(struct elfcopy *ecp)
* is loadable, but if user explicitly set section flags
* while neither "load" nor "alloc" is set, we make the
* section unloadable.
+ *
+ * Sections in relocatable object is loadable if
+ * section flag SHF_ALLOC is set.
*/
if (sec_flags &&
(sec_flags & (SF_LOAD | SF_ALLOC)) == 0)
s->loadable = 0;
- else
+ else {
s->loadable = add_to_inseg_list(ecp, s);
+ if ((ecp->flags & RELOCATABLE) &&
+ (ish.sh_flags & SHF_ALLOC))
+ s->loadable = 1;
+ }
} else {
/* Assuming .shstrtab is "unloadable". */
s = ecp->shstrtab;
@@ -875,10 +883,10 @@ resync_sections(struct elfcopy *ecp)
if (s->align == 0)
s->align = 1;
if (off <= s->off) {
- if (!s->loadable)
+ if (!s->loadable || (ecp->flags & RELOCATABLE))
s->off = roundup(off, s->align);
} else {
- if (s->loadable)
+ if (s->loadable && (ecp->flags & RELOCATABLE) == 0)
warnx("moving loadable section %s, "
"is this intentional?", s->name);
s->off = roundup(off, s->align);
@@ -1028,8 +1036,11 @@ print_section(struct section *s)
print_data(s->buf, s->sz);
} else {
id = NULL;
- while ((id = elf_getdata(s->is, id)) != NULL)
+ while ((id = elf_getdata(s->is, id)) != NULL ||
+ (id = elf_rawdata(s->is, id)) != NULL) {
+ (void) elf_errno();
print_data(id->d_buf, id->d_size);
+ }
elferr = elf_errno();
if (elferr != 0)
errx(EXIT_FAILURE, "elf_getdata() failed: %s",
@@ -1049,7 +1060,9 @@ read_section(struct section *s, size_t *
sz = 0;
b = NULL;
id = NULL;
- while ((id = elf_getdata(s->is, id)) != NULL) {
+ while ((id = elf_getdata(s->is, id)) != NULL ||
+ (id = elf_rawdata(s->is, id)) != NULL) {
+ (void) elf_errno();
if (b == NULL)
b = malloc(id->d_size);
else
@@ -1077,10 +1090,10 @@ copy_shdr(struct elfcopy *ecp, struct se
GElf_Shdr ish, osh;
if (gelf_getshdr(s->is, &ish) == NULL)
- errx(EXIT_FAILURE, "526 gelf_getshdr() failed: %s",
+ errx(EXIT_FAILURE, "gelf_getshdr() failed: %s",
elf_errmsg(-1));
if (gelf_getshdr(s->os, &osh) == NULL)
- errx(EXIT_FAILURE, "529 gelf_getshdr() failed: %s",
+ errx(EXIT_FAILURE, "gelf_getshdr() failed: %s",
elf_errmsg(-1));
if (copy)
@@ -1097,19 +1110,32 @@ copy_shdr(struct elfcopy *ecp, struct se
if (sec_flags) {
osh.sh_flags = 0;
- if (sec_flags & SF_ALLOC) {
+ if (sec_flags & SF_ALLOC)
osh.sh_flags |= SHF_ALLOC;
- if (!s->loadable)
- warnx("set SHF_ALLOC flag for "
- "unloadable section %s",
- s->name);
- }
if ((sec_flags & SF_READONLY) == 0)
osh.sh_flags |= SHF_WRITE;
if (sec_flags & SF_CODE)
osh.sh_flags |= SHF_EXECINSTR;
+ if ((sec_flags & SF_CONTENTS) &&
+ s->type == SHT_NOBITS && s->sz > 0) {
+ /*
+ * Convert SHT_NOBITS section to section with
+ * (zero'ed) content on file.
+ */
+ osh.sh_type = s->type = SHT_PROGBITS;
+ if ((s->buf = calloc(1, s->sz)) == NULL)
+ err(EXIT_FAILURE, "malloc failed");
+ s->nocopy = 1;
+ }
} else {
osh.sh_flags = ish.sh_flags;
+ /*
+ * Newer binutils as(1) emits the section flag
+ * SHF_INFO_LINK for relocation sections. elfcopy
+ * emits this flag in the output section if it's
+ * missing in the input section, to remain compatible
+ * with binutils.
+ */
if (ish.sh_type == SHT_REL || ish.sh_type == SHT_RELA)
osh.sh_flags |= SHF_INFO_LINK;
}
@@ -1135,11 +1161,14 @@ copy_data(struct section *s)
return;
if ((id = elf_getdata(s->is, NULL)) == NULL) {
- elferr = elf_errno();
- if (elferr != 0)
- errx(EXIT_FAILURE, "elf_getdata() failed: %s",
- elf_errmsg(elferr));
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-projects
mailing list