2010-03-26 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Fri, 26 Mar 2010 17:14:23 +0000 (17:14 -0000)
committerZoltan Varga <vargaz@gmail.com>
Fri, 26 Mar 2010 17:14:23 +0000 (17:14 -0000)
* image-writer.c (bin_writer_emit_writeout): Fix the size of the got.plt
section. Fixes #591000.

svn path=/trunk/mono/; revision=154295

mono/mini/ChangeLog
mono/mini/image-writer.c

index 19f7ff6f7990997711b638b1c9da4eaf9718a5e5..5b004d8c86d63e13e16a302402edcc7a1b96b2ca 100755 (executable)
@@ -1,3 +1,8 @@
+2010-03-26  Zoltan Varga  <vargaz@gmail.com>
+
+       * image-writer.c (bin_writer_emit_writeout): Fix the size of the got.plt
+       section. Fixes #591000.
+
 2010-03-26  Andreas Faerber  <andreas.faerber@web.de>
 
        * Makefile.am (version.h): Check for pure .git directory only,
index d60501ff651fbfcaa6789da9eb15e55f15839504..8b2242e3634f6a417891c297435d39dee7b983e1 100644 (file)
@@ -1175,7 +1175,7 @@ bin_writer_emit_writeout (MonoImageWriter *acfg)
        virt_offset = ALIGN_TO (virt_offset, secth [SECT_GOT_PLT].sh_addralign);
        secth [SECT_GOT_PLT].sh_addr = virt_offset;
        secth [SECT_GOT_PLT].sh_offset = file_offset;
-       size = 12;
+       size = 3 * SIZEOF_VOID_P;
        secth [SECT_GOT_PLT].sh_size = size;
        file_offset += size;
        virt_offset += size;
@@ -1260,6 +1260,11 @@ bin_writer_emit_writeout (MonoImageWriter *acfg)
        secth [SECT_STRTAB].sh_size = size;
        file_offset += size;
 
+       for (i = 1; i < SECT_NUM; ++i) {
+               if (section_info [i].esize != 0)
+                       g_assert (secth [i].sh_size % section_info [i].esize == 0);
+       }
+
        file_offset += 4-1;
        file_offset &= ~(4-1);