Merge from HEAD

This commit is contained in:
Baptiste Daroussin 2015-04-03 23:23:09 +00:00
commit 4bf53d0b46
4107 changed files with 1000026 additions and 442559 deletions

View File

@ -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.
.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) && \
${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
.if defined(TARGET) && !defined(_TARGET)
_TARGET=${TARGET}

View File

@ -164,7 +164,7 @@ EXTRA_REVISION= _${BRANCH:C/.*-p([0-9]+$)/\1/}
PKG_VERSION= ${REVISION}${EXTRA_REVISION}
.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}
_t= ${TARGET}
.else
@ -224,7 +224,9 @@ INSTALLTMP!= /usr/bin/mktemp -d -u -t install
# 1. legacy stage [BMAKE]
# This stage is responsible for creating compatibility
# 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]
# This stage is responsible for creating programs that
# are needed for backward compatibility reasons. They
@ -235,7 +237,7 @@ INSTALLTMP!= /usr/bin/mktemp -d -u -t install
# the build process.
# 3. cross-tools stage [XMAKE]
# 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.
# 4. world stage [WMAKE]
# This stage actually builds the world.
@ -274,7 +276,8 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \
-DNO_PIC MK_PROFILE=no -DNO_SHARED \
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=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
TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \
@ -356,7 +359,8 @@ X${COMPILER}?= ${${COMPILER}}
.endfor
XBINUTILS= AS AR LD NM OBJCOPY OBJDUMP RANLIB SIZE STRINGS
.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}}
.else
X${BINUTIL}?= ${${BINUTIL}}
@ -396,9 +400,9 @@ DEPFLAGS+= -I${WORLDTMP}/usr/include/c++/v1
TARGET_ABI?= unknown
TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0
XCFLAGS+= -target ${TARGET_TRIPLE}
.endif
XCFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS}
XCXXFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS}
.endif
.else
.if defined(CROSS_BINUTILS_PREFIX) && exists(${CROSS_BINUTILS_PREFIX})
BFLAGS+= -B${CROSS_BINUTILS_PREFIX}
@ -423,8 +427,9 @@ LIB32CPUFLAGS= -march=${TARGET_CPUTYPE}
LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \
MACHINE_CPU="i686 mmx sse sse2"
LIB32WMAKEFLAGS= \
AS="${AS} --32" \
LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32"
AS="${XAS} --32" \
LD="${XLD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \
OBJCOPY="${XOBJCOPY}"
.elif ${TARGET_ARCH} == "powerpc64"
.if empty(TARGET_CPUTYPE)
@ -434,7 +439,8 @@ LIB32CPUFLAGS= -mcpu=${TARGET_CPUTYPE}
.endif
LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc
LIB32WMAKEFLAGS= \
LD="${LD} -m elf32ppc_fbsd"
LD="${XLD} -m elf32ppc_fbsd" \
OBJCOPY="${XOBJCOPY}"
.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:
.if ${BOOTSTRAPPING} < 800107 && ${BOOTSTRAPPING} != 0
@ -1363,7 +1371,10 @@ legacy:
.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
@ -1569,7 +1580,9 @@ kernel-tools: .MAKE
-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} == "amd64" || ${TARGET_ARCH} == "i386"
@ -1600,6 +1613,11 @@ _elftctools= lib/libelftc \
# cross-build on a FreeBSD 10 host:
_elftctools+= usr.bin/addr2line
.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
# If an full path to an external cross compiler is given, don't build

View File

@ -38,6 +38,12 @@
# xargs -n1 | sort | uniq -d;
# 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.
OLD_FILES+=usr/include/clang/3.5.1/__wmmintrin_aes.h
OLD_FILES+=usr/include/clang/3.5.1/__wmmintrin_pclmul.h

View File

@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
disable the most expensive debugging functionality run
"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:
Clang, llvm and lldb have been upgraded to 3.6.0 release. Please see
the 20141231 entry below for information about prerequisites and

View File

@ -342,7 +342,7 @@ setfile(struct stat *fs, int fd)
tspec[0] = fs->st_atim;
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)) {
warn("utimensat: %s", to.p_path);
rval = 1;

View File

@ -6,6 +6,9 @@ PROG= expr
SRCS= expr.y
YFLAGS=
# expr relies on signed integer wrapping
CFLAGS+= -fwrapv
NO_WMISSING_VARIABLE_DECLARATIONS=
.if ${MK_TESTS} != "no"

View File

@ -352,7 +352,7 @@ err: if (unlink(to))
ts[0] = sbp->st_atim;
ts[1] = sbp->st_mtim;
if (utimensat(AT_FDCWD, to, ts, 0))
if (futimens(to_fd, ts))
warn("%s: set times", to);
if (close(to_fd)) {

View File

@ -82,7 +82,7 @@ static int wr_trail = 1; /* trailer was rewritten in append */
static int can_unlnk = 0; /* do we unlink null archives? */
const char *arcname; /* printable name of archive */
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 void ar_start_gzip(int, const char *, int);
@ -1123,7 +1123,7 @@ ar_next(void)
if (sigprocmask(SIG_SETMASK, &o_mask, NULL) < 0)
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);
tty_prnt("\nATTENTION! %s archive volume change required.\n", argv0);

View File

@ -217,6 +217,7 @@ extern int vflag;
extern int Dflag;
extern int Hflag;
extern int Lflag;
extern int Oflag;
extern int Xflag;
extern int Yflag;
extern int Zflag;

View File

@ -194,7 +194,7 @@ pax_options(int argc, char **argv)
/*
* 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) {
switch (c) {
case 'a':
@ -447,6 +447,12 @@ pax_options(int argc, char **argv)
Lflag = 1;
flg |= CLF;
break;
case 'O':
/*
* Force one volume. Non standard option.
*/
Oflag = 1;
break;
case 'P':
/*
* do NOT follow symlinks (default)
@ -584,7 +590,7 @@ tar_options(int argc, char **argv)
{
int c;
int fstdin = 0;
int Oflag = 0;
int tar_Oflag = 0;
int nincfiles = 0;
int incfiles_max = 0;
struct incfile {
@ -664,7 +670,7 @@ tar_options(int argc, char **argv)
if (opt_add("write_opt=nodir") < 0)
tar_usage();
case 'O':
Oflag = 1;
tar_Oflag = 1;
break;
case 'p':
/*
@ -820,8 +826,8 @@ tar_options(int argc, char **argv)
* (unless -o specified)
*/
if (act == ARCHIVE || act == APPND)
frmt = &(fsub[Oflag ? F_OTAR : F_TAR]);
else if (Oflag) {
frmt = &(fsub[tar_Oflag ? F_OTAR : F_TAR]);
else if (tar_Oflag) {
paxwarn(1, "The -O/-o options are only valid when writing an archive");
tar_usage(); /* only valid when writing */
}
@ -1526,25 +1532,25 @@ no_op(void)
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("\n [-G group] ... ", stderr);
(void)fputs("[-T [from_date][,to_date]] ... ", 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(" [-p string] ... [-s replstr] ... ", stderr);
(void)fputs("[-U user] ... [-G group] ...\n ", stderr);
(void)fputs("[-T [from_date][,to_date]] ... ", 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(" [-B bytes] [-s replstr] ... ", stderr);
(void)fputs("[-o options] ... [-U user] ...", stderr);
(void)fputs("\n [-G group] ... ", stderr);
(void)fputs("[-T [from_date][,to_date][/[c][m]]] ... ", 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("\n [-U user] ... [-G group] ... ", stderr);
(void)fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr);

View File

@ -33,7 +33,7 @@
.\" @(#)pax.1 8.4 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
.Dd December 21, 2013
.Dd March 17, 2015
.Dt PAX 1
.Os
.Sh NAME
@ -41,7 +41,7 @@
.Nd read and write file archives and copy directory hierarchies
.Sh SYNOPSIS
.Nm
.Op Fl cdnvz
.Op Fl cdnvzO
.Bk -words
.Op Fl f Ar archive
.Ek
@ -68,7 +68,7 @@
.Op Ar pattern ...\&
.Nm
.Fl r
.Op Fl cdiknuvzDYZ
.Op Fl cdiknuvzDOYZ
.Bk -words
.Op Fl f Ar archive
.Ek
@ -104,7 +104,7 @@
.Op Ar pattern ...\&
.Nm
.Fl w
.Op Fl dituvzHLPX
.Op Fl dituvzHLOPX
.Bk -words
.Op Fl b Ar blocksize
.Ek
@ -147,7 +147,7 @@
.Nm
.Fl r
.Fl w
.Op Fl diklntuvDHLPXYZ
.Op Fl diklntuvDHLOPXYZ
.Bk -words
.Op Fl p Ar string
.Ar ...\&
@ -853,6 +853,13 @@ Follow only command line symbolic links while performing a physical file
system traversal.
.It Fl L
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
Do not follow symbolic links, perform a physical file system traversal.
This is the default mode.
@ -1176,6 +1183,7 @@ The options
.Fl G ,
.Fl H ,
.Fl L ,
.Fl O ,
.Fl P ,
.Fl T ,
.Fl U ,

View File

@ -85,6 +85,7 @@ int vflag; /* produce verbose output */
int Dflag; /* same as uflag except inode change time */
int Hflag; /* follow command line symlinks (write only) */
int Lflag; /* follow symlinks when writing */
int Oflag; /* limit to single volume */
int Xflag; /* archive files with same device id only */
int Yflag; /* same as Dflg except after name mode */
int Zflag; /* same as uflg except after name mode */

View File

@ -49,6 +49,8 @@ FILES+= ifs2.0
FILES+= ifs3.0
FILES+= ifs4.0
FILES+= ifs5.0
FILES+= ifs6.0
FILES+= ifs7.0
FILES+= length1.0
FILES+= length2.0
FILES+= length3.0

View File

@ -0,0 +1,6 @@
# $FreeBSD$
IFS=': '
x=': :'
set -- $x
[ "$#|$1|$2|$3" = "2|||" ]

View File

@ -0,0 +1,5 @@
# $FreeBSD$
IFS=2
set -- $((123))
[ "$#|$1|$2|$3" = "2|1|3|" ]

View File

@ -35,11 +35,11 @@ BEGIN
this->b = -2;
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("ping localhost");
system("ping -q -c 1 localhost 2>/dev/null | grep -v '^round-trip '");
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);
exit(0);
}

View File

@ -1,8 +1,17 @@
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
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
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

View File

@ -45,12 +45,13 @@ fi
dtrace=$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
/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
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[4]: %d %d %d %d %d)\n",
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[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[4]: %d %d %d %d %d)\n",
args[4]->ipv4_ver, args[4]->ipv4_length, args[4]->ipv4_flags,

View File

@ -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)
2 ip:::receive (args[2]: 4 64, args[4]: 4 84 0 0 255)
2 ip:::receive (args[2]: 4 64, args[4]: 4 84 0 0 255)
127.0.0.1 is alive
PING 127.0.0.1 (127.0.0.1): 56 data bytes
1 packets transmitted, 1 packets received, 0.0% packet loss
2 ip:::send (args[2]: 4 64, args[4]: 4 84 0 0 64)
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)

View File

@ -73,6 +73,7 @@ cat > test.pl <<-EOPERL
Timeout => 3);
die "Could not connect to host $local port $tcpport" unless \$s;
close \$s;
sleep(2);
EOPERL
$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE

View File

@ -76,6 +76,7 @@ cat > test.pl <<-EOPERL
Timeout => 3);
die "Could not connect to host $dest port $tcpport" unless \$s;
close \$s;
sleep(2);
EOPERL
$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE

View File

@ -55,12 +55,13 @@ else
removeinet6=0
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
/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
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[5]: %d %d %d)\n",
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[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[5]: %d %d %d)\n",
args[5]->ipv6_ver, args[5]->ipv6_tclass, args[5]->ipv6_plen);

View File

@ -1,6 +1,8 @@
::1 is alive
1 ip:::send (args[2]: 6 64, args[5]: 6 0 64)
1 ip:::send (args[2]: 6 64, args[5]: 6 0 64)
2 ip:::receive (args[2]: 6 64, args[5]: 6 0 64)
2 ip:::receive (args[2]: 6 64, args[5]: 6 0 64)
PING6(56=40+8+8 bytes) ::1 --> ::1
1 packets transmitted, 1 packets received, 0.0% packet loss
2 ip:::send (args[2]: 6 16, args[5]: 6 0 16)
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)

View File

@ -79,6 +79,7 @@ cat > test.pl <<-EOPERL
die "Could not connect to host $local port $tcpport" unless \$s;
print \$s "testing state machine transitions";
close \$s;
sleep(2);
EOPERL
$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE

View File

@ -84,6 +84,7 @@ cat > test.pl <<-EOPERL
die "Could not connect to host $dest port $tcpport" unless \$s;
print \$s "testing state machine transitions";
close \$s;
sleep(2);
EOPERL
$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE

View File

@ -727,8 +727,8 @@ dt_print_packed(dtrace_hdl_t *dtp, FILE *fp,
utf8 = B_TRUE;
} else if ((term = getenv("TERM")) != NULL &&
(strcmp(term, "sun") == 0 ||
strcmp(term, "sun-color") == 0) ||
strcmp(term, "dumb") == 0) {
strcmp(term, "sun-color") == 0 ||
strcmp(term, "dumb") == 0)) {
utf8 = B_FALSE;
} else {
utf8 = B_TRUE;

View File

@ -8,10 +8,8 @@ TESTS_SUBDIRS+= common
.PATH: ${.CURDIR:H:H:H:H}/tests
KYUAFILE= YES
.PATH: ${.CURDIR:H:H:H}/contrib/opensolaris/cmd/dtrace/test/cmd/scripts
.PATH: ${.CURDIR}/tools
SCRIPTSDIR= ${TESTSDIR}
SCRIPTS= dtest.pl
SUBDIR_PARALLEL=
SCRIPTS= dtest.sh
.include <bsd.test.mk>

View File

@ -16,7 +16,6 @@ ${TESTGROUP}EXEDIR= ${TESTSDIR}
TESTWRAPPER= t_dtrace_contrib
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_user="root"

View File

@ -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

View File

@ -33,8 +33,8 @@ ${tcase}_head()
${tcase}_body()
{
$mod
atf_check -s exit:0 -o ignore -e ignore \\
"\$(atf_get_srcdir)/../../dtest" -n "\$(atf_get_srcdir)/${tfile}"
atf_check -s exit:0 -o empty -e empty \\
"\$(atf_get_srcdir)/../../dtest" "\$(atf_get_srcdir)/${tfile}"
}
__EOF__
}

View File

@ -1286,7 +1286,7 @@ struct elf_find_verdep_info
};
/* 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
is an integer value; type & 2 indicates whether there is a string

View File

@ -6835,6 +6835,8 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
case Tag_ABI_FP_number_model:
case Tag_ABI_align8_preserved:
case Tag_ABI_HardFP_use:
case Tag_CPU_unaligned_access:
case Tag_FP_HP_extension:
/* Use the largest value specified. */
if (in_attr[i].i > out_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;
default: /* All known attributes should be explicitly covered. */
abort ();
/* XXX Not now */
/* abort (); */
break;
}
}

View File

@ -271,7 +271,11 @@ enum
Tag_ABI_optimization_goals,
Tag_ABI_FP_optimization_goals,
/* 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,
};

View File

@ -9,6 +9,7 @@
*/
#include "int_lib.h"
#include <stddef.h>
#if __APPLE__
#include <libkern/OSCacheControl.h>

View File

@ -24,7 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <sys/param.h>
#include <dwarf.h>
#include <err.h>
@ -40,7 +39,7 @@
#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[] = {
{"target" , required_argument, NULL, 'b'},

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* 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)
#endif
#if defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
#if defined(__APPLE__) || defined(__GLIBC__) || defined(__GNU__) || \
defined(__linux__)
#if defined(__GNUC__)
#define ELFTC_VCSID(ID) __asm__(".ident\t\"" ID "\"")
#else
@ -330,8 +331,8 @@ struct name { \
#ifndef ELFTC_GETPROGNAME
#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__minix) || \
defined(__NetBSD__)
#if defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || \
defined(__minix) || defined(__NetBSD__)
#include <stdlib.h>
@ -340,7 +341,7 @@ struct name { \
#endif /* __DragonFly__ || __FreeBSD__ || __minix || __NetBSD__ */
#if defined(__GLIBC__)
#if defined(__GLIBC__) || defined(__linux__)
/*
* 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
#endif /* __GLIBC__ */
#endif /* __GLIBC__ || __linux__ */
#if defined(__OpenBSD__)
@ -368,6 +369,21 @@ extern const char *__progname;
** 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__)
#include <osreldate.h>
@ -381,7 +397,7 @@ extern const char *__progname;
#endif
#if defined(__GLIBC__)
#if defined(__GLIBC__) || defined(__linux__)
#include <endian.h>
@ -401,7 +417,7 @@ extern const char *__progname;
#define roundup2 roundup
#endif /* __GLIBC__ */
#endif /* __GLIBC__ || __linux__ */
#if defined(__FreeBSD__)

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* 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") \
_ELF_DEFINE_DT(DT_MOVESZ, 0x6FFFFDFBUL, \
"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, \
"dynamic position flags") \
_ELF_DEFINE_DT(DT_SYMINSZ, 0x6FFFFDFEUL, \

View File

@ -1,6 +1,6 @@
#!/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
# test object and examining the resulting object.
@ -19,7 +19,7 @@ touch ${tmp_c}
echo "/* Generated by ${program} on `date` */"
cc -c ${tmp_c} -o ${tmp_o}
readelf -h ${tmp_o} | awk '
LC_ALL=C readelf -h ${tmp_o} | awk '
$1 ~ "Class:" {
sub("ELF","",$2); elfclass = $2;
}

View File

@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <sys/param.h>
#include <ctype.h>
#include <err.h>
@ -36,7 +35,7 @@
#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

View File

@ -24,8 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <err.h>
@ -40,7 +38,7 @@
#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 _ARHDR_LEN 60 /* length of ar header */

View File

@ -24,7 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <sys/param.h>
#include <ctype.h>
#include <err.h>
@ -37,7 +36,7 @@
#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 char hex_digit(uint8_t n);

View File

@ -24,7 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <err.h>
@ -36,7 +35,7 @@
#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

View File

@ -21,9 +21,9 @@
.\" out of the use of this software, even if advised of the possibility of
.\" 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
.Dt ELFCOPY 1
.Sh NAME
@ -63,7 +63,9 @@
.Op Fl -adjust-warnings | Fl -change-warnings
.Op Fl -change-section-lma 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 -localize-hidden
.Op Fl -no-adjust-warnings | Fl -no-change-warnings
.Op Fl -only-keep-debug
.Op Fl -pad-to Ns = Ns Ar address
@ -75,6 +77,7 @@
.Op Fl -set-start Ns = Ns Ar address
.Op Fl -srec-forceS3
.Op Fl -srec-len Ns = Ns Ar val
.Op Fl -strip-dwo
.Op Fl -strip-unneeded
.Ar infile
.Op Ar outfile
@ -220,10 +223,15 @@ Depending on the operator specified, the value in argument
.Ar val
will be used as an increment, a decrement or as the new value
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
Fill the gaps between sections with the byte value specified by
the argument
.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
Do not issue a warning if the section specified by the options
.Fl -change-section-address ,
@ -304,6 +312,8 @@ Set the maximum length of an S-record line to
.Ar val .
This option is only meaningful when the output target is set to
.Dq srec .
.It Fl -strip-dwo
Do not copy .dwo debug sections to the output file.
.It Fl -strip-unneeded
Do not copy symbols that are not needed for relocation processing.
.El

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* 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>
@ -190,7 +190,9 @@ struct elfcopy {
STRIP_NONE = 0,
STRIP_ALL,
STRIP_DEBUG,
STRIP_DWO,
STRIP_NONDEBUG,
STRIP_NONDWO,
STRIP_UNNEEDED
} strip;
@ -216,6 +218,7 @@ struct elfcopy {
#define SEC_REMOVE 0x00800000U
#define SEC_COPY 0x01000000U
#define DISCARD_LLABEL 0x02000000U
#define LOCALIZE_HIDDEN 0x04000000U
int flags; /* elfcopy run control flags. */
int64_t change_addr; /* Section address adjustment. */

View File

@ -24,7 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/stat.h>
@ -40,7 +39,7 @@
#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
{
@ -57,9 +56,11 @@ enum options
ECP_GLOBALIZE_SYMBOLS,
ECP_KEEP_SYMBOLS,
ECP_KEEP_GLOBAL_SYMBOLS,
ECP_LOCALIZE_HIDDEN,
ECP_LOCALIZE_SYMBOLS,
ECP_NO_CHANGE_WARN,
ECP_ONLY_DEBUG,
ECP_ONLY_DWO,
ECP_PAD_TO,
ECP_PREFIX_ALLOC,
ECP_PREFIX_SEC,
@ -72,6 +73,7 @@ enum options
ECP_SET_START,
ECP_SREC_FORCE_S3,
ECP_SREC_LEN,
ECP_STRIP_DWO,
ECP_STRIP_SYMBOLS,
ECP_STRIP_UNNEEDED,
ECP_WEAKEN_ALL,
@ -124,6 +126,7 @@ static struct option elfcopy_longopts[] =
{"change-warnings", no_argument, NULL, ECP_CHANGE_WARN},
{"discard-all", 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},
{"globalize-symbol", required_argument, NULL, ECP_GLOBALIZE_SYMBOL},
{"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-symbols", required_argument, NULL,
ECP_KEEP_GLOBAL_SYMBOLS},
{"localize-hidden", no_argument, NULL, ECP_LOCALIZE_HIDDEN},
{"localize-symbol", required_argument, NULL, 'L'},
{"localize-symbols", required_argument, NULL, ECP_LOCALIZE_SYMBOLS},
{"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},
{"strip-all", no_argument, NULL, 'S'},
{"strip-debug", no_argument, 0, 'g'},
{"strip-dwo", no_argument, NULL, ECP_STRIP_DWO},
{"strip-symbol", required_argument, NULL, 'N'},
{"strip-symbols", required_argument, NULL, ECP_STRIP_SYMBOLS},
{"strip-unneeded", no_argument, NULL, ECP_STRIP_UNNEEDED},
@ -348,6 +353,7 @@ create_elf(struct elfcopy *ecp)
if (ecp->strip == STRIP_DEBUG ||
ecp->strip == STRIP_UNNEEDED ||
ecp->flags & WEAKEN_ALL ||
ecp->flags & LOCALIZE_HIDDEN ||
ecp->flags & DISCARD_LOCAL ||
ecp->flags & DISCARD_LLABEL ||
ecp->prefix_sym != NULL ||
@ -870,6 +876,9 @@ elfcopy_main(struct elfcopy *ecp, int argc, char **argv)
case ECP_KEEP_GLOBAL_SYMBOLS:
parse_symlist_file(ecp, optarg, SYMOP_KEEPG);
break;
case ECP_LOCALIZE_HIDDEN:
ecp->flags |= LOCALIZE_HIDDEN;
break;
case ECP_LOCALIZE_SYMBOLS:
parse_symlist_file(ecp, optarg, SYMOP_LOCALIZE);
break;
@ -879,6 +888,9 @@ elfcopy_main(struct elfcopy *ecp, int argc, char **argv)
case ECP_ONLY_DEBUG:
ecp->strip = STRIP_NONDEBUG;
break;
case ECP_ONLY_DWO:
ecp->strip = STRIP_NONDWO;
break;
case ECP_PAD_TO:
ecp->pad_to = (uint64_t) strtoull(optarg, NULL, 0);
break;
@ -939,6 +951,9 @@ elfcopy_main(struct elfcopy *ecp, int argc, char **argv)
ecp->flags |= SREC_FORCE_LEN;
ecp->srec_len = strtoul(optarg, NULL, 0);
break;
case ECP_STRIP_DWO:
ecp->strip = STRIP_DWO;
break;
case ECP_STRIP_SYMBOLS:
parse_symlist_file(ecp, optarg, SYMOP_STRIP);
break;
@ -1379,6 +1394,8 @@ Usage: %s [options] infile [outfile]\n\
section by VAL.\n\
--gap-fill=VAL Fill the gaps between sections with bytes\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\
Do not issue warnings for non-existent\n\
sections.\n\

View File

@ -24,7 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <err.h>
@ -35,7 +34,7 @@
#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 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_compress_section(struct elfcopy *ecp, 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_print_section(struct elfcopy *ecp, const char *name);
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);
}
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 (ecp->strip == STRIP_ALL ||
ecp->strip == STRIP_DEBUG ||
@ -233,6 +238,16 @@ is_debug_section(const char *name)
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
is_print_section(struct elfcopy *ecp, const char *name)
{

View File

@ -24,7 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <sys/queue.h>
#include <err.h>
#include <gelf.h>
@ -35,7 +34,7 @@
#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);

View File

@ -24,7 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <sys/param.h>
#include <err.h>
#include <fnmatch.h>
@ -34,7 +33,7 @@
#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. */
struct symbuf {
@ -128,6 +127,17 @@ is_local_symbol(unsigned char st_info)
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
is_local_label(const char *name)
{
@ -457,6 +467,11 @@ generate_symbols(struct elfcopy *ecp)
lookup_symop_list(ecp, name, SYMOP_KEEPG) == NULL)
sym.st_info = GELF_ST_INFO(STB_LOCAL,
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 {
/* STB_LOCAL binding. */
if (lookup_symop_list(ecp, name, SYMOP_GLOBALIZE) !=
@ -1036,10 +1051,8 @@ match_wildcard(const char *name, const char *pattern)
}
match = 0;
if (!fnmatch(pattern, name, 0)) {
if (!fnmatch(pattern, name, 0))
match = 1;
printf("string '%s' match to pattern '%s'\n", name, pattern);
}
return (reverse ? !match : match);
}

View File

@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* 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_
@ -190,6 +190,7 @@ struct _Dwarf_LineInfo {
Dwarf_Half li_version; /* Version of line info. */
Dwarf_Unsigned li_hdrlen; /* Length of line info header. */
Dwarf_Small li_minlen; /* Minimum instrutction length. */
Dwarf_Small li_maxop; /* Maximum operations per inst. */
Dwarf_Small li_defstmt; /* Default value of is_stmt. */
int8_t li_lbase; /* Line base for special opcode. */
Dwarf_Small li_lrange; /* Line range for special opcode. */

View File

@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* 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_
@ -444,7 +444,9 @@ enum Dwarf_ISA {
};
/* 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_const_value_signedint(Dwarf_P_Die, Dwarf_Signed,
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_direct(Dwarf_Attribute, Dwarf_Half *,
Dwarf_Error *);
__END_DECLS
#ifdef __cplusplus
}
#endif
#endif /* !_LIBDWARF_H_ */

View File

@ -26,7 +26,7 @@
#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
_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);
hdroff = offset;
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_lbase = dbg->read(ds->ds_data, &offset, 1);
li->li_lrange = dbg->read(ds->ds_data, &offset, 1);

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* 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_
@ -194,7 +194,9 @@ enum {
* Function Prototypes.
*/
__BEGIN_DECLS
#ifdef __cplusplus
extern "C" {
#endif
struct _Libelf_Data *_libelf_allocate_data(Elf_Scn *_s);
Elf *_libelf_allocate_elf(void);
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,
unsigned int _encoding, int _elfclass, int _direction);
int _libelf_xlate_shtype(uint32_t _sht);
__END_DECLS
#ifdef __cplusplus
}
#endif
#endif /* __LIBELF_H_ */

View File

@ -23,10 +23,10 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* 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__)
#define LIBELF_ARCH EM_X86_64

View File

@ -32,7 +32,7 @@
#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_getdata(Elf_Scn *s, Elf_Data *ed)

View File

@ -24,8 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <assert.h>
#include <libelf.h>
#include <stdlib.h>
@ -36,7 +34,7 @@
#include <sys/mman.h>
#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
elf_end(Elf *e)

View File

@ -24,15 +24,13 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <libelf.h>
#include <stdio.h>
#include <string.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.

View File

@ -24,13 +24,11 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.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
elf_errno(void)

View File

@ -24,13 +24,11 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.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
elf_fill(int fill)

View File

@ -24,13 +24,11 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.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
elf_flagarhdr(Elf_Arhdr *a, Elf_Cmd c, unsigned int flags)

View File

@ -24,13 +24,11 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.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_getarhdr(Elf *e)

View File

@ -24,13 +24,11 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.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_getarsym(Elf *ar, size_t *ptr)

View File

@ -24,13 +24,11 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.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
elf_getbase(Elf *e)

View File

@ -24,15 +24,13 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <ar.h>
#include <assert.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 *
elf_getident(Elf *e, size_t *sz)

View File

@ -24,13 +24,11 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.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.

View File

@ -24,13 +24,11 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.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 *e)

View File

@ -24,15 +24,13 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <ar.h>
#include <assert.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_next(Elf *e)

View File

@ -24,14 +24,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <ar.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
_libelf_getphdrnum(Elf *e, size_t *phnum)

View File

@ -24,14 +24,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <ar.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
elf_rand(Elf *ar, off_t offset)

View File

@ -24,13 +24,11 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.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 *
elf_rawfile(Elf *e, size_t *sz)

View File

@ -24,7 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <sys/queue.h>
#include <assert.h>
@ -37,7 +36,7 @@
#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.

View File

@ -24,14 +24,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <ar.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
_libelf_getshdrnum(Elf *e, size_t *shnum)

View File

@ -24,14 +24,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <ar.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
_libelf_getshdrstrndx(Elf *e, size_t *strndx)

View File

@ -24,13 +24,11 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.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
elf_version(unsigned int v)

View File

@ -23,14 +23,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* 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_
#define _GELF_H_
#include <sys/cdefs.h>
#include <libelf.h>
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_VISIBILITY ELF64_ST_VISIBILITY
__BEGIN_DECLS
#ifdef __cplusplus
extern "C" {
#endif
long gelf_checksum(Elf *_elf);
size_t gelf_fsize(Elf *_elf, Elf_Type _type, size_t _count,
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_move(Elf_Data *_dst, int _index, GElf_Move *_src);
int gelf_update_syminfo(Elf_Data *_dst, int _index, GElf_Syminfo *_src);
__END_DECLS
#ifdef __cplusplus
}
#endif
#endif /* _GELF_H_ */

View File

@ -24,8 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <assert.h>
#include <gelf.h>
#include <limits.h>
@ -33,7 +31,7 @@
#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_getcap(Elf_Data *ed, int ndx, GElf_Cap *dst)

View File

@ -24,14 +24,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <gelf.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
elf32_checksum(Elf *e)

View File

@ -24,8 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <assert.h>
#include <gelf.h>
#include <limits.h>
@ -33,7 +31,7 @@
#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_getdyn(Elf_Data *ed, int ndx, GElf_Dyn *dst)

View File

@ -24,8 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <assert.h>
#include <gelf.h>
#include <libelf.h>
@ -35,7 +33,7 @@
#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_getehdr(Elf *e)

View File

@ -24,14 +24,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <gelf.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
elf32_fsize(Elf_Type t, size_t c, unsigned int v)

View File

@ -24,13 +24,11 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <gelf.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
gelf_getclass(Elf *e)

View File

@ -24,8 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <assert.h>
#include <gelf.h>
#include <limits.h>
@ -33,7 +31,7 @@
#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_getmove(Elf_Data *ed, int ndx, GElf_Move *dst)

View File

@ -24,8 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <gelf.h>
#include <libelf.h>
#include <limits.h>
@ -33,7 +31,7 @@
#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_getphdr(Elf *e)

View File

@ -24,8 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <assert.h>
#include <gelf.h>
#include <limits.h>
@ -33,7 +31,7 @@
#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_getrel(Elf_Data *ed, int ndx, GElf_Rel *dst)

View File

@ -24,8 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <assert.h>
#include <gelf.h>
#include <limits.h>
@ -33,7 +31,7 @@
#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_getrela(Elf_Data *ed, int ndx, GElf_Rela *dst)

View File

@ -24,8 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <assert.h>
#include <gelf.h>
#include <libelf.h>
@ -34,7 +32,7 @@
#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_getshdr(Elf_Scn *s)

View File

@ -24,8 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <assert.h>
#include <gelf.h>
#include <limits.h>
@ -33,7 +31,7 @@
#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_getsym(Elf_Data *ed, int ndx, GElf_Sym *dst)

View File

@ -24,14 +24,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <assert.h>
#include <gelf.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_getsyminfo(Elf_Data *ed, int ndx, GElf_Syminfo *dst)

View File

@ -24,14 +24,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <assert.h>
#include <gelf.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_getsymshndx(Elf_Data *d, Elf_Data *id, int ndx, GElf_Sym *dst,

View File

@ -24,15 +24,13 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <gelf.h>
#include <libelf.h>
#include <string.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 *
elf32_xlatetof(Elf_Data *dst, const Elf_Data *src, unsigned int encoding)

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* 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_
@ -176,7 +176,9 @@ enum Elf_Error {
#define ELF_F_ARCHIVE 0x100U /* archive creation */
#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);
int elf_cntl(Elf *_elf, Elf_Cmd _cmd);
int elf_end(Elf *_elf);
@ -247,6 +249,8 @@ Elf_Data *elf64_xlatetof(Elf_Data *_dst, const Elf_Data *_src,
unsigned int _enc);
Elf_Data *elf64_xlatetom(Elf_Data *_dst, const Elf_Data *_src,
unsigned int _enc);
__END_DECLS
#ifdef __cplusplus
}
#endif
#endif /* _LIBELF_H_ */

View File

@ -24,15 +24,13 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <sys/types.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 {
unsigned int a32;

View File

@ -28,8 +28,6 @@
* Internal APIs
*/
#include <sys/cdefs.h>
#include <assert.h>
#include <errno.h>
#include <libelf.h>
@ -38,7 +36,7 @@
#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 *
_libelf_allocate_elf(void)

View File

@ -24,8 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <assert.h>
#include <ctype.h>
#include <libelf.h>
@ -35,7 +33,7 @@
#include "_libelf.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

View File

@ -24,8 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <assert.h>
#include <libelf.h>
#include <stdlib.h>
@ -34,7 +32,7 @@
#include "_libelf.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

View File

@ -24,13 +24,11 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <gelf.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
_libelf_sum(unsigned long c, const unsigned char *s, size_t size)

View File

@ -24,15 +24,13 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <assert.h>
#include <libelf.h>
#include <string.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__. */

View File

@ -24,13 +24,11 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.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
_libelf_xlate_shtype(uint32_t sht)

View File

@ -24,8 +24,6 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <assert.h>
#include <gelf.h>
#include <libelf.h>
@ -33,7 +31,7 @@
#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

View File

@ -24,14 +24,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <assert.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.

View File

@ -24,15 +24,13 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include <assert.h>
#include <libelf.h>
#include <string.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__. */

Some files were not shown because too many files have changed in this diff Show More