1 /*
2 * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
138 // immediately after the _header field. This information is used only when
139 // checking the validity of the archive and is deallocated after the archive is loaded.
140 //
141 // Note that the _paths_misc_info does NOT include information for JAR files
142 // that existed during dump time. Their information is stored in _classpath_entry_table.
143 int _paths_misc_info_size;
144
145 // The following is a table of all the class path entries that were used
146 // during dumping. At run time, we require these files to exist and have the same
147 // size/modification time, or else the archive will refuse to load.
148 //
149 // All of these entries must be JAR files. The dumping process would fail if a non-empty
150 // directory was specified in the classpaths. If an empty directory was specified
151 // it is checked by the _paths_misc_info as described above.
152 //
153 // FIXME -- if JAR files in the tail of the list were specified but not used during dumping,
154 // they should be removed from this table, to save space and to avoid spurious
155 // loading failures during runtime.
156 int _classpath_entry_table_size;
157 size_t _classpath_entry_size;
158 SharedClassPathEntry* _classpath_entry_table;
159
160 char* region_addr(int idx);
161
162 virtual bool validate();
163 virtual void populate(FileMapInfo* info, size_t alignment);
164 int compute_crc();
165 };
166
167 FileMapHeader * _header;
168
169 const char* _full_path;
170 char* _paths_misc_info;
171
172 static FileMapInfo* _current_info;
173
174 bool init_from_file(int fd);
175 void align_file_position();
176 bool validate_header_impl();
177
|
1 /*
2 * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
138 // immediately after the _header field. This information is used only when
139 // checking the validity of the archive and is deallocated after the archive is loaded.
140 //
141 // Note that the _paths_misc_info does NOT include information for JAR files
142 // that existed during dump time. Their information is stored in _classpath_entry_table.
143 int _paths_misc_info_size;
144
145 // The following is a table of all the class path entries that were used
146 // during dumping. At run time, we require these files to exist and have the same
147 // size/modification time, or else the archive will refuse to load.
148 //
149 // All of these entries must be JAR files. The dumping process would fail if a non-empty
150 // directory was specified in the classpaths. If an empty directory was specified
151 // it is checked by the _paths_misc_info as described above.
152 //
153 // FIXME -- if JAR files in the tail of the list were specified but not used during dumping,
154 // they should be removed from this table, to save space and to avoid spurious
155 // loading failures during runtime.
156 int _classpath_entry_table_size;
157 size_t _classpath_entry_size;
158 int _num_patch_mod_prefixes; // number of --patch-module entries
159 SharedClassPathEntry* _classpath_entry_table;
160
161 char* region_addr(int idx);
162
163 virtual bool validate();
164 virtual void populate(FileMapInfo* info, size_t alignment);
165 int compute_crc();
166 };
167
168 FileMapHeader * _header;
169
170 const char* _full_path;
171 char* _paths_misc_info;
172
173 static FileMapInfo* _current_info;
174
175 bool init_from_file(int fd);
176 void align_file_position();
177 bool validate_header_impl();
178
|