aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2005-12-07 14:43:54 +0000
committerH.J. Lu <hjl.tools@gmail.com>2005-12-07 14:43:54 +0000
commitfe21a8fc74862995effcdc1d994a1dec827ca3ac (patch)
tree7929d7495d5823ad3ef0807115a40efb5b41ffd8
parentcf54500c3c2c47c9e1fe915d154df4da2d28cec8 (diff)
downloadgdb-fe21a8fc74862995effcdc1d994a1dec827ca3ac.zip
gdb-fe21a8fc74862995effcdc1d994a1dec827ca3ac.tar.gz
gdb-fe21a8fc74862995effcdc1d994a1dec827ca3ac.tar.bz2
bfd/
2005-12-07 Thiemo Seufer <ths@networkno.de> H.J. Lu <hongjiu.lu@intel.com> PR ld/1932 * bfd-in.h (bfd_elf_record_link_assignment): Add output_bfd and hidden arguments. * bfd.c (bfd_hide_symbol): Removed. * bfd-in2.h: Regenerated. * elflink.c (bfd_elf_record_link_assignment): Handle hidden symbols which were provided by a linker script. ld/ 2005-12-07 Thiemo Seufer <ths@networkno.de> H.J. Lu <hongjiu.lu@intel.com> PR ld/1932 * emultempl/elf32.em (gld${EMULATION_NAME}_find_exp_assignment): Adjust bfd_elf_record_link_assignment call. * ldexp.c (exp_fold_tree_1): Remove call to bfd_hide_symbol.
-rw-r--r--bfd/ChangeLog14
-rw-r--r--bfd/bfd-in.h3
-rw-r--r--bfd/bfd-in2.h8
-rw-r--r--bfd/bfd.c26
-rw-r--r--bfd/elflink.c14
-rw-r--r--ld/ChangeLog9
-rw-r--r--ld/emultempl/elf32.em5
-rw-r--r--ld/ldexp.c2
8 files changed, 42 insertions, 39 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index eeae34f..e34e2db 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,17 @@
+2005-12-07 Thiemo Seufer <ths@networkno.de>
+ H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/1932
+ * bfd-in.h (bfd_elf_record_link_assignment): Add output_bfd
+ and hidden arguments.
+
+ * bfd.c (bfd_hide_symbol): Removed.
+
+ * bfd-in2.h: Regenerated.
+
+ * elflink.c (bfd_elf_record_link_assignment): Handle hidden
+ symbols which were provided by a linker script.
+
2005-12-06 Paul Gilliam <pgilliam@us.ibm.com>
* cpu-powerpc.c (bfd_powerpc_archs): Add ppc 750.
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index eaecb92..74aded8 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -633,7 +633,8 @@ enum dynamic_lib_link_class {
};
extern bfd_boolean bfd_elf_record_link_assignment
- (struct bfd_link_info *, const char *, bfd_boolean);
+ (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
+ bfd_boolean);
extern struct bfd_link_needed_list *bfd_elf_get_needed_list
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_elf_get_bfd_needed_list
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 81fb666..fc02ecf 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -640,7 +640,8 @@ enum dynamic_lib_link_class {
};
extern bfd_boolean bfd_elf_record_link_assignment
- (struct bfd_link_info *, const char *, bfd_boolean);
+ (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
+ bfd_boolean);
extern struct bfd_link_needed_list *bfd_elf_get_needed_list
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_elf_get_bfd_needed_list
@@ -4613,11 +4614,6 @@ void bfd_preserve_restore (bfd *, struct bfd_preserve *);
void bfd_preserve_finish (bfd *, struct bfd_preserve *);
-void bfd_hide_symbol (bfd *,
- struct bfd_link_info *,
- struct bfd_link_hash_entry *,
- bfd_boolean);
-
/* Extracted from archive.c. */
symindex bfd_get_next_mapent
(bfd *abfd, symindex previous, carsym **sym);
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 3783ccf..af1b730 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -1511,29 +1511,3 @@ bfd_preserve_finish (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_preserve *preserve)
objalloc. */
bfd_hash_table_free (&preserve->section_htab);
}
-
-/*
-FUNCTION
- bfd_hide_symbol
-
-SYNOPSIS
- void bfd_hide_symbol (bfd *,
- struct bfd_link_info *,
- struct bfd_link_hash_entry *,
- bfd_boolean);
-
-DESCRIPTION
- This function hides a symbol so that it won't be exported.
-
-*/
-
-void
-bfd_hide_symbol (bfd *abfd,
- struct bfd_link_info *link_info,
- struct bfd_link_hash_entry *h,
- bfd_boolean force_local)
-{
- if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
- (get_elf_backend_data (abfd)->elf_backend_hide_symbol)
- (link_info, (struct elf_link_hash_entry *) h, force_local);
-}
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 1fcfce3..f31c5c1 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -424,9 +424,11 @@ bfd_elf_link_record_dynamic_symbol (struct bfd_link_info *info,
this in case some dynamic object refers to this symbol. */
bfd_boolean
-bfd_elf_record_link_assignment (struct bfd_link_info *info,
+bfd_elf_record_link_assignment (bfd *output_bfd,
+ struct bfd_link_info *info,
const char *name,
- bfd_boolean provide)
+ bfd_boolean provide,
+ bfd_boolean hidden)
{
struct elf_link_hash_entry *h;
struct elf_link_hash_table *htab;
@@ -473,6 +475,14 @@ bfd_elf_record_link_assignment (struct bfd_link_info *info,
h->def_regular = 1;
+ if (provide && hidden)
+ {
+ const struct elf_backend_data *bed = get_elf_backend_data (output_bfd);
+
+ h->other = (h->other & ~ELF_ST_VISIBILITY (-1)) | STV_HIDDEN;
+ (*bed->elf_backend_hide_symbol) (info, h, TRUE);
+ }
+
/* STV_HIDDEN and STV_INTERNAL symbols must be STB_LOCAL in shared objects
and executables. */
if (!info->relocatable
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 42b1e62..9927ab8 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,12 @@
+2005-12-07 Thiemo Seufer <ths@networkno.de>
+ H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/1932
+ * emultempl/elf32.em (gld${EMULATION_NAME}_find_exp_assignment):
+ Adjust bfd_elf_record_link_assignment call.
+
+ * ldexp.c (exp_fold_tree_1): Remove call to bfd_hide_symbol.
+
2005-11-25 Jan Beulich <jbeulich@novell.com>
* Makefile.am: Make configdoc.texi writeable before trying
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 55e1663..703248a 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -986,8 +986,9 @@ gld${EMULATION_NAME}_find_exp_assignment (etree_type *exp)
will do no harm. */
if (strcmp (exp->assign.dst, ".") != 0)
{
- if (!bfd_elf_record_link_assignment (&link_info, exp->assign.dst,
- provide))
+ if (!bfd_elf_record_link_assignment (output_bfd, &link_info,
+ exp->assign.dst, provide,
+ exp->assign.hidden))
einfo ("%P%F: failed to record assignment to %s: %E\n",
exp->assign.dst);
}
diff --git a/ld/ldexp.c b/ld/ldexp.c
index cee1da5..c9d707e 100644
--- a/ld/ldexp.c
+++ b/ld/ldexp.c
@@ -735,8 +735,6 @@ exp_fold_tree_1 (etree_type *tree)
defined by some object. */
break;
}
- if (tree->assign.hidden)
- bfd_hide_symbol (output_bfd, &link_info, h, TRUE);
}
exp_fold_tree_1 (tree->assign.src);