Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: illumos/illumos-gate
base: adbbcfface
...
head fork: illumos/illumos-gate
compare: 87c723434d
Checking mergeability… Don't worry, you can still create the pull request.
  • 8 commits
  • 10 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jan 10, 2013
@richlowe richlowe 3440 librtld_db demos need warnings gagged
Reviewed by: Gordon Ross <gwr@nexenta.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Garrett D'Amore <garrett@damore.org>
f8a567b
@richlowe richlowe 3441 -zassert-deflib messages are in the wrong place
Reviewed by: Gordon Ross <gwr@nexenta.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Garrett D'Amore <garrett@damore.org>
059c3de
@richlowe richlowe 3442 sgs checks should be run in normal builds
Reviewed by: Gordon Ross <gwr@nexenta.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Garrett D'Amore <garrett@damore.org>
9c5a314
@richlowe richlowe 3453 GNU comdat redirection does exactly the wrong thing
Reviewed by: Jason King <jason.brian.king@gmail.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Garrett D'Amore <garrett@damore.org>
84f7afe
@richlowe richlowe 3439 discarded sections shouldn't end up on output lists
Reviewed by: Gordon Ross <gwr@nexenta.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Garrett D'Amore <garrett@damore.org>
c866e23
@richlowe richlowe 3436 relocatable objects also need sloppy relocation
Reviewed by: Gordon Ross <gwr@nexenta.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Garrett D'Amore <garrett@damore.org>
396f90f
@richlowe richlowe 3450 elfdump crashes on non-Solaris/Linux objects
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Approved by: Garrett D'Amore <garrett@damore.org>
8a8ef76
@richlowe richlowe 3451 archive libraries with no symbols shouldn't require a string table
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Jason King <jason.brian.king@gmail.com>
Approved by: Garrett D'Amore <garrett@damore.org>
87c7234
View
12 usr/src/cmd/Makefile.check
@@ -145,11 +145,9 @@ MANIFEST_SUBDIRS= \
ypcmd/ypupdated \
zonestat/zonestatd
-$(CLOSED_BUILD)MANIFEST_SUBDIRS += \
- $(CLOSED)/cmd/cmd-inet/usr.lib/in.iked
-
-DTEST_SUBDIRS= \
- dtrace/test/tst
+MISC_SUBDIRS= \
+ dtrace/test/tst \
+ sgs
.KEEP_STATE:
@@ -163,13 +161,13 @@ DTEST_SUBDIRS= \
.NO_PARALLEL:
-check: svccfg_check $(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS) $(DTEST_SUBDIRS)
+check: svccfg_check $(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS) $(MISC_SUBDIRS)
svccfg_check:
@$(ECHO) "building requirements for svccfg check ..."; \
(cd $(SRC)/cmd/svc/seed && pwd && $(MAKE) $(MFLAGS) global.db)
-$(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS) $(DTEST_SUBDIRS): FRC
+$(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS) $(MISC_SUBDIRS): FRC
@cd $@; pwd; $(MAKE) check
FRC:
View
2  usr/src/cmd/sgs/Makefile
@@ -136,6 +136,8 @@ $(MSGDIR): $(MSGSUBDIRS) FRC
chkmsg: libconv $(MSGSUBDIRS) FRC
+check: chkmsg
+
# built from lib/Makefile
install_lib: FRC
@ cd lex; pwd; $(MAKE) $@
View
3  usr/src/cmd/sgs/elfdump/common/elfdump.c
@@ -2225,7 +2225,6 @@ versions(Cache *cache, Word shnum, const char *file, uint_t flags,
/* Gather information about the version sections */
- bzero(versym, sizeof (*versym));
versym->max_verndx = 1;
for (cnt = 1; cnt < shnum; cnt++) {
Cache *_cache = &cache[cnt];
@@ -4739,7 +4738,7 @@ regular(const char *file, int fd, Elf *elf, uint_t flags,
size_t ndx, shstrndx, shnum, phnum;
Shdr *shdr;
Cache *cache;
- VERSYM_STATE versym;
+ VERSYM_STATE versym = { 0 };
int ret = 0;
int addr_align;
View
33 usr/src/cmd/sgs/libelf/common/getarsym.c
@@ -105,36 +105,43 @@ arsym(Byte *off, size_t sz, size_t *e, int is64)
if (is64) {
if (sz < 8 || (sz - 8) / 8 < (n = get8(off))) {
_elf_seterr(EFMT_ARSYMSZ, 0);
- return (0);
+ return (NULL);
}
} else {
if (sz < 4 || (sz - 4) / 4 < (n = get4(off))) {
_elf_seterr(EFMT_ARSYMSZ, 0);
- return (0);
+ return (NULL);
}
}
off += eltsize;
endoff = off + n * eltsize;
/*
- * string table must be present, null terminated
+ * If there are symbols in the symbol table, a
+ * string table must be present and NULL terminated.
+ *
+ * The format dictates that the string table must always be
+ * present, however in the case of an archive containing no
+ * symbols GNU ar will not create one. We are permissive for
+ * the sake of compatibility.
*/
-
- if (((str = (char *)endoff) >= endstr) ||
- (*(endstr - 1) != '\0')) {
+ if ((n > 0) && (((str = (char *)endoff) >= endstr) ||
+ (*(endstr - 1) != '\0'))) {
_elf_seterr(EFMT_ARSYM, 0);
- return (0);
+ return (NULL);
}
/*
+ * There is always at least one entry returned if a symtab
+ * exists since the table's last entry is an artificial one
+ * with a NULL as_name, but is included in the count.
+ *
* overflow can occur here, but not likely
*/
-
*e = n + 1;
- n = sizeof (Elf_Arsym) * (n + 1);
- if ((oas = malloc(n)) == 0) {
+ if ((oas = calloc(n + 1, sizeof (Elf_Arsym))) == NULL) {
_elf_seterr(EMEM_ARSYM, errno);
- return (0);
+ return (NULL);
}
}
{
@@ -144,7 +151,7 @@ arsym(Byte *off, size_t sz, size_t *e, int is64)
if (str >= endstr) {
_elf_seterr(EFMT_ARSYMSTR, 0);
free(oas);
- return (0);
+ return (NULL);
}
if (is64)
as->as_off = get8(off);
@@ -158,7 +165,7 @@ arsym(Byte *off, size_t sz, size_t *e, int is64)
/* LINTED */
;
}
- as->as_name = 0;
+ as->as_name = NULL;
as->as_off = 0;
as->as_hash = ~(unsigned long)0L;
}
View
10 usr/src/cmd/sgs/libld/common/libld.msg
@@ -1263,6 +1263,11 @@
@ MSG_DBG_AOUT_FMT "debug: a.out: "
@ MSG_DBG_NAME_FMT "debug: %s: "
+# -z assert-deflib strings
+
+@ MSG_ARG_ASSDEFLIB_MALFORMED "library name malformed: %s"
+@ MSG_ARG_ASSDEFLIB_FOUND "dynamic library found on default search path \
+ (%s): lib%s.so"
@ _END_
@@ -1469,11 +1474,6 @@
@ MSG_ARG_GUIDE_NO_TEXT "notext"
@ MSG_ARG_GUIDE_NO_UNUSED "nounused"
-# -z assert-deflib strings
-@ MSG_ARG_ASSDEFLIB_MALFORMED "library name malformed: %s"
-@ MSG_ARG_ASSDEFLIB_FOUND "dynamic library found on default search path \
- (%s): lib%s.so"
-
# Environment variable strings
@ MSG_LD_RUN_PATH "LD_RUN_PATH"
View
37 usr/src/cmd/sgs/libld/common/place.c
@@ -325,7 +325,7 @@ gnu_comdat_sym(Ifl_desc *ifl, Is_desc *gisp)
* link-edits. For now, size the section name dynamically.
*/
ssize = strlen(isp->is_name);
- if ((strncmp(isp->is_name, gisp->is_name, ssize) != 0) &&
+ if ((strncmp(isp->is_name, gisp->is_name, ssize) == 0) &&
(gisp->is_name[ssize] == '.'))
return ((char *)&gisp->is_name[ssize]);
}
@@ -851,6 +851,13 @@ ld_place_section(Ofl_desc *ofl, Is_desc *isp, Place_path_info *path_info,
}
/*
+ * When building relocatable objects, we must not redirect COMDAT
+ * section names into their outputs, such that our output object may
+ * be successfully used as an input object also requiring COMDAT
+ * processing
+ */
+
+ /*
* GNU section names may follow the convention:
*
* .gnu.linkonce.*
@@ -863,13 +870,15 @@ ld_place_section(Ofl_desc *ofl, Is_desc *isp, Place_path_info *path_info,
* because we know the name is not NULL, and therefore must have
* at least one character plus a NULL termination.
*/
- if (((ofl->ofl_flags & FLG_OF_RELOBJ) == 0) &&
- (isp->is_name == oname) && (isp->is_name[1] == 'g') &&
+ if ((isp->is_name == oname) && (isp->is_name[1] == 'g') &&
(strncmp(MSG_ORIG(MSG_SCN_GNU_LINKONCE), isp->is_name,
MSG_SCN_GNU_LINKONCE_SIZE) == 0)) {
- if ((oname =
- (char *)gnu_linkonce_sec(isp->is_name)) != isp->is_name) {
- DBG_CALL(Dbg_sec_redirected(ofl->ofl_lml, isp, oname));
+ if ((ofl->ofl_flags & FLG_OF_RELOBJ) == 0) {
+ if ((oname = (char *)gnu_linkonce_sec(isp->is_name)) !=
+ isp->is_name) {
+ DBG_CALL(Dbg_sec_redirected(ofl->ofl_lml, isp,
+ oname));
+ }
}
/*
@@ -894,16 +903,17 @@ ld_place_section(Ofl_desc *ofl, Is_desc *isp, Place_path_info *path_info,
* sections, and this identification can be triggered by a pattern
* match section names.
*/
- if (((ofl->ofl_flags & FLG_OF_RELOBJ) == 0) &&
- (isp->is_name == oname) && (isp->is_flags & FLG_IS_COMDAT) &&
+ if ((isp->is_name == oname) && (isp->is_flags & FLG_IS_COMDAT) &&
((sname = gnu_comdat_sym(ifl, isp)) != NULL)) {
size_t size = sname - isp->is_name;
- if ((oname = libld_malloc(size + 1)) == NULL)
- return ((Os_desc *)S_ERROR);
- (void) strncpy(oname, isp->is_name, size);
- oname[size] = '\0';
- DBG_CALL(Dbg_sec_redirected(ofl->ofl_lml, isp, oname));
+ if ((ofl->ofl_flags & FLG_OF_RELOBJ) == 0) {
+ if ((oname = libld_malloc(size + 1)) == NULL)
+ return ((Os_desc *)S_ERROR);
+ (void) strncpy(oname, isp->is_name, size);
+ oname[size] = '\0';
+ DBG_CALL(Dbg_sec_redirected(ofl->ofl_lml, isp, oname));
+ }
/*
* Enable relaxed relocation processing, as this is
@@ -1199,6 +1209,7 @@ ld_place_section(Ofl_desc *ofl, Is_desc *isp, Place_path_info *path_info,
* so that they can be updated as a group later.
*/
if ((shdr->sh_type == SHT_GROUP) &&
+ ((isp->is_flags & FLG_IS_DISCARD) == 0) &&
(aplist_append(&ofl->ofl_osgroups, osp,
AL_CNT_OFL_OSGROUPS) == NULL))
return ((Os_desc *)S_ERROR);
View
4 usr/src/cmd/sgs/librtld_db/demo/Makefile.com
@@ -66,6 +66,10 @@ LINTERRS = -erroff=E_NAME_DEF_NOT_USED2 \
LINTFLAGS += $(LDLIBS) -L../../$(MACH) $(LINTERRS)
LINTFLAGS64 += $(LDLIBS) -L../../$(MACH) $(LINTERRS)
CLEANFILES += $(LINTOUT)
+
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-variable
# DEMO DELETE END
test-sparc= test-sparc-regs
View
2  usr/src/cmd/sgs/librtld_db/demo/common/dis.c
@@ -79,7 +79,7 @@ print_address_ps(struct ps_prochandle *ph, ulong_t address, unsigned flags)
/*
* Embed SOName in symbol name
*/
- if (mip = addr_to_map(ph, address)) {
+ if ((mip = addr_to_map(ph, address)) != 0) {
(void) strcpy(buf, mip->mi_name);
(void) strcat(buf, ":");
} else
View
4 usr/src/cmd/sgs/packages/common/SUNWonld-README
@@ -1640,3 +1640,7 @@ Bugid Risk Synopsis
3260 linker is insufficiently careful with strtok
3261 linker should ignore unknown hardware capabilities
3265 link-editor builds bogus .eh_frame_hdr on ia32
+3453 GNU comdat redirection does exactly the wrong thing
+3439 discarded sections shouldn't end up on output lists
+3436 relocatable objects also need sloppy relocation
+3451 archive libraries with no symbols shouldn't require a string table
View
3  usr/src/cmd/sgs/rtld/common/rtld.msg
@@ -273,6 +273,8 @@
@ MSG_USD_RUNPATH " unused search path=%s (RUNPATH/RPATH from \
file %s)\n"
+@ MSG_CAP_IGN_UNKCAP "ignoring unknown capability: %s"
+
@ _END_
# The following strings represent reserved words, files, pathnames and symbols.
@@ -300,7 +302,6 @@
@ MSG_STR_ONE "1"
@ MSG_CAP_DELIMIT ","
-@ MSG_CAP_IGN_UNKCAP "ignoring unknown capability: %s"
@ MSG_SUNW_OST_SGS "SUNW_OST_SGS"
@ MSG_SUNW_OST_OSLIB "SUNW_OST_OSLIB"

No commit comments for this range

Something went wrong with that request. Please try again.