提交 035a5fb2 编写于 作者: L lana

Merge

......@@ -30,6 +30,22 @@ PRODUCT = oracle
#SUBDIRS_MAKEFLAGS += JAVAC_LINT_OPTIONS=-Xlint:all,-deprecation,-path
include $(BUILDDIR)/common/Defs.gmk
JFR_SRCDIRS_EXIST := $(shell \
if [ -d $(CLOSED_SHARE_SRC)/native/oracle/jfr ] ; then \
echo true; \
else \
echo false; \
fi)
JFR =
ifndef OPENJDK
ifndef JAVASE_EMBEDDED
ifeq ($(JFR_SRCDIRS_EXIST), true)
JFR = jfr
endif
endif
endif
# build com/oracle/security/ucrypto on Solaris platform for non-OpenJDK builds
UCRYPTO =
ifndef OPENJDK
......@@ -38,13 +54,6 @@ ifndef OPENJDK
endif
endif
JFR =
ifndef OPENJDK
ifndef JAVASE_EMBEDDED
JFR = jfr
endif
endif
SUBDIRS = $(JFR) net nio util $(UCRYPTO)
include $(BUILDDIR)/common/Subdirs.gmk
......
......@@ -99,6 +99,9 @@ CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required!
# variable names because the incoming option value can be overridden
# in some situations, e.g., a VARIANT != OPT build.
ADD_GNU_DEBUGLINK = $(ABS_BUILDTOOLBINDIR)/add_gnu_debuglink
FIX_EMPTY_SEC_HDR_FLAGS = $(ABS_BUILDTOOLBINDIR)/fix_empty_sec_hdr_flags
ifeq ($(VARIANT), OPT)
FULL_DEBUG_SYMBOLS ?= 1
ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
......@@ -113,26 +116,11 @@ _JUNK_ := $(shell \
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
# Default OBJCOPY comes from the SUNWbinutils package:
DEF_OBJCOPY=/usr/sfw/bin/gobjcopy
ifeq ($(PLATFORM)-$(LIBARCH), solaris-amd64)
# On Solaris AMD64/X64, gobjcopy is not happy and fails:
#
# usr/sfw/bin/gobjcopy --add-gnu-debuglink=<lib>.debuginfo <lib>.so
# BFD: stKPaiop: Not enough room for program headers, try linking with -N
# /usr/sfw/bin/gobjcopy: stKPaiop: Bad value
# BFD: stKPaiop: Not enough room for program headers, try linking with -N
# /usr/sfw/bin/gobjcopy: libsaproc.debuginfo: Bad value
# BFD: stKPaiop: Not enough room for program headers, try linking with -N
# /usr/sfw/bin/gobjcopy: stKPaiop: Bad value
_JUNK_ := $(shell \
echo >&2 "INFO: $(DEF_OBJCOPY) is not working on Solaris AMD64/X64")
OBJCOPY=
else
OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
ifneq ($(ALT_OBJCOPY),)
_JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
# disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path
OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
endif
OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
ifneq ($(ALT_OBJCOPY),)
_JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
# disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path
OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
endif
# Setting ENABLE_FULL_DEBUG_SYMBOLS=1 (and OBJCOPY) above enables the
......@@ -243,18 +231,21 @@ endif
# optimization flags as used by FASTDEBUG. We also want all the
# debug info in one place (-xs).
#
CFLAGS_COMMON=
CXXFLAGS_COMMON=
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS),1)
ifeq ($(VARIANT), OPT)
CC_OPT = -g -xs $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
CXX_OPT = -g0 -xs $(CXX_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
OPTIMIZATION_LEVEL = $(FASTDEBUG_OPTIMIZATION_LEVEL)
CFLAGS_COMMON += -g -xs
CXXFLAGS_COMMON += -g0 -xs
endif
CFLAGS_DEBUG_OPTION += -xs
CXXFLAGS_DEBUG_OPTION += -xs
endif
endif
CFLAGS_COMMON = -L$(OBJDIR)
CFLAGS_COMMON += -L$(OBJDIR)
# Do not allow C99 language features like declarations in code etc.
CFLAGS_COMMON += -xc99=%none
......
#
# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -297,6 +297,7 @@ BUILDTOOLJARDIR = $(OUTPUTDIR)/btjars
ABS_BUILDTOOLJARDIR = $(ABS_OUTPUTDIR)/btjars
# for generated tool class files
BUILDTOOLBINDIR = $(OUTPUTDIR)/btbins
ABS_BUILDTOOLBINDIR = $(ABS_OUTPUTDIR)/btbins
# for generated java source files
GENSRCDIR = $(OUTPUTDIR)/gensrc
# for generated C source files (not javah)
......
......@@ -245,6 +245,12 @@ ifneq ($(PLATFORM), macosx)
ARFLAGS = -r
endif
ifeq ($(PLATFORM), solaris)
ifeq ($(LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS),1)
$(ACTUAL_LIBRARY):: $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS)
endif
endif
$(ACTUAL_LIBRARY):: $(COMPILE_FILES_o) $(FILES_m) $(FILES_reorder)
@$(prep-target)
@$(ECHO) "STATS: LIBRARY=$(LIBRARY), PRODUCT=$(PRODUCT), OPTIMIZATION_LEVEL=$(OPTIMIZATION_LEVEL)"
......@@ -260,11 +266,29 @@ endif # WRITE_LIBVERSION
ifneq ($(PLATFORM), macosx)
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS),1)
ifeq ($(PLATFORM), solaris)
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
# Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
# empty section headers until a fixed $(OBJCOPY) is available.
# An empty section header has sh_addr == 0 and sh_size == 0.
# This problem has only been seen on Solaris X64, but we call this tool
# on all Solaris builds just in case.
#
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
(set -e ; \
$(CD) $(@D) ; \
$(FIX_EMPTY_SEC_HDR_FLAGS) $(@F) ; \
$(OBJCOPY) --only-keep-debug $(@F) $(LIB_PREFIX)$(LIBRARY).debuginfo ; \
$(ADD_GNU_DEBUGLINK) $(LIB_PREFIX)$(LIBRARY).debuginfo $(@F) ; \
)
else # PLATFORM != solaris
(set -e ; \
$(CD) $(@D) ; \
$(OBJCOPY) --only-keep-debug $(@F) $(LIBRARY).debuginfo ; \
$(OBJCOPY) --add-gnu-debuglink=$(LIBRARY).debuginfo $(@F) ; \
$(OBJCOPY) --only-keep-debug $(@F) $(LIB_PREFIX)$(LIBRARY).debuginfo ; \
$(OBJCOPY) --add-gnu-debuglink=$(LIB_PREFIX)$(LIBRARY).debuginfo $(@F) ; \
)
endif # PLATFORM == solaris
ifeq ($(STRIP_POLICY),all_strip)
$(STRIP) $@
else
......@@ -281,8 +305,8 @@ endif # WRITE_LIBVERSION
ifeq ($(ZIP_DEBUGINFO_FILES),1)
(set -e ; \
$(CD) $(@D) ; \
$(ZIPEXE) -q $(LIBRARY).diz $(LIBRARY).debuginfo ; \
$(RM) $(LIBRARY).debuginfo ; \
$(ZIPEXE) -q $(LIB_PREFIX)$(LIBRARY).diz $(LIB_PREFIX)$(LIBRARY).debuginfo ; \
$(RM) $(LIB_PREFIX)$(LIBRARY).debuginfo ; \
)
endif
endif # LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS
......
......@@ -230,6 +230,13 @@ else
#
# This rule only applies on unix. It supports quantify and its ilk.
#
ifeq ($(PLATFORM), solaris)
ifeq ($(PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS),1)
$(ACTUAL_PROGRAM):: $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS)
endif
endif
$(ACTUAL_PROGRAM):: $(FILES_o)
@$(prep-target)
@set -- $?; \
......@@ -244,11 +251,29 @@ else
ifneq ($(PLATFORM), macosx)
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS),1)
ifeq ($(PLATFORM), solaris)
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
# Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
# empty section headers until a fixed $(OBJCOPY) is available.
# An empty section header has sh_addr == 0 and sh_size == 0.
# This problem has only been seen on Solaris X64, but we call this tool
# on all Solaris builds just in case.
#
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
(set -e ; \
$(CD) $(@D) ; \
$(FIX_EMPTY_SEC_HDR_FLAGS) $(@F) ; \
$(OBJCOPY) --only-keep-debug $(@F) $(@F).debuginfo ; \
$(ADD_GNU_DEBUGLINK) $(@F).debuginfo $(@F) ; \
)
else # PLATFORM != solaris
(set -e ; \
$(CD) $(@D) ; \
$(OBJCOPY) --only-keep-debug $(@F) $(@F).debuginfo ; \
$(OBJCOPY) --add-gnu-debuglink=$(@F).debuginfo $(@F) ; \
)
endif # PLATFORM == solaris
ifeq ($(STRIP_POLICY),all_strip)
$(STRIP) $@
else
......
......@@ -69,7 +69,6 @@ FILES_c = \
jdk_util_md.c \
check_version.c \
java_props_md.c \
DriverManager.c \
ConstantPool.c \
MessageUtils.c \
GC.c \
......
......@@ -482,6 +482,7 @@ JAVA_JAVA_java = \
sun/misc/JavaNioAccess.java \
sun/misc/Perf.java \
sun/misc/PerfCounter.java \
sun/misc/Hashing.java \
sun/net/www/protocol/jar/Handler.java \
sun/net/www/protocol/jar/JarURLConnection.java \
sun/net/www/protocol/file/Handler.java \
......
......@@ -232,7 +232,6 @@ SUNWprivate_1.1 {
Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2;
Java_java_security_AccessController_getStackAccessControlContext;
Java_java_security_AccessController_getInheritedAccessControlContext;
Java_java_sql_DriverManager_getCallerClassLoader;
Java_java_util_ResourceBundle_getClassContext;
Java_java_util_TimeZone_getSystemTimeZoneID;
Java_java_util_TimeZone_getSystemGMTOffsetID;
......
......@@ -55,6 +55,9 @@ FILES_java += \
sun/nio/ch/DevPollArrayWrapper.java \
sun/nio/ch/DevPollSelectorImpl.java \
sun/nio/ch/DevPollSelectorProvider.java \
sun/nio/ch/EventPortSelectorImpl.java \
sun/nio/ch/EventPortSelectorProvider.java \
sun/nio/ch/EventPortWrapper.java \
sun/nio/ch/InheritedChannel.java \
sun/nio/ch/PollSelectorProvider.java \
sun/nio/ch/PollSelectorImpl.java \
......
......@@ -39,7 +39,6 @@ SUNWprivate_1.1 {
Java_sun_nio_ch_EPollArrayWrapper_epollCreate;
Java_sun_nio_ch_EPollArrayWrapper_epollCtl;
Java_sun_nio_ch_EPollArrayWrapper_epollWait;
Java_sun_nio_ch_EPollArrayWrapper_fdLimit;
Java_sun_nio_ch_EPollArrayWrapper_init;
Java_sun_nio_ch_EPollArrayWrapper_interrupt;
Java_sun_nio_ch_EPollArrayWrapper_offsetofData;
......@@ -87,6 +86,7 @@ SUNWprivate_1.1 {
Java_sun_nio_ch_IOUtil_configureBlocking;
Java_sun_nio_ch_IOUtil_drain;
Java_sun_nio_ch_IOUtil_fdVal;
Java_sun_nio_ch_IOUtil_fdLimit;
Java_sun_nio_ch_IOUtil_initIDs;
Java_sun_nio_ch_IOUtil_makePipe;
Java_sun_nio_ch_IOUtil_randomBytes;
......
......@@ -36,7 +36,6 @@ SUNWprivate_1.1 {
Java_sun_nio_ch_DatagramDispatcher_readv0;
Java_sun_nio_ch_DatagramDispatcher_write0;
Java_sun_nio_ch_DatagramDispatcher_writev0;
Java_sun_nio_ch_DevPollArrayWrapper_fdLimit;
Java_sun_nio_ch_DevPollArrayWrapper_init;
Java_sun_nio_ch_DevPollArrayWrapper_interrupt;
Java_sun_nio_ch_DevPollArrayWrapper_poll0;
......@@ -74,6 +73,7 @@ SUNWprivate_1.1 {
Java_sun_nio_ch_InheritedChannel_soType0;
Java_sun_nio_ch_IOUtil_configureBlocking;
Java_sun_nio_ch_IOUtil_drain;
Java_sun_nio_ch_IOUtil_fdLimit;
Java_sun_nio_ch_IOUtil_fdVal;
Java_sun_nio_ch_IOUtil_initIDs;
Java_sun_nio_ch_IOUtil_makePipe;
......@@ -112,13 +112,13 @@ SUNWprivate_1.1 {
Java_sun_nio_ch_UnixAsynchronousServerSocketChannelImpl_accept0;
Java_sun_nio_ch_UnixAsynchronousServerSocketChannelImpl_initIDs;
Java_sun_nio_ch_UnixAsynchronousSocketChannelImpl_checkConnect;
Java_sun_nio_ch_SolarisEventPort_init;
Java_sun_nio_ch_SolarisEventPort_portCreate;
Java_sun_nio_ch_SolarisEventPort_portClose;
Java_sun_nio_ch_SolarisEventPort_portAssociate;
Java_sun_nio_ch_SolarisEventPort_portGet;
Java_sun_nio_ch_SolarisEventPort_portGetn;
Java_sun_nio_ch_SolarisEventPort_portSend;
Java_sun_nio_ch_SolarisEventPort_port_1create;
Java_sun_nio_ch_SolarisEventPort_port_1close;
Java_sun_nio_ch_SolarisEventPort_port_1associate;
Java_sun_nio_ch_SolarisEventPort_port_1dissociate;
Java_sun_nio_ch_SolarisEventPort_port_1get;
Java_sun_nio_ch_SolarisEventPort_port_1getn;
Java_sun_nio_ch_SolarisEventPort_port_1send;
Java_sun_nio_fs_GnomeFileTypeDetector_initializeGio;
Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGio;
Java_sun_nio_fs_GnomeFileTypeDetector_initializeGnomeVfs;
......
......@@ -89,6 +89,7 @@ jprt.make.rule.core.test.targets= \
${jprt.my.test.target.set:TESTNAME=jdk_text}, \
${jprt.my.test.target.set:TESTNAME=jdk_tools1}, \
${jprt.my.test.target.set:TESTNAME=jdk_tools2}, \
${jprt.my.test.target.set:TESTNAME=jdk_jfr}, \
${jprt.my.test.target.set:TESTNAME=jdk_misc}
# All vm test targets (testset=all)
......
......@@ -50,6 +50,7 @@
<fileset dir="${classes.dir}">
<include name="sun/tools/jconsole/**/*.class"/>
<include name="com/sun/tools/jconsole/**/*.class"/>
<include name="sun/tools/jconsole/resources/*.properties"/>
<include name="sun/tools/jconsole/resources/*.gif"/>
<include name="sun/tools/jconsole/resources/*.png"/>
</fileset>
......
......@@ -30,17 +30,22 @@
MANIFEST = sun/tools/jconsole/manifest
PNG_FILES = \
sun/tools/jconsole/resources/brandlogo.png \
sun/tools/jconsole/resources/collapse-winlf.png \
sun/tools/jconsole/resources/connected16.png \
sun/tools/jconsole/resources/connected24.png \
sun/tools/jconsole/resources/disconnected16.png \
sun/tools/jconsole/resources/disconnected24.png \
sun/tools/jconsole/resources/expand-winlf.png \
sun/tools/jconsole/resources/masthead-left.png \
sun/tools/jconsole/resources/masthead-right.png
sun/tools/jconsole/resources/brandlogo.png \
sun/tools/jconsole/resources/collapse-winlf.png \
sun/tools/jconsole/resources/connected16.png \
sun/tools/jconsole/resources/connected24.png \
sun/tools/jconsole/resources/disconnected16.png \
sun/tools/jconsole/resources/disconnected24.png \
sun/tools/jconsole/resources/expand-winlf.png \
sun/tools/jconsole/resources/masthead-left.png \
sun/tools/jconsole/resources/masthead-right.png
GIF_FILES = \
sun/tools/jconsole/resources/mbean.gif \
sun/tools/jconsole/resources/mbeanserverdelegate.gif \
sun/tools/jconsole/resources/xobject.gif
sun/tools/jconsole/resources/mbean.gif \
sun/tools/jconsole/resources/mbeanserverdelegate.gif \
sun/tools/jconsole/resources/xobject.gif
PROP_FILES = \
sun/tools/jconsole/resources/messages.properties \
sun/tools/jconsole/resources/messages_ja.properties \
sun/tools/jconsole/resources/messages_zh_CN.properties
......@@ -53,21 +53,21 @@ AUTO_FILES_JAVA_DIRS = sun/tools/jconsole \
FILES_png = $(PNG_FILES:%.png=$(CLASSBINDIR)/%.png)
FILES_gif = $(GIF_FILES:%.gif=$(CLASSBINDIR)/%.gif)
FILES_prop = $(PROP_FILES:%.properties=$(CLASSBINDIR)/%.properties)
build: $(GENSRCDIR)/sun/tools/jconsole/Version.java
#
# Resources
#
LOCALE_SET_DEFINITION = jdk
RESOURCE_BUNDLES_JAVA = $(PKGDIR)/resources/JConsoleResources.java
RESOURCE_BUNDLES_UNCOMPILED_PROPERTIES = $(PKGDIR)/resources/messages.properties
#
# Rules.
#
include $(BUILDDIR)/common/Classes.gmk
build: $(FILES_png) $(FILES_gif) $(TEMPDIR)/manifest $(JARFILE)
build: $(FILES_png) $(FILES_gif) $(FILES_prop) $(TEMPDIR)/manifest $(JARFILE)
$(GENSRCDIR)/sun/tools/jconsole/Version.java: \
$(SHARE_SRC)/classes/sun/tools/jconsole/Version.java.template
......@@ -85,7 +85,7 @@ $(TEMPDIR)/manifest: $(SHARE_SRC)/classes/$(PKGDIR)/manifest
# Extra rule to build jconsole.jar
#
$(JARFILE): $(LIBDIR) $(FILES_class) $(FILES_png) $(FILES_gif) $(TEMPDIR)/manifest
$(JARFILE): $(LIBDIR) $(FILES_class) $(FILES_png) $(FILES_gif) $(FILES_prop) $(TEMPDIR)/manifest
$(BOOT_JAR_CMD) -cfm $(JARFILE) $(TEMPDIR)/manifest \
-C $(CLASSBINDIR) sun/tools/jconsole \
-C $(CLASSBINDIR) com/sun/tools/jconsole \
......
......@@ -3,6 +3,10 @@
# (1)sorted
# (2)added the singlebyte entries
#
# (3)updated 0xA140-0xA7A0 mappings to follow GB18030/MS936
# (4)added euro sign entry A2E3 20AC (instead of 0xA2E3 0xE76C)
# this is what gb18030 does.
#
0x00 0x0000
0x01 0x0001
0x02 0x0002
......@@ -6508,12 +6512,12 @@
0xA2A8 0x2177
0xA2A9 0x2178
0xA2AA 0x2179
0xA2AB 0xE586
0xA2AC 0xE587
0xA2AD 0xE588
0xA2AE 0xE589
0xA2AF 0xE58A
0xA2B0 0xE58B
0xA2AB 0xE766
0xA2AC 0xE767
0xA2AD 0xE768
0xA2AE 0xE769
0xA2AF 0xE76A
0xA2B0 0xE76B
0xA2B1 0x2488
0xA2B2 0x2489
0xA2B3 0x248A
......@@ -6564,8 +6568,8 @@
0xA2E0 0x2467
0xA2E1 0x2468
0xA2E2 0x2469
0xA2E3 0xE58C
0xA2E4 0xE58D
0xA2E3 0x20AC
0xA2E4 0xE76D
0xA2E5 0x3220
0xA2E6 0x3221
0xA2E7 0x3222
......@@ -6576,8 +6580,8 @@
0xA2EC 0x3227
0xA2ED 0x3228
0xA2EE 0x3229
0xA2EF 0xE58E
0xA2F0 0xE58F
0xA2EF 0xE76E
0xA2F0 0xE76F
0xA2F1 0x2160
0xA2F2 0x2161
0xA2F3 0x2162
......@@ -6590,104 +6594,104 @@
0xA2FA 0x2169
0xA2FB 0x216A
0xA2FC 0x216B
0xA2FD 0xE590
0xA2FE 0xE591
0xA340 0xE592
0xA341 0xE593
0xA342 0xE594
0xA343 0xE595
0xA344 0xE596
0xA345 0xE597
0xA346 0xE598
0xA347 0xE599
0xA348 0xE59A
0xA349 0xE59B
0xA34A 0xE59C
0xA34B 0xE59D
0xA34C 0xE59E
0xA34D 0xE59F
0xA34E 0xE5A0
0xA34F 0xE5A1
0xA350 0xE5A2
0xA351 0xE5A3
0xA352 0xE5A4
0xA353 0xE5A5
0xA354 0xE5A6
0xA355 0xE5A7
0xA356 0xE5A8
0xA357 0xE5A9
0xA358 0xE5AA
0xA359 0xE5AB
0xA35A 0xE5AC
0xA35B 0xE5AD
0xA35C 0xE5AE
0xA35D 0xE5AF
0xA35E 0xE5B0
0xA35F 0xE5B1
0xA360 0xE5B2
0xA361 0xE5B3
0xA362 0xE5B4
0xA363 0xE5B5
0xA364 0xE5B6
0xA365 0xE5B7
0xA366 0xE5B8
0xA367 0xE5B9
0xA368 0xE5BA
0xA369 0xE5BB
0xA36A 0xE5BC
0xA36B 0xE5BD
0xA36C 0xE5BE
0xA36D 0xE5BF
0xA36E 0xE5C0
0xA36F 0xE5C1
0xA370 0xE5C2
0xA371 0xE5C3
0xA372 0xE5C4
0xA373 0xE5C5
0xA374 0xE5C6
0xA375 0xE5C7
0xA376 0xE5C8
0xA377 0xE5C9
0xA378 0xE5CA
0xA379 0xE5CB
0xA37A 0xE5CC
0xA37B 0xE5CD
0xA37C 0xE5CE
0xA37D 0xE5CF
0xA37E 0xE5D0
0xA380 0xE5D1
0xA381 0xE5D2
0xA382 0xE5D3
0xA383 0xE5D4
0xA384 0xE5D5
0xA385 0xE5D6
0xA386 0xE5D7
0xA387 0xE5D8
0xA388 0xE5D9
0xA389 0xE5DA
0xA38A 0xE5DB
0xA38B 0xE5DC
0xA38C 0xE5DD
0xA38D 0xE5DE
0xA38E 0xE5DF
0xA38F 0xE5E0
0xA390 0xE5E1
0xA391 0xE5E2
0xA392 0xE5E3
0xA393 0xE5E4
0xA394 0xE5E5
0xA395 0xE5E6
0xA396 0xE5E7
0xA397 0xE5E8
0xA398 0xE5E9
0xA399 0xE5EA
0xA39A 0xE5EB
0xA39B 0xE5EC
0xA39C 0xE5ED
0xA39D 0xE5EE
0xA39E 0xE5EF
0xA39F 0xE5F0
0xA3A0 0xE5F1
0xA2FD 0xE770
0xA2FE 0xE771
0xA340 0xE586
0xA341 0xE587
0xA342 0xE588
0xA343 0xE589
0xA344 0xE58A
0xA345 0xE58B
0xA346 0xE58C
0xA347 0xE58D
0xA348 0xE58E
0xA349 0xE58F
0xA34A 0xE590
0xA34B 0xE591
0xA34C 0xE592
0xA34D 0xE593
0xA34E 0xE594
0xA34F 0xE595
0xA350 0xE596
0xA351 0xE597
0xA352 0xE598
0xA353 0xE599
0xA354 0xE59A
0xA355 0xE59B
0xA356 0xE59C
0xA357 0xE59D
0xA358 0xE59E
0xA359 0xE59F
0xA35A 0xE5A0
0xA35B 0xE5A1
0xA35C 0xE5A2
0xA35D 0xE5A3
0xA35E 0xE5A4
0xA35F 0xE5A5
0xA360 0xE5A6
0xA361 0xE5A7
0xA362 0xE5A8
0xA363 0xE5A9
0xA364 0xE5AA
0xA365 0xE5AB
0xA366 0xE5AC
0xA367 0xE5AD
0xA368 0xE5AE
0xA369 0xE5AF
0xA36A 0xE5B0
0xA36B 0xE5B1
0xA36C 0xE5B2
0xA36D 0xE5B3
0xA36E 0xE5B4
0xA36F 0xE5B5
0xA370 0xE5B6
0xA371 0xE5B7
0xA372 0xE5B8
0xA373 0xE5B9
0xA374 0xE5BA
0xA375 0xE5BB
0xA376 0xE5BC
0xA377 0xE5BD
0xA378 0xE5BE
0xA379 0xE5BF
0xA37A 0xE5C0
0xA37B 0xE5C1
0xA37C 0xE5C2
0xA37D 0xE5C3
0xA37E 0xE5C4
0xA380 0xE5C5
0xA381 0xE5C6
0xA382 0xE5C7
0xA383 0xE5C8
0xA384 0xE5C9
0xA385 0xE5CA
0xA386 0xE5CB
0xA387 0xE5CC
0xA388 0xE5CD
0xA389 0xE5CE
0xA38A 0xE5CF
0xA38B 0xE5D0
0xA38C 0xE5D1
0xA38D 0xE5D2
0xA38E 0xE5D3
0xA38F 0xE5D4
0xA390 0xE5D5
0xA391 0xE5D6
0xA392 0xE5D7
0xA393 0xE5D8
0xA394 0xE5D9
0xA395 0xE5DA
0xA396 0xE5DB
0xA397 0xE5DC
0xA398 0xE5DD
0xA399 0xE5DE
0xA39A 0xE5DF
0xA39B 0xE5E0
0xA39C 0xE5E1
0xA39D 0xE5E2
0xA39E 0xE5E3
0xA39F 0xE5E4
0xA3A0 0xE5E5
0xA3A1 0xFF01
0xA3A2 0xFF02
0xA3A3 0xFF03
......@@ -6782,102 +6786,102 @@
0xA3FC 0xFF5C
0xA3FD 0xFF5D
0xA3FE 0xFFE3
0xA440 0xE5F2
0xA441 0xE5F3
0xA442 0xE5F4
0xA443 0xE5F5
0xA444 0xE5F6
0xA445 0xE5F7
0xA446 0xE5F8
0xA447 0xE5F9
0xA448 0xE5FA
0xA449 0xE5FB
0xA44A 0xE5FC
0xA44B 0xE5FD
0xA44C 0xE5FE
0xA44D 0xE5FF
0xA44E 0xE600
0xA44F 0xE601
0xA450 0xE602
0xA451 0xE603
0xA452 0xE604
0xA453 0xE605
0xA454 0xE606
0xA455 0xE607
0xA456 0xE608
0xA457 0xE609
0xA458 0xE60A
0xA459 0xE60B
0xA45A 0xE60C
0xA45B 0xE60D
0xA45C 0xE60E
0xA45D 0xE60F
0xA45E 0xE610
0xA45F 0xE611
0xA460 0xE612
0xA461 0xE613
0xA462 0xE614
0xA463 0xE615
0xA464 0xE616
0xA465 0xE617
0xA466 0xE618
0xA467 0xE619
0xA468 0xE61A
0xA469 0xE61B
0xA46A 0xE61C
0xA46B 0xE61D
0xA46C 0xE61E
0xA46D 0xE61F
0xA46E 0xE620
0xA46F 0xE621
0xA470 0xE622
0xA471 0xE623
0xA472 0xE624
0xA473 0xE625
0xA474 0xE626
0xA475 0xE627
0xA476 0xE628
0xA477 0xE629
0xA478 0xE62A
0xA479 0xE62B
0xA47A 0xE62C
0xA47B 0xE62D
0xA47C 0xE62E
0xA47D 0xE62F
0xA47E 0xE630
0xA480 0xE631
0xA481 0xE632
0xA482 0xE633
0xA483 0xE634
0xA484 0xE635
0xA485 0xE636
0xA486 0xE637
0xA487 0xE638
0xA488 0xE639
0xA489 0xE63A
0xA48A 0xE63B
0xA48B 0xE63C
0xA48C 0xE63D
0xA48D 0xE63E
0xA48E 0xE63F
0xA48F 0xE640
0xA490 0xE641
0xA491 0xE642
0xA492 0xE643
0xA493 0xE644
0xA494 0xE645
0xA495 0xE646
0xA496 0xE647
0xA497 0xE648
0xA498 0xE649
0xA499 0xE64A
0xA49A 0xE64B
0xA49B 0xE64C
0xA49C 0xE64D
0xA49D 0xE64E
0xA49E 0xE64F
0xA49F 0xE650
0xA4A0 0xE651
0xA440 0xE5E6
0xA441 0xE5E7
0xA442 0xE5E8
0xA443 0xE5E9
0xA444 0xE5EA
0xA445 0xE5EB
0xA446 0xE5EC
0xA447 0xE5ED
0xA448 0xE5EE
0xA449 0xE5EF
0xA44A 0xE5F0
0xA44B 0xE5F1
0xA44C 0xE5F2
0xA44D 0xE5F3
0xA44E 0xE5F4
0xA44F 0xE5F5
0xA450 0xE5F6
0xA451 0xE5F7
0xA452 0xE5F8
0xA453 0xE5F9
0xA454 0xE5FA
0xA455 0xE5FB
0xA456 0xE5FC
0xA457 0xE5FD
0xA458 0xE5FE
0xA459 0xE5FF
0xA45A 0xE600
0xA45B 0xE601
0xA45C 0xE602
0xA45D 0xE603
0xA45E 0xE604
0xA45F 0xE605
0xA460 0xE606
0xA461 0xE607
0xA462 0xE608
0xA463 0xE609
0xA464 0xE60A
0xA465 0xE60B
0xA466 0xE60C
0xA467 0xE60D
0xA468 0xE60E
0xA469 0xE60F
0xA46A 0xE610
0xA46B 0xE611
0xA46C 0xE612
0xA46D 0xE613
0xA46E 0xE614
0xA46F 0xE615
0xA470 0xE616
0xA471 0xE617
0xA472 0xE618
0xA473 0xE619
0xA474 0xE61A
0xA475 0xE61B
0xA476 0xE61C
0xA477 0xE61D
0xA478 0xE61E
0xA479 0xE61F
0xA47A 0xE620
0xA47B 0xE621
0xA47C 0xE622
0xA47D 0xE623
0xA47E 0xE624
0xA480 0xE625
0xA481 0xE626
0xA482 0xE627
0xA483 0xE628
0xA484 0xE629
0xA485 0xE62A
0xA486 0xE62B
0xA487 0xE62C
0xA488 0xE62D
0xA489 0xE62E
0xA48A 0xE62F
0xA48B 0xE630
0xA48C 0xE631
0xA48D 0xE632
0xA48E 0xE633
0xA48F 0xE634
0xA490 0xE635
0xA491 0xE636
0xA492 0xE637
0xA493 0xE638
0xA494 0xE639
0xA495 0xE63A
0xA496 0xE63B
0xA497 0xE63C
0xA498 0xE63D
0xA499 0xE63E
0xA49A 0xE63F
0xA49B 0xE640
0xA49C 0xE641
0xA49D 0xE642
0xA49E 0xE643
0xA49F 0xE644
0xA4A0 0xE645
0xA4A1 0x3041
0xA4A2 0x3042
0xA4A3 0x3043
......@@ -6961,113 +6965,113 @@
0xA4F1 0x3091
0xA4F2 0x3092
0xA4F3 0x3093
0xA4F4 0xE652
0xA4F5 0xE653
0xA4F6 0xE654
0xA4F7 0xE655
0xA4F8 0xE656
0xA4F9 0xE657
0xA4FA 0xE658
0xA4FB 0xE659
0xA4FC 0xE65A
0xA4FD 0xE65B
0xA4FE 0xE65C
0xA540 0xE65D
0xA541 0xE65E
0xA542 0xE65F
0xA543 0xE660
0xA544 0xE661
0xA545 0xE662
0xA546 0xE663
0xA547 0xE664
0xA548 0xE665
0xA549 0xE666
0xA54A 0xE667
0xA54B 0xE668
0xA54C 0xE669
0xA54D 0xE66A
0xA54E 0xE66B
0xA54F 0xE66C
0xA550 0xE66D
0xA551 0xE66E
0xA552 0xE66F
0xA553 0xE670
0xA554 0xE671
0xA555 0xE672
0xA556 0xE673
0xA557 0xE674
0xA558 0xE675
0xA559 0xE676
0xA55A 0xE677
0xA55B 0xE678
0xA55C 0xE679
0xA55D 0xE67A
0xA55E 0xE67B
0xA55F 0xE67C
0xA560 0xE67D
0xA561 0xE67E
0xA562 0xE67F
0xA563 0xE680
0xA564 0xE681
0xA565 0xE682
0xA566 0xE683
0xA567 0xE684
0xA568 0xE685
0xA569 0xE686
0xA56A 0xE687
0xA56B 0xE688
0xA56C 0xE689
0xA56D 0xE68A
0xA56E 0xE68B
0xA56F 0xE68C
0xA570 0xE68D
0xA571 0xE68E
0xA572 0xE68F
0xA573 0xE690
0xA574 0xE691
0xA575 0xE692
0xA576 0xE693
0xA577 0xE694
0xA578 0xE695
0xA579 0xE696
0xA57A 0xE697
0xA57B 0xE698
0xA57C 0xE699
0xA57D 0xE69A
0xA57E 0xE69B
0xA580 0xE69C
0xA581 0xE69D
0xA582 0xE69E
0xA583 0xE69F
0xA584 0xE6A0
0xA585 0xE6A1
0xA586 0xE6A2
0xA587 0xE6A3
0xA588 0xE6A4
0xA589 0xE6A5
0xA58A 0xE6A6
0xA58B 0xE6A7
0xA58C 0xE6A8
0xA58D 0xE6A9
0xA58E 0xE6AA
0xA58F 0xE6AB
0xA590 0xE6AC
0xA591 0xE6AD
0xA592 0xE6AE
0xA593 0xE6AF
0xA594 0xE6B0
0xA595 0xE6B1
0xA596 0xE6B2
0xA597 0xE6B3
0xA598 0xE6B4
0xA599 0xE6B5
0xA59A 0xE6B6
0xA59B 0xE6B7
0xA59C 0xE6B8
0xA59D 0xE6B9
0xA59E 0xE6BA
0xA59F 0xE6BB
0xA5A0 0xE6BC
0xA4F4 0xE772
0xA4F5 0xE773
0xA4F6 0xE774
0xA4F7 0xE775
0xA4F8 0xE776
0xA4F9 0xE777
0xA4FA 0xE778
0xA4FB 0xE779
0xA4FC 0xE77A
0xA4FD 0xE77B
0xA4FE 0xE77C
0xA540 0xE646
0xA541 0xE647
0xA542 0xE648
0xA543 0xE649
0xA544 0xE64A
0xA545 0xE64B
0xA546 0xE64C
0xA547 0xE64D
0xA548 0xE64E
0xA549 0xE64F
0xA54A 0xE650
0xA54B 0xE651
0xA54C 0xE652
0xA54D 0xE653
0xA54E 0xE654
0xA54F 0xE655
0xA550 0xE656
0xA551 0xE657
0xA552 0xE658
0xA553 0xE659
0xA554 0xE65A
0xA555 0xE65B
0xA556 0xE65C
0xA557 0xE65D
0xA558 0xE65E
0xA559 0xE65F
0xA55A 0xE660
0xA55B 0xE661
0xA55C 0xE662
0xA55D 0xE663
0xA55E 0xE664
0xA55F 0xE665
0xA560 0xE666
0xA561 0xE667
0xA562 0xE668
0xA563 0xE669
0xA564 0xE66A
0xA565 0xE66B
0xA566 0xE66C
0xA567 0xE66D
0xA568 0xE66E
0xA569 0xE66F
0xA56A 0xE670
0xA56B 0xE671
0xA56C 0xE672
0xA56D 0xE673
0xA56E 0xE674
0xA56F 0xE675
0xA570 0xE676
0xA571 0xE677
0xA572 0xE678
0xA573 0xE679
0xA574 0xE67A
0xA575 0xE67B
0xA576 0xE67C
0xA577 0xE67D
0xA578 0xE67E
0xA579 0xE67F
0xA57A 0xE680
0xA57B 0xE681
0xA57C 0xE682
0xA57D 0xE683
0xA57E 0xE684
0xA580 0xE685
0xA581 0xE686
0xA582 0xE687
0xA583 0xE688
0xA584 0xE689
0xA585 0xE68A
0xA586 0xE68B
0xA587 0xE68C
0xA588 0xE68D
0xA589 0xE68E
0xA58A 0xE68F
0xA58B 0xE690
0xA58C 0xE691
0xA58D 0xE692
0xA58E 0xE693
0xA58F 0xE694
0xA590 0xE695
0xA591 0xE696
0xA592 0xE697
0xA593 0xE698
0xA594 0xE699
0xA595 0xE69A
0xA596 0xE69B
0xA597 0xE69C
0xA598 0xE69D
0xA599 0xE69E
0xA59A 0xE69F
0xA59B 0xE6A0
0xA59C 0xE6A1
0xA59D 0xE6A2
0xA59E 0xE6A3
0xA59F 0xE6A4
0xA5A0 0xE6A5
0xA5A1 0x30A1
0xA5A2 0x30A2
0xA5A3 0x30A3
......@@ -7154,110 +7158,110 @@
0xA5F4 0x30F4
0xA5F5 0x30F5
0xA5F6 0x30F6
0xA5F7 0xE6BD
0xA5F8 0xE6BE
0xA5F9 0xE6BF
0xA5FA 0xE6C0
0xA5FB 0xE6C1
0xA5FC 0xE6C2
0xA5FD 0xE6C3
0xA5FE 0xE6C4
0xA640 0xE6C5
0xA641 0xE6C6
0xA642 0xE6C7
0xA643 0xE6C8
0xA644 0xE6C9
0xA645 0xE6CA
0xA646 0xE6CB
0xA647 0xE6CC
0xA648 0xE6CD
0xA649 0xE6CE
0xA64A 0xE6CF
0xA64B 0xE6D0
0xA64C 0xE6D1
0xA64D 0xE6D2
0xA64E 0xE6D3
0xA64F 0xE6D4
0xA650 0xE6D5
0xA651 0xE6D6
0xA652 0xE6D7
0xA653 0xE6D8
0xA654 0xE6D9
0xA655 0xE6DA
0xA656 0xE6DB
0xA657 0xE6DC
0xA658 0xE6DD
0xA659 0xE6DE
0xA65A 0xE6DF
0xA65B 0xE6E0
0xA65C 0xE6E1
0xA65D 0xE6E2
0xA65E 0xE6E3
0xA65F 0xE6E4
0xA660 0xE6E5
0xA661 0xE6E6
0xA662 0xE6E7
0xA663 0xE6E8
0xA664 0xE6E9
0xA665 0xE6EA
0xA666 0xE6EB
0xA667 0xE6EC
0xA668 0xE6ED
0xA669 0xE6EE
0xA66A 0xE6EF
0xA66B 0xE6F0
0xA66C 0xE6F1
0xA66D 0xE6F2
0xA66E 0xE6F3
0xA66F 0xE6F4
0xA670 0xE6F5
0xA671 0xE6F6
0xA672 0xE6F7
0xA673 0xE6F8
0xA674 0xE6F9
0xA675 0xE6FA
0xA676 0xE6FB
0xA677 0xE6FC
0xA678 0xE6FD
0xA679 0xE6FE
0xA67A 0xE6FF
0xA67B 0xE700
0xA67C 0xE701
0xA67D 0xE702
0xA67E 0xE703
0xA680 0xE704
0xA681 0xE705
0xA682 0xE706
0xA683 0xE707
0xA684 0xE708
0xA685 0xE709
0xA686 0xE70A
0xA687 0xE70B
0xA688 0xE70C
0xA689 0xE70D
0xA68A 0xE70E
0xA68B 0xE70F
0xA68C 0xE710
0xA68D 0xE711
0xA68E 0xE712
0xA68F 0xE713
0xA690 0xE714
0xA691 0xE715
0xA692 0xE716
0xA693 0xE717
0xA694 0xE718
0xA695 0xE719
0xA696 0xE71A
0xA697 0xE71B
0xA698 0xE71C
0xA699 0xE71D
0xA69A 0xE71E
0xA69B 0xE71F
0xA69C 0xE720
0xA69D 0xE721
0xA69E 0xE722
0xA69F 0xE723
0xA6A0 0xE724
0xA5F7 0xE77D
0xA5F8 0xE77E
0xA5F9 0xE77F
0xA5FA 0xE780
0xA5FB 0xE781
0xA5FC 0xE782
0xA5FD 0xE783
0xA5FE 0xE784
0xA640 0xE6A6
0xA641 0xE6A7
0xA642 0xE6A8
0xA643 0xE6A9
0xA644 0xE6AA
0xA645 0xE6AB
0xA646 0xE6AC
0xA647 0xE6AD
0xA648 0xE6AE
0xA649 0xE6AF
0xA64A 0xE6B0
0xA64B 0xE6B1
0xA64C 0xE6B2
0xA64D 0xE6B3
0xA64E 0xE6B4
0xA64F 0xE6B5
0xA650 0xE6B6
0xA651 0xE6B7
0xA652 0xE6B8
0xA653 0xE6B9
0xA654 0xE6BA
0xA655 0xE6BB
0xA656 0xE6BC
0xA657 0xE6BD
0xA658 0xE6BE
0xA659 0xE6BF
0xA65A 0xE6C0
0xA65B 0xE6C1
0xA65C 0xE6C2
0xA65D 0xE6C3
0xA65E 0xE6C4
0xA65F 0xE6C5
0xA660 0xE6C6
0xA661 0xE6C7
0xA662 0xE6C8
0xA663 0xE6C9
0xA664 0xE6CA
0xA665 0xE6CB
0xA666 0xE6CC
0xA667 0xE6CD
0xA668 0xE6CE
0xA669 0xE6CF
0xA66A 0xE6D0
0xA66B 0xE6D1
0xA66C 0xE6D2
0xA66D 0xE6D3
0xA66E 0xE6D4
0xA66F 0xE6D5
0xA670 0xE6D6
0xA671 0xE6D7
0xA672 0xE6D8
0xA673 0xE6D9
0xA674 0xE6DA
0xA675 0xE6DB
0xA676 0xE6DC
0xA677 0xE6DD
0xA678 0xE6DE
0xA679 0xE6DF
0xA67A 0xE6E0
0xA67B 0xE6E1
0xA67C 0xE6E2
0xA67D 0xE6E3
0xA67E 0xE6E4
0xA680 0xE6E5
0xA681 0xE6E6
0xA682 0xE6E7
0xA683 0xE6E8
0xA684 0xE6E9
0xA685 0xE6EA
0xA686 0xE6EB
0xA687 0xE6EC
0xA688 0xE6ED
0xA689 0xE6EE
0xA68A 0xE6EF
0xA68B 0xE6F0
0xA68C 0xE6F1
0xA68D 0xE6F2
0xA68E 0xE6F3
0xA68F 0xE6F4
0xA690 0xE6F5
0xA691 0xE6F6
0xA692 0xE6F7
0xA693 0xE6F8
0xA694 0xE6F9
0xA695 0xE6FA
0xA696 0xE6FB
0xA697 0xE6FC
0xA698 0xE6FD
0xA699 0xE6FE
0xA69A 0xE6FF
0xA69B 0xE700
0xA69C 0xE701
0xA69D 0xE702
0xA69E 0xE703
0xA69F 0xE704
0xA6A0 0xE705
0xA6A1 0x0391
0xA6A2 0x0392
0xA6A3 0x0393
......@@ -7282,14 +7286,14 @@
0xA6B6 0x03A7
0xA6B7 0x03A8
0xA6B8 0x03A9
0xA6B9 0xE725
0xA6BA 0xE726
0xA6BB 0xE727
0xA6BC 0xE728
0xA6BD 0xE729
0xA6BE 0xE72A
0xA6BF 0xE72B
0xA6C0 0xE72C
0xA6B9 0xE785
0xA6BA 0xE786
0xA6BB 0xE787
0xA6BC 0xE788
0xA6BD 0xE789
0xA6BE 0xE78A
0xA6BF 0xE78B
0xA6C0 0xE78C
0xA6C1 0x03B1
0xA6C2 0x03B2
0xA6C3 0x03B3
......@@ -7314,13 +7318,13 @@
0xA6D6 0x03C7
0xA6D7 0x03C8
0xA6D8 0x03C9
0xA6D9 0xE72D
0xA6DA 0xE72E
0xA6DB 0xE72F
0xA6DC 0xE730
0xA6DD 0xE731
0xA6DE 0xE732
0xA6DF 0xE733
0xA6D9 0xE78D
0xA6DA 0xE78E
0xA6DB 0xE78F
0xA6DC 0xE790
0xA6DD 0xE791
0xA6DE 0xE792
0xA6DF 0xE793
0xA6E0 0xFE35
0xA6E1 0xFE36
0xA6E2 0xFE39
......@@ -7333,121 +7337,121 @@
0xA6E9 0xFE42
0xA6EA 0xFE43
0xA6EB 0xFE44
0xA6EC 0xE734
0xA6ED 0xE735
0xA6EC 0xE794
0xA6ED 0xE795
0xA6EE 0xFE3B
0xA6EF 0xFE3C
0xA6F0 0xFE37
0xA6F1 0xFE38
0xA6F2 0xFE31
0xA6F3 0xE736
0xA6F3 0xE796
0xA6F4 0xFE33
0xA6F5 0xFE34
0xA6F6 0xE737
0xA6F7 0xE738
0xA6F8 0xE739
0xA6F9 0xE73A
0xA6FA 0xE73B
0xA6FB 0xE73C
0xA6FC 0xE73D
0xA6FD 0xE73E
0xA6FE 0xE73F
0xA740 0xE740
0xA741 0xE741
0xA742 0xE742
0xA743 0xE743
0xA744 0xE744
0xA745 0xE745
0xA746 0xE746
0xA747 0xE747
0xA748 0xE748
0xA749 0xE749
0xA74A 0xE74A
0xA74B 0xE74B
0xA74C 0xE74C
0xA74D 0xE74D
0xA74E 0xE74E
0xA74F 0xE74F
0xA750 0xE750
0xA751 0xE751
0xA752 0xE752
0xA753 0xE753
0xA754 0xE754
0xA755 0xE755
0xA756 0xE756
0xA757 0xE757
0xA758 0xE758
0xA759 0xE759
0xA75A 0xE75A
0xA75B 0xE75B
0xA75C 0xE75C
0xA75D 0xE75D
0xA75E 0xE75E
0xA75F 0xE75F
0xA760 0xE760
0xA761 0xE761
0xA762 0xE762
0xA763 0xE763
0xA764 0xE764
0xA765 0xE765
0xA766 0xE766
0xA767 0xE767
0xA768 0xE768
0xA769 0xE769
0xA76A 0xE76A
0xA76B 0xE76B
0xA76C 0xE76C
0xA76D 0xE76D
0xA76E 0xE76E
0xA76F 0xE76F
0xA770 0xE770
0xA771 0xE771
0xA772 0xE772
0xA773 0xE773
0xA774 0xE774
0xA775 0xE775
0xA776 0xE776
0xA777 0xE777
0xA778 0xE778
0xA779 0xE779
0xA77A 0xE77A
0xA77B 0xE77B
0xA77C 0xE77C
0xA77D 0xE77D
0xA77E 0xE77E
0xA780 0xE77F
0xA781 0xE780
0xA782 0xE781
0xA783 0xE782
0xA784 0xE783
0xA785 0xE784
0xA786 0xE785
0xA787 0xE786
0xA788 0xE787
0xA789 0xE788
0xA78A 0xE789
0xA78B 0xE78A
0xA78C 0xE78B
0xA78D 0xE78C
0xA78E 0xE78D
0xA78F 0xE78E
0xA790 0xE78F
0xA791 0xE790
0xA792 0xE791
0xA793 0xE792
0xA794 0xE793
0xA795 0xE794
0xA796 0xE795
0xA797 0xE796
0xA798 0xE797
0xA799 0xE798
0xA79A 0xE799
0xA79B 0xE79A
0xA79C 0xE79B
0xA79D 0xE79C
0xA79E 0xE79D
0xA79F 0xE79E
0xA7A0 0xE79F
0xA6F6 0xE797
0xA6F7 0xE798
0xA6F8 0xE799
0xA6F9 0xE79A
0xA6FA 0xE79B
0xA6FB 0xE79C
0xA6FC 0xE79D
0xA6FD 0xE79E
0xA6FE 0xE79F
0xA740 0xE706
0xA741 0xE707
0xA742 0xE708
0xA743 0xE709
0xA744 0xE70A
0xA745 0xE70B
0xA746 0xE70C
0xA747 0xE70D
0xA748 0xE70E
0xA749 0xE70F
0xA74A 0xE710
0xA74B 0xE711
0xA74C 0xE712
0xA74D 0xE713
0xA74E 0xE714
0xA74F 0xE715
0xA750 0xE716
0xA751 0xE717
0xA752 0xE718
0xA753 0xE719
0xA754 0xE71A
0xA755 0xE71B
0xA756 0xE71C
0xA757 0xE71D
0xA758 0xE71E
0xA759 0xE71F
0xA75A 0xE720
0xA75B 0xE721
0xA75C 0xE722
0xA75D 0xE723
0xA75E 0xE724
0xA75F 0xE725
0xA760 0xE726
0xA761 0xE727
0xA762 0xE728
0xA763 0xE729
0xA764 0xE72A
0xA765 0xE72B
0xA766 0xE72C
0xA767 0xE72D
0xA768 0xE72E
0xA769 0xE72F
0xA76A 0xE730
0xA76B 0xE731
0xA76C 0xE732
0xA76D 0xE733
0xA76E 0xE734
0xA76F 0xE735
0xA770 0xE736
0xA771 0xE737
0xA772 0xE738
0xA773 0xE739
0xA774 0xE73A
0xA775 0xE73B
0xA776 0xE73C
0xA777 0xE73D
0xA778 0xE73E
0xA779 0xE73F
0xA77A 0xE740
0xA77B 0xE741
0xA77C 0xE742
0xA77D 0xE743
0xA77E 0xE744
0xA780 0xE745
0xA781 0xE746
0xA782 0xE747
0xA783 0xE748
0xA784 0xE749
0xA785 0xE74A
0xA786 0xE74B
0xA787 0xE74C
0xA788 0xE74D
0xA789 0xE74E
0xA78A 0xE74F
0xA78B 0xE750
0xA78C 0xE751
0xA78D 0xE752
0xA78E 0xE753
0xA78F 0xE754
0xA790 0xE755
0xA791 0xE756
0xA792 0xE757
0xA793 0xE758
0xA794 0xE759
0xA795 0xE75A
0xA796 0xE75B
0xA797 0xE75C
0xA798 0xE75D
0xA799 0xE75E
0xA79A 0xE75F
0xA79B 0xE760
0xA79C 0xE761
0xA79D 0xE762
0xA79E 0xE763
0xA79F 0xE764
0xA7A0 0xE765
0xA7A1 0x0410
0xA7A2 0x0411
0xA7A3 0x0412
......
此差异已折叠。
#
# Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -58,6 +58,11 @@ ifndef DISABLE_NIMBUS
SUBDIRS += generate_nimbus
endif
ifeq ($(PLATFORM), solaris)
# temporary tools to work around gobjcopy bugs
SUBDIRS += add_gnu_debuglink fix_empty_sec_hdr_flags
endif
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
......
#
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Rules to build add_gnu_debuglink, used by various Makefiles on Solaris
BUILDDIR = ../..
include $(BUILDDIR)/common/Defs.gmk
# Default name
PROGRAM = add_gnu_debuglink
ADD_GNU_DEBUGLINK_PROG = $(ABS_BUILDTOOLBINDIR)/$(PROGRAM)
ADD_GNU_DEBUGLINK_SRC = add_gnu_debuglink.c
ADD_GNU_DEBUGLINK_FLAGS =
LIBS_ADD_GNU_DEBUGLINK += -lelf
all: $(ADD_GNU_DEBUGLINK)
$(ADD_GNU_DEBUGLINK_PROG): $(ADD_GNU_DEBUGLINK_SRC)
$(MKDIR) -p $(BUILDTOOLBINDIR)
$(CC) -g -o $@ $< $(ADD_GNU_DEBUGLINK_FLAGS) $(LIBS_ADD_GNU_DEBUGLINK)
clean::
$(RM) $(ADD_GNU_DEBUGLINK_PROG)
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
/*
* Name: add_gnu_debuglink.c
*
* Description: Add a ".gnu_debuglink" section that refers to the specified
* debug_info_path to the specified ELF object.
*
* This program is adapted from the example program shown on the
* elf(3elf) man page and from code from the Solaris compiler
* driver.
*/
/*
* needed to define SHF_EXCLUDE
*/
#define ELF_TARGET_ALL
#include <fcntl.h>
#include <stdio.h>
#include <libelf.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
static void failure(void);
static unsigned int gnu_debuglink_crc32(unsigned int crc, unsigned char *buf,
size_t len);
void
main(int argc, char ** argv) {
/* new ELF section name */
static char SEC_NAME[] = ".gnu_debuglink";
unsigned char buffer[8 * 1024]; /* I/O buffer */
int buffer_len; /* buffer length */
char * debug_info_path; /* debug info path */
void * ehdr; /* ELF header */
Elf * elf; /* ELF descriptor */
char * elf_ident; /* ELF identity string */
char * elf_obj; /* elf_obj file */
int fd; /* descriptor for files */
unsigned int file_crc = 0; /* CRC for debug info file */
int is_elfclass64; /* is an ELFCLASS64 file? */
Elf_Data * link_dat; /* ELF data for new debug info link */
Elf_Data * name_dat; /* ELF data for new section name */
Elf_Scn * new_scn; /* new ELF section descriptor */
void * new_shdr; /* new ELF section header */
Elf_Scn * scn; /* ELF section descriptor */
void * shdr; /* ELF section header */
if (argc != 3) {
(void) fprintf(stderr, "Usage: %s debug_info_path elf_obj\n", argv[0]);
exit(2);
}
debug_info_path = argv[1]; /* save for later */
if ((fd = open(debug_info_path, O_RDONLY)) == -1) {
(void) fprintf(stderr, "%s: cannot open file.\n", debug_info_path);
exit(3);
}
(void) printf("Computing CRC for '%s'\n", debug_info_path);
(void) fflush(stdout);
/* compute CRC for the debug info file */
for (;;) {
int len = read(fd, buffer, sizeof buffer);
if (len <= 0) {
break;
}
file_crc = gnu_debuglink_crc32(file_crc, buffer, len);
}
(void) close(fd);
/* open the elf_obj */
elf_obj = argv[2];
if ((fd = open(elf_obj, O_RDWR)) == -1) {
(void) fprintf(stderr, "%s: cannot open file.\n", elf_obj);
exit(4);
}
(void) printf("Opening '%s' for update\n", elf_obj);
(void) fflush(stdout);
(void) elf_version(EV_CURRENT); /* coordinate ELF versions */
/* obtain the ELF descriptors from the input file */
if ((elf = elf_begin(fd, ELF_C_RDWR, NULL)) == NULL) {
failure();
}
/* determine if ELFCLASS64 or not? */
elf_ident = elf_getident(elf, NULL);
is_elfclass64 = (elf_ident[EI_CLASS] == ELFCLASS64);
/* get the ELF header */
if (is_elfclass64) {
ehdr = elf64_getehdr(elf);
} else {
ehdr = elf32_getehdr(elf);
}
if (ehdr == NULL) {
failure();
}
/* get the ELF section descriptor */
if (is_elfclass64) {
scn = elf_getscn(elf, ((Elf64_Ehdr *) ehdr)->e_shstrndx);
} else {
scn = elf_getscn(elf, ((Elf32_Ehdr *) ehdr)->e_shstrndx);
}
if (scn == NULL) {
failure();
}
/* get the section header */
if (is_elfclass64) {
shdr = elf64_getshdr(scn);
} else {
shdr = elf32_getshdr(scn);
}
if (shdr == NULL) {
failure();
}
(void) printf("Adding ELF data for new section name\n");
(void) fflush(stdout);
name_dat = elf_newdata(scn);
name_dat->d_buf = (void *) SEC_NAME;
if (is_elfclass64) {
name_dat->d_off = ((Elf64_Shdr *) shdr)->sh_size + 1;
} else {
name_dat->d_off = ((Elf32_Shdr *) shdr)->sh_size + 1;
}
name_dat->d_align = 1;
name_dat->d_size = strlen(SEC_NAME) + 1;
new_scn = elf_newscn(elf);
if (is_elfclass64) {
new_shdr = elf64_getshdr(new_scn);
((Elf64_Shdr *) new_shdr)->sh_flags = SHF_EXCLUDE;
((Elf64_Shdr *) new_shdr)->sh_type = SHT_PROGBITS;
((Elf64_Shdr *) new_shdr)->sh_name = ((Elf64_Shdr *) shdr)->sh_size;
((Elf64_Shdr *) new_shdr)->sh_addralign = 1;
((Elf64_Shdr *) shdr)->sh_size += (strlen(SEC_NAME) + 1);
} else {
new_shdr = elf32_getshdr(new_scn);
((Elf32_Shdr *) new_shdr)->sh_flags = SHF_EXCLUDE;
((Elf32_Shdr *) new_shdr)->sh_type = SHT_PROGBITS;
((Elf32_Shdr *) new_shdr)->sh_name = ((Elf32_Shdr *) shdr)->sh_size;
((Elf32_Shdr *) new_shdr)->sh_addralign = 1;
((Elf32_Shdr *) shdr)->sh_size += (strlen(SEC_NAME) + 1);
}
(void) printf("Adding ELF data for debug_info_path value\n");
(void) fflush(stdout);
(void) memset(buffer, 0, sizeof buffer);
buffer_len = strlen(debug_info_path) + 1; /* +1 for NUL */
(void) strncpy((char *) buffer, debug_info_path, buffer_len);
if (buffer_len % 4 != 0) {
/* not on a 4 byte boundary so pad to the next one */
buffer_len += (4 - buffer_len % 4);
}
/* save the CRC */
(void) memcpy(&buffer[buffer_len], &file_crc, sizeof file_crc);
buffer_len += sizeof file_crc;
link_dat = elf_newdata(new_scn);
link_dat->d_type = ELF_T_BYTE;
link_dat->d_size = buffer_len;
link_dat->d_buf = buffer;
link_dat->d_align = 1;
(void) printf("Saving updates to '%s'\n", elf_obj);
(void) fflush(stdout);
(void) elf_update(elf, ELF_C_NULL); /* recalc ELF memory structures */
(void) elf_update(elf, ELF_C_WRITE); /* write out changes to ELF obj */
(void) elf_end(elf); /* done with ELF obj */
(void) close(fd);
(void) printf("Done updating '%s'\n", elf_obj);
(void) fflush(stdout);
exit(0);
} /* end main */
static void
failure() {
(void) fprintf(stderr, "%s\n", elf_errmsg(elf_errno()));
exit(5);
}
/*
* The CRC used in gnu_debuglink, retrieved from
* http://sourceware.org/gdb/current/onlinedocs/gdb/Separate-Debug-Files.html#Separate-Debug-Files.
*/
static unsigned int
gnu_debuglink_crc32(unsigned int crc, unsigned char *buf, size_t len) {
static const unsigned int crc32_table[256] = {
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,
0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4,
0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07,
0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856,
0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4,
0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3,
0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a,
0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599,
0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190,
0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,
0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e,
0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed,
0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3,
0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a,
0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,
0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010,
0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17,
0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6,
0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615,
0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344,
0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a,
0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1,
0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c,
0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef,
0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe,
0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,
0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c,
0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b,
0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1,
0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278,
0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,
0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66,
0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605,
0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8,
0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b,
0x2d02ef8d
};
unsigned char *end;
crc = ~crc & 0xffffffff;
for (end = buf + len; buf < end; ++buf) {
crc = crc32_table[(crc ^ *buf) & 0xff] ^ (crc >> 8);
}
return ~crc & 0xffffffff;
}
#
# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -19,61 +19,28 @@
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# @test
# @bug 6853328
# @summary Support OK-AS-DELEGATE flag
# @run shell/timeout=600 ok-as-delegate-xrealm.sh
#
if [ "${TESTSRC}" = "" ] ; then
TESTSRC=`dirname $0`
fi
if [ "${TESTJAVA}" = "" ] ; then
JAVAC_CMD=`which javac`
TESTJAVA=`dirname $JAVAC_CMD`/..
fi
# set platform-dependent variables
OS=`uname -s`
case "$OS" in
Windows_* )
FS="\\"
SEP=";"
;;
CYGWIN* )
FS="/"
SEP=";"
;;
* )
FS="/"
SEP=":"
;;
esac
# Rules to build fix_empty_sec_hdr_flags, used by various Makefiles on Solaris
${TESTJAVA}${FS}bin${FS}javac -XDignore.symbol.file -d . \
${TESTSRC}${FS}OkAsDelegateXRealm.java \
${TESTSRC}${FS}KDC.java \
${TESTSRC}${FS}OneKDC.java \
${TESTSRC}${FS}Action.java \
${TESTSRC}${FS}Context.java \
|| exit 10
BUILDDIR = ../..
include $(BUILDDIR)/common/Defs.gmk
# Add $TESTSRC to classpath so that customized nameservice can be used
J="${TESTJAVA}${FS}bin${FS}java -cp $TESTSRC${SEP}."
# Default name
PROGRAM = fix_empty_sec_hdr_flags
FIX_EMPTY_SEC_HDR_FLAGS_PROG = $(ABS_BUILDTOOLBINDIR)/$(PROGRAM)
# KDC no OK-AS-DELEGATE, fail
$J OkAsDelegateXRealm false || exit 1
FIX_EMPTY_SEC_HDR_FLAGS_SRC = fix_empty_sec_hdr_flags.c
FIX_EMPTY_SEC_HDR_FLAGS_FLAGS =
LIBS_FIX_EMPTY_SEC_HDR_FLAGS += -lelf
# KDC set OK-AS-DELEGATE for all, succeed
$J -Dtest.kdc.policy.ok-as-delegate OkAsDelegateXRealm true || exit 2
all: $(FIX_EMPTY_SEC_HDR_FLAGS)
# KDC set OK-AS-DELEGATE for host/host.r3.local only, fail
$J -Dtest.kdc.policy.ok-as-delegate=host/host.r3.local OkAsDelegateXRealm false || exit 3
$(FIX_EMPTY_SEC_HDR_FLAGS_PROG): $(FIX_EMPTY_SEC_HDR_FLAGS_SRC)
$(MKDIR) -p $(BUILDTOOLBINDIR)
$(CC) -g -o $@ $< $(FIX_EMPTY_SEC_HDR_FLAGS_FLAGS) $(LIBS_FIX_EMPTY_SEC_HDR_FLAGS)
# KDC set OK-AS-DELEGATE for all, succeed
$J "-Dtest.kdc.policy.ok-as-delegate=host/host.r3.local krbtgt/R2 krbtgt/R3" OkAsDelegateXRealm true || exit 4
clean::
$(RM) $(FIX_EMPTY_SEC_HDR_FLAGS_PROG)
exit 0
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
/*
* Name: fix_empty_sec_hdr_flags.c
*
* Description: Remove the SHF_ALLOC flag from "empty" section headers.
* An "empty" section header has sh_addr == 0 and sh_size == 0.
*
* This program is adapted from the example program shown on the
* elf(3elf) man page and from code from the Solaris compiler
* driver.
*/
#include <fcntl.h>
#include <stdio.h>
#include <libelf.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
static void failure(void);
void
main(int argc, char ** argv) {
void * ehdr; /* ELF header */
unsigned int i; /* section counter */
int fd; /* descriptor for file */
Elf * elf; /* ELF descriptor */
char * elf_ident; /* ELF identity string */
char * elf_obj; /* elf_obj file */
int fix_count; /* number of flags fixed */
int is_elfclass64; /* is an ELFCLASS64 file? */
Elf_Scn * scn; /* ELF section descriptor */
void * shdr; /* ELF section header */
Elf_Data * shstrtab; /* ELF section header string table */
if (argc != 2) {
(void) fprintf(stderr, "Usage: %s elf_obj\n", argv[0]);
exit(2);
}
/* open the elf_obj */
elf_obj = argv[1];
if ((fd = open(elf_obj, O_RDWR)) == -1) {
(void) fprintf(stderr, "%s: cannot open file.\n", elf_obj);
exit(3);
}
(void) printf("Opening '%s' for update\n", elf_obj);
(void) fflush(stdout);
(void) elf_version(EV_CURRENT); /* coordinate ELF versions */
/* obtain the ELF descriptors from the input file */
if ((elf = elf_begin(fd, ELF_C_RDWR, NULL)) == NULL) {
failure();
}
/* determine if ELFCLASS64 or not? */
elf_ident = elf_getident(elf, NULL);
is_elfclass64 = (elf_ident[EI_CLASS] == ELFCLASS64);
/* get the ELF header */
if (is_elfclass64) {
ehdr = elf64_getehdr(elf);
} else {
ehdr = elf32_getehdr(elf);
}
if (ehdr == NULL) {
failure();
}
/* get the ELF section descriptor */
if (is_elfclass64) {
scn = elf_getscn(elf, ((Elf64_Ehdr *) ehdr)->e_shstrndx);
} else {
scn = elf_getscn(elf, ((Elf32_Ehdr *) ehdr)->e_shstrndx);
}
if (scn == NULL) {
failure();
}
/* get the section header string table */
shstrtab = elf_getdata(scn, NULL);
if (shstrtab == NULL) {
failure();
}
fix_count = 0;
/* traverse the sections of the input file */
for (i = 1, scn = NULL; scn = elf_nextscn(elf, scn); i++) {
int has_flag_set; /* is SHF_ALLOC flag set? */
int is_empty; /* is section empty? */
char * name; /* short hand pointer */
/* get the section header */
if (is_elfclass64) {
shdr = elf64_getshdr(scn);
} else {
shdr = elf32_getshdr(scn);
}
if (shdr == NULL) {
failure();
}
if (is_elfclass64) {
name = (char *)shstrtab->d_buf + ((Elf64_Shdr *) shdr)->sh_name;
} else {
name = (char *)shstrtab->d_buf + ((Elf32_Shdr *) shdr)->sh_name;
}
if (is_elfclass64) {
has_flag_set = ((Elf64_Shdr *) shdr)->sh_flags & SHF_ALLOC;
is_empty = ((Elf64_Shdr *) shdr)->sh_addr == 0 &&
((Elf64_Shdr *) shdr)->sh_size == 0;
} else {
has_flag_set = ((Elf32_Shdr *) shdr)->sh_flags & SHF_ALLOC;
is_empty = ((Elf32_Shdr *) shdr)->sh_addr == 0 &&
((Elf32_Shdr *) shdr)->sh_size == 0;
}
if (is_empty && has_flag_set) {
(void) printf("section[%u] '%s' is empty, "
"but SHF_ALLOC flag is set.\n", i, name);
(void) printf("Clearing the SHF_ALLOC flag.\n");
if (is_elfclass64) {
((Elf64_Shdr *) shdr)->sh_flags &= ~SHF_ALLOC;
} else {
((Elf32_Shdr *) shdr)->sh_flags &= ~SHF_ALLOC;
}
fix_count++;
}
} /* end for each ELF section */
if (fix_count > 0) {
(void) printf("Saving %d updates to '%s'\n", fix_count, elf_obj);
(void) fflush(stdout);
(void) elf_update(elf, ELF_C_NULL); /* recalc ELF memory structures */
(void) elf_update(elf, ELF_C_WRITE); /* write out changes to ELF obj */
} else {
(void) printf("No SHF_ALLOC flags needed to be cleared.\n");
}
(void) elf_end(elf); /* done with ELF obj */
(void) close(fd);
(void) printf("Done %s '%s'\n",
(fix_count > 0) ? "updating" : "with", elf_obj);
(void) fflush(stdout);
exit(0);
} /* end main */
static void
failure() {
(void) fprintf(stderr, "%s\n", elf_errmsg(elf_errno()));
exit(6);
}
......@@ -69,7 +69,6 @@ FILES_c = \
jdk_util_md.c \
check_version.c \
java_props_md.c \
DriverManager.c \
ConstantPool.c \
MessageUtils.c \
GC.c \
......
......@@ -232,7 +232,6 @@ SUNWprivate_1.1 {
Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2;
Java_java_security_AccessController_getStackAccessControlContext;
Java_java_security_AccessController_getInheritedAccessControlContext;
Java_java_sql_DriverManager_getCallerClassLoader;
Java_java_util_ResourceBundle_getClassContext;
Java_java_util_TimeZone_getSystemTimeZoneID;
Java_java_util_TimeZone_getSystemGMTOffsetID;
......
......@@ -653,8 +653,8 @@ class Attribute implements Comparable<Attribute> {
return fixups[0]; // return ref-bearing cookie, if any
}
public String layoutForPackageMajver(int majver) {
if (majver <= JAVA5_PACKAGE_MAJOR_VERSION) {
public String layoutForClassVersion(Package.Version vers) {
if (vers.lessThan(JAVA6_MAX_CLASS_VERSION)) {
// Disallow layout syntax in the oldest protocol version.
return expandCaseDashNotation(layout);
}
......
......@@ -74,30 +74,27 @@ class BandStructure {
abstract protected Index getCPIndex(byte tag);
// Local copy of package version.
private int packageMajver = -1;
// Local copy of highest class version.
private Package.Version highestClassVersion = null;
/** Call this exactly once, early, to specify the archive major version. */
public void initPackageMajver(int packageMajver) throws IOException {
assert(packageMajver > 0 && packageMajver < 0x10000);
if (this.packageMajver > 0) {
public void initHighestClassVersion(Package.Version highestClassVersion) throws IOException {
if (this.highestClassVersion != null) {
throw new IOException(
"Package majver is already initialized to " + this.packageMajver+
"; new setting is " + packageMajver);
"Highest class major version is already initialized to " +
this.highestClassVersion + "; new setting is " + highestClassVersion);
}
this.packageMajver = packageMajver;
adjustToMajver();
this.highestClassVersion = highestClassVersion;
adjustToClassVersion();
}
public int getPackageMajver() {
if (packageMajver < 0) {
throw new RuntimeException("Package majver not yet initialized");
}
return packageMajver;
public Package.Version getHighestClassVersion() {
return highestClassVersion;
}
private final boolean isReader = this instanceof PackageReader;
protected BandStructure() {
}
protected BandStructure() {}
final static Coding BYTE1 = Coding.of(1,256);
......@@ -1866,20 +1863,12 @@ class BandStructure {
attrClassFileVersionMask = (1<<CLASS_ATTR_ClassFile_version);
}
private void adjustToMajver() throws IOException {
if (getPackageMajver() < JAVA6_PACKAGE_MAJOR_VERSION) {
private void adjustToClassVersion() throws IOException {
if (getHighestClassVersion().lessThan(JAVA6_MAX_CLASS_VERSION)) {
if (verbose > 0) Utils.log.fine("Legacy package version");
// Revoke definition of pre-1.6 attribute type.
undefineAttribute(CODE_ATTR_StackMapTable, ATTR_CONTEXT_CODE);
}
if (getPackageMajver() < JAVA7_PACKAGE_MAJOR_VERSION) {
if (testBit(archiveOptions, AO_HAVE_CP_EXTRAS))
// this bit was reserved for future use in previous versions
throw new IOException("Format bits for Java 7 must be zero in previous releases");
}
if (testBit(archiveOptions, AO_UNUSED_MBZ)) {
throw new IOException("High archive option bits are reserved and must be zero: "+Integer.toHexString(archiveOptions));
}
}
protected void initAttrIndexLimit() {
......@@ -1942,21 +1931,14 @@ class BandStructure {
}
}
protected Attribute makeClassFileVersionAttr(int minver, int majver) {
byte[] bytes = {
(byte)(minver >> 8), (byte)minver,
(byte)(majver >> 8), (byte)majver
};
return attrClassFileVersion.addContent(bytes);
protected Attribute makeClassFileVersionAttr(Package.Version ver) {
return attrClassFileVersion.addContent(ver.asBytes());
}
protected short[] parseClassFileVersionAttr(Attribute attr) {
protected Package.Version parseClassFileVersionAttr(Attribute attr) {
assert(attr.layout() == attrClassFileVersion);
assert(attr.size() == 4);
byte[] bytes = attr.bytes();
int minver = ((bytes[0] & 0xFF) << 8) | (bytes[1] & 0xFF);
int majver = ((bytes[2] & 0xFF) << 8) | (bytes[3] & 0xFF);
return new short[]{ (short) minver, (short) majver };
return Package.Version.of(attr.bytes());
}
private boolean assertBandOKForElems(Band[] ab, Attribute.Layout.Element[] elems) {
......
......@@ -174,27 +174,31 @@ class ClassReader {
("Bad magic number in class file "
+Integer.toHexString(cls.magic),
ATTR_CONTEXT_CLASS, "magic-number", "pass");
cls.minver = (short) readUnsignedShort();
cls.majver = (short) readUnsignedShort();
int minver = (short) readUnsignedShort();
int majver = (short) readUnsignedShort();
cls.version = Package.Version.of(majver, minver);
//System.out.println("ClassFile.version="+cls.majver+"."+cls.minver);
String bad = checkVersion(cls.majver, cls.minver);
String bad = checkVersion(cls.version);
if (bad != null) {
throw new Attribute.FormatException
("classfile version too "+bad+": "
+cls.majver+"."+cls.minver+" in "+cls.file,
+cls.version+" in "+cls.file,
ATTR_CONTEXT_CLASS, "version", "pass");
}
}
private String checkVersion(int majver, int minver) {
if (majver < pkg.min_class_majver ||
(majver == pkg.min_class_majver &&
minver < pkg.min_class_minver)) {
private String checkVersion(Package.Version ver) {
int majver = ver.major;
int minver = ver.minor;
if (majver < pkg.minClassVersion.major ||
(majver == pkg.minClassVersion.major &&
minver < pkg.minClassVersion.minor)) {
return "small";
}
if (majver > pkg.max_class_majver ||
(majver == pkg.max_class_majver &&
minver > pkg.max_class_minver)) {
if (majver > pkg.maxClassVersion.major ||
(majver == pkg.maxClassVersion.major &&
minver > pkg.maxClassVersion.minor)) {
return "large";
}
return null; // OK
......
......@@ -113,8 +113,8 @@ class ClassWriter {
void writeMagicNumbers() throws IOException {
writeInt(cls.magic);
writeShort(cls.minver);
writeShort(cls.majver);
writeShort(cls.version.minor);
writeShort(cls.version.major);
}
void writeConstantPool() throws IOException {
......
......@@ -43,30 +43,40 @@ class Constants {
1.0 to 1.3.X 45,3
1.4 to 1.4.X 46,0
1.5 to 1.5.X 49,0
1.6 to 1.5.x 50,0 NOTE Assumed for now
1.6 to 1.5.x 50,0
1.7 to 1.6.x 51,0
*/
public final static short JAVA_MIN_CLASS_MAJOR_VERSION = 45;
public final static short JAVA_MIN_CLASS_MINOR_VERSION = 03;
public final static Package.Version JAVA_MIN_CLASS_VERSION =
Package.Version.of(45, 03);
public final static short JAVA5_MAX_CLASS_MAJOR_VERSION = 49;
public final static short JAVA5_MAX_CLASS_MINOR_VERSION = 0;
public final static Package.Version JAVA5_MAX_CLASS_VERSION =
Package.Version.of(49, 00);
public final static short JAVA6_MAX_CLASS_MAJOR_VERSION = 50;
public final static short JAVA6_MAX_CLASS_MINOR_VERSION = 0;
public final static Package.Version JAVA6_MAX_CLASS_VERSION =
Package.Version.of(50, 00);
public final static short JAVA7_MAX_CLASS_MAJOR_VERSION = 51;
public final static short JAVA7_MAX_CLASS_MINOR_VERSION = 0;
public final static Package.Version JAVA7_MAX_CLASS_VERSION =
Package.Version.of(51, 00);
public final static int JAVA_PACKAGE_MAGIC = 0xCAFED00D;
public final static int JAVA5_PACKAGE_MAJOR_VERSION = 150;
public final static int JAVA5_PACKAGE_MINOR_VERSION = 7;
public final static int JAVA6_PACKAGE_MAJOR_VERSION = 160;
public final static int JAVA6_PACKAGE_MINOR_VERSION = 1;
public final static Package.Version JAVA5_PACKAGE_VERSION =
Package.Version.of(150, 7);
public final static int JAVA7_PACKAGE_MAJOR_VERSION = 170;
public final static int JAVA7_PACKAGE_MINOR_VERSION = 1;
public final static Package.Version JAVA6_PACKAGE_VERSION =
Package.Version.of(160, 1);
public final static Package.Version JAVA7_PACKAGE_VERSION =
Package.Version.of(170, 1);
// upper limit, should point to the latest class version
public final static Package.Version JAVA_MAX_CLASS_VERSION =
JAVA7_MAX_CLASS_VERSION;
// upper limit should point to the latest package version, for version info!.
public final static Package.Version MAX_PACKAGE_VERSION =
JAVA7_PACKAGE_VERSION;
public final static int CONSTANT_POOL_INDEX_LIMIT = 0x10000;
public final static int CONSTANT_POOL_NARROW_LIMIT = 0x00100;
......
......@@ -25,6 +25,7 @@
package com.sun.java.util.jar.pack;
import java.util.jar.Pack200;
import com.sun.java.util.jar.pack.Attribute.Layout;
import com.sun.java.util.jar.pack.ConstantPool.ClassEntry;
import com.sun.java.util.jar.pack.ConstantPool.DescriptorEntry;
......@@ -67,46 +68,58 @@ class Package {
verbose = pmap.getInteger(Utils.DEBUG_VERBOSE);
}
int magic;
int package_minver;
int package_majver;
final int magic = JAVA_PACKAGE_MAGIC;
int default_modtime = NO_MODTIME;
int default_options = 0; // FO_DEFLATE_HINT
short default_class_majver = -1; // fill in later
short default_class_minver = 0; // fill in later
Version defaultClassVersion = null;
// These fields can be adjusted by driver properties.
short min_class_majver = JAVA_MIN_CLASS_MAJOR_VERSION;
short min_class_minver = JAVA_MIN_CLASS_MINOR_VERSION;
short max_class_majver = JAVA7_MAX_CLASS_MAJOR_VERSION;
short max_class_minver = JAVA7_MAX_CLASS_MINOR_VERSION;
final Version minClassVersion;
final Version maxClassVersion;
// null, indicates that consensus rules during package write
final Version packageVersion;
Version observedHighestClassVersion = null;
short observed_max_class_majver = min_class_majver;
short observed_max_class_minver = min_class_minver;
// What constants are used in this unit?
ConstantPool.IndexGroup cp = new ConstantPool.IndexGroup();
Package() {
magic = JAVA_PACKAGE_MAGIC;
package_minver = -1; // fill in later
package_majver = 0; // fill in later
/*
* typically used by the PackageReader to set the defaults, in which
* case we take the defaults.
*/
public Package() {
minClassVersion = JAVA_MIN_CLASS_VERSION;
maxClassVersion = JAVA_MAX_CLASS_VERSION;
packageVersion = null;
}
public
void reset() {
/*
* Typically used by the PackerImpl during before packing, the defaults are
* overridden by the users preferences.
*/
public Package(Version minClassVersion, Version maxClassVersion, Version packageVersion) {
// Fill in permitted range of major/minor version numbers.
this.minClassVersion = minClassVersion == null
? JAVA_MIN_CLASS_VERSION
: minClassVersion;
this.maxClassVersion = maxClassVersion == null
? JAVA_MAX_CLASS_VERSION
: maxClassVersion;
this.packageVersion = packageVersion;
}
public void reset() {
cp = new ConstantPool.IndexGroup();
classes.clear();
files.clear();
BandStructure.nextSeqForDebug = 0;
package_minver = -1; // fill in later
package_majver = 0; // fill in later
}
int getPackageVersion() {
return (package_majver << 16) + package_minver;
observedHighestClassVersion = null;
}
// Special empty versions of Code and InnerClasses, used for markers.
......@@ -128,73 +141,31 @@ class Package {
attrDefs = Collections.unmodifiableMap(ad);
}
int getDefaultClassVersion() {
return (default_class_majver << 16) + (char)default_class_minver;
Version getDefaultClassVersion() {
return defaultClassVersion;
}
/** Return the highest version number of all classes,
* or 0 if there are no classes.
*/
int getHighestClassVersion() {
int res = 0; // initial low value
private void setHighestClassVersion() {
if (observedHighestClassVersion != null)
return;
Version res = JAVA_MIN_CLASS_VERSION; // initial low value
for (Class cls : classes) {
int ver = cls.getVersion();
if (res < ver) res = ver;
Version ver = cls.getVersion();
if (res.lessThan(ver)) res = ver;
}
return res;
observedHighestClassVersion = res;
}
/** Convenience function to choose an archive version based
* on the class file versions observed within the archive.
*/
void choosePackageVersion() {
assert(package_majver <= 0); // do not call this twice
int classver = getHighestClassVersion();
if (classver == 0 || (classver >>> 16) < JAVA6_MAX_CLASS_MAJOR_VERSION) {
// There are only old classfiles in this segment or resources
package_majver = JAVA5_PACKAGE_MAJOR_VERSION;
package_minver = JAVA5_PACKAGE_MINOR_VERSION;
} else if ((classver >>> 16) == JAVA6_MAX_CLASS_MAJOR_VERSION) {
package_majver = JAVA6_PACKAGE_MAJOR_VERSION;
package_minver = JAVA6_PACKAGE_MINOR_VERSION;
} else {
// Normal case. Use the newest archive format, when available
package_majver = JAVA7_PACKAGE_MAJOR_VERSION;
package_minver = JAVA7_PACKAGE_MINOR_VERSION;
}
Version getHighestClassVersion() {
setHighestClassVersion();
return observedHighestClassVersion;
}
// What Java classes are in this unit?
// Fixed 6211177, converted to throw IOException
void checkVersion() throws IOException {
if (magic != JAVA_PACKAGE_MAGIC) {
String gotMag = Integer.toHexString(magic);
String expMag = Integer.toHexString(JAVA_PACKAGE_MAGIC);
throw new IOException("Unexpected package magic number: got "+gotMag+"; expected "+expMag);
}
int[] majminFound = null;
for (int[] majmin : new int[][]{
{ JAVA7_PACKAGE_MAJOR_VERSION, JAVA7_PACKAGE_MINOR_VERSION },
{ JAVA6_PACKAGE_MAJOR_VERSION, JAVA6_PACKAGE_MINOR_VERSION },
{ JAVA5_PACKAGE_MAJOR_VERSION, JAVA5_PACKAGE_MINOR_VERSION }
}) {
if (package_majver == majmin[0] && package_minver == majmin[1]) {
majminFound = majmin;
break;
}
}
if (majminFound == null) {
String gotVer = package_majver+"."+package_minver;
String expVer = JAVA7_PACKAGE_MAJOR_VERSION+"."+JAVA7_PACKAGE_MINOR_VERSION+
" OR "+
JAVA6_PACKAGE_MAJOR_VERSION+"."+JAVA6_PACKAGE_MINOR_VERSION+
" OR "+
JAVA5_PACKAGE_MAJOR_VERSION+"."+JAVA5_PACKAGE_MINOR_VERSION;
throw new IOException("Unexpected package minor version: got "+gotVer+"; expected "+expVer);
}
}
ArrayList<Package.Class> classes = new ArrayList<>();
public List<Package.Class> getClasses() {
......@@ -210,7 +181,7 @@ class Package {
// File header
int magic;
short minver, majver;
Version version;
// Local constant pool (one-way mapping of index => package cp).
Entry[] cpMap;
......@@ -231,8 +202,7 @@ class Package {
Class(int flags, ClassEntry thisClass, ClassEntry superClass, ClassEntry[] interfaces) {
this.magic = JAVA_MAGIC;
this.minver = default_class_minver;
this.majver = default_class_majver;
this.version = defaultClassVersion;
this.flags = flags;
this.thisClass = thisClass;
this.superClass = superClass;
......@@ -254,11 +224,8 @@ class Package {
return thisClass.stringValue();
}
int getVersion() {
return (majver << 16) + (char)minver;
}
String getVersionString() {
return versionStringOf(majver, minver);
Version getVersion() {
return this.version;
}
// Note: equals and hashCode are identity-based.
......@@ -1182,13 +1149,6 @@ class Package {
}
}
public static String versionStringOf(int majver, int minver) {
return majver+"."+minver;
}
public static String versionStringOf(int version) {
return versionStringOf(version >>> 16, (char)version);
}
public void stripConstantFields() {
for (Class c : classes) {
for (Iterator<Class.Field> j = c.fields.iterator(); j.hasNext(); ) {
......@@ -1342,4 +1302,75 @@ class Package {
static final List<Class.Field> noFields = Arrays.asList(new Class.Field[0]);
static final List<Class.Method> noMethods = Arrays.asList(new Class.Method[0]);
static final List<InnerClass> noInnerClasses = Arrays.asList(new InnerClass[0]);
protected static final class Version {
public final short major;
public final short minor;
private Version(short major, short minor) {
this.major = major;
this.minor = minor;
}
public String toString() {
return major + "." + minor;
}
public boolean equals(Object that) {
return that instanceof Version
&& major == ((Version)that).major
&& minor == ((Version)that).minor;
}
public int intValue() {
return (major << 16) + minor;
}
public int hashCode() {
return (major << 16) + 7 + minor;
}
public static Version of(int major, int minor) {
return new Version((short)major, (short)minor);
}
public static Version of(byte[] bytes) {
int minor = ((bytes[0] & 0xFF) << 8) | (bytes[1] & 0xFF);
int major = ((bytes[2] & 0xFF) << 8) | (bytes[3] & 0xFF);
return new Version((short)major, (short)minor);
}
public static Version of(int major_minor) {
short minor = (short)major_minor;
short major = (short)(major_minor >>> 16);
return new Version(major, minor);
}
public static Version makeVersion(PropMap props, String partialKey) {
int min = props.getInteger(Utils.COM_PREFIX
+ partialKey + ".minver", -1);
int maj = props.getInteger(Utils.COM_PREFIX
+ partialKey + ".majver", -1);
return min >= 0 && maj >= 0 ? Version.of(maj, min) : null;
}
public byte[] asBytes() {
byte[] bytes = {
(byte) (minor >> 8), (byte) minor,
(byte) (major >> 8), (byte) major
};
return bytes;
}
public int compareTo(Version that) {
return this.intValue() - that.intValue();
}
public boolean lessThan(Version that) {
return compareTo(that) < 0 ;
}
public boolean greaterThan(Version that) {
return compareTo(that) > 0 ;
}
}
}
......@@ -60,6 +60,7 @@ class PackageReader extends BandStructure {
Package pkg;
byte[] bytes;
LimitedBuffer in;
Package.Version packageVersion;
PackageReader(Package pkg, InputStream in) throws IOException {
this.pkg = pkg;
......@@ -220,7 +221,6 @@ class PackageReader extends BandStructure {
final static int MAGIC_BYTES = 4;
void readArchiveMagic() throws IOException {
// Read a minimum of bytes in the first gulp.
in.setReadLimit(MAGIC_BYTES + AH_LENGTH_MIN);
......@@ -230,10 +230,38 @@ class PackageReader extends BandStructure {
archive_magic.readFrom(in);
// read and check magic numbers:
pkg.magic = getMagicInt32();
int magic = getMagicInt32();
if (pkg.magic != magic) {
throw new IOException("Unexpected package magic number: got "
+ magic + "; expected " + pkg.magic);
}
archive_magic.doneDisbursing();
}
// Fixed 6211177, converted to throw IOException
void checkArchiveVersion() throws IOException {
Package.Version versionFound = null;
for (Package.Version v : new Package.Version[] {
JAVA7_PACKAGE_VERSION,
JAVA6_PACKAGE_VERSION,
JAVA5_PACKAGE_VERSION
}) {
if (packageVersion.equals(v)) {
versionFound = v;
break;
}
}
if (versionFound == null) {
String expVer = JAVA7_PACKAGE_VERSION.toString()
+ " OR "
+ JAVA6_PACKAGE_VERSION.toString()
+ " OR "
+ JAVA5_PACKAGE_VERSION.toString();
throw new IOException("Unexpected package minor version: got "
+ packageVersion.toString() + "; expected " + expVer);
}
}
void readArchiveHeader() throws IOException {
// archive_header:
// #archive_minver :UNSIGNED5[1]
......@@ -264,10 +292,11 @@ class PackageReader extends BandStructure {
archive_header_0.expectLength(AH_LENGTH_0);
archive_header_0.readFrom(in);
pkg.package_minver = archive_header_0.getInt();
pkg.package_majver = archive_header_0.getInt();
pkg.checkVersion();
this.initPackageMajver(pkg.package_majver);
int minver = archive_header_0.getInt();
int majver = archive_header_0.getInt();
packageVersion = Package.Version.of(majver, minver);
checkArchiveVersion();
this.initHighestClassVersion(JAVA7_MAX_CLASS_VERSION);
archiveOptions = archive_header_0.getInt();
archive_header_0.doneDisbursing();
......@@ -324,8 +353,9 @@ class PackageReader extends BandStructure {
numInnerClasses = archive_header_1.getInt();
pkg.default_class_minver = (short) archive_header_1.getInt();
pkg.default_class_majver = (short) archive_header_1.getInt();
minver = (short) archive_header_1.getInt();
majver = (short) archive_header_1.getInt();
pkg.defaultClassVersion = Package.Version.of(majver, minver);
numClasses = archive_header_1.getInt();
archive_header_1.doneDisbursing();
......@@ -414,7 +444,7 @@ class PackageReader extends BandStructure {
}
void checkLegacy(String bandname) {
if (this.pkg.package_majver < JAVA7_PACKAGE_MAJOR_VERSION) {
if (packageVersion.lessThan(JAVA7_PACKAGE_VERSION)) {
throw new RuntimeException("unexpected band " + bandname);
}
}
......@@ -947,9 +977,9 @@ class PackageReader extends BandStructure {
name.stringValue(),
layout.stringValue());
// Check layout string for Java 6 extensions.
String pvLayout = def.layoutForPackageMajver(getPackageMajver());
String pvLayout = def.layoutForClassVersion(getHighestClassVersion());
if (!pvLayout.equals(def.layout())) {
throw new IOException("Bad attribute layout in version 150 archive: "+def.layout());
throw new IOException("Bad attribute layout in archive: "+def.layout());
}
this.setAttributeLayoutIndex(def, index);
if (dump != null) dump.println(index+" "+def);
......@@ -1140,12 +1170,9 @@ class PackageReader extends BandStructure {
Attribute retroVersion = cls.getAttribute(attrClassFileVersion);
if (retroVersion != null) {
cls.removeAttribute(retroVersion);
short[] minmajver = parseClassFileVersionAttr(retroVersion);
cls.minver = minmajver[0];
cls.majver = minmajver[1];
cls.version = parseClassFileVersionAttr(retroVersion);
} else {
cls.minver = pkg.default_class_minver;
cls.majver = pkg.default_class_majver;
cls.version = pkg.defaultClassVersion;
}
// Replace null SourceFile by "obvious" string.
......
......@@ -49,12 +49,13 @@ import static com.sun.java.util.jar.pack.Constants.*;
class PackageWriter extends BandStructure {
Package pkg;
OutputStream finalOut;
Package.Version packageVersion;
PackageWriter(Package pkg, OutputStream out) throws IOException {
this.pkg = pkg;
this.finalOut = out;
// Caller has specified archive version in the package:
initPackageMajver(pkg.package_majver);
// Caller has specified maximum class file version in the package:
initHighestClassVersion(pkg.getHighestClassVersion());
}
void write() throws IOException {
......@@ -118,6 +119,57 @@ class PackageWriter extends BandStructure {
collectInnerClasses();
}
/*
* Convenience function to choose an archive version based
* on the class file versions observed within the archive
* or set the user defined version preset via properties.
*/
void chooseDefaultPackageVersion() throws IOException {
if (pkg.packageVersion != null) {
packageVersion = pkg.packageVersion;
if (verbose > 0) {
Utils.log.info("package version overridden with: "
+ packageVersion);
}
return;
}
Package.Version highV = getHighestClassVersion();
// set the package version now
if (highV.lessThan(JAVA6_MAX_CLASS_VERSION)) {
// There are only old classfiles in this segment or resources
packageVersion = JAVA5_PACKAGE_VERSION;
} else if (highV.equals(JAVA6_MAX_CLASS_VERSION) ||
(highV.equals(JAVA7_MAX_CLASS_VERSION) && !pkg.cp.haveExtraTags())) {
// force down the package version if we have jdk7 classes without
// any Indy references, this is because jdk7 class file (52.0) without
// Indy is identical to jdk6 class file (51.0).
packageVersion = JAVA6_PACKAGE_VERSION;
} else {
// Normal case. Use the newest archive format, when available
packageVersion = JAVA7_PACKAGE_VERSION;
}
if (verbose > 0) {
Utils.log.info("Highest version class file: " + highV
+ " package version: " + packageVersion);
}
}
void checkVersion() throws IOException {
assert(packageVersion != null);
if (packageVersion.lessThan(JAVA7_PACKAGE_VERSION)) {
// this bit was reserved for future use in previous versions
if (testBit(archiveOptions, AO_HAVE_CP_EXTRAS)) {
throw new IOException("Format bits for Java 7 must be zero in previous releases");
}
}
if (testBit(archiveOptions, AO_UNUSED_MBZ)) {
throw new IOException("High archive option bits are reserved and must be zero: " + Integer.toHexString(archiveOptions));
}
}
void setArchiveOptions() {
// Decide on some archive options early.
// Does not decide on: AO_HAVE_SPECIAL_FORMATS,
......@@ -168,11 +220,11 @@ class PackageWriter extends BandStructure {
}
}
// Decide on default version number (majority rule).
Map<Integer, int[]> verCounts = new HashMap<>();
Map<Package.Version, int[]> verCounts = new HashMap<>();
int bestCount = 0;
int bestVersion = -1;
Package.Version bestVersion = null;
for (Class cls : pkg.classes) {
int version = cls.getVersion();
Package.Version version = cls.getVersion();
int[] var = verCounts.get(version);
if (var == null) {
var = new int[1];
......@@ -186,28 +238,22 @@ class PackageWriter extends BandStructure {
}
}
verCounts.clear();
if (bestVersion == -1) bestVersion = 0; // degenerate case
int bestMajver = (char)(bestVersion >>> 16);
int bestMinver = (char)(bestVersion);
pkg.default_class_majver = (short) bestMajver;
pkg.default_class_minver = (short) bestMinver;
String bestVerStr = Package.versionStringOf(bestMajver, bestMinver);
if (bestVersion == null) bestVersion = JAVA_MIN_CLASS_VERSION; // degenerate case
pkg.defaultClassVersion = bestVersion;
if (verbose > 0)
Utils.log.info("Consensus version number in segment is "+bestVerStr);
Utils.log.info("Consensus version number in segment is " + bestVersion);
if (verbose > 0)
Utils.log.info("Highest version number in segment is "+
Package.versionStringOf(pkg.getHighestClassVersion()));
Utils.log.info("Highest version number in segment is "
+ pkg.getHighestClassVersion());
// Now add explicit pseudo-attrs. to classes with odd versions.
for (Class cls : pkg.classes) {
if (cls.getVersion() != bestVersion) {
Attribute a = makeClassFileVersionAttr(cls.minver, cls.majver);
if (!cls.getVersion().equals(bestVersion)) {
Attribute a = makeClassFileVersionAttr(cls.getVersion());
if (verbose > 1) {
String clsVer = cls.getVersionString();
String pkgVer = bestVerStr;
Utils.log.fine("Version "+clsVer+" of "+cls
+" doesn't match package version "
+pkgVer);
Utils.log.fine("Version "+cls.getVersion() + " of " + cls
+ " doesn't match package version "
+ bestVersion);
}
// Note: Does not add in "natural" order. (Who cares?)
cls.addAttribute(a);
......@@ -252,7 +298,7 @@ class PackageWriter extends BandStructure {
}
void writeFileHeader() throws IOException {
pkg.checkVersion();
chooseDefaultPackageVersion();
writeArchiveMagic();
writeArchiveHeader();
}
......@@ -322,12 +368,13 @@ class PackageWriter extends BandStructure {
if (haveCPExtra)
headerSizeForDebug += AH_CP_EXTRA_LEN;
assert(pkg.package_majver > 0); // caller must specify!
archive_header_0.putInt(pkg.package_minver);
archive_header_0.putInt(pkg.package_majver);
// the archiveOptions are all initialized, sanity check now!.
checkVersion();
archive_header_0.putInt(packageVersion.minor);
archive_header_0.putInt(packageVersion.major);
if (verbose > 0)
Utils.log.info("Package Version for this segment:"+
Package.versionStringOf(pkg.getPackageVersion()));
Utils.log.info("Package Version for this segment:" + packageVersion);
archive_header_0.putInt(archiveOptions); // controls header format
assert(archive_header_0.length() == AH_LENGTH_0);
......@@ -361,8 +408,8 @@ class PackageWriter extends BandStructure {
writeConstantPoolCounts(haveNumbers, haveCPExtra);
archive_header_1.putInt(pkg.getAllInnerClasses().size());
archive_header_1.putInt(pkg.default_class_minver);
archive_header_1.putInt(pkg.default_class_majver);
archive_header_1.putInt(pkg.defaultClassVersion.minor);
archive_header_1.putInt(pkg.defaultClassVersion.major);
archive_header_1.putInt(pkg.classes.size());
// Sanity: Make sure we came out to 29 (less optional fields):
......@@ -892,7 +939,7 @@ class PackageWriter extends BandStructure {
if (predefIndex == null) {
// Make sure the package CP can name the local attribute.
Entry ne = ConstantPool.getUtf8Entry(def.name());
String layout = def.layoutForPackageMajver(getPackageMajver());
String layout = def.layoutForClassVersion(getHighestClassVersion());
Entry le = ConstantPool.getUtf8Entry(layout);
requiredEntries.add(ne);
requiredEntries.add(le);
......@@ -988,7 +1035,7 @@ class PackageWriter extends BandStructure {
assert((header & ADH_CONTEXT_MASK) == def.ctype());
attr_definition_headers.putByte(header);
attr_definition_name.putRef(ConstantPool.getUtf8Entry(def.name()));
String layout = def.layoutForPackageMajver(getPackageMajver());
String layout = def.layoutForClassVersion(getHighestClassVersion());
attr_definition_layout.putRef(ConstantPool.getUtf8Entry(layout));
// Check that we are transmitting that correct attribute index:
boolean debug = false;
......@@ -1542,8 +1589,8 @@ class PackageWriter extends BandStructure {
break;
default:
// CONSTANT_MethodHandle, etc.
if (getPackageMajver() < JAVA7_PACKAGE_MAJOR_VERSION) {
throw new IOException("bad package major version for Java 7 ldc");
if (getHighestClassVersion().lessThan(JAVA7_MAX_CLASS_VERSION)) {
throw new IOException("bad class file major version for Java 7 ldc");
}
bc_which = bc_loadablevalueref;
switch (bc) {
......@@ -1581,8 +1628,8 @@ class PackageWriter extends BandStructure {
// Make sure the discarded bytes are sane:
assert(i.getConstant() == (1+((MemberEntry)ref).descRef.typeRef.computeSize(true)) << 8);
} else if (bc == _invokedynamic) {
if (getPackageMajver() < JAVA7_PACKAGE_MAJOR_VERSION) {
throw new IOException("bad package major version for Java 7 invokedynamic");
if (getHighestClassVersion().lessThan(JAVA7_MAX_CLASS_VERSION)) {
throw new IOException("bad class major version for Java 7 invokedynamic");
}
assert(i.getLength() == 5);
assert(i.getConstant() == 0); // last 2 bytes MBZ
......
/*
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -164,8 +164,11 @@ public class PackerImpl extends TLGlobals implements Pack200.Packer {
if (verbose > 0) Utils.log.info(props.toString());
}
// Here's where the bits are collected before getting packed:
final Package pkg = new Package();
// Here's where the bits are collected before getting packed, we also
// initialize the version numbers now.
final Package pkg = new Package(Package.Version.makeVersion(props, "min.class"),
Package.Version.makeVersion(props, "max.class"),
Package.Version.makeVersion(props, "package"));
final String unknownAttrCommand;
{
......@@ -279,23 +282,6 @@ public class PackerImpl extends TLGlobals implements Pack200.Packer {
if (verbose > 0) Utils.log.info("passFiles = " + passFiles);
}
{
// Fill in permitted range of major/minor version numbers.
int ver;
if ((ver = props.getInteger(Utils.COM_PREFIX+"min.class.majver")) != 0)
pkg.min_class_majver = (short) ver;
if ((ver = props.getInteger(Utils.COM_PREFIX+"min.class.minver")) != 0)
pkg.min_class_minver = (short) ver;
if ((ver = props.getInteger(Utils.COM_PREFIX+"max.class.majver")) != 0)
pkg.max_class_majver = (short) ver;
if ((ver = props.getInteger(Utils.COM_PREFIX+"max.class.minver")) != 0)
pkg.max_class_minver = (short) ver;
if ((ver = props.getInteger(Utils.COM_PREFIX+"package.minver")) != 0)
pkg.package_minver = (short) ver;
if ((ver = props.getInteger(Utils.COM_PREFIX+"package.majver")) != 0)
pkg.package_majver = (short) ver;
}
{
// Hook for testing: Forces use of special archive modes.
int opt = props.getInteger(Utils.COM_PREFIX+"archive.options");
......@@ -603,9 +589,6 @@ public class PackerImpl extends TLGlobals implements Pack200.Packer {
if (props.getBoolean(Utils.COM_PREFIX+"strip.exceptions")) pkg.stripAttributeKind("Exceptions");
if (props.getBoolean(Utils.COM_PREFIX+"strip.innerclasses")) pkg.stripAttributeKind("InnerClasses");
// Must choose an archive version; PackageWriter does not.
if (pkg.package_majver <= 0) pkg.choosePackageVersion();
PackageWriter pw = new PackageWriter(pkg, out);
pw.archiveNextCount = nextCount;
pw.write();
......
/*
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -193,13 +193,18 @@ final class PropMap implements SortedMap<String, String> {
boolean setBoolean(String s, boolean val) {
return toBoolean(setProperty(s, String.valueOf(val)));
}
int toInteger(String val) {
if (val == null) return 0;
return toInteger(val, 0);
}
int toInteger(String val, int def) {
if (val == null) return def;
if (Pack200.Packer.TRUE.equals(val)) return 1;
if (Pack200.Packer.FALSE.equals(val)) return 0;
return Integer.parseInt(val);
}
int getInteger(String s, int def) {
return toInteger(getProperty(s), def);
}
int getInteger(String s) {
return toInteger(getProperty(s));
}
......
......@@ -25,12 +25,6 @@
package com.sun.java.util.jar.pack;
import com.sun.java.util.jar.pack.ConstantPool.ClassEntry;
import com.sun.java.util.jar.pack.ConstantPool.DescriptorEntry;
import com.sun.java.util.jar.pack.ConstantPool.LiteralEntry;
import com.sun.java.util.jar.pack.ConstantPool.MemberEntry;
import com.sun.java.util.jar.pack.ConstantPool.SignatureEntry;
import com.sun.java.util.jar.pack.ConstantPool.Utf8Entry;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
......@@ -38,9 +32,8 @@ import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Collections;
import java.util.Date;
import java.util.Enumeration;
import java.util.Map;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.JarInputStream;
......@@ -211,9 +204,7 @@ class Utils {
static String getVersionString() {
return "Pack200, Vendor: " +
System.getProperty("java.vendor") +
", Version: " +
Constants.JAVA6_PACKAGE_MAJOR_VERSION + "." +
Constants.JAVA6_PACKAGE_MINOR_VERSION;
", Version: " + Constants.MAX_PACKAGE_VERSION;
}
static void markJarFile(JarOutputStream out) throws IOException {
......@@ -240,8 +231,7 @@ class Utils {
}
static void copyJarFile(JarFile in, JarOutputStream out) throws IOException {
byte[] buffer = new byte[1 << 14];
for (Enumeration<JarEntry> e = in.entries(); e.hasMoreElements(); ) {
JarEntry je = e.nextElement();
for (JarEntry je : Collections.list(in.entries())) {
out.putNextEntry(je);
InputStream ein = in.getInputStream(je);
for (int nr; 0 < (nr = ein.read(buffer)); ) {
......
/*
* Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -30,7 +30,6 @@ package java.lang;
* inappropriate argument.
*
* @author unascribed
* @see java.lang.Thread#setPriority(int)
* @since JDK1.0
*/
public
......
......@@ -381,7 +381,7 @@ public final class Integer extends Number implements Comparable<Integer> {
int size = (i < 0) ? stringSize(-i) + 1 : stringSize(i);
char[] buf = new char[size];
getChars(i, size, buf);
return new String(0, size, buf);
return new String(buf, true);
}
/**
......
......@@ -373,7 +373,7 @@ public final class Long extends Number implements Comparable<Long> {
int size = (i < 0) ? stringSize(-i) + 1 : stringSize(i);
char[] buf = new char[size];
getChars(i, size, buf);
return new String(0, size, buf);
return new String(buf, true);
}
/**
......
/*
* Copyright (c) 1994, 2001, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -31,7 +31,7 @@ package java.lang;
* have the appropriate format.
*
* @author unascribed
* @see java.lang.Integer#toString()
* @see java.lang.Integer#parseInt(String)
* @since JDK1.0
*/
public
......
......@@ -250,6 +250,7 @@ class StringCoding {
static char[] decode(byte[] ba, int off, int len) {
String csn = Charset.defaultCharset().name();
try {
// use charset name decode() variant which provides caching.
return decode(csn, ba, off, len);
} catch (UnsupportedEncodingException x) {
warnUnsupportedCharset(csn);
......@@ -382,6 +383,7 @@ class StringCoding {
static byte[] encode(char[] ca, int off, int len) {
String csn = Charset.defaultCharset().name();
try {
// use charset name encode() variant which provides caching.
return encode(csn, ca, off, len);
} catch (UnsupportedEncodingException x) {
warnUnsupportedCharset(csn);
......
/*
* Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -658,7 +658,7 @@ public abstract class Signature extends SignatureSpi {
throws SignatureException {
if (state == VERIFY) {
if ((signature == null) || (offset < 0) || (length < 0) ||
(offset + length > signature.length)) {
(length > signature.length - offset)) {
throw new IllegalArgumentException("Bad arguments");
}
......
/*
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -45,15 +45,28 @@ import sun.security.jca.GetInstance.Instance;
* one of the static <code>getInstance</code> methods, passing in the
* algorithm name of the <code>CertPathBuilder</code> desired and optionally
* the name of the provider desired.
* <p>
* Once a <code>CertPathBuilder</code> object has been created, certification
*
* <p>Once a <code>CertPathBuilder</code> object has been created, certification
* paths can be constructed by calling the {@link #build build} method and
* passing it an algorithm-specific set of parameters. If successful, the
* result (including the <code>CertPath</code> that was built) is returned
* in an object that implements the <code>CertPathBuilderResult</code>
* interface.
*
* <p> Every implementation of the Java platform is required to support the
* <p>The {@link #getRevocationChecker} method allows an application to specify
* additional algorithm-specific parameters and options used by the
* {@code CertPathBuilder} when checking the revocation status of certificates.
* Here is an example demonstrating how it is used with the PKIX algorithm:
*
* <pre>
* CertPathBuilder cpb = CertPathBuilder.getInstance("PKIX");
* PKIXRevocationChecker rc = (PKIXRevocationChecker)cpb.getRevocationChecker();
* rc.setOptions(EnumSet.of(Option.PREFER_CRLS));
* params.addCertPathChecker(rc);
* CertPathBuilderResult cpbr = cpb.build(params);
* </pre>
*
* <p>Every implementation of the Java platform is required to support the
* following standard <code>CertPathBuilder</code> algorithm:
* <ul>
* <li><tt>PKIX</tt></li>
......@@ -96,10 +109,9 @@ public class CertPathBuilder {
* </pre>
*/
private static final String CPB_TYPE = "certpathbuilder.type";
private static final Debug debug = Debug.getInstance("certpath");
private CertPathBuilderSpi builderSpi;
private Provider provider;
private String algorithm;
private final CertPathBuilderSpi builderSpi;
private final Provider provider;
private final String algorithm;
/**
* Creates a <code>CertPathBuilder</code> object of the given algorithm,
......@@ -290,15 +302,30 @@ public class CertPathBuilder {
* if no such property exists.
*/
public final static String getDefaultType() {
String cpbtype;
cpbtype = AccessController.doPrivileged(new PrivilegedAction<String>() {
public String run() {
return Security.getProperty(CPB_TYPE);
}
});
if (cpbtype == null) {
cpbtype = "PKIX";
}
return cpbtype;
String cpbtype =
AccessController.doPrivileged(new PrivilegedAction<String>() {
public String run() {
return Security.getProperty(CPB_TYPE);
}
});
return (cpbtype == null) ? "PKIX" : cpbtype;
}
/**
* Returns a {@code CertPathChecker} that the encapsulated
* {@code CertPathBuilderSpi} implementation uses to check the revocation
* status of certificates. A PKIX implementation returns objects of
* type {@code PKIXRevocationChecker}.
*
* <p>The primary purpose of this method is to allow callers to specify
* additional input parameters and options specific to revocation checking.
* See the class description for an example.
*
* @throws UnsupportedOperationException if the service provider does not
* support this method
* @since 1.8
*/
public final CertPathChecker getRevocationChecker() {
return builderSpi.engineGetRevocationChecker();
}
}
/*
* Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -72,4 +72,25 @@ public abstract class CertPathBuilderSpi {
*/
public abstract CertPathBuilderResult engineBuild(CertPathParameters params)
throws CertPathBuilderException, InvalidAlgorithmParameterException;
/**
* Returns a {@code CertPathChecker} that this implementation uses to
* check the revocation status of certificates. A PKIX implementation
* returns objects of type {@code PKIXRevocationChecker}.
*
* <p>The primary purpose of this method is to allow callers to specify
* additional input parameters and options specific to revocation checking.
* See the class description of {@code CertPathBuilder} for an example.
*
* <p>This method was added to version 1.8 of the Java Platform Standard
* Edition. In order to maintain backwards compatibility with existing
* service providers, this method cannot be abstract and by default throws
* an {@code UnsupportedOperationException}.
*
* @throws UnsupportedOperationException if this method is not supported
* @since 1.8
*/
public CertPathChecker engineGetRevocationChecker() {
throw new UnsupportedOperationException();
}
}
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.security.cert;
/**
* <p>Performs one or more checks on each {@code Certificate} of a
* {@code CertPath}.
*
* <p>A {@code CertPathChecker} implementation is typically created to extend
* a certification path validation algorithm. For example, an implementation
* may check for and process a critical private extension of each certificate
* in a certification path.
*
* @since 1.8
*/
public interface CertPathChecker {
/**
* Initializes the internal state of this {@code CertPathChecker}.
*
* <p>The {@code forward} flag specifies the order that certificates will
* be passed to the {@link #check check} method (forward or reverse).
*
* @param forward the order that certificates are presented to the
* {@code check} method. If {@code true}, certificates are
* presented from target to trust anchor (forward); if
* {@code false}, from trust anchor to target (reverse).
* @throws CertPathValidatorException if this {@code CertPathChecker} is
* unable to check certificates in the specified order
*/
void init(boolean forward) throws CertPathValidatorException;
/**
* Indicates if forward checking is supported. Forward checking refers
* to the ability of the {@code CertPathChecker} to perform its checks
* when certificates are presented to the {@code check} method in the
* forward direction (from target to trust anchor).
*
* @return {@code true} if forward checking is supported, {@code false}
* otherwise
*/
boolean isForwardCheckingSupported();
/**
* Performs the check(s) on the specified certificate using its internal
* state. The certificates are presented in the order specified by the
* {@code init} method.
*
* @param cert the {@code Certificate} to be checked
* @throws CertPathValidatorException if the specified certificate does
* not pass the check
*/
void check(Certificate cert) throws CertPathValidatorException;
}
/*
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -46,15 +46,29 @@ import sun.security.jca.GetInstance.Instance;
* call one of the static <code>getInstance</code> methods, passing in the
* algorithm name of the <code>CertPathValidator</code> desired and
* optionally the name of the provider desired.
* <p>
* Once a <code>CertPathValidator</code> object has been created, it can
*
* <p>Once a <code>CertPathValidator</code> object has been created, it can
* be used to validate certification paths by calling the {@link #validate
* validate} method and passing it the <code>CertPath</code> to be validated
* and an algorithm-specific set of parameters. If successful, the result is
* returned in an object that implements the
* <code>CertPathValidatorResult</code> interface.
*
* <p> Every implementation of the Java platform is required to support the
* <p>The {@link #getRevocationChecker} method allows an application to specify
* additional algorithm-specific parameters and options used by the
* {@code CertPathValidator} when checking the revocation status of
* certificates. Here is an example demonstrating how it is used with the PKIX
* algorithm:
*
* <pre>
* CertPathValidator cpv = CertPathValidator.getInstance("PKIX");
* PKIXRevocationChecker rc = (PKIXRevocationChecker)cpv.getRevocationChecker();
* rc.setOptions(EnumSet.of(Option.SOFT_FAIL));
* params.addCertPathChecker(rc);
* CertPathValidatorResult cpvr = cpv.validate(path, params);
* </pre>
*
* <p>Every implementation of the Java platform is required to support the
* following standard <code>CertPathValidator</code> algorithm:
* <ul>
* <li><tt>PKIX</tt></li>
......@@ -96,10 +110,9 @@ public class CertPathValidator {
* </pre>
*/
private static final String CPV_TYPE = "certpathvalidator.type";
private static final Debug debug = Debug.getInstance("certpath");
private CertPathValidatorSpi validatorSpi;
private Provider provider;
private String algorithm;
private final CertPathValidatorSpi validatorSpi;
private final Provider provider;
private final String algorithm;
/**
* Creates a <code>CertPathValidator</code> object of the given algorithm,
......@@ -301,15 +314,30 @@ public class CertPathValidator {
* if no such property exists.
*/
public final static String getDefaultType() {
String cpvtype;
cpvtype = AccessController.doPrivileged(new PrivilegedAction<String>() {
public String run() {
return Security.getProperty(CPV_TYPE);
}
});
if (cpvtype == null) {
cpvtype = "PKIX";
}
return cpvtype;
String cpvtype =
AccessController.doPrivileged(new PrivilegedAction<String>() {
public String run() {
return Security.getProperty(CPV_TYPE);
}
});
return (cpvtype == null) ? "PKIX" : cpvtype;
}
/**
* Returns a {@code CertPathChecker} that the encapsulated
* {@code CertPathValidatorSpi} implementation uses to check the revocation
* status of certificates. A PKIX implementation returns objects of
* type {@code PKIXRevocationChecker}.
*
* <p>The primary purpose of this method is to allow callers to specify
* additional input parameters and options specific to revocation checking.
* See the class description for an example.
*
* @throws UnsupportedOperationException if the service provider does not
* support this method
* @since 1.8
*/
public final CertPathChecker getRevocationChecker() {
return validatorSpi.engineGetRevocationChecker();
}
}
/*
* Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -82,4 +82,25 @@ public abstract class CertPathValidatorSpi {
public abstract CertPathValidatorResult
engineValidate(CertPath certPath, CertPathParameters params)
throws CertPathValidatorException, InvalidAlgorithmParameterException;
/**
* Returns a {@code CertPathChecker} that this implementation uses to
* check the revocation status of certificates. A PKIX implementation
* returns objects of type {@code PKIXRevocationChecker}.
*
* <p>The primary purpose of this method is to allow callers to specify
* additional input parameters and options specific to revocation checking.
* See the class description of {@code CertPathValidator} for an example.
*
* <p>This method was added to version 1.8 of the Java Platform Standard
* Edition. In order to maintain backwards compatibility with existing
* service providers, this method cannot be abstract and by default throws
* an {@code UnsupportedOperationException}.
*
* @throws UnsupportedOperationException if this method is not supported
* @since 1.8
*/
public CertPathChecker engineGetRevocationChecker() {
throw new UnsupportedOperationException();
}
}
/*
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -87,7 +87,8 @@ import java.util.Set;
* @author Yassir Elley
* @author Sean Mullan
*/
public abstract class PKIXCertPathChecker implements Cloneable {
public abstract class PKIXCertPathChecker
implements CertPathChecker, Cloneable {
/**
* Default constructor.
......@@ -111,6 +112,7 @@ public abstract class PKIXCertPathChecker implements Cloneable {
* the specified order; it should never be thrown if the forward flag
* is false since reverse checking must be supported
*/
@Override
public abstract void init(boolean forward)
throws CertPathValidatorException;
......@@ -123,6 +125,7 @@ public abstract class PKIXCertPathChecker implements Cloneable {
* @return <code>true</code> if forward checking is supported,
* <code>false</code> otherwise
*/
@Override
public abstract boolean isForwardCheckingSupported();
/**
......@@ -162,6 +165,17 @@ public abstract class PKIXCertPathChecker implements Cloneable {
Collection<String> unresolvedCritExts)
throws CertPathValidatorException;
/**
* {@inheritDoc}
*
* <p>This implementation calls
* {@code check(cert, java.util.Collections.<String>emptySet())}.
*/
@Override
public void check(Certificate cert) throws CertPathValidatorException {
check(cert, java.util.Collections.<String>emptySet());
}
/**
* Returns a clone of this object. Calls the <code>Object.clone()</code>
* method.
......@@ -170,6 +184,7 @@ public abstract class PKIXCertPathChecker implements Cloneable {
*
* @return a copy of this <code>PKIXCertPathChecker</code>
*/
@Override
public Object clone() {
try {
return super.clone();
......
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.security.cert;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
/**
* A {@code PKIXCertPathChecker} for checking the revocation status of
* certificates with the PKIX algorithm.
*
* <p>A {@code PKIXRevocationChecker} checks the revocation status of
* certificates with the Online Certificate Status Protocol (OCSP) or
* Certificate Revocation Lists (CRLs). OCSP is described in RFC 2560 and
* is a network protocol for determining the status of a certificate. A CRL
* is a time-stamped list identifying revoked certificates, and RFC 5280
* describes an algorithm for determining the revocation status of certificates
* using CRLs.
*
* <p>Each {@code PKIXRevocationChecker} must be able to check the revocation
* status of certificates with OCSP and CRLs. By default, OCSP is the
* preferred mechanism for checking revocation status, with CRLs as the
* fallback mechanism. However, this preference can be switched to CRLs with
* the {@link Option.PREFER_CRLS} option.
*
* <p>A {@code PKIXRevocationChecker} is obtained by calling the
* {@link CertPathValidator#getRevocationChecker getRevocationChecker} method
* of a PKIX {@code CertPathValidator}. Additional parameters and options
* specific to revocation can be set (by calling {@link #setOCSPResponder}
* method for instance). The {@code PKIXRevocationChecker} is added to
* a {@code PKIXParameters} object using the
* {@link PKIXParameters#addCertPathChecker addCertPathChecker}
* or {@link PKIXParameters#setCertPathCheckers setCertPathCheckers} method,
* and then the {@code PKIXParameters} is passed along with the {@code CertPath}
* to be validated to the {@link CertPathValidator#validate validate} method
* of a PKIX {@code CertPathValidator}. When supplying a revocation checker in
* this manner, do not enable the default revocation checking mechanism (by
* calling {@link PKIXParameters#setRevocationEnabled}.
*
* <p>Note that when a {@code PKIXRevocationChecker} is added to
* {@code PKIXParameters}, it clones the {@code PKIXRevocationChecker};
* thus any subsequent modifications to the {@code PKIXRevocationChecker}
* have no effect.
*
* <p>Any parameter that is not set (or is set to {@code null}) will be set to
* the default value for that parameter.
*
* <p><b>Concurrent Access</b>
*
* <p>Unless otherwise specified, the methods defined in this class are not
* thread-safe. Multiple threads that need to access a single object
* concurrently should synchronize amongst themselves and provide the
* necessary locking. Multiple threads each manipulating separate objects
* need not synchronize.
*
* @since 1.8
*/
public abstract class PKIXRevocationChecker extends PKIXCertPathChecker {
private URI ocspResponder;
private X509Certificate ocspResponderCert;
private List<Extension> ocspExtensions = Collections.<Extension>emptyList();
private Map<X509Certificate, byte[]> ocspStapled = Collections.emptyMap();
private Set<Option> options = Collections.emptySet();
protected PKIXRevocationChecker() {}
/**
* Sets the URI that identifies the location of the OCSP responder. This
* overrides the {@code ocsp.responderURL} security property and any
* responder specified in a certificate's Authority Information Access
* Extension, as defined in RFC 5280.
*
* @param uri the responder URI
*/
public void setOCSPResponder(URI uri) {
this.ocspResponder = uri;
}
/**
* Gets the URI that identifies the location of the OCSP responder. This
* overrides the {@code ocsp.responderURL} security property. If this
* parameter or the {@code ocsp.responderURL} property is not set, the
* location is determined from the certificate's Authority Information
* Access Extension, as defined in RFC 5280.
*
* @return the responder URI, or {@code null} if not set
*/
public URI getOCSPResponder() {
return ocspResponder;
}
/**
* Sets the OCSP responder's certificate. This overrides the
* {@code ocsp.responderCertSubjectName},
* {@code ocsp.responderCertIssuerName},
* and {@code ocsp.responderCertSerialNumber} security properties.
*
* @param cert the responder's certificate
*/
public void setOCSPResponderCert(X509Certificate cert) {
this.ocspResponderCert = cert;
}
/**
* Gets the OCSP responder's certificate. This overrides the
* {@code ocsp.responderCertSubjectName},
* {@code ocsp.responderCertIssuerName},
* and {@code ocsp.responderCertSerialNumber} security properties. If this
* parameter or the aforementioned properties are not set, then the
* responder's certificate is determined as specified in RFC 2560.
*
* @return the responder's certificate, or {@code null} if not set
*/
public X509Certificate getOCSPResponderCert() {
return ocspResponderCert;
}
// request extensions; single extensions not supported
/**
* Sets the optional OCSP request extensions.
*
* @param extensions a list of extensions. The list is copied to protect
* against subsequent modification.
*/
public void setOCSPExtensions(List<Extension> extensions)
{
this.ocspExtensions = (extensions == null)
? Collections.<Extension>emptyList()
: new ArrayList<Extension>(extensions);
}
/**
* Gets the optional OCSP request extensions.
*
* @return an unmodifiable list of extensions. Returns an empty list if no
* extensions have been specified.
*/
public List<Extension> getOCSPExtensions() {
return Collections.unmodifiableList(ocspExtensions);
}
/**
* Sets the stapled OCSP responses. These responses are used to determine
* the revocation status of the specified certificates when OCSP is used.
*
* @param responses a map of stapled OCSP responses. Each key is an
* {@code X509Certificate} that maps to the corresponding
* DER-encoded OCSP response for that certificate. A deep copy of
* the map is performed to protect against subsequent modification.
*/
public void setOCSPStapledResponses(Map<X509Certificate, byte[]> responses)
{
if (responses == null) {
this.ocspStapled = Collections.<X509Certificate, byte[]>emptyMap();
} else {
Map<X509Certificate, byte[]> copy = new HashMap<>(responses.size());
for (Map.Entry<X509Certificate, byte[]> e : responses.entrySet()) {
copy.put(e.getKey(), e.getValue().clone());
}
this.ocspStapled = copy;
}
}
/**
* Gets the stapled OCSP responses. These responses are used to determine
* the revocation status of the specified certificates when OCSP is used.
*
* @return a map of stapled OCSP responses. Each key is an
* {@code X509Certificate} that maps to the corresponding
* DER-encoded OCSP response for that certificate. A deep copy of
* the map is returned to protect against subsequent modification.
* Returns an empty map if no responses have been specified.
*/
public Map<X509Certificate, byte[]> getOCSPStapledResponses() {
Map<X509Certificate, byte[]> copy = new HashMap<>(ocspStapled.size());
for (Map.Entry<X509Certificate, byte[]> e : ocspStapled.entrySet()) {
copy.put(e.getKey(), e.getValue().clone());
}
return copy;
}
/**
* Sets the revocation options.
*
* @param options a set of revocation options. The set is copied to protect
* against subsequent modification.
*/
public void setOptions(Set<Option> options) {
this.options = (options == null)
? Collections.<Option>emptySet()
: new HashSet<Option>(options);
}
/**
* Gets the revocation options.
*
* @return an unmodifiable set of revocation options, or an empty set if
* none are specified
*/
public Set<Option> getOptions() {
return Collections.unmodifiableSet(options);
}
@Override
public Object clone() {
PKIXRevocationChecker copy = (PKIXRevocationChecker)super.clone();
copy.ocspExtensions = new ArrayList<>(ocspExtensions);
copy.ocspStapled = new HashMap<>(ocspStapled);
// deep-copy the encoded stapled responses, since they are mutable
for (Map.Entry<X509Certificate, byte[]> entry :
copy.ocspStapled.entrySet())
{
byte[] encoded = entry.getValue();
entry.setValue(encoded.clone());
}
copy.options = new HashSet<>(options);
return copy;
}
/**
* Various revocation options that can be specified for the revocation
* checking mechanism.
*/
public enum Option {
/**
* Only check the revocation status of end-entity certificates.
*/
ONLY_END_ENTITY,
/**
* Prefer CRLs to OSCP. The default behavior is to prefer OCSP. Each
* PKIX implementation should document further details of their
* specific preference rules and fallback policies.
*/
PREFER_CRLS,
/**
* Ignore network failures. The default behavior is to consider it a
* failure if the revocation status of a certificate cannot be obtained
* due to a network error. This option applies to both OCSP and CRLs.
*/
SOFT_FAIL
}
}
<!--
Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
......@@ -38,8 +38,10 @@ certificates and X.509 v2 CRLs.
<li><a href="{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
<b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
Cryptography Architecture (JCA) Reference Guide</b></a>
<li>RFC 3280: Internet X.509 Public Key Infrastructure Certificate and
<li>RFC 5280: Internet X.509 Public Key Infrastructure Certificate and
Certificate Revocation List (CRL) Profile
<li>RFC 2560: X.509 Internet Public Key Infrastructure Online Certificate
Status Protocol - OCSP
<li><a href="{@docRoot}/../technotes/guides/security/StandardNames.html">
<b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
Cryptography Architecture Standard Algorithm Name
......@@ -50,8 +52,8 @@ certificates and X.509 v2 CRLs.
For information about X.509 certificates and CRLs, please see:
<ul>
<li><a href="http://www.ietf.org/rfc/rfc3280.txt">
http://www.ietf.org/rfc/rfc3280.txt</a>
<li><a href="http://www.ietf.org/rfc/rfc5280.txt">
http://www.ietf.org/rfc/rfc5280.txt</a>
<li><a href=
"{@docRoot}/../technotes/guides/security/certpath/CertPathProgGuide.html">
<b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
......
......@@ -145,9 +145,9 @@ class BreakDictionary {
BufferedInputStream in;
try {
in = (BufferedInputStream)AccessController.doPrivileged(
new PrivilegedExceptionAction() {
public Object run() throws Exception {
in = AccessController.doPrivileged(
new PrivilegedExceptionAction<BufferedInputStream>() {
public BufferedInputStream run() throws Exception {
return new BufferedInputStream(getClass().getResourceAsStream("/sun/text/resources/" + dictionaryName));
}
}
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册