diff options
| author | Andreas Schwab | 2010-07-25 21:09:54 +0200 |
|---|---|---|
| committer | Andreas Schwab | 2010-07-25 21:09:54 +0200 |
| commit | dcc19aacb785a5a0de0184342ab8eae714bff916 (patch) | |
| tree | 108d2dcfc0ec36a97a0283a849f6de2ad2d8f75e /src | |
| parent | 7bfa6d7793030944556daeede46dff688465cfd7 (diff) | |
| download | emacs-dcc19aacb785a5a0de0184342ab8eae714bff916.tar.gz emacs-dcc19aacb785a5a0de0184342ab8eae714bff916.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/config.in | 3 | ||||
| -rw-r--r-- | src/dispnew.c | 2 | ||||
| -rw-r--r-- | src/emacs.c | 10 |
4 files changed, 19 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 0ed773d1acd..50a9fcb8ba8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2010-07-25 Andreas Schwab <schwab@linux-m68k.org> | 1 | 2010-07-25 Andreas Schwab <schwab@linux-m68k.org> |
| 2 | 2 | ||
| 3 | * emacs.c (main) [PROFILING]: Use __executable_start if defined to | ||
| 4 | find start of text segment. | ||
| 5 | * dispnew.c (safe_bcopy): Don't define if HAVE___EXECUTABLE_START | ||
| 6 | is defined. | ||
| 7 | |||
| 3 | * callproc.c (set_initial_environment): Avoid unbalanced braces. | 8 | * callproc.c (set_initial_environment): Avoid unbalanced braces. |
| 4 | 9 | ||
| 5 | 2010-07-25 Ken Brown <kbrown@cornell.edu> | 10 | 2010-07-25 Ken Brown <kbrown@cornell.edu> |
diff --git a/src/config.in b/src/config.in index 40b62633446..647c8804dff 100644 --- a/src/config.in +++ b/src/config.in | |||
| @@ -801,6 +801,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 801 | /* Define to 1 if you want to use the X window system. */ | 801 | /* Define to 1 if you want to use the X window system. */ |
| 802 | #undef HAVE_X_WINDOWS | 802 | #undef HAVE_X_WINDOWS |
| 803 | 803 | ||
| 804 | /* Define to 1 if you have the `__executable_start' function. */ | ||
| 805 | #undef HAVE___EXECUTABLE_START | ||
| 806 | |||
| 804 | /* Define to 1 if you have the `__fpending' function. */ | 807 | /* Define to 1 if you have the `__fpending' function. */ |
| 805 | #undef HAVE___FPENDING | 808 | #undef HAVE___FPENDING |
| 806 | 809 | ||
diff --git a/src/dispnew.c b/src/dispnew.c index fe64143ec07..73aafe07d94 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -436,7 +436,7 @@ DEFUN ("dump-redisplay-history", Fdump_redisplay_history, | |||
| 436 | #endif /* GLYPH_DEBUG == 0 */ | 436 | #endif /* GLYPH_DEBUG == 0 */ |
| 437 | 437 | ||
| 438 | 438 | ||
| 439 | #ifdef PROFILING | 439 | #if defined PROFILING && !HAVE___EXECUTABLE_START |
| 440 | /* FIXME: only used to find text start for profiling. */ | 440 | /* FIXME: only used to find text start for profiling. */ |
| 441 | 441 | ||
| 442 | void | 442 | void |
diff --git a/src/emacs.c b/src/emacs.c index fbae7763877..a5d57116c4f 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -1747,9 +1747,18 @@ main (int argc, char **argv) | |||
| 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 |
| @@ -1757,6 +1766,7 @@ main (int argc, char **argv) | |||
| 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); |