aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGlenn Morris2013-02-12 20:31:09 -0800
committerGlenn Morris2013-02-12 20:31:09 -0800
commit01fcc3a532872b29784a4d888ab9cc1aef0eed01 (patch)
treee1fba1dfe3ec5b61ddc3e5e3824e4536b2c39429 /src
parentd0009c7351874e853c63ce67cea6103f33afa60b (diff)
parent1a359750bbac95fd6bf8fe1233e747a1d26f0082 (diff)
downloademacs-01fcc3a532872b29784a4d888ab9cc1aef0eed01.tar.gz
emacs-01fcc3a532872b29784a4d888ab9cc1aef0eed01.zip
Merge from emacs-24; up to 2012-12-17T11:17:34Z!rgm@gnu.org
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog46
-rw-r--r--src/bidi.c5
-rw-r--r--src/coding.c2
-rw-r--r--src/font.c2
-rw-r--r--src/indent.c2
-rw-r--r--src/keyboard.c7
-rw-r--r--src/pre-crt0.c6
-rw-r--r--src/unexaix.c93
8 files changed, 104 insertions, 59 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index ed750032dd6..31ffd36c060 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,49 @@
12013-02-13 Glenn Morris <rgm@gnu.org>
2
3 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
4
52013-02-13 Paul Eggert <eggert@cs.ucla.edu>
6
7 Improve AIX port some more (Bug#13650).
8 With this, it should be as good as it was in 23.3, though it's
9 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
10 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
11 * unexaix.c (start_of_text): Remove.
12 (_data, _text): Declare as char[], not int, as AIX manual suggests.
13 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
14 (orig_load_scnptr, orig_data_scnptr):
15 Now off_t, not long, since they are file offsets.
16 (make_hdr): Use _data, not start_of_data ().
17 This is the key part of the fix.
18 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
19 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
20
21 * pre-crt0.c (data_start): Initialize to 1.
22 This ports to compilers that optimize the external declaration
23 'int x = 0;' as if it were 'int x;' to shrink the executable.
24
25 Improve AIX port (Bug#13650).
26 This doesn't fix the bug, but it makes progress: Emacs builds now.
27 * unexaix.c: Include inttypes.h, stdarg.h.
28 (report_error, report_error_1): Mark as _Noreturn.
29 (report_error): Don't report the wrong errno.
30 (report_error_1): Now varargs. All callers changed.
31 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
32 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
33 (write_ptr): Use %p to print address rather than %lx and a cast
34 to unsigned long. Grow buffer a bit, to be safer.
35
362013-02-13 Eli Zaretskii <eliz@gnu.org>
37
38 * bidi.c (bidi_resolve_neutral): After finding the next
39 non-neutral character, accept NEUTRAL_ON type as well, because
40 directional control characters, such as LRE and RLE, have their
41 type converted to that by bidi_resolve_weak. This avoids aborts
42 when LRE/RLE follows a run of neutrals.
43 (bidi_move_to_visually_next): Assert that return value of
44 bidi_peek_at_next_level is non-negative. Negative values will
45 cause an infloop.
46
12013-02-13 Paul Eggert <eggert@cs.ucla.edu> 472013-02-13 Paul Eggert <eggert@cs.ucla.edu>
2 48
3 Minor getenv-related fixes. 49 Minor getenv-related fixes.
diff --git a/src/bidi.c b/src/bidi.c
index b067c8134e3..db2e48a2ca7 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -1973,6 +1973,7 @@ bidi_resolve_neutral (struct bidi_it *bidi_it)
1973 next_type = STRONG_R; 1973 next_type = STRONG_R;
1974 break; 1974 break;
1975 case WEAK_BN: 1975 case WEAK_BN:
1976 case NEUTRAL_ON: /* W6/Retaining */
1976 if (!bidi_explicit_dir_char (bidi_it->ch)) 1977 if (!bidi_explicit_dir_char (bidi_it->ch))
1977 emacs_abort (); /* can't happen: BNs are skipped */ 1978 emacs_abort (); /* can't happen: BNs are skipped */
1978 /* FALLTHROUGH */ 1979 /* FALLTHROUGH */
@@ -2391,6 +2392,10 @@ bidi_move_to_visually_next (struct bidi_it *bidi_it)
2391 next_level = bidi_peek_at_next_level (bidi_it); 2392 next_level = bidi_peek_at_next_level (bidi_it);
2392 while (next_level != expected_next_level) 2393 while (next_level != expected_next_level)
2393 { 2394 {
2395 /* If next_level is -1, it means we have an unresolved level
2396 in the cache, which at this point should not happen. If
2397 it does, we will infloop. */
2398 eassert (next_level >= 0);
2394 expected_next_level += incr; 2399 expected_next_level += incr;
2395 level_to_search += incr; 2400 level_to_search += incr;
2396 bidi_find_other_level_edge (bidi_it, level_to_search, !ascending); 2401 bidi_find_other_level_edge (bidi_it, level_to_search, !ascending);
diff --git a/src/coding.c b/src/coding.c
index b881f162ab9..868fb7df0ea 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -10712,7 +10712,7 @@ reading if you suppress escape sequence detection.
10712 10712
10713The other way to read escape sequences in a file without decoding is 10713The other way to read escape sequences in a file without decoding is
10714to explicitly specify some coding system that doesn't use ISO-2022 10714to explicitly specify some coding system that doesn't use ISO-2022
10715escape sequence (e.g `latin-1') on reading by \\[universal-coding-system-argument]. */); 10715escape sequence (e.g., `latin-1') on reading by \\[universal-coding-system-argument]. */);
10716 inhibit_iso_escape_detection = 0; 10716 inhibit_iso_escape_detection = 0;
10717 10717
10718 DEFVAR_BOOL ("inhibit-null-byte-detection", 10718 DEFVAR_BOOL ("inhibit-null-byte-detection",
diff --git a/src/font.c b/src/font.c
index bed0ac8caf2..5cfac07de72 100644
--- a/src/font.c
+++ b/src/font.c
@@ -4831,7 +4831,7 @@ where
4831 OPENED-NAME is the name used for opening the font, 4831 OPENED-NAME is the name used for opening the font,
4832 FULL-NAME is the full name of the font, 4832 FULL-NAME is the full name of the font,
4833 SIZE is the pixelsize of the font, 4833 SIZE is the pixelsize of the font,
4834 HEIGHT is the pixel-height of the font (i.e ascent + descent), 4834 HEIGHT is the pixel-height of the font (i.e., ascent + descent),
4835 BASELINE-OFFSET is the upward offset pixels from ASCII baseline, 4835 BASELINE-OFFSET is the upward offset pixels from ASCII baseline,
4836 RELATIVE-COMPOSE and DEFAULT-ASCENT are the numbers controlling 4836 RELATIVE-COMPOSE and DEFAULT-ASCENT are the numbers controlling
4837 how to compose characters. 4837 how to compose characters.
diff --git a/src/indent.c b/src/indent.c
index 44ecbbc8a58..ce1639eae1e 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -291,7 +291,7 @@ DEFUN ("current-column", Fcurrent_column, Scurrent_column, 0, 0, 0,
291 doc: /* Return the horizontal position of point. Beginning of line is column 0. 291 doc: /* Return the horizontal position of point. Beginning of line is column 0.
292This is calculated by adding together the widths of all the displayed 292This is calculated by adding together the widths of all the displayed
293representations of the character between the start of the previous line 293representations of the character between the start of the previous line
294and point (eg. control characters will have a width of 2 or 4, tabs 294and point (e.g., control characters will have a width of 2 or 4, tabs
295will have a variable width). 295will have a variable width).
296Ignores finite width of frame, which means that this function may return 296Ignores finite width of frame, which means that this function may return
297values greater than (frame-width). 297values greater than (frame-width).
diff --git a/src/keyboard.c b/src/keyboard.c
index 94432cb7bf6..4ead0538b92 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -11618,9 +11618,7 @@ If the binding is a function, it is called with one argument (the prompt)
11618and its return value (a key sequence) is used. 11618and its return value (a key sequence) is used.
11619 11619
11620The events that come from bindings in `input-decode-map' are not 11620The events that come from bindings in `input-decode-map' are not
11621themselves looked up in `input-decode-map'. 11621themselves looked up in `input-decode-map'. */);
11622
11623This variable is keyboard-local. */);
11624 11622
11625 DEFVAR_LISP ("function-key-map", Vfunction_key_map, 11623 DEFVAR_LISP ("function-key-map", Vfunction_key_map,
11626 doc: /* The parent keymap of all `local-function-key-map' instances. 11624 doc: /* The parent keymap of all `local-function-key-map' instances.
@@ -11633,8 +11631,7 @@ definition will take precedence. */);
11633 DEFVAR_LISP ("key-translation-map", Vkey_translation_map, 11631 DEFVAR_LISP ("key-translation-map", Vkey_translation_map,
11634 doc: /* Keymap of key translations that can override keymaps. 11632 doc: /* Keymap of key translations that can override keymaps.
11635This keymap works like `function-key-map', but comes after that, 11633This keymap works like `function-key-map', but comes after that,
11636and its non-prefix bindings override ordinary bindings. 11634and its non-prefix bindings override ordinary bindings. */);
11637Another difference is that it is global rather than keyboard-local. */);
11638 Vkey_translation_map = Fmake_sparse_keymap (Qnil); 11635 Vkey_translation_map = Fmake_sparse_keymap (Qnil);
11639 11636
11640 DEFVAR_LISP ("deferred-action-list", Vdeferred_action_list, 11637 DEFVAR_LISP ("deferred-action-list", Vdeferred_action_list,
diff --git a/src/pre-crt0.c b/src/pre-crt0.c
index ea5736eba2a..6b9618c8dc3 100644
--- a/src/pre-crt0.c
+++ b/src/pre-crt0.c
@@ -4,7 +4,7 @@
4 that make environ an initialized variable. However, we do 4 that make environ an initialized variable. However, we do
5 need to make sure the label data_start exists anyway. */ 5 need to make sure the label data_start exists anyway. */
6 6
7/* Create a label to appear at the beginning of data space. */ 7/* Create a label to appear at the beginning of data space.
8 8 Its value is nonzero so that it cannot be put into bss. */
9int data_start = 0;
10 9
10int data_start = 1;
diff --git a/src/unexaix.c b/src/unexaix.c
index 92ebd2e3ceb..da44480fdca 100644
--- a/src/unexaix.c
+++ b/src/unexaix.c
@@ -51,6 +51,8 @@ what you give them. Help stamp out software-hoarding! */
51#include "getpagesize.h" 51#include "getpagesize.h"
52 52
53#include <sys/types.h> 53#include <sys/types.h>
54#include <inttypes.h>
55#include <stdarg.h>
54#include <stdio.h> 56#include <stdio.h>
55#include <sys/stat.h> 57#include <sys/stat.h>
56#include <errno.h> 58#include <errno.h>
@@ -59,10 +61,8 @@ what you give them. Help stamp out software-hoarding! */
59 61
60#include "mem-limits.h" 62#include "mem-limits.h"
61 63
62char *start_of_text (void); /* Start of text */ 64extern char _data[];
63 65extern char _text[];
64extern int _data;
65extern int _text;
66 66
67#include <filehdr.h> 67#include <filehdr.h>
68#include <aouthdr.h> 68#include <aouthdr.h>
@@ -71,15 +71,15 @@ extern int _text;
71 71
72static struct filehdr f_hdr; /* File header */ 72static struct filehdr f_hdr; /* File header */
73static struct aouthdr f_ohdr; /* Optional file header (a.out) */ 73static struct aouthdr f_ohdr; /* Optional file header (a.out) */
74static long bias; /* Bias to add for growth */ 74static off_t bias; /* Bias to add for growth */
75static long lnnoptr; /* Pointer to line-number info within file */ 75static off_t lnnoptr; /* Pointer to line-number info within file */
76 76
77static long text_scnptr; 77static off_t text_scnptr;
78static long data_scnptr; 78static off_t data_scnptr;
79#define ALIGN(val, pwr) (((val) + ((1L<<(pwr))-1)) & ~((1L<<(pwr))-1)) 79#define ALIGN(val, pwr) (((val) + ((1L<<(pwr))-1)) & ~((1L<<(pwr))-1))
80static long load_scnptr; 80static off_t load_scnptr;
81static long orig_load_scnptr; 81static off_t orig_load_scnptr;
82static long orig_data_scnptr; 82static off_t orig_data_scnptr;
83static int unrelocate_symbols (int, int, const char *, const char *); 83static int unrelocate_symbols (int, int, const char *, const char *);
84 84
85#ifndef MAX_SECTIONS 85#ifndef MAX_SECTIONS
@@ -92,23 +92,30 @@ static int pagemask;
92 92
93#include "lisp.h" 93#include "lisp.h"
94 94
95static void 95static _Noreturn void
96report_error (const char *file, int fd) 96report_error (const char *file, int fd)
97{ 97{
98 if (fd) 98 if (fd)
99 close (fd); 99 {
100 int failed_errno = errno;
101 close (fd);
102 errno = failed_errno;
103 }
100 report_file_error ("Cannot unexec", Fcons (build_string (file), Qnil)); 104 report_file_error ("Cannot unexec", Fcons (build_string (file), Qnil));
101} 105}
102 106
103#define ERROR0(msg) report_error_1 (new, msg, 0, 0); return -1 107#define ERROR0(msg) report_error_1 (new, msg)
104#define ERROR1(msg,x) report_error_1 (new, msg, x, 0); return -1 108#define ERROR1(msg,x) report_error_1 (new, msg, x)
105#define ERROR2(msg,x,y) report_error_1 (new, msg, x, y); return -1 109#define ERROR2(msg,x,y) report_error_1 (new, msg, x, y)
106 110
107static void 111static _Noreturn void ATTRIBUTE_FORMAT_PRINTF (2, 3)
108report_error_1 (int fd, const char *msg, int a1, int a2) 112report_error_1 (int fd, const char *msg, ...)
109{ 113{
114 va_list ap;
110 close (fd); 115 close (fd);
111 error (msg, a1, a2); 116 va_start (ap, msg);
117 verror (msg, ap);
118 va_end (ap);
112} 119}
113 120
114static int make_hdr (int, int, const char *, const char *); 121static int make_hdr (int, int, const char *, const char *);
@@ -163,8 +170,8 @@ make_hdr (int new, int a_out,
163 const char *a_name, const char *new_name) 170 const char *a_name, const char *new_name)
164{ 171{
165 int scns; 172 int scns;
166 unsigned int bss_start; 173 uintptr_t bss_start;
167 unsigned int data_start; 174 uintptr_t data_start;
168 175
169 struct scnhdr section[MAX_SECTIONS]; 176 struct scnhdr section[MAX_SECTIONS];
170 struct scnhdr * f_thdr; /* Text section header */ 177 struct scnhdr * f_thdr; /* Text section header */
@@ -179,17 +186,17 @@ make_hdr (int new, int a_out,
179 pagemask = getpagesize () - 1; 186 pagemask = getpagesize () - 1;
180 187
181 /* Adjust text/data boundary. */ 188 /* Adjust text/data boundary. */
182 data_start = (long) start_of_data (); 189 data_start = (uintptr_t) _data;
183 data_start = ADDR_CORRECT (data_start);
184 190
185 data_start = data_start & ~pagemask; /* (Down) to page boundary. */ 191 data_start = data_start & ~pagemask; /* (Down) to page boundary. */
186 192
187 bss_start = ADDR_CORRECT (sbrk (0)) + pagemask; 193 bss_start = (uintptr_t) sbrk (0) + pagemask;
188 bss_start &= ~ pagemask; 194 bss_start &= ~ pagemask;
189 195
190 if (data_start > bss_start) /* Can't have negative data size. */ 196 if (data_start > bss_start) /* Can't have negative data size. */
191 { 197 {
192 ERROR2 ("unexec: data_start (%u) can't be greater than bss_start (%u)", 198 ERROR2 (("unexec: data_start (0x%"PRIxPTR
199 ") can't be greater than bss_start (0x%"PRIxPTR")"),
193 data_start, bss_start); 200 data_start, bss_start);
194 } 201 }
195 202
@@ -279,7 +286,7 @@ make_hdr (int new, int a_out,
279 286
280 /* fix scnptr's */ 287 /* fix scnptr's */
281 { 288 {
282 ulong ptr = section[0].s_scnptr; 289 off_t ptr = section[0].s_scnptr;
283 290
284 bias = -1; 291 bias = -1;
285 for (scns = 0; scns < f_hdr.f_nscns; scns++) 292 for (scns = 0; scns < f_hdr.f_nscns; scns++)
@@ -375,12 +382,12 @@ copy_text_and_data (int new)
375 char *end; 382 char *end;
376 char *ptr; 383 char *ptr;
377 384
378 lseek (new, (long) text_scnptr, SEEK_SET); 385 lseek (new, text_scnptr, SEEK_SET);
379 ptr = start_of_text () + text_scnptr; 386 ptr = _text + text_scnptr;
380 end = ptr + f_ohdr.tsize; 387 end = ptr + f_ohdr.tsize;
381 write_segment (new, ptr, end); 388 write_segment (new, ptr, end);
382 389
383 lseek (new, (long) data_scnptr, SEEK_SET); 390 lseek (new, data_scnptr, SEEK_SET);
384 ptr = (char *) f_ohdr.data_start; 391 ptr = (char *) f_ohdr.data_start;
385 end = ptr + f_ohdr.dsize; 392 end = ptr + f_ohdr.dsize;
386 write_segment (new, ptr, end); 393 write_segment (new, ptr, end);
@@ -393,7 +400,6 @@ static void
393write_segment (int new, char *ptr, char *end) 400write_segment (int new, char *ptr, char *end)
394{ 401{
395 int i, nwrite, ret; 402 int i, nwrite, ret;
396 char buf[80];
397 char zeros[UnexBlockSz]; 403 char zeros[UnexBlockSz];
398 404
399 for (i = 0; ptr < end;) 405 for (i = 0; ptr < end;)
@@ -414,9 +420,13 @@ write_segment (int new, char *ptr, char *end)
414 } 420 }
415 else if (nwrite != ret) 421 else if (nwrite != ret)
416 { 422 {
423 int write_errno = errno;
424 char buf[1000];
425 void *addr = ptr;
417 sprintf (buf, 426 sprintf (buf,
418 "unexec write failure: addr 0x%lx, fileno %d, size 0x%x, wrote 0x%x, errno %d", 427 "unexec write failure: addr %p, fileno %d, size 0x%x, wrote 0x%x, errno %d",
419 (unsigned long)ptr, new, nwrite, ret, errno); 428 addr, new, nwrite, ret, errno);
429 errno = write_errno;
420 PERROR (buf); 430 PERROR (buf);
421 } 431 }
422 i += nwrite; 432 i += nwrite;
@@ -537,13 +547,13 @@ unrelocate_symbols (int new, int a_out,
537 int i; 547 int i;
538 LDHDR ldhdr; 548 LDHDR ldhdr;
539 LDREL ldrel; 549 LDREL ldrel;
540 ulong t_reloc = (ulong) &_text - f_ohdr.text_start; 550 off_t t_reloc = (intptr_t) _text - f_ohdr.text_start;
541#ifndef ALIGN_DATA_RELOC 551#ifndef ALIGN_DATA_RELOC
542 ulong d_reloc = (ulong) &_data - f_ohdr.data_start; 552 off_t d_reloc = (intptr_t) _data - f_ohdr.data_start;
543#else 553#else
544 /* This worked (and was needed) before AIX 4.2. 554 /* This worked (and was needed) before AIX 4.2.
545 I have no idea why. -- Mike */ 555 I have no idea why. -- Mike */
546 ulong d_reloc = (ulong) &_data - ALIGN (f_ohdr.data_start, 2); 556 off_t d_reloc = (intptr_t) _data - ALIGN (f_ohdr.data_start, 2);
547#endif 557#endif
548 int * p; 558 int * p;
549 559
@@ -628,16 +638,3 @@ unrelocate_symbols (int new, int a_out,
628 } 638 }
629 return 0; 639 return 0;
630} 640}
631
632/*
633 * Return the address of the start of the text segment prior to
634 * doing an unexec. After unexec the return value is undefined.
635 * See crt0.c for further explanation and _start.
636 *
637 */
638
639char *
640start_of_text (void)
641{
642 return ((char *) 0x10000000);
643}