diff options
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/bfd-in.h | 2 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 2 | ||||
-rw-r--r-- | bfd/elflink.c | 33 | ||||
-rw-r--r-- | bfd/linker.c | 33 |
5 files changed, 42 insertions, 35 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1f82cdc14a..98fb93690e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2005-08-04 Alan Modra <amodra@bigpond.net.au> + + * elflink.c (fix_syms, _bfd_elf_fix_excluded_sec_syms): Move to.. + * linker.c (fix_syms, _bfd_fix_excluded_sec_syms): ..here. + * bfd-in.h (_bfd_fix_excluded_sec_syms): Rename. + * bfd-in2.h: Regenerate. + 2005-08-03 H.J. Lu <hongjiu.lu@intel.com> * elfxx-ia64.c (elfNN_ia64_relax_section): Resize .rela.got diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index 10b4c13b7f..39a82cbffc 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -708,7 +708,7 @@ extern void _bfd_elf_provide_symbol extern void _bfd_elf_provide_section_bound_symbols (struct bfd_link_info *, struct bfd_section *, const char *, const char *); -extern void _bfd_elf_fix_excluded_sec_syms +extern void _bfd_fix_excluded_sec_syms (bfd *, struct bfd_link_info *); extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index e8c597266e..50ac263286 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -715,7 +715,7 @@ extern void _bfd_elf_provide_symbol extern void _bfd_elf_provide_section_bound_symbols (struct bfd_link_info *, struct bfd_section *, const char *, const char *); -extern void _bfd_elf_fix_excluded_sec_syms +extern void _bfd_fix_excluded_sec_syms (bfd *, struct bfd_link_info *); extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs diff --git a/bfd/elflink.c b/bfd/elflink.c index 082b530302..457ba8e621 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -9890,39 +9890,6 @@ _bfd_elf_provide_section_bound_symbols (struct bfd_link_info *info, _bfd_elf_provide_symbol (info, end, val, sec); } -/* Convert symbols in excluded output sections to absolute. */ - -static bfd_boolean -fix_syms (struct bfd_link_hash_entry *h, void *data) -{ - bfd *obfd = (bfd *) data; - - if (h->type == bfd_link_hash_warning) - h = h->u.i.link; - - if (h->type == bfd_link_hash_defined - || h->type == bfd_link_hash_defweak) - { - asection *s = h->u.def.section; - if (s != NULL - && s->output_section != NULL - && (s->output_section->flags & SEC_EXCLUDE) != 0 - && bfd_section_removed_from_list (obfd, s->output_section)) - { - h->u.def.value += s->output_offset + s->output_section->vma; - h->u.def.section = bfd_abs_section_ptr; - } - } - - return TRUE; -} - -void -_bfd_elf_fix_excluded_sec_syms (bfd *obfd, struct bfd_link_info *info) -{ - bfd_link_hash_traverse (info->hash, fix_syms, obfd); -} - bfd_boolean _bfd_elf_common_definition (Elf_Internal_Sym *sym) { diff --git a/bfd/linker.c b/bfd/linker.c index 426d545e32..0bfdfb2370 100644 --- a/bfd/linker.c +++ b/bfd/linker.c @@ -3071,3 +3071,36 @@ _bfd_generic_section_already_linked (bfd *abfd, asection *sec) /* This is the first section with this name. Record it. */ bfd_section_already_linked_table_insert (already_linked_list, sec); } + +/* Convert symbols in excluded output sections to absolute. */ + +static bfd_boolean +fix_syms (struct bfd_link_hash_entry *h, void *data) +{ + bfd *obfd = (bfd *) data; + + if (h->type == bfd_link_hash_warning) + h = h->u.i.link; + + if (h->type == bfd_link_hash_defined + || h->type == bfd_link_hash_defweak) + { + asection *s = h->u.def.section; + if (s != NULL + && s->output_section != NULL + && (s->output_section->flags & SEC_EXCLUDE) != 0 + && bfd_section_removed_from_list (obfd, s->output_section)) + { + h->u.def.value += s->output_offset + s->output_section->vma; + h->u.def.section = bfd_abs_section_ptr; + } + } + + return TRUE; +} + +void +_bfd_fix_excluded_sec_syms (bfd *obfd, struct bfd_link_info *info) +{ + bfd_link_hash_traverse (info->hash, fix_syms, obfd); +} |