diff options
author | Alan Modra <amodra@gmail.com> | 2023-08-27 21:17:05 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-08-27 21:21:38 +0930 |
commit | 6785fd72d503fd13bfec31a2897694f1590031eb (patch) | |
tree | fe86bf1be8d09d2ebe79083349fcdb67db04eb5d /include/coff | |
parent | 8606b47e94078e77a53f3cd714272c853d2add22 (diff) | |
download | fsf-binutils-gdb-6785fd72d503fd13bfec31a2897694f1590031eb.zip fsf-binutils-gdb-6785fd72d503fd13bfec31a2897694f1590031eb.tar.gz fsf-binutils-gdb-6785fd72d503fd13bfec31a2897694f1590031eb.tar.bz2 |
PE dos_message
I was looking at dos_message and wondering why we have H_PUT_32
in _bfd_XXi_only_swap_filehdr_out but no H_GET_32 in pe_bfd_object_p.
On a big-endian machine this would result in scrambling the code and
strings constained in dos_message. Rather than fix the lack of
H_GET_32 in pe_bfd_object_p, I decided it doesn't make sense to store
dos_message internally as an array of ints.
include/
* coff/internal.h (struct internal_extra_pe_filehdr): Make
dos_message a char array.
* coff/msdos.h (struct external_DOS_hdr): Flatten dos_message.
* coff/pe.h (struct external_PEI_filehdr): Likewise.
bfd/
* libcoff-in.h (struct pe_tdata): Make dos_message a char array.
* libcoff.h: Regenerate.
* peXXigen.c (_bfd_XXi_only_swap_filehdr_out): memcpy dos_message
to output.
* peicode.h (pe_mkobject): Don't memset already zeroed pe_opthdr.
Tidy allocation of tdata.pe_obj_data. Set up dos_message from..
(default_dos_message): ..this. New static array.
Diffstat (limited to 'include/coff')
-rw-r--r-- | include/coff/internal.h | 2 | ||||
-rw-r--r-- | include/coff/msdos.h | 2 | ||||
-rw-r--r-- | include/coff/pe.h | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/include/coff/internal.h b/include/coff/internal.h index 7a566ca..f33817e 100644 --- a/include/coff/internal.h +++ b/include/coff/internal.h @@ -54,7 +54,7 @@ struct internal_extra_pe_filehdr unsigned short e_oeminfo; /* OEM information; e_oemid specific, 0x0 */ unsigned short e_res2[10]; /* Reserved words, all 0x0 */ bfd_vma e_lfanew; /* File address of new exe header, 0x80 */ - unsigned int dos_message[16]; /* Text which always follows DOS header. */ + char dos_message[64]; /* Text which always follows DOS header. */ bfd_vma nt_signature; /* required NT signature, 0x4550 */ }; diff --git a/include/coff/msdos.h b/include/coff/msdos.h index b879e45..5f09c76 100644 --- a/include/coff/msdos.h +++ b/include/coff/msdos.h @@ -48,7 +48,7 @@ struct external_DOS_hdr char e_oeminfo[2]; /* OEM information. */ char e_res2[10][2]; /* Reserved words, all 0x0. */ char e_lfanew[4]; /* File address of new exe header, usually 0x80. */ - char dos_message[16][4]; /* Other stuff, always follow DOS header. */ + char dos_message[64]; /* Other stuff, always follow DOS header. */ }; /* The actual DOS header only includes up to the e_ovno field. */ diff --git a/include/coff/pe.h b/include/coff/pe.h index 6b26d53..7e69e6f 100644 --- a/include/coff/pe.h +++ b/include/coff/pe.h @@ -218,7 +218,7 @@ struct external_PEI_filehdr char e_oeminfo[2]; /* OEM information; e_oemid specific, 0x0. */ char e_res2[10][2]; /* Reserved words, all 0x0. */ char e_lfanew[4]; /* File address of new exe header, usually 0x80. */ - char dos_message[16][4]; /* Other stuff, always follow DOS header. */ + char dos_message[64]; /* Other stuff, always follow DOS header. */ /* Note: additional bytes may be inserted before the signature. Use the e_lfanew field to find the actual location of the NT signature. */ |