summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorab196087 <none@none>2008-05-07 14:28:09 -0700
committerab196087 <none@none>2008-05-07 14:28:09 -0700
commit5b764efa67662f6a18a3eea7053aab98a9fbfebf (patch)
treee64d64225ff852047d92f09e004995b71c121cba
parent1d367f3f65205953b8a40535c837d8b620c40317 (diff)
downloadillumos-joyent-5b764efa67662f6a18a3eea7053aab98a9fbfebf.tar.gz
6516212 usr/src/cmd/sgs/libelf warlock targets should be fixed or abandoned
-rw-r--r--usr/src/cmd/sgs/libelf/Makefile.targ50
-rw-r--r--usr/src/cmd/sgs/libelf/common/libelf.wlcmd39
-rw-r--r--usr/src/cmd/sgs/libelf/common/update.c32
-rw-r--r--usr/src/cmd/sgs/packages/common/SUNWonld-README1
4 files changed, 89 insertions, 33 deletions
diff --git a/usr/src/cmd/sgs/libelf/Makefile.targ b/usr/src/cmd/sgs/libelf/Makefile.targ
index c816e490ec..e5d688a517 100644
--- a/usr/src/cmd/sgs/libelf/Makefile.targ
+++ b/usr/src/cmd/sgs/libelf/Makefile.targ
@@ -19,7 +19,7 @@
# CDDL HEADER END
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
@@ -95,30 +95,42 @@ objs/xlate.o \
pics/xlate.o: xlate.c
#
-# Targets needed to support running of Warlock, warlock can be
+# Targets needed to support running of Warlock. The old warlock can be
# located at:
# suntools.eng:/export/tools/internal/warlock
#
# to use add the following to your path:
# export PATH=/net/suntools.eng/export/tools/internal/warlock/bin:$PATH
#
-.PARALLEL: $(WARLOCKFILES)
-warlock: wlocks .WAIT warlock_files
- warlock -c ../common/libelf.wlcmd $(WARLOCKFILES)
-
-warlock_files: $(BLTSRCS) .WAIT $(WARLOCKFILES)
-
-wlocks:
- -@mkdir -p $@
-
-wlocks/%.ll: %.c
- wlcc $(CFLAGS) $(CPPFLAGS) -o $@ $<
-
-wlocks/%.ll: ../misc/%.c
- wlcc $(CFLAGS) $(CPPFLAGS) -o $@ $<
-
-wlocks/%.ll: ../common/%.c
- wlcc $(CFLAGS) $(CPPFLAGS) -o $@ $<
+# The newer warlock is at:
+# export PATH=/ws/onnv-gate/public/warlock/$MACH:$PATH
+#
+# This target has value for manual debugging, but is not suitable
+# for production use. For this reason, the necessary rules are commented
+# out with '###'. Remove the comments to use it.
+#
+###warlock := CFLAGS=
+###
+###.PARALLEL: $(WARLOCKFILES)
+###warlock: wlocks .WAIT warlock_files
+### warlock -c ../common/libelf.wlcmd $(WARLOCKFILES)
+###
+###warlock_files: $(BLTSRCS) .WAIT $(WARLOCKFILES)
+###
+###wlocks:
+### -@mkdir -p $@
+###
+###wlocks/%.ll: %.c
+### wlcc $(CFLAGS) $(CPPFLAGS) -o $@ $<
+###
+###wlocks/%.ll: ../misc/%.c
+### wlcc $(CFLAGS) $(CPPFLAGS) -o $@ $<
+###
+###wlocks/%.ll: ../common/%.c
+### wlcc $(CFLAGS) $(CPPFLAGS) -o $@ $<
+###
+###wlocks/%64.ll: ../common/%.c
+### wlcc -D_ELF64 $(CFLAGS) $(CPPFLAGS) -o $@ $<
# Special target for native builds (ie. when we need to build a version of ld
diff --git a/usr/src/cmd/sgs/libelf/common/libelf.wlcmd b/usr/src/cmd/sgs/libelf/common/libelf.wlcmd
index 3e411bd41a..5c9c0eb1ce 100644
--- a/usr/src/cmd/sgs/libelf/common/libelf.wlcmd
+++ b/usr/src/cmd/sgs/libelf/common/libelf.wlcmd
@@ -1,14 +1,13 @@
#ident "%Z%%M% %I% %E% SMI"
#
-# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
@@ -66,4 +65,34 @@ root _elf_version
root nlist
#root _elf_errmsg_r
root demangle
-add xlate.c:xlate/f target `funcs | egrep '_to(m|f)$'` byte_to
+add xlate.c:xlate/f target `funcs | egrep '_to(m|f)$'` xlate.c:byte_to
+add xlate64.c:xlate/f target `funcs | egrep '_to(m|f)$'` xlate64.c:byte_to
+#
+root _elf_getxoff
+root _elf_swap_wrimage
+root _gelf_getdyndtflags_1
+root elf_getshnum
+root elf_getshstrndx
+root gelf_checksum
+root gelf_fsize
+root gelf_getcap
+root gelf_getmove
+root gelf_getphdr
+root gelf_getrel
+root gelf_getrela
+root gelf_getsyminfo
+root gelf_getsymshndx
+root gelf_newehdr
+root gelf_newphdr
+root gelf_update_cap
+root gelf_update_dyn
+root gelf_update_ehdr
+root gelf_update_move
+root gelf_update_phdr
+root gelf_update_rel
+root gelf_update_rela
+root gelf_update_shdr
+root gelf_update_syminfo
+root gelf_update_symshndx
+root gelf_xlatetof
+root gelf_xlatetom
diff --git a/usr/src/cmd/sgs/libelf/common/update.c b/usr/src/cmd/sgs/libelf/common/update.c
index aa80db57f1..d9390de4ab 100644
--- a/usr/src/cmd/sgs/libelf/common/update.c
+++ b/usr/src/cmd/sgs/libelf/common/update.c
@@ -835,26 +835,33 @@ _elfxx_update(Elf * elf, Elf_Cmd cmd)
* target host.
*/
int
-_elfxx_swap_wrimage(Elf * elf)
+_elfxx_swap_wrimage(Elf *elf)
{
- NOTE(ASSUMING_PROTECTED(*elf))
Elf_Data dst, src;
Elf_Scn *s;
- Ehdr *eh = elf->ed_ehdr;
- Half e_phnum = eh->e_phnum;
- unsigned ver = eh->e_version;
- unsigned encode = eh->e_ident[EI_DATA];
+ Ehdr *eh;
+ Half e_phnum;
+ unsigned ver;
+ unsigned encode;
/*
* Ehdr first
*/
+ ELFWLOCK(elf);
+ eh = elf->ed_ehdr;
+ e_phnum = eh->e_phnum;
+ ver = eh->e_version;
+ encode = eh->e_ident[EI_DATA];
+
src.d_buf = dst.d_buf = (Elf_Void *)eh;
src.d_type = dst.d_type = ELF_T_EHDR;
src.d_size = dst.d_size = sizeof (Ehdr);
src.d_version = dst.d_version = ver;
- if (elf_xlatetof(&dst, &src, encode) == 0)
+ if (elf_xlatetof(&dst, &src, encode) == 0) {
+ ELFUNLOCK(elf);
return (1);
+ }
/*
* Phdr table if one exists
@@ -873,6 +880,7 @@ _elfxx_swap_wrimage(Elf * elf)
ELFACCESSDATA(work, _elf_work)
src.d_version = dst.d_version = work;
if (elf_xlatetof(&dst, &src, encode) == 0) {
+ ELFUNLOCK(elf);
return (1);
}
}
@@ -896,14 +904,17 @@ _elfxx_swap_wrimage(Elf * elf)
if (_elf_locked_getdata(s, &prevd->db_data) !=
&d->db_data) {
SCNUNLOCK(s);
+ ELFUNLOCK(elf);
return (1);
}
SCNUNLOCK(s);
}
dst = d->db_data;
- if (elf_xlatetof(&dst, &d->db_data, encode) == 0)
+ if (elf_xlatetof(&dst, &d->db_data, encode) == 0) {
+ ELFUNLOCK(elf);
return (1);
+ }
}
}
@@ -916,10 +927,13 @@ _elfxx_swap_wrimage(Elf * elf)
for (s = elf->ed_hdscn; s != 0; s = s->s_next) {
src.d_buf = dst.d_buf = s->s_shdr;
src.d_size = dst.d_size = sizeof (Shdr);
- if (elf_xlatetof(&dst, &src, encode) == 0)
+ if (elf_xlatetof(&dst, &src, encode) == 0) {
+ ELFUNLOCK(elf);
return (1);
+ }
}
+ ELFUNLOCK(elf);
return (0);
}
diff --git a/usr/src/cmd/sgs/packages/common/SUNWonld-README b/usr/src/cmd/sgs/packages/common/SUNWonld-README
index e7ed83b421..3b5ae0e1f2 100644
--- a/usr/src/cmd/sgs/packages/common/SUNWonld-README
+++ b/usr/src/cmd/sgs/packages/common/SUNWonld-README
@@ -1338,3 +1338,4 @@ Bugid Risk Synopsis
6685125 ld/elfdump do not handle ZERO terminator .eh_frame amd64 unwind entry
6686889 ld.so.1 regression - bad pointer created with 6509323 integration
6695681 ldd(1) crashes when run from a chrooted environment
+6516212 usr/src/cmd/sgs/libelf warlock targets should be fixed or abandoned