elf_gc_mark
Alan Modra
amodra@bigpond.net.au
Mon Jun 3 22:26:00 GMT 2002
I was checking through all the backend gc_mark_hook functions when
considering a change in handling .opd relocs, and found that the vax
and sh64 backend use code that predates the change I made in
http://sources.redhat.com/ml/binutils/2001-12/msg00234.html to support
more than 64k ELF sections.
* elf32-openrisc.c (openrisc_elf_gc_mark_hook): Remove
ATTRIBUTE_UNUSED on used params.
* elf32-vax.c (elf_vax_gc_mark_hook): Remove unnecessary checks
before calling bfd_section_from_elf_index on local syms.
* elf64-sh64.c (sh_elf64_gc_mark_hook): Likewise.
Index: bfd/elf32-openrisc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-openrisc.c,v
retrieving revision 1.8
diff -u -p -r1.8 elf32-openrisc.c
--- bfd/elf32-openrisc.c 7 May 2002 00:16:51 -0000 1.8
+++ bfd/elf32-openrisc.c 4 Jun 2002 05:17:16 -0000
@@ -469,11 +469,11 @@ openrisc_elf_relocate_section (output_bf
static asection *
openrisc_elf_gc_mark_hook (abfd, info, rel, h, sym)
- bfd *abfd ATTRIBUTE_UNUSED;
+ bfd *abfd;
struct bfd_link_info *info ATTRIBUTE_UNUSED;
- Elf_Internal_Rela *rel ATTRIBUTE_UNUSED;
- struct elf_link_hash_entry *h ATTRIBUTE_UNUSED;
- Elf_Internal_Sym *sym ATTRIBUTE_UNUSED;
+ Elf_Internal_Rela *rel;
+ struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *sym;
{
if (h != NULL)
{
Index: bfd/elf32-vax.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-vax.c,v
retrieving revision 1.2
diff -u -p -r1.2 elf32-vax.c
--- bfd/elf32-vax.c 3 Jun 2002 01:57:09 -0000 1.2
+++ bfd/elf32-vax.c 4 Jun 2002 05:17:17 -0000
@@ -887,13 +887,7 @@ elf_vax_gc_mark_hook (abfd, info, rel, h
}
else
{
- if (!(elf_bad_symtab (abfd)
- && ELF_ST_BIND (sym->st_info) != STB_LOCAL)
- && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE)
- && sym->st_shndx != SHN_COMMON))
- {
- return bfd_section_from_elf_index (abfd, sym->st_shndx);
- }
+ return bfd_section_from_elf_index (abfd, sym->st_shndx);
}
return NULL;
Index: bfd/elf64-sh64.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-sh64.c,v
retrieving revision 1.8
diff -u -p -r1.8 elf64-sh64.c
--- bfd/elf64-sh64.c 3 Jun 2002 01:57:09 -0000 1.8
+++ bfd/elf64-sh64.c 4 Jun 2002 05:17:20 -0000
@@ -2481,11 +2481,7 @@ sh_elf64_gc_mark_hook (abfd, info, rel,
}
else
{
- if (!(elf_bad_symtab (abfd)
- && ELF_ST_BIND (sym->st_info) != STB_LOCAL)
- && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE)
- && sym->st_shndx != SHN_COMMON))
- return bfd_section_from_elf_index (abfd, sym->st_shndx);
+ return bfd_section_from_elf_index (abfd, sym->st_shndx);
}
return NULL;
--
Alan Modra
IBM OzLabs - Linux Technology Centre
More information about the Binutils
mailing list