Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2009-08-11 02:02:41 +0400
committerJan Kratochvil <jan.kratochvil@redhat.com>2009-08-11 02:02:41 +0400
commit12fa1497c16b3ea003b713529b13cfda9427559a (patch)
tree671b83be2cea86671b6e335f70f4b94e56a4a1e8 /include/coff
parent4e9b47b8d4d03c7e38861887e91ec05136986624 (diff)
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')
-rw-r--r--include/coff/ChangeLog6
-rw-r--r--include/coff/ti.h16
2 files changed, 15 insertions, 7 deletions
diff --git a/include/coff/ChangeLog b/include/coff/ChangeLog
index a38228b33..4aa9dc107 100644
--- a/include/coff/ChangeLog
+++ b/include/coff/ChangeLog
@@ -1,5 +1,11 @@
2009-08-10 Jan Kratochvil <jan.kratochvil@redhat.com>
+ 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.
+
+2009-08-10 Jan Kratochvil <jan.kratochvil@redhat.com>
+
Stop using bfd_usrdata in libbfd.
* go32exe.h (struct external_filehdr_go32_exe <stub>, FILHSZ): Replace
STUBSIZE by GO32_STUBSIZE.
diff --git a/include/coff/ti.h b/include/coff/ti.h
index e0e17293d..7f3ad7e53 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