aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/Makefile9
-rw-r--r--usr.bin/beep/Makefile3
-rw-r--r--usr.bin/bmake/Makefile104
-rw-r--r--usr.bin/bmake/Makefile.config4
-rw-r--r--usr.bin/bmake/unit-tests/Makefile2
-rw-r--r--usr.bin/etdump/etdump.152
-rw-r--r--usr.bin/gcore/elfcore.c12
-rwxr-xr-xusr.bin/grep/tests/grep_freebsd_test.sh15
-rw-r--r--usr.bin/grep/util.c72
-rw-r--r--usr.bin/objcopy/Makefile14
10 files changed, 190 insertions, 97 deletions
diff --git a/usr.bin/Makefile b/usr.bin/Makefile
index bca7896e5a17..b9e4d6c1153a 100644
--- a/usr.bin/Makefile
+++ b/usr.bin/Makefile
@@ -247,9 +247,14 @@ SUBDIR.${MK_TFTP}+= tftp
SUBDIR.${MK_TOOLCHAIN}+= addr2line
SUBDIR.${MK_TOOLCHAIN}+= ar
SUBDIR.${MK_TOOLCHAIN}+= nm
-SUBDIR.${MK_TOOLCHAIN}+= objcopy
SUBDIR.${MK_TOOLCHAIN}+= readelf
SUBDIR.${MK_TOOLCHAIN}+= size
+.endif
+# Include elftoolchain's strings in build targets even if using LLVM_BINUTILS,
+# as we may later install with different options. In particular, the release
+# artifact builds use default options for buildworld but install with
+# MK_TOOLCHAIN=no which implies MK_LLVM_BINUTILS=no.
+.if ${MK_LLVM_BINUTILS} == "no" || !make(install)
SUBDIR+= strings
.endif
SUBDIR.${MK_TOOLCHAIN}+= c89
@@ -264,6 +269,8 @@ SUBDIR.${MK_TOOLCHAIN}+= indent
SUBDIR.${MK_TOOLCHAIN}+= lex
SUBDIR.${MK_TOOLCHAIN}+= lorder
SUBDIR.${MK_TOOLCHAIN}+= mkstr
+# ELF Tool Chain elfcopy required for EFI objects (PR280771)
+SUBDIR.${MK_TOOLCHAIN}+= objcopy
SUBDIR.${MK_TOOLCHAIN}+= rpcgen
SUBDIR.${MK_TOOLCHAIN}+= unifdef
SUBDIR.${MK_TOOLCHAIN}+= xstr
diff --git a/usr.bin/beep/Makefile b/usr.bin/beep/Makefile
index f252ab64f843..1f2548c24819 100644
--- a/usr.bin/beep/Makefile
+++ b/usr.bin/beep/Makefile
@@ -1,6 +1,5 @@
PROG= beep
MAN= beep.1
-
-LDFLAGS= -lm
+LIBADD= m
.include <bsd.prog.mk>
diff --git a/usr.bin/bmake/Makefile b/usr.bin/bmake/Makefile
index 9a146246df0d..a8bcdfd9f859 100644
--- a/usr.bin/bmake/Makefile
+++ b/usr.bin/bmake/Makefile
@@ -2,20 +2,20 @@
# See contrib/bmake/bsd.after-import.mk
#
-SRCTOP ?= ${.CURDIR:H:H}
+SRCTOP?= ${.CURDIR:H:H}
# look here first for config.h
-CFLAGS += -I${.CURDIR}
+CFLAGS+= -I${.CURDIR}
# for after-import
-CLEANDIRS += FreeBSD
-CLEANFILES += bootstrap
+CLEANDIRS+= FreeBSD
+CLEANFILES+= bootstrap
-# $Id: Makefile,v 1.132 2024/09/22 19:56:26 sjg Exp $
+# $Id: Makefile,v 1.133 2025/03/08 20:12:56 sjg Exp $
-PROG ?= ${.CURDIR:T}
+PROG?= ${.CURDIR:T}
-SRCS = \
+SRCS= \
arch.c \
buf.c \
compat.c \
@@ -40,8 +40,8 @@ SRCS = \
.MAIN: all
-MAN = ${PROG}.1
-SRCS.${MAN} = ${srcdir}/make.1
+MAN= ${PROG}.1
+SRCS.${MAN}= ${srcdir}/make.1
.-include "Makefile.inc"
@@ -49,45 +49,45 @@ SRCS.${MAN} = ${srcdir}/make.1
.-include "Makefile.config"
.if !empty(LIBOBJS)
-SRCS += ${LIBOBJS:T:.o=.c}
+SRCS+= ${LIBOBJS:T:.o=.c}
.endif
# just in case
-prefix ?= /usr
-srcdir ?= ${.PARSEDIR}
-srcdir := ${srcdir}
+prefix?= /usr
+srcdir?= ${.PARSEDIR}
+srcdir:= ${srcdir}
-DEFAULT_SYS_PATH ?= ${prefix}/share/mk
+DEFAULT_SYS_PATH?= ${prefix}/share/mk
-CPPFLAGS += -DUSE_META
-CFLAGS += ${CPPFLAGS}
-CFLAGS += -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\"
-CFLAGS += -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE
-CFLAGS += ${COPTS.${.ALLSRC:M*.c:T:u}}
-COPTS.main.c += "-DMAKE_VERSION=\"${_MAKE_VERSION}\""
+CPPFLAGS+= -DUSE_META
+CFLAGS+= ${CPPFLAGS}
+CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\"
+CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE
+CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}}
+COPTS.main.c+= "-DMAKE_VERSION=\"${_MAKE_VERSION}\""
.for x in FORCE_MAKE_OS FORCE_MACHINE FORCE_MACHINE_ARCH
.ifdef $x
-COPTS.main.c += "-D$x=\"${$x}\""
+COPTS.main.c+= "-D$x=\"${$x}\""
.endif
.endfor
# meta mode can be useful even without filemon
# should be set by now
-USE_FILEMON ?= no
+USE_FILEMON?= no
.if ${USE_FILEMON:tl} != "no"
.PATH: ${srcdir}/filemon
-SRCS += filemon_${USE_FILEMON}.c
-COPTS.meta.c += -DUSE_FILEMON -DUSE_FILEMON_${USE_FILEMON:tu}
-COPTS.job.c += ${COPTS.meta.c}
+SRCS+= filemon_${USE_FILEMON}.c
+COPTS.meta.c+= -DUSE_FILEMON -DUSE_FILEMON_${USE_FILEMON:tu}
+COPTS.job.c+= ${COPTS.meta.c}
.if ${USE_FILEMON} == "dev"
-FILEMON_H ?= /usr/include/dev/filemon/filemon.h
+FILEMON_H?= /usr/include/dev/filemon/filemon.h
.if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h"
-COPTS.filemon_dev.c += -DHAVE_FILEMON_H -I${FILEMON_H:H}
+COPTS.filemon_dev.c+= -DHAVE_FILEMON_H -I${FILEMON_H:H}
.endif
.elif ${USE_FILEMON} == "ktrace"
-COPTS.filemon_ktrace.c += -Wno-error=unused-parameter
+COPTS.filemon_ktrace.c+= -Wno-error=unused-parameter
.endif
.endif # USE_FILEMON
@@ -96,10 +96,10 @@ COPTS.filemon_ktrace.c += -Wno-error=unused-parameter
.if make(obj) || make(clean)
-SUBDIR.${MK_TESTS} += unit-tests
+SUBDIR.${MK_TESTS}+= unit-tests
.endif
-MAN1 = ${MAN}
+MAN1= ${MAN}
.if ${MK_GEN_MAN:Uno} == "yes"
@@ -107,8 +107,8 @@ MAN1 = ${MAN}
.include <${srcdir}/mk/genfiles.mk>
.if ${PROG} != "make"
-CLEANFILES += my.history
-SED_CMDS.${MAN} += \
+CLEANFILES+= my.history
+SED_CMDS.${MAN}+= \
-e '/^.Dt/s/MAKE/${PROG:tu}/' \
-e '/^.Nm/s/make/${PROG}/' \
@@ -123,7 +123,7 @@ my.history:
echo "It uses autoconf to facilitate portability to other platforms."; \
echo ".Pp") > $@
-SED_CMDS.${MAN} += \
+SED_CMDS.${MAN}+= \
-e '/^.Sh HISTORY/rmy.history' \
-e '/^.Sh HISTORY/,/BUGS/s,^.Nm,make,' \
@@ -131,7 +131,7 @@ SED_CMDS.${MAN} += \
.if ${.MAKE.OS:N*BSD} != ""
# assume .Nx is not supported
-SED_CMDS.${MAN} += -e 's/^\.Nx/NetBSD/'
+SED_CMDS.${MAN}+= -e 's/^\.Nx/NetBSD/'
.endif
# watch out for a late change of PROG
@@ -140,35 +140,35 @@ SED_CMDS.${MAN} += -e 's/^\.Nx/NetBSD/'
${MAN}: ${SRCS.${MAN}} _GENFILES_USE
all man beforeinstall: ${MAN}
-_mfromdir = .
+_mfromdir= .
.endif
.endif # MK_GEN_MAN
-MANTARGET ?= cat
-MANDEST ?= ${MANDIR}/${MANTARGET}1
+MANTARGET?= cat
+MANDEST?= ${MANDIR}/${MANTARGET}1
.if ${MANTARGET} == "cat"
-_mfromdir = ${srcdir}
+_mfromdir= ${srcdir}
.endif
.include <bsd.prog.mk>
-CPPFLAGS += -DMAKE_NATIVE -DHAVE_CONFIG_H
-COPTS.var.c += -Wno-cast-qual
-COPTS.job.c += -Wno-format-nonliteral
-COPTS.parse.c += -Wno-format-nonliteral
-COPTS.var.c += -Wno-format-nonliteral
+CPPFLAGS+= -DMAKE_NATIVE -DHAVE_CONFIG_H
+COPTS.var.c+= -Wno-cast-qual
+COPTS.job.c+= -Wno-format-nonliteral
+COPTS.parse.c+= -Wno-format-nonliteral
+COPTS.var.c+= -Wno-format-nonliteral
# Force these
-SHAREDIR = ${SHAREDIR.bmake:U${prefix}/share}
-BINDIR = ${BINDIR.bmake:U${prefix}/bin}
-MANDIR = ${MANDIR.bmake:U${SHAREDIR}/man}
+SHAREDIR= ${SHAREDIR.bmake:U${prefix}/share}
+BINDIR= ${BINDIR.bmake:U${prefix}/bin}
+MANDIR= ${MANDIR.bmake:U${SHAREDIR}/man}
${OBJS}: config.h
# A simple unit-test driver to help catch regressions
-TEST_MAKE ?= ${.OBJDIR}/${PROG:T}
+TEST_MAKE?= ${.OBJDIR}/${PROG:T}
accept test: .NOMETA
cd ${.CURDIR}/unit-tests && \
MAKEFLAGS= ${TEST_MAKE} -r -m / ${.TARGET} ${TESTS:DTESTS=${TESTS:Q}}
@@ -179,9 +179,9 @@ accept test: .NOMETA
# which prevents MK_AUTO_OBJ doing its job
# so do it here
.if defined(MAKEOBJDIRPREFIX) || ${MAKEOBJDIR:U:M*/*} != ""
-_utobj = ${.OBJDIR}/unit-tests
+_utobj= ${.OBJDIR}/unit-tests
.else
-_utobj = ${.CURDIR}/unit-tests/${MAKEOBJDIR:Uobj}
+_utobj= ${.CURDIR}/unit-tests/${MAKEOBJDIR:Uobj}
.endif
utobj: .NOMETA
@test -d ${_utobj} && exit 0; \
@@ -192,11 +192,11 @@ test: utobj
.endif
# override some simple things
-BINDIR = /usr/bin
-MANDIR = /usr/share/man/man
+BINDIR= /usr/bin
+MANDIR= /usr/share/man/man
# make sure we get this
-CFLAGS += ${COPTS.${.IMPSRC:T}}
+CFLAGS+= ${COPTS.${.IMPSRC:T}}
after-import: ${SRCTOP}/contrib/bmake/bsd.after-import.mk
cd ${.CURDIR} && ${.MAKE} -f ${SRCTOP}/contrib/bmake/bsd.after-import.mk
diff --git a/usr.bin/bmake/Makefile.config b/usr.bin/bmake/Makefile.config
index 9ca3691cbb2a..a5e81a13cd0a 100644
--- a/usr.bin/bmake/Makefile.config
+++ b/usr.bin/bmake/Makefile.config
@@ -6,7 +6,7 @@ SRCTOP?= ${.CURDIR:H:H}
# things set by configure
-_MAKE_VERSION?=20250125
+_MAKE_VERSION?=20250308
prefix?= /usr
srcdir= ${SRCTOP}/contrib/bmake
@@ -14,7 +14,7 @@ CC?= cc
MAKE_OS?=
DEFAULT_SYS_PATH?= .../share/mk:/usr/share/mk
-EGREP = egrep
+EGREP= egrep
CPPFLAGS+=
CFLAGS+= ${CPPFLAGS} -DHAVE_CONFIG_H
LDFLAGS+=
diff --git a/usr.bin/bmake/unit-tests/Makefile b/usr.bin/bmake/unit-tests/Makefile
index 7011ab754b9e..cdf252d5e474 100644
--- a/usr.bin/bmake/unit-tests/Makefile
+++ b/usr.bin/bmake/unit-tests/Makefile
@@ -471,7 +471,7 @@ TESTS+= varparse-mod
TESTS+= varparse-undef-partial
# some shells have quirks
-_shell := ${.SHELL:tA:T}
+_shell:= ${.SHELL:tA:T}
.if ${_shell} == "dash"
# dash fails -x output
BROKEN_TESTS+= opt-debug-x-trace
diff --git a/usr.bin/etdump/etdump.1 b/usr.bin/etdump/etdump.1
index bec8d201eb4f..a86a5e24742c 100644
--- a/usr.bin/etdump/etdump.1
+++ b/usr.bin/etdump/etdump.1
@@ -1,3 +1,6 @@
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause
+.\"
.\" Copyright (c) 2018 iXsystems, Inc
.\" All rights reserved.
.\"
@@ -22,51 +25,54 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd April 25, 2018
-.Dt ETDUMP 8
+.Dd January 18, 2025
+.Dt ETDUMP 1
.Os
.Sh NAME
.Nm etdump
-.Nd Dump El Torito boot catalog information from ISO images
+.Nd dump ISO-9660 El Torito boot catalog information
.Sh SYNOPSIS
.Nm
.Op Fl f Ar format
.Op Fl o Ar file
.Ar
.Sh DESCRIPTION
-This program reads El Torito boot catalog information from an ISO image and
-outputs it in various formats.
-It can be used to check the catalog in an image or to output catalog data in
-a format that can be used by other tools such as shell scripts.
+This program reads El Torito boot catalog information
+from an ISO-9660 image and outputs it in various formats.
+It can be used to check the catalog in an image or
+to output catalog data in a format that can be used by other tools
+such as shell scripts.
.Pp
Supported options are:
.Bl -tag -width flag
-.It Fl f Ar format Fl -format Ar format
+.It Fl f Ar format | Fl -format Ar format
Select the output format.
Supported output formats are:
-.Bl -tag -width shell -offset indent
-.It Sy text
+.Bl -tag -width indent
+.It Cm text
Human-readable text (default)
-.It Sy shell
-Each boot entry is emitted as a string suitable for passing to a sh-compatible
-eval command.
+.It Cm shell
+Each boot entry is emitted as a string
+suitable for passing to a sh-compatible eval command.
The variables emitted are:
-.Bl -tag -width et_platform -offset indent
-.It et_platform
+.Bl -tag -width "et_platform"
+.It Dv et_platform
The platform ID from the section header.
Set to 'default' for the initial (default) entry.
-.It et_system
+.It Dv et_system
The system ID from the boot entry.
-.It et_lba
+.It Dv et_lba
The starting LBA (2048-byte blocks) of the boot image.
-.It et_sectors
+.It Dv et_sectors
The number of sectors (512-byte sectors) that comprise the boot image.
.El
.El
-.It Fl o Ar file Fl -output Ar file
+.It Fl o Ar file | Fl -output Ar file
Write output to
.Ar file .
-If '-' is specified then standard out is used.
+If
+.Ql -
+is specified then standard out is used.
.El
.Sh EXAMPLES
To see what entries are in a given boot catalog run
@@ -87,14 +93,16 @@ Section header: efi, final
Media type: no emulation
.Ed
.Pp
-To use the output in a shell script a for loop can be used to iterate over the
-entries returned using eval:
+To use the output in a shell script a for loop can be used
+to iterate over the entries returned using eval:
.Bd -literal -offset indent
for entry in `etdump --format shell bootonly.iso`; do
eval $entry
echo $et_platform $et_system $et_lba $et_sectors
done
.Ed
+.Sh SEE ALSO
+.Xr cd9660 4
.Sh HISTORY
The
.Nm
diff --git a/usr.bin/gcore/elfcore.c b/usr.bin/gcore/elfcore.c
index 2bffd409bb11..86613a91ca73 100644
--- a/usr.bin/gcore/elfcore.c
+++ b/usr.bin/gcore/elfcore.c
@@ -105,6 +105,7 @@ static void *elf_note_powerpc_vsx(void *, size_t *);
static void *elf_note_procstat_auxv(void *, size_t *);
static void *elf_note_procstat_files(void *, size_t *);
static void *elf_note_procstat_groups(void *, size_t *);
+static void *elf_note_procstat_kqueues(void *, size_t *);
static void *elf_note_procstat_osrel(void *, size_t *);
static void *elf_note_procstat_proc(void *, size_t *);
static void *elf_note_procstat_psstrings(void *, size_t *);
@@ -388,6 +389,7 @@ elf_putnotes(pid_t pid, struct sbuf *sb, size_t *sizep)
elf_putnote(NT_PROCSTAT_PSSTRINGS, elf_note_procstat_psstrings, &pid,
sb);
elf_putnote(NT_PROCSTAT_AUXV, elf_note_procstat_auxv, &pid, sb);
+ elf_putnote(NT_PROCSTAT_KQUEUES, elf_note_procstat_kqueues, &pid, sb);
#endif
size = sbuf_end_section(sb, old_len, 1, 0);
@@ -756,7 +758,7 @@ procstat_sysctl(void *arg, int what, size_t structsz, size_t *sizep)
{
size_t len;
pid_t pid;
- int name[4], structsize;
+ int name[5], structsize;
void *buf, *p;
pid = *(pid_t *)arg;
@@ -842,6 +844,14 @@ elf_note_procstat_auxv(void *arg, size_t *sizep)
}
static void *
+elf_note_procstat_kqueues(void *arg, size_t *sizep)
+{
+
+ return (procstat_sysctl(arg, KERN_PROC_KQUEUE,
+ sizeof(struct kinfo_knote), sizep));
+}
+
+static void *
elf_note_procstat_rlimit(void *arg, size_t *sizep)
{
pid_t pid;
diff --git a/usr.bin/grep/tests/grep_freebsd_test.sh b/usr.bin/grep/tests/grep_freebsd_test.sh
index 77017529843e..906b70645151 100755
--- a/usr.bin/grep/tests/grep_freebsd_test.sh
+++ b/usr.bin/grep/tests/grep_freebsd_test.sh
@@ -103,10 +103,25 @@ zflag_body()
atf_check grep -qz "foo.*bar" in
}
+atf_test_case color_dupe
+color_dupe_body()
+{
+
+ # This assumes a MAX_MATCHES of exactly 32. Previously buggy procline()
+ # calls would terminate the line premature every MAX_MATCHES matches,
+ # meaning we'd see the line be output again for the next MAX_MATCHES
+ # number of matches.
+ jot -nb 'A' -s '' 33 > in
+
+ atf_check -o save:color.out grep --color=always . in
+ atf_check -o match:"^ +1 color.out" wc -l color.out
+}
+
atf_init_test_cases()
{
atf_add_test_case grep_r_implied
atf_add_test_case rgrep
atf_add_test_case gnuext
atf_add_test_case zflag
+ atf_add_test_case color_dupe
}
diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c
index 4e1c44b442f2..ed87e56956f6 100644
--- a/usr.bin/grep/util.c
+++ b/usr.bin/grep/util.c
@@ -72,7 +72,7 @@ static int litexec(const struct pat *pat, const char *string,
size_t nmatch, regmatch_t pmatch[]);
#endif
static bool procline(struct parsec *pc);
-static void printline(struct parsec *pc, int sep);
+static bool printline(struct parsec *pc, int sep, size_t *last_out);
static void printline_metadata(struct str *line, int sep);
bool
@@ -214,15 +214,29 @@ procmatch_match(struct mprintc *mc, struct parsec *pc)
/* Print the matching line, but only if not quiet/binary */
if (mc->printmatch) {
- printline(pc, ':');
+ size_t last_out;
+ bool terminated;
+
+ last_out = 0;
+ terminated = printline(pc, ':', &last_out);
while (pc->matchidx >= MAX_MATCHES) {
/* Reset matchidx and try again */
pc->matchidx = 0;
if (procline(pc) == !vflag)
- printline(pc, ':');
+ terminated = printline(pc, ':', &last_out);
else
break;
}
+
+ /*
+ * The above loop processes the entire line as long as we keep
+ * hitting the maximum match count. At this point, we know
+ * that there's nothing left to be printed and can terminate the
+ * line.
+ */
+ if (!terminated)
+ printline(pc, ':', &last_out);
+
first_match = false;
mc->same_file = true;
mc->last_outed = 0;
@@ -748,26 +762,39 @@ printline_metadata(struct str *line, int sep)
}
/*
- * Prints a matching line according to the command line options.
+ * Prints a matching line according to the command line options. We need
+ * *last_out to be populated on entry in case this is just a continuation of
+ * matches within the same line.
+ *
+ * Returns true if the line was terminated, false if it was not.
*/
-static void
-printline(struct parsec *pc, int sep)
+static bool
+printline(struct parsec *pc, int sep, size_t *last_out)
{
- size_t a = 0;
+ size_t a = *last_out;
size_t i, matchidx;
regmatch_t match;
+ bool terminated;
+
+ /*
+ * Nearly all paths below will terminate the line by default, but it is
+ * avoided in some circumstances in case we don't have the full context
+ * available here.
+ */
+ terminated = true;
/* If matchall, everything matches but don't actually print for -o */
if (oflag && matchall)
- return;
+ return (terminated);
matchidx = pc->matchidx;
/* --color and -o */
- if ((oflag || color) && matchidx > 0) {
+ if ((oflag || color) && (pc->printed > 0 || matchidx > 0)) {
/* Only print metadata once per line if --color */
- if (!oflag && pc->printed == 0)
+ if (!oflag && pc->printed == 0) {
printline_metadata(&pc->ln, sep);
+ }
for (i = 0; i < matchidx; i++) {
match = pc->matches[i];
/* Don't output zero length matches */
@@ -780,9 +807,10 @@ printline(struct parsec *pc, int sep)
if (oflag) {
pc->ln.boff = match.rm_so;
printline_metadata(&pc->ln, sep);
- } else
+ } else {
fwrite(pc->ln.dat + a, match.rm_so - a, 1,
stdout);
+ }
if (color)
fprintf(stdout, "\33[%sm\33[K", color);
fwrite(pc->ln.dat + match.rm_so,
@@ -793,13 +821,31 @@ printline(struct parsec *pc, int sep)
if (oflag)
putchar('\n');
}
- if (!oflag) {
- if (pc->ln.len - a > 0)
+
+ /*
+ * Don't terminate if we reached the match limit; we may have
+ * other matches on this line to process.
+ */
+ *last_out = a;
+ if (!oflag && matchidx != MAX_MATCHES) {
+ if (pc->ln.len - a > 0) {
fwrite(pc->ln.dat + a, pc->ln.len - a, 1,
stdout);
+ *last_out = pc->ln.len;
+ }
putchar('\n');
+ } else if (!oflag) {
+ /*
+ * -o is terminated on every match output, so this
+ * branch is only designed to capture MAX_MATCHES in a
+ * line which may be a signal to us for a lack of
+ * context. The caller will know more and call us again
+ * to terminate if it needs to.
+ */
+ terminated = false;
}
} else
grep_printline(&pc->ln, sep);
pc->printed++;
+ return (terminated);
}
diff --git a/usr.bin/objcopy/Makefile b/usr.bin/objcopy/Makefile
index 101c84cc5206..2f3386d95ebe 100644
--- a/usr.bin/objcopy/Makefile
+++ b/usr.bin/objcopy/Makefile
@@ -7,12 +7,22 @@ ELFCOPYDIR= ${ELFTCDIR}/elfcopy
.PATH: ${ELFCOPYDIR}
-PROG= objcopy
+PROG= elfcopy
+MAN= elfcopy.1
+
+.if ${MK_LLVM_BINUTILS} == "no"
+
+LINKS+= ${BINDIR}/${PROG} ${BINDIR}/objcopy
+LINKS+= ${BINDIR}/${PROG} ${BINDIR}/strip
+MAN+= objcopy.1 strip.1
+
objcopy.1: elfcopy.1
sed -e 's/\.Dt ELFCOPY 1/.Dt OBJCOPY 1/' \
-e '/\.Nm elfcopy ,/d' < ${.ALLSRC} > ${.TARGET}
CLEANFILES+= objcopy.1
+.endif
+
SRCS= archive.c ascii.c binary.c main.c pe.c sections.c segments.c symbols.c
WARNS?= 5
@@ -22,9 +32,7 @@ LIBADD= archive elftc elf pe
CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/libpe -I${ELFTCDIR}/common
CFLAGS+=-DWITH_PE=1
-MAN= ${PROG}.1 strip.1
-LINKS= ${BINDIR}/${PROG} ${BINDIR}/strip
# This same hack is in lib/libelf/Makefile and usr.bin/readelf/Makefile
# We need to link against the correct version of these files. One