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/cofflink.c | |
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/cofflink.c')
-rw-r--r-- | bfd/cofflink.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/bfd/cofflink.c b/bfd/cofflink.c index 7d1d505..c721bdf 100644 --- a/bfd/cofflink.c +++ b/bfd/cofflink.c @@ -1550,9 +1550,10 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) if (isym.n_scnum > 0) { isym.n_scnum = (*secpp)->output_section->target_index; - isym.n_value += ((*secpp)->output_section->vma - + (*secpp)->output_offset - - (*secpp)->vma); + isym.n_value += (*secpp)->output_offset; + if (! obj_pe (finfo->output_bfd)) + isym.n_value += ((*secpp)->output_section->vma + - (*secpp)->vma); } /* The value of a C_FILE symbol is the symbol index of the @@ -2245,8 +2246,9 @@ _bfd_coff_write_global_sym (h, data) else isym.n_scnum = sec->target_index; isym.n_value = (h->root.u.def.value - + sec->vma + h->root.u.def.section->output_offset); + if (! obj_pe (finfo->output_bfd)) + isym.n_value += sec->vma; } break; @@ -2544,8 +2546,9 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, sec = sections[symndx]; val = (sec->output_section->vma + sec->output_offset - + sym->n_value - - sec->vma); + + sym->n_value); + if (! obj_pe (output_bfd)) + val -= sec->vma; } } else |