Verified Commit c3fa5c46 authored by Camil Staps's avatar Camil Staps
Browse files

Include _startup3.o and _startup4.o when linking on Windows; generate correct...

Include _startup3.o and _startup4.o when linking on Windows; generate correct options file on 64-bit Windows
parent eaff7eb8
......@@ -663,10 +663,10 @@ int find_clean_system_file (char *file_name,char *extension,char *complete_file_
#ifdef _WINDOWS_
/* Special case for run time system on windows:
The _startup.dcl file is implemented by multiple .o files
(_startup0.o, _startup1.o, _startup2.o)
If _startup0.o is searched for, _startup.dlc
(_startup0.o, _startup1.o, _startup2.o, etc.)
If _startup0.o is searched for, _startup.dcl
*/
if(!strcmp(file_name,"_startup0") || !strcmp(file_name,"_startup1") || !strcmp(file_name,"_startup2")) {
if(!strncmp(file_name,"_startup",8) && isdigit(file_name[8]) && file_name[9]=='\0') {
found = find_file("_startup",".dcl",complete_file_name,first_path,file_time_p);
if(found) {
/* Replace "_startup.dcl" at the end of the file name with the original
......@@ -2449,7 +2449,11 @@ data [] =
# endif
int_to_2_chars (3)/*n_sections*/,
int_to_4_chars (817729185)/*time_date_stamp*/,
# ifdef A_64
int_to_4_chars (188)/*symbol_table_pointer*/,
# else
int_to_4_chars (164)/*symbol_table_pointer*/,
# endif
int_to_4_chars (14)/*n_symbols*/,
int_to_2_chars (0)/*optional_header_size*/,
int_to_2_chars (0x0104)/*characteristics*/,
......@@ -2488,105 +2492,170 @@ data [] =
int_to_4_chars (0xc0000080)/*bss_section_flags*/,
/* data section offset 140 */
int_to_4_chars (0)/*heap_size*/,
# ifdef A_64
int_to_4_chars (0),
# endif
int_to_4_chars (0)/*stack_size*/,
# ifdef A_64
int_to_4_chars (0),
# endif
int_to_4_chars (0)/*flags*/,
# ifdef A_64
int_to_4_chars (0),
# endif
int_to_4_chars (0)/*initial_heap_size*/,
# ifdef A_64
int_to_4_chars (0),
# endif
int_to_4_chars (0)/*heap_size_multiple*/,
# ifdef A_64
int_to_4_chars (0),
# endif
int_to_4_chars (0)/*min_write_heap_size*/,
# ifdef A_64
int_to_4_chars (0),
# endif
/* symbol table offset */
/* .file at 164 */
/* .file at 164 / 188 */
'.','f','i','l', 'e','\0','\0','\0',
int_to_4_chars (0)/*file_value*/,
int_to_2_chars (65534)/*file_section_n(IMAGE_SYM_DEBUG)*/,
int_to_2_chars (0)/*file_type*/,
(char) 103/*file_storage_class(IMAGE_SYM_CLASS_FILE)*/,
(char) 1/*file_n_aux_sections*/,
/* fake (aux to .file) at 182 */
/* fake (aux to .file) at 182 / 206 */
'f','a','k','e','\0','\0','\0','\0',
int_to_4_chars (0)/*file_aux_value*/,
int_to_2_chars (0)/*file_aux_section_n(IMAGE_SYM_UNDEFINED)*/,
int_to_2_chars (0)/*file_aux_type*/,
(char) 0/*file_aux_storage_class(IMAGE_SYM_CLASS_NULL)*/,
(char) 0 /*file_aux_n_aux_sections*/,
/* .text at 200 */
/* .text at 200 / 224 */
'.','t','e','x','t','\0','\0','\0',
int_to_4_chars (0)/*text_value*/,
int_to_2_chars (1)/*text_section_n*/,
int_to_2_chars (0)/*text_type*/,
(char) 3/*text_storage_class(IMAGE_SYM_CLASS_STATIC)*/,
(char) 1/*text_n_aux_sections*/,
/* null to .text at 214 */
/* null to .text at 214 / 238 */
int_to_4_chars (0)/*text_raw_data_size*/,
'\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0'/*null_aux_entry*/,
/* .data at 236 */
/* .data at 236 / 260 */
'.','d','a','t','a','\0','\0','\0',
int_to_4_chars (0)/*data_value*/,
int_to_2_chars (2)/*data_section_n*/,
int_to_2_chars (0)/*data_type*/,
(char) 3/*data_storage_class(IMAGE_SYM_CLASS_STATIC)*/,
(char) 1/*data_n_aux_sections*/,
/* null to .data at 254 */
/* null to .data at 254 / 278 */
# ifdef A_64
int_to_4_chars (48)/*data_raw_data_size*/,
# else
int_to_4_chars (24)/*data_raw_data_size*/,
# endif
'\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0'/*null_aux_entry*/,
/* .bss at 272 */
/* .bss at 272 / 296 */
'.','b','s','s','\0','\0','\0','\0',
int_to_4_chars (20)/*bss_value*/,
int_to_2_chars (3)/*bss_section_n*/,
int_to_2_chars (0)/*bss_type*/,
(char) 3/*bss_storage_class(IMAGE_SYM_CLASS_STATIC)*/,
(char) 1/*bss_n_aux_sections*/,
/* null to .bss at 290 */
/* null to .bss at 290 / 314 */
int_to_4_chars (0)/*bss_raw_data_size*/,
'\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0'/*null_aux_entry*/,
/* _heap_size at 306 */
/* _heap_size at 306 / 330 */
int_to_4_chars (0), int_to_4_chars (4)/*heap_size_offset*/,
int_to_4_chars (0)/*heap_size_value*/,
int_to_2_chars (2)/*heap_size_section_n*/,
int_to_2_chars (0)/*heap_size_type*/,
(char) 2/*heap_size_class(IMAGE_SYM_CLASS_EXTERNAL)*/,
(char) 0/*heap_size_n_aux_sections*/,
/* _ab_stack_size at 326 */
int_to_4_chars (0), int_to_4_chars (15)/*ab_stack_size_offset*/,
/* _ab_stack_size at 326 / 360 */
int_to_4_chars (0), int_to_4_chars (14)/*ab_stack_size_offset*/,
# ifdef A_64
int_to_4_chars (8)/*ab_stack_size_value*/,
# else
int_to_4_chars (4)/*ab_stack_size_value*/,
# endif
int_to_2_chars (2)/*ab_stack_size_section_n*/,
int_to_2_chars (0)/*ab_stack_size_type*/,
(char) 2/*ab_stack_size_class(IMAGE_SYM_CLASS_EXTERNAL)*/,
(char) 0/*ab_stack_size_n_aux_sections*/,
/* _flags at 344 */
'_','f','l','a','g','s','\0','\0',
/* _flags at 344 / 368 */
# ifndef A_64
'_',
# endif
'f','l','a','g','s','\0','\0',
# ifdef A_64
'\0',
# endif
# ifdef A_64
int_to_4_chars (16)/*flags_value*/,
# else
int_to_4_chars (8)/*flags_value*/,
# endif
int_to_2_chars (2)/*flags_section_n*/,
int_to_2_chars (0)/*flags_type*/,
(char) 2/*flags_class(IMAGE_SYM_CLASS_EXTERNAL)*/,
(char) 0/*flags_n_aux_sections*/,
/* _initial_heap_size at 362 */
int_to_4_chars (0), int_to_4_chars (30)/*initial_heap_size_offset*/,
/* _initial_heap_size at 362 / 386 */
int_to_4_chars (0), int_to_4_chars (28)/*initial_heap_size_offset*/,
# ifdef A_64
int_to_4_chars (24)/*initial_heap_size_value*/,
# else
int_to_4_chars (12)/*initial_heap_size_value*/,
# endif
int_to_2_chars (2)/*initial_heap_size_section_n*/,
int_to_2_chars (0)/*initial_heap_size_type*/,
(char) 2/*initial_heap_size_class(IMAGE_SYM_CLASS_EXTERNAL)*/,
(char) 0/*initial_heap_size_n_aux_sections*/,
/* _heap_size_multiple at 378 */
int_to_4_chars (0), int_to_4_chars (49)/*heap_size_multiple_offset*/,
/* _heap_size_multiple at 378 / 402 */
int_to_4_chars (0), int_to_4_chars (46)/*heap_size_multiple_offset*/,
# ifdef A_64
int_to_4_chars (32)/*heap_size_multiple_value*/,
# else
int_to_4_chars (16)/*heap_size_multiple_value*/,
# endif
int_to_2_chars (2)/*heap_size_multiple_section_n*/,
int_to_2_chars (0)/*heap_size_multiple_type*/,
(char) 2/*heap_size_multiple_class(IMAGE_SYM_CLASS_EXTERNAL)*/,
(char) 0/*heap_size_multiple_n_aux_sections*/,
/* _min_write_heap_size at 396 */
int_to_4_chars (0), int_to_4_chars(69)/*min_write_heap_size_offset*/,
/* _min_write_heap_size at 396 / 420 */
int_to_4_chars (0), int_to_4_chars(65)/*min_write_heap_size_offset*/,
# ifdef A_64
int_to_4_chars (40)/*min_write_heap_size_value*/,
# else
int_to_4_chars (20)/*min_write_heap_size_value*/,
# endif
int_to_2_chars (2)/*min_write_heap_size_section_n*/,
int_to_2_chars (0)/*min_write_heap_size_type*/,
(char) 2/*min_write_heap_size_class(IMAGE_SYM_CLASS_EXTERNAL)*/,
(char) 0/*min_write_heap_size_n_aux_sections*/,
/* string table at 414 */
/* string table at 414 / 438 */
# ifdef A_64
int_to_4_chars (81/*size string_table*/ + 4),
# else
int_to_4_chars (86/*size string_table*/ + 4),
'_','h','e','a','p','_','s','i','z','e','\0',
'_','a','b','_','s','t','a','c','k','_','s','i','z','e','\0',
'_','i','n','i','t','i','a','l','_','h','e','a','p','_','s','i','z','e','\0',
'_','h','e','a','p','_','s','i','z','e','_','m','u','l','t','i','p','l','e','\0',
'_','m','i','n','_','w','r','i','t','e','_','h','e','a','p','_','s','i','z','e','\0'
'_',
# endif
'h','e','a','p','_','s','i','z','e','\0',
# ifndef A_64
'_',
# endif
'a','b','_','s','t','a','c','k','_','s','i','z','e','\0',
# ifndef A_64
'_',
# endif
'i','n','i','t','i','a','l','_','h','e','a','p','_','s','i','z','e','\0',
# ifndef A_64
'_',
# endif
'h','e','a','p','_','s','i','z','e','_','m','u','l','t','i','p','l','e','\0',
# ifndef A_64
'_',
# endif
'm','i','n','_','w','r','i','t','e','_','h','e','a','p','_','s','i','z','e','\0'
# else
# ifdef OMF
0x0b000d80,0x6974706f,0x2e736e6f,0xf36a626f
......@@ -3024,12 +3093,21 @@ int create_options_file (char **options_file_name_p)
data_size=sizeof (data);
#else
# ifdef _WINDOWS_
# ifdef A_64
((long*)&data[140])[0]=heap_size;
((long*)&data[140])[1]=ab_stack_size;
((long*)&data[140])[2]=flags;
((long*)&data[140])[3]=initial_heap_size;
((long*)&data[140])[4]=heap_size_multiple;
((long*)&data[140])[5]=0/*min_write_heap_size*/;
# else
((int*)&data[140])[0]=heap_size;
((int*)&data[140])[1]=ab_stack_size;
((int*)&data[140])[2]=flags;
((int*)&data[140])[3]=initial_heap_size;
((int*)&data[140])[4]=heap_size_multiple;
((int*)&data[140])[5]=0/*min_write_heap_size*/;
# endif
data_size=sizeof (data);
# else
# ifdef MACH_O64
......@@ -3206,7 +3284,8 @@ static int link_project (P_NODE first_project_node,char *options_file_name,char
# if defined (NO_CLIB)
char startup0_file_name[PATH_NAME_STRING_SIZE];
# endif
char startup1_file_name[PATH_NAME_STRING_SIZE],startup2_file_name[PATH_NAME_STRING_SIZE];
char startup1_file_name[PATH_NAME_STRING_SIZE],startup2_file_name[PATH_NAME_STRING_SIZE],
startup3_file_name[PATH_NAME_STRING_SIZE],startup4_file_name[PATH_NAME_STRING_SIZE];
#else
char start_up_file_name[PATH_NAME_STRING_SIZE];
#endif
......@@ -3285,6 +3364,12 @@ static int link_project (P_NODE first_project_node,char *options_file_name,char
need_file ("_startup2",OBJECT_FILE_EXTENSION,startup2_file_name);
*arg++=startup2_file_name;
need_file ("_startup3",OBJECT_FILE_EXTENSION,startup3_file_name);
*arg++=startup3_file_name;
need_file ("_startup4",OBJECT_FILE_EXTENSION,startup4_file_name);
*arg++=startup4_file_name;
# else
if ((clean_options & NO_TIME_PROFILE_MASK)!=0){
......@@ -3523,6 +3608,12 @@ static int link_project (P_NODE first_project_node,char *options_file_name,char
need_file ("_startup2",OBJECT_FILE_EXTENSION,startup2_file_name);
*arg++=startup2_file_name;
need_file ("_startup3",OBJECT_FILE_EXTENSION,startup3_file_name);
*arg++=startup3_file_name;
need_file ("_startup4",OBJECT_FILE_EXTENSION,startup4_file_name);
*arg++=startup4_file_name;
#else
if ((clean_options & NO_TIME_PROFILE_MASK)!=0)
need_file ("_startup",OBJECT_FILE_EXTENSION,start_up_file_name);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment