* peXXigen.c (_bfd_XXi_final_link_postscript): Use correct size
[deliverable/binutils-gdb.git] / bfd / peXXigen.c
index a5b7f68b902d91229dcd820fbc09993955f29a97..825229aab930a158ca0d20c7d8d88955ebdb2ecd 100644 (file)
@@ -2437,8 +2437,15 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo)
             abfd);
          result = FALSE;
        }
-
+     /* According to PECOFF sepcifications by Microsoft version 8.2
+       the TLS data directory consists of 4 pointers, followed
+       by two 4-byte integer. This implies that the total size
+       is different for 32-bit and 64-bit executables.  */ 
+#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64)
       pe_data (abfd)->pe_opthdr.DataDirectory[PE_TLS_TABLE].Size = 0x18;
+#else
+      pe_data (abfd)->pe_opthdr.DataDirectory[PE_TLS_TABLE].Size = 0x28;
+#endif
     }
 
 /* If there is a .pdata section and we have linked pdata finally, we
This page took 0.023122 seconds and 4 git commands to generate.