aboutsummaryrefslogtreecommitdiff
path: root/bfd/ieee.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1998-07-10 20:31:44 +0000
committerIan Lance Taylor <ian@airs.com>1998-07-10 20:31:44 +0000
commit81d195ae16efa152da57c5e4065282012a937ff4 (patch)
tree2b768604c809a96f90b2d3fb0cbec324a15bed73 /bfd/ieee.c
parent326d0b2545eaafe2757486bb4672cce1986dfdea (diff)
downloadgdb-81d195ae16efa152da57c5e4065282012a937ff4.zip
gdb-81d195ae16efa152da57c5e4065282012a937ff4.tar.gz
gdb-81d195ae16efa152da57c5e4065282012a937ff4.tar.bz2
* ieee.c (ieee_slurp_external_symbols): Select an appropriate
section for an absolute symbol in a fully linked file. Based on patch from Christian Holland <CHolland@de.lucent.com>.
Diffstat (limited to 'bfd/ieee.c')
-rw-r--r--bfd/ieee.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/bfd/ieee.c b/bfd/ieee.c
index c2a022b..beefe92 100644
--- a/bfd/ieee.c
+++ b/bfd/ieee.c
@@ -825,6 +825,28 @@ ieee_slurp_external_symbols (abfd)
&extra,
&symbol->symbol.section);
+ /* Fully linked IEEE-695 files tend to give every symbol
+ an absolute value. Try to convert that back into a
+ section relative value. FIXME: This won't always to
+ the right thing. */
+ if (bfd_is_abs_section (symbol->symbol.section)
+ && (abfd->flags & HAS_RELOC) == 0)
+ {
+ bfd_vma val;
+ asection *s;
+
+ val = symbol->symbol.value;
+ for (s = abfd->sections; s != NULL; s = s->next)
+ {
+ if (val >= s->vma && val < s->vma + s->_raw_size)
+ {
+ symbol->symbol.section = s;
+ symbol->symbol.value -= s->vma;
+ break;
+ }
+ }
+ }
+
symbol->symbol.flags = BSF_GLOBAL | BSF_EXPORT;
}