diff options
| author | Andrew Innes | 1999-05-02 10:13:08 +0000 |
|---|---|---|
| committer | Andrew Innes | 1999-05-02 10:13:08 +0000 |
| commit | e3ddd18c28c58472ef8e707a30f06703ef95e177 (patch) | |
| tree | b2997dfe1317b10693b83b688fc77d793157dea3 /src | |
| parent | 9551468ff4aeb9dec3b7284b07f5bc41c27c8b41 (diff) | |
| download | emacs-e3ddd18c28c58472ef8e707a30f06703ef95e177.tar.gz emacs-e3ddd18c28c58472ef8e707a30f06703ef95e177.zip | |
(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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/unexw32.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/unexw32.c b/src/unexw32.c index 743ce0086f6..2aa2a529329 100644 --- a/src/unexw32.c +++ b/src/unexw32.c | |||
| @@ -380,13 +380,31 @@ get_section_info (file_data *p_infile) | |||
| 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 | across libraries. If we can arrange for this, all we need to do is | ||
| 388 | find the start and size of the EMDATA section. */ | ||
| 389 | data_section = find_section ("EMDATA", nt_header); | ||
| 390 | if (data_section) | ||
| 387 | { | 391 | { |
| 388 | printf ("Initialized data is not in a single section...bailing\n"); | 392 | data_start = (char *) nt_header->OptionalHeader.ImageBase + |
| 389 | exit (1); | 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 |