diff options
| -rw-r--r-- | src/unexelf.c | 12 | ||||
| -rw-r--r-- | src/widget.c | 13 | ||||
| -rw-r--r-- | src/widget.h | 2 | ||||
| -rw-r--r-- | src/xfns.c | 2 |
4 files changed, 24 insertions, 5 deletions
diff --git a/src/unexelf.c b/src/unexelf.c index 7fad64fab17..5129784ade2 100644 --- a/src/unexelf.c +++ b/src/unexelf.c | |||
| @@ -576,7 +576,17 @@ unexec (const char *new_name, const char *old_name) | |||
| 576 | } | 576 | } |
| 577 | 577 | ||
| 578 | /* This loop seeks out relocation sections for the data section, so | 578 | /* This loop seeks out relocation sections for the data section, so |
| 579 | that it can undo relocations performed by the runtime loader. */ | 579 | that it can undo relocations performed by the runtime loader. |
| 580 | |||
| 581 | The following approach does not work on x86 platforms that use | ||
| 582 | the GNU Gold linker, which can generate .rel.dyn relocation | ||
| 583 | sections containing R_386_32 entries that the following code does | ||
| 584 | not grok. Emacs works around this problem by avoiding C | ||
| 585 | constructs that generate such entries, which is horrible hack. | ||
| 586 | |||
| 587 | FIXME: Presumably more problems like this will crop up as linkers | ||
| 588 | get fancier. We really need to stop assuming that Emacs can grok | ||
| 589 | arbitrary linker output. See Bug#27248. */ | ||
| 580 | for (n = new_file_h->e_shnum; 0 < --n; ) | 590 | for (n = new_file_h->e_shnum; 0 < --n; ) |
| 581 | { | 591 | { |
| 582 | ElfW (Shdr) *rel_shdr = &NEW_SECTION_H (n); | 592 | ElfW (Shdr) *rel_shdr = &NEW_SECTION_H (n); |
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 [] = "\ | |||
| 108 | 108 | ||
| 109 | static EmacsFrameClassRec emacsFrameClassRec = { | 109 | static EmacsFrameClassRec emacsFrameClassRec = { |
| 110 | { /* core fields */ | 110 | { /* core fields */ |
| 111 | /* superclass */ &widgetClassRec, | 111 | /* superclass */ 0, /* filled in by emacsFrameClass */ |
| 112 | /* class_name */ (char *) "EmacsFrame", | 112 | /* class_name */ (char *) "EmacsFrame", |
| 113 | /* widget_size */ sizeof (EmacsFrameRec), | 113 | /* widget_size */ sizeof (EmacsFrameRec), |
| 114 | /* class_initialize */ 0, | 114 | /* class_initialize */ 0, |
| @@ -146,7 +146,16 @@ static EmacsFrameClassRec emacsFrameClassRec = { | |||
| 146 | } | 146 | } |
| 147 | }; | 147 | }; |
| 148 | 148 | ||
| 149 | WidgetClass emacsFrameClass = (WidgetClass) &emacsFrameClassRec; | 149 | WidgetClass |
| 150 | emacsFrameClass (void) | ||
| 151 | { | ||
| 152 | /* Set the superclass here rather than relying on static | ||
| 153 | initialization, to work around an unexelf.c bug on x86 platforms | ||
| 154 | that use the GNU Gold linker (Bug#27248). */ | ||
| 155 | emacsFrameClassRec.core_class.superclass = &widgetClassRec; | ||
| 156 | |||
| 157 | return (WidgetClass) &emacsFrameClassRec; | ||
| 158 | } | ||
| 150 | 159 | ||
| 151 | static void | 160 | static void |
| 152 | get_default_char_pixel_size (EmacsFrame ew, int *pixel_width, int *pixel_height) | 161 | get_default_char_pixel_size (EmacsFrame ew, int *pixel_width, int *pixel_height) |
diff --git a/src/widget.h b/src/widget.h index 2c5fb61df2f..97dd6ab61de 100644 --- a/src/widget.h +++ b/src/widget.h | |||
| @@ -90,7 +90,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 90 | typedef struct _EmacsFrameRec *EmacsFrame; | 90 | typedef struct _EmacsFrameRec *EmacsFrame; |
| 91 | typedef struct _EmacsFrameClassRec *EmacsFrameClass; | 91 | typedef struct _EmacsFrameClassRec *EmacsFrameClass; |
| 92 | 92 | ||
| 93 | extern WidgetClass emacsFrameClass; | 93 | extern WidgetClass emacsFrameClass (void); |
| 94 | 94 | ||
| 95 | extern struct _DisplayContext *display_context; | 95 | extern struct _DisplayContext *display_context; |
| 96 | 96 | ||
diff --git a/src/xfns.c b/src/xfns.c index e463391c74a..7be2253cc3b 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -2875,7 +2875,7 @@ x_window (struct frame *f, long window_prompting) | |||
| 2875 | XtSetArg (al[ac], XtNdepth, FRAME_DISPLAY_INFO (f)->n_planes); ac++; | 2875 | XtSetArg (al[ac], XtNdepth, FRAME_DISPLAY_INFO (f)->n_planes); ac++; |
| 2876 | XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++; | 2876 | XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++; |
| 2877 | XtSetArg (al[ac], XtNborderWidth, 0); ac++; | 2877 | XtSetArg (al[ac], XtNborderWidth, 0); ac++; |
| 2878 | frame_widget = XtCreateWidget (f->namebuf, emacsFrameClass, pane_widget, | 2878 | frame_widget = XtCreateWidget (f->namebuf, emacsFrameClass (), pane_widget, |
| 2879 | al, ac); | 2879 | al, ac); |
| 2880 | 2880 | ||
| 2881 | f->output_data.x->edit_widget = frame_widget; | 2881 | f->output_data.x->edit_widget = frame_widget; |