Merge ^/head r316992 through r317215.

This commit is contained in:
Dimitry Andric 2017-04-20 21:04:21 +00:00
commit 554491ffbd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/clang500-import/; revision=317217
321 changed files with 54945 additions and 3588 deletions

View file

@ -1522,8 +1522,8 @@ sign-packages: _pkgbootstrap .PHONY
-o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \
${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \
${PKGSIGNKEY} ; \
ln -s ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \
${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest
cd ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI); \
ln -s ${PKG_VERSION} latest
#
#
@ -1972,7 +1972,7 @@ native-xtools: .PHONY
${_clang} \
sbin/md5 \
sbin/sysctl \
gnu/usr.bin/diff \
usr.bin/diff \
usr.bin/awk \
usr.bin/basename \
usr.bin/bmake \

View file

@ -150,6 +150,8 @@ OLD_FILES+=usr/lib/clang/4.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_
OLD_DIRS+=usr/lib/clang/4.0.0/lib/freebsd
OLD_DIRS+=usr/lib/clang/4.0.0/lib
OLD_DIRS+=usr/lib/clang/4.0.0
# 20170420: remove GNU diff
OLD_FILES+=usr/share/man/man7/diff.7.gz
# 20170322: rename <x> to <x>_test to match the FreeBSD test suite name scheme
OLD_FILES+=usr/tests/usr.bin/col/col
OLD_FILES+=usr/tests/usr.bin/diff/diff
@ -175,14 +177,6 @@ OLD_FILES+=usr/tests/lib/libc/locale/io_test
# 20170319: remove nls for non supported Big5* locales
OLD_DIRS+=usr/share/nls/zh_HK.Big5HKSCS
OLD_DIRS+=usr/share/nls/zh_TW.Big5
# 20170319: Remove zh_TW.Big5
OLD_FILES+=usr/share/locale/zh_TW.Big5/LC_COLLATE
OLD_FILES+=usr/share/locale/zh_TW.Big5/LC_CTYPE
OLD_FILES+=usr/share/locale/zh_TW.Big5/LC_MESSAGES
OLD_FILES+=usr/share/locale/zh_TW.Big5/LC_MONETARY
OLD_FILES+=usr/share/locale/zh_TW.Big5/LC_NUMERIC
OLD_FILES+=usr/share/locale/zh_TW.Big5/LC_TIME
OLD_DIRS+=usr/share/locale/zh_TW.Big5
# 20170313: move .../sys/geom/eli/... to .../sys/geom/class/eli/...
OLD_FILES+=usr/tests/sys/geom/eli/pbkdf2/pbkdf2
OLD_FILES+=usr/tests/sys/geom/eli/pbkdf2/Kyuafile

View file

@ -56,6 +56,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
Please see the 20141231 entry below for information about prerequisites
and upgrading, if you are not already using clang 3.5.0 or higher.
20170420:
GNU diff has been replaced by a BSD licensed diff. Some features of GNU
diff has not been implemented, if those are needed a newer version of
GNU diff is available via the diffutils package under the gdiff name.
20170413:
As of r316810 for ipfilter, keep frags is no longer assumed when
keep state is specified in a rule. r316810 aligns ipfilter with

View file

@ -63,17 +63,8 @@ setalias(const char *name, const char *val)
{
struct alias *ap, **app;
unalias(name);
app = hashalias(name);
for (ap = *app; ap; ap = ap->next) {
if (equal(name, ap->name)) {
INTOFF;
ckfree(ap->val);
ap->val = savestr(val);
INTON;
return;
}
}
/* not found */
INTOFF;
ap = ckmalloc(sizeof (struct alias));
ap->name = savestr(name);
@ -85,6 +76,14 @@ setalias(const char *name, const char *val)
INTON;
}
static void
freealias(struct alias *ap)
{
ckfree(ap->name);
ckfree(ap->val);
ckfree(ap);
}
static int
unalias(const char *name)
{
@ -106,9 +105,7 @@ unalias(const char *name)
else {
INTOFF;
*app = ap->next;
ckfree(ap->name);
ckfree(ap->val);
ckfree(ap);
freealias(ap);
INTON;
}
aliases--;
@ -122,19 +119,21 @@ unalias(const char *name)
static void
rmaliases(void)
{
struct alias *ap, *tmp;
struct alias *ap, **app;
int i;
INTOFF;
for (i = 0; i < ATABSIZE; i++) {
ap = atab[i];
atab[i] = NULL;
while (ap) {
ckfree(ap->name);
ckfree(ap->val);
tmp = ap;
ap = ap->next;
ckfree(tmp);
app = &atab[i];
while (*app) {
ap = *app;
if (ap->flag & ALIASINUSE) {
*ap->name = '\0';
app = &(*app)->next;
} else {
*app = ap->next;
freealias(ap);
}
}
}
aliases = 0;

View file

@ -23,6 +23,8 @@ ${PACKAGE}FILES+= alias13.0
${PACKAGE}FILES+= alias14.0
${PACKAGE}FILES+= alias15.0 alias15.0.stdout
${PACKAGE}FILES+= alias16.0
${PACKAGE}FILES+= alias17.0
${PACKAGE}FILES+= alias18.0
${PACKAGE}FILES+= and-pipe-not.0
${PACKAGE}FILES+= case1.0
${PACKAGE}FILES+= case2.0

View file

@ -0,0 +1,7 @@
# $FreeBSD$
v=1
alias a='unalias -a
v=2'
eval a
[ "$v" = 2 ]

View file

@ -0,0 +1,8 @@
# $FreeBSD$
v=1
alias a='alias a=v=2
v=3
a'
eval a
[ "$v" = 2 ]

View file

@ -40,7 +40,7 @@
#include "uthash.h"
#include "_elftc.h"
ELFTC_VCSID("$Id: addr2line.c 3446 2016-05-03 01:31:17Z emaste $");
ELFTC_VCSID("$Id: addr2line.c 3499 2016-11-25 16:06:29Z emaste $");
struct Func {
char *name;
@ -720,11 +720,11 @@ main(int argc, char **argv)
if (argc > 0)
for (i = 0; i < argc; i++)
translate(dbg, e, argv[i]);
else
while (fgets(line, sizeof(line), stdin) != NULL) {
else {
setvbuf(stdout, NULL, _IOLBF, 0);
while (fgets(line, sizeof(line), stdin) != NULL)
translate(dbg, e, line);
fflush(stdout);
}
}
dwarf_finish(dbg, &de);

View file

@ -0,0 +1,2 @@
DPADD+= ${LIBBZ2}
LDADD+= -lbz2

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 3485 2016-08-18 13:38:52Z emaste $
* $Id: elfdefinitions.h 3515 2017-01-24 22:04:22Z emaste $
*/
/*
@ -153,6 +153,8 @@ _ELF_DEFINE_DT(DT_SUNW_FILTER, 0x6000000FUL, \
"offset of string naming standard filtees") \
_ELF_DEFINE_DT(DT_SUNW_CAP, 0x60000010UL, \
"address of hardware capabilities section") \
_ELF_DEFINE_DT(DT_SUNW_ASLR, 0x60000023UL, \
"Address Space Layout Randomization flag") \
_ELF_DEFINE_DT(DT_HIOS, 0x6FFFF000UL, \
"end of OS-specific types") \
_ELF_DEFINE_DT(DT_VALRNGLO, 0x6FFFFD00UL, \
@ -919,6 +921,12 @@ _ELF_DEFINE_PT(PT_GNU_STACK, 0x6474E551UL, \
"Stack flags") \
_ELF_DEFINE_PT(PT_GNU_RELRO, 0x6474E552UL, \
"Segment becomes read-only after relocation") \
_ELF_DEFINE_PT(PT_OPENBSD_RANDOMIZE,0x65A3DBE6UL, \
"Segment filled with random data") \
_ELF_DEFINE_PT(PT_OPENBSD_WXNEEDED, 0x65A3DBE7UL, \
"Program violates W^X") \
_ELF_DEFINE_PT(PT_OPENBSD_BOOTDATA, 0x65A41BE6UL, \
"Boot data") \
_ELF_DEFINE_PT(PT_SUNWBSS, 0x6FFFFFFAUL, \
"A Solaris .SUNW_bss section") \
_ELF_DEFINE_PT(PT_SUNWSTACK, 0x6FFFFFFBUL, \

View file

@ -35,7 +35,7 @@
#include "_elftc.h"
ELFTC_VCSID("$Id: cxxfilt.c 3454 2016-05-07 17:11:05Z kaiwang27 $");
ELFTC_VCSID("$Id: cxxfilt.c 3499 2016-11-25 16:06:29Z emaste $");
#define STRBUFSZ 8192
@ -175,6 +175,7 @@ main(int argc, char **argv)
} else {
p = 0;
for (;;) {
setvbuf(stdout, NULL, _IOLBF, 0);
c = fgetc(stdin);
if (c == EOF || !(isalnum(c) || strchr(".$_", c))) {
if (p > 0) {

View file

@ -23,7 +23,7 @@
.\"
.\" $Id: elfcopy.1 3426 2016-03-05 13:32:28Z emaste $
.\"
.Dd March 5, 2016
.Dd April 20, 2017
.Os
.Dt ELFCOPY 1
.Sh NAME
@ -83,6 +83,7 @@
.Op Fl -srec-forceS3
.Op Fl -srec-len Ns = Ns Ar val
.Op Fl -strip-dwo
.Op Fl -strip-symbols= Ns Ar filename
.Op Fl -strip-unneeded
.Ar infile
.Op Ar outfile
@ -339,6 +340,10 @@ 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-symbols= Ns Ar filename
Do not copy any of the symbols specified by
.Ar filename
to the output.
.It Fl -strip-unneeded
Do not copy symbols that are not needed for relocation processing.
.El

View file

@ -39,7 +39,7 @@
#include "elfcopy.h"
ELFTC_VCSID("$Id: main.c 3446 2016-05-03 01:31:17Z emaste $");
ELFTC_VCSID("$Id: main.c 3520 2017-04-17 01:47:52Z kaiwang27 $");
enum options
{
@ -285,6 +285,7 @@ create_elf(struct elfcopy *ecp)
size_t ishnum;
ecp->flags |= SYMTAB_INTACT;
ecp->flags &= ~SYMTAB_EXIST;
/* Create EHDR. */
if (gelf_getehdr(ecp->ein, &ieh) == NULL)
@ -499,6 +500,10 @@ free_elf(struct elfcopy *ecp)
}
}
ecp->symtab = NULL;
ecp->strtab = NULL;
ecp->shstrtab = NULL;
if (ecp->secndx != NULL) {
free(ecp->secndx);
ecp->secndx = NULL;

View file

@ -0,0 +1,4 @@
.if !defined(LIBELF_AR)
DPADD+= ${LIBBZ2}
LDADD+= -lbz2
.endif

View file

@ -34,7 +34,7 @@
#include "elfcopy.h"
ELFTC_VCSID("$Id: pe.c 3490 2016-08-31 00:12:22Z emaste $");
ELFTC_VCSID("$Id: pe.c 3508 2016-12-27 06:19:39Z kaiwang27 $");
/* Convert ELF object to Portable Executable (PE). */
void

View file

@ -34,7 +34,7 @@
#include "elfcopy.h"
ELFTC_VCSID("$Id: symbols.c 3446 2016-05-03 01:31:17Z emaste $");
ELFTC_VCSID("$Id: symbols.c 3520 2017-04-17 01:47:52Z kaiwang27 $");
/* Backwards compatibility for systems with older ELF definitions. */
#ifndef STB_GNU_UNIQUE
@ -676,6 +676,8 @@ create_symtab(struct elfcopy *ecp)
sy = ecp->symtab;
st = ecp->strtab;
assert(sy != NULL && st != NULL);
/*
* Set section index map for .symtab and .strtab. We need to set
* these map because otherwise symbols which refer to .symtab and

View file

@ -50,7 +50,7 @@
#include "_elftc.h"
ELFTC_VCSID("$Id: elfdump.c 3482 2016-08-02 18:47:00Z emaste $");
ELFTC_VCSID("$Id: elfdump.c 3497 2016-10-17 20:57:22Z emaste $");
#if defined(ELFTC_NEED_ELF_NOTE_DEFINITION)
#include "native-elf-format.h"
@ -223,9 +223,9 @@ d_tags(uint64_t tag)
case 0x6ffffff0: return "DT_GNU_VERSYM";
/* 0x70000000 - 0x7fffffff processor-specific semantics */
case 0x70000000: return "DT_IA_64_PLT_RESERVE";
case 0x7ffffffd: return "DT_SUNW_AUXILIARY";
case 0x7ffffffe: return "DT_SUNW_USED";
case 0x7fffffff: return "DT_SUNW_FILTER";
case DT_AUXILIARY: return "DT_AUXILIARY";
case DT_USED: return "DT_USED";
case DT_FILTER: return "DT_FILTER";
}
snprintf(unknown_buf, sizeof(unknown_buf),

View file

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: dwarf.h 3052 2014-05-26 20:36:24Z kaiwang27 $
* $Id: dwarf.h 3494 2016-09-20 17:16:13Z emaste $
*/
#ifndef _DWARF_H_
@ -208,6 +208,25 @@
#define DW_AT_lo_user 0x2000
#define DW_AT_hi_user 0x3fff
/* SGI/MIPS extensions. */
#define DW_AT_MIPS_fde 0x2001
#define DW_AT_MIPS_loop_begin 0x2002
#define DW_AT_MIPS_tail_loop_begin 0x2003
#define DW_AT_MIPS_epilog_begin 0x2004
#define DW_AT_MIPS_loop_unroll_factor 0x2005
#define DW_AT_MIPS_software_pipeline_depth 0x2006
#define DW_AT_MIPS_linkage_name 0x2007
#define DW_AT_MIPS_stride 0x2008
#define DW_AT_MIPS_abstract_name 0x2009
#define DW_AT_MIPS_clone_origin 0x200a
#define DW_AT_MIPS_has_inlines 0x200b
#define DW_AT_MIPS_stride_byte 0x200c
#define DW_AT_MIPS_stride_elem 0x200d
#define DW_AT_MIPS_ptr_dopetype 0x200e
#define DW_AT_MIPS_allocatable_dopetype 0x200f
#define DW_AT_MIPS_assumed_shape_dopetype 0x2010
#define DW_AT_MIPS_assumed_size 0x2011
/* GNU extensions. */
#define DW_AT_sf_names 0x2101
#define DW_AT_src_info 0x2102
@ -505,6 +524,7 @@
#define DW_LANG_UPC 0x0012
#define DW_LANG_D 0x0013
#define DW_LANG_lo_user 0x8000
#define DW_LANG_Mips_Assembler 0x8001
#define DW_LANG_hi_user 0xffff
#define DW_ID_case_sensitive 0x00

View file

@ -26,7 +26,7 @@
#include "_libdwarf.h"
ELFTC_VCSID("$Id: dwarf_attrval.c 3159 2015-02-15 21:43:27Z emaste $");
ELFTC_VCSID("$Id: dwarf_attrval.c 3509 2016-12-29 03:58:41Z emaste $");
int
dwarf_attrval_flag(Dwarf_Die die, Dwarf_Half attr, Dwarf_Bool *valp, Dwarf_Error *err)

View file

@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id: dwarf_attrval_signed.3 2980 2014-01-21 20:15:54Z kaiwang27 $
.\" $Id: dwarf_attrval_signed.3 3509 2016-12-29 03:58:41Z emaste $
.\"
.Dd December 26, 2016
.Os

View file

@ -27,7 +27,7 @@
#include "_libdwarf.h"
ELFTC_VCSID("$Id: dwarf_dump.c 3052 2014-05-26 20:36:24Z kaiwang27 $");
ELFTC_VCSID("$Id: dwarf_dump.c 3494 2016-09-20 17:16:13Z emaste $");
int
dwarf_get_ACCESS_name(unsigned access, const char **s)
@ -262,6 +262,40 @@ dwarf_get_AT_name(unsigned attr, const char **s)
*s = "DW_AT_body_begin"; break;
case DW_AT_body_end:
*s = "DW_AT_body_end"; break;
case DW_AT_MIPS_fde:
*s = "DW_AT_MIPS_fde"; break;
case DW_AT_MIPS_loop_begin:
*s = "DW_AT_MIPS_loop_begin"; break;
case DW_AT_MIPS_tail_loop_begin:
*s = "DW_AT_MIPS_tail_loop_begin"; break;
case DW_AT_MIPS_epilog_begin:
*s = "DW_AT_MIPS_epilog_begin"; break;
case DW_AT_MIPS_loop_unroll_factor:
*s = "DW_AT_MIPS_loop_unroll_factor"; break;
case DW_AT_MIPS_software_pipeline_depth:
*s = "DW_AT_MIPS_software_pipeline_depth"; break;
case DW_AT_MIPS_linkage_name:
*s = "DW_AT_MIPS_linkage_name"; break;
case DW_AT_MIPS_stride:
*s = "DW_AT_MIPS_stride"; break;
case DW_AT_MIPS_abstract_name:
*s = "DW_AT_MIPS_abstract_name"; break;
case DW_AT_MIPS_clone_origin:
*s = "DW_AT_MIPS_clone_origin"; break;
case DW_AT_MIPS_has_inlines:
*s = "DW_AT_MIPS_has_inlines"; break;
case DW_AT_MIPS_stride_byte:
*s = "DW_AT_MIPS_stride_byte"; break;
case DW_AT_MIPS_stride_elem:
*s = "DW_AT_MIPS_stride_elem"; break;
case DW_AT_MIPS_ptr_dopetype:
*s = "DW_AT_MIPS_ptr_dopetype"; break;
case DW_AT_MIPS_allocatable_dopetype:
*s = "DW_AT_MIPS_allocatable_dopetype"; break;
case DW_AT_MIPS_assumed_shape_dopetype:
*s = "DW_AT_MIPS_assumed_shape_dopetype"; break;
case DW_AT_MIPS_assumed_size:
*s = "DW_AT_MIPS_assumed_size"; break;
case DW_AT_GNU_vector:
*s = "DW_AT_GNU_vector"; break;
case DW_AT_GNU_guarded_by:
@ -756,6 +790,8 @@ dwarf_get_LANG_name(unsigned lang, const char **s)
*s = "DW_LANG_D"; break;
case DW_LANG_lo_user:
*s = "DW_LANG_lo_user"; break;
case DW_LANG_Mips_Assembler:
*s = "DW_LANG_Mips_Assembler"; break;
case DW_LANG_hi_user:
*s = "DW_LANG_hi_user"; break;
default:

View file

@ -21,7 +21,7 @@
.\" out of the use of this software, even if advised of the possibility of
.\" such damage.
.\"
.\" $Id: gelf_newehdr.3 189 2008-07-20 10:38:08Z jkoshy $
.\" $Id: gelf_newehdr.3 3500 2016-12-04 11:08:44Z jkoshy $
.\"
.Dd October 22, 2007
.Os
@ -127,6 +127,15 @@ flag on ELF descriptor
.Sh RETURN VALUES
These functions return a pointer to a translated header descriptor
if successful, or NULL on failure.
.Sh COMPATIBILITY
The
.Fn gelf_newehdr
function uses a type of
.Ft "void *"
for its returned value.
This differs from some other implementations of the ELF(3) API, which use an
.Ft "unsigned long"
return type.
.Sh ERRORS
These functions can fail with the following errors:
.Bl -tag -width "[ELF_E_RESOURCE]"

View file

@ -21,7 +21,7 @@
.\" out of the use of this software, even if advised of the possibility of
.\" such damage.
.\"
.\" $Id: gelf_newphdr.3 189 2008-07-20 10:38:08Z jkoshy $
.\" $Id: gelf_newphdr.3 3500 2016-12-04 11:08:44Z jkoshy $
.\"
.Dd October 22, 2007
.Os
@ -97,6 +97,15 @@ will no longer be valid.
.Sh RETURN VALUES
The functions a valid pointer if successful, or NULL in case an error
was encountered.
.Sh COMPATIBILITY
The
.Fn gelf_newphdr
function uses a type of
.Ft "void *"
for its returned value.
This differs from some other implementations of the ELF(3) API, which use an
.Ft "unsigned long"
return type.
.Sh ERRORS
These functions may fail with the following errors:
.Bl -tag -width "[ELF_E_RESOURCE]"

View file

@ -21,7 +21,7 @@
.\" out of the use of this software, even if advised of the possibility of
.\" such damage.
.\"
.\" $Id: elftc_bfd_find_target.3 3488 2016-08-24 18:15:57Z emaste $
.\" $Id: elftc_bfd_find_target.3 3516 2017-02-10 02:33:08Z emaste $
.\"
.Dd November 30, 2011
.Os
@ -74,6 +74,7 @@ Known descriptor names and their properties include:
.It Li elf32-littlearm Ta ELF Ta LSB Ta 32
.It Li elf32-littlemips Ta ELF Ta LSB Ta 32
.It Li elf32-powerpc Ta ELF Ta MSB Ta 32
.It Li elf32-powerpc-freebsd Ta ELF Ta MSB Ta 32
.It Li elf32-powerpcle Ta ELF Ta LSB Ta 32
.It Li elf32-sh Ta ELF Ta MSB Ta 32
.It Li elf32-shl Ta ELF Ta LSB Ta 32
@ -94,6 +95,7 @@ Known descriptor names and their properties include:
.It Li elf64-littleaarch64 Ta ELF Ta LSB Ta 64
.It Li elf64-littlemips Ta ELF Ta LSB Ta 64
.It Li elf64-powerpc Ta ELF Ta MSB Ta 64
.It Li elf64-powerpc-freebsd Ta ELF Ta MSB Ta 64
.It Li elf64-powerpcle Ta ELF Ta LSB Ta 64
.It Li elf64-sh64 Ta ELF Ta MSB Ta 64
.It Li elf64-sh64l Ta ELF Ta LSB Ta 64

View file

@ -30,7 +30,7 @@
#include "_libelftc.h"
ELFTC_VCSID("$Id: libelftc_bfdtarget.c 3488 2016-08-24 18:15:57Z emaste $");
ELFTC_VCSID("$Id: libelftc_bfdtarget.c 3516 2017-02-10 02:33:08Z emaste $");
struct _Elftc_Bfd_Target _libelftc_targets[] = {

View file

@ -37,7 +37,7 @@
#include "_libelftc.h"
ELFTC_VCSID("$Id: libelftc_dem_arm.c 3447 2016-05-03 13:32:23Z emaste $");
ELFTC_VCSID("$Id: libelftc_dem_arm.c 3513 2016-12-29 07:04:22Z kaiwang27 $");
/**
* @file cpp_demangle_arm.c
@ -68,6 +68,7 @@ struct demangle_data {
};
#define SIMPLE_HASH(x,y) (64 * x + y)
#define VEC_PUSH_STR(d,s) vector_str_push((d), (s), strlen((s)))
#define CPP_DEMANGLE_ARM_TRY 128
static void dest_cstring(struct cstring *);
@ -137,7 +138,7 @@ cpp_demangle_ARM(const char *org)
++d.p;
/* start argument types */
if (vector_str_push(&d.vec, "(", 1) == false)
if (VEC_PUSH_STR(&d.vec, "(") == false)
goto clean;
for (;;) {
@ -169,21 +170,21 @@ cpp_demangle_ARM(const char *org)
goto clean;
if (d.ptr == true) {
if (vector_str_push(&d.vec, "*", 1) == false)
if (VEC_PUSH_STR(&d.vec, "*") == false)
goto clean;
d.ptr = false;
}
if (d.ref == true) {
if (vector_str_push(&d.vec, "&", 1) == false)
if (VEC_PUSH_STR(&d.vec, "&") == false)
goto clean;
d.ref = false;
}
if (d.cnst == true) {
if (vector_str_push(&d.vec, " const", 6) == false)
if (VEC_PUSH_STR(&d.vec, " const") == false)
goto clean;
d.cnst = false;
@ -210,7 +211,7 @@ cpp_demangle_ARM(const char *org)
free(arg);
if (vector_str_push(&d.vec, ", ", 2) == false)
if (VEC_PUSH_STR(&d.vec, ", ") == false)
goto clean;
if (++try > CPP_DEMANGLE_ARM_TRY)
@ -218,7 +219,7 @@ cpp_demangle_ARM(const char *org)
}
/* end argument types */
if (vector_str_push(&d.vec, ")", 1) == false)
if (VEC_PUSH_STR(&d.vec, ")") == false)
goto clean;
flat:
@ -323,11 +324,10 @@ push_CTDT(const char *s, size_t l, struct vector_str *v)
return (false);
assert(v->size > 1);
if (vector_str_push(v, v->container[v->size - 2],
strlen(v->container[v->size - 2])) == false)
if (VEC_PUSH_STR(v, v->container[v->size - 2]) == false)
return (false);
if (vector_str_push(v, "()", 2) == false)
if (VEC_PUSH_STR(v, "()") == false)
return (false);
return (true);
@ -429,7 +429,7 @@ read_func(struct demangle_data *d)
if (read_class(d) == false)
return (false);
if (vector_str_push(&d->vec, "::", 2) == false)
if (VEC_PUSH_STR(&d->vec, "::") == false)
return (false);
}
@ -486,7 +486,7 @@ read_func_name(struct demangle_data *d)
if (read_qual_name(d) == false)
goto clean;
if (vector_str_push(&d->vec, "::", 2) == false)
if (VEC_PUSH_STR(&d->vec, "::") == false)
goto clean;
if (vector_str_push(&d->vec, op_name, len) == false)
@ -508,7 +508,7 @@ read_func_name(struct demangle_data *d)
if (read_class(d) == false)
goto clean;
if (vector_str_push(&d->vec, "::", 2) == false)
if (VEC_PUSH_STR(&d->vec, "::") == false)
goto clean;
if (vector_str_push(&d->vec, op_name, len) == false)
@ -553,7 +553,7 @@ read_func_ptr(struct demangle_data *d)
}
if (fptr.ptr == true) {
if (vector_str_push(&fptr.vec, "*", 1) == false) {
if (VEC_PUSH_STR(&fptr.vec, "*") == false) {
dest_demangle_data(&fptr);
return (false);
@ -563,7 +563,7 @@ read_func_ptr(struct demangle_data *d)
}
if (fptr.ref == true) {
if (vector_str_push(&fptr.vec, "&", 1) == false) {
if (VEC_PUSH_STR(&fptr.vec, "&") == false) {
dest_demangle_data(&fptr);
return (false);
@ -573,7 +573,7 @@ read_func_ptr(struct demangle_data *d)
}
if (fptr.cnst == true) {
if (vector_str_push(&fptr.vec, " const", 6) == false) {
if (VEC_PUSH_STR(&fptr.vec, " const") == false) {
dest_demangle_data(&fptr);
return (false);
@ -585,7 +585,7 @@ read_func_ptr(struct demangle_data *d)
if (*fptr.p == '_')
break;
if (vector_str_push(&fptr.vec, ", ", 2) == false) {
if (VEC_PUSH_STR(&fptr.vec, ", ") == false) {
dest_demangle_data(&fptr);
return (false);
@ -636,7 +636,7 @@ read_func_ptr(struct demangle_data *d)
free(rtn_type);
if (vector_str_push(&d->vec, " (*)(", 5) == false) {
if (VEC_PUSH_STR(&d->vec, " (*)(") == false) {
free(arg_type);
return (false);
@ -650,7 +650,7 @@ read_func_ptr(struct demangle_data *d)
free(arg_type);
return (vector_str_push(&d->vec, ")", 1));
return (VEC_PUSH_STR(&d->vec, ")"));
}
static bool
@ -689,7 +689,7 @@ read_memptr(struct demangle_data *d)
if (vector_str_push(&d->vec, mptr_str, len) == false)
goto clean;
if (vector_str_push(&d->vec, "::*", 3) == false)
if (VEC_PUSH_STR(&d->vec, "::*") == false)
goto clean;
rtn = true;
@ -712,108 +712,102 @@ read_op(struct demangle_data *d)
switch (SIMPLE_HASH(*(d->p), *(d->p+1))) {
case SIMPLE_HASH('m', 'l') :
d->p += 2;
return (vector_str_push(&d->vec, "operator*", 9));
return (VEC_PUSH_STR(&d->vec, "operator*"));
case SIMPLE_HASH('d', 'v') :
d->p += 2;
return (vector_str_push(&d->vec, "operator/", 9));
return (VEC_PUSH_STR(&d->vec, "operator/"));
case SIMPLE_HASH('m', 'd') :
d->p += 2;
return (vector_str_push(&d->vec, "operator%", 9));
return (VEC_PUSH_STR(&d->vec, "operator%"));
case SIMPLE_HASH('p', 'l') :
d->p += 2;
return (vector_str_push(&d->vec, "operator+", 9));
return (VEC_PUSH_STR(&d->vec, "operator+"));
case SIMPLE_HASH('m', 'i') :
d->p += 2;
return (vector_str_push(&d->vec, "operator-", 9));
return (VEC_PUSH_STR(&d->vec, "operator-"));
case SIMPLE_HASH('l', 's') :
d->p += 2;
return (vector_str_push(&d->vec, "operator<<", 10));
return (VEC_PUSH_STR(&d->vec, "operator<<"));
case SIMPLE_HASH('r', 's') :
d->p += 2;
return (vector_str_push(&d->vec, "operator>>", 10));
return (VEC_PUSH_STR(&d->vec, "operator>>"));
case SIMPLE_HASH('e', 'q') :
d->p += 2;
return (vector_str_push(&d->vec, "operator==", 10));
return (VEC_PUSH_STR(&d->vec, "operator=="));
case SIMPLE_HASH('n', 'e') :
d->p += 2;
return (vector_str_push(&d->vec, "operator!=", 10));
return (VEC_PUSH_STR(&d->vec, "operator!="));
case SIMPLE_HASH('l', 't') :
d->p += 2;
return (vector_str_push(&d->vec, "operator<", 9));
return (VEC_PUSH_STR(&d->vec, "operator<"));
case SIMPLE_HASH('g', 't') :
d->p += 2;
return (vector_str_push(&d->vec, "operator>", 9));
return (VEC_PUSH_STR(&d->vec, "operator>"));
case SIMPLE_HASH('l', 'e') :
d->p += 2;
return (vector_str_push(&d->vec, "operator<=", 10));
return (VEC_PUSH_STR(&d->vec, "operator<="));
case SIMPLE_HASH('g', 'e') :
d->p += 2;
return (vector_str_push(&d->vec, "operator>=", 10));
return (VEC_PUSH_STR(&d->vec, "operator>="));
case SIMPLE_HASH('a', 'd') :
d->p += 2;
if (*d->p == 'v') {
++d->p;
return (vector_str_push(&d->vec, "operator/=",
10));
return (VEC_PUSH_STR(&d->vec, "operator/="));
} else
return (vector_str_push(&d->vec, "operator&", 9));
return (VEC_PUSH_STR(&d->vec, "operator&"));
case SIMPLE_HASH('o', 'r') :
d->p += 2;
return (vector_str_push(&d->vec, "operator|", 9));
return (VEC_PUSH_STR(&d->vec, "operator|"));
case SIMPLE_HASH('e', 'r') :
d->p += 2;
return (vector_str_push(&d->vec, "operator^", 9));
return (VEC_PUSH_STR(&d->vec, "operator^"));
case SIMPLE_HASH('a', 'a') :
d->p += 2;
if (*d->p == 'd') {
++d->p;
return (vector_str_push(&d->vec, "operator&=",
10));
return (VEC_PUSH_STR(&d->vec, "operator&="));
} else
return (vector_str_push(&d->vec, "operator&&",
10));
return (VEC_PUSH_STR(&d->vec, "operator&&"));
case SIMPLE_HASH('o', 'o') :
d->p += 2;
return (vector_str_push(&d->vec, "operator||", 10));
return (VEC_PUSH_STR(&d->vec, "operator||"));
case SIMPLE_HASH('n', 't') :
d->p += 2;
return (vector_str_push(&d->vec, "operator!", 9));
return (VEC_PUSH_STR(&d->vec, "operator!"));
case SIMPLE_HASH('c', 'o') :
d->p += 2;
return (vector_str_push(&d->vec, "operator~", 9));
return (VEC_PUSH_STR(&d->vec, "operator~"));
case SIMPLE_HASH('p', 'p') :
d->p += 2;
return (vector_str_push(&d->vec, "operator++", 10));
return (VEC_PUSH_STR(&d->vec, "operator++"));
case SIMPLE_HASH('m', 'm') :
d->p += 2;
return (vector_str_push(&d->vec, "operator--", 10));
return (VEC_PUSH_STR(&d->vec, "operator--"));
case SIMPLE_HASH('a', 's') :
d->p += 2;
return (vector_str_push(&d->vec, "operator=", 9));
return (VEC_PUSH_STR(&d->vec, "operator="));
case SIMPLE_HASH('r', 'f') :
d->p += 2;
return (vector_str_push(&d->vec, "operator->", 10));
return (VEC_PUSH_STR(&d->vec, "operator->"));
case SIMPLE_HASH('a', 'p') :
/* apl */
if (*(d->p + 2) != 'l')
return (false);
d->p += 3;
return (vector_str_push(&d->vec, "operator+=", 10));
return (VEC_PUSH_STR(&d->vec, "operator+="));
case SIMPLE_HASH('a', 'm') :
d->p += 2;
if (*d->p == 'i') {
++d->p;
return (vector_str_push(&d->vec, "operator-=",
10));
return (VEC_PUSH_STR(&d->vec, "operator-="));
} else if (*d->p == 'u') {
++d->p;
return (vector_str_push(&d->vec, "operator*=",
10));
return (VEC_PUSH_STR(&d->vec, "operator*="));
} else if (*d->p == 'd') {
++d->p;
return (vector_str_push(&d->vec, "operator%=",
10));
return (VEC_PUSH_STR(&d->vec, "operator%="));
}
return (false);
@ -823,40 +817,40 @@ read_op(struct demangle_data *d)
return (false);
d->p += 3;
return (vector_str_push(&d->vec, "operator<<=", 11));
return (VEC_PUSH_STR(&d->vec, "operator<<="));
case SIMPLE_HASH('a', 'r') :
/* ars */
if (*(d->p + 2) != 's')
return (false);
d->p += 3;
return (vector_str_push(&d->vec, "operator>>=", 11));
return (VEC_PUSH_STR(&d->vec, "operator>>="));
case SIMPLE_HASH('a', 'o') :
/* aor */
if (*(d->p + 2) != 'r')
return (false);
d->p += 3;
return (vector_str_push(&d->vec, "operator|=", 10));
return (VEC_PUSH_STR(&d->vec, "operator|="));
case SIMPLE_HASH('a', 'e') :
/* aer */
if (*(d->p + 2) != 'r')
return (false);
d->p += 3;
return (vector_str_push(&d->vec, "operator^=", 10));
return (VEC_PUSH_STR(&d->vec, "operator^="));
case SIMPLE_HASH('c', 'm') :
d->p += 2;
return (vector_str_push(&d->vec, "operator,", 9));
return (VEC_PUSH_STR(&d->vec, "operator,"));
case SIMPLE_HASH('r', 'm') :
d->p += 2;
return (vector_str_push(&d->vec, "operator->*", 11));
return (VEC_PUSH_STR(&d->vec, "operator->*"));
case SIMPLE_HASH('c', 'l') :
d->p += 2;
return (vector_str_push(&d->vec, "()", 2));
return (VEC_PUSH_STR(&d->vec, "()"));
case SIMPLE_HASH('v', 'c') :
d->p += 2;
return (vector_str_push(&d->vec, "[]", 2));
return (VEC_PUSH_STR(&d->vec, "[]"));
case SIMPLE_HASH('c', 't') :
d->p += 4;
d->type = ENCODE_OP_CT;
@ -883,11 +877,10 @@ read_op(struct demangle_data *d)
return (false);
case SIMPLE_HASH('n', 'w') :
d->p += 2;
return (vector_str_push(&d->vec, "operator new()", 14));
return (VEC_PUSH_STR(&d->vec, "operator new()"));
case SIMPLE_HASH('d', 'l') :
d->p += 2;
return (vector_str_push(&d->vec, "operator delete()",
17));
return (VEC_PUSH_STR(&d->vec, "operator delete()"));
case SIMPLE_HASH('o', 'p') :
/* __op<TO_TYPE>__<FROM_TYPE> */
d->p += 2;
@ -962,13 +955,13 @@ read_op_user(struct demangle_data *d)
if (vector_str_push(&d->vec, from_str, from_len) == false)
goto clean;
if (vector_str_push(&d->vec, "::operator ", 11) == false)
if (VEC_PUSH_STR(&d->vec, "::operator ") == false)
return (false);
if (vector_str_push(&d->vec, to_str, to_len) == false)
goto clean;
rtn = vector_str_push(&d->vec, "()", 2);
rtn = VEC_PUSH_STR(&d->vec, "()");
clean:
free(to_str);
free(from_str);
@ -1000,7 +993,7 @@ read_qual_name(struct demangle_data *d)
if (read_class(d) == false)
return (false);
if (vector_str_push(&d->vec, "::", 2) == false)
if (VEC_PUSH_STR(&d->vec, "::") == false)
return (false);
}
@ -1029,12 +1022,10 @@ read_subst(struct demangle_data *d)
d->p = str;
if (vector_str_push(&d->vec, d->arg.container[idx - 1],
strlen(d->arg.container[idx - 1])) == false)
if (VEC_PUSH_STR(&d->vec, d->arg.container[idx - 1]) == false)
return (-1);
if (vector_str_push(&d->arg, d->arg.container[idx - 1],
strlen(d->arg.container[idx - 1])) == false)
if (VEC_PUSH_STR(&d->arg, d->arg.container[idx - 1]) == false)
return (-1);
if (*d->p == '\0')
@ -1073,16 +1064,14 @@ read_subst_iter(struct demangle_data *d)
d->p = str;
for (i = 0; i < repeat ; ++i) {
if (vector_str_push(&d->vec, d->arg.container[idx - 1],
strlen(d->arg.container[idx - 1])) == false)
if (VEC_PUSH_STR(&d->vec, d->arg.container[idx - 1]) == false)
return (-1);
if (vector_str_push(&d->arg, d->arg.container[idx - 1],
strlen(d->arg.container[idx - 1])) == false)
if (VEC_PUSH_STR(&d->arg, d->arg.container[idx - 1]) == false)
return (-1);
if (i != repeat - 1 &&
vector_str_push(&d->vec, ", ", 2) == false)
VEC_PUSH_STR(&d->vec, ", ") == false)
return (-1);
}
@ -1108,7 +1097,7 @@ read_type(struct demangle_data *d)
case 'U' :
++d->p;
if (vector_str_push(&d->vec, "unsigned ", 9) == false)
if (VEC_PUSH_STR(&d->vec, "unsigned ") == false)
return (false);
break;
@ -1118,7 +1107,7 @@ read_type(struct demangle_data *d)
if (*d->p == 'P')
d->cnst = true;
else {
if (vector_str_push(&d->vec, "const ", 6) ==
if (VEC_PUSH_STR(&d->vec, "const ") ==
false)
return (false);
}
@ -1127,14 +1116,14 @@ read_type(struct demangle_data *d)
case 'V' :
++d->p;
if (vector_str_push(&d->vec, "volatile ", 9) == false)
if (VEC_PUSH_STR(&d->vec, "volatile ") == false)
return (false);
break;
case 'S' :
++d->p;
if (vector_str_push(&d->vec, "signed ", 7) == false)
if (VEC_PUSH_STR(&d->vec, "signed ") == false)
return (false);
break;
@ -1185,39 +1174,39 @@ read_type(struct demangle_data *d)
case 'v' :
++d->p;
return (vector_str_push(&d->vec, "void", 4));
return (VEC_PUSH_STR(&d->vec, "void"));
case 'c' :
++d->p;
return (vector_str_push(&d->vec, "char", 4));
return (VEC_PUSH_STR(&d->vec, "char"));
case 's' :
++d->p;
return (vector_str_push(&d->vec, "short", 5));
return (VEC_PUSH_STR(&d->vec, "short"));
case 'i' :
++d->p;
return (vector_str_push(&d->vec, "int", 3));
return (VEC_PUSH_STR(&d->vec, "int"));
case 'l' :
++d->p;
return (vector_str_push(&d->vec, "long", 4));
return (VEC_PUSH_STR(&d->vec, "long"));
case 'f' :
++d->p;
return (vector_str_push(&d->vec, "float", 5));
return (VEC_PUSH_STR(&d->vec, "float"));
case 'd':
++d->p;
return (vector_str_push(&d->vec, "double", 6));
return (VEC_PUSH_STR(&d->vec, "double"));
case 'r':
++d->p;
return (vector_str_push(&d->vec, "long double", 11));
return (VEC_PUSH_STR(&d->vec, "long double"));
case 'e':
++d->p;
return (vector_str_push(&d->vec, "...", 3));
return (VEC_PUSH_STR(&d->vec, "..."));
default:
return (false);
};

View file

@ -37,7 +37,7 @@
#include "_libelftc.h"
ELFTC_VCSID("$Id: libelftc_dem_gnu2.c 3447 2016-05-03 13:32:23Z emaste $");
ELFTC_VCSID("$Id: libelftc_dem_gnu2.c 3513 2016-12-29 07:04:22Z kaiwang27 $");
/**
* @file cpp_demangle_gnu2.c
@ -66,6 +66,7 @@ struct demangle_data {
};
#define SIMPLE_HASH(x,y) (64 * x + y)
#define VEC_PUSH_STR(d,s) vector_str_push((d), (s), strlen((s)))
#define CPP_DEMANGLE_GNU2_TRY 128
static void dest_cstring(struct cstring *);
@ -126,7 +127,7 @@ cpp_demangle_gnu2(const char *org)
if (push_CTDT("::~", 3, &d.vec) == false)
goto clean;
if (vector_str_push(&d.vec, "(void)", 6) == false)
if (VEC_PUSH_STR(&d.vec, "(void)") == false)
goto clean;
goto flat;
@ -141,7 +142,7 @@ cpp_demangle_gnu2(const char *org)
++d.p;
else if (*d.p == '\0') {
if (d.class_name == true) {
if (vector_str_push(&d.vec, "(void)", 6) == false)
if (VEC_PUSH_STR(&d.vec, "(void)") == false)
goto clean;
goto flat;
@ -150,7 +151,7 @@ cpp_demangle_gnu2(const char *org)
}
/* start argument types */
if (vector_str_push(&d.vec, "(", 1) == false)
if (VEC_PUSH_STR(&d.vec, "(") == false)
goto clean;
for (;;) {
@ -182,21 +183,21 @@ cpp_demangle_gnu2(const char *org)
goto clean;
if (d.ptr == true) {
if (vector_str_push(&d.vec, "*", 1) == false)
if (VEC_PUSH_STR(&d.vec, "*") == false)
goto clean;
d.ptr = false;
}
if (d.ref == true) {
if (vector_str_push(&d.vec, "&", 1) == false)
if (VEC_PUSH_STR(&d.vec, "&") == false)
goto clean;
d.ref = false;
}
if (d.cnst == true) {
if (vector_str_push(&d.vec, " const", 6) == false)
if (VEC_PUSH_STR(&d.vec, " const") == false)
goto clean;
d.cnst = false;
@ -223,7 +224,7 @@ cpp_demangle_gnu2(const char *org)
free(arg);
if (vector_str_push(&d.vec, ", ", 2) == false)
if (VEC_PUSH_STR(&d.vec, ", ") == false)
goto clean;
if (++try > CPP_DEMANGLE_GNU2_TRY)
@ -231,10 +232,10 @@ cpp_demangle_gnu2(const char *org)
}
/* end argument types */
if (vector_str_push(&d.vec, ")", 1) == false)
if (VEC_PUSH_STR(&d.vec, ")") == false)
goto clean;
flat:
if (d.cnst_fn == true && vector_str_push(&d.vec, " const", 6) == false)
if (d.cnst_fn == true && VEC_PUSH_STR(&d.vec, " const") == false)
goto clean;
rtn = vector_str_get_flat(&d.vec, NULL);
@ -410,8 +411,7 @@ push_CTDT(const char *s, size_t l, struct vector_str *v)
assert(v->size > 1);
return (vector_str_push(v, v->container[v->size - 2],
strlen(v->container[v->size - 2])));
return (VEC_PUSH_STR(v, v->container[v->size - 2]));
}
static bool
@ -518,7 +518,7 @@ read_func(struct demangle_data *d)
if (read_class(d) == false)
return (false);
if (vector_str_push(&d->vec, "::", 2) == false)
if (VEC_PUSH_STR(&d->vec, "::") == false)
return (false);
}
@ -563,7 +563,7 @@ read_func_name(struct demangle_data *d)
/* not good condition, start function name with '__' */
d->type = ENCODE_FUNC;
if (vector_str_push(&d->vec, "__", 2) == false)
if (VEC_PUSH_STR(&d->vec, "__") == false)
return (false);
return (read_func(d));
@ -601,7 +601,7 @@ read_func_name(struct demangle_data *d)
if (read_qual_name(d) == false)
goto clean;
if (vector_str_push(&d->vec, "::", 2) == false)
if (VEC_PUSH_STR(&d->vec, "::") == false)
goto clean;
if (vector_str_push(&d->vec, op_name, len) == false)
@ -623,7 +623,7 @@ read_func_name(struct demangle_data *d)
if (read_class(d) == false)
goto clean;
if (vector_str_push(&d->vec, "::", 2) == false)
if (VEC_PUSH_STR(&d->vec, "::") == false)
goto clean;
if (vector_str_push(&d->vec, op_name, len) == false)
@ -665,7 +665,7 @@ read_func_name(struct demangle_data *d)
return (false);
}
return (vector_str_push(&d->vec, " virtual table", 14));
return (VEC_PUSH_STR(&d->vec, " virtual table"));
} else
return (read_func(d));
clean:
@ -702,7 +702,7 @@ read_func_ptr(struct demangle_data *d)
}
if (fptr.ptr == true) {
if (vector_str_push(&fptr.vec, "*", 1) == false) {
if (VEC_PUSH_STR(&fptr.vec, "*") == false) {
dest_demangle_data(&fptr);
return (false);
@ -712,7 +712,7 @@ read_func_ptr(struct demangle_data *d)
}
if (fptr.ref == true) {
if (vector_str_push(&fptr.vec, "&", 1) == false) {
if (VEC_PUSH_STR(&fptr.vec, "&") == false) {
dest_demangle_data(&fptr);
return (false);
@ -722,7 +722,7 @@ read_func_ptr(struct demangle_data *d)
}
if (fptr.cnst == true) {
if (vector_str_push(&fptr.vec, " const", 6) == false) {
if (VEC_PUSH_STR(&fptr.vec, " const") == false) {
dest_demangle_data(&fptr);
return (false);
@ -734,7 +734,7 @@ read_func_ptr(struct demangle_data *d)
if (*fptr.p == '_')
break;
if (vector_str_push(&fptr.vec, ", ", 2) == false) {
if (VEC_PUSH_STR(&fptr.vec, ", ") == false) {
dest_demangle_data(&fptr);
return (false);
@ -785,7 +785,7 @@ read_func_ptr(struct demangle_data *d)
free(rtn_type);
if (vector_str_push(&d->vec, " (*)(", 5) == false) {
if (VEC_PUSH_STR(&d->vec, " (*)(") == false) {
free(arg_type);
return (false);
@ -799,7 +799,7 @@ read_func_ptr(struct demangle_data *d)
free(arg_type);
return (vector_str_push(&d->vec, ")", 1));
return (VEC_PUSH_STR(&d->vec, ")"));
}
static bool
@ -836,7 +836,7 @@ read_memptr(struct demangle_data *d)
if (vector_str_push(&d->vec, mptr_str, len) == false)
goto clean;
if (vector_str_push(&d->vec, "::*", 3) == false)
if (VEC_PUSH_STR(&d->vec, "::*") == false)
goto clean;
rtn = true;
@ -859,108 +859,102 @@ read_op(struct demangle_data *d)
switch (SIMPLE_HASH(*(d->p), *(d->p+1))) {
case SIMPLE_HASH('m', 'l') :
d->p += 2;
return (vector_str_push(&d->vec, "operator*", 9));
return (VEC_PUSH_STR(&d->vec, "operator*"));
case SIMPLE_HASH('d', 'v') :
d->p += 2;
return (vector_str_push(&d->vec, "operator/", 9));
return (VEC_PUSH_STR(&d->vec, "operator/"));
case SIMPLE_HASH('m', 'd') :
d->p += 2;
return (vector_str_push(&d->vec, "operator%", 9));
return (VEC_PUSH_STR(&d->vec, "operator%"));
case SIMPLE_HASH('p', 'l') :
d->p += 2;
return (vector_str_push(&d->vec, "operator+", 9));
return (VEC_PUSH_STR(&d->vec, "operator+"));
case SIMPLE_HASH('m', 'i') :
d->p += 2;
return (vector_str_push(&d->vec, "operator-", 9));
return (VEC_PUSH_STR(&d->vec, "operator-"));
case SIMPLE_HASH('l', 's') :
d->p += 2;
return (vector_str_push(&d->vec, "operator<<", 10));
return (VEC_PUSH_STR(&d->vec, "operator<<"));
case SIMPLE_HASH('r', 's') :
d->p += 2;
return (vector_str_push(&d->vec, "operator>>", 10));
return (VEC_PUSH_STR(&d->vec, "operator>>"));
case SIMPLE_HASH('e', 'q') :
d->p += 2;
return (vector_str_push(&d->vec, "operator==", 10));
return (VEC_PUSH_STR(&d->vec, "operator=="));
case SIMPLE_HASH('n', 'e') :
d->p += 2;
return (vector_str_push(&d->vec, "operator!=", 10));
return (VEC_PUSH_STR(&d->vec, "operator!="));
case SIMPLE_HASH('l', 't') :
d->p += 2;
return (vector_str_push(&d->vec, "operator<", 9));
return (VEC_PUSH_STR(&d->vec, "operator<"));
case SIMPLE_HASH('g', 't') :
d->p += 2;
return (vector_str_push(&d->vec, "operator>", 9));
return (VEC_PUSH_STR(&d->vec, "operator>"));
case SIMPLE_HASH('l', 'e') :
d->p += 2;
return (vector_str_push(&d->vec, "operator<=", 10));
return (VEC_PUSH_STR(&d->vec, "operator<="));
case SIMPLE_HASH('g', 'e') :
d->p += 2;
return (vector_str_push(&d->vec, "operator>=", 10));
return (VEC_PUSH_STR(&d->vec, "operator>="));
case SIMPLE_HASH('a', 'd') :
d->p += 2;
if (*d->p == 'v') {
++d->p;
return (vector_str_push(&d->vec, "operator/=",
10));
return (VEC_PUSH_STR(&d->vec, "operator/="));
} else
return (vector_str_push(&d->vec, "operator&", 9));
return (VEC_PUSH_STR(&d->vec, "operator&"));
case SIMPLE_HASH('o', 'r') :
d->p += 2;
return (vector_str_push(&d->vec, "operator|", 9));
return (VEC_PUSH_STR(&d->vec, "operator|"));
case SIMPLE_HASH('e', 'r') :
d->p += 2;
return (vector_str_push(&d->vec, "operator^", 9));
return (VEC_PUSH_STR(&d->vec, "operator^"));
case SIMPLE_HASH('a', 'a') :
d->p += 2;
if (*d->p == 'd') {
++d->p;
return (vector_str_push(&d->vec, "operator&=",
10));
return (VEC_PUSH_STR(&d->vec, "operator&="));
} else
return (vector_str_push(&d->vec, "operator&&",
10));
return (VEC_PUSH_STR(&d->vec, "operator&&"));
case SIMPLE_HASH('o', 'o') :
d->p += 2;
return (vector_str_push(&d->vec, "operator||", 10));
return (VEC_PUSH_STR(&d->vec, "operator||"));
case SIMPLE_HASH('n', 't') :
d->p += 2;
return (vector_str_push(&d->vec, "operator!", 9));
return (VEC_PUSH_STR(&d->vec, "operator!"));
case SIMPLE_HASH('c', 'o') :
d->p += 2;
return (vector_str_push(&d->vec, "operator~", 9));
return (VEC_PUSH_STR(&d->vec, "operator~"));
case SIMPLE_HASH('p', 'p') :
d->p += 2;
return (vector_str_push(&d->vec, "operator++", 10));
return (VEC_PUSH_STR(&d->vec, "operator++"));
case SIMPLE_HASH('m', 'm') :
d->p += 2;
return (vector_str_push(&d->vec, "operator--", 10));
return (VEC_PUSH_STR(&d->vec, "operator--"));
case SIMPLE_HASH('a', 's') :
d->p += 2;
return (vector_str_push(&d->vec, "operator=", 9));
return (VEC_PUSH_STR(&d->vec, "operator="));
case SIMPLE_HASH('r', 'f') :
d->p += 2;
return (vector_str_push(&d->vec, "operator->", 10));
return (VEC_PUSH_STR(&d->vec, "operator->"));
case SIMPLE_HASH('a', 'p') :
/* apl */
if (*(d->p + 2) != 'l')
return (false);
d->p += 3;
return (vector_str_push(&d->vec, "operator+=", 10));
return (VEC_PUSH_STR(&d->vec, "operator+="));
case SIMPLE_HASH('a', 'm') :
d->p += 2;
if (*d->p == 'i') {
++d->p;
return (vector_str_push(&d->vec, "operator-=",
10));
return (VEC_PUSH_STR(&d->vec, "operator-="));
} else if (*d->p == 'u') {
++d->p;
return (vector_str_push(&d->vec, "operator*=",
10));
return (VEC_PUSH_STR(&d->vec, "operator*="));
} else if (*d->p == 'd') {
++d->p;
return (vector_str_push(&d->vec, "operator%=",
10));
return (VEC_PUSH_STR(&d->vec, "operator%="));
}
return (false);
@ -970,47 +964,46 @@ read_op(struct demangle_data *d)
return (false);
d->p += 3;
return (vector_str_push(&d->vec, "operator<<=", 11));
return (VEC_PUSH_STR(&d->vec, "operator<<="));
case SIMPLE_HASH('a', 'r') :
/* ars */
if (*(d->p + 2) != 's')
return (false);
d->p += 3;
return (vector_str_push(&d->vec, "operator>>=", 11));
return (VEC_PUSH_STR(&d->vec, "operator>>="));
case SIMPLE_HASH('a', 'o') :
/* aor */
if (*(d->p + 2) != 'r')
return (false);
d->p += 3;
return (vector_str_push(&d->vec, "operator|=", 10));
return (VEC_PUSH_STR(&d->vec, "operator|="));
case SIMPLE_HASH('a', 'e') :
/* aer */
if (*(d->p + 2) != 'r')
return (false);
d->p += 3;
return (vector_str_push(&d->vec, "operator^=", 10));
return (VEC_PUSH_STR(&d->vec, "operator^="));
case SIMPLE_HASH('c', 'm') :
d->p += 2;
return (vector_str_push(&d->vec, "operator,", 9));
return (VEC_PUSH_STR(&d->vec, "operator,"));
case SIMPLE_HASH('r', 'm') :
d->p += 2;
return (vector_str_push(&d->vec, "operator->*", 11));
return (VEC_PUSH_STR(&d->vec, "operator->*"));
case SIMPLE_HASH('c', 'l') :
d->p += 2;
return (vector_str_push(&d->vec, "()", 2));
return (VEC_PUSH_STR(&d->vec, "()"));
case SIMPLE_HASH('v', 'c') :
d->p += 2;
return (vector_str_push(&d->vec, "[]", 2));
return (VEC_PUSH_STR(&d->vec, "[]"));
case SIMPLE_HASH('n', 'w') :
d->p += 2;
return (vector_str_push(&d->vec, "operator new()", 14));
return (VEC_PUSH_STR(&d->vec, "operator new()"));
case SIMPLE_HASH('d', 'l') :
d->p += 2;
return (vector_str_push(&d->vec, "operator delete()",
17));
return (VEC_PUSH_STR(&d->vec, "operator delete()"));
case SIMPLE_HASH('o', 'p') :
/* __op<TO_TYPE>__<FROM_TYPE> */
d->p += 2;
@ -1025,7 +1018,7 @@ read_op(struct demangle_data *d)
if (read_type(d) == false)
return (false);
return (vector_str_push(&d->vec, " type_info function", 19));
return (VEC_PUSH_STR(&d->vec, " type_info function"));
case SIMPLE_HASH('t', 'i') :
d->p += 2;
d->type = ENCODE_OP_TI;
@ -1033,7 +1026,7 @@ read_op(struct demangle_data *d)
if (read_type(d) == false)
return (false);
return (vector_str_push(&d->vec, " type_info node", 15));
return (VEC_PUSH_STR(&d->vec, " type_info node"));
default :
return (false);
};
@ -1099,13 +1092,13 @@ read_op_user(struct demangle_data *d)
if (vector_str_push(&d->vec, from_str, from_len) == false)
goto clean;
if (vector_str_push(&d->vec, "::operator ", 11) == false)
if (VEC_PUSH_STR(&d->vec, "::operator ") == false)
goto clean;
if (vector_str_push(&d->vec, to_str, to_len) == false)
goto clean;
rtn = vector_str_push(&d->vec, "()", 2);
rtn = VEC_PUSH_STR(&d->vec, "()");
clean:
free(to_str);
free(from_str);
@ -1137,7 +1130,7 @@ read_qual_name(struct demangle_data *d)
if (read_class(d) == false)
return (false);
if (vector_str_push(&d->vec, "::", 2) == false)
if (VEC_PUSH_STR(&d->vec, "::") == false)
return (false);
}
@ -1166,12 +1159,10 @@ read_subst(struct demangle_data *d)
d->p = str;
if (vector_str_push(&d->vec, d->arg.container[idx - 1],
strlen(d->arg.container[idx - 1])) == false)
if (VEC_PUSH_STR(&d->vec, d->arg.container[idx - 1]) == false)
return (-1);
if (vector_str_push(&d->arg, d->arg.container[idx - 1],
strlen(d->arg.container[idx - 1])) == false)
if (VEC_PUSH_STR(&d->arg, d->arg.container[idx - 1]) == false)
return (-1);
if (*d->p == '\0')
@ -1210,16 +1201,14 @@ read_subst_iter(struct demangle_data *d)
d->p = str;
for (i = 0; i < repeat ; ++i) {
if (vector_str_push(&d->vec, d->arg.container[idx - 1],
strlen(d->arg.container[idx - 1])) == false)
if (VEC_PUSH_STR(&d->vec, d->arg.container[idx - 1]) == false)
return (-1);
if (vector_str_push(&d->arg, d->arg.container[idx - 1],
strlen(d->arg.container[idx - 1])) == false)
if (VEC_PUSH_STR(&d->arg, d->arg.container[idx - 1]) == false)
return (-1);
if (i != repeat - 1 &&
vector_str_push(&d->vec, ", ", 2) == false)
VEC_PUSH_STR(&d->vec, ", ") == false)
return (-1);
}
@ -1245,7 +1234,7 @@ read_type(struct demangle_data *d)
case 'U' :
++d->p;
if (vector_str_push(&d->vec, "unsigned ", 9) == false)
if (VEC_PUSH_STR(&d->vec, "unsigned ") == false)
return (false);
break;
@ -1255,7 +1244,7 @@ read_type(struct demangle_data *d)
if (*d->p == 'P')
d->cnst = true;
else {
if (vector_str_push(&d->vec, "const ", 6) ==
if (VEC_PUSH_STR(&d->vec, "const ") ==
false)
return (false);
}
@ -1264,14 +1253,14 @@ read_type(struct demangle_data *d)
case 'V' :
++d->p;
if (vector_str_push(&d->vec, "volatile ", 9) == false)
if (VEC_PUSH_STR(&d->vec, "volatile ") == false)
return (false);
break;
case 'S' :
++d->p;
if (vector_str_push(&d->vec, "signed ", 7) == false)
if (VEC_PUSH_STR(&d->vec, "signed ") == false)
return (false);
break;
@ -1322,51 +1311,51 @@ read_type(struct demangle_data *d)
case 'v' :
++d->p;
return (vector_str_push(&d->vec, "void", 4));
return (VEC_PUSH_STR(&d->vec, "void"));
case 'b':
++d->p;
return(vector_str_push(&d->vec, "bool", 4));
return(VEC_PUSH_STR(&d->vec, "bool"));
case 'c' :
++d->p;
return (vector_str_push(&d->vec, "char", 4));
return (VEC_PUSH_STR(&d->vec, "char"));
case 's' :
++d->p;
return (vector_str_push(&d->vec, "short", 5));
return (VEC_PUSH_STR(&d->vec, "short"));
case 'i' :
++d->p;
return (vector_str_push(&d->vec, "int", 3));
return (VEC_PUSH_STR(&d->vec, "int"));
case 'l' :
++d->p;
return (vector_str_push(&d->vec, "long", 4));
return (VEC_PUSH_STR(&d->vec, "long"));
case 'f' :
++d->p;
return (vector_str_push(&d->vec, "float", 5));
return (VEC_PUSH_STR(&d->vec, "float"));
case 'd':
++d->p;
return (vector_str_push(&d->vec, "double", 6));
return (VEC_PUSH_STR(&d->vec, "double"));
case 'r':
++d->p;
return (vector_str_push(&d->vec, "long double", 11));
return (VEC_PUSH_STR(&d->vec, "long double"));
case 'e':
++d->p;
return (vector_str_push(&d->vec, "...", 3));
return (VEC_PUSH_STR(&d->vec, "..."));
case 'w':
++d->p;
return (vector_str_push(&d->vec, "wchar_t", 7));
return (VEC_PUSH_STR(&d->vec, "wchar_t"));
case 'x':
++d->p;
return (vector_str_push(&d->vec, "long long", 9));
return (VEC_PUSH_STR(&d->vec, "long long"));
default:
return (false);
};

File diff suppressed because it is too large Load diff

View file

@ -48,7 +48,7 @@
#include "_elftc.h"
ELFTC_VCSID("$Id: nm.c 3472 2016-05-17 20:11:16Z emaste $");
ELFTC_VCSID("$Id: nm.c 3504 2016-12-17 15:33:16Z kaiwang27 $");
/* symbol information list */
STAILQ_HEAD(sym_head, sym_entry);
@ -1186,7 +1186,7 @@ read_elf(Elf *elf, const char *filename, Elf_Kind kind)
}
if (!elf_getshnum(elf, &shnum)) {
if ((e_err = elf_errno()) != 0)
warnx("%s: %s", OBJNAME, elf_errmsg(e_err));
warnx("%s: %s", OBJNAME, "File format not recognized");
else
warnx("%s: cannot get section number", OBJNAME);
rtn = 1;

View file

@ -47,7 +47,7 @@
#include "_elftc.h"
ELFTC_VCSID("$Id: readelf.c 3484 2016-08-03 13:36:49Z emaste $");
ELFTC_VCSID("$Id: readelf.c 3519 2017-04-09 23:15:58Z kaiwang27 $");
/* Backwards compatability for older FreeBSD releases. */
#ifndef STB_GNU_UNIQUE
@ -296,6 +296,7 @@ static void dump_elf(struct readelf *re);
static void dump_dyn_val(struct readelf *re, GElf_Dyn *dyn, uint32_t stab);
static void dump_dynamic(struct readelf *re);
static void dump_liblist(struct readelf *re);
static void dump_mips_abiflags(struct readelf *re, struct section *s);
static void dump_mips_attributes(struct readelf *re, uint8_t *p, uint8_t *pe);
static void dump_mips_odk_reginfo(struct readelf *re, uint8_t *p, size_t sz);
static void dump_mips_options(struct readelf *re, struct section *s);
@ -325,6 +326,7 @@ static const char *dwarf_regname(struct readelf *re, unsigned int num);
static struct dumpop *find_dumpop(struct readelf *re, size_t si,
const char *sn, int op, int t);
static int get_ent_count(struct section *s, int *ent_count);
static int get_mips_register_size(uint8_t flag);
static char *get_regoff_str(struct readelf *re, Dwarf_Half reg,
Dwarf_Addr off);
static const char *get_string(struct readelf *re, int strtab, size_t off);
@ -718,6 +720,7 @@ section_type(unsigned int mach, unsigned int stype)
case SHT_MIPS_EH_REGION: return "MIPS_EH_REGION";
case SHT_MIPS_XLATE_OLD: return "MIPS_XLATE_OLD";
case SHT_MIPS_PDR_EXCEPTION: return "MIPS_PDR_EXCEPTION";
case SHT_MIPS_ABIFLAGS: return "MIPS_ABIFLAGS";
default:
break;
}
@ -4099,33 +4102,109 @@ static void
dump_mips_specific_info(struct readelf *re)
{
struct section *s;
int i, options_found;
int i;
options_found = 0;
s = NULL;
for (i = 0; (size_t) i < re->shnum; i++) {
s = &re->sl[i];
if (s->name != NULL && (!strcmp(s->name, ".MIPS.options") ||
(s->type == SHT_MIPS_OPTIONS))) {
dump_mips_options(re, s);
options_found = 1;
}
}
if (s->name != NULL && (!strcmp(s->name, ".MIPS.abiflags") ||
(s->type == SHT_MIPS_ABIFLAGS)))
dump_mips_abiflags(re, s);
/*
* According to SGI mips64 spec, .reginfo should be ignored if
* .MIPS.options section is present.
* Dump .reginfo if present (although it will be ignored by an OS if a
* .MIPS.options section is present, according to SGI mips64 spec).
*/
if (!options_found) {
for (i = 0; (size_t) i < re->shnum; i++) {
s = &re->sl[i];
if (s->name != NULL && (!strcmp(s->name, ".reginfo") ||
(s->type == SHT_MIPS_REGINFO)))
dump_mips_reginfo(re, s);
}
for (i = 0; (size_t) i < re->shnum; i++) {
s = &re->sl[i];
if (s->name != NULL && (!strcmp(s->name, ".reginfo") ||
(s->type == SHT_MIPS_REGINFO)))
dump_mips_reginfo(re, s);
}
}
static void
dump_mips_abiflags(struct readelf *re, struct section *s)
{
Elf_Data *d;
uint8_t *p;
int elferr;
uint32_t isa_ext, ases, flags1, flags2;
uint16_t version;
uint8_t isa_level, isa_rev, gpr_size, cpr1_size, cpr2_size, fp_abi;
if ((d = elf_rawdata(s->scn, NULL)) == NULL) {
elferr = elf_errno();
if (elferr != 0)
warnx("elf_rawdata failed: %s",
elf_errmsg(elferr));
return;
}
if (d->d_size != 24) {
warnx("invalid MIPS abiflags section size");
return;
}
p = d->d_buf;
version = re->dw_decode(&p, 2);
printf("MIPS ABI Flags Version: %u", version);
if (version != 0) {
printf(" (unknown)\n\n");
return;
}
printf("\n\n");
isa_level = re->dw_decode(&p, 1);
isa_rev = re->dw_decode(&p, 1);
gpr_size = re->dw_decode(&p, 1);
cpr1_size = re->dw_decode(&p, 1);
cpr2_size = re->dw_decode(&p, 1);
fp_abi = re->dw_decode(&p, 1);
isa_ext = re->dw_decode(&p, 4);
ases = re->dw_decode(&p, 4);
flags1 = re->dw_decode(&p, 4);
flags2 = re->dw_decode(&p, 4);
printf("ISA: ");
if (isa_rev <= 1)
printf("MIPS%u\n", isa_level);
else
printf("MIPS%ur%u\n", isa_level, isa_rev);
printf("GPR size: %d\n", get_mips_register_size(gpr_size));
printf("CPR1 size: %d\n", get_mips_register_size(cpr1_size));
printf("CPR2 size: %d\n", get_mips_register_size(cpr2_size));
printf("FP ABI: ");
switch (fp_abi) {
case 3:
printf("Soft float");
break;
default:
printf("%u", fp_abi);
break;
}
printf("\nISA Extension: %u\n", isa_ext);
printf("ASEs: %u\n", ases);
printf("FLAGS 1: %08x\n", flags1);
printf("FLAGS 2: %08x\n", flags2);
}
static int
get_mips_register_size(uint8_t flag)
{
switch (flag) {
case 0: return 0;
case 1: return 32;
case 2: return 64;
case 3: return 128;
default: return -1;
}
}
static void
dump_mips_reginfo(struct readelf *re, struct section *s)
{
@ -6218,9 +6297,7 @@ dump_dwarf_loclist(struct readelf *re)
Dwarf_Half tag, version, pointer_size, off_size;
Dwarf_Error de;
struct loc_at *la;
int i, j, ret;
printf("\nContents of section .debug_loc:\n");
int i, j, ret, has_content;
/* Search .debug_info section. */
while ((ret = dwarf_next_cu_header_b(re->dbg, NULL, &version, NULL,
@ -6237,7 +6314,7 @@ dump_dwarf_loclist(struct readelf *re)
lowpc = 0;
if (tag == DW_TAG_compile_unit) {
if (dwarf_attrval_unsigned(die, DW_AT_low_pc,
&lowpc, &de) != DW_DLV_OK)
&lowpc, &de) != DW_DLV_OK)
lowpc = 0;
}
@ -6283,14 +6360,20 @@ dump_dwarf_loclist(struct readelf *re)
if (TAILQ_EMPTY(&lalist))
return;
printf(" Offset Begin End Expression\n");
has_content = 0;
TAILQ_FOREACH(la, &lalist, la_next) {
if (dwarf_loclist_n(la->la_at, &llbuf, &lcnt, &de) !=
if ((ret = dwarf_loclist_n(la->la_at, &llbuf, &lcnt, &de)) !=
DW_DLV_OK) {
warnx("dwarf_loclist_n failed: %s", dwarf_errmsg(de));
if (ret != DW_DLV_NO_ENTRY)
warnx("dwarf_loclist_n failed: %s",
dwarf_errmsg(de));
continue;
}
if (!has_content) {
has_content = 1;
printf("\nContents of section .debug_loc:\n");
printf(" Offset Begin End Expression\n");
}
set_cu_context(re, la->la_cu_psize, la->la_cu_osize,
la->la_cu_ver);
for (i = 0; i < lcnt; i++) {
@ -6325,6 +6408,9 @@ dump_dwarf_loclist(struct readelf *re)
}
dwarf_dealloc(re->dbg, llbuf, DW_DLA_LIST);
}
if (!has_content)
printf("\nSection '.debug_loc' has no debugging data.\n");
}
/*
@ -6672,8 +6758,9 @@ dump_elf(struct readelf *re)
static void
dump_dwarf(struct readelf *re)
{
int error;
struct loc_at *la, *_la;
Dwarf_Error de;
int error;
if (dwarf_elf_init(re->elf, DW_DLC_READ, NULL, NULL, &re->dbg, &de)) {
if ((error = dwarf_errno(de)) != DW_DLE_DEBUG_INFO_NULL)
@ -6709,6 +6796,11 @@ dump_dwarf(struct readelf *re)
if (re->dop & DW_O)
dump_dwarf_loclist(re);
TAILQ_FOREACH_SAFE(la, &lalist, la_next, _la) {
TAILQ_REMOVE(&lalist, la, la_next);
free(la);
}
dwarf_finish(re->dbg, &de);
}

View file

@ -46,7 +46,7 @@
#include "_elftc.h"
ELFTC_VCSID("$Id: strings.c 3446 2016-05-03 01:31:17Z emaste $");
ELFTC_VCSID("$Id: strings.c 3498 2016-10-26 19:25:13Z emaste $");
enum radix_style {
RADIX_DECIMAL,

View file

@ -1,4 +1,5 @@
#include "ipf.h"
#include <err.h>
extern int nohdrfields;
@ -32,6 +33,10 @@ wordtab_t *parsefields(table, arg)
fields = malloc(2 * sizeof(*fields));
} else {
fields = reallocarray(fields, num + 1, sizeof(*fields));
if (fields == NULL) {
warnx("memory allocation error at %d in %s in %s", __LINE__, __FUNCTION__, __FILE__);
abort();
}
}
if (t == NULL) {

View file

@ -9,6 +9,7 @@
#include "ipf.h"
#include <sys/ioctl.h>
#include <syslog.h>
#include <err.h>
#ifdef IPFILTER_BPF
# include <pcap.h>
#endif
@ -2195,6 +2196,10 @@ char *phrase;
for (i = 0, s = strtok(phrase, " \r\n\t"); s != NULL;
s = strtok(NULL, " \r\n\t"), i++) {
fb = reallocarray(fb, i / 4 + 1, sizeof(*fb));
if (fb == NULL) {
warnx("memory allocation error at %d in %s in %s", __LINE__, __FUNCTION__, __FILE__);
abort();
}
l = (u_32_t)strtol(s, NULL, 0);
switch (i & 3)
{

View file

@ -121,7 +121,7 @@ GLIBCXX_3.4 {
std::__moneypunct_cache*;
std::__numpunct_cache*;
std::__timepunct_cache*;
__gnu_debug::_Error_formatter*
__gnu_debug::_Error_formatter*;
};
# Names not in an 'extern' block are mangled names.
@ -604,34 +604,6 @@ GLIBCXX_3.4.4 {
} GLIBCXX_3.4.3;
GLIBCXX_3.4.5 {
# std::string
_ZNKSs11_M_disjunctEPKc;
_ZNKSs15_M_check_lengthE[jm][jm]PKc;
_ZNSs4_Rep26_M_set_length_and_sharableE*;
_ZNSs7_M_copyEPcPKc[jm];
_ZNSs7_M_moveEPcPKc[jm];
_ZNSs9_M_assignEPc[jm]c;
# std::wstring
_ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw;
_ZNKSbIwSt11char_traitsIwESaIwEE15_M_check_lengthE[jm][jm]PKc;
_ZNSbIwSt11char_traitsIwESaIwEE4_Rep26_M_set_length_and_sharableE*;
_ZNSbIwSt11char_traitsIwESaIwEE7_M_copyEPwPKw[jm];
_ZNSbIwSt11char_traitsIwESaIwEE7_M_moveEPwPKw[jm];
_ZNSbIwSt11char_traitsIwESaIwEE9_M_assignEPw[jm]w;
_ZNKSt13basic_fstreamI[cw]St11char_traitsI[cw]EE7is_openEv;
_ZNKSt14basic_ifstreamI[cw]St11char_traitsI[cw]EE7is_openEv;
_ZNKSt14basic_ofstreamI[cw]St11char_traitsI[cw]EE7is_openEv;
_ZNSi6ignoreE[ilv];
_ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreE[ilv];
_ZNSt11char_traitsI[cw]E2eqERK[cw]S2_;
_ZNSt19istreambuf_iteratorI[cw]St11char_traitsI[cw]EEppEv;
} GLIBCXX_3.4.4;
GLIBCXX_3.4.6 {
@ -643,8 +615,6 @@ GLIBCXX_3.4.6 {
_ZNSt15basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EE9showmanycEv;
_ZNKSt15basic_stringbufIwSt11char_traitsIwESaIwEE3strEv;
_ZN9__gnu_cxx6__poolILb1EE13_M_initializeEv;
} GLIBCXX_3.4.5;

View file

@ -35922,14 +35922,11 @@ X86TargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
if (Subtarget.is64Bit()) {
Res.first = X86::RAX;
Res.second = &X86::GR64_ADRegClass;
} else if (Subtarget.is32Bit()) {
} else {
assert((Subtarget.is32Bit() || Subtarget.is16Bit()) &&
"Expecting 64, 32 or 16 bit subtarget");
Res.first = X86::EAX;
Res.second = &X86::GR32_ADRegClass;
} else if (Subtarget.is16Bit()) {
Res.first = X86::AX;
Res.second = &X86::GR16_ADRegClass;
} else {
llvm_unreachable("Expecting 64, 32 or 16 bit subtarget");
}
return Res;
}

View file

@ -438,7 +438,6 @@ def LOW32_ADDR_ACCESS_RBP : RegisterClass<"X86", [i32], 32,
(add LOW32_ADDR_ACCESS, RBP)>;
// A class to support the 'A' assembler constraint: [ER]AX then [ER]DX.
def GR16_AD : RegisterClass<"X86", [i16], 16, (add AX, DX)>;
def GR32_AD : RegisterClass<"X86", [i32], 32, (add EAX, EDX)>;
def GR64_AD : RegisterClass<"X86", [i64], 64, (add RAX, RDX)>;

View file

@ -377,6 +377,20 @@ egrep_empty_invalid_body()
{
atf_check -s exit:1 egrep '{' /dev/null
}
atf_test_case zerolen
zerolen_head()
{
atf_set "descr" "Check for successful zero-length matches with ^$"
}
zerolen_body()
{
printf "Eggs\n\nCheese" > test1
atf_check -o inline:"\n" grep -e "^$" test1
atf_check -o inline:"Eggs\nCheese\n" grep -v -e "^$" test1
}
# End FreeBSD
atf_init_test_cases()
@ -404,5 +418,6 @@ atf_init_test_cases()
atf_add_test_case f_file_empty
atf_add_test_case escmap
atf_add_test_case egrep_empty_invalid
atf_add_test_case zerolen
# End FreeBSD
}

View file

@ -156,7 +156,8 @@ findsaddr(register const struct sockaddr_in *to,
return (errbuf);
}
} while (rp->rtm_seq != seq || rp->rtm_pid != pid);
} while (rp->rtm_type != RTM_GET || rp->rtm_seq != seq ||
rp->rtm_pid != pid);
close(s);

View file

@ -206,7 +206,7 @@ static U64 XXH_read64(const void* memPtr)
#if defined(_MSC_VER) /* Visual Studio */
# define XXH_swap32 _byteswap_ulong
# define XXH_swap64 _byteswap_uint64
#elif GCC_VERSION >= 403
#elif (GCC_VERSION >= 403 && !defined(__riscv__))
# define XXH_swap32 __builtin_bswap32
# define XXH_swap64 __builtin_bswap64
#else

View file

@ -897,6 +897,8 @@
..
zh_HK.UTF-8
..
zh_TW.Big5
..
zh_TW.UTF-8
..
..

View file

@ -41,7 +41,7 @@ ldconfig_start()
${ldconfig} -elf ${_ins} ${_LDC}
case `sysctl -n hw.machine_arch` in
amd64)
amd64|powerpc64)
for i in ${ldconfig_local32_dirs}; do
if [ -d "${i}" ]; then
_files=`find ${i} -type f`

View file

@ -7,13 +7,10 @@ SUBDIR.${MK_DIALOG}+= libdialog
SUBDIR.${MK_GCC}+= libgcov libgomp
SUBDIR.${MK_SSP}+= libssp
SUBDIR.${MK_TESTS}+= tests
SUBDIR.${MK_GDB}+= libreadline
.if ${MK_BINUTILS} != "no" && ${MK_GDB} != "no"
SUBDIR+= libreadline
.endif
.if ${MK_GNU_DIFF} != "no" || ${MK_GNU_GREP} != "no" || \
${MK_GNU_GREP_COMPAT} != "no" || ${MK_GDB} != "no"
.if ${MK_GNU_GREP} != "no" || ${MK_GNU_GREP_COMPAT} != "no" || \
${MK_GDB} != "no"
SUBDIR+= libregex
.endif

View file

@ -17,7 +17,7 @@ SUBDIR_DEPEND_gdb= binutils
.endif
SUBDIR.${MK_GCC}+= cc
SUBDIR.${MK_GNU_DIFF}+= diff diff3
SUBDIR.${MK_GNU_DIFF}+= diff3
SUBDIR.${MK_GNU_GREP}+= grep
SUBDIR.${MK_GPL_DTC}+= dtc
SUBDIR.${MK_TESTS}+= tests

View file

@ -1,36 +0,0 @@
# $FreeBSD$
.include <src.opts.mk>
DIFFSRC=${.CURDIR}/../../../contrib/diff/src
.PATH: ${DIFFSRC} \
${.CURDIR}/../../../contrib/diff/lib \
${.CURDIR}/../../../contrib/diff/man \
${.CURDIR}/../../../contrib/diff/doc
PROG= diff
SRCS= analyze.c context.c diff.c dir.c ed.c ifdef.c io.c \
normal.c side.c util.c \
xmalloc.c strtoumax.c cmpbuf.c exitfail.c error.c quotesys.c \
strftime.c c-stack.c basename.c exclude.c hard-locale.c \
file-type.c posixver.c prepargs.c version-etc.c
# Important for ctype macros!
CFLAGS+=-funsigned-char
CFLAGS+=-DHAVE_CONFIG_H
CFLAGS+=-DPR_PROGRAM=\"/usr/bin/pr\"
CFLAGS+=-I${.CURDIR}/../../../contrib/diff
CFLAGS+=-I${.CURDIR}/../../../contrib/diff/src
CFLAGS+=-I${.CURDIR}/../../../contrib/diff/lib
CFLAGS+=-I${DESTDIR}/usr/include/gnu
MAN= diff.1 diff.7
LIBADD+= gnuregex
.if ${MK_TESTS} != "no"
SUBDIR+= tests
.endif
.include <bsd.prog.mk>

View file

@ -1,19 +0,0 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/lib/libregex \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
.include <dirdeps.mk>
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
.endif

View file

@ -1,15 +0,0 @@
# $FreeBSD$
PACKAGE= tests
TESTSRC= ${SRCTOP}/contrib/netbsd-tests/usr.bin/diff
NETBSD_ATF_TESTS_SH= diff_test
ATF_TESTS_SH_SED_diff_test= -e 's/t_diff/`basename $$0`/g'
${PACKAGE}FILES+= d_mallocv1.in
${PACKAGE}FILES+= d_mallocv2.in
.include <netbsd-tests.test.mk>
.include <bsd.test.mk>

View file

@ -1,11 +0,0 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
.include <dirdeps.mk>
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
.endif

View file

@ -40,6 +40,10 @@ CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\"
CFLAGS+= -DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\"
CFLAGS+= -DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\"
CFLAGS+= -ffunction-sections
CFLAGS+= -fdata-sections
LDFLAGS+= -Wl,--gc-sections
CXXFLAGS+= -std=c++11
CXXFLAGS+= -fno-exceptions
CXXFLAGS+= -fno-rtti

View file

@ -52,15 +52,22 @@ __FBSDID("$FreeBSD$");
long
telldir(DIR *dirp)
{
struct ddloc *lp;
struct ddloc *lp, *flp;
long idx;
if (__isthreaded)
_pthread_mutex_lock(&dirp->dd_lock);
flp = NULL;
LIST_FOREACH(lp, &dirp->dd_td->td_locq, loc_lqe) {
if (lp->loc_seek == dirp->dd_seek &&
lp->loc_loc == dirp->dd_loc)
if (lp->loc_seek == dirp->dd_seek) {
if (flp == NULL)
flp = lp;
if (lp->loc_loc == dirp->dd_loc)
break;
} else if (flp != NULL) {
lp = NULL;
break;
}
}
if (lp == NULL) {
lp = malloc(sizeof(struct ddloc));
@ -72,7 +79,10 @@ telldir(DIR *dirp)
lp->loc_index = dirp->dd_td->td_loccnt++;
lp->loc_seek = dirp->dd_seek;
lp->loc_loc = dirp->dd_loc;
LIST_INSERT_HEAD(&dirp->dd_td->td_locq, lp, loc_lqe);
if (flp != NULL)
LIST_INSERT_BEFORE(flp, lp, loc_lqe);
else
LIST_INSERT_HEAD(&dirp->dd_td->td_locq, lp, loc_lqe);
}
idx = lp->loc_index;
if (__isthreaded)

View file

@ -1,5 +1,5 @@
/*-
* Copyright 2010 Nexenta Systems, Inc. All rights reserved.
* Copyright 2017 Nexenta Systems, Inc.
* Copyright (c) 2002 Tim J. Robbins
* All rights reserved.
*
@ -42,22 +42,22 @@ __FBSDID("$FreeBSD$");
int
wcscoll_l(const wchar_t *ws1, const wchar_t *ws2, locale_t locale)
{
int len1, len2, pri1, pri2, ret;
int len1, len2, pri1, pri2;
wchar_t *tr1 = NULL, *tr2 = NULL;
int direc, pass;
int ret = wcscmp(ws1, ws2);
FIX_LOCALE(locale);
struct xlocale_collate *table =
(struct xlocale_collate*)locale->components[XLC_COLLATE];
if (table->__collate_load_error)
/*
* Locale has no special collating order or could not be
* loaded, do a fast binary comparison.
*/
return (wcscmp(ws1, ws2));
if (table->__collate_load_error || ret == 0)
return (ret);
ret = 0;
if (*ws1 == 0 && *ws2 != 0)
return (-1);
if (*ws1 != 0 && *ws2 == 0)
return (1);
/*
* Once upon a time we had code to try to optimize this, but
@ -77,19 +77,19 @@ wcscoll_l(const wchar_t *ws1, const wchar_t *ws2, locale_t locale)
const int32_t *st2 = NULL;
const wchar_t *w1 = ws1;
const wchar_t *w2 = ws2;
int check1, check2;
/* special pass for UNDEFINED */
if (pass == table->info->directive_count) {
direc = DIRECTIVE_FORWARD | DIRECTIVE_UNDEFINED;
direc = DIRECTIVE_FORWARD;
} else {
direc = table->info->directive[pass];
}
if (direc & DIRECTIVE_BACKWARD) {
wchar_t *bp, *fp, c;
free(tr1);
if ((tr1 = wcsdup(w1)) == NULL)
goto fail;
goto end;
bp = tr1;
fp = tr1 + wcslen(tr1) - 1;
while (bp < fp) {
@ -97,8 +97,9 @@ wcscoll_l(const wchar_t *ws1, const wchar_t *ws2, locale_t locale)
*bp++ = *fp;
*fp-- = c;
}
free(tr2);
if ((tr2 = wcsdup(w2)) == NULL)
goto fail;
goto end;
bp = tr2;
fp = tr2 + wcslen(tr2) - 1;
while (bp < fp) {
@ -111,6 +112,7 @@ wcscoll_l(const wchar_t *ws1, const wchar_t *ws2, locale_t locale)
}
if (direc & DIRECTIVE_POSITION) {
int check1, check2;
while (*w1 && *w2) {
pri1 = pri2 = 0;
check1 = check2 = 1;
@ -120,7 +122,7 @@ wcscoll_l(const wchar_t *ws1, const wchar_t *ws2, locale_t locale)
&pri1, pass, &st1);
if (pri1 < 0) {
errno = EINVAL;
goto fail;
goto end;
}
if (!pri1) {
pri1 = COLLATE_MAX_PRIORITY;
@ -133,7 +135,7 @@ wcscoll_l(const wchar_t *ws1, const wchar_t *ws2, locale_t locale)
&pri2, pass, &st2);
if (pri2 < 0) {
errno = EINVAL;
goto fail;
goto end;
}
if (!pri2) {
pri2 = COLLATE_MAX_PRIORITY;
@ -149,58 +151,64 @@ wcscoll_l(const wchar_t *ws1, const wchar_t *ws2, locale_t locale)
w1 += len1;
w2 += len2;
}
} else {
while (*w1 && *w2) {
pri1 = pri2 = 0;
check1 = check2 = 1;
while ((pri1 == pri2) && (check1 || check2)) {
while (check1 && *w1) {
_collate_lookup(table, w1,
&len1, &pri1, pass, &st1);
if (pri1 > 0)
break;
if (pri1 < 0) {
errno = EINVAL;
goto fail;
}
st1 = NULL;
w1 += 1;
}
check1 = (st1 != NULL);
while (check2 && *w2) {
_collate_lookup(table, w2,
&len2, &pri2, pass, &st2);
if (pri2 > 0)
break;
if (pri2 < 0) {
errno = EINVAL;
goto fail;
}
st2 = NULL;
w2 += 1;
}
check2 = (st2 != NULL);
if (!pri1 || !pri2)
break;
if (!*w1) {
if (*w2) {
ret = -(int)*w2;
goto end;
}
if (!pri1 || !pri2)
} else {
ret = *w1;
goto end;
}
} else {
int vpri1 = 0, vpri2 = 0;
while (*w1 || *w2 || st1 || st2) {
pri1 = 1;
while (*w1 || st1) {
_collate_lookup(table, w1, &len1, &pri1,
pass, &st1);
w1 += len1;
if (pri1 > 0) {
vpri1++;
break;
}
if (pri1 < 0) {
errno = EINVAL;
goto end;
}
st1 = NULL;
}
pri2 = 1;
while (*w2 || st2) {
_collate_lookup(table, w2, &len2, &pri2,
pass, &st2);
w2 += len2;
if (pri2 > 0) {
vpri2++;
break;
}
if (pri2 < 0) {
errno = EINVAL;
goto end;
}
st2 = NULL;
}
if ((!pri1 || !pri2) && (vpri1 == vpri2))
break;
if (pri1 != pri2) {
ret = pri1 - pri2;
goto end;
}
w1 += len1;
w2 += len2;
}
}
if (!*w1) {
if (*w2) {
ret = -(int)*w2;
if (vpri1 && !vpri2) {
ret = 1;
goto end;
}
if (!vpri1 && vpri2) {
ret = -1;
goto end;
}
} else {
ret = *w1;
goto end;
}
}
ret = 0;
@ -210,10 +218,6 @@ wcscoll_l(const wchar_t *ws1, const wchar_t *ws2, locale_t locale)
free(tr2);
return (ret);
fail:
ret = wcscmp(ws1, ws2);
goto end;
}
int

View file

@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd February 15, 2017
.Dd April 18, 2017
.Dt KQUEUE 2
.Os
.Sh NAME
@ -332,6 +332,9 @@ For sockets, the low water mark and socket error handling is
identical to the
.Dv EVFILT_READ
case.
.It Dv EVFILT_EMPTY
Takes a descriptor as the identifier, and returns whenever
there is no remaining data in the write buffer.
.It Dv EVFILT_AIO
The sigevent portion of the AIO request is filled in, with
.Va sigev_notify_kqueue

View file

@ -1,5 +1,7 @@
/*-
* Copyright (c) 2016 Baptiste Daroussin <bapt@FreeBSD.org>
* Copyright 2016 Tom Lane <tgl@sss.pgh.pa.us>
* Copyright 2017 Nexenta Systems, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -30,6 +32,8 @@ __FBSDID("$FreeBSD$");
#include <wchar.h>
#include <locale.h>
#include <stdlib.h>
#include <time.h>
#include <errno.h>
#include <atf-c.h>
@ -55,9 +59,98 @@ ATF_TC_BODY(russian_collation, tc)
"Bad collation, expected: '%ls' got '%ls'", res, c);
}
#define NSTRINGS 2000
#define MAXSTRLEN 20
#define MAXXFRMLEN (MAXSTRLEN * 20)
typedef struct {
char sval[MAXSTRLEN];
char xval[MAXXFRMLEN];
} cstr;
ATF_TC_WITHOUT_HEAD(strcoll_vs_strxfrm);
ATF_TC_BODY(strcoll_vs_strxfrm, tc)
{
cstr data[NSTRINGS];
char *curloc;
int i, j;
curloc = setlocale(LC_ALL, "en_US.UTF-8");
ATF_CHECK_MSG(curloc != NULL, "Fail to set locale");
/* Ensure new random() values on every run */
srandom((unsigned int) time(NULL));
/* Generate random UTF8 strings of length less than MAXSTRLEN bytes */
for (i = 0; i < NSTRINGS; i++) {
char *p;
int len;
again:
p = data[i].sval;
len = 1 + (random() % (MAXSTRLEN - 1));
while (len > 0) {
int c;
/*
* Generate random printable char in ISO8859-1 range.
* Bias towards producing a lot of spaces.
*/
if ((random() % 16) < 3) {
c = ' ';
} else {
do {
c = random() & 0xFF;
} while (!((c >= ' ' && c <= 127) ||
(c >= 0xA0 && c <= 0xFF)));
}
if (c <= 127) {
*p++ = c;
len--;
} else {
if (len < 2)
break;
/* Poor man's utf8-ification */
*p++ = 0xC0 + (c >> 6);
len--;
*p++ = 0x80 + (c & 0x3F);
len--;
}
}
*p = '\0';
/* strxfrm() each string as we produce it */
errno = 0;
ATF_CHECK_MSG(strxfrm(data[i].xval, data[i].sval,
MAXXFRMLEN) < MAXXFRMLEN, "strxfrm() result for %d-length "
" string exceeded %d bytes", (int)strlen(data[i].sval),
MAXXFRMLEN);
/*
* Amend strxfrm() failing on certain characters to be fixed and
* test later
*/
if (errno != 0)
goto again;
}
for (i = 0; i < NSTRINGS; i++) {
for (j = 0; j < NSTRINGS; j++) {
int sr = strcoll(data[i].sval, data[j].sval);
int sx = strcmp(data[i].xval, data[j].xval);
ATF_CHECK_MSG(!((sr * sx < 0) ||
(sr * sx == 0 && sr + sx != 0)),
"%s: diff for \"%s\" and \"%s\"",
curloc, data[i].sval, data[j].sval);
}
}
}
ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, russian_collation);
ATF_TP_ADD_TC(tp, strcoll_vs_strxfrm);
return (atf_no_error());
}

View file

@ -6,5 +6,5 @@
const char *
elftc_version(void)
{
return "elftoolchain r3490M";
return "elftoolchain r3520M";
}

View file

@ -200,7 +200,7 @@ jailparam_all(struct jailparam **jpp)
{
struct jailparam *jp, *tjp;
size_t mlen1, mlen2, buflen;
int njp, nlist;
unsigned njp, nlist;
int mib1[CTL_MAXNAME], mib2[CTL_MAXNAME - 2];
char buf[MAXPATHLEN];
@ -250,7 +250,7 @@ jailparam_all(struct jailparam **jpp)
/* Add the parameter to the list */
if (njp >= nlist) {
nlist *= 2;
tjp = realloc(jp, nlist * sizeof(*jp));
tjp = reallocarray(jp, nlist, sizeof(*jp));
if (tjp == NULL)
goto error;
jp = tjp;
@ -259,7 +259,7 @@ jailparam_all(struct jailparam **jpp)
goto error;
mib1[1] = 2;
}
jp = realloc(jp, njp * sizeof(*jp));
jp = reallocarray(jp, njp, sizeof(*jp));
*jpp = jp;
return (njp);

View file

@ -74,7 +74,8 @@ pt_map_thread(const td_thragent_t *const_ta, psaddr_t pt, enum pt_type type)
{
td_thragent_t *ta = __DECONST(td_thragent_t *, const_ta);
struct pt_map *new;
int i, first = -1;
int first = -1;
unsigned int i;
/* leave zero out */
for (i = 1; i < ta->map_len; ++i) {
@ -94,12 +95,12 @@ pt_map_thread(const td_thragent_t *const_ta, psaddr_t pt, enum pt_type type)
ta->map_len = 20;
first = 1;
} else {
new = realloc(ta->map,
sizeof(struct pt_map) * ta->map_len * 2);
new = reallocarray(ta->map, ta->map_len,
2 * sizeof(struct pt_map));
if (new == NULL)
return (-1);
memset(new + ta->map_len, '\0', sizeof(struct pt_map) *
ta->map_len);
memset(new + ta->map_len, '\0', ta->map_len *
sizeof(struct pt_map));
first = ta->map_len;
ta->map = new;
ta->map_len *= 2;
@ -1047,7 +1048,7 @@ pt_thr_sstep(const td_thrhandle_t *th, int step)
static void
pt_unmap_lwp(const td_thragent_t *ta, lwpid_t lwp)
{
int i;
unsigned int i;
for (i = 0; i < ta->map_len; ++i) {
if (ta->map[i].type == PT_LWP && ta->map[i].lwp == lwp) {

View file

@ -77,7 +77,7 @@ struct td_thragent {
int thread_off_sigmask;
int thread_off_sigpend;
struct pt_map *map;
int map_len;
unsigned int map_len;
};
void pt_md_init(void);

View file

@ -170,6 +170,7 @@ updatestat(void)
struct timeval tm, btm;
int mib[6];
size_t len;
uint64_t val;
int ifcount;
#ifdef DEBUG
@ -229,11 +230,12 @@ updatestat(void)
#endif
#define FETCH_CNT(stat, cnt) do { \
len = sizeof((stat)); \
if (sysctlbyname("vm.stats." #cnt , &(stat), &len, 0, 0) < 0) { \
syslog(LOG_ERR, "sysctl(vm.stats." #cnt "): %m"); \
len = sizeof(uint64_t); \
if (sysctlbyname("vm.stats." #cnt , &val, &len, NULL, 0) < 0) { \
syslog(LOG_ERR, "sysctl(vm.stats." #cnt "): %m"); \
exit(1); \
} \
stat = val; \
} while (0)
FETCH_CNT(stats_all.s1.v_pgpgin, vm.v_vnodepgsin);

View file

@ -15,6 +15,7 @@ write_partition_layout() {
fi
_OBJDIR="$(make -C ${WORLDDIR} -V .OBJDIR)"
_OBJDIR="$(realpath ${_OBJDIR})"
if [ -d "${_OBJDIR%%/usr/src}/${TARGET}.${TARGET_ARCH}" ]; then
BOOTFILES="/${_OBJDIR%%/usr/src}/${TARGET}.${TARGET_ARCH}/usr/src/sys/boot"
else

View file

@ -1497,10 +1497,7 @@ rtmsg(int cmd, int flags, int fib)
#define NEXTADDR(w, u) \
if (rtm_addrs & (w)) { \
l = (((struct sockaddr *)&(u))->sa_len == 0) ? \
sizeof(long) : \
1 + ((((struct sockaddr *)&(u))->sa_len - 1) \
| (sizeof(long) - 1)); \
l = SA_SIZE(&(u)); \
memmove(cp, (char *)&(u), l); \
cp += l; \
if (verbose) \
@ -1564,7 +1561,8 @@ rtmsg(int cmd, int flags, int fib)
do {
l = read(s, (char *)&m_rtmsg, sizeof(m_rtmsg));
} while (l > 0 && stop_read == 0 &&
(rtm.rtm_seq != rtm_seq || rtm.rtm_pid != pid));
(rtm.rtm_type != RTM_GET || rtm.rtm_seq != rtm_seq ||
rtm.rtm_pid != pid));
if (stop_read != 0) {
warnx("read from routing socket timed out");
return (-1);
@ -1706,10 +1704,13 @@ print_rtmsg(struct rt_msghdr *rtm, size_t msglen)
break;
default:
printf("pid: %ld, seq %d, errno %d, flags:",
(long)rtm->rtm_pid, rtm->rtm_seq, rtm->rtm_errno);
printb(rtm->rtm_flags, routeflags);
pmsg_common(rtm, msglen);
if (rtm->rtm_type <= RTM_RESOLVE) {
printf("pid: %ld, seq %d, errno %d, flags:",
(long)rtm->rtm_pid, rtm->rtm_seq, rtm->rtm_errno);
printb(rtm->rtm_flags, routeflags);
pmsg_common(rtm, msglen);
} else
printf("type: %u, len: %zu\n", rtm->rtm_type, msglen);
}
return;

View file

@ -1233,6 +1233,15 @@ read_rt(void)
if (m.r.rtm.rtm_type <= RTM_CHANGE)
strp += sprintf(strp," from pid %d",m.r.rtm.rtm_pid);
/*
* Only messages that use the struct rt_msghdr format are
* allowed beyond this point.
*/
if (m.r.rtm.rtm_type > RTM_RESOLVE) {
trace_act("ignore %s", str);
continue;
}
rt_xaddrs(&info, m.r.addrs, &m.r.addrs[RTAX_MAX],
m.r.rtm.rtm_addrs);

View file

@ -5,7 +5,7 @@
LOCALEDIR= ${SHAREDIR}/locale
FILESNAME= LC_COLLATE
.SUFFIXES: .src .LC_COLLATE
MAPLOC= ${.CURDIR}/../../tools/tools/locale/etc/final-maps
MAPLOC= ${SRCTOP}/tools/tools/locale/etc/final-maps
.src.LC_COLLATE:
localedef -D -U -i ${.IMPSRC} \
@ -158,6 +158,7 @@ LOCALES+= sr_RS.ISO8859-2
LOCALES+= sr_RS.ISO8859-5
LOCALES+= zh_CN.GB2312
LOCALES+= zh_CN.eucCN
LOCALES+= zh_TW.Big5
LOCALES+= zh_CN.GB18030
LOCALES+= zh_CN.GBK
LOCALES+= ja_JP.eucJP

16033
share/colldef/zh_TW.Big5.src Normal file

File diff suppressed because it is too large Load diff

View file

@ -5,7 +5,7 @@
LOCALEDIR= ${SHAREDIR}/locale
FILESNAME= LC_CTYPE
.SUFFIXES: .src .LC_CTYPE
MAPLOC= ${.CURDIR}/../../tools/tools/locale/etc/final-maps
MAPLOC= ${SRCTOP}/tools/tools/locale/etc/final-maps
.src.LC_CTYPE:
localedef -D -U -c -w ${MAPLOC}/widths.txt \
@ -39,6 +39,7 @@ LOCALES+= zh_CN.GB18030
LOCALES+= zh_CN.GB2312
LOCALES+= zh_CN.GBK
LOCALES+= zh_CN.eucCN
LOCALES+= zh_TW.Big5

File diff suppressed because it is too large Load diff

View file

@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd June 8, 2015
.Dd April 20, 2017
.Dt GEOM 4
.Os
.Sh NAME
@ -55,6 +55,7 @@
.Cd options GEOM_MAP
.Cd options GEOM_MBR
.Cd options GEOM_MIRROR
.Cd options GEOM_MOUNTVER
.Cd options GEOM_MULTIPATH
.Cd options GEOM_NOP
.Cd options GEOM_PART_APM

View file

@ -1,6 +1,6 @@
.\" DO NOT EDIT-- this file is automatically generated.
.\" DO NOT EDIT-- this file is generated by tools/build/options/makeman.
.\" $FreeBSD$
.Dd April 10, 2017
.Dd April 19, 2017
.Dt SRC.CONF 5
.Os
.Sh NAME
@ -150,7 +150,7 @@ of the normal system build.
The resulting system cannot build programs from source.
.Pp
This is a default setting on
arm64/aarch64.
arm64/aarch64, riscv/riscv64 and riscv/riscv64sf.
When set, it enforces these options:
.Pp
.Bl -item -compact
@ -172,7 +172,7 @@ toolchain is provided.
.Ef
.Pp
This is a default setting on
arm64/aarch64.
arm64/aarch64, riscv/riscv64 and riscv/riscv64sf.
.It Va WITH_BINUTILS_BOOTSTRAP
Set build binutils (as, ld, objcopy and objdump)
as part of the bootstrap process.
@ -302,7 +302,7 @@ When set, it enforces these options:
Set to not build the Clang C/C++ compiler during the regular phase of the build.
.Pp
This is a default setting on
sparc64/sparc64.
riscv/riscv64, riscv/riscv64sf and sparc64/sparc64.
When set, it enforces these options:
.Pp
.Bl -item -compact
@ -323,7 +323,7 @@ To be able to build the system, either gcc or clang bootstrap must be
enabled unless an alternate compiler is provided via XCC.
.Pp
This is a default setting on
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64.
.It Va WITH_CLANG_BOOTSTRAP
Set to build the Clang C/C++ compiler during the bootstrap phase of the build.
.Pp
@ -336,7 +336,7 @@ Set to avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of
the Clang C/C++ compiler.
.Pp
This is a default setting on
sparc64/sparc64.
riscv/riscv64, riscv/riscv64sf and sparc64/sparc64.
.It Va WITH_CLANG_FULL
Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the
Clang C/C++ compiler.
@ -351,7 +351,7 @@ and
.Pa /usr/bin/cpp .
.Pp
This is a default setting on
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64.
.It Va WITH_CLANG_IS_CC
Set to install the Clang C/C++ compiler as
.Pa /usr/bin/cc ,
@ -427,7 +427,7 @@ Set to not build
.Xr cxgbetool 8
.Pp
This is a default setting on
arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc and powerpc/powerpcspe.
arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf.
.It Va WITH_CXGBETOOL
Set to build
.Xr cxgbetool 8
@ -442,6 +442,9 @@ It will also prevent building of
.Xr gperf 1
and
.Xr devd 8 .
.Pp
This is a default setting on
riscv/riscv64 and riscv/riscv64sf.
When set, it enforces these options:
.Pp
.Bl -item -compact
@ -462,6 +465,13 @@ When set, it enforces these options:
.It
.Va WITHOUT_TESTS_SUPPORT
.El
.It Va WITH_CXX
Set to build
.Xr c++ 1
and related libraries.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
.It Va WITHOUT_DEBUG_FILES
Set to avoid building or installing standalone debug files for each
executable binary and shared library.
@ -598,7 +608,7 @@ and
.Xr efivar 8 .
.Pp
This is a default setting on
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64.
.It Va WITH_EFI
Set to build
.Xr efivar 3
@ -662,7 +672,7 @@ Set to not build games.
Set to not build and install gcc and g++ as part of the normal build process.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386.
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf.
.It Va WITH_GCC
Set to build and install gcc and g++.
.Pp
@ -675,7 +685,7 @@ unless an alternative compiler is provided via
XCC.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386.
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf.
.It Va WITH_GCC_BOOTSTRAP
Set to build gcc and g++ as part of the bootstrap process.
.Pp
@ -690,32 +700,19 @@ Set to not build
.Xr gdb 1 .
.Pp
This is a default setting on
arm64/aarch64.
amd64/amd64, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf.
.It Va WITH_GDB
Set to build
.Xr gdb 1 .
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
.It Va WITHOUT_GNU
Set to not build contributed GNU software as a part of the base system.
This option can be useful if the system built must not contain any code
covered by the GNU Public License due to legal reasons.
.Bf -symbolic
The option has no effect yet.
.Ef
When set, it enforces these options:
.Pp
.Bl -item -compact
.It
.Va WITHOUT_GNU_SUPPORT
.El
arm/arm, arm/armeb, arm/armv6 and sparc64/sparc64.
.It Va WITHOUT_GNUCXX
Do not build the GNU C++ stack (g++, libstdc++).
This is the default on platforms where clang is the system compiler.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386.
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf.
.It Va WITH_GNUCXX
Build the GNU C++ stack (g++, libstdc++).
This is the default on platforms where gcc is the system compiler.
@ -733,8 +730,6 @@ Set to not build GNU
.It Va WITHOUT_GNU_GREP_COMPAT
Set this option to omit the gnu extensions to grep from being included in
BSD grep.
.It Va WITHOUT_GNU_SUPPORT
Set to build some programs without optional GNU support.
.It Va WITHOUT_GPIO
Set to not build
.Xr gpioctl 8
@ -749,6 +744,17 @@ and
.Xr vgrind 1 .
You should consider installing the textproc/groff port to not break
.Xr man 1 .
.Pp
This is a default setting on
riscv/riscv64 and riscv/riscv64sf.
.It Va WITH_GROFF
Set to build
.Xr groff 1
and
.Xr vgrind 1 .
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
.It Va WITHOUT_GSSAPI
Set to not build libgssapi.
.It Va WITHOUT_HAST
@ -930,7 +936,7 @@ library.
Set to not build LLVM's lld linker.
.Pp
This is a default setting on
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64.
When set, it enforces these options:
.Pp
.Bl -item -compact
@ -946,7 +952,7 @@ amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386.
Set to not build the LLDB debugger.
.Pp
This is a default setting on
arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64.
.It Va WITH_LLDB
Set to build the LLDB debugger.
.Pp
@ -959,7 +965,7 @@ To be able to build the system, either Binutils or LLD bootstrap must be
enabled unless an alternate linker is provided via XLD.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64.
.It Va WITH_LLD_BOOTSTRAP
Set to build the LLD linker during the bootstrap phase of the build.
.Pp
@ -969,7 +975,7 @@ arm64/aarch64.
Set to use GNU binutils ld as the system linker, instead of LLVM's LLD.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64.
.It Va WITH_LLD_IS_LD
Set to use LLVM's LLD as the system linker, instead of GNU binutils ld.
.Pp
@ -992,7 +998,7 @@ arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips6
Set to use LLVM's libunwind stack unwinder (instead of GCC's unwinder).
.Pp
This is a default setting on
amd64/amd64, arm64/aarch64 and i386/i386.
amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf.
.It Va WITHOUT_LOCALES
Set to not build localization files; see
.Xr locale 1 .
@ -1231,7 +1237,17 @@ Set to not build
.Xr ppp 8
and related programs.
.It Va WITHOUT_PROFILE
Set to avoid compiling profiled libraries.
Set to not build profiled libraries for use with
.Xr gprof 8 .
.Pp
This is a default setting on
riscv/riscv64 and riscv/riscv64sf.
.It Va WITH_PROFILE
Set to build profiled libraries for use with
.Xr gprof 8 .
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
.It Va WITHOUT_QUOTAS
Set to not build
.Xr quota 1
@ -1275,6 +1291,10 @@ Set to not build
Set to not build
.Xr routed 8
utility.
.It Va WITH_RPCBIND_WARMSTART_SUPPORT
Set to build
.Xr rpcbind 8
with warmstart support.
.It Va WITHOUT_SENDMAIL
Set to not build
.Xr sendmail 8
@ -1319,7 +1339,7 @@ mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf,
Set to build world with propolice stack smashing protection.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64.
.It Va WITH_STAGING
Enable staging of files to a stage tree.
This can be best thought of as auto-install to
@ -1403,7 +1423,7 @@ and
options control those.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64.
.It Va WITHOUT_TALK
Set to not build or install
.Xr talk 1
@ -1431,6 +1451,9 @@ See
.Xr tests 7
for more details.
This also disables the build of all test-related dependencies, including ATF.
.Pp
This is a default setting on
riscv/riscv64 and riscv/riscv64sf.
When set, it enforces these options:
.Pp
.Bl -item -compact
@ -1441,6 +1464,9 @@ When set, it enforces these options:
.El
.It Va WITHOUT_TESTS_SUPPORT
Set to disables the build of all test-related dependencies, including ATF.
.Pp
This is a default setting on
riscv/riscv64 and riscv/riscv64sf.
.It Va WITHOUT_TEXTPROC
Set to not build
programs used for text processing.

View file

@ -169,6 +169,7 @@ flz [label="Florent Thoumie\nflz@FreeBSD.org\n2006/03/30"]
gabor [label="Gabor Kovesdan\ngabor@FreeBSD.org\n2010/02/02"]
gad [label="Garance A. Drosehn\ngad@FreeBSD.org\n2000/10/27"]
gallatin [label="Andrew Gallatin\ngallatin@FreeBSD.org\n1999/01/15"]
ganbold [label="Ganbold Tsagaankhuu\nganbold@FreeBSD.org\n2013/12/18"]
gavin [label="Gavin Atkinson\ngavin@FreeBSD.org\n2009/12/07"]
gibbs [label="Justin T. Gibbs\ngibbs@FreeBSD.org\n????/??/??"]
gjb [label="Glen Barber\ngjb@FreeBSD.org\n2013/06/04"]
@ -772,6 +773,8 @@ sjg -> stevek
sos -> marcel
stas -> ganbold
theraven -> phil
thompsa -> weongyo

View file

@ -42,6 +42,10 @@ MKOBJDIRS= auto
# Use __objdir here so it is easier to tweak without impacting
# the logic.
.if !empty(MAKEOBJDIRPREFIX)
.if ${.CURDIR:M${MAKEOBJDIRPREFIX}/*} != ""
# we are already in obj tree!
__objdir?= ${.CURDIR}
.endif
__objdir?= ${MAKEOBJDIRPREFIX}${.CURDIR}
.endif
__objdir?= ${MAKEOBJDIR:Uobj}

View file

@ -41,7 +41,7 @@ __<src.opts.mk>__:
# that haven't been converted over.
#
# These options are used by src the builds
# These options are used by the src builds
__DEFAULT_YES_OPTIONS = \
ACCT \
@ -96,8 +96,6 @@ __DEFAULT_YES_OPTIONS = \
FTP \
GAMES \
GCOV \
GDB \
GNU \
GNU_DIFF \
GNU_GREP \
GNU_GREP_COMPAT \
@ -188,6 +186,7 @@ __DEFAULT_NO_OPTIONS = \
OFED \
OPENLDAP \
REPRODUCIBLE_BUILD \
RPCBIND_WARMSTART_SUPPORT \
SHARED_TOOLCHAIN \
SORT_THREADS \
SVN \
@ -263,6 +262,14 @@ __DEFAULT_NO_OPTIONS+=LLDB
.if ${__T} == "arm" || ${__T} == "armeb"
BROKEN_OPTIONS+=LLDB
.endif
# GDB in base is generally less functional than GDB in ports. Ports GDB
# does not yet contain kernel support for arm, and sparc64 kernel support
# has not been tested.
.if ${__T:Marm*} != "" || ${__T} == "sparc64"
__DEFAULT_YES_OPTIONS+=GDB
.else
__DEFAULT_NO_OPTIONS+=GDB
.endif
# Only doing soft float API stuff on armv6
.if ${__T} != "armv6"
BROKEN_OPTIONS+=LIBSOFT
@ -443,7 +450,6 @@ MK_${vv:H}:= ${MK_${vv:T}}
.for var in \
BLACKLIST \
BZIP2 \
GNU \
INET \
INET6 \
KERBEROS \

View file

@ -103,6 +103,7 @@ LOCALES+= zh_CN.GBK
LOCALES+= zh_CN.UTF-8
LOCALES+= zh_CN.eucCN
LOCALES+= zh_HK.UTF-8
LOCALES+= zh_TW.Big5
LOCALES+= zh_TW.UTF-8

View file

@ -0,0 +1,50 @@
# Warning: Do not edit. This file is automatically generated from the
# tools in /usr/src/tools/tools/locale. The data is obtained from the
# CLDR project, obtained from http://cldr.unicode.org/
# -----------------------------------------------------------------------------
#
# int_curr_symbol (last character always SPACE)
¢â¢å¢Ò¡@
#
# currency_symbol
¢C
#
# mon_decimal_point
¡D
#
# mon_thousands_sep
¡A
#
# mon_grouping
3
#
# positive_sign
#
# negative_sign
¡Ð
#
# int_frac_digits
2
#
# frac_digits
2
#
# p_cs_precedes
1
#
# p_sep_by_space
0
#
# n_cs_precedes
1
#
# n_sep_by_space
0
#
# p_sign_posn
1
#
# n_sign_posn
1
# EOF

View file

@ -76,6 +76,7 @@ LOCALES+= zh_CN.GB2312
LOCALES+= zh_CN.GBK
LOCALES+= zh_CN.UTF-8
LOCALES+= zh_HK.UTF-8
LOCALES+= zh_TW.Big5
LOCALES+= zh_TW.UTF-8

View file

@ -0,0 +1,17 @@
# Warning: Do not edit. This file is automatically generated from the
# tools in /usr/src/tools/tools/locale. The data is obtained from the
# CLDR project, obtained from http://cldr.unicode.org/
# -----------------------------------------------------------------------------
#
# yesexpr
^((是)|(確定)|([yY]([eE][sS])?)|([yY]))
#
# noexpr
^((否)|(不)|([nN]([oO])?)|([nN]))
#
# yesstr
是:確定:yes:y:YES:Y
#
# nostr
否:不:no:n:NO:N
# EOF

View file

@ -23,6 +23,7 @@ LOCALES+= uk_UA.KOI8-U
LOCALES+= uk_UA.UTF-8
LOCALES+= zh_CN.GB2312
LOCALES+= zh_CN.eucCN
LOCALES+= zh_TW.Big5

View file

@ -0,0 +1,14 @@
# Warning: Do not edit. This file is automatically generated from the
# tools in /usr/src/tools/tools/locale. The data is obtained from the
# CLDR project, obtained from http://cldr.unicode.org/
# -----------------------------------------------------------------------------
#
# decimal_point
¡D
#
# thousands_sep
¡A
#
# grouping
3
# EOF

View file

@ -1,6 +1,6 @@
/*-
* Copyright (C) 2002-2003 NetGroup, Politecnico di Torino (Italy)
* Copyright (C) 2005-2016 Jung-uk Kim <jkim@FreeBSD.org>
* Copyright (C) 2005-2017 Jung-uk Kim <jkim@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -37,10 +37,14 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/socket.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <net/if.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
#include <vm/vm_kern.h>
#else
#include <stdlib.h>
#include <string.h>
@ -55,8 +59,6 @@ __FBSDID("$FreeBSD$");
#include <amd64/amd64/bpf_jit_machdep.h>
bpf_filter_func bpf_jit_compile(struct bpf_insn *, u_int, size_t *);
/*
* Emit routine to update the jump table.
*/
@ -601,7 +603,11 @@ bpf_jit_compile(struct bpf_insn *prog, u_int nins, size_t *size)
*size = stream.cur_ip;
#ifdef _KERNEL
stream.ibuf = malloc(*size, M_BPFJIT, M_NOWAIT);
/*
* We cannot use malloc(9) because DMAP is mapped as NX.
*/
stream.ibuf = (void *)kmem_malloc(kernel_arena, *size,
M_NOWAIT);
if (stream.ibuf == NULL)
break;
#else
@ -650,3 +656,14 @@ bpf_jit_compile(struct bpf_insn *prog, u_int nins, size_t *size)
return ((bpf_filter_func)(void *)stream.ibuf);
}
void
bpf_jit_free(void *func, size_t size)
{
#ifdef _KERNEL
kmem_free(kernel_arena, (vm_offset_t)func, size);
#else
munmap(func, size);
#endif
}

View file

@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
#include <sys/sched.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <sys/vmmeter.h>
#include <machine/fpu.h>
#include <machine/efi.h>
#include <machine/metadata.h>

View file

@ -90,9 +90,6 @@ ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
ASSYM(TDP_CALLCHAIN, TDP_CALLCHAIN);
ASSYM(TDP_KTHREAD, TDP_KTHREAD);
ASSYM(V_TRAP, offsetof(struct vmmeter, v_trap));
ASSYM(V_SYSCALL, offsetof(struct vmmeter, v_syscall));
ASSYM(V_INTR, offsetof(struct vmmeter, v_intr));
ASSYM(PAGE_SIZE, PAGE_SIZE);
ASSYM(NPTEPG, NPTEPG);
ASSYM(NPDEPG, NPDEPG);

View file

@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
#include <sys/msgbuf.h>
#include <sys/sysctl.h>
#include <sys/watchdog.h>
#include <sys/vmmeter.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/vm_page.h>

View file

@ -176,7 +176,7 @@ trap(struct trapframe *frame)
register_t addr = 0;
ksiginfo_t ksi;
PCPU_INC(cnt.v_trap);
VM_CNT_INC(v_trap);
type = frame->tf_trapno;
#ifdef SMP

View file

@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/systm.h>
#include <sys/vmmeter.h>
#include <vm/vm.h>
#include <vm/vm_page.h>
#include <vm/vm_pageout.h>

View file

@ -348,7 +348,7 @@ atomic_testandclear_long(volatile u_long *p, u_int v)
* avoid a dependency on sys/pcpu.h in machine/atomic.h consumers.
* An assertion in amd64/vm_machdep.c ensures that the value is correct.
*/
#define OFFSETOF_MONITORBUF 0x180
#define OFFSETOF_MONITORBUF 0x100
#if defined(SMP)
static __inline void

View file

@ -31,7 +31,9 @@
#include <sys/pcpu.h>
extern struct pcpu __pcpu[1];
extern struct pcpu __pcpu[];
#define EARLY_COUNTER &__pcpu[0].pc_early_dummy_counter
#define counter_enter() do {} while (0)
#define counter_exit() do {} while (0)

View file

@ -66,7 +66,7 @@
uint32_t pc_pcid_next; \
uint32_t pc_pcid_gen; \
uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \
char __pad[145] /* be divisor of PAGE_SIZE \
char __pad[384] /* be divisor of PAGE_SIZE \
after cache alignment */
#define PC_DBREG_CMD_NONE 0

View file

@ -32,6 +32,4 @@
#define A10_GPIO_FUNC_MII 2
#define A10_GPIO_FUNC_RGMII 5
int a10_gpio_ethernet_activate(uint32_t);
#endif

View file

@ -419,7 +419,7 @@ aw_ir_attach(device_t dev)
}
/* De-assert reset */
if (hwreset_get_by_ofw_name(dev, 0, "apb", &rst_apb) == 0) {
if (hwreset_get_by_ofw_idx(dev, 0, 0, &rst_apb) == 0) {
err = hwreset_deassert(rst_apb);
if (err != 0) {
device_printf(dev, "cannot de-assert reset\n");

View file

@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
#include <sys/conf.h>
#include <sys/pmc.h>
#include <sys/pmckern.h>
#include <sys/vmmeter.h>
#include <machine/atomic.h>
#include <machine/bus.h>
@ -184,7 +185,7 @@ intr_irq_handler(struct trapframe *frame)
struct intr_event *event;
int i;
PCPU_INC(cnt.v_intr);
VM_CNT_INC(v_intr);
i = -1;
while ((i = arm_get_next_irq(i)) != -1) {
intrcnt[i]++;

View file

@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$");
#include <sys/syscallsubr.h>
#include <sys/sysent.h>
#include <sys/sysproto.h>
#include <sys/vmmeter.h>
#include <vm/vm_object.h>
#include <vm/vm_page.h>
@ -813,9 +814,10 @@ initarm(struct arm_boot_params *abp)
/*
* Add one table for end of kernel map, one for stacks, msgbuf and
* L1 and L2 tables map and one for vectors map.
* L1 and L2 tables map, one for vectors map and two for
* l2 structures from pmap_bootstrap.
*/
l2size += 3;
l2size += 5;
/* Make it divisible by 4 */
l2size = (l2size + 3) & ~3;

View file

@ -272,7 +272,9 @@ pl310_wbinv_range(vm_paddr_t start, vm_size_t size)
#ifdef PL310_ERRATA_727915
platform_pl310_write_debug(pl310_softc, 3);
if (pl310_softc->sc_rtl_revision >= CACHE_ID_RELEASE_r2p0 &&
pl310_softc->sc_rtl_revision < CACHE_ID_RELEASE_r3p1)
platform_pl310_write_debug(pl310_softc, 3);
#endif
while (size > 0) {
#ifdef PL310_ERRATA_588369
@ -293,7 +295,9 @@ pl310_wbinv_range(vm_paddr_t start, vm_size_t size)
size -= g_l2cache_line_size;
}
#ifdef PL310_ERRATA_727915
platform_pl310_write_debug(pl310_softc, 0);
if (pl310_softc->sc_rtl_revision >= CACHE_ID_RELEASE_r2p0 &&
pl310_softc->sc_rtl_revision < CACHE_ID_RELEASE_r3p1)
platform_pl310_write_debug(pl310_softc, 0);
#endif
pl310_cache_sync();

View file

@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$");
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/signalvar.h>
#include <sys/vmmeter.h>
#include <vm/vm.h>
#include <vm/pmap.h>
@ -203,7 +204,7 @@ abort_handler(struct trapframe *tf, int type)
td = curthread;
p = td->td_proc;
PCPU_INC(cnt.v_trap);
VM_CNT_INC(v_trap);
/* Data abort came from user mode? */
user = TRAP_USERMODE(tf);
@ -614,7 +615,7 @@ prefetch_abort_handler(struct trapframe *tf)
td = curthread;
p = td->td_proc;
PCPU_INC(cnt.v_trap);
VM_CNT_INC(v_trap);
if (TRAP_USERMODE(tf)) {
td->td_frame = tf;

View file

@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
#include <sys/mutex.h>
#include <sys/signalvar.h>
#include <sys/ktr.h>
#include <sys/vmmeter.h>
#ifdef KTRACE
#include <sys/uio.h>
#include <sys/ktrace.h>
@ -290,7 +291,7 @@ abort_handler(struct trapframe *tf, int prefetch)
void *onfault;
#endif
PCPU_INC(cnt.v_trap);
VM_CNT_INC(v_trap);
td = curthread;
fsr = (prefetch) ? cp15_ifsr_get(): cp15_dfsr_get();

View file

@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$");
#include <sys/mutex.h>
#include <sys/signalvar.h>
#include <sys/ptrace.h>
#include <sys/vmmeter.h>
#ifdef KDB
#include <sys/kdb.h>
#endif
@ -200,7 +201,7 @@ undefinedinstruction(struct trapframe *frame)
if (__predict_true(frame->tf_spsr & PSR_F) == 0)
enable_interrupts(PSR_F);
PCPU_INC(cnt.v_trap);
VM_CNT_INC(v_trap);
fault_pc = frame->tf_pc;

View file

@ -21,6 +21,8 @@ options ROOTDEVNAME=\"/dev/da0s1a\"
options SCHED_ULE # ULE scheduler
options SMP
options VM_KMEM_SIZE_MAX=0x9CCD000
# Pseudo devices
device random
device pty
@ -73,6 +75,9 @@ device cesa
device crypto
device cryptodev
# L2 Cache
device pl310
#FDT
options FDT
options FDT_DTB_STATIC

View file

@ -68,6 +68,12 @@ struct usbphy_softc {
u_int phy_num;
};
static struct ofw_compat_data compat_data[] = {
{"fsl,imx6q-usbphy", true},
{"fsl,imx6ul-usbphy", true},
{NULL, false}
};
static int
usbphy_detach(device_t dev)
{
@ -167,7 +173,7 @@ usbphy_probe(device_t dev)
if (!ofw_bus_status_okay(dev))
return (ENXIO);
if (ofw_bus_is_compatible(dev, "fsl,imx6q-usbphy") == 0)
if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data)
return (ENXIO);
device_set_desc(dev, "Freescale i.MX6 USB PHY");

View file

@ -32,6 +32,10 @@
#include <sys/pcpu.h>
#include <machine/atomic.h>
extern struct pcpu __pcpu[];
#define EARLY_COUNTER &__pcpu[0].pc_early_dummy_counter
#define counter_enter() do {} while (0)
#define counter_exit() do {} while (0)

View file

@ -57,10 +57,10 @@ struct vmspace;
void *pc_qmap_pte2p; \
unsigned int pc_dbreg[32]; \
int pc_dbreg_cmd; \
char __pad[27]
char __pad[155]
#else
#define PCPU_MD_FIELDS \
char __pad[157]
char __pad[93]
#endif
#ifdef _KERNEL

View file

@ -134,8 +134,8 @@
#define PREFETCH_CTRL_INSTR_PREFETCH (1 << 29)
#define PREFETCH_CTRL_DL (1 << 30)
#define PL310_POWER_CTRL 0xF80
#define POWER_CTRL_ENABLE_GATING (1 << 0)
#define POWER_CTRL_ENABLE_STANDBY (1 << 1)
#define POWER_CTRL_ENABLE_GATING (1 << 1)
#define POWER_CTRL_ENABLE_STANDBY (1 << 0)
struct intr_config_hook;

View file

@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
int armada38x_open_bootrom_win(void);
int armada38x_scu_enable(void);
int armada38x_win_set_iosync_barrier(void);
int armada38x_mbus_optimization(void);
uint32_t
get_tclk(void)
@ -114,6 +115,50 @@ armada38x_open_bootrom_win(void)
return (rv);
}
int
armada38x_mbus_optimization(void)
{
bus_space_handle_t vaddr_iowind;
int rv;
rv = bus_space_map(fdtbus_bs_tag, (bus_addr_t)MV_MBUS_CTRL_BASE,
MV_MBUS_CTRL_REGS_LEN, 0, &vaddr_iowind);
if (rv != 0)
return (rv);
/*
* MBUS Units Priority Control Register - Prioritize XOR,
* PCIe and GbEs (ID=4,6,3,7,8) DRAM access
* GbE is High and others are Medium.
*/
bus_space_write_4(fdtbus_bs_tag, vaddr_iowind, 0, 0x19180);
/*
* Fabric Units Priority Control Register -
* Prioritize CPUs requests.
*/
bus_space_write_4(fdtbus_bs_tag, vaddr_iowind, 0x4, 0x3000A);
/*
* MBUS Units Prefetch Control Register -
* Pre-fetch enable for all IO masters.
*/
bus_space_write_4(fdtbus_bs_tag, vaddr_iowind, 0x8, 0xFFFF);
/*
* Fabric Units Prefetch Control Register -
* Enable the CPUs Instruction and Data prefetch.
*/
bus_space_write_4(fdtbus_bs_tag, vaddr_iowind, 0xc, 0x303);
bus_space_barrier(fdtbus_bs_tag, vaddr_iowind, 0, MV_MBUS_CTRL_REGS_LEN,
BUS_SPACE_BARRIER_WRITE);
bus_space_unmap(fdtbus_bs_tag, vaddr_iowind, MV_MBUS_CTRL_REGS_LEN);
return (rv);
}
int
armada38x_scu_enable(void)
{

View file

@ -0,0 +1,74 @@
/*-
* Copyright (c) 2017 Stormshield.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* The machine-dependent part of the arm/pl310 driver for Armada 38x SoCs.
*/
#include <sys/types.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/rman.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <machine/bus.h>
#include <machine/pl310.h>
void
platform_pl310_init(struct pl310_softc *sc)
{
uint32_t reg;
/*
* Enable power saving modes:
* - Dynamic Gating stops the clock when the controller is idle.
*/
reg = pl310_read4(sc, PL310_POWER_CTRL);
reg |= POWER_CTRL_ENABLE_GATING;
pl310_write4(sc, PL310_POWER_CTRL, reg);
pl310_write4(sc, PL310_PREFETCH_CTRL, PREFETCH_CTRL_DL |
PREFETCH_CTRL_DATA_PREFETCH | PREFETCH_CTRL_INCR_DL |
PREFETCH_CTRL_DL_ON_WRAP);
}
void
platform_pl310_write_ctrl(struct pl310_softc *sc, uint32_t val)
{
pl310_write4(sc, PL310_CTRL, val);
}
void
platform_pl310_write_debug(struct pl310_softc *sc, uint32_t val)
{
pl310_write4(sc, PL310_DEBUG_CTRL, val);
}

View file

@ -7,3 +7,4 @@ arm/mv/armada38x/armada38x.c standard
arm/mv/armada38x/armada38x_mp.c optional smp
arm/mv/armada38x/pmsu.c standard
arm/mv/armada38x/rtc.c standard
arm/mv/armada38x/armada38x_pl310.c optional pl310

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