aboutsummaryrefslogtreecommitdiff
path: root/include/coff/ti.h
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2009-08-10 22:02:41 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2009-08-10 22:02:41 +0000
commit62cc2e1fa2d79bc4a8cf92d9e9b6216f97d0a9ee (patch)
treeedd1f3b46f95e8831f12be27dd0ce3dfc1082c20 /include/coff/ti.h
parent9bf609ecf25a0d2ec4dded8566e8c2b68238171e (diff)
downloadgdb-62cc2e1fa2d79bc4a8cf92d9e9b6216f97d0a9ee.zip
gdb-62cc2e1fa2d79bc4a8cf92d9e9b6216f97d0a9ee.tar.gz
gdb-62cc2e1fa2d79bc4a8cf92d9e9b6216f97d0a9ee.tar.bz2
include/coff/
Fix references past allocated memory for i386-*-go32. * ti.h (COFF_ADJUST_FILEHDR_IN_POST, COFF_ADJUST_FILEHDR_OUT_POST): Reference F_TARGET_ID only when !COFF0_P.
Diffstat (limited to 'include/coff/ti.h')
-rw-r--r--include/coff/ti.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/include/coff/ti.h b/include/coff/ti.h
index e0e1729..7f3ad7e 100644
--- a/include/coff/ti.h
+++ b/include/coff/ti.h
@@ -102,19 +102,21 @@ struct external_filehdr
#define COFF_ADJUST_FILEHDR_IN_POST(abfd, src, dst) \
do \
{ \
- ((struct internal_filehdr *)(dst))->f_target_id = \
- H_GET_16 (abfd, ((FILHDR *)(src))->f_target_id); \
+ if (!COFF0_P (abfd)) \
+ ((struct internal_filehdr *)(dst))->f_target_id = \
+ H_GET_16 (abfd, ((FILHDR *)(src))->f_target_id); \
} \
while (0)
#endif
#ifndef COFF_ADJUST_FILEHDR_OUT_POST
#define COFF_ADJUST_FILEHDR_OUT_POST(abfd, src, dst) \
- do \
- { \
- H_PUT_16 (abfd, ((struct internal_filehdr *)(src))->f_target_id, \
- ((FILHDR *)(dst))->f_target_id); \
- } \
+ do \
+ { \
+ if (!COFF0_P (abfd)) \
+ H_PUT_16 (abfd, ((struct internal_filehdr *)(src))->f_target_id, \
+ ((FILHDR *)(dst))->f_target_id); \
+ } \
while (0)
#endif