comparison src/emacs.c @ 109539:d962ccf8829f

Use __executable_start to find start of text segment for profiling * emacs.c (main) [PROFILING]: Use __executable_start if defined to find start of text segment. * dispnew.c (safe_bcopy): Don't define if HAVE___EXECUTABLE_START is defined. * configure.in: Check for __executable_start.
author Andreas Schwab <schwab@linux-m68k.org>
date Sun, 25 Jul 2010 21:09:54 +0200
parents 4e99d7aa7526
children 05e7e7c46ff0
comparison
equal deleted inserted replaced
109538:ed55b1a60024 109539:d962ccf8829f
1745 #ifdef __MINGW32__ 1745 #ifdef __MINGW32__
1746 extern unsigned char etext asm ("etext"); 1746 extern unsigned char etext asm ("etext");
1747 #else 1747 #else
1748 extern char etext; 1748 extern char etext;
1749 #endif 1749 #endif
1750 #ifdef HAVE___EXECUTABLE_START
1751 /* This symbol is defined by GNU ld to the start of the text
1752 segment. */
1753 extern char __executable_start[];
1754 #else
1750 extern void safe_bcopy (); 1755 extern void safe_bcopy ();
1756 #endif
1751 1757
1752 atexit (_mcleanup); 1758 atexit (_mcleanup);
1759 #ifdef HAVE___EXECUTABLE_START
1760 monstartup (__executable_start, &etext);
1761 #else
1753 /* This uses safe_bcopy because that function comes first in the 1762 /* This uses safe_bcopy because that function comes first in the
1754 Emacs executable. It might be better to use something that 1763 Emacs executable. It might be better to use something that
1755 gives the start of the text segment, but start_of_text is not 1764 gives the start of the text segment, but start_of_text is not
1756 defined on all systems now. */ 1765 defined on all systems now. */
1757 /* FIXME: Does not work on architectures with function 1766 /* FIXME: Does not work on architectures with function
1758 descriptors. */ 1767 descriptors. */
1759 monstartup (safe_bcopy, &etext); 1768 monstartup (safe_bcopy, &etext);
1769 #endif
1760 } 1770 }
1761 else 1771 else
1762 moncontrol (0); 1772 moncontrol (0);
1763 #endif 1773 #endif
1764 #endif 1774 #endif