summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McDonald <danmcd@joyent.com>2022-01-07 11:29:49 -0500
committerDan McDonald <danmcd@joyent.com>2022-01-07 11:29:49 -0500
commit5494b509734767884e5c4e1237dab66b69980c64 (patch)
tree85b366f459f5ac32ec1173dcf6c77488369d1f5a
parent0cc1a62e5527e9741273983ed61b4d14d6ad7cee (diff)
parent59c22e7a2e5efed7b82bdb64375da8627629d3e9 (diff)
downloadillumos-joyent-5494b509734767884e5c4e1237dab66b69980c64.tar.gz
[illumos-gate merge]
commit 59c22e7a2e5efed7b82bdb64375da8627629d3e9 14346 loader: add __alloc_size2 commit bb771288d01b795ba4ddad4a440845264a95a7e0 14340 libbe: 'menu_fp' may be used uninitialized commit 7c46107350cb9215d4a4b9e371541fbfa02abdb4 14319 ld shouldn't warn about SHF_EXCLUDE unknown sections commit c7ebb3fa8bd1474c486063f5c422f61578a4a968 14347 ed: mismatched bound commit cf45009884e299356c21eb3d343d4b99bfd1fd5f 14348 libdbm: mismatched bound commit 439b932b1a6fbc5105bd6987cb696a707183a149 14344 libnisdb: ISO C++17 does not allow 'register' storage class specifier commit 74bc43b0515c1d5245354261e501b8923daba127 14353 crypto_mech2id should take unlimited string argument commit 48f0b85934bda8ceb1816a9b7d27b697dbb40aeb 14336 elfdump: this 'if' clause does not guard...
-rw-r--r--usr/src/boot/include/stdlib.h8
-rw-r--r--usr/src/boot/sys/sys/cdefs.h6
-rw-r--r--usr/src/cmd/ed/ed.c5
-rw-r--r--usr/src/cmd/sgs/elfdump/common/elfdump.c10
-rw-r--r--usr/src/cmd/sgs/libld/common/files.c11
-rw-r--r--usr/src/cmd/sgs/tools/SUNWonld-README1
-rw-r--r--usr/src/lib/libbe/common/be_utils.c3
-rw-r--r--usr/src/lib/libnisdb/db_dictionary.cc24
-rw-r--r--usr/src/lib/libnisdb/db_index.cc8
-rw-r--r--usr/src/lib/libnisdb/db_index_entry_c.c32
-rw-r--r--usr/src/lib/libnisdb/ldap_map.c2
-rw-r--r--usr/src/lib/libzpool/common/kernel.c2
-rw-r--r--usr/src/pkg/manifests/system-test-elftest.p5m1
-rw-r--r--usr/src/test/elf-tests/runfiles/default.run2
-rw-r--r--usr/src/test/elf-tests/tests/sections/shf-exclude/Makefile3
-rw-r--r--usr/src/test/elf-tests/tests/sections/shf-exclude/Makefile.test9
-rw-r--r--usr/src/test/elf-tests/tests/sections/shf-exclude/unknown-os.sh37
-rw-r--r--usr/src/ucblib/libdbm/dbm.c4
-rw-r--r--usr/src/uts/common/crypto/api/kcf_miscapi.c4
-rw-r--r--usr/src/uts/common/sys/crypto/api.h2
20 files changed, 111 insertions, 63 deletions
diff --git a/usr/src/boot/include/stdlib.h b/usr/src/boot/include/stdlib.h
index b8708a27a5..2b6e781ffb 100644
--- a/usr/src/boot/include/stdlib.h
+++ b/usr/src/boot/include/stdlib.h
@@ -88,7 +88,7 @@ long atol(const char *);
void *bsearch(const void *, const void *, size_t,
size_t, int (*)(const void *, const void *));
void *calloc(size_t, size_t) __malloc_like __result_use_check
- __alloc_size(1) __alloc_size(2);
+ __alloc_size2(1, 2);
div_t div(int, int) __pure2;
_Noreturn void exit(int);
void free(void *);
@@ -257,7 +257,7 @@ __uint32_t
void arc4random_addrandom(unsigned char *, int);
void arc4random_buf(void *, size_t);
void arc4random_stir(void);
-__uint32_t
+__uint32_t
arc4random_uniform(__uint32_t);
#ifdef __BLOCKS__
int atexit_b(void (^)(void));
@@ -303,8 +303,8 @@ void qsort_r(void *, size_t, size_t, void *,
int (*)(void *, const void *, const void *));
int radixsort(const unsigned char **, int, const unsigned char *,
unsigned);
-void *reallocarray(void *, size_t, size_t) __result_use_check __alloc_size(2)
- __alloc_size(3);
+void *reallocarray(void *, size_t, size_t) __result_use_check
+ __alloc_size2(2, 3);
void *reallocf(void *, size_t) __alloc_size(2);
int rpmatch(const char *);
void setprogname(const char *);
diff --git a/usr/src/boot/sys/sys/cdefs.h b/usr/src/boot/sys/sys/cdefs.h
index 530359f6c1..29b06e6946 100644
--- a/usr/src/boot/sys/sys/cdefs.h
+++ b/usr/src/boot/sys/sys/cdefs.h
@@ -239,8 +239,10 @@
#endif
#if __GNUC_PREREQ__(4, 3) || __has_attribute(__alloc_size__)
#define __alloc_size(x) __attribute__((__alloc_size__(x)))
+#define __alloc_size2(n, x) __attribute__((__alloc_size__(n, x)))
#else
#define __alloc_size(x)
+#define __alloc_size2(n, x)
#endif
#if __GNUC_PREREQ__(4, 9) || __has_attribute(__alloc_align__)
#define __alloc_align(x) __attribute__((__alloc_align__(x)))
@@ -533,7 +535,7 @@
* the use of non-standard inlining. In general we should try to avoid
* using these but GCC-compatible compilers tend to support the extensions
* well enough to use them in limited cases.
- */
+ */
#if defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__)
#if __GNUC_PREREQ__(4, 3) || __has_attribute(__artificial__)
#define __gnu_inline __attribute__((__gnu_inline__, __artificial__))
@@ -784,7 +786,7 @@
* Type Safety Checking
*
* Clang provides additional attributes to enable checking type safety
- * properties that cannot be enforced by the C type system.
+ * properties that cannot be enforced by the C type system.
*/
#if __has_attribute(__argument_with_type_tag__) && \
diff --git a/usr/src/cmd/ed/ed.c b/usr/src/cmd/ed/ed.c
index a2fae9c409..138fb1dcc3 100644
--- a/usr/src/cmd/ed/ed.c
+++ b/usr/src/cmd/ed/ed.c
@@ -3075,10 +3075,11 @@ static char stdtabs[] = {
static int
-stdtab(char option[], char tabvect[NTABS])
+stdtab(char *option, char *tabvect)
{
char *scan;
- tabvect[0] = 0;
+
+ tabvect[0] = '\0';
scan = stdtabs;
while (*scan) {
if (strequal(&scan, option)) {
diff --git a/usr/src/cmd/sgs/elfdump/common/elfdump.c b/usr/src/cmd/sgs/elfdump/common/elfdump.c
index 0219f2f831..a5c8aa2200 100644
--- a/usr/src/cmd/sgs/elfdump/common/elfdump.c
+++ b/usr/src/cmd/sgs/elfdump/common/elfdump.c
@@ -133,7 +133,7 @@ typedef struct {
uint_t n; /* # items in shxndx.data */
} shxndx;
VERSYM_STATE *versym; /* NULL, or associated VERSYM section */
- Sym *sym; /* Array of symbols */
+ Sym *sym; /* Array of symbols */
Word symn; /* # of symbols */
} SYMTBL_STATE;
@@ -1575,7 +1575,7 @@ cap_section(const char *file, Cache *cache, Word shnum, Cache *ccache,
((ehdr->e_type == ET_EXEC) || (ehdr->e_type == ET_DYN))) {
Capinfo *cip;
Capchain *chain;
- Cache *chcache;
+ Cache *chcache;
Shdr *chshdr;
Word chainnum, inum;
@@ -1965,7 +1965,7 @@ syminfo(Cache *cache, Word shnum, Ehdr *ehdr, uchar_t osabi, const char *file)
Elf_syminfo_title(0);
for (ndx = 1, info++; ndx < infonum; ndx++, info++) {
- Sym *sym;
+ Sym *sym;
const char *needed, *name;
Word expect_dt;
Word boundto = info->si_boundto;
@@ -2135,7 +2135,7 @@ version_def(Verdef *vdf, Word vdf_num, Cache *vcache, Cache *scache,
* contain the largest version index seen.
*
* note:
- * The versym section of an object that follows the original
+ * The versym section of an object that follows the original
* Solaris versioning rules only contains indexes into the verdef
* section. Symbols defined in other objects (UNDEF) are given
* a version of 0, indicating that they are not defined by
@@ -3028,7 +3028,7 @@ dynamic(Cache *cache, Word shnum, Ehdr *ehdr, uchar_t osabi, const char *file)
case _sec_type: \
if (sec._sec_field == NULL) \
sec._sec_field = _cache; \
- break
+ break
GRAB(SHT_SYMTAB, symtab);
GRAB(SHT_DYNSYM, dynsym);
GRAB(SHT_FINI_ARRAY, fini_array);
diff --git a/usr/src/cmd/sgs/libld/common/files.c b/usr/src/cmd/sgs/libld/common/files.c
index 2073ae2ec5..3afd9ae3e7 100644
--- a/usr/src/cmd/sgs/libld/common/files.c
+++ b/usr/src/cmd/sgs/libld/common/files.c
@@ -2676,10 +2676,15 @@ process_elf(Ifl_desc *ifl, Elf *elf, Ofl_desc *ofl)
} else {
/*
* If this section is below SHT_LOSUNW then we don't
- * really know what to do with it, issue a warning
- * message but do the basic section processing anyway.
+ * really know what to do with it.
+ *
+ * If SHF_EXCLUDE is set we're being told we should
+ * (or may) ignore the section. Otherwise issue a
+ * warning message but do the basic section processing
+ * anyway.
*/
- if (row < (Word)SHT_LOSUNW) {
+ if ((row < (Word)SHT_LOSUNW) &&
+ ((shdr->sh_flags & SHF_EXCLUDE) == 0)) {
Conv_inv_buf_t inv_buf;
ld_eprintf(ofl, ERR_WARNING,
diff --git a/usr/src/cmd/sgs/tools/SUNWonld-README b/usr/src/cmd/sgs/tools/SUNWonld-README
index 36fdba7231..1e15c9fbdc 100644
--- a/usr/src/cmd/sgs/tools/SUNWonld-README
+++ b/usr/src/cmd/sgs/tools/SUNWonld-README
@@ -1684,3 +1684,4 @@ Bugid Risk Synopsis
14250 ld should resolve discarded COMDAT symbols against their mates
14283 ldd should not complain about non-executable shared objects
14308 discard SHF_EXCLUDE sections when linking kernel modules
+14319 ld shouldn't warn about SHF_EXCLUDE unknown sections
diff --git a/usr/src/lib/libbe/common/be_utils.c b/usr/src/lib/libbe/common/be_utils.c
index f748ad978f..17d43ee195 100644
--- a/usr/src/lib/libbe/common/be_utils.c
+++ b/usr/src/lib/libbe/common/be_utils.c
@@ -2067,7 +2067,7 @@ be_has_menu_entry(char *be_dataset, char *be_root_pool, int *entry)
{
zfs_handle_t *zhp = NULL;
char menu_file[MAXPATHLEN];
- FILE *menu_fp;
+ FILE *menu_fp = NULL;
char line[BUFSIZ];
char *last;
char *rpool_mntpnt = NULL;
@@ -2139,7 +2139,6 @@ be_has_menu_entry(char *be_dataset, char *be_root_pool, int *entry)
tok = strtok_r(last, BE_WHITE_SPACE, &last);
if (tok != NULL && strcmp(tok,
be_dataset) == 0) {
- (void) fclose(menu_fp);
/*
* The entry number needs to be
* decremented here because the title
diff --git a/usr/src/lib/libnisdb/db_dictionary.cc b/usr/src/lib/libnisdb/db_dictionary.cc
index 74162009af..2eef6d3b6e 100644
--- a/usr/src/lib/libnisdb/db_dictionary.cc
+++ b/usr/src/lib/libnisdb/db_dictionary.cc
@@ -322,7 +322,7 @@ static bool_t
add_to_bucket(db_table_desc_p bucket, db_table_desc **head, db_table_desc_p td)
{
db_table_desc_p curr;
- register char *target_name;
+ char *target_name;
unsigned long target_hval;
target_name = td->table_name;
target_hval = td->hashval;
@@ -488,7 +488,7 @@ enumerate_dictionary(db_dict_desc *dd, db_status (*func) (db_table_desc*))
static db_table_desc *
search_dictionary(db_dict_desc *dd, char *target)
{
- register unsigned long hval;
+ unsigned long hval;
unsigned long bucket;
if (target == NULL || dd == NULL || dd->tables.tables_len == 0)
@@ -514,9 +514,9 @@ search_dictionary(db_dict_desc *dd, char *target)
static db_status
remove_from_dictionary(db_dict_desc *dd, char *target, bool_t remove_storage)
{
- register unsigned long hval;
+ unsigned long hval;
unsigned long bucket;
- register db_table_desc *fst;
+ db_table_desc *fst;
if (target == NULL)
return (DB_NOTUNIQUE);
@@ -544,7 +544,7 @@ remove_from_dictionary(db_dict_desc *dd, char *target, bool_t remove_storage)
*
* Inputs: db_dict_desc_p dd pointer to dictionary to add to.
* db_table_desc *td pointer to table entry to be added. The
- * db_table_desc.next field will be altered
+ * db_table_desc.next field will be altered
* without regard to it's current setting.
* This means that if next points to a list of
* table entries, they may be either linked into
@@ -553,7 +553,7 @@ remove_from_dictionary(db_dict_desc *dd, char *target, bool_t remove_storage)
static db_status
add_to_dictionary(db_dict_desc_p dd, db_table_desc *td)
{
- register unsigned long hval;
+ unsigned long hval;
char *target;
if (dd == NULL)
@@ -692,7 +692,7 @@ db_dictionary::db_clone_bucket(db_table_desc *bucket, db_table_desc **clone)
int
db_dictionary::change_table_name(db_table_desc *clone, char *tok, char *repl)
{
- char *newname;
+ char *newname;
char *loc_end, *loc_beg;
WRITELOCK(this, DB_LOCK_ERROR, "w db_dictionary::change_table_name");
@@ -700,7 +700,7 @@ db_dictionary::change_table_name(db_table_desc *clone, char *tok, char *repl)
/*
* Special case for a tok="". This is used for the
* nisrestore(1M), when restoring a replica in another
- * domain. This routine is used to change the datafile
+ * domain. This routine is used to change the datafile
* names in the data.dict (see bugid #4031273). This will not
* effect massage_dict(), since it never generates an empty
* string for tok.
@@ -843,7 +843,7 @@ db_dictionary::massage_dict(char *newdictname, char *tok, char *repl)
int retval;
u_int i, tbl_count;
db_status status;
- db_table_desc *bucket, *np, *clone, *next_np;
+ db_table_desc *bucket, *np, *clone, *next_np;
char tail[NIS_MAXNAMELEN];
db_dictionary *tmpptr;
@@ -976,7 +976,7 @@ db_dictionary::merge_dict(db_dictionary& tempdict, char *tok, char *repl)
"wu db_dictionary::merge_dict");
return (DB_INTERNAL_ERROR);
}
-
+
dbstat = add_to_dictionary(dictionary, clone);
if (dbstat == DB_NOTUNIQUE) {
/* Overide */
@@ -1294,7 +1294,7 @@ db_dictionary::dump()
unlink(tmpfilename); /* get rid of partial dumps */
pickle_dict_desc f(tmpfilename, PICKLE_WRITE);
- status = f.transfer(&dictionary); /* dump table descs */
+ status = f.transfer(&dictionary); /* dump table descs */
if (status != 0) {
WARNING("db_dictionary::dump: could not write out dictionary");
} else if (rename(tmpfilename, filename) < 0) {
@@ -2393,7 +2393,7 @@ db_dictionary::rollback(char *table) {
syslog(LOG_ERR,
"db_dictionary::rollback: rollback error %d for \"%s\"", ret, table);
}
-
+
WRITEUNLOCK(this, ret, "wu db_dictionary::rollback");
return (ret);
}
diff --git a/usr/src/lib/libnisdb/db_index.cc b/usr/src/lib/libnisdb/db_index.cc
index ccc8da686e..1f2f1e6641 100644
--- a/usr/src/lib/libnisdb/db_index.cc
+++ b/usr/src/lib/libnisdb/db_index.cc
@@ -187,7 +187,7 @@ db_index_entry *
db_index::lookup(item *index_value, long *how_many_found,
db_table *table, bool_t checkTTL)
{
- register unsigned long hval;
+ unsigned long hval;
unsigned long bucket;
db_index_entry *ret;
@@ -225,9 +225,9 @@ db_index::lookup(item *index_value, long *how_many_found,
db_status
db_index::remove(item* index_value, entryp recnum)
{
- register unsigned long hval;
+ unsigned long hval;
unsigned long bucket;
- register db_index_entry *fst;
+ db_index_entry *fst;
db_status ret;
if (index_value == NULL)
@@ -265,7 +265,7 @@ db_index::remove(item* index_value, entryp recnum)
db_status
db_index::add(item* index_value, entryp recnum)
{
- register unsigned long hval;
+ unsigned long hval;
if (index_value == NULL)
return (DB_NOTUNIQUE);
diff --git a/usr/src/lib/libnisdb/db_index_entry_c.c b/usr/src/lib/libnisdb/db_index_entry_c.c
index f1ea9e6921..c8ffe721bc 100644
--- a/usr/src/lib/libnisdb/db_index_entry_c.c
+++ b/usr/src/lib/libnisdb/db_index_entry_c.c
@@ -40,20 +40,18 @@
#include "xdr_nullptr.h"
bool_t
-xdr_db_index_entry(xdrs, objp)
- register XDR *xdrs;
- db_index_entry *objp;
+xdr_db_index_entry(XDR *xdrs, db_index_entry *objp)
{
bool_t more_data;
- register db_index_entry *ep = objp;
- register db_index_entry *loc;
- register db_index_entry *freeptr = NULL;
+ db_index_entry *ep = objp;
+ db_index_entry *loc;
+ db_index_entry *freeptr = NULL;
for (;;) {
if (!xdr_u_long(xdrs, &ep->hashval))
return (FALSE);
if (!xdr_pointer(xdrs, (char **)&ep->key, sizeof (item),
- (xdrproc_t) xdr_item))
+ (xdrproc_t)xdr_item))
return (FALSE);
if (!xdr_entryp(xdrs, &ep->location))
return (FALSE);
@@ -93,7 +91,7 @@ xdr_db_index_entry(xdrs, objp)
case XDR_DECODE:
if (loc == NULL) {
ep->next = loc = (db_index_entry *)
- mem_alloc(sizeof (db_index_entry));
+ mem_alloc(sizeof (db_index_entry));
if (loc == NULL) {
syslog(LOG_ERR,
"xdr_db_index_entry: mem_alloc failed");
@@ -125,13 +123,11 @@ xdr_db_index_entry(xdrs, objp)
bool_t
-xdr_db_index_entry_p(xdrs, objp)
- register XDR *xdrs;
- db_index_entry_p *objp;
+xdr_db_index_entry_p(XDR *xdrs, db_index_entry_p *objp)
{
if (!xdr_pointer(xdrs, (char **)objp, sizeof (db_index_entry),
- (xdrproc_t) xdr_db_index_entry))
+ (xdrproc_t)xdr_db_index_entry))
return (FALSE);
return (TRUE);
}
@@ -139,14 +135,12 @@ xdr_db_index_entry_p(xdrs, objp)
bool_t
-xdr_db_free_entry(xdrs, objp)
- register XDR *xdrs;
- db_free_entry *objp;
+xdr_db_free_entry(XDR *xdrs, db_free_entry *objp)
{
bool_t more_data;
- register db_free_entry *ep = objp;
- register db_free_entry *loc;
- register db_free_entry *freeptr = NULL;
+ db_free_entry *ep = objp;
+ db_free_entry *loc;
+ db_free_entry *freeptr = NULL;
for (;;) {
if (!xdr_entryp(xdrs, &ep->where))
@@ -185,7 +179,7 @@ xdr_db_free_entry(xdrs, objp)
case XDR_DECODE:
if (loc == NULL) {
ep->next = loc = (db_free_entry *)
- mem_alloc(sizeof (db_free_entry));
+ mem_alloc(sizeof (db_free_entry));
if (loc == NULL) {
syslog(LOG_ERR,
"db_free_entry: mem_alloc failed");
diff --git a/usr/src/lib/libnisdb/ldap_map.c b/usr/src/lib/libnisdb/ldap_map.c
index 524a847757..4d2e5c4a0d 100644
--- a/usr/src/lib/libnisdb/ldap_map.c
+++ b/usr/src/lib/libnisdb/ldap_map.c
@@ -1402,7 +1402,7 @@ attrVal(char *msg, char *attrName, char *def, char *attrs) {
return (val);
}
-extern bool_t xdr_nis_object(register XDR *xdrs, nis_object *objp);
+extern bool_t xdr_nis_object(XDR *xdrs, nis_object *objp);
/*
* Copy an XDR:ed version of the NIS+ object 'o' (or the one indicated
diff --git a/usr/src/lib/libzpool/common/kernel.c b/usr/src/lib/libzpool/common/kernel.c
index d26955d83d..19d240d2dc 100644
--- a/usr/src/lib/libzpool/common/kernel.c
+++ b/usr/src/lib/libzpool/common/kernel.c
@@ -686,7 +686,7 @@ crypto_create_ctx_template(crypto_mechanism_t *mech,
}
crypto_mech_type_t
-crypto_mech2id(crypto_mech_name_t name)
+crypto_mech2id(const char *name)
{
return (CRYPTO_MECH_INVALID);
}
diff --git a/usr/src/pkg/manifests/system-test-elftest.p5m b/usr/src/pkg/manifests/system-test-elftest.p5m
index 10f03106d2..490458e6d9 100644
--- a/usr/src/pkg/manifests/system-test-elftest.p5m
+++ b/usr/src/pkg/manifests/system-test-elftest.p5m
@@ -106,6 +106,7 @@ file path=opt/elf-tests/tests/sections/shf-exclude/exclude-so mode=0555
file path=opt/elf-tests/tests/sections/shf-exclude/exclude.s mode=0444
file path=opt/elf-tests/tests/sections/shf-exclude/include-reloc mode=0555
file path=opt/elf-tests/tests/sections/shf-exclude/stub.c mode=0444
+file path=opt/elf-tests/tests/sections/shf-exclude/unknown-os mode=0555
dir path=opt/elf-tests/tests/string-merge
file path=opt/elf-tests/tests/string-merge/simple mode=0555
file path=opt/elf-tests/tests/string-merge/str1.s mode=0444
diff --git a/usr/src/test/elf-tests/runfiles/default.run b/usr/src/test/elf-tests/runfiles/default.run
index 45dde7efd0..6d833f9b53 100644
--- a/usr/src/test/elf-tests/runfiles/default.run
+++ b/usr/src/test/elf-tests/runfiles/default.run
@@ -45,7 +45,7 @@ tests = ['mixed-hidden-comdat']
[/opt/elf-tests/tests/sections/shf-exclude]
arch = i86pc
-tests = ['exclude-kmod', 'exclude-exec', 'exclude-so', 'include-reloc']
+tests = ['exclude-kmod', 'exclude-exec', 'exclude-so', 'include-reloc', 'unknown-os']
[/opt/elf-tests/tests/string-merge/]
tests = ['simple']
diff --git a/usr/src/test/elf-tests/tests/sections/shf-exclude/Makefile b/usr/src/test/elf-tests/tests/sections/shf-exclude/Makefile
index b1d06c8da7..e92f21bd32 100644
--- a/usr/src/test/elf-tests/tests/sections/shf-exclude/Makefile
+++ b/usr/src/test/elf-tests/tests/sections/shf-exclude/Makefile
@@ -17,7 +17,8 @@ include $(SRC)/test/Makefile.com
PROG = exclude-kmod \
exclude-so \
exclude-exec \
- include-reloc
+ include-reloc \
+ unknown-os
DATAFILES = Makefile.test exclude.s stub.c
diff --git a/usr/src/test/elf-tests/tests/sections/shf-exclude/Makefile.test b/usr/src/test/elf-tests/tests/sections/shf-exclude/Makefile.test
index 48515adeea..ed8f00fefb 100644
--- a/usr/src/test/elf-tests/tests/sections/shf-exclude/Makefile.test
+++ b/usr/src/test/elf-tests/tests/sections/shf-exclude/Makefile.test
@@ -11,7 +11,7 @@
# Copyright 2021, Richard Lowe.
-OBJS= exclude.o stub.o
+OBJS= exclude.o unknown-os-exclude.o stub.o
# Allow building out of the test harness easily too
SRCDIR=$(PWD)
@@ -20,6 +20,10 @@ SRCDIR=$(PWD)
all: $(OBJS)
+unknown-os-exclude.o: exclude.o
+ cp exclude.o $@;
+ elfedit -e 'shdr:sh_type .test 0x60000000' $@ # SHT_LOOS
+
%.o: $(SRCDIR)/%.c
gcc -m64 -c $< -o $@
@@ -40,3 +44,6 @@ test.exec: exclude.o stub.o
test.o: exclude.o stub.o
ld -zfatal-warnings -r exclude.o stub.o -o test.o
+
+test.unknown-os: unknown-os-exclude.o stub.o
+ ld -zfatal-warnings -r unknown-os-exclude.o stub.o -o test.unknown-os
diff --git a/usr/src/test/elf-tests/tests/sections/shf-exclude/unknown-os.sh b/usr/src/test/elf-tests/tests/sections/shf-exclude/unknown-os.sh
new file mode 100644
index 0000000000..4e892e0fb3
--- /dev/null
+++ b/usr/src/test/elf-tests/tests/sections/shf-exclude/unknown-os.sh
@@ -0,0 +1,37 @@
+#!/bin/ksh
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2021, Richard Lowe.
+
+TESTDIR=$(dirname $0)
+
+tmpdir=/tmp/test.$$
+mkdir $tmpdir
+cd $tmpdir
+
+cleanup() {
+ cd /
+ rm -fr $tmpdir
+}
+
+trap 'cleanup' EXIT
+
+if [[ $PWD != $tmpdir ]]; then
+ print -u2 "Failed to create temporary directory: $tmpdir"
+ exit 1;
+fi
+
+make -f ${TESTDIR}/Makefile.test SRCDIR=${TESTDIR} test.unknown-os
+if (( $? != 0 )); then
+ print -u2 "FAIL: Failed to link test.unknown-os"
+ exit 1;
+fi
diff --git a/usr/src/ucblib/libdbm/dbm.c b/usr/src/ucblib/libdbm/dbm.c
index 82d136c0a7..664cee81fc 100644
--- a/usr/src/ucblib/libdbm/dbm.c
+++ b/usr/src/ucblib/libdbm/dbm.c
@@ -24,7 +24,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* Portions of this source code were derived from Berkeley 4.3 BSD
@@ -404,7 +404,7 @@ setbit(void)
}
datum
-makdatum(char buf[PBLKSIZ], int n)
+makdatum(char *buf, int n)
{
short *sp;
int t;
diff --git a/usr/src/uts/common/crypto/api/kcf_miscapi.c b/usr/src/uts/common/crypto/api/kcf_miscapi.c
index a8be13a09e..3ba3031e1c 100644
--- a/usr/src/uts/common/crypto/api/kcf_miscapi.c
+++ b/usr/src/uts/common/crypto/api/kcf_miscapi.c
@@ -80,9 +80,9 @@ static kcf_ntfy_elem_t *ntfy_list_tail;
* CRYPTO_MECH_INVALID otherwise.
*/
crypto_mech_type_t
-crypto_mech2id(char *mechname)
+crypto_mech2id(const char *mechname)
{
- return (crypto_mech2id_common(mechname, B_TRUE));
+ return (crypto_mech2id_common((char *)mechname, B_TRUE));
}
/*
diff --git a/usr/src/uts/common/sys/crypto/api.h b/usr/src/uts/common/sys/crypto/api.h
index e2df619bdc..4f27bbafb8 100644
--- a/usr/src/uts/common/sys/crypto/api.h
+++ b/usr/src/uts/common/sys/crypto/api.h
@@ -56,7 +56,7 @@ typedef struct {
*/
#define CRYPTO_MECH_INVALID ((uint64_t)-1)
-extern crypto_mech_type_t crypto_mech2id(crypto_mech_name_t name);
+extern crypto_mech_type_t crypto_mech2id(const char *name);
/*
* Create and destroy context templates.