From a36655cb1b59e1d6d32c704c895de23c22ac87a4 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 28 Dec 2024 21:35:07 +0100 Subject: [PATCH] Delete firstfile.c and lastfile.c With the removal of unexec and purespace, the definitions in these files are no longer used. Remove them. * src/firstfile.c: * src/lastfile.c: Delete unused files. * configure.ac (PRE_ALLOC_OBJ, POST_ALLOC_OBJ, FIRSTFILE_OBJ): Remove variables and dependent code. * msdos/autogen/Makefile.in: * msdos/sed1v2.inp: * src/Makefile.in: Don't use above deleted variables. * src/deps.mk: Remove lastfile.c dependencies. (cherry picked from commit c70d595708cd0dc19e85e58148a75df21d80f9b2) --- configure.ac | 11 ---------- msdos/autogen/Makefile.in | 3 --- msdos/sed1v2.inp | 3 --- src/Makefile.in | 14 ++----------- src/deps.mk | 1 - src/firstfile.c | 32 ---------------------------- src/lastfile.c | 44 --------------------------------------- 7 files changed, 2 insertions(+), 106 deletions(-) delete mode 100644 src/firstfile.c delete mode 100644 src/lastfile.c diff --git a/configure.ac b/configure.ac index bd74490baa9..c96e03d63c5 100644 --- a/configure.ac +++ b/configure.ac @@ -2998,7 +2998,6 @@ if test "${opsys}" = "mingw32"; then HAVE_W32=${emacs_cv_w32api} fi -FIRSTFILE_OBJ= NTDIR= LIBS_ECLIENT= LIB_WSOCK32= @@ -3046,7 +3045,6 @@ if test "${HAVE_W32}" = "yes"; then W32_RES_LINK="\$(EMACSRES)" CLIENTRES="emacsclient.res" CLIENTW="emacsclientw\$(EXEEXT)" - FIRSTFILE_OBJ=firstfile.o NTDIR=nt CM_OBJ= LIBS_ECLIENT="-lcomctl32" @@ -3068,7 +3066,6 @@ AC_SUBST([EMACS_MANIFEST]) AC_SUBST([CLIENTRES]) AC_SUBST([CLIENTW]) AC_SUBST([W32_RES_LINK]) -AC_SUBST([FIRSTFILE_OBJ]) AC_SUBST([NTDIR]) AC_SUBST([CM_OBJ]) AC_SUBST([LIBS_ECLIENT]) @@ -7260,20 +7257,12 @@ AC_SUBST([RALLOC_OBJ]) if test "$opsys" = "cygwin"; then CYGWIN_OBJ="cygw32.o" - PRE_ALLOC_OBJ= - POST_ALLOC_OBJ=lastfile.o elif test "$opsys" = "mingw32"; then CYGWIN_OBJ= - PRE_ALLOC_OBJ= - POST_ALLOC_OBJ=lastfile.o else CYGWIN_OBJ= - PRE_ALLOC_OBJ=lastfile.o - POST_ALLOC_OBJ= fi AC_SUBST([CYGWIN_OBJ]) -AC_SUBST([PRE_ALLOC_OBJ]) -AC_SUBST([POST_ALLOC_OBJ]) dnl Call this 'FORTIFY_SOUR' so that it sorts before the 'FORTIFY_SOURCE' dnl verbatim defined above. The tricky name is apropos, as this hack diff --git a/msdos/autogen/Makefile.in b/msdos/autogen/Makefile.in index 83df237d565..e1c42ad9609 100644 --- a/msdos/autogen/Makefile.in +++ b/msdos/autogen/Makefile.in @@ -456,7 +456,6 @@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXECINFO_H = @EXECINFO_H@ EXEEXT = @EXEEXT@ -FIRSTFILE_OBJ = @FIRSTFILE_OBJ@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FONT_OBJ = @FONT_OBJ@ @@ -990,10 +989,8 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PAXCTL = @PAXCTL@ PKG_CONFIG = @PKG_CONFIG@ -POST_ALLOC_OBJ = @POST_ALLOC_OBJ@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ -PRE_ALLOC_OBJ = @PRE_ALLOC_OBJ@ PRIPTR_PREFIX = @PRIPTR_PREFIX@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PROFILING_CFLAGS = @PROFILING_CFLAGS@ diff --git a/msdos/sed1v2.inp b/msdos/sed1v2.inp index 5fc09cfe844..791d6ab2693 100644 --- a/msdos/sed1v2.inp +++ b/msdos/sed1v2.inp @@ -165,10 +165,7 @@ s/ *@WEBP_LIBS@// /^XINERAMA_CFLAGS *=/s/@XINERAMA_CFLAGS@// /^GMALLOC_OBJ *=/s/@GMALLOC_OBJ@/gmalloc.o/ /^VMLIMIT_OBJ *=/s/@VMLIMIT_OBJ@/vm-limit.o/ -/^FIRSTFILE_OBJ *=/s/@FIRSTFILE_OBJ@// /^RALLOC_OBJ *=/s/@RALLOC_OBJ@/ralloc.o/ -/^PRE_ALLOC_OBJ *=/s/@PRE_ALLOC_OBJ@/lastfile.o/ -/^POST_ALLOC_OBJ *=/s/@POST_ALLOC_OBJ@/$(vmlimitobj)/ /^UNEXEC_OBJ *=/s/@UNEXEC_OBJ@/unexcoff.o/ /^BUILD_DETAILS *=/s/@BUILD_DETAILS@// /^CANNOT_DUMP *=/s/@CANNOT_DUMP@/no/ diff --git a/src/Makefile.in b/src/Makefile.in index 57300205115..8296329f136 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -447,8 +447,6 @@ ALL_CXX_CFLAGS = $(EMACS_CFLAGS) \ .cc.o: $(AM_V_CXX)$(CXX) -c $(CPPFLAGS) $(ALL_CXX_CFLAGS) $(PROFILING_CFLAGS) $< -## lastfile must follow all files whose initialized data areas should -## be dumped as pure by dump-emacs. base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \ charset.o coding.o category.o ccl.o character.o chartab.o bidi.o \ $(CM_OBJ) term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \ @@ -497,19 +495,11 @@ VMLIMIT_OBJ=@VMLIMIT_OBJ@ ## ralloc.o if !SYSTEM_MALLOC && REL_ALLOC, else empty. RALLOC_OBJ=@RALLOC_OBJ@ -## Empty on Cygwin and MinGW, lastfile.o elsewhere. -PRE_ALLOC_OBJ=@PRE_ALLOC_OBJ@ -## lastfile.o on Cygwin and MinGW, empty elsewhere. -POST_ALLOC_OBJ=@POST_ALLOC_OBJ@ - ## List of object files that make-docfile should not be told about. -otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \ - $(POST_ALLOC_OBJ) $(WIDGET_OBJ) $(LIBOBJS) +otherobj= $(TERMCAP_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) $(WIDGET_OBJ) $(LIBOBJS) ## All object files linked into temacs. $(VMLIMIT_OBJ) should be first. -## (On MinGW, firstfile.o should be before vm-limit.o.) -FIRSTFILE_OBJ=@FIRSTFILE_OBJ@ -ALLOBJS = $(FIRSTFILE_OBJ) $(VMLIMIT_OBJ) $(obj) $(otherobj) +ALLOBJS = $(VMLIMIT_OBJ) $(obj) $(otherobj) # Must be first, before dep inclusion! ifneq ($(HAVE_BE_APP),yes) diff --git a/src/deps.mk b/src/deps.mk index 5fa6ed79abe..e2c786f8fb0 100644 --- a/src/deps.mk +++ b/src/deps.mk @@ -137,7 +137,6 @@ keyboard.o: keyboard.c termchar.h termhooks.h termopts.h buffer.h character.h \ keymap.o: keymap.c buffer.h commands.h keyboard.h termhooks.h blockinput.h \ atimer.h systime.h character.h charset.h $(INTERVALS_H) \ keymap.h window.h coding.h frame.h lisp.h globals.h $(config_h) -lastfile.o: lastfile.c $(config_h) macros.o: macros.c window.h buffer.h commands.h macros.h keyboard.h msdos.h \ dispextern.h lisp.h globals.h $(config_h) systime.h coding.h composite.h gmalloc.o: gmalloc.c $(config_h) diff --git a/src/firstfile.c b/src/firstfile.c deleted file mode 100644 index 1cd190a631b..00000000000 --- a/src/firstfile.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Mark beginning of data space to dump as pure, for GNU Emacs. - Copyright (C) 1997, 2001-2025 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or (at -your option) any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see . */ - - -#include - -#ifdef WINDOWSNT -/* See comments in lastfile.c. */ -char my_begdata[] = "Beginning of Emacs initialized data"; -char my_begbss[1]; /* Do not initialize this variable. */ -static char _my_begbss[1]; -char * my_begbss_static = _my_begbss; - -/* Add a dummy reference to ensure emacs.o is linked in. */ -extern int main (int, char **); -int (*dummy_main_reference) (int, char **) = main; -#endif diff --git a/src/lastfile.c b/src/lastfile.c deleted file mode 100644 index 509c54daa04..00000000000 --- a/src/lastfile.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Mark end of data space to dump as pure, for GNU Emacs. - Copyright (C) 1985, 2001-2025 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or (at -your option) any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see . */ - - -/* How this works: - - Fdump_emacs dumps everything up to my_edata as text space (pure). - - The files of Emacs are written so as to have no initialized - data that can ever need to be altered except at the first startup. - This is so that those words can be dumped as shareable text. - - It is not possible to exercise such control over library files. - So it is necessary to refrain from making their data areas shared. - Therefore, this file is loaded following all the files of Emacs - but before library files. - As a result, the symbol my_edata indicates the point - in data space between data coming from Emacs and data - coming from libraries. -*/ - -#include - -#include "lisp.h" - -#if (!defined SYSTEM_MALLOC \ - || defined WINDOWSNT || defined CYGWIN || defined DARWIN_OS) -char my_edata[] = "End of Emacs initialized data"; -#endif -- 2.39.5