aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bfd/elf-bfd.h2
-rw-r--r--bfd/elf-eh-frame.c2
-rw-r--r--bfd/elflink.c24
3 files changed, 7 insertions, 21 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 5d19529..a2b3eb0 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -2612,7 +2612,7 @@ extern bool _bfd_elf_create_dynamic_sections
extern bool _bfd_elf_create_got_section
(bfd *, struct bfd_link_info *);
extern asection *_bfd_elf_section_for_symbol
- (struct elf_reloc_cookie *, unsigned long, bool);
+ (struct elf_reloc_cookie *, unsigned long);
extern struct elf_link_hash_entry *_bfd_elf_define_linkage_sym
(bfd *, struct bfd_link_info *, asection *, const char *);
extern void _bfd_elf_init_1_index_section
diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
index 4eda3c9..62cba84 100644
--- a/bfd/elf-eh-frame.c
+++ b/bfd/elf-eh-frame.c
@@ -555,7 +555,7 @@ _bfd_elf_parse_eh_frame_entry (struct bfd_link_info *info,
if (r_symndx == STN_UNDEF)
return false;
- text_sec = _bfd_elf_section_for_symbol (cookie, r_symndx, false);
+ text_sec = _bfd_elf_section_for_symbol (cookie, r_symndx);
if (text_sec == NULL)
return false;
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 3f3ea2c..c7a5a52 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -142,8 +142,7 @@ get_ext_sym_hash_from_cookie (struct elf_reloc_cookie *cookie, unsigned long r_s
asection *
_bfd_elf_section_for_symbol (struct elf_reloc_cookie *cookie,
- unsigned long r_symndx,
- bool discard)
+ unsigned long r_symndx)
{
struct elf_link_hash_entry *h;
@@ -151,28 +150,15 @@ _bfd_elf_section_for_symbol (struct elf_reloc_cookie *cookie,
if (h != NULL)
{
- if ((h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- && discarded_section (h->root.u.def.section))
+ if (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
return h->root.u.def.section;
else
return NULL;
}
- /* It's not a relocation against a global symbol,
- but it could be a relocation against a local
- symbol for a discarded section. */
- asection *isec;
- Elf_Internal_Sym *isym;
-
- /* Need to: get the symbol; get the section. */
- isym = &cookie->locsyms[r_symndx];
- isec = bfd_section_from_elf_index (cookie->abfd, isym->st_shndx);
- if (isec != NULL
- && discard ? discarded_section (isec) : 1)
- return isec;
-
- return NULL;
+ Elf_Internal_Sym *isym = &cookie->locsyms[r_symndx];
+ return bfd_section_from_elf_index (cookie->abfd, isym->st_shndx);
}
/* Define a symbol in a dynamic linkage section. */