diff options
author | Ian Lance Taylor <ian@airs.com> | 1997-05-21 21:42:38 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1997-05-21 21:42:38 +0000 |
commit | 20a9631ae35a5feb23f06e0a5ec7697930040aa7 (patch) | |
tree | 6beed4b40a0b02b405f494f77b04d1c9c01b40c0 /bfd/coffcode.h | |
parent | 1a7a427ef1394c28494ad77e2beae46dc267b6f6 (diff) | |
download | gdb-20a9631ae35a5feb23f06e0a5ec7697930040aa7.zip gdb-20a9631ae35a5feb23f06e0a5ec7697930040aa7.tar.gz gdb-20a9631ae35a5feb23f06e0a5ec7697930040aa7.tar.bz2 |
* coffcode.h (coff_slurp_symbol_table): If COFF_WITH_PE or
COFF_IMAGE_WITH_PE, don't subtract the section VMA from the symbol
value.
* coffgen.c (fixup_symbol_value): Add abfd parameter. Change all
callers. If PE file, don't add section VMA.
(coff_write_alien_symbol): If PE file, don't add section VMA.
* cofflink.c (_bfd_coff_link_input_bfd): Likewise.
(_bfd_coff_write_global_sym): Likewise.
(_bfd_coff_generic_relocate_section): Likewise.
Diffstat (limited to 'bfd/coffcode.h')
-rw-r--r-- | bfd/coffcode.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 941be95..633d31f 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -3408,8 +3408,15 @@ coff_slurp_symbol_table (abfd) section */ dst->symbol.flags = BSF_EXPORT | BSF_GLOBAL; + +#if defined (COFF_WITH_PE) || defined (COFF_IMAGE_WITH_PE) + /* PE sets the symbol to a value relative to the + start of the section. */ + dst->symbol.value = src->u.syment.n_value; +#else dst->symbol.value = (src->u.syment.n_value - dst->symbol.section->vma); +#endif if (ISFCN ((src->u.syment.n_type))) { @@ -3448,8 +3455,16 @@ coff_slurp_symbol_table (abfd) /* Base the value as an index from the base of the section, if there is one. */ if (dst->symbol.section) - dst->symbol.value = (src->u.syment.n_value - - dst->symbol.section->vma); + { +#if defined (COFF_WITH_PE) || defined (COFF_IMAGE_WITH_PE) + /* PE sets the symbol to a value relative to the + start of the section. */ + dst->symbol.value = src->u.syment.n_value; +#else + dst->symbol.value = (src->u.syment.n_value + - dst->symbol.section->vma); +#endif + } else dst->symbol.value = src->u.syment.n_value; break; @@ -3545,10 +3560,16 @@ coff_slurp_symbol_table (abfd) case C_FCN: /* ".bf" or ".ef" */ case C_EFCN: /* physical end of function */ dst->symbol.flags = BSF_LOCAL; +#if defined (COFF_WITH_PE) || defined (COFF_IMAGE_WITH_PE) + /* PE sets the symbol to a value relative to the start + of the section. */ + dst->symbol.value = src->u.syment.n_value; +#else /* Base the value as an index from the base of the section. */ dst->symbol.value = (src->u.syment.n_value - dst->symbol.section->vma); +#endif break; case C_NULL: |