summaryrefslogtreecommitdiff
path: root/src/widget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/widget.c')
-rw-r--r--src/widget.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/widget.c b/src/widget.c
index d7ec7028517..585039d58c6 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -108,7 +108,7 @@ emacsFrameTranslations [] = "\
static EmacsFrameClassRec emacsFrameClassRec = {
{ /* core fields */
- /* superclass */ &widgetClassRec,
+ /* superclass */ 0, /* filled in by emacsFrameClass */
/* class_name */ (char *) "EmacsFrame",
/* widget_size */ sizeof (EmacsFrameRec),
/* class_initialize */ 0,
@@ -146,7 +146,16 @@ static EmacsFrameClassRec emacsFrameClassRec = {
}
};
-WidgetClass emacsFrameClass = (WidgetClass) &emacsFrameClassRec;
+WidgetClass
+emacsFrameClass (void)
+{
+ /* Set the superclass here rather than relying on static
+ initialization, to work around an unexelf.c bug on x86 platforms
+ that use the GNU Gold linker (Bug#27248). */
+ emacsFrameClassRec.core_class.superclass = &widgetClassRec;
+
+ return (WidgetClass) &emacsFrameClassRec;
+}
static void
get_default_char_pixel_size (EmacsFrame ew, int *pixel_width, int *pixel_height)