X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fimage-writer.c;h=986fe5d1d502e59ff6aba0195e6a1b38b63a6fd5;hb=7bbda0750f055c7823f85694d9e54f1ea7bcb094;hp=a54b14c5764b5543dc2887690e0f70edcf653ea1;hpb=c8761953ee37178ba6631a0dafc30f40496c2158;p=mono.git diff --git a/mono/mini/image-writer.c b/mono/mini/image-writer.c index a54b14c5764..986fe5d1d50 100644 --- a/mono/mini/image-writer.c +++ b/mono/mini/image-writer.c @@ -1070,7 +1070,7 @@ bin_writer_emit_writeout (MonoImageWriter *acfg) { FILE *file; ElfHeader header; - ElfProgHeader progh [3]; + ElfProgHeader progh [4]; ElfSectHeader secth [SECT_NUM]; #ifdef USE_ELF_RELA ElfRelocA *relocs; @@ -1336,7 +1336,7 @@ bin_writer_emit_writeout (MonoImageWriter *acfg) header.e_phoff = sizeof (header); header.e_ehsize = sizeof (header); header.e_phentsize = sizeof (ElfProgHeader); - header.e_phnum = 3; + header.e_phnum = 4; header.e_entry = secth [SECT_TEXT].sh_addr; header.e_shstrndx = SECT_SHSTRTAB; header.e_shentsize = sizeof (ElfSectHeader); @@ -1407,6 +1407,13 @@ bin_writer_emit_writeout (MonoImageWriter *acfg) progh [2].p_align = SIZEOF_VOID_P; progh [2].p_flags = 6; + progh [3].p_type = PT_GNU_STACK; + progh [3].p_offset = secth [SECT_DYNAMIC].sh_offset; + progh [3].p_vaddr = progh [3].p_paddr = secth [SECT_DYNAMIC].sh_addr; + progh [3].p_filesz = progh [3].p_memsz = secth [SECT_DYNAMIC].sh_size; + progh [3].p_align = SIZEOF_VOID_P; + progh [3].p_flags = 6; + /* Compute the addresses of the bin sections, so relocation can be done */ for (i = 0; i < SECT_NUM; ++i) { if (sections [i]) {