Merge from HEAD
This commit is contained in:
@@ -166,10 +166,10 @@ _MAKE= PATH=${PATH} ${SUB_MAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=$
|
|||||||
|
|
||||||
# Guess machine architecture from machine type, and vice versa.
|
# Guess machine architecture from machine type, and vice versa.
|
||||||
.if !defined(TARGET_ARCH) && defined(TARGET)
|
.if !defined(TARGET_ARCH) && defined(TARGET)
|
||||||
_TARGET_ARCH= ${TARGET:S/pc98/i386/}
|
_TARGET_ARCH= ${TARGET:S/pc98/i386/:S/arm64/aarch64/}
|
||||||
.elif !defined(TARGET) && defined(TARGET_ARCH) && \
|
.elif !defined(TARGET) && defined(TARGET_ARCH) && \
|
||||||
${TARGET_ARCH} != ${MACHINE_ARCH}
|
${TARGET_ARCH} != ${MACHINE_ARCH}
|
||||||
_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/}
|
_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/aarch64/arm64/:C/powerpc64/powerpc/}
|
||||||
.endif
|
.endif
|
||||||
.if defined(TARGET) && !defined(_TARGET)
|
.if defined(TARGET) && !defined(_TARGET)
|
||||||
_TARGET=${TARGET}
|
_TARGET=${TARGET}
|
||||||
|
|||||||
+30
-12
@@ -164,7 +164,7 @@ EXTRA_REVISION= _${BRANCH:C/.*-p([0-9]+$)/\1/}
|
|||||||
PKG_VERSION= ${REVISION}${EXTRA_REVISION}
|
PKG_VERSION= ${REVISION}${EXTRA_REVISION}
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
KNOWN_ARCHES?= amd64 arm armeb/arm armv6/arm armv6hf/arm i386 i386/pc98 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64
|
KNOWN_ARCHES?= aarch64/arm64 amd64 arm armeb/arm armv6/arm armv6hf/arm i386 i386/pc98 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64
|
||||||
.if ${TARGET} == ${TARGET_ARCH}
|
.if ${TARGET} == ${TARGET_ARCH}
|
||||||
_t= ${TARGET}
|
_t= ${TARGET}
|
||||||
.else
|
.else
|
||||||
@@ -224,7 +224,9 @@ INSTALLTMP!= /usr/bin/mktemp -d -u -t install
|
|||||||
# 1. legacy stage [BMAKE]
|
# 1. legacy stage [BMAKE]
|
||||||
# This stage is responsible for creating compatibility
|
# This stage is responsible for creating compatibility
|
||||||
# shims that are needed by the bootstrap-tools,
|
# shims that are needed by the bootstrap-tools,
|
||||||
# build-tools and cross-tools stages.
|
# build-tools and cross-tools stages. These are generally
|
||||||
|
# APIs that tools from one of those three stages need to
|
||||||
|
# build that aren't present on the host.
|
||||||
# 1. bootstrap-tools stage [BMAKE]
|
# 1. bootstrap-tools stage [BMAKE]
|
||||||
# This stage is responsible for creating programs that
|
# This stage is responsible for creating programs that
|
||||||
# are needed for backward compatibility reasons. They
|
# are needed for backward compatibility reasons. They
|
||||||
@@ -235,7 +237,7 @@ INSTALLTMP!= /usr/bin/mktemp -d -u -t install
|
|||||||
# the build process.
|
# the build process.
|
||||||
# 3. cross-tools stage [XMAKE]
|
# 3. cross-tools stage [XMAKE]
|
||||||
# This stage is responsible for creating any tools that
|
# This stage is responsible for creating any tools that
|
||||||
# are needed for cross-builds. A cross-compiler is one
|
# are needed for building the system. A cross-compiler is one
|
||||||
# of them.
|
# of them.
|
||||||
# 4. world stage [WMAKE]
|
# 4. world stage [WMAKE]
|
||||||
# This stage actually builds the world.
|
# This stage actually builds the world.
|
||||||
@@ -274,7 +276,8 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \
|
|||||||
-DNO_PIC MK_PROFILE=no -DNO_SHARED \
|
-DNO_PIC MK_PROFILE=no -DNO_SHARED \
|
||||||
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
|
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
|
||||||
MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
|
MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
|
||||||
MK_LLDB=no MK_TESTS=no
|
MK_LLDB=no MK_TESTS=no \
|
||||||
|
MK_INCLUDES=yes
|
||||||
|
|
||||||
# build-tools stage
|
# build-tools stage
|
||||||
TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \
|
TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \
|
||||||
@@ -356,7 +359,8 @@ X${COMPILER}?= ${${COMPILER}}
|
|||||||
.endfor
|
.endfor
|
||||||
XBINUTILS= AS AR LD NM OBJCOPY OBJDUMP RANLIB SIZE STRINGS
|
XBINUTILS= AS AR LD NM OBJCOPY OBJDUMP RANLIB SIZE STRINGS
|
||||||
.for BINUTIL in ${XBINUTILS}
|
.for BINUTIL in ${XBINUTILS}
|
||||||
.if defined(CROSS_BINUTILS_PREFIX)
|
.if defined(CROSS_BINUTILS_PREFIX) && \
|
||||||
|
exists(${CROSS_BINUTILS_PREFIX}${${BINUTIL}})
|
||||||
X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX}${${BINUTIL}}
|
X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX}${${BINUTIL}}
|
||||||
.else
|
.else
|
||||||
X${BINUTIL}?= ${${BINUTIL}}
|
X${BINUTIL}?= ${${BINUTIL}}
|
||||||
@@ -396,9 +400,9 @@ DEPFLAGS+= -I${WORLDTMP}/usr/include/c++/v1
|
|||||||
TARGET_ABI?= unknown
|
TARGET_ABI?= unknown
|
||||||
TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0
|
TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0
|
||||||
XCFLAGS+= -target ${TARGET_TRIPLE}
|
XCFLAGS+= -target ${TARGET_TRIPLE}
|
||||||
|
.endif
|
||||||
XCFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS}
|
XCFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS}
|
||||||
XCXXFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS}
|
XCXXFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS}
|
||||||
.endif
|
|
||||||
.else
|
.else
|
||||||
.if defined(CROSS_BINUTILS_PREFIX) && exists(${CROSS_BINUTILS_PREFIX})
|
.if defined(CROSS_BINUTILS_PREFIX) && exists(${CROSS_BINUTILS_PREFIX})
|
||||||
BFLAGS+= -B${CROSS_BINUTILS_PREFIX}
|
BFLAGS+= -B${CROSS_BINUTILS_PREFIX}
|
||||||
@@ -423,8 +427,9 @@ LIB32CPUFLAGS= -march=${TARGET_CPUTYPE}
|
|||||||
LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \
|
LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \
|
||||||
MACHINE_CPU="i686 mmx sse sse2"
|
MACHINE_CPU="i686 mmx sse sse2"
|
||||||
LIB32WMAKEFLAGS= \
|
LIB32WMAKEFLAGS= \
|
||||||
AS="${AS} --32" \
|
AS="${XAS} --32" \
|
||||||
LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32"
|
LD="${XLD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \
|
||||||
|
OBJCOPY="${XOBJCOPY}"
|
||||||
|
|
||||||
.elif ${TARGET_ARCH} == "powerpc64"
|
.elif ${TARGET_ARCH} == "powerpc64"
|
||||||
.if empty(TARGET_CPUTYPE)
|
.if empty(TARGET_CPUTYPE)
|
||||||
@@ -434,7 +439,8 @@ LIB32CPUFLAGS= -mcpu=${TARGET_CPUTYPE}
|
|||||||
.endif
|
.endif
|
||||||
LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc
|
LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc
|
||||||
LIB32WMAKEFLAGS= \
|
LIB32WMAKEFLAGS= \
|
||||||
LD="${LD} -m elf32ppc_fbsd"
|
LD="${XLD} -m elf32ppc_fbsd" \
|
||||||
|
OBJCOPY="${XOBJCOPY}"
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
|
||||||
@@ -1345,7 +1351,9 @@ update:
|
|||||||
#
|
#
|
||||||
|
|
||||||
#
|
#
|
||||||
# legacy: Build compatibility shims for the next three targets
|
# legacy: Build compatibility shims for the next three targets. This is a minimal
|
||||||
|
# set of tools and shims necessary to compensate for older systems which don't have
|
||||||
|
# the APIs that the targets built in bootstrap-tools, build-tools or cross-tools.
|
||||||
#
|
#
|
||||||
legacy:
|
legacy:
|
||||||
.if ${BOOTSTRAPPING} < 800107 && ${BOOTSTRAPPING} != 0
|
.if ${BOOTSTRAPPING} < 800107 && ${BOOTSTRAPPING} != 0
|
||||||
@@ -1363,7 +1371,10 @@ legacy:
|
|||||||
.endfor
|
.endfor
|
||||||
|
|
||||||
#
|
#
|
||||||
# bootstrap-tools: Build tools needed for compatibility
|
# bootstrap-tools: Build tools needed for compatibility. These are binaries that
|
||||||
|
# are built to build other binaries in the system. However, the focus of these
|
||||||
|
# binaries is usually quite narrow. Bootstrap tools use the host's compiler and
|
||||||
|
# libraries, augmented by -legacy.
|
||||||
#
|
#
|
||||||
_bt= _bootstrap-tools
|
_bt= _bootstrap-tools
|
||||||
|
|
||||||
@@ -1569,7 +1580,9 @@ kernel-tools: .MAKE
|
|||||||
-p ${MAKEOBJDIRPREFIX}/usr >/dev/null
|
-p ${MAKEOBJDIRPREFIX}/usr >/dev/null
|
||||||
|
|
||||||
#
|
#
|
||||||
# cross-tools: Build cross-building tools
|
# cross-tools: All the tools needed to build the rest of the system after
|
||||||
|
# we get done with the earlier stages. It is the last set of tools needed
|
||||||
|
# to begin building the target binaries.
|
||||||
#
|
#
|
||||||
.if ${TARGET_ARCH} != ${MACHINE_ARCH}
|
.if ${TARGET_ARCH} != ${MACHINE_ARCH}
|
||||||
.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
|
.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
|
||||||
@@ -1600,6 +1613,11 @@ _elftctools= lib/libelftc \
|
|||||||
# cross-build on a FreeBSD 10 host:
|
# cross-build on a FreeBSD 10 host:
|
||||||
_elftctools+= usr.bin/addr2line
|
_elftctools+= usr.bin/addr2line
|
||||||
.endif
|
.endif
|
||||||
|
.elif ${TARGET_ARCH} != ${MACHINE_ARCH} && ${MK_ELFTOOLCHAIN_TOOLS} != "no"
|
||||||
|
# If cross-building with an external binutils we still need to build strip for
|
||||||
|
# the target (for at least crunchide).
|
||||||
|
_elftctools= lib/libelftc \
|
||||||
|
usr.bin/elfcopy
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
# If an full path to an external cross compiler is given, don't build
|
# If an full path to an external cross compiler is given, don't build
|
||||||
|
|||||||
@@ -38,6 +38,12 @@
|
|||||||
# xargs -n1 | sort | uniq -d;
|
# xargs -n1 | sort | uniq -d;
|
||||||
# done
|
# done
|
||||||
|
|
||||||
|
# 20150329
|
||||||
|
.if ${TARGET_ARCH} == "arm"
|
||||||
|
OLD_FILES+=usr/include/bootconfig.h
|
||||||
|
.endif
|
||||||
|
# 20150326
|
||||||
|
OLD_FILES+=usr/share/man/man1/pmcstudy.1.gz
|
||||||
# 20150315: new clang import which bumps version from 3.5.1 to 3.6.0.
|
# 20150315: new clang import which bumps version from 3.5.1 to 3.6.0.
|
||||||
OLD_FILES+=usr/include/clang/3.5.1/__wmmintrin_aes.h
|
OLD_FILES+=usr/include/clang/3.5.1/__wmmintrin_aes.h
|
||||||
OLD_FILES+=usr/include/clang/3.5.1/__wmmintrin_pclmul.h
|
OLD_FILES+=usr/include/clang/3.5.1/__wmmintrin_pclmul.h
|
||||||
|
|||||||
@@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
|
|||||||
disable the most expensive debugging functionality run
|
disable the most expensive debugging functionality run
|
||||||
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
|
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
|
||||||
|
|
||||||
|
20150324:
|
||||||
|
From legacy ata(4) driver was removed support for SATA controllers
|
||||||
|
supported by more functional drivers ahci(4), siis(4) and mvs(4).
|
||||||
|
Kernel modules ataahci and ataadaptec were removed completely,
|
||||||
|
replaced by ahci and mvs modules respectively.
|
||||||
|
|
||||||
20150315:
|
20150315:
|
||||||
Clang, llvm and lldb have been upgraded to 3.6.0 release. Please see
|
Clang, llvm and lldb have been upgraded to 3.6.0 release. Please see
|
||||||
the 20141231 entry below for information about prerequisites and
|
the 20141231 entry below for information about prerequisites and
|
||||||
|
|||||||
+1
-1
@@ -342,7 +342,7 @@ setfile(struct stat *fs, int fd)
|
|||||||
|
|
||||||
tspec[0] = fs->st_atim;
|
tspec[0] = fs->st_atim;
|
||||||
tspec[1] = fs->st_mtim;
|
tspec[1] = fs->st_mtim;
|
||||||
if (utimensat(AT_FDCWD, to.p_path, tspec,
|
if (fdval ? futimens(fd, tspec) : utimensat(AT_FDCWD, to.p_path, tspec,
|
||||||
islink ? AT_SYMLINK_NOFOLLOW : 0)) {
|
islink ? AT_SYMLINK_NOFOLLOW : 0)) {
|
||||||
warn("utimensat: %s", to.p_path);
|
warn("utimensat: %s", to.p_path);
|
||||||
rval = 1;
|
rval = 1;
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ PROG= expr
|
|||||||
SRCS= expr.y
|
SRCS= expr.y
|
||||||
YFLAGS=
|
YFLAGS=
|
||||||
|
|
||||||
|
# expr relies on signed integer wrapping
|
||||||
|
CFLAGS+= -fwrapv
|
||||||
|
|
||||||
NO_WMISSING_VARIABLE_DECLARATIONS=
|
NO_WMISSING_VARIABLE_DECLARATIONS=
|
||||||
|
|
||||||
.if ${MK_TESTS} != "no"
|
.if ${MK_TESTS} != "no"
|
||||||
|
|||||||
+1
-1
@@ -352,7 +352,7 @@ err: if (unlink(to))
|
|||||||
|
|
||||||
ts[0] = sbp->st_atim;
|
ts[0] = sbp->st_atim;
|
||||||
ts[1] = sbp->st_mtim;
|
ts[1] = sbp->st_mtim;
|
||||||
if (utimensat(AT_FDCWD, to, ts, 0))
|
if (futimens(to_fd, ts))
|
||||||
warn("%s: set times", to);
|
warn("%s: set times", to);
|
||||||
|
|
||||||
if (close(to_fd)) {
|
if (close(to_fd)) {
|
||||||
|
|||||||
+2
-2
@@ -82,7 +82,7 @@ static int wr_trail = 1; /* trailer was rewritten in append */
|
|||||||
static int can_unlnk = 0; /* do we unlink null archives? */
|
static int can_unlnk = 0; /* do we unlink null archives? */
|
||||||
const char *arcname; /* printable name of archive */
|
const char *arcname; /* printable name of archive */
|
||||||
const char *gzip_program; /* name of gzip program */
|
const char *gzip_program; /* name of gzip program */
|
||||||
static pid_t zpid = -1; /* pid of child process */
|
static pid_t zpid = -1; /* pid of child process */
|
||||||
|
|
||||||
static int get_phys(void);
|
static int get_phys(void);
|
||||||
static void ar_start_gzip(int, const char *, int);
|
static void ar_start_gzip(int, const char *, int);
|
||||||
@@ -1123,7 +1123,7 @@ ar_next(void)
|
|||||||
if (sigprocmask(SIG_SETMASK, &o_mask, NULL) < 0)
|
if (sigprocmask(SIG_SETMASK, &o_mask, NULL) < 0)
|
||||||
syswarn(0, errno, "Unable to restore signal mask");
|
syswarn(0, errno, "Unable to restore signal mask");
|
||||||
|
|
||||||
if (done || !wr_trail || strcmp(NM_TAR, argv0) == 0)
|
if (done || !wr_trail || Oflag || strcmp(NM_TAR, argv0) == 0)
|
||||||
return(-1);
|
return(-1);
|
||||||
|
|
||||||
tty_prnt("\nATTENTION! %s archive volume change required.\n", argv0);
|
tty_prnt("\nATTENTION! %s archive volume change required.\n", argv0);
|
||||||
|
|||||||
@@ -217,6 +217,7 @@ extern int vflag;
|
|||||||
extern int Dflag;
|
extern int Dflag;
|
||||||
extern int Hflag;
|
extern int Hflag;
|
||||||
extern int Lflag;
|
extern int Lflag;
|
||||||
|
extern int Oflag;
|
||||||
extern int Xflag;
|
extern int Xflag;
|
||||||
extern int Yflag;
|
extern int Yflag;
|
||||||
extern int Zflag;
|
extern int Zflag;
|
||||||
|
|||||||
+15
-9
@@ -194,7 +194,7 @@ pax_options(int argc, char **argv)
|
|||||||
/*
|
/*
|
||||||
* process option flags
|
* process option flags
|
||||||
*/
|
*/
|
||||||
while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:zB:DE:G:HLPT:U:XYZ"))
|
while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:zB:DE:G:HLOPT:U:XYZ"))
|
||||||
!= -1) {
|
!= -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'a':
|
case 'a':
|
||||||
@@ -447,6 +447,12 @@ pax_options(int argc, char **argv)
|
|||||||
Lflag = 1;
|
Lflag = 1;
|
||||||
flg |= CLF;
|
flg |= CLF;
|
||||||
break;
|
break;
|
||||||
|
case 'O':
|
||||||
|
/*
|
||||||
|
* Force one volume. Non standard option.
|
||||||
|
*/
|
||||||
|
Oflag = 1;
|
||||||
|
break;
|
||||||
case 'P':
|
case 'P':
|
||||||
/*
|
/*
|
||||||
* do NOT follow symlinks (default)
|
* do NOT follow symlinks (default)
|
||||||
@@ -584,7 +590,7 @@ tar_options(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
int fstdin = 0;
|
int fstdin = 0;
|
||||||
int Oflag = 0;
|
int tar_Oflag = 0;
|
||||||
int nincfiles = 0;
|
int nincfiles = 0;
|
||||||
int incfiles_max = 0;
|
int incfiles_max = 0;
|
||||||
struct incfile {
|
struct incfile {
|
||||||
@@ -664,7 +670,7 @@ tar_options(int argc, char **argv)
|
|||||||
if (opt_add("write_opt=nodir") < 0)
|
if (opt_add("write_opt=nodir") < 0)
|
||||||
tar_usage();
|
tar_usage();
|
||||||
case 'O':
|
case 'O':
|
||||||
Oflag = 1;
|
tar_Oflag = 1;
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
/*
|
/*
|
||||||
@@ -820,8 +826,8 @@ tar_options(int argc, char **argv)
|
|||||||
* (unless -o specified)
|
* (unless -o specified)
|
||||||
*/
|
*/
|
||||||
if (act == ARCHIVE || act == APPND)
|
if (act == ARCHIVE || act == APPND)
|
||||||
frmt = &(fsub[Oflag ? F_OTAR : F_TAR]);
|
frmt = &(fsub[tar_Oflag ? F_OTAR : F_TAR]);
|
||||||
else if (Oflag) {
|
else if (tar_Oflag) {
|
||||||
paxwarn(1, "The -O/-o options are only valid when writing an archive");
|
paxwarn(1, "The -O/-o options are only valid when writing an archive");
|
||||||
tar_usage(); /* only valid when writing */
|
tar_usage(); /* only valid when writing */
|
||||||
}
|
}
|
||||||
@@ -1526,25 +1532,25 @@ no_op(void)
|
|||||||
void
|
void
|
||||||
pax_usage(void)
|
pax_usage(void)
|
||||||
{
|
{
|
||||||
(void)fputs("usage: pax [-cdnvz] [-E limit] [-f archive] ", stderr);
|
(void)fputs("usage: pax [-cdnOvz] [-E limit] [-f archive] ", stderr);
|
||||||
(void)fputs("[-s replstr] ... [-U user] ...", stderr);
|
(void)fputs("[-s replstr] ... [-U user] ...", stderr);
|
||||||
(void)fputs("\n [-G group] ... ", stderr);
|
(void)fputs("\n [-G group] ... ", stderr);
|
||||||
(void)fputs("[-T [from_date][,to_date]] ... ", stderr);
|
(void)fputs("[-T [from_date][,to_date]] ... ", stderr);
|
||||||
(void)fputs("[pattern ...]\n", stderr);
|
(void)fputs("[pattern ...]\n", stderr);
|
||||||
(void)fputs(" pax -r [-cdiknuvzDYZ] [-E limit] ", stderr);
|
(void)fputs(" pax -r [-cdiknOuvzDYZ] [-E limit] ", stderr);
|
||||||
(void)fputs("[-f archive] [-o options] ... \n", stderr);
|
(void)fputs("[-f archive] [-o options] ... \n", stderr);
|
||||||
(void)fputs(" [-p string] ... [-s replstr] ... ", stderr);
|
(void)fputs(" [-p string] ... [-s replstr] ... ", stderr);
|
||||||
(void)fputs("[-U user] ... [-G group] ...\n ", stderr);
|
(void)fputs("[-U user] ... [-G group] ...\n ", stderr);
|
||||||
(void)fputs("[-T [from_date][,to_date]] ... ", stderr);
|
(void)fputs("[-T [from_date][,to_date]] ... ", stderr);
|
||||||
(void)fputs(" [pattern ...]\n", stderr);
|
(void)fputs(" [pattern ...]\n", stderr);
|
||||||
(void)fputs(" pax -w [-dituvzHLPX] [-b blocksize] ", stderr);
|
(void)fputs(" pax -w [-dituvzHLOPX] [-b blocksize] ", stderr);
|
||||||
(void)fputs("[ [-a] [-f archive] ] [-x format] \n", stderr);
|
(void)fputs("[ [-a] [-f archive] ] [-x format] \n", stderr);
|
||||||
(void)fputs(" [-B bytes] [-s replstr] ... ", stderr);
|
(void)fputs(" [-B bytes] [-s replstr] ... ", stderr);
|
||||||
(void)fputs("[-o options] ... [-U user] ...", stderr);
|
(void)fputs("[-o options] ... [-U user] ...", stderr);
|
||||||
(void)fputs("\n [-G group] ... ", stderr);
|
(void)fputs("\n [-G group] ... ", stderr);
|
||||||
(void)fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr);
|
(void)fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr);
|
||||||
(void)fputs("[file ...]\n", stderr);
|
(void)fputs("[file ...]\n", stderr);
|
||||||
(void)fputs(" pax -r -w [-diklntuvDHLPXYZ] ", stderr);
|
(void)fputs(" pax -r -w [-diklntuvDHLOPXYZ] ", stderr);
|
||||||
(void)fputs("[-p string] ... [-s replstr] ...", stderr);
|
(void)fputs("[-p string] ... [-s replstr] ...", stderr);
|
||||||
(void)fputs("\n [-U user] ... [-G group] ... ", stderr);
|
(void)fputs("\n [-U user] ... [-G group] ... ", stderr);
|
||||||
(void)fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr);
|
(void)fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr);
|
||||||
|
|||||||
+13
-5
@@ -33,7 +33,7 @@
|
|||||||
.\" @(#)pax.1 8.4 (Berkeley) 4/18/94
|
.\" @(#)pax.1 8.4 (Berkeley) 4/18/94
|
||||||
.\" $FreeBSD$
|
.\" $FreeBSD$
|
||||||
.\"
|
.\"
|
||||||
.Dd December 21, 2013
|
.Dd March 17, 2015
|
||||||
.Dt PAX 1
|
.Dt PAX 1
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
.Nd read and write file archives and copy directory hierarchies
|
.Nd read and write file archives and copy directory hierarchies
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm
|
.Nm
|
||||||
.Op Fl cdnvz
|
.Op Fl cdnvzO
|
||||||
.Bk -words
|
.Bk -words
|
||||||
.Op Fl f Ar archive
|
.Op Fl f Ar archive
|
||||||
.Ek
|
.Ek
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
.Op Ar pattern ...\&
|
.Op Ar pattern ...\&
|
||||||
.Nm
|
.Nm
|
||||||
.Fl r
|
.Fl r
|
||||||
.Op Fl cdiknuvzDYZ
|
.Op Fl cdiknuvzDOYZ
|
||||||
.Bk -words
|
.Bk -words
|
||||||
.Op Fl f Ar archive
|
.Op Fl f Ar archive
|
||||||
.Ek
|
.Ek
|
||||||
@@ -104,7 +104,7 @@
|
|||||||
.Op Ar pattern ...\&
|
.Op Ar pattern ...\&
|
||||||
.Nm
|
.Nm
|
||||||
.Fl w
|
.Fl w
|
||||||
.Op Fl dituvzHLPX
|
.Op Fl dituvzHLOPX
|
||||||
.Bk -words
|
.Bk -words
|
||||||
.Op Fl b Ar blocksize
|
.Op Fl b Ar blocksize
|
||||||
.Ek
|
.Ek
|
||||||
@@ -147,7 +147,7 @@
|
|||||||
.Nm
|
.Nm
|
||||||
.Fl r
|
.Fl r
|
||||||
.Fl w
|
.Fl w
|
||||||
.Op Fl diklntuvDHLPXYZ
|
.Op Fl diklntuvDHLOPXYZ
|
||||||
.Bk -words
|
.Bk -words
|
||||||
.Op Fl p Ar string
|
.Op Fl p Ar string
|
||||||
.Ar ...\&
|
.Ar ...\&
|
||||||
@@ -853,6 +853,13 @@ Follow only command line symbolic links while performing a physical file
|
|||||||
system traversal.
|
system traversal.
|
||||||
.It Fl L
|
.It Fl L
|
||||||
Follow all symbolic links to perform a logical file system traversal.
|
Follow all symbolic links to perform a logical file system traversal.
|
||||||
|
.It Fl O
|
||||||
|
Force the archive to be one volume.
|
||||||
|
If a volume ends prematurely,
|
||||||
|
.Nm
|
||||||
|
will not prompt for a new volume.
|
||||||
|
This option can be useful for
|
||||||
|
automated tasks where error recovery cannot be performed by a human.
|
||||||
.It Fl P
|
.It Fl P
|
||||||
Do not follow symbolic links, perform a physical file system traversal.
|
Do not follow symbolic links, perform a physical file system traversal.
|
||||||
This is the default mode.
|
This is the default mode.
|
||||||
@@ -1176,6 +1183,7 @@ The options
|
|||||||
.Fl G ,
|
.Fl G ,
|
||||||
.Fl H ,
|
.Fl H ,
|
||||||
.Fl L ,
|
.Fl L ,
|
||||||
|
.Fl O ,
|
||||||
.Fl P ,
|
.Fl P ,
|
||||||
.Fl T ,
|
.Fl T ,
|
||||||
.Fl U ,
|
.Fl U ,
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ int vflag; /* produce verbose output */
|
|||||||
int Dflag; /* same as uflag except inode change time */
|
int Dflag; /* same as uflag except inode change time */
|
||||||
int Hflag; /* follow command line symlinks (write only) */
|
int Hflag; /* follow command line symlinks (write only) */
|
||||||
int Lflag; /* follow symlinks when writing */
|
int Lflag; /* follow symlinks when writing */
|
||||||
|
int Oflag; /* limit to single volume */
|
||||||
int Xflag; /* archive files with same device id only */
|
int Xflag; /* archive files with same device id only */
|
||||||
int Yflag; /* same as Dflg except after name mode */
|
int Yflag; /* same as Dflg except after name mode */
|
||||||
int Zflag; /* same as uflg except after name mode */
|
int Zflag; /* same as uflg except after name mode */
|
||||||
|
|||||||
@@ -49,6 +49,8 @@ FILES+= ifs2.0
|
|||||||
FILES+= ifs3.0
|
FILES+= ifs3.0
|
||||||
FILES+= ifs4.0
|
FILES+= ifs4.0
|
||||||
FILES+= ifs5.0
|
FILES+= ifs5.0
|
||||||
|
FILES+= ifs6.0
|
||||||
|
FILES+= ifs7.0
|
||||||
FILES+= length1.0
|
FILES+= length1.0
|
||||||
FILES+= length2.0
|
FILES+= length2.0
|
||||||
FILES+= length3.0
|
FILES+= length3.0
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# $FreeBSD$
|
||||||
|
|
||||||
|
IFS=': '
|
||||||
|
x=': :'
|
||||||
|
set -- $x
|
||||||
|
[ "$#|$1|$2|$3" = "2|||" ]
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# $FreeBSD$
|
||||||
|
|
||||||
|
IFS=2
|
||||||
|
set -- $((123))
|
||||||
|
[ "$#|$1|$2|$3" = "2|1|3|" ]
|
||||||
@@ -35,11 +35,11 @@ BEGIN
|
|||||||
this->b = -2;
|
this->b = -2;
|
||||||
|
|
||||||
system("echo %s %d %d", "foo", this->a, this->b);
|
system("echo %s %d %d", "foo", this->a, this->b);
|
||||||
system("ping localhost");
|
system("ping -q -c 1 localhost 2>/dev/null | grep -v '^round-trip '");
|
||||||
system("echo %d", ++this->a);
|
system("echo %d", ++this->a);
|
||||||
system("ping localhost");
|
system("ping -q -c 1 localhost 2>/dev/null | grep -v '^round-trip '");
|
||||||
system("echo %d", ++this->a);
|
system("echo %d", ++this->a);
|
||||||
system("ping localhost");
|
system("ping -q -c 1 localhost 2>/dev/null | grep -v '^round-trip '");
|
||||||
system("echo %d", ++this->a);
|
system("echo %d", ++this->a);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,17 @@
|
|||||||
foo 9 -2
|
foo 9 -2
|
||||||
localhost is alive
|
PING localhost (127.0.0.1): 56 data bytes
|
||||||
|
|
||||||
|
--- localhost ping statistics ---
|
||||||
|
1 packets transmitted, 1 packets received, 0.0% packet loss
|
||||||
10
|
10
|
||||||
localhost is alive
|
PING localhost (127.0.0.1): 56 data bytes
|
||||||
|
|
||||||
|
--- localhost ping statistics ---
|
||||||
|
1 packets transmitted, 1 packets received, 0.0% packet loss
|
||||||
11
|
11
|
||||||
localhost is alive
|
PING localhost (127.0.0.1): 56 data bytes
|
||||||
|
|
||||||
|
--- localhost ping statistics ---
|
||||||
|
1 packets transmitted, 1 packets received, 0.0% packet loss
|
||||||
12
|
12
|
||||||
|
|
||||||
|
|||||||
@@ -45,12 +45,13 @@ fi
|
|||||||
dtrace=$1
|
dtrace=$1
|
||||||
local=127.0.0.1
|
local=127.0.0.1
|
||||||
|
|
||||||
$dtrace -c "/sbin/ping $local 3" -qs /dev/stdin <<EOF | sort -n
|
$dtrace -c "/sbin/ping -q -c 1 -t 3 $local" -qs /dev/stdin <<EOF | sort -n | \
|
||||||
|
grep -v -e '^round-trip ' -e '^--- '
|
||||||
ip:::send
|
ip:::send
|
||||||
/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
|
/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
|
||||||
args[4]->ipv4_protocol == IPPROTO_ICMP/
|
args[4]->ipv4_protocol == IPPROTO_ICMP/
|
||||||
{
|
{
|
||||||
printf("1 ip:::send (");
|
printf("2 ip:::send (");
|
||||||
printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength);
|
printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength);
|
||||||
printf("args[4]: %d %d %d %d %d)\n",
|
printf("args[4]: %d %d %d %d %d)\n",
|
||||||
args[4]->ipv4_ver, args[4]->ipv4_length, args[4]->ipv4_flags,
|
args[4]->ipv4_ver, args[4]->ipv4_length, args[4]->ipv4_flags,
|
||||||
@@ -61,7 +62,7 @@ ip:::receive
|
|||||||
/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
|
/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
|
||||||
args[4]->ipv4_protocol == IPPROTO_ICMP/
|
args[4]->ipv4_protocol == IPPROTO_ICMP/
|
||||||
{
|
{
|
||||||
printf("2 ip:::receive (");
|
printf("3 ip:::receive (");
|
||||||
printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength);
|
printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength);
|
||||||
printf("args[4]: %d %d %d %d %d)\n",
|
printf("args[4]: %d %d %d %d %d)\n",
|
||||||
args[4]->ipv4_ver, args[4]->ipv4_length, args[4]->ipv4_flags,
|
args[4]->ipv4_ver, args[4]->ipv4_length, args[4]->ipv4_flags,
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
1 ip:::send (args[2]: 4 64, args[4]: 4 84 0 0 255)
|
|
||||||
1 ip:::send (args[2]: 4 64, args[4]: 4 84 0 0 255)
|
PING 127.0.0.1 (127.0.0.1): 56 data bytes
|
||||||
2 ip:::receive (args[2]: 4 64, args[4]: 4 84 0 0 255)
|
1 packets transmitted, 1 packets received, 0.0% packet loss
|
||||||
2 ip:::receive (args[2]: 4 64, args[4]: 4 84 0 0 255)
|
2 ip:::send (args[2]: 4 64, args[4]: 4 84 0 0 64)
|
||||||
127.0.0.1 is alive
|
2 ip:::send (args[2]: 4 64, args[4]: 4 84 0 0 64)
|
||||||
|
3 ip:::receive (args[2]: 4 64, args[4]: 4 84 0 0 64)
|
||||||
|
3 ip:::receive (args[2]: 4 64, args[4]: 4 84 0 0 64)
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ cat > test.pl <<-EOPERL
|
|||||||
Timeout => 3);
|
Timeout => 3);
|
||||||
die "Could not connect to host $local port $tcpport" unless \$s;
|
die "Could not connect to host $local port $tcpport" unless \$s;
|
||||||
close \$s;
|
close \$s;
|
||||||
|
sleep(2);
|
||||||
EOPERL
|
EOPERL
|
||||||
|
|
||||||
$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE
|
$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ cat > test.pl <<-EOPERL
|
|||||||
Timeout => 3);
|
Timeout => 3);
|
||||||
die "Could not connect to host $dest port $tcpport" unless \$s;
|
die "Could not connect to host $dest port $tcpport" unless \$s;
|
||||||
close \$s;
|
close \$s;
|
||||||
|
sleep(2);
|
||||||
EOPERL
|
EOPERL
|
||||||
|
|
||||||
$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE
|
$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE
|
||||||
|
|||||||
@@ -55,12 +55,13 @@ else
|
|||||||
removeinet6=0
|
removeinet6=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$dtrace -c "/sbin/ping -A inet6 $local 3" -qs /dev/stdin <<EOF | sort -n
|
$dtrace -c "/sbin/ping6 -q -c 1 -X 3 $local" -qs /dev/stdin <<EOF | sort -n | \
|
||||||
|
grep -v -e '^round-trip ' -e '^--- '
|
||||||
ip:::send
|
ip:::send
|
||||||
/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
|
/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
|
||||||
args[5]->ipv6_nexthdr == IPPROTO_ICMPV6/
|
args[5]->ipv6_nexthdr == IPPROTO_ICMPV6/
|
||||||
{
|
{
|
||||||
printf("1 ip:::send (");
|
printf("2 ip:::send (");
|
||||||
printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength);
|
printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength);
|
||||||
printf("args[5]: %d %d %d)\n",
|
printf("args[5]: %d %d %d)\n",
|
||||||
args[5]->ipv6_ver, args[5]->ipv6_tclass, args[5]->ipv6_plen);
|
args[5]->ipv6_ver, args[5]->ipv6_tclass, args[5]->ipv6_plen);
|
||||||
@@ -70,7 +71,7 @@ ip:::receive
|
|||||||
/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
|
/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
|
||||||
args[5]->ipv6_nexthdr == IPPROTO_ICMPV6/
|
args[5]->ipv6_nexthdr == IPPROTO_ICMPV6/
|
||||||
{
|
{
|
||||||
printf("2 ip:::receive (");
|
printf("3 ip:::receive (");
|
||||||
printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength);
|
printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength);
|
||||||
printf("args[5]: %d %d %d)\n",
|
printf("args[5]: %d %d %d)\n",
|
||||||
args[5]->ipv6_ver, args[5]->ipv6_tclass, args[5]->ipv6_plen);
|
args[5]->ipv6_ver, args[5]->ipv6_tclass, args[5]->ipv6_plen);
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
::1 is alive
|
|
||||||
1 ip:::send (args[2]: 6 64, args[5]: 6 0 64)
|
PING6(56=40+8+8 bytes) ::1 --> ::1
|
||||||
1 ip:::send (args[2]: 6 64, args[5]: 6 0 64)
|
1 packets transmitted, 1 packets received, 0.0% packet loss
|
||||||
2 ip:::receive (args[2]: 6 64, args[5]: 6 0 64)
|
2 ip:::send (args[2]: 6 16, args[5]: 6 0 16)
|
||||||
2 ip:::receive (args[2]: 6 64, args[5]: 6 0 64)
|
2 ip:::send (args[2]: 6 16, args[5]: 6 0 16)
|
||||||
|
3 ip:::receive (args[2]: 6 16, args[5]: 6 0 16)
|
||||||
|
3 ip:::receive (args[2]: 6 16, args[5]: 6 0 16)
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ cat > test.pl <<-EOPERL
|
|||||||
die "Could not connect to host $local port $tcpport" unless \$s;
|
die "Could not connect to host $local port $tcpport" unless \$s;
|
||||||
print \$s "testing state machine transitions";
|
print \$s "testing state machine transitions";
|
||||||
close \$s;
|
close \$s;
|
||||||
|
sleep(2);
|
||||||
EOPERL
|
EOPERL
|
||||||
|
|
||||||
$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE
|
$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ cat > test.pl <<-EOPERL
|
|||||||
die "Could not connect to host $dest port $tcpport" unless \$s;
|
die "Could not connect to host $dest port $tcpport" unless \$s;
|
||||||
print \$s "testing state machine transitions";
|
print \$s "testing state machine transitions";
|
||||||
close \$s;
|
close \$s;
|
||||||
|
sleep(2);
|
||||||
EOPERL
|
EOPERL
|
||||||
|
|
||||||
$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE
|
$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE
|
||||||
|
|||||||
@@ -727,8 +727,8 @@ dt_print_packed(dtrace_hdl_t *dtp, FILE *fp,
|
|||||||
utf8 = B_TRUE;
|
utf8 = B_TRUE;
|
||||||
} else if ((term = getenv("TERM")) != NULL &&
|
} else if ((term = getenv("TERM")) != NULL &&
|
||||||
(strcmp(term, "sun") == 0 ||
|
(strcmp(term, "sun") == 0 ||
|
||||||
strcmp(term, "sun-color") == 0) ||
|
strcmp(term, "sun-color") == 0 ||
|
||||||
strcmp(term, "dumb") == 0) {
|
strcmp(term, "dumb") == 0)) {
|
||||||
utf8 = B_FALSE;
|
utf8 = B_FALSE;
|
||||||
} else {
|
} else {
|
||||||
utf8 = B_TRUE;
|
utf8 = B_TRUE;
|
||||||
|
|||||||
@@ -8,10 +8,8 @@ TESTS_SUBDIRS+= common
|
|||||||
.PATH: ${.CURDIR:H:H:H:H}/tests
|
.PATH: ${.CURDIR:H:H:H:H}/tests
|
||||||
KYUAFILE= YES
|
KYUAFILE= YES
|
||||||
|
|
||||||
.PATH: ${.CURDIR:H:H:H}/contrib/opensolaris/cmd/dtrace/test/cmd/scripts
|
.PATH: ${.CURDIR}/tools
|
||||||
SCRIPTSDIR= ${TESTSDIR}
|
SCRIPTSDIR= ${TESTSDIR}
|
||||||
SCRIPTS= dtest.pl
|
SCRIPTS= dtest.sh
|
||||||
|
|
||||||
SUBDIR_PARALLEL=
|
|
||||||
|
|
||||||
.include <bsd.test.mk>
|
.include <bsd.test.mk>
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ ${TESTGROUP}EXEDIR= ${TESTSDIR}
|
|||||||
|
|
||||||
TESTWRAPPER= t_dtrace_contrib
|
TESTWRAPPER= t_dtrace_contrib
|
||||||
ATF_TESTS_SH+= ${TESTWRAPPER}
|
ATF_TESTS_SH+= ${TESTWRAPPER}
|
||||||
TEST_METADATA.t_dtrace_contrib+= required_files="/usr/local/bin/perl"
|
|
||||||
TEST_METADATA.t_dtrace_contrib+= required_files="/usr/local/bin/ksh"
|
TEST_METADATA.t_dtrace_contrib+= required_files="/usr/local/bin/ksh"
|
||||||
TEST_METADATA.t_dtrace_contrib+= required_user="root"
|
TEST_METADATA.t_dtrace_contrib+= required_user="root"
|
||||||
|
|
||||||
|
|||||||
Executable
+129
@@ -0,0 +1,129 @@
|
|||||||
|
# $FreeBSD$
|
||||||
|
|
||||||
|
usage()
|
||||||
|
{
|
||||||
|
cat >&2 <<__EOF__
|
||||||
|
A harness for test cases in the DTrace test suite.
|
||||||
|
|
||||||
|
usage: $(basename $0) <testfile>
|
||||||
|
__EOF__
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
gettag()
|
||||||
|
{
|
||||||
|
local tag
|
||||||
|
|
||||||
|
tag=$(basename $1)
|
||||||
|
tag=${tag#*.}
|
||||||
|
tag=${tag%%[a-z.]*}
|
||||||
|
echo $tag
|
||||||
|
}
|
||||||
|
|
||||||
|
runtest()
|
||||||
|
{
|
||||||
|
local dflags exe exstatus pid retval status
|
||||||
|
|
||||||
|
exstatus=0
|
||||||
|
retval=0
|
||||||
|
|
||||||
|
case $TFILE in
|
||||||
|
drp.DTRACEDROP_*.d|err.*.d|tst.*.d)
|
||||||
|
case $TFILE in
|
||||||
|
drp.DTRACEDROP_*.d)
|
||||||
|
dflags="-x droptags"
|
||||||
|
tag=$(gettag "$TFILE")
|
||||||
|
;;
|
||||||
|
err.D_*.d)
|
||||||
|
exstatus=1
|
||||||
|
dflags="-x errtags"
|
||||||
|
tag=$(gettag "$TFILE")
|
||||||
|
;;
|
||||||
|
err.*.d)
|
||||||
|
exstatus=1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exe=${TFILE%.*}.exe
|
||||||
|
if [ -f "$exe" -a -x "$exe" ]; then
|
||||||
|
./$exe &
|
||||||
|
pid=$!
|
||||||
|
dflags="$dflags ${pid}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
dtrace -C -s "${TFILE}" $dflags >$STDOUT 2>$STDERR
|
||||||
|
status=$?
|
||||||
|
|
||||||
|
if [ $status -ne $exstatus ]; then
|
||||||
|
ERRMSG="dtrace exited with status ${status}, expected ${exstatus}"
|
||||||
|
retval=1
|
||||||
|
elif [ -n "${tag}" ] && ! grep -Fq " [${tag}] " ${STDERR}; then
|
||||||
|
ERRMSG="dtrace's error output did not contain expected tag ${tag}"
|
||||||
|
retval=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$pid" ]; then
|
||||||
|
kill -0 $pid >/dev/null 2>&1 && kill -9 $pid >/dev/null 2>&1
|
||||||
|
wait
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
err.*.ksh|tst.*.ksh)
|
||||||
|
expr "$TFILE" : 'err.*' >/dev/null && exstatus=1
|
||||||
|
|
||||||
|
ksh "$TFILE" /usr/sbin/dtrace >$STDOUT 2>$STDERR
|
||||||
|
status=$?
|
||||||
|
|
||||||
|
if [ $status -ne $exstatus ]; then
|
||||||
|
ERRMSG="script exited with status ${status}, expected ${exstatus}"
|
||||||
|
retval=1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
ERRMSG="unexpected test file name $TFILE"
|
||||||
|
retval=1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
return $retval
|
||||||
|
}
|
||||||
|
|
||||||
|
[ $# -eq 1 ] || usage
|
||||||
|
|
||||||
|
readonly STDERR=$(mktemp)
|
||||||
|
readonly STDOUT=$(mktemp)
|
||||||
|
readonly TFILE=$(basename $1)
|
||||||
|
readonly EXOUT=${TFILE}.out
|
||||||
|
|
||||||
|
kldstat -q -m dtrace_test || kldload dtrace_test
|
||||||
|
cd $(dirname $1)
|
||||||
|
runtest
|
||||||
|
RESULT=$?
|
||||||
|
|
||||||
|
if [ $RESULT -eq 0 -a -f $EXOUT -a -r $EXOUT ] && \
|
||||||
|
! cmp $STDOUT $EXOUT >/dev/null 2>&1; then
|
||||||
|
ERRMSG="test output mismatch"
|
||||||
|
RESULT=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $RESULT -ne 0 ]; then
|
||||||
|
echo "test $TFILE failed: $ERRMSG" >&2
|
||||||
|
if [ $(stat -f '%z' $STDOUT) -gt 0 ]; then
|
||||||
|
cat >&2 <<__EOF__
|
||||||
|
test stdout:
|
||||||
|
--
|
||||||
|
$(cat $STDOUT)
|
||||||
|
--
|
||||||
|
__EOF__
|
||||||
|
fi
|
||||||
|
if [ $(stat -f '%z' $STDERR) -gt 0 ]; then
|
||||||
|
cat >&2 <<__EOF__
|
||||||
|
test stderr:
|
||||||
|
--
|
||||||
|
$(cat $STDERR)
|
||||||
|
--
|
||||||
|
__EOF__
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f $STDERR $STDOUT
|
||||||
|
exit $RESULT
|
||||||
@@ -33,8 +33,8 @@ ${tcase}_head()
|
|||||||
${tcase}_body()
|
${tcase}_body()
|
||||||
{
|
{
|
||||||
$mod
|
$mod
|
||||||
atf_check -s exit:0 -o ignore -e ignore \\
|
atf_check -s exit:0 -o empty -e empty \\
|
||||||
"\$(atf_get_srcdir)/../../dtest" -n "\$(atf_get_srcdir)/${tfile}"
|
"\$(atf_get_srcdir)/../../dtest" "\$(atf_get_srcdir)/${tfile}"
|
||||||
}
|
}
|
||||||
__EOF__
|
__EOF__
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1286,7 +1286,7 @@ struct elf_find_verdep_info
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* The maximum number of known object attributes for any target. */
|
/* The maximum number of known object attributes for any target. */
|
||||||
#define NUM_KNOWN_OBJ_ATTRIBUTES 32
|
#define NUM_KNOWN_OBJ_ATTRIBUTES 71
|
||||||
|
|
||||||
/* The value of an object attribute. type & 1 indicates whether there
|
/* The value of an object attribute. type & 1 indicates whether there
|
||||||
is an integer value; type & 2 indicates whether there is a string
|
is an integer value; type & 2 indicates whether there is a string
|
||||||
|
|||||||
@@ -6835,6 +6835,8 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
|
|||||||
case Tag_ABI_FP_number_model:
|
case Tag_ABI_FP_number_model:
|
||||||
case Tag_ABI_align8_preserved:
|
case Tag_ABI_align8_preserved:
|
||||||
case Tag_ABI_HardFP_use:
|
case Tag_ABI_HardFP_use:
|
||||||
|
case Tag_CPU_unaligned_access:
|
||||||
|
case Tag_FP_HP_extension:
|
||||||
/* Use the largest value specified. */
|
/* Use the largest value specified. */
|
||||||
if (in_attr[i].i > out_attr[i].i)
|
if (in_attr[i].i > out_attr[i].i)
|
||||||
out_attr[i].i = in_attr[i].i;
|
out_attr[i].i = in_attr[i].i;
|
||||||
@@ -6951,7 +6953,9 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: /* All known attributes should be explicitly covered. */
|
default: /* All known attributes should be explicitly covered. */
|
||||||
abort ();
|
/* XXX Not now */
|
||||||
|
/* abort (); */
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -271,7 +271,11 @@ enum
|
|||||||
Tag_ABI_optimization_goals,
|
Tag_ABI_optimization_goals,
|
||||||
Tag_ABI_FP_optimization_goals,
|
Tag_ABI_FP_optimization_goals,
|
||||||
/* 32 is generic. */
|
/* 32 is generic. */
|
||||||
|
Tag_CPU_unaligned_access = 34,
|
||||||
|
Tag_FP_HP_extension = 36,
|
||||||
|
Tag_ABI_FP_16bit_format = 38,
|
||||||
|
Tag_MPextension_use = 42,
|
||||||
|
Tag_DIV_use = 44,
|
||||||
Tag_Virtualization_use = 68,
|
Tag_Virtualization_use = 68,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "int_lib.h"
|
#include "int_lib.h"
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
#include <libkern/OSCacheControl.h>
|
#include <libkern/OSCacheControl.h>
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <dwarf.h>
|
#include <dwarf.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
@@ -40,7 +39,7 @@
|
|||||||
|
|
||||||
#include "_elftc.h"
|
#include "_elftc.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: addr2line.c 3148 2015-02-15 18:47:39Z emaste $");
|
ELFTC_VCSID("$Id: addr2line.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
static struct option longopts[] = {
|
static struct option longopts[] = {
|
||||||
{"target" , required_argument, NULL, 'b'},
|
{"target" , required_argument, NULL, 'b'},
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: _elftc.h 3139 2015-01-05 03:17:06Z kaiwang27 $
|
* $Id: _elftc.h 3175 2015-03-27 17:21:24Z emaste $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -294,7 +294,8 @@ struct name { \
|
|||||||
#define ELFTC_VCSID(ID) __FBSDID(ID)
|
#define ELFTC_VCSID(ID) __FBSDID(ID)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
|
#if defined(__APPLE__) || defined(__GLIBC__) || defined(__GNU__) || \
|
||||||
|
defined(__linux__)
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
#define ELFTC_VCSID(ID) __asm__(".ident\t\"" ID "\"")
|
#define ELFTC_VCSID(ID) __asm__(".ident\t\"" ID "\"")
|
||||||
#else
|
#else
|
||||||
@@ -330,8 +331,8 @@ struct name { \
|
|||||||
|
|
||||||
#ifndef ELFTC_GETPROGNAME
|
#ifndef ELFTC_GETPROGNAME
|
||||||
|
|
||||||
#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__minix) || \
|
#if defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || \
|
||||||
defined(__NetBSD__)
|
defined(__minix) || defined(__NetBSD__)
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
@@ -340,7 +341,7 @@ struct name { \
|
|||||||
#endif /* __DragonFly__ || __FreeBSD__ || __minix || __NetBSD__ */
|
#endif /* __DragonFly__ || __FreeBSD__ || __minix || __NetBSD__ */
|
||||||
|
|
||||||
|
|
||||||
#if defined(__GLIBC__)
|
#if defined(__GLIBC__) || defined(__linux__)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GLIBC based systems have a global 'char *' pointer referencing
|
* GLIBC based systems have a global 'char *' pointer referencing
|
||||||
@@ -350,7 +351,7 @@ extern const char *program_invocation_short_name;
|
|||||||
|
|
||||||
#define ELFTC_GETPROGNAME() program_invocation_short_name
|
#define ELFTC_GETPROGNAME() program_invocation_short_name
|
||||||
|
|
||||||
#endif /* __GLIBC__ */
|
#endif /* __GLIBC__ || __linux__ */
|
||||||
|
|
||||||
|
|
||||||
#if defined(__OpenBSD__)
|
#if defined(__OpenBSD__)
|
||||||
@@ -368,6 +369,21 @@ extern const char *__progname;
|
|||||||
** Per-OS configuration.
|
** Per-OS configuration.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
|
||||||
|
#include <machine/endian.h>
|
||||||
|
#define roundup2 roundup
|
||||||
|
|
||||||
|
#define ELFTC_BYTE_ORDER _BYTE_ORDER
|
||||||
|
#define ELFTC_BYTE_ORDER_LITTLE_ENDIAN _LITTLE_ENDIAN
|
||||||
|
#define ELFTC_BYTE_ORDER_BIG_ENDIAN _BIG_ENDIAN
|
||||||
|
|
||||||
|
#define ELFTC_HAVE_MMAP 1
|
||||||
|
#define ELFTC_HAVE_STRMODE 1
|
||||||
|
|
||||||
|
#endif /* __APPLE__ */
|
||||||
|
|
||||||
|
|
||||||
#if defined(__DragonFly__)
|
#if defined(__DragonFly__)
|
||||||
|
|
||||||
#include <osreldate.h>
|
#include <osreldate.h>
|
||||||
@@ -381,7 +397,7 @@ extern const char *__progname;
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GLIBC__)
|
#if defined(__GLIBC__) || defined(__linux__)
|
||||||
|
|
||||||
#include <endian.h>
|
#include <endian.h>
|
||||||
|
|
||||||
@@ -401,7 +417,7 @@ extern const char *__progname;
|
|||||||
|
|
||||||
#define roundup2 roundup
|
#define roundup2 roundup
|
||||||
|
|
||||||
#endif /* __GLIBC__ */
|
#endif /* __GLIBC__ || __linux__ */
|
||||||
|
|
||||||
|
|
||||||
#if defined(__FreeBSD__)
|
#if defined(__FreeBSD__)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: elfdefinitions.h 3149 2015-02-15 19:00:06Z emaste $
|
* $Id: elfdefinitions.h 3178 2015-03-30 18:29:13Z emaste $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -171,7 +171,7 @@ _ELF_DEFINE_DT(DT_MOVEENT, 0x6FFFFDFAUL, \
|
|||||||
"size of DT_MOVETAB entries") \
|
"size of DT_MOVETAB entries") \
|
||||||
_ELF_DEFINE_DT(DT_MOVESZ, 0x6FFFFDFBUL, \
|
_ELF_DEFINE_DT(DT_MOVESZ, 0x6FFFFDFBUL, \
|
||||||
"total size of the MOVETAB table") \
|
"total size of the MOVETAB table") \
|
||||||
_ELF_DEFINE_DT(DT_FEATURE_1, 0x6FFFFDFCUL, "feature values") \
|
_ELF_DEFINE_DT(DT_FEATURE, 0x6FFFFDFCUL, "feature values") \
|
||||||
_ELF_DEFINE_DT(DT_POSFLAG_1, 0x6FFFFDFDUL, \
|
_ELF_DEFINE_DT(DT_POSFLAG_1, 0x6FFFFDFDUL, \
|
||||||
"dynamic position flags") \
|
"dynamic position flags") \
|
||||||
_ELF_DEFINE_DT(DT_SYMINSZ, 0x6FFFFDFEUL, \
|
_ELF_DEFINE_DT(DT_SYMINSZ, 0x6FFFFDFEUL, \
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# $Id: native-elf-format 2064 2011-10-26 15:12:32Z jkoshy $
|
# $Id: native-elf-format 3167 2015-02-24 19:10:08Z emaste $
|
||||||
#
|
#
|
||||||
# Find the native ELF format for a host platform by compiling a
|
# Find the native ELF format for a host platform by compiling a
|
||||||
# test object and examining the resulting object.
|
# test object and examining the resulting object.
|
||||||
@@ -19,7 +19,7 @@ touch ${tmp_c}
|
|||||||
echo "/* Generated by ${program} on `date` */"
|
echo "/* Generated by ${program} on `date` */"
|
||||||
|
|
||||||
cc -c ${tmp_c} -o ${tmp_o}
|
cc -c ${tmp_c} -o ${tmp_o}
|
||||||
readelf -h ${tmp_o} | awk '
|
LC_ALL=C readelf -h ${tmp_o} | awk '
|
||||||
$1 ~ "Class:" {
|
$1 ~ "Class:" {
|
||||||
sub("ELF","",$2); elfclass = $2;
|
sub("ELF","",$2); elfclass = $2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
@@ -36,7 +35,7 @@
|
|||||||
|
|
||||||
#include "_elftc.h"
|
#include "_elftc.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: cxxfilt.c 2185 2011-11-19 16:07:16Z jkoshy $");
|
ELFTC_VCSID("$Id: cxxfilt.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
#define STRBUFSZ 8192
|
#define STRBUFSZ 8192
|
||||||
|
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
@@ -40,7 +38,7 @@
|
|||||||
|
|
||||||
#include "elfcopy.h"
|
#include "elfcopy.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: archive.c 3102 2014-10-29 21:09:01Z jkoshy $");
|
ELFTC_VCSID("$Id: archive.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
#define _ARMAG_LEN 8 /* length of ar magic string */
|
#define _ARMAG_LEN 8 /* length of ar magic string */
|
||||||
#define _ARHDR_LEN 60 /* length of ar header */
|
#define _ARHDR_LEN 60 /* length of ar header */
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
@@ -37,7 +36,7 @@
|
|||||||
|
|
||||||
#include "elfcopy.h"
|
#include "elfcopy.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: ascii.c 2358 2011-12-19 18:22:32Z kaiwang27 $");
|
ELFTC_VCSID("$Id: ascii.c 3177 2015-03-30 18:19:41Z emaste $");
|
||||||
|
|
||||||
static void append_data(struct section *s, const void *buf, size_t sz);
|
static void append_data(struct section *s, const void *buf, size_t sz);
|
||||||
static char hex_digit(uint8_t n);
|
static char hex_digit(uint8_t n);
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
@@ -36,7 +35,7 @@
|
|||||||
|
|
||||||
#include "elfcopy.h"
|
#include "elfcopy.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: binary.c 2358 2011-12-19 18:22:32Z kaiwang27 $");
|
ELFTC_VCSID("$Id: binary.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert ELF object to `binary'. Sections with SHF_ALLOC flag set
|
* Convert ELF object to `binary'. Sections with SHF_ALLOC flag set
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
.\" out of the use of this software, even if advised of the possibility of
|
.\" out of the use of this software, even if advised of the possibility of
|
||||||
.\" such damage.
|
.\" such damage.
|
||||||
.\"
|
.\"
|
||||||
.\" $Id: elfcopy.1 2373 2011-12-30 07:13:44Z jkoshy $
|
.\" $Id: elfcopy.1 3173 2015-03-27 16:46:13Z emaste $
|
||||||
.\"
|
.\"
|
||||||
.Dd October 03, 2011
|
.Dd March 27, 2015
|
||||||
.Os
|
.Os
|
||||||
.Dt ELFCOPY 1
|
.Dt ELFCOPY 1
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@@ -63,7 +63,9 @@
|
|||||||
.Op Fl -adjust-warnings | Fl -change-warnings
|
.Op Fl -adjust-warnings | Fl -change-warnings
|
||||||
.Op Fl -change-section-lma Ar section Ns {+|-|=} Ns Ar val
|
.Op Fl -change-section-lma Ar section Ns {+|-|=} Ns Ar val
|
||||||
.Op Fl -change-section-vma Ar section Ns {+|-|=} Ns Ar val
|
.Op Fl -change-section-vma Ar section Ns {+|-|=} Ns Ar val
|
||||||
|
.Op Fl -extract-dwo
|
||||||
.Op Fl -gap-fill Ns = Ns Ar val
|
.Op Fl -gap-fill Ns = Ns Ar val
|
||||||
|
.Op Fl -localize-hidden
|
||||||
.Op Fl -no-adjust-warnings | Fl -no-change-warnings
|
.Op Fl -no-adjust-warnings | Fl -no-change-warnings
|
||||||
.Op Fl -only-keep-debug
|
.Op Fl -only-keep-debug
|
||||||
.Op Fl -pad-to Ns = Ns Ar address
|
.Op Fl -pad-to Ns = Ns Ar address
|
||||||
@@ -75,6 +77,7 @@
|
|||||||
.Op Fl -set-start Ns = Ns Ar address
|
.Op Fl -set-start Ns = Ns Ar address
|
||||||
.Op Fl -srec-forceS3
|
.Op Fl -srec-forceS3
|
||||||
.Op Fl -srec-len Ns = Ns Ar val
|
.Op Fl -srec-len Ns = Ns Ar val
|
||||||
|
.Op Fl -strip-dwo
|
||||||
.Op Fl -strip-unneeded
|
.Op Fl -strip-unneeded
|
||||||
.Ar infile
|
.Ar infile
|
||||||
.Op Ar outfile
|
.Op Ar outfile
|
||||||
@@ -220,10 +223,15 @@ Depending on the operator specified, the value in argument
|
|||||||
.Ar val
|
.Ar val
|
||||||
will be used as an increment, a decrement or as the new value
|
will be used as an increment, a decrement or as the new value
|
||||||
of the virtual memory address.
|
of the virtual memory address.
|
||||||
|
.It Fl -extract-dwo
|
||||||
|
Copy only .dwo debug sections to the output file.
|
||||||
.It Fl -gap-fill Ns = Ns Ar val
|
.It Fl -gap-fill Ns = Ns Ar val
|
||||||
Fill the gaps between sections with the byte value specified by
|
Fill the gaps between sections with the byte value specified by
|
||||||
the argument
|
the argument
|
||||||
.Ar val .
|
.Ar val .
|
||||||
|
.It Fl -localize-hidden
|
||||||
|
Make all hidden symbols local to the output file.
|
||||||
|
This includes symbols with internal visiblity.
|
||||||
.It Fl -no-adjust-warnings | Fl -no-change-warnings
|
.It Fl -no-adjust-warnings | Fl -no-change-warnings
|
||||||
Do not issue a warning if the section specified by the options
|
Do not issue a warning if the section specified by the options
|
||||||
.Fl -change-section-address ,
|
.Fl -change-section-address ,
|
||||||
@@ -304,6 +312,8 @@ Set the maximum length of an S-record line to
|
|||||||
.Ar val .
|
.Ar val .
|
||||||
This option is only meaningful when the output target is set to
|
This option is only meaningful when the output target is set to
|
||||||
.Dq srec .
|
.Dq srec .
|
||||||
|
.It Fl -strip-dwo
|
||||||
|
Do not copy .dwo debug sections to the output file.
|
||||||
.It Fl -strip-unneeded
|
.It Fl -strip-unneeded
|
||||||
Do not copy symbols that are not needed for relocation processing.
|
Do not copy symbols that are not needed for relocation processing.
|
||||||
.El
|
.El
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: elfcopy.h 3134 2014-12-23 10:43:59Z kaiwang27 $
|
* $Id: elfcopy.h 3173 2015-03-27 16:46:13Z emaste $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
@@ -190,7 +190,9 @@ struct elfcopy {
|
|||||||
STRIP_NONE = 0,
|
STRIP_NONE = 0,
|
||||||
STRIP_ALL,
|
STRIP_ALL,
|
||||||
STRIP_DEBUG,
|
STRIP_DEBUG,
|
||||||
|
STRIP_DWO,
|
||||||
STRIP_NONDEBUG,
|
STRIP_NONDEBUG,
|
||||||
|
STRIP_NONDWO,
|
||||||
STRIP_UNNEEDED
|
STRIP_UNNEEDED
|
||||||
} strip;
|
} strip;
|
||||||
|
|
||||||
@@ -216,6 +218,7 @@ struct elfcopy {
|
|||||||
#define SEC_REMOVE 0x00800000U
|
#define SEC_REMOVE 0x00800000U
|
||||||
#define SEC_COPY 0x01000000U
|
#define SEC_COPY 0x01000000U
|
||||||
#define DISCARD_LLABEL 0x02000000U
|
#define DISCARD_LLABEL 0x02000000U
|
||||||
|
#define LOCALIZE_HIDDEN 0x04000000U
|
||||||
|
|
||||||
int flags; /* elfcopy run control flags. */
|
int flags; /* elfcopy run control flags. */
|
||||||
int64_t change_addr; /* Section address adjustment. */
|
int64_t change_addr; /* Section address adjustment. */
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
@@ -40,7 +39,7 @@
|
|||||||
|
|
||||||
#include "elfcopy.h"
|
#include "elfcopy.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: main.c 3156 2015-02-15 21:40:01Z emaste $");
|
ELFTC_VCSID("$Id: main.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
enum options
|
enum options
|
||||||
{
|
{
|
||||||
@@ -57,9 +56,11 @@ enum options
|
|||||||
ECP_GLOBALIZE_SYMBOLS,
|
ECP_GLOBALIZE_SYMBOLS,
|
||||||
ECP_KEEP_SYMBOLS,
|
ECP_KEEP_SYMBOLS,
|
||||||
ECP_KEEP_GLOBAL_SYMBOLS,
|
ECP_KEEP_GLOBAL_SYMBOLS,
|
||||||
|
ECP_LOCALIZE_HIDDEN,
|
||||||
ECP_LOCALIZE_SYMBOLS,
|
ECP_LOCALIZE_SYMBOLS,
|
||||||
ECP_NO_CHANGE_WARN,
|
ECP_NO_CHANGE_WARN,
|
||||||
ECP_ONLY_DEBUG,
|
ECP_ONLY_DEBUG,
|
||||||
|
ECP_ONLY_DWO,
|
||||||
ECP_PAD_TO,
|
ECP_PAD_TO,
|
||||||
ECP_PREFIX_ALLOC,
|
ECP_PREFIX_ALLOC,
|
||||||
ECP_PREFIX_SEC,
|
ECP_PREFIX_SEC,
|
||||||
@@ -72,6 +73,7 @@ enum options
|
|||||||
ECP_SET_START,
|
ECP_SET_START,
|
||||||
ECP_SREC_FORCE_S3,
|
ECP_SREC_FORCE_S3,
|
||||||
ECP_SREC_LEN,
|
ECP_SREC_LEN,
|
||||||
|
ECP_STRIP_DWO,
|
||||||
ECP_STRIP_SYMBOLS,
|
ECP_STRIP_SYMBOLS,
|
||||||
ECP_STRIP_UNNEEDED,
|
ECP_STRIP_UNNEEDED,
|
||||||
ECP_WEAKEN_ALL,
|
ECP_WEAKEN_ALL,
|
||||||
@@ -124,6 +126,7 @@ static struct option elfcopy_longopts[] =
|
|||||||
{"change-warnings", no_argument, NULL, ECP_CHANGE_WARN},
|
{"change-warnings", no_argument, NULL, ECP_CHANGE_WARN},
|
||||||
{"discard-all", no_argument, NULL, 'x'},
|
{"discard-all", no_argument, NULL, 'x'},
|
||||||
{"discard-locals", no_argument, NULL, 'X'},
|
{"discard-locals", no_argument, NULL, 'X'},
|
||||||
|
{"extract-dwo", no_argument, NULL, ECP_ONLY_DWO},
|
||||||
{"gap-fill", required_argument, NULL, ECP_GAP_FILL},
|
{"gap-fill", required_argument, NULL, ECP_GAP_FILL},
|
||||||
{"globalize-symbol", required_argument, NULL, ECP_GLOBALIZE_SYMBOL},
|
{"globalize-symbol", required_argument, NULL, ECP_GLOBALIZE_SYMBOL},
|
||||||
{"globalize-symbols", required_argument, NULL, ECP_GLOBALIZE_SYMBOLS},
|
{"globalize-symbols", required_argument, NULL, ECP_GLOBALIZE_SYMBOLS},
|
||||||
@@ -134,6 +137,7 @@ static struct option elfcopy_longopts[] =
|
|||||||
{"keep-global-symbol", required_argument, NULL, 'G'},
|
{"keep-global-symbol", required_argument, NULL, 'G'},
|
||||||
{"keep-global-symbols", required_argument, NULL,
|
{"keep-global-symbols", required_argument, NULL,
|
||||||
ECP_KEEP_GLOBAL_SYMBOLS},
|
ECP_KEEP_GLOBAL_SYMBOLS},
|
||||||
|
{"localize-hidden", no_argument, NULL, ECP_LOCALIZE_HIDDEN},
|
||||||
{"localize-symbol", required_argument, NULL, 'L'},
|
{"localize-symbol", required_argument, NULL, 'L'},
|
||||||
{"localize-symbols", required_argument, NULL, ECP_LOCALIZE_SYMBOLS},
|
{"localize-symbols", required_argument, NULL, ECP_LOCALIZE_SYMBOLS},
|
||||||
{"no-adjust-warnings", no_argument, NULL, ECP_NO_CHANGE_WARN},
|
{"no-adjust-warnings", no_argument, NULL, ECP_NO_CHANGE_WARN},
|
||||||
@@ -157,6 +161,7 @@ static struct option elfcopy_longopts[] =
|
|||||||
{"srec-len", required_argument, NULL, ECP_SREC_LEN},
|
{"srec-len", required_argument, NULL, ECP_SREC_LEN},
|
||||||
{"strip-all", no_argument, NULL, 'S'},
|
{"strip-all", no_argument, NULL, 'S'},
|
||||||
{"strip-debug", no_argument, 0, 'g'},
|
{"strip-debug", no_argument, 0, 'g'},
|
||||||
|
{"strip-dwo", no_argument, NULL, ECP_STRIP_DWO},
|
||||||
{"strip-symbol", required_argument, NULL, 'N'},
|
{"strip-symbol", required_argument, NULL, 'N'},
|
||||||
{"strip-symbols", required_argument, NULL, ECP_STRIP_SYMBOLS},
|
{"strip-symbols", required_argument, NULL, ECP_STRIP_SYMBOLS},
|
||||||
{"strip-unneeded", no_argument, NULL, ECP_STRIP_UNNEEDED},
|
{"strip-unneeded", no_argument, NULL, ECP_STRIP_UNNEEDED},
|
||||||
@@ -348,6 +353,7 @@ create_elf(struct elfcopy *ecp)
|
|||||||
if (ecp->strip == STRIP_DEBUG ||
|
if (ecp->strip == STRIP_DEBUG ||
|
||||||
ecp->strip == STRIP_UNNEEDED ||
|
ecp->strip == STRIP_UNNEEDED ||
|
||||||
ecp->flags & WEAKEN_ALL ||
|
ecp->flags & WEAKEN_ALL ||
|
||||||
|
ecp->flags & LOCALIZE_HIDDEN ||
|
||||||
ecp->flags & DISCARD_LOCAL ||
|
ecp->flags & DISCARD_LOCAL ||
|
||||||
ecp->flags & DISCARD_LLABEL ||
|
ecp->flags & DISCARD_LLABEL ||
|
||||||
ecp->prefix_sym != NULL ||
|
ecp->prefix_sym != NULL ||
|
||||||
@@ -870,6 +876,9 @@ elfcopy_main(struct elfcopy *ecp, int argc, char **argv)
|
|||||||
case ECP_KEEP_GLOBAL_SYMBOLS:
|
case ECP_KEEP_GLOBAL_SYMBOLS:
|
||||||
parse_symlist_file(ecp, optarg, SYMOP_KEEPG);
|
parse_symlist_file(ecp, optarg, SYMOP_KEEPG);
|
||||||
break;
|
break;
|
||||||
|
case ECP_LOCALIZE_HIDDEN:
|
||||||
|
ecp->flags |= LOCALIZE_HIDDEN;
|
||||||
|
break;
|
||||||
case ECP_LOCALIZE_SYMBOLS:
|
case ECP_LOCALIZE_SYMBOLS:
|
||||||
parse_symlist_file(ecp, optarg, SYMOP_LOCALIZE);
|
parse_symlist_file(ecp, optarg, SYMOP_LOCALIZE);
|
||||||
break;
|
break;
|
||||||
@@ -879,6 +888,9 @@ elfcopy_main(struct elfcopy *ecp, int argc, char **argv)
|
|||||||
case ECP_ONLY_DEBUG:
|
case ECP_ONLY_DEBUG:
|
||||||
ecp->strip = STRIP_NONDEBUG;
|
ecp->strip = STRIP_NONDEBUG;
|
||||||
break;
|
break;
|
||||||
|
case ECP_ONLY_DWO:
|
||||||
|
ecp->strip = STRIP_NONDWO;
|
||||||
|
break;
|
||||||
case ECP_PAD_TO:
|
case ECP_PAD_TO:
|
||||||
ecp->pad_to = (uint64_t) strtoull(optarg, NULL, 0);
|
ecp->pad_to = (uint64_t) strtoull(optarg, NULL, 0);
|
||||||
break;
|
break;
|
||||||
@@ -939,6 +951,9 @@ elfcopy_main(struct elfcopy *ecp, int argc, char **argv)
|
|||||||
ecp->flags |= SREC_FORCE_LEN;
|
ecp->flags |= SREC_FORCE_LEN;
|
||||||
ecp->srec_len = strtoul(optarg, NULL, 0);
|
ecp->srec_len = strtoul(optarg, NULL, 0);
|
||||||
break;
|
break;
|
||||||
|
case ECP_STRIP_DWO:
|
||||||
|
ecp->strip = STRIP_DWO;
|
||||||
|
break;
|
||||||
case ECP_STRIP_SYMBOLS:
|
case ECP_STRIP_SYMBOLS:
|
||||||
parse_symlist_file(ecp, optarg, SYMOP_STRIP);
|
parse_symlist_file(ecp, optarg, SYMOP_STRIP);
|
||||||
break;
|
break;
|
||||||
@@ -1379,6 +1394,8 @@ Usage: %s [options] infile [outfile]\n\
|
|||||||
section by VAL.\n\
|
section by VAL.\n\
|
||||||
--gap-fill=VAL Fill the gaps between sections with bytes\n\
|
--gap-fill=VAL Fill the gaps between sections with bytes\n\
|
||||||
of value VAL.\n\
|
of value VAL.\n\
|
||||||
|
--localize-hidden Make all hidden symbols local to the output\n\
|
||||||
|
file.\n\
|
||||||
--no-adjust-warning| --no-change-warnings\n\
|
--no-adjust-warning| --no-change-warnings\n\
|
||||||
Do not issue warnings for non-existent\n\
|
Do not issue warnings for non-existent\n\
|
||||||
sections.\n\
|
sections.\n\
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
@@ -35,7 +34,7 @@
|
|||||||
|
|
||||||
#include "elfcopy.h"
|
#include "elfcopy.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: sections.c 3150 2015-02-15 19:07:46Z emaste $");
|
ELFTC_VCSID("$Id: sections.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
static void add_gnu_debuglink(struct elfcopy *ecp);
|
static void add_gnu_debuglink(struct elfcopy *ecp);
|
||||||
static uint32_t calc_crc32(const char *p, size_t len, uint32_t crc);
|
static uint32_t calc_crc32(const char *p, size_t len, uint32_t crc);
|
||||||
@@ -47,6 +46,7 @@ static void insert_to_strtab(struct section *t, const char *s);
|
|||||||
static int is_append_section(struct elfcopy *ecp, const char *name);
|
static int is_append_section(struct elfcopy *ecp, const char *name);
|
||||||
static int is_compress_section(struct elfcopy *ecp, const char *name);
|
static int is_compress_section(struct elfcopy *ecp, const char *name);
|
||||||
static int is_debug_section(const char *name);
|
static int is_debug_section(const char *name);
|
||||||
|
static int is_dwo_section(const char *name);
|
||||||
static int is_modify_section(struct elfcopy *ecp, const char *name);
|
static int is_modify_section(struct elfcopy *ecp, const char *name);
|
||||||
static int is_print_section(struct elfcopy *ecp, const char *name);
|
static int is_print_section(struct elfcopy *ecp, const char *name);
|
||||||
static int lookup_string(struct section *t, const char *s);
|
static int lookup_string(struct section *t, const char *s);
|
||||||
@@ -73,6 +73,11 @@ is_remove_section(struct elfcopy *ecp, const char *name)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ecp->strip == STRIP_DWO && is_dwo_section(name))
|
||||||
|
return (1);
|
||||||
|
if (ecp->strip == STRIP_NONDWO && !is_dwo_section(name))
|
||||||
|
return (1);
|
||||||
|
|
||||||
if (is_debug_section(name)) {
|
if (is_debug_section(name)) {
|
||||||
if (ecp->strip == STRIP_ALL ||
|
if (ecp->strip == STRIP_ALL ||
|
||||||
ecp->strip == STRIP_DEBUG ||
|
ecp->strip == STRIP_DEBUG ||
|
||||||
@@ -233,6 +238,16 @@ is_debug_section(const char *name)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
is_dwo_section(const char *name)
|
||||||
|
{
|
||||||
|
size_t len;
|
||||||
|
|
||||||
|
if ((len = strlen(name)) > 4 && strcmp(name + len - 4, ".dwo") == 0)
|
||||||
|
return (1);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
is_print_section(struct elfcopy *ecp, const char *name)
|
is_print_section(struct elfcopy *ecp, const char *name)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <gelf.h>
|
#include <gelf.h>
|
||||||
@@ -35,7 +34,7 @@
|
|||||||
|
|
||||||
#include "elfcopy.h"
|
#include "elfcopy.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: segments.c 3134 2014-12-23 10:43:59Z kaiwang27 $");
|
ELFTC_VCSID("$Id: segments.c 3177 2015-03-30 18:19:41Z emaste $");
|
||||||
|
|
||||||
static void insert_to_inseg_list(struct segment *seg, struct section *sec);
|
static void insert_to_inseg_list(struct segment *seg, struct section *sec);
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <fnmatch.h>
|
#include <fnmatch.h>
|
||||||
@@ -34,7 +33,7 @@
|
|||||||
|
|
||||||
#include "elfcopy.h"
|
#include "elfcopy.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: symbols.c 3135 2014-12-24 08:22:43Z kaiwang27 $");
|
ELFTC_VCSID("$Id: symbols.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
/* Symbol table buffer structure. */
|
/* Symbol table buffer structure. */
|
||||||
struct symbuf {
|
struct symbuf {
|
||||||
@@ -128,6 +127,17 @@ is_local_symbol(unsigned char st_info)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
is_hidden_symbol(unsigned char st_other)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (GELF_ST_VISIBILITY(st_other) == STV_HIDDEN ||
|
||||||
|
GELF_ST_VISIBILITY(st_other) == STV_INTERNAL)
|
||||||
|
return (1);
|
||||||
|
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
is_local_label(const char *name)
|
is_local_label(const char *name)
|
||||||
{
|
{
|
||||||
@@ -457,6 +467,11 @@ generate_symbols(struct elfcopy *ecp)
|
|||||||
lookup_symop_list(ecp, name, SYMOP_KEEPG) == NULL)
|
lookup_symop_list(ecp, name, SYMOP_KEEPG) == NULL)
|
||||||
sym.st_info = GELF_ST_INFO(STB_LOCAL,
|
sym.st_info = GELF_ST_INFO(STB_LOCAL,
|
||||||
GELF_ST_TYPE(sym.st_info));
|
GELF_ST_TYPE(sym.st_info));
|
||||||
|
if (ecp->flags & LOCALIZE_HIDDEN &&
|
||||||
|
sym.st_shndx != SHN_UNDEF &&
|
||||||
|
is_hidden_symbol(sym.st_other))
|
||||||
|
sym.st_info = GELF_ST_INFO(STB_LOCAL,
|
||||||
|
GELF_ST_TYPE(sym.st_info));
|
||||||
} else {
|
} else {
|
||||||
/* STB_LOCAL binding. */
|
/* STB_LOCAL binding. */
|
||||||
if (lookup_symop_list(ecp, name, SYMOP_GLOBALIZE) !=
|
if (lookup_symop_list(ecp, name, SYMOP_GLOBALIZE) !=
|
||||||
@@ -1036,10 +1051,8 @@ match_wildcard(const char *name, const char *pattern)
|
|||||||
}
|
}
|
||||||
|
|
||||||
match = 0;
|
match = 0;
|
||||||
if (!fnmatch(pattern, name, 0)) {
|
if (!fnmatch(pattern, name, 0))
|
||||||
match = 1;
|
match = 1;
|
||||||
printf("string '%s' match to pattern '%s'\n", name, pattern);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (reverse ? !match : match);
|
return (reverse ? !match : match);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: _libdwarf.h 3161 2015-02-15 21:43:36Z emaste $
|
* $Id: _libdwarf.h 3164 2015-02-19 01:20:12Z kaiwang27 $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __LIBDWARF_H_
|
#ifndef __LIBDWARF_H_
|
||||||
@@ -190,6 +190,7 @@ struct _Dwarf_LineInfo {
|
|||||||
Dwarf_Half li_version; /* Version of line info. */
|
Dwarf_Half li_version; /* Version of line info. */
|
||||||
Dwarf_Unsigned li_hdrlen; /* Length of line info header. */
|
Dwarf_Unsigned li_hdrlen; /* Length of line info header. */
|
||||||
Dwarf_Small li_minlen; /* Minimum instrutction length. */
|
Dwarf_Small li_minlen; /* Minimum instrutction length. */
|
||||||
|
Dwarf_Small li_maxop; /* Maximum operations per inst. */
|
||||||
Dwarf_Small li_defstmt; /* Default value of is_stmt. */
|
Dwarf_Small li_defstmt; /* Default value of is_stmt. */
|
||||||
int8_t li_lbase; /* Line base for special opcode. */
|
int8_t li_lbase; /* Line base for special opcode. */
|
||||||
Dwarf_Small li_lrange; /* Line range for special opcode. */
|
Dwarf_Small li_lrange; /* Line range for special opcode. */
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: libdwarf.h 3149 2015-02-15 19:00:06Z emaste $
|
* $Id: libdwarf.h 3174 2015-03-27 17:13:41Z emaste $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _LIBDWARF_H_
|
#ifndef _LIBDWARF_H_
|
||||||
@@ -444,7 +444,9 @@ enum Dwarf_ISA {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Function prototype definitions. */
|
/* Function prototype definitions. */
|
||||||
__BEGIN_DECLS
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
Dwarf_P_Attribute dwarf_add_AT_comp_dir(Dwarf_P_Die, char *, Dwarf_Error *);
|
Dwarf_P_Attribute dwarf_add_AT_comp_dir(Dwarf_P_Die, char *, Dwarf_Error *);
|
||||||
Dwarf_P_Attribute dwarf_add_AT_const_value_signedint(Dwarf_P_Die, Dwarf_Signed,
|
Dwarf_P_Attribute dwarf_add_AT_const_value_signedint(Dwarf_P_Die, Dwarf_Signed,
|
||||||
Dwarf_Error *);
|
Dwarf_Error *);
|
||||||
@@ -831,6 +833,8 @@ int dwarf_whatattr(Dwarf_Attribute, Dwarf_Half *, Dwarf_Error *);
|
|||||||
int dwarf_whatform(Dwarf_Attribute, Dwarf_Half *, Dwarf_Error *);
|
int dwarf_whatform(Dwarf_Attribute, Dwarf_Half *, Dwarf_Error *);
|
||||||
int dwarf_whatform_direct(Dwarf_Attribute, Dwarf_Half *,
|
int dwarf_whatform_direct(Dwarf_Attribute, Dwarf_Half *,
|
||||||
Dwarf_Error *);
|
Dwarf_Error *);
|
||||||
__END_DECLS
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* !_LIBDWARF_H_ */
|
#endif /* !_LIBDWARF_H_ */
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include "_libdwarf.h"
|
#include "_libdwarf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: libdwarf_lineno.c 3100 2014-10-25 20:34:29Z jkoshy $");
|
ELFTC_VCSID("$Id: libdwarf_lineno.c 3164 2015-02-19 01:20:12Z kaiwang27 $");
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_dwarf_lineno_add_file(Dwarf_LineInfo li, uint8_t **p, const char *compdir,
|
_dwarf_lineno_add_file(Dwarf_LineInfo li, uint8_t **p, const char *compdir,
|
||||||
@@ -315,6 +315,8 @@ _dwarf_lineno_init(Dwarf_Die die, uint64_t offset, Dwarf_Error *error)
|
|||||||
li->li_hdrlen = dbg->read(ds->ds_data, &offset, dwarf_size);
|
li->li_hdrlen = dbg->read(ds->ds_data, &offset, dwarf_size);
|
||||||
hdroff = offset;
|
hdroff = offset;
|
||||||
li->li_minlen = dbg->read(ds->ds_data, &offset, 1);
|
li->li_minlen = dbg->read(ds->ds_data, &offset, 1);
|
||||||
|
if (li->li_version == 4)
|
||||||
|
li->li_maxop = dbg->read(ds->ds_data, &offset, 1);
|
||||||
li->li_defstmt = dbg->read(ds->ds_data, &offset, 1);
|
li->li_defstmt = dbg->read(ds->ds_data, &offset, 1);
|
||||||
li->li_lbase = dbg->read(ds->ds_data, &offset, 1);
|
li->li_lbase = dbg->read(ds->ds_data, &offset, 1);
|
||||||
li->li_lrange = dbg->read(ds->ds_data, &offset, 1);
|
li->li_lrange = dbg->read(ds->ds_data, &offset, 1);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: _libelf.h 3011 2014-03-23 03:32:42Z jkoshy $
|
* $Id: _libelf.h 3174 2015-03-27 17:13:41Z emaste $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __LIBELF_H_
|
#ifndef __LIBELF_H_
|
||||||
@@ -194,7 +194,9 @@ enum {
|
|||||||
* Function Prototypes.
|
* Function Prototypes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
__BEGIN_DECLS
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
struct _Libelf_Data *_libelf_allocate_data(Elf_Scn *_s);
|
struct _Libelf_Data *_libelf_allocate_data(Elf_Scn *_s);
|
||||||
Elf *_libelf_allocate_elf(void);
|
Elf *_libelf_allocate_elf(void);
|
||||||
Elf_Scn *_libelf_allocate_scn(Elf *_e, size_t _ndx);
|
Elf_Scn *_libelf_allocate_scn(Elf *_e, size_t _ndx);
|
||||||
@@ -230,6 +232,8 @@ int _libelf_setshstrndx(Elf *_e, void *_eh, int _elfclass,
|
|||||||
Elf_Data *_libelf_xlate(Elf_Data *_d, const Elf_Data *_s,
|
Elf_Data *_libelf_xlate(Elf_Data *_d, const Elf_Data *_s,
|
||||||
unsigned int _encoding, int _elfclass, int _direction);
|
unsigned int _encoding, int _elfclass, int _direction);
|
||||||
int _libelf_xlate_shtype(uint32_t _sht);
|
int _libelf_xlate_shtype(uint32_t _sht);
|
||||||
__END_DECLS
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* __LIBELF_H_ */
|
#endif /* __LIBELF_H_ */
|
||||||
|
|||||||
@@ -23,10 +23,10 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: _libelf_config.h 3143 2015-02-15 17:57:38Z emaste $
|
* $Id: _libelf_config.h 3168 2015-02-24 19:17:47Z emaste $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef __DragonFly__
|
#if defined(__APPLE__) || defined(__DragonFly__)
|
||||||
|
|
||||||
#if defined(__amd64__)
|
#if defined(__amd64__)
|
||||||
#define LIBELF_ARCH EM_X86_64
|
#define LIBELF_ARCH EM_X86_64
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: elf_data.c 3009 2014-03-23 01:49:59Z jkoshy $");
|
ELFTC_VCSID("$Id: elf_data.c 3177 2015-03-30 18:19:41Z emaste $");
|
||||||
|
|
||||||
Elf_Data *
|
Elf_Data *
|
||||||
elf_getdata(Elf_Scn *s, Elf_Data *ed)
|
elf_getdata(Elf_Scn *s, Elf_Data *ed)
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -36,7 +34,7 @@
|
|||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: elf_end.c 2240 2011-11-28 06:36:48Z jkoshy $");
|
ELFTC_VCSID("$Id: elf_end.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
int
|
int
|
||||||
elf_end(Elf *e)
|
elf_end(Elf *e)
|
||||||
|
|||||||
@@ -24,15 +24,13 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: elf_errmsg.c 3012 2014-03-23 03:41:38Z jkoshy $");
|
ELFTC_VCSID("$Id: elf_errmsg.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Retrieve a human readable translation for an error message.
|
* Retrieve a human readable translation for an error message.
|
||||||
|
|||||||
@@ -24,13 +24,11 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: elf_errno.c 2225 2011-11-26 18:55:54Z jkoshy $");
|
ELFTC_VCSID("$Id: elf_errno.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
int
|
int
|
||||||
elf_errno(void)
|
elf_errno(void)
|
||||||
|
|||||||
@@ -24,13 +24,11 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: elf_fill.c 2225 2011-11-26 18:55:54Z jkoshy $");
|
ELFTC_VCSID("$Id: elf_fill.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
void
|
void
|
||||||
elf_fill(int fill)
|
elf_fill(int fill)
|
||||||
|
|||||||
@@ -24,13 +24,11 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: elf_flag.c 2988 2014-03-17 08:51:49Z jkoshy $");
|
ELFTC_VCSID("$Id: elf_flag.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
unsigned int
|
unsigned int
|
||||||
elf_flagarhdr(Elf_Arhdr *a, Elf_Cmd c, unsigned int flags)
|
elf_flagarhdr(Elf_Arhdr *a, Elf_Cmd c, unsigned int flags)
|
||||||
|
|||||||
@@ -24,13 +24,11 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: elf_getarhdr.c 2225 2011-11-26 18:55:54Z jkoshy $");
|
ELFTC_VCSID("$Id: elf_getarhdr.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
Elf_Arhdr *
|
Elf_Arhdr *
|
||||||
elf_getarhdr(Elf *e)
|
elf_getarhdr(Elf *e)
|
||||||
|
|||||||
@@ -24,13 +24,11 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: elf_getarsym.c 2225 2011-11-26 18:55:54Z jkoshy $");
|
ELFTC_VCSID("$Id: elf_getarsym.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
Elf_Arsym *
|
Elf_Arsym *
|
||||||
elf_getarsym(Elf *ar, size_t *ptr)
|
elf_getarsym(Elf *ar, size_t *ptr)
|
||||||
|
|||||||
@@ -24,13 +24,11 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: elf_getbase.c 2225 2011-11-26 18:55:54Z jkoshy $");
|
ELFTC_VCSID("$Id: elf_getbase.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
off_t
|
off_t
|
||||||
elf_getbase(Elf *e)
|
elf_getbase(Elf *e)
|
||||||
|
|||||||
@@ -24,15 +24,13 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <ar.h>
|
#include <ar.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: elf_getident.c 2225 2011-11-26 18:55:54Z jkoshy $");
|
ELFTC_VCSID("$Id: elf_getident.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
char *
|
char *
|
||||||
elf_getident(Elf *e, size_t *sz)
|
elf_getident(Elf *e, size_t *sz)
|
||||||
|
|||||||
@@ -24,13 +24,11 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: elf_hash.c 2225 2011-11-26 18:55:54Z jkoshy $");
|
ELFTC_VCSID("$Id: elf_hash.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This elf_hash function is defined by the System V ABI.
|
* This elf_hash function is defined by the System V ABI.
|
||||||
|
|||||||
@@ -24,13 +24,11 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: elf_kind.c 2225 2011-11-26 18:55:54Z jkoshy $");
|
ELFTC_VCSID("$Id: elf_kind.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
Elf_Kind
|
Elf_Kind
|
||||||
elf_kind(Elf *e)
|
elf_kind(Elf *e)
|
||||||
|
|||||||
@@ -24,15 +24,13 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <ar.h>
|
#include <ar.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: elf_next.c 2989 2014-03-17 09:56:46Z jkoshy $");
|
ELFTC_VCSID("$Id: elf_next.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
Elf_Cmd
|
Elf_Cmd
|
||||||
elf_next(Elf *e)
|
elf_next(Elf *e)
|
||||||
|
|||||||
@@ -24,14 +24,12 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <ar.h>
|
#include <ar.h>
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: elf_phnum.c 2225 2011-11-26 18:55:54Z jkoshy $");
|
ELFTC_VCSID("$Id: elf_phnum.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_libelf_getphdrnum(Elf *e, size_t *phnum)
|
_libelf_getphdrnum(Elf *e, size_t *phnum)
|
||||||
|
|||||||
@@ -24,14 +24,12 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <ar.h>
|
#include <ar.h>
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: elf_rand.c 2991 2014-03-17 09:57:04Z jkoshy $");
|
ELFTC_VCSID("$Id: elf_rand.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
off_t
|
off_t
|
||||||
elf_rand(Elf *ar, off_t offset)
|
elf_rand(Elf *ar, off_t offset)
|
||||||
|
|||||||
@@ -24,13 +24,11 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: elf_rawfile.c 3013 2014-03-23 06:16:59Z jkoshy $");
|
ELFTC_VCSID("$Id: elf_rawfile.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
char *
|
char *
|
||||||
elf_rawfile(Elf *e, size_t *sz)
|
elf_rawfile(Elf *e, size_t *sz)
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@@ -37,7 +36,7 @@
|
|||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: elf_scn.c 3147 2015-02-15 18:45:23Z emaste $");
|
ELFTC_VCSID("$Id: elf_scn.c 3177 2015-03-30 18:19:41Z emaste $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Load an ELF section table and create a list of Elf_Scn structures.
|
* Load an ELF section table and create a list of Elf_Scn structures.
|
||||||
|
|||||||
@@ -24,14 +24,12 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <ar.h>
|
#include <ar.h>
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: elf_shnum.c 2225 2011-11-26 18:55:54Z jkoshy $");
|
ELFTC_VCSID("$Id: elf_shnum.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_libelf_getshdrnum(Elf *e, size_t *shnum)
|
_libelf_getshdrnum(Elf *e, size_t *shnum)
|
||||||
|
|||||||
@@ -24,14 +24,12 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <ar.h>
|
#include <ar.h>
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: elf_shstrndx.c 2225 2011-11-26 18:55:54Z jkoshy $");
|
ELFTC_VCSID("$Id: elf_shstrndx.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_libelf_getshdrstrndx(Elf *e, size_t *strndx)
|
_libelf_getshdrstrndx(Elf *e, size_t *strndx)
|
||||||
|
|||||||
@@ -24,13 +24,11 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: elf_version.c 2225 2011-11-26 18:55:54Z jkoshy $");
|
ELFTC_VCSID("$Id: elf_version.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
unsigned int
|
unsigned int
|
||||||
elf_version(unsigned int v)
|
elf_version(unsigned int v)
|
||||||
|
|||||||
@@ -23,14 +23,12 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: gelf.h 1168 2010-09-04 01:03:25Z jkoshy $
|
* $Id: gelf.h 3174 2015-03-27 17:13:41Z emaste $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _GELF_H_
|
#ifndef _GELF_H_
|
||||||
#define _GELF_H_
|
#define _GELF_H_
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
typedef Elf64_Addr GElf_Addr; /* Addresses */
|
typedef Elf64_Addr GElf_Addr; /* Addresses */
|
||||||
@@ -69,7 +67,9 @@ typedef Elf64_Syminfo GElf_Syminfo; /* Symbol information */
|
|||||||
#define GELF_ST_TYPE ELF64_ST_TYPE
|
#define GELF_ST_TYPE ELF64_ST_TYPE
|
||||||
#define GELF_ST_VISIBILITY ELF64_ST_VISIBILITY
|
#define GELF_ST_VISIBILITY ELF64_ST_VISIBILITY
|
||||||
|
|
||||||
__BEGIN_DECLS
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
long gelf_checksum(Elf *_elf);
|
long gelf_checksum(Elf *_elf);
|
||||||
size_t gelf_fsize(Elf *_elf, Elf_Type _type, size_t _count,
|
size_t gelf_fsize(Elf *_elf, Elf_Type _type, size_t _count,
|
||||||
unsigned int _version);
|
unsigned int _version);
|
||||||
@@ -103,6 +103,8 @@ GElf_Syminfo *gelf_getsyminfo(Elf_Data *_src, int _index, GElf_Syminfo *_dst);
|
|||||||
int gelf_update_cap(Elf_Data *_dst, int _index, GElf_Cap *_src);
|
int gelf_update_cap(Elf_Data *_dst, int _index, GElf_Cap *_src);
|
||||||
int gelf_update_move(Elf_Data *_dst, int _index, GElf_Move *_src);
|
int gelf_update_move(Elf_Data *_dst, int _index, GElf_Move *_src);
|
||||||
int gelf_update_syminfo(Elf_Data *_dst, int _index, GElf_Syminfo *_src);
|
int gelf_update_syminfo(Elf_Data *_dst, int _index, GElf_Syminfo *_src);
|
||||||
__END_DECLS
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _GELF_H_ */
|
#endif /* _GELF_H_ */
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <gelf.h>
|
#include <gelf.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
@@ -33,7 +31,7 @@
|
|||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: gelf_cap.c 2995 2014-03-18 02:16:31Z jkoshy $");
|
ELFTC_VCSID("$Id: gelf_cap.c 3177 2015-03-30 18:19:41Z emaste $");
|
||||||
|
|
||||||
GElf_Cap *
|
GElf_Cap *
|
||||||
gelf_getcap(Elf_Data *ed, int ndx, GElf_Cap *dst)
|
gelf_getcap(Elf_Data *ed, int ndx, GElf_Cap *dst)
|
||||||
|
|||||||
@@ -24,14 +24,12 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <gelf.h>
|
#include <gelf.h>
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: gelf_checksum.c 2225 2011-11-26 18:55:54Z jkoshy $");
|
ELFTC_VCSID("$Id: gelf_checksum.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
long
|
long
|
||||||
elf32_checksum(Elf *e)
|
elf32_checksum(Elf *e)
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <gelf.h>
|
#include <gelf.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
@@ -33,7 +31,7 @@
|
|||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: gelf_dyn.c 2998 2014-03-18 17:19:00Z jkoshy $");
|
ELFTC_VCSID("$Id: gelf_dyn.c 3177 2015-03-30 18:19:41Z emaste $");
|
||||||
|
|
||||||
GElf_Dyn *
|
GElf_Dyn *
|
||||||
gelf_getdyn(Elf_Data *ed, int ndx, GElf_Dyn *dst)
|
gelf_getdyn(Elf_Data *ed, int ndx, GElf_Dyn *dst)
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <gelf.h>
|
#include <gelf.h>
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
@@ -35,7 +33,7 @@
|
|||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: gelf_ehdr.c 2268 2011-12-03 17:05:11Z jkoshy $");
|
ELFTC_VCSID("$Id: gelf_ehdr.c 3177 2015-03-30 18:19:41Z emaste $");
|
||||||
|
|
||||||
Elf32_Ehdr *
|
Elf32_Ehdr *
|
||||||
elf32_getehdr(Elf *e)
|
elf32_getehdr(Elf *e)
|
||||||
|
|||||||
@@ -24,14 +24,12 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <gelf.h>
|
#include <gelf.h>
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: gelf_fsize.c 2225 2011-11-26 18:55:54Z jkoshy $");
|
ELFTC_VCSID("$Id: gelf_fsize.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
elf32_fsize(Elf_Type t, size_t c, unsigned int v)
|
elf32_fsize(Elf_Type t, size_t c, unsigned int v)
|
||||||
|
|||||||
@@ -24,13 +24,11 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <gelf.h>
|
#include <gelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: gelf_getclass.c 2225 2011-11-26 18:55:54Z jkoshy $");
|
ELFTC_VCSID("$Id: gelf_getclass.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
int
|
int
|
||||||
gelf_getclass(Elf *e)
|
gelf_getclass(Elf *e)
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <gelf.h>
|
#include <gelf.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
@@ -33,7 +31,7 @@
|
|||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: gelf_move.c 2998 2014-03-18 17:19:00Z jkoshy $");
|
ELFTC_VCSID("$Id: gelf_move.c 3177 2015-03-30 18:19:41Z emaste $");
|
||||||
|
|
||||||
GElf_Move *
|
GElf_Move *
|
||||||
gelf_getmove(Elf_Data *ed, int ndx, GElf_Move *dst)
|
gelf_getmove(Elf_Data *ed, int ndx, GElf_Move *dst)
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <gelf.h>
|
#include <gelf.h>
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
@@ -33,7 +31,7 @@
|
|||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: gelf_phdr.c 2268 2011-12-03 17:05:11Z jkoshy $");
|
ELFTC_VCSID("$Id: gelf_phdr.c 3177 2015-03-30 18:19:41Z emaste $");
|
||||||
|
|
||||||
Elf32_Phdr *
|
Elf32_Phdr *
|
||||||
elf32_getphdr(Elf *e)
|
elf32_getphdr(Elf *e)
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <gelf.h>
|
#include <gelf.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
@@ -33,7 +31,7 @@
|
|||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: gelf_rel.c 2998 2014-03-18 17:19:00Z jkoshy $");
|
ELFTC_VCSID("$Id: gelf_rel.c 3177 2015-03-30 18:19:41Z emaste $");
|
||||||
|
|
||||||
GElf_Rel *
|
GElf_Rel *
|
||||||
gelf_getrel(Elf_Data *ed, int ndx, GElf_Rel *dst)
|
gelf_getrel(Elf_Data *ed, int ndx, GElf_Rel *dst)
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <gelf.h>
|
#include <gelf.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
@@ -33,7 +31,7 @@
|
|||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: gelf_rela.c 2998 2014-03-18 17:19:00Z jkoshy $");
|
ELFTC_VCSID("$Id: gelf_rela.c 3177 2015-03-30 18:19:41Z emaste $");
|
||||||
|
|
||||||
GElf_Rela *
|
GElf_Rela *
|
||||||
gelf_getrela(Elf_Data *ed, int ndx, GElf_Rela *dst)
|
gelf_getrela(Elf_Data *ed, int ndx, GElf_Rela *dst)
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <gelf.h>
|
#include <gelf.h>
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
@@ -34,7 +32,7 @@
|
|||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: gelf_shdr.c 2268 2011-12-03 17:05:11Z jkoshy $");
|
ELFTC_VCSID("$Id: gelf_shdr.c 3177 2015-03-30 18:19:41Z emaste $");
|
||||||
|
|
||||||
Elf32_Shdr *
|
Elf32_Shdr *
|
||||||
elf32_getshdr(Elf_Scn *s)
|
elf32_getshdr(Elf_Scn *s)
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <gelf.h>
|
#include <gelf.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
@@ -33,7 +31,7 @@
|
|||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: gelf_sym.c 2999 2014-03-18 17:19:06Z jkoshy $");
|
ELFTC_VCSID("$Id: gelf_sym.c 3177 2015-03-30 18:19:41Z emaste $");
|
||||||
|
|
||||||
GElf_Sym *
|
GElf_Sym *
|
||||||
gelf_getsym(Elf_Data *ed, int ndx, GElf_Sym *dst)
|
gelf_getsym(Elf_Data *ed, int ndx, GElf_Sym *dst)
|
||||||
|
|||||||
@@ -24,14 +24,12 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <gelf.h>
|
#include <gelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: gelf_syminfo.c 2998 2014-03-18 17:19:00Z jkoshy $");
|
ELFTC_VCSID("$Id: gelf_syminfo.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
GElf_Syminfo *
|
GElf_Syminfo *
|
||||||
gelf_getsyminfo(Elf_Data *ed, int ndx, GElf_Syminfo *dst)
|
gelf_getsyminfo(Elf_Data *ed, int ndx, GElf_Syminfo *dst)
|
||||||
|
|||||||
@@ -24,14 +24,12 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <gelf.h>
|
#include <gelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: gelf_symshndx.c 2998 2014-03-18 17:19:00Z jkoshy $");
|
ELFTC_VCSID("$Id: gelf_symshndx.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
GElf_Sym *
|
GElf_Sym *
|
||||||
gelf_getsymshndx(Elf_Data *d, Elf_Data *id, int ndx, GElf_Sym *dst,
|
gelf_getsymshndx(Elf_Data *d, Elf_Data *id, int ndx, GElf_Sym *dst,
|
||||||
|
|||||||
@@ -24,15 +24,13 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <gelf.h>
|
#include <gelf.h>
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: gelf_xlate.c 2225 2011-11-26 18:55:54Z jkoshy $");
|
ELFTC_VCSID("$Id: gelf_xlate.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
Elf_Data *
|
Elf_Data *
|
||||||
elf32_xlatetof(Elf_Data *dst, const Elf_Data *src, unsigned int encoding)
|
elf32_xlatetof(Elf_Data *dst, const Elf_Data *src, unsigned int encoding)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: libelf.h 2988 2014-03-17 08:51:49Z jkoshy $
|
* $Id: libelf.h 3174 2015-03-27 17:13:41Z emaste $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _LIBELF_H_
|
#ifndef _LIBELF_H_
|
||||||
@@ -176,7 +176,9 @@ enum Elf_Error {
|
|||||||
#define ELF_F_ARCHIVE 0x100U /* archive creation */
|
#define ELF_F_ARCHIVE 0x100U /* archive creation */
|
||||||
#define ELF_F_ARCHIVE_SYSV 0x200U /* SYSV style archive */
|
#define ELF_F_ARCHIVE_SYSV 0x200U /* SYSV style archive */
|
||||||
|
|
||||||
__BEGIN_DECLS
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
Elf *elf_begin(int _fd, Elf_Cmd _cmd, Elf *_elf);
|
Elf *elf_begin(int _fd, Elf_Cmd _cmd, Elf *_elf);
|
||||||
int elf_cntl(Elf *_elf, Elf_Cmd _cmd);
|
int elf_cntl(Elf *_elf, Elf_Cmd _cmd);
|
||||||
int elf_end(Elf *_elf);
|
int elf_end(Elf *_elf);
|
||||||
@@ -247,6 +249,8 @@ Elf_Data *elf64_xlatetof(Elf_Data *_dst, const Elf_Data *_src,
|
|||||||
unsigned int _enc);
|
unsigned int _enc);
|
||||||
Elf_Data *elf64_xlatetom(Elf_Data *_dst, const Elf_Data *_src,
|
Elf_Data *elf64_xlatetom(Elf_Data *_dst, const Elf_Data *_src,
|
||||||
unsigned int _enc);
|
unsigned int _enc);
|
||||||
__END_DECLS
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _LIBELF_H_ */
|
#endif /* _LIBELF_H_ */
|
||||||
|
|||||||
@@ -24,15 +24,13 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: libelf_align.c 3006 2014-03-22 08:10:07Z jkoshy $");
|
ELFTC_VCSID("$Id: libelf_align.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
struct align {
|
struct align {
|
||||||
unsigned int a32;
|
unsigned int a32;
|
||||||
|
|||||||
@@ -28,8 +28,6 @@
|
|||||||
* Internal APIs
|
* Internal APIs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
@@ -38,7 +36,7 @@
|
|||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: libelf_allocate.c 2272 2011-12-03 17:07:31Z jkoshy $");
|
ELFTC_VCSID("$Id: libelf_allocate.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
Elf *
|
Elf *
|
||||||
_libelf_allocate_elf(void)
|
_libelf_allocate_elf(void)
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
@@ -35,7 +33,7 @@
|
|||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
#include "_libelf_ar.h"
|
#include "_libelf_ar.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: libelf_ar.c 3013 2014-03-23 06:16:59Z jkoshy $");
|
ELFTC_VCSID("$Id: libelf_ar.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
#define LIBELF_NALLOC_SIZE 16
|
#define LIBELF_NALLOC_SIZE 16
|
||||||
|
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -34,7 +32,7 @@
|
|||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
#include "_libelf_ar.h"
|
#include "_libelf_ar.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: libelf_ar_util.c 3157 2015-02-15 21:42:02Z emaste $");
|
ELFTC_VCSID("$Id: libelf_ar_util.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert a string bounded by `start' and `start+sz' (exclusive) to a
|
* Convert a string bounded by `start' and `start+sz' (exclusive) to a
|
||||||
|
|||||||
@@ -24,13 +24,11 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <gelf.h>
|
#include <gelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: libelf_checksum.c 3003 2014-03-22 07:43:10Z jkoshy $");
|
ELFTC_VCSID("$Id: libelf_checksum.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
static unsigned long
|
static unsigned long
|
||||||
_libelf_sum(unsigned long c, const unsigned char *s, size_t size)
|
_libelf_sum(unsigned long c, const unsigned char *s, size_t size)
|
||||||
|
|||||||
@@ -24,15 +24,13 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: libelf_convert.m4 3158 2015-02-15 21:42:07Z emaste $");
|
ELFTC_VCSID("$Id: libelf_convert.m4 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
/* WARNING: GENERATED FROM __file__. */
|
/* WARNING: GENERATED FROM __file__. */
|
||||||
|
|
||||||
|
|||||||
@@ -24,13 +24,11 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: libelf_data.c 3080 2014-07-28 08:46:17Z jkoshy $");
|
ELFTC_VCSID("$Id: libelf_data.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
int
|
int
|
||||||
_libelf_xlate_shtype(uint32_t sht)
|
_libelf_xlate_shtype(uint32_t sht)
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <gelf.h>
|
#include <gelf.h>
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
@@ -33,7 +31,7 @@
|
|||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: libelf_ehdr.c 3009 2014-03-23 01:49:59Z jkoshy $");
|
ELFTC_VCSID("$Id: libelf_ehdr.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Retrieve counts for sections, phdrs and the section string table index
|
* Retrieve counts for sections, phdrs and the section string table index
|
||||||
|
|||||||
@@ -24,14 +24,12 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: libelf_extended.c 3005 2014-03-22 07:43:25Z jkoshy $");
|
ELFTC_VCSID("$Id: libelf_extended.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Retrieve section #0, allocating a new section if needed.
|
* Retrieve section #0, allocating a new section if needed.
|
||||||
|
|||||||
@@ -24,15 +24,13 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <libelf.h>
|
#include <libelf.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "_libelf.h"
|
#include "_libelf.h"
|
||||||
|
|
||||||
ELFTC_VCSID("$Id: libelf_msize.m4 2225 2011-11-26 18:55:54Z jkoshy $");
|
ELFTC_VCSID("$Id: libelf_msize.m4 3174 2015-03-27 17:13:41Z emaste $");
|
||||||
|
|
||||||
/* WARNING: GENERATED FROM __file__. */
|
/* WARNING: GENERATED FROM __file__. */
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user