* peigen.c (_bfd_pei_swap_aouthdr_in): If some DataDirectory
is empty, make sure that its rva also 0. NT loader dislikes having otherwise.
This commit is contained in:
parent
6d4c43bfc6
commit
3028b4c011
2 changed files with 27 additions and 7 deletions
|
@ -1,3 +1,9 @@
|
|||
2000-09-26 Paul Sokolovsky <Paul.Sokolovsky@technologist.com>
|
||||
|
||||
* peigen.c (_bfd_pei_swap_aouthdr_in): If some DataDirectory
|
||||
is empty, make sure that its rva also 0. NT loader dislikes
|
||||
having otherwise.
|
||||
|
||||
2000-09-26 Steve Ellcey <sje@cup.hp.com>
|
||||
|
||||
* som.c (som_bfd_derive_misc_symbol_info): Make weak symbols
|
||||
|
|
28
bfd/peigen.c
28
bfd/peigen.c
|
@ -469,10 +469,17 @@ _bfd_pei_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1)
|
|||
int idx;
|
||||
for (idx=0; idx < 16; idx++)
|
||||
{
|
||||
a->DataDirectory[idx].VirtualAddress =
|
||||
bfd_h_get_32 (abfd, (bfd_byte *)src->DataDirectory[idx][0]);
|
||||
a->DataDirectory[idx].Size =
|
||||
bfd_h_get_32 (abfd, (bfd_byte *)src->DataDirectory[idx][1]);
|
||||
/* If data directory is empty, rva also should be 0 */
|
||||
int size = bfd_h_get_32 (abfd, (bfd_byte *) src->DataDirectory[idx][1]);
|
||||
a->DataDirectory[idx].Size = size;
|
||||
|
||||
if (size)
|
||||
{
|
||||
a->DataDirectory[idx].VirtualAddress =
|
||||
bfd_h_get_32 (abfd, (bfd_byte *) src->DataDirectory[idx][0]);
|
||||
}
|
||||
else
|
||||
a->DataDirectory[idx].VirtualAddress = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -527,9 +534,16 @@ add_data_entry (abfd, aout, idx, name, base)
|
|||
&& (coff_section_data (abfd, sec) != NULL)
|
||||
&& (pei_section_data (abfd, sec) != NULL))
|
||||
{
|
||||
aout->DataDirectory[idx].VirtualAddress = (sec->vma - base) & 0xffffffff;
|
||||
aout->DataDirectory[idx].Size = pei_section_data (abfd, sec)->virt_size;
|
||||
sec->flags |= SEC_DATA;
|
||||
/* If data directory is empty, rva also should be 0 */
|
||||
int size = pei_section_data (abfd, sec)->virt_size;
|
||||
aout->DataDirectory[idx].Size = size;
|
||||
|
||||
if (size)
|
||||
{
|
||||
aout->DataDirectory[idx].VirtualAddress =
|
||||
(sec->vma - base) & 0xffffffff;
|
||||
sec->flags |= SEC_DATA;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue