/[emacs]/emacs/src/unexelf.c
ViewVC logotype

Diff of /emacs/src/unexelf.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.48 by eliz, Sat Apr 13 09:52:42 2002 UTC revision 1.48.2.1 by miles, Fri Apr 4 06:21:03 2003 UTC
# Line 89  raid:/nfs/raid/src/dist-18.56/src> dump Line 89  raid:/nfs/raid/src/dist-18.56/src> dump
89  temacs:  temacs:
90    
91             **** SECTION HEADER TABLE ****             **** SECTION HEADER TABLE ****
92  [No]    Type    Flags   Addr         Offset       Size          Name   [No]    Type    Flags   Addr         Offset       Size          Name
93          Link    Info    Adralgn      Entsize           Link    Info    Adralgn      Entsize
94    
95  [1]     1       2       0x80480d4    0xd4         0x13          .interp   [1]     1       2       0x80480d4    0xd4         0x13          .interp
96          0       0       0x1          0           0       0       0x1          0
97    
98  [2]     5       2       0x80480e8    0xe8         0x388         .hash   [2]     5       2       0x80480e8    0xe8         0x388         .hash
99          3       0       0x4          0x4           3       0       0x4          0x4
100    
101  [3]     11      2       0x8048470    0x470        0x7f0         .dynsym   [3]     11      2       0x8048470    0x470        0x7f0         .dynsym
102          4       1       0x4          0x10           4       1       0x4          0x10
103    
104  [4]     3       2       0x8048c60    0xc60        0x3ad         .dynstr   [4]     3       2       0x8048c60    0xc60        0x3ad         .dynstr
105          0       0       0x1          0           0       0       0x1          0
106    
107  [5]     9       2       0x8049010    0x1010       0x338         .rel.plt   [5]     9       2       0x8049010    0x1010       0x338         .rel.plt
108          3       7       0x4          0x8           3       7       0x4          0x8
109    
110  [6]     1       6       0x8049348    0x1348       0x3           .init   [6]     1       6       0x8049348    0x1348       0x3           .init
111          0       0       0x4          0           0       0       0x4          0
112    
113  [7]     1       6       0x804934c    0x134c       0x680         .plt   [7]     1       6       0x804934c    0x134c       0x680         .plt
114          0       0       0x4          0x4           0       0       0x4          0x4
115    
116  [8]     1       6       0x80499cc    0x19cc       0x3c56f       .text   [8]     1       6       0x80499cc    0x19cc       0x3c56f       .text
117          0       0       0x4          0           0       0       0x4          0
118    
119  [9]     1       6       0x8085f3c    0x3df3c      0x3           .fini   [9]     1       6       0x8085f3c    0x3df3c      0x3           .fini
120          0       0       0x4          0           0       0       0x4          0
121    
122  [10]    1       2       0x8085f40    0x3df40      0x69c         .rodata   [10]    1       2       0x8085f40    0x3df40      0x69c         .rodata
123          0       0       0x4          0           0       0       0x4          0
124    
125  [11]    1       2       0x80865dc    0x3e5dc      0xd51         .rodata1   [11]    1       2       0x80865dc    0x3e5dc      0xd51         .rodata1
126          0       0       0x4          0           0       0       0x4          0
127    
128  [12]    1       3       0x8088330    0x3f330      0x20afc       .data   [12]    1       3       0x8088330    0x3f330      0x20afc       .data
129          0       0       0x4          0           0       0       0x4          0
130    
131  [13]    1       3       0x80a8e2c    0x5fe2c      0x89d         .data1   [13]    1       3       0x80a8e2c    0x5fe2c      0x89d         .data1
132          0       0       0x4          0           0       0       0x4          0
133    
134  [14]    1       3       0x80a96cc    0x606cc      0x1a8         .got   [14]    1       3       0x80a96cc    0x606cc      0x1a8         .got
135          0       0       0x4          0x4           0       0       0x4          0x4
136    
137  [15]    6       3       0x80a9874    0x60874      0x80          .dynamic   [15]    6       3       0x80a9874    0x60874      0x80          .dynamic
138          4       0       0x4          0x8           4       0       0x4          0x8
139    
140  [16]    8       3       0x80a98f4    0x608f4      0x449c        .bss   [16]    8       3       0x80a98f4    0x608f4      0x449c        .bss
141          0       0       0x4          0           0       0       0x4          0
142    
143  [17]    2       0       0            0x608f4      0x9b90        .symtab   [17]    2       0       0            0x608f4      0x9b90        .symtab
144          18      371     0x4          0x10           18      371     0x4          0x10
145    
146  [18]    3       0       0            0x6a484      0x8526        .strtab   [18]    3       0       0            0x6a484      0x8526        .strtab
147          0       0       0x1          0           0       0       0x1          0
148    
149  [19]    3       0       0            0x729aa      0x93          .shstrtab   [19]    3       0       0            0x729aa      0x93          .shstrtab
150          0       0       0x1          0           0       0       0x1          0
151    
152  [20]    1       0       0            0x72a3d      0x68b7        .comment   [20]    1       0       0            0x72a3d      0x68b7        .comment
153          0       0       0x1          0           0       0       0x1          0
154    
155  raid:/nfs/raid/src/dist-18.56/src> dump -h xemacs   raid:/nfs/raid/src/dist-18.56/src> dump -h xemacs
156    
157  xemacs:   xemacs:
158    
159             **** SECTION HEADER TABLE ****              **** SECTION HEADER TABLE ****
160  [No]    Type    Flags   Addr         Offset       Size          Name   [No]    Type    Flags   Addr         Offset       Size          Name
161          Link    Info    Adralgn      Entsize           Link    Info    Adralgn      Entsize
162    
163  [1]     1       2       0x80480d4    0xd4         0x13          .interp   [1]     1       2       0x80480d4    0xd4         0x13          .interp
164          0       0       0x1          0           0       0       0x1          0
165    
166  [2]     5       2       0x80480e8    0xe8         0x388         .hash   [2]     5       2       0x80480e8    0xe8         0x388         .hash
167          3       0       0x4          0x4           3       0       0x4          0x4
168    
169  [3]     11      2       0x8048470    0x470        0x7f0         .dynsym   [3]     11      2       0x8048470    0x470        0x7f0         .dynsym
170          4       1       0x4          0x10           4       1       0x4          0x10
171    
172  [4]     3       2       0x8048c60    0xc60        0x3ad         .dynstr   [4]     3       2       0x8048c60    0xc60        0x3ad         .dynstr
173          0       0       0x1          0           0       0       0x1          0
174    
175  [5]     9       2       0x8049010    0x1010       0x338         .rel.plt   [5]     9       2       0x8049010    0x1010       0x338         .rel.plt
176          3       7       0x4          0x8           3       7       0x4          0x8
177    
178  [6]     1       6       0x8049348    0x1348       0x3           .init   [6]     1       6       0x8049348    0x1348       0x3           .init
179          0       0       0x4          0           0       0       0x4          0
180    
181  [7]     1       6       0x804934c    0x134c       0x680         .plt   [7]     1       6       0x804934c    0x134c       0x680         .plt
182          0       0       0x4          0x4           0       0       0x4          0x4
183    
184  [8]     1       6       0x80499cc    0x19cc       0x3c56f       .text   [8]     1       6       0x80499cc    0x19cc       0x3c56f       .text
185          0       0       0x4          0           0       0       0x4          0
186    
187  [9]     1       6       0x8085f3c    0x3df3c      0x3           .fini   [9]     1       6       0x8085f3c    0x3df3c      0x3           .fini
188          0       0       0x4          0           0       0       0x4          0
189    
190  [10]    1       2       0x8085f40    0x3df40      0x69c         .rodata   [10]    1       2       0x8085f40    0x3df40      0x69c         .rodata
191          0       0       0x4          0           0       0       0x4          0
192    
193  [11]    1       2       0x80865dc    0x3e5dc      0xd51         .rodata1   [11]    1       2       0x80865dc    0x3e5dc      0xd51         .rodata1
194          0       0       0x4          0           0       0       0x4          0
195    
196  [12]    1       3       0x8088330    0x3f330      0x20afc       .data   [12]    1       3       0x8088330    0x3f330      0x20afc       .data
197          0       0       0x4          0           0       0       0x4          0
198    
199  [13]    1       3       0x80a8e2c    0x5fe2c      0x89d         .data1   [13]    1       3       0x80a8e2c    0x5fe2c      0x89d         .data1
200          0       0       0x4          0           0       0       0x4          0
201    
202  [14]    1       3       0x80a96cc    0x606cc      0x1a8         .got   [14]    1       3       0x80a96cc    0x606cc      0x1a8         .got
203          0       0       0x4          0x4           0       0       0x4          0x4
204    
205  [15]    6       3       0x80a9874    0x60874      0x80          .dynamic   [15]    6       3       0x80a9874    0x60874      0x80          .dynamic
206          4       0       0x4          0x8           4       0       0x4          0x8
207    
208  [16]    8       3       0x80c6800    0x7d800      0             .bss   [16]    8       3       0x80c6800    0x7d800      0             .bss
209          0       0       0x4          0           0       0       0x4          0
210    
211  [17]    2       0       0            0x7d800      0x9b90        .symtab   [17]    2       0       0            0x7d800      0x9b90        .symtab
212          18      371     0x4          0x10           18      371     0x4          0x10
213    
214  [18]    3       0       0            0x87390      0x8526        .strtab   [18]    3       0       0            0x87390      0x8526        .strtab
215          0       0       0x1          0           0       0       0x1          0
216    
217  [19]    3       0       0            0x8f8b6      0x93          .shstrtab   [19]    3       0       0            0x8f8b6      0x93          .shstrtab
218          0       0       0x1          0           0       0       0x1          0
219    
220  [20]    1       0       0            0x8f949      0x68b7        .comment   [20]    1       0       0            0x8f949      0x68b7        .comment
221          0       0       0x1          0           0       0       0x1          0
222    
223  [21]    1       3       0x80a98f4    0x608f4      0x1cf0c       .data   [21]    1       3       0x80a98f4    0x608f4      0x1cf0c       .data
224          0       0       0x4          0           0       0       0x4          0
225    
226   * This is an example of how the file header is changed.  "Shoff" is    * This is an example of how the file header is changed.  "Shoff" is
227   * the section header offset within the file.  Since that table is    * the section header offset within the file.  Since that table is
228   * after the new .data section, it is moved.  "Shnum" is the number of    * after the new .data section, it is moved.  "Shnum" is the number of
229   * sections, which we increment.    * sections, which we increment.
230   *    *
231   * "Phoff" is the file offset to the program header.  "Phentsize" and    * "Phoff" is the file offset to the program header.  "Phentsize" and
232   * "Shentsz" are the program and section header entries sizes respectively.    * "Shentsz" are the program and section header entries sizes respectively.
233   * These can be larger than the apparent struct sizes.    * These can be larger than the apparent struct sizes.
234    
235  raid:/nfs/raid/src/dist-18.56/src> dump -f temacs   raid:/nfs/raid/src/dist-18.56/src> dump -f temacs
236    
237  temacs:   temacs:
238    
239                      **** ELF HEADER ****                       **** ELF HEADER ****
240  Class        Data       Type         Machine     Version   Class        Data       Type         Machine     Version
241  Entry        Phoff      Shoff        Flags       Ehsize   Entry        Phoff      Shoff        Flags       Ehsize
242  Phentsize    Phnum      Shentsz      Shnum       Shstrndx   Phentsize    Phnum      Shentsz      Shnum       Shstrndx
   
 1            1          2            3           1  
 0x80499cc    0x34       0x792f4      0           0x34  
 0x20         5          0x28         21          19  
   
 raid:/nfs/raid/src/dist-18.56/src> dump -f xemacs  
   
 xemacs:  
   
                     **** ELF HEADER ****  
 Class        Data       Type         Machine     Version  
 Entry        Phoff      Shoff        Flags       Ehsize  
 Phentsize    Phnum      Shentsz      Shnum       Shstrndx  
   
 1            1          2            3           1  
 0x80499cc    0x34       0x96200      0           0x34  
 0x20         5          0x28         22          19  
   
  * These are the program headers.  "Offset" is the file offset to the  
  * segment.  "Vaddr" is the memory load address.  "Filesz" is the  
  * segment size as it appears in the file, and "Memsz" is the size in  
  * memory.  Below, the third segment is the code and the fourth is the  
  * data: the difference between Filesz and Memsz is .bss  
243    
244  raid:/nfs/raid/src/dist-18.56/src> dump -o temacs   1            1          2            3           1
245     0x80499cc    0x34       0x792f4      0           0x34
246     0x20         5          0x28         21          19
247    
248  temacs:   raid:/nfs/raid/src/dist-18.56/src> dump -f xemacs
249   ***** PROGRAM EXECUTION HEADER *****  
250  Type        Offset      Vaddr       Paddr   xemacs:
251  Filesz      Memsz       Flags       Align  
252                         **** ELF HEADER ****
253     Class        Data       Type         Machine     Version
254     Entry        Phoff      Shoff        Flags       Ehsize
255     Phentsize    Phnum      Shentsz      Shnum       Shstrndx
256    
257     1            1          2            3           1
258     0x80499cc    0x34       0x96200      0           0x34
259     0x20         5          0x28         22          19
260    
261      * These are the program headers.  "Offset" is the file offset to the
262      * segment.  "Vaddr" is the memory load address.  "Filesz" is the
263      * segment size as it appears in the file, and "Memsz" is the size in
264      * memory.  Below, the third segment is the code and the fourth is the
265      * data: the difference between Filesz and Memsz is .bss
266    
267  6           0x34        0x8048034   0   raid:/nfs/raid/src/dist-18.56/src> dump -o temacs
 0xa0        0xa0        5           0  
268    
269  3           0xd4        0           0   temacs:
270  0x13        0           4           0    ***** PROGRAM EXECUTION HEADER *****
271     Type        Offset      Vaddr       Paddr
272     Filesz      Memsz       Flags       Align
273    
274  1           0x34        0x8048034   0   6           0x34        0x8048034   0
275  0x3f2f9     0x3f2f9     5           0x1000   0xa0        0xa0        5           0
276    
277  1           0x3f330     0x8088330   0   3           0xd4        0           0
278  0x215c4     0x25a60     7           0x1000   0x13        0           4           0
279    
280  2           0x60874     0x80a9874   0   1           0x34        0x8048034   0
281  0x80        0           7           0   0x3f2f9     0x3f2f9     5           0x1000
282    
283  raid:/nfs/raid/src/dist-18.56/src> dump -o xemacs   1           0x3f330     0x8088330   0
284     0x215c4     0x25a60     7           0x1000
285    
286  xemacs:   2           0x60874     0x80a9874   0
287   ***** PROGRAM EXECUTION HEADER *****   0x80        0           7           0
 Type        Offset      Vaddr       Paddr  
 Filesz      Memsz       Flags       Align  
288    
289  6           0x34        0x8048034   0   raid:/nfs/raid/src/dist-18.56/src> dump -o xemacs
 0xa0        0xa0        5           0  
290    
291  3           0xd4        0           0   xemacs:
292  0x13        0           4           0    ***** PROGRAM EXECUTION HEADER *****
293     Type        Offset      Vaddr       Paddr
294     Filesz      Memsz       Flags       Align
295    
296  1           0x34        0x8048034   0   6           0x34        0x8048034   0
297  0x3f2f9     0x3f2f9     5           0x1000   0xa0        0xa0        5           0
298    
299  1           0x3f330     0x8088330   0   3           0xd4        0           0
300  0x3e4d0     0x3e4d0     7           0x1000   0x13        0           4           0
301    
302  2           0x60874     0x80a9874   0   1           0x34        0x8048034   0
303  0x80        0           7           0   0x3f2f9     0x3f2f9     5           0x1000
304    
305     1           0x3f330     0x8088330   0
306     0x3e4d0     0x3e4d0     7           0x1000
307    
308     2           0x60874     0x80a9874   0
309     0x80        0           7           0
310    
311    
312   */   */
# Line 336  Filesz      Memsz       Flags       Alig Line 336  Filesz      Memsz       Flags       Alig
336   * The above example now should look like:   * The above example now should look like:
337    
338             **** SECTION HEADER TABLE ****             **** SECTION HEADER TABLE ****
339  [No]    Type    Flags   Addr         Offset       Size          Name   [No]    Type    Flags   Addr         Offset       Size          Name
340          Link    Info    Adralgn      Entsize           Link    Info    Adralgn      Entsize
341    
342  [1]     1       2       0x80480d4    0xd4         0x13          .interp   [1]     1       2       0x80480d4    0xd4         0x13          .interp
343          0       0       0x1          0           0       0       0x1          0
344    
345  [2]     5       2       0x80480e8    0xe8         0x388         .hash   [2]     5       2       0x80480e8    0xe8         0x388         .hash
346          3       0       0x4          0x4           3       0       0x4          0x4
347    
348  [3]     11      2       0x8048470    0x470        0x7f0         .dynsym   [3]     11      2       0x8048470    0x470        0x7f0         .dynsym
349          4       1       0x4          0x10           4       1       0x4          0x10
350    
351  [4]     3       2       0x8048c60    0xc60        0x3ad         .dynstr   [4]     3       2       0x8048c60    0xc60        0x3ad         .dynstr
352          0       0       0x1          0           0       0       0x1          0
353    
354  [5]     9       2       0x8049010    0x1010       0x338         .rel.plt   [5]     9       2       0x8049010    0x1010       0x338         .rel.plt
355          3       7       0x4          0x8           3       7       0x4          0x8
356    
357  [6]     1       6       0x8049348    0x1348       0x3           .init   [6]     1       6       0x8049348    0x1348       0x3           .init
358          0       0       0x4          0           0       0       0x4          0
359    
360  [7]     1       6       0x804934c    0x134c       0x680         .plt   [7]     1       6       0x804934c    0x134c       0x680         .plt
361          0       0       0x4          0x4           0       0       0x4          0x4
362    
363  [8]     1       6       0x80499cc    0x19cc       0x3c56f       .text   [8]     1       6       0x80499cc    0x19cc       0x3c56f       .text
364          0       0       0x4          0           0       0       0x4          0
365    
366  [9]     1       6       0x8085f3c    0x3df3c      0x3           .fini   [9]     1       6       0x8085f3c    0x3df3c      0x3           .fini
367          0       0       0x4          0           0       0       0x4          0
368    
369  [10]    1       2       0x8085f40    0x3df40      0x69c         .rodata   [10]    1       2       0x8085f40    0x3df40      0x69c         .rodata
370          0       0       0x4          0           0       0       0x4          0
371    
372  [11]    1       2       0x80865dc    0x3e5dc      0xd51         .rodata1   [11]    1       2       0x80865dc    0x3e5dc      0xd51         .rodata1
373          0       0       0x4          0           0       0       0x4          0
374    
375  [12]    1       3       0x8088330    0x3f330      0x20afc       .data   [12]    1       3       0x8088330    0x3f330      0x20afc       .data
376          0       0       0x4          0           0       0       0x4          0
377    
378  [13]    1       3       0x80a8e2c    0x5fe2c      0x89d         .data1   [13]    1       3       0x80a8e2c    0x5fe2c      0x89d         .data1
379          0       0       0x4          0           0       0       0x4          0
380    
381  [14]    1       3       0x80a96cc    0x606cc      0x1a8         .got   [14]    1       3       0x80a96cc    0x606cc      0x1a8         .got
382          0       0       0x4          0x4           0       0       0x4          0x4
383    
384  [15]    6       3       0x80a9874    0x60874      0x80          .dynamic   [15]    6       3       0x80a9874    0x60874      0x80          .dynamic
385          4       0       0x4          0x8           4       0       0x4          0x8
386    
387  [16]    1       3       0x80a98f4    0x608f4      0x1cf0c       .data   [16]    1       3       0x80a98f4    0x608f4      0x1cf0c       .data
388          0       0       0x4          0           0       0       0x4          0
389    
390  [17]    8       3       0x80c6800    0x7d800      0             .bss   [17]    8       3       0x80c6800    0x7d800      0             .bss
391          0       0       0x4          0           0       0       0x4          0
392    
393  [18]    2       0       0            0x7d800      0x9b90        .symtab   [18]    2       0       0            0x7d800      0x9b90        .symtab
394          19      371     0x4          0x10           19      371     0x4          0x10
395    
396  [19]    3       0       0            0x87390      0x8526        .strtab   [19]    3       0       0            0x87390      0x8526        .strtab
397          0       0       0x1          0           0       0       0x1          0
398    
399  [20]    3       0       0            0x8f8b6      0x93          .shstrtab   [20]    3       0       0            0x8f8b6      0x93          .shstrtab
400          0       0       0x1          0           0       0       0x1          0
401    
402  [21]    1       0       0            0x8f949      0x68b7        .comment   [21]    1       0       0            0x8f949      0x68b7        .comment
403          0       0       0x1          0           0       0       0x1          0
404    
405   */   */
406    
# Line 476  typedef struct { Line 476  typedef struct {
476          long cbFdOffset;          long cbFdOffset;
477          long cbRfdOffset;          long cbRfdOffset;
478          long cbExtOffset;          long cbExtOffset;
479  } HDRR, *pHDRR;  } HDRR, *pHDRR;
480  #define cbHDRR sizeof(HDRR)  #define cbHDRR sizeof(HDRR)
481  #define hdrNil ((pHDRR)0)  #define hdrNil ((pHDRR)0)
482  #endif  #endif
# Line 930  unexec (new_name, old_name, data_start, Line 930  unexec (new_name, old_name, data_start,
930    
931        memcpy (&NEW_SECTION_H (nn), &OLD_SECTION_H (n),        memcpy (&NEW_SECTION_H (nn), &OLD_SECTION_H (n),
932                old_file_h->e_shentsize);                old_file_h->e_shentsize);
933          
934        if (n == old_bss_index        if (n == old_bss_index
935            /* The new bss and sbss section's size is zero, and its file offset            /* The new bss and sbss section's size is zero, and its file offset
936               and virtual address should be off by NEW_DATA2_SIZE.  */               and virtual address should be off by NEW_DATA2_SIZE.  */
# Line 987  unexec (new_name, old_name, data_start, Line 987  unexec (new_name, old_name, data_start,
987        if (NEW_SECTION_H (nn).sh_type != SHT_SYMTAB        if (NEW_SECTION_H (nn).sh_type != SHT_SYMTAB
988            && NEW_SECTION_H (nn).sh_type != SHT_DYNSYM)            && NEW_SECTION_H (nn).sh_type != SHT_DYNSYM)
989          PATCH_INDEX (NEW_SECTION_H (nn).sh_info);          PATCH_INDEX (NEW_SECTION_H (nn).sh_info);
990          
991        if (old_sbss_index != -1)        if (old_sbss_index != -1)
992          if (!strcmp (old_section_names + NEW_SECTION_H (nn).sh_name, ".sbss"))          if (!strcmp (old_section_names + NEW_SECTION_H (nn).sh_name, ".sbss"))
993            {            {
994              NEW_SECTION_H (nn).sh_offset =              NEW_SECTION_H (nn).sh_offset =
995                round_up (NEW_SECTION_H (nn).sh_offset,                round_up (NEW_SECTION_H (nn).sh_offset,
996                          NEW_SECTION_H (nn).sh_addralign);                          NEW_SECTION_H (nn).sh_addralign);
997              NEW_SECTION_H (nn).sh_type = SHT_PROGBITS;              NEW_SECTION_H (nn).sh_type = SHT_PROGBITS;
# Line 1012  unexec (new_name, old_name, data_start, Line 1012  unexec (new_name, old_name, data_start,
1012                        ".lit4")                        ".lit4")
1013            || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name),            || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name),
1014                        ".lit8")                        ".lit8")
1015              /* The conditional bit below was in Oliva's original code
1016                 (1999-08-25) and seems to have been dropped by mistake
1017                 subsequently.  It prevents a crash at startup under X in
1018                 `IRIX64 6.5 6.5.17m', whether compiled on that relase or
1019                 an earlier one.  It causes no trouble on the other ELF
1020                 platforms I could test (Irix 6.5.15m, Solaris 8, Debian
1021                 Potato x86, Debian Woody SPARC); however, it's reported
1022                 to cause crashes under some version of GNU/Linux.  It's
1023                 not yet clear what's changed in that Irix version to
1024                 cause the problem, or why the fix sometimes fails under
1025                 GNU/Linux.  There's probably no good reason to have
1026                 something Irix-specific here, but this will have to do
1027                 for now.  IRIX6_5 is the most specific macro we have to
1028                 test.  -- fx 2002-10-01
1029    
1030                 The issue _looks_ as though it's gone away on 6.5.18m,
1031                 but maybe it's still lurking, to be triggered by some
1032                 change in the binary.  It appears to concern the dynamic
1033                 loader, but I never got anywhere with an SGI support call
1034                 seeking clues.  -- fx 2002-11-29.  */
1035    #ifdef IRIX6_5
1036              || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name),
1037                          ".got")
1038    #endif
1039            || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name),            || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name),
1040                        ".sdata1")                        ".sdata1")
1041            || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name),            || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name),
# Line 1048  unexec (new_name, old_name, data_start, Line 1072  unexec (new_name, old_name, data_start,
1072    
1073  #if defined (__sony_news) && defined (_SYSTYPE_SYSV)  #if defined (__sony_news) && defined (_SYSTYPE_SYSV)
1074        if (NEW_SECTION_H (nn).sh_type == SHT_MIPS_DEBUG        if (NEW_SECTION_H (nn).sh_type == SHT_MIPS_DEBUG
1075            && old_mdebug_index != -1)            && old_mdebug_index != -1)
1076          {          {
1077            int diff = NEW_SECTION_H(nn).sh_offset            int diff = NEW_SECTION_H(nn).sh_offset
1078                  - OLD_SECTION_H(old_mdebug_index).sh_offset;                  - OLD_SECTION_H(old_mdebug_index).sh_offset;
1079            HDRR *phdr = (HDRR *)(NEW_SECTION_H (nn).sh_offset + new_base);            HDRR *phdr = (HDRR *)(NEW_SECTION_H (nn).sh_offset + new_base);
1080    
# Line 1072  unexec (new_name, old_name, data_start, Line 1096  unexec (new_name, old_name, data_start,
1096  #endif /* __sony_news && _SYSTYPE_SYSV */  #endif /* __sony_news && _SYSTYPE_SYSV */
1097    
1098  #if __sgi  #if __sgi
1099        /* Adjust  the HDRR offsets in .mdebug and copy the        /* Adjust  the HDRR offsets in .mdebug and copy the
1100           line data if it's in its usual 'hole' in the object.           line data if it's in its usual 'hole' in the object.
1101           Makes the new file debuggable with dbx.           Makes the new file debuggable with dbx.
1102           patches up two problems: the absolute file offsets           patches up two problems: the absolute file offsets
# Line 1178  unexec (new_name, old_name, data_start, Line 1202  unexec (new_name, old_name, data_start,
1202        /* Cause a compilation error if anyone uses n instead of nn below.  */        /* Cause a compilation error if anyone uses n instead of nn below.  */
1203        struct {int a;} n;        struct {int a;} n;
1204    
1205        switch (section.sh_type)        switch (section.sh_type)
1206          {          {
1207          default:          default:
1208            break;            break;
# Line 1195  unexec (new_name, old_name, data_start, Line 1219  unexec (new_name, old_name, data_start,
1219                            ".lit4")                            ".lit4")
1220                || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),                || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),
1221                            ".lit8")                            ".lit8")
1222    #ifdef IRIX6_5                  /* see above */
1223                  || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),
1224                              ".got")
1225    #endif
1226                || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),                || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),
1227                            ".sdata1")                            ".sdata1")
1228                || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),                || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),
# Line 1224  unexec (new_name, old_name, data_start, Line 1252  unexec (new_name, old_name, data_start,
1252    /* Write out new_file, and free the buffers.  */    /* Write out new_file, and free the buffers.  */
1253    
1254    if (write (new_file, new_base, new_file_size) != new_file_size)    if (write (new_file, new_base, new_file_size) != new_file_size)
1255      fatal ("Didn't write %d bytes to %s: errno %d\n",      fatal ("Didn't write %d bytes to %s: errno %d\n",
1256             new_file_size, new_base, errno);             new_file_size, new_base, errno);
1257    
1258    munmap (old_base, old_file_size);    munmap (old_base, old_file_size);

Legend:
Removed from v.1.48  
changed lines
  Added in v.1.48.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26