Mercurial > emacs
comparison src/unexw32.c @ 24669:66df82aa955e
(get_section_info): Dump back the entire EMDATA
section if we can put Emacs' initialized data in a separate
section, otherwise use the my_begdata/my_edata method.
author | Andrew Innes <andrewi@gnu.org> |
---|---|
date | Sun, 02 May 1999 10:13:08 +0000 |
parents | 16e5582ed876 |
children | a67730c51617 |
comparison
equal
deleted
inserted
replaced
24668:6c9eaa09906c | 24669:66df82aa955e |
---|---|
378 to preserve. Then we map these VAs to the section entries in the | 378 to preserve. Then we map these VAs to the section entries in the |
379 source image. Finally, we determine the new size of the raw data | 379 source image. Finally, we determine the new size of the raw data |
380 area for the bss section, so we can make the new image the correct | 380 area for the bss section, so we can make the new image the correct |
381 size. */ | 381 size. */ |
382 | 382 |
383 data_start = my_begdata; | 383 /* We arrange for the Emacs initialized data to be in a separate |
384 data_size = my_edata - my_begdata; | 384 section if possible, because we cannot rely on my_begdata and |
385 data_section = rva_to_section (PTR_TO_RVA (my_begdata), nt_header); | 385 my_edata marking out the full extent of the initialized data, at |
386 if (data_section != rva_to_section (PTR_TO_RVA (my_edata), nt_header)) | 386 least on the Alpha where the linker freely reorders variables |
387 { | 387 across libraries. If we can arrange for this, all we need to do is |
388 printf ("Initialized data is not in a single section...bailing\n"); | 388 find the start and size of the EMDATA section. */ |
389 exit (1); | 389 data_section = find_section ("EMDATA", nt_header); |
390 if (data_section) | |
391 { | |
392 data_start = (char *) nt_header->OptionalHeader.ImageBase + | |
393 data_section->VirtualAddress; | |
394 data_size = data_section->Misc.VirtualSize; | |
395 } | |
396 else | |
397 { | |
398 /* Fallback on the old method if compiler doesn't support the | |
399 data_set #pragma (or its equivalent). */ | |
400 data_start = my_begdata; | |
401 data_size = my_edata - my_begdata; | |
402 data_section = rva_to_section (PTR_TO_RVA (my_begdata), nt_header); | |
403 if (data_section != rva_to_section (PTR_TO_RVA (my_edata), nt_header)) | |
404 { | |
405 printf ("Initialized data is not in a single section...bailing\n"); | |
406 exit (1); | |
407 } | |
390 } | 408 } |
391 | 409 |
392 /* As noted in lastfile.c, the Alpha (but not the Intel) MSVC linker | 410 /* As noted in lastfile.c, the Alpha (but not the Intel) MSVC linker |
393 globally segregates all static and public bss data (ie. across all | 411 globally segregates all static and public bss data (ie. across all |
394 linked modules, not just per module), so we must take both static | 412 linked modules, not just per module), so we must take both static |