summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordrahn <drahn@openbsd.org>2004-05-23 13:28:05 +0000
committerdrahn <drahn@openbsd.org>2004-05-23 13:28:05 +0000
commit18f91e6f09369b913492899604ef7ce2afa1425f (patch)
tree34efd03a19efb2a62caf33a575d6a9063c3a1706
parentunbreak ipcomp; report davidkrause; ok hshoexer@ (diff)
downloadwireguard-openbsd-18f91e6f09369b913492899604ef7ce2afa1425f.tar.xz
wireguard-openbsd-18f91e6f09369b913492899604ef7ce2afa1425f.zip
Workaround for alpha, which generate a relocation entry for a function pointer
in the read-only section rather than a PLT reference like all other archs. workaround ok kettenis@ binutils/ld needs to be fixed and workaround removed eventually.
-rw-r--r--gnu/usr.bin/binutils/gdb/c-lang.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gnu/usr.bin/binutils/gdb/c-lang.c b/gnu/usr.bin/binutils/gdb/c-lang.c
index ba34540f386..a95cec057a8 100644
--- a/gnu/usr.bin/binutils/gdb/c-lang.c
+++ b/gnu/usr.bin/binutils/gdb/c-lang.c
@@ -593,6 +593,16 @@ struct type **const (cplus_builtin_types[]) =
0
};
+/* without this stub function, alpha attempts to generate a
+ * text relocation for the function pointer instead of a PLT reference.
+ */
+static char *call_cplus_demangle (const char *mangled, int options);
+static char *
+call_cplus_demangle (const char *mangled, int options)
+{
+ return cplus_demangle(mangled, options);
+}
+
const struct language_defn cplus_language_defn =
{
"c++", /* Language name */
@@ -615,7 +625,7 @@ const struct language_defn cplus_language_defn =
value_of_this, /* value_of_this */
cp_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
cp_lookup_transparent_type, /* lookup_transparent_type */
- cplus_demangle, /* Language specific symbol demangler */
+ call_cplus_demangle, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
{"%ld", "", "d", ""}, /* Decimal format info */