summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2016-02-12 21:12:47 +0000
committeremaste <emaste@FreeBSD.org>2016-02-12 21:12:47 +0000
commit3c199a1603840b41f079ef2a95ca07b300fbd844 (patch)
treea21f3ce3a6083f92907d99d0e7f3b716ab9166e0
parente659a689f9d8783176a86c10c3cd713f6eea1085 (diff)
downloadFreeBSD-src-3c199a1603840b41f079ef2a95ca07b300fbd844.zip
FreeBSD-src-3c199a1603840b41f079ef2a95ca07b300fbd844.tar.gz
Add libpe for elfcopy(1) PE/COFF support
Sponsored by: The FreeBSD Foundation
-rw-r--r--Makefile.inc12
-rw-r--r--lib/Makefile2
-rw-r--r--lib/libpe/Makefile34
-rw-r--r--share/mk/src.libnames.mk4
4 files changed, 42 insertions, 0 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 173f70e..63d1b2f 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1638,6 +1638,7 @@ _binutils= gnu/usr.bin/binutils
.endif
.if ${MK_ELFTOOLCHAIN_BOOTSTRAP} != "no"
_elftctools= lib/libelftc \
+ lib/libpe \
usr.bin/elfcopy \
usr.bin/nm \
usr.bin/size \
@@ -1650,6 +1651,7 @@ _elftctools+= usr.bin/addr2line
# If cross-building with an external binutils we still need to build strip for
# the target (for at least crunchide).
_elftctools= lib/libelftc \
+ lib/libpe \
usr.bin/elfcopy
.endif
diff --git a/lib/Makefile b/lib/Makefile
index ccc6507..699aa6a 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -80,6 +80,7 @@ SUBDIR= ${SUBDIR_ORDERED} \
libopie \
libpam \
libpcap \
+ ${_libpe} \
libpjdlog \
${_libpmc} \
${_libproc} \
@@ -184,6 +185,7 @@ _cuse= libcuse
.if ${MK_TOOLCHAIN} != "no"
_libelftc= libelftc
+_libpe= libpe
.endif
.if ${MK_FILE} != "no"
diff --git a/lib/libpe/Makefile b/lib/libpe/Makefile
new file mode 100644
index 0000000..877b331
--- /dev/null
+++ b/lib/libpe/Makefile
@@ -0,0 +1,34 @@
+# $FreeBSD$
+.include <bsd.own.mk>
+
+INTERNALLIB=
+
+ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain
+
+.PATH: ${ELFTCDIR}/libpe
+
+LIB= pe
+
+SRCS= libpe_buffer.c \
+ libpe_coff.c \
+ libpe_dos.c \
+ libpe_init.c \
+ libpe_rich.c \
+ libpe_section.c \
+ libpe_utils.c \
+ pe_buffer.c \
+ pe_cntl.c \
+ pe_coff.c \
+ pe_dos.c \
+ pe_flag.c \
+ pe_init.c \
+ pe_rich.c \
+ pe_section.c \
+ pe_symtab.c \
+ pe_update.c
+
+CFLAGS+=-I${ELFTCDIR}/libpe -I${ELFTCDIR}/common
+
+MAN=
+
+.include <bsd.lib.mk>
diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk
index 28c2368..d27597f 100644
--- a/share/mk/src.libnames.mk
+++ b/share/mk/src.libnames.mk
@@ -39,6 +39,7 @@ _INTERNALLIBS= \
openbsd \
opts \
parse \
+ pe \
readline \
sl \
sm \
@@ -367,6 +368,9 @@ LDADD+= ${LDADD_${_l}}
LIBELFTCDIR= ${OBJTOP}/lib/libelftc
LIBELFTC?= ${LIBELFTCDIR}/libelftc.a
+LIBPEDIR= ${OBJTOP}/lib/libpe
+LIBPE?= ${LIBPEDIR}/libpe.a
+
LIBREADLINEDIR= ${OBJTOP}/gnu/lib/libreadline/readline
LIBREADLINE?= ${LIBREADLINEDIR}/libreadline.a
OpenPOWER on IntegriCloud