aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-02-17 12:03:08 +0100
committerBjörn Gustavsson <[email protected]>2017-02-17 12:35:49 +0100
commit5263d10ba361cf0666cb6b2730132a018ba67bd6 (patch)
tree57023886ebc46af04caac6137d2eb97976926955 /erts
parent5b80964cabcb5ec6c7961d3714fa9ed4bdcc6585 (diff)
downloadotp-5263d10ba361cf0666cb6b2730132a018ba67bd6.tar.gz
otp-5263d10ba361cf0666cb6b2730132a018ba67bd6.tar.bz2
otp-5263d10ba361cf0666cb6b2730132a018ba67bd6.zip
Teach make_preload to handle the new 'AtU8' chunk
26b59dfe67 introduced the new 'AtU8' chunk to support Unicode atoms. make_preload strips the pre-loaded BEAM files so that they only contain essential chunks. It expects to find the old 'Atom' chunk. Teach make_preload to read the new 'AtU8' chunk instead of the old chunk. Also produce a nice error message if someone by mistake compiles the pre-loaded modules with an OTP 19 compiler.
Diffstat (limited to 'erts')
-rwxr-xr-xerts/emulator/utils/make_preload18
-rw-r--r--erts/preloaded/ebin/erl_prim_loader.beambin55840 -> 55820 bytes
-rw-r--r--erts/preloaded/ebin/erl_tracer.beambin2176 -> 2160 bytes
-rw-r--r--erts/preloaded/ebin/erlang.beambin106232 -> 106104 bytes
-rw-r--r--erts/preloaded/ebin/erts_code_purger.beambin11472 -> 11456 bytes
-rw-r--r--erts/preloaded/ebin/erts_dirty_process_code_checker.beambin2108 -> 2092 bytes
-rw-r--r--erts/preloaded/ebin/erts_internal.beambin10892 -> 10876 bytes
-rw-r--r--erts/preloaded/ebin/erts_literal_area_collector.beambin3280 -> 3264 bytes
-rw-r--r--erts/preloaded/ebin/init.beambin50016 -> 49996 bytes
-rw-r--r--erts/preloaded/ebin/otp_ring0.beambin1420 -> 1404 bytes
-rw-r--r--erts/preloaded/ebin/prim_eval.beambin1292 -> 1276 bytes
-rw-r--r--erts/preloaded/ebin/prim_file.beambin44428 -> 44408 bytes
-rw-r--r--erts/preloaded/ebin/prim_inet.beambin76464 -> 76440 bytes
-rw-r--r--erts/preloaded/ebin/prim_zip.beambin23132 -> 23112 bytes
-rw-r--r--erts/preloaded/ebin/zlib.beambin14304 -> 14288 bytes
15 files changed, 13 insertions, 5 deletions
diff --git a/erts/emulator/utils/make_preload b/erts/emulator/utils/make_preload
index 8b629d9517..bcb2e42614 100755
--- a/erts/emulator/utils/make_preload
+++ b/erts/emulator/utils/make_preload
@@ -90,7 +90,7 @@ foreach $file (@ARGV) {
open(FILE, $file) or error("failed to read $file: $!");
binmode(FILE);
$_ = <FILE>;
- $_ = beam_strip($_);
+ $_ = beam_strip($_, $file);
close(FILE);
push(@modules, " {\"$module\", " . length($_) . ", preloaded_$module},\n");
@@ -147,20 +147,20 @@ sub error {
}
sub beam_strip {
- my($beam) = @_;
+ my($beam,$file) = @_;
my $size_left = length($beam);
my %chunk;
my %needed_chunk = ('Code' => 1,
- 'Atom' => 1,
+ 'AtU8' => 1,
'ImpT' => 1,
'ExpT' => 1,
'StrT' => 1,
'FunT' => 1,
'LitT' => 1);
- die "can't read Beam files for OTP R4 or earlier (sorry)"
+ die "$file: can't read Beam files for OTP R4 or earlier (sorry)"
if $beam =~ /^\x7fBEAM!/;
#
@@ -177,7 +177,7 @@ sub beam_strip {
die "form size $size greater than size ", $size_left, " of module"
if $size > $size_left;
$size_left -= 4;
- die "not a BEAM file: IFF form type is not 'BEAM'"
+ die "$file: not a BEAM file: IFF form type is not 'BEAM'"
unless $beam_id eq 'BEAM';
#
@@ -197,6 +197,14 @@ sub beam_strip {
}
#
+ # Abort if there is no new-style 'AtU8' atom chunk.
+ #
+
+ exists $chunk{'AtU8'} or
+ die "$file: no 'AtU8' chunk (re-compile with " .
+ "OTP 20 or later)\n";
+
+ #
# Create a new beam file with only the useful chunk types.
#
diff --git a/erts/preloaded/ebin/erl_prim_loader.beam b/erts/preloaded/ebin/erl_prim_loader.beam
index 4f4027c74e..5b03019d8e 100644
--- a/erts/preloaded/ebin/erl_prim_loader.beam
+++ b/erts/preloaded/ebin/erl_prim_loader.beam
Binary files differ
diff --git a/erts/preloaded/ebin/erl_tracer.beam b/erts/preloaded/ebin/erl_tracer.beam
index c05bc813f0..4cf1b5ed82 100644
--- a/erts/preloaded/ebin/erl_tracer.beam
+++ b/erts/preloaded/ebin/erl_tracer.beam
Binary files differ
diff --git a/erts/preloaded/ebin/erlang.beam b/erts/preloaded/ebin/erlang.beam
index 7cdf2931a1..149d30d299 100644
--- a/erts/preloaded/ebin/erlang.beam
+++ b/erts/preloaded/ebin/erlang.beam
Binary files differ
diff --git a/erts/preloaded/ebin/erts_code_purger.beam b/erts/preloaded/ebin/erts_code_purger.beam
index 1b28a929ce..0a318b70bb 100644
--- a/erts/preloaded/ebin/erts_code_purger.beam
+++ b/erts/preloaded/ebin/erts_code_purger.beam
Binary files differ
diff --git a/erts/preloaded/ebin/erts_dirty_process_code_checker.beam b/erts/preloaded/ebin/erts_dirty_process_code_checker.beam
index e5381d3574..20ee82a134 100644
--- a/erts/preloaded/ebin/erts_dirty_process_code_checker.beam
+++ b/erts/preloaded/ebin/erts_dirty_process_code_checker.beam
Binary files differ
diff --git a/erts/preloaded/ebin/erts_internal.beam b/erts/preloaded/ebin/erts_internal.beam
index 57b3023ea6..fe99cc769b 100644
--- a/erts/preloaded/ebin/erts_internal.beam
+++ b/erts/preloaded/ebin/erts_internal.beam
Binary files differ
diff --git a/erts/preloaded/ebin/erts_literal_area_collector.beam b/erts/preloaded/ebin/erts_literal_area_collector.beam
index 2fab34318e..e925636787 100644
--- a/erts/preloaded/ebin/erts_literal_area_collector.beam
+++ b/erts/preloaded/ebin/erts_literal_area_collector.beam
Binary files differ
diff --git a/erts/preloaded/ebin/init.beam b/erts/preloaded/ebin/init.beam
index 8123d63a9e..fdd87ef739 100644
--- a/erts/preloaded/ebin/init.beam
+++ b/erts/preloaded/ebin/init.beam
Binary files differ
diff --git a/erts/preloaded/ebin/otp_ring0.beam b/erts/preloaded/ebin/otp_ring0.beam
index 3c6a6d4f41..b91fa63e7d 100644
--- a/erts/preloaded/ebin/otp_ring0.beam
+++ b/erts/preloaded/ebin/otp_ring0.beam
Binary files differ
diff --git a/erts/preloaded/ebin/prim_eval.beam b/erts/preloaded/ebin/prim_eval.beam
index 133fda4b13..66cc919bf1 100644
--- a/erts/preloaded/ebin/prim_eval.beam
+++ b/erts/preloaded/ebin/prim_eval.beam
Binary files differ
diff --git a/erts/preloaded/ebin/prim_file.beam b/erts/preloaded/ebin/prim_file.beam
index 99ad863b8b..b5e5ff9f88 100644
--- a/erts/preloaded/ebin/prim_file.beam
+++ b/erts/preloaded/ebin/prim_file.beam
Binary files differ
diff --git a/erts/preloaded/ebin/prim_inet.beam b/erts/preloaded/ebin/prim_inet.beam
index e52e442f8e..994677872c 100644
--- a/erts/preloaded/ebin/prim_inet.beam
+++ b/erts/preloaded/ebin/prim_inet.beam
Binary files differ
diff --git a/erts/preloaded/ebin/prim_zip.beam b/erts/preloaded/ebin/prim_zip.beam
index 122406c834..6f1c82509f 100644
--- a/erts/preloaded/ebin/prim_zip.beam
+++ b/erts/preloaded/ebin/prim_zip.beam
Binary files differ
diff --git a/erts/preloaded/ebin/zlib.beam b/erts/preloaded/ebin/zlib.beam
index c683d395f3..eb9e07af7e 100644
--- a/erts/preloaded/ebin/zlib.beam
+++ b/erts/preloaded/ebin/zlib.beam
Binary files differ