From cbf3f2d5b3787c8281f3227b65ec30170fcd3379 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 28 Sep 2023 14:05:59 +0200 Subject: Don't mark rdata symbols DATA in MSVC .def file (GH issue #315) --- libbuild2/bin/def-rule.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libbuild2/bin/def-rule.cxx b/libbuild2/bin/def-rule.cxx index 0998c89..143cc35 100644 --- a/libbuild2/bin/def-rule.cxx +++ b/libbuild2/bin/def-rule.cxx @@ -417,6 +417,8 @@ namespace build2 // we will try to recognize C/C++ identifiers plus the special symbols // that we need to export (e.g., vtable). // + // Note that it looks like rdata should not be declared DATA. It is + // known to break ??_7 (vtable) exporting (see GH issue 315). // for (const string& s: syms.r) { @@ -424,7 +426,7 @@ namespace build2 (s[0] == '?' && s[1] != '?') || // C++ s.compare (0, 4, "??_7") == 0) // vtable { - os << " " << strip (s) << " DATA\n"; + os << " " << strip (s) << '\n'; } } } @@ -496,6 +498,12 @@ namespace build2 // we will try to recognize C/C++ identifiers plus the special symbols // that we need to export (e.g., vtable and typeinfo). // + // For the description of GNU binutils .def format, see: + // + // https://sourceware.org/binutils/docs/binutils/def-file-format.html + // + // @@ Maybe CONSTANT is more appropriate than DATA? + // for (const string& s: syms.r) { if (s.find_first_of (".") != string::npos) // Special (.refptr.*) -- cgit v1.1