Skip to content

Commit f2cced0

Browse files
authored
Merge pull request #2200 from SAP/pr-jdk-17.0.19+6
Merge to tag jdk-17.0.19+6
2 parents 77d07f0 + 2704c80 commit f2cced0

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

make/hotspot/lib/JvmMapfile.gmk

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -99,9 +99,26 @@ else ifeq ($(call isTargetOs, aix), true)
9999

100100
else ifeq ($(call isTargetOs, windows), true)
101101
DUMP_SYMBOLS_CMD := $(DUMPBIN) -symbols *.obj
102+
103+
# The following lines create a list of vftable symbols to be filtered out of
104+
# the mapfile. Removing this line causes the linker to complain about too many
105+
# (> 64K) symbols, so the _guess_ is that this line is here to keep down the
106+
# number of exported symbols below that limit.
107+
#
108+
# Some usages of C++ lambdas require the vftable symbol of classes that use
109+
# the lambda type as a template parameter. The usage of those classes won't
110+
# link if their vftable symbols are removed. That's why there's an exception
111+
# for vftable symbols containing the string 'lambda'.
112+
#
113+
# A very simple example of a lambda usage that fails if the lambda vftable
114+
# symbols are missing in the mapfile:
115+
#
116+
# #include <functional>
117+
# std::function<void()> f = [](){}
118+
102119
FILTER_SYMBOLS_AWK_SCRIPT := \
103120
'{ \
104-
if ($$7 ~ /??_7.*@@6B@/ && $$7 !~ /type_info/) print $$7; \
121+
if ($$7 ~ /\?\?_7.*@@6B@/ && $$7 !~ /type_info/ && $$7 !~ /lambda/) print $$7; \
105122
}'
106123

107124
else

0 commit comments

Comments
 (0)