This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[RFA:] Put export_dynamics flag in struct bfd_link_info, part 2
- To: binutils at sources dot redhat dot com
- Subject: [RFA:] Put export_dynamics flag in struct bfd_link_info, part 2
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Date: Fri, 15 Jun 2001 19:00:13 +0200
Part 2, cleaning up redundancy: export_dynamic passed as a
parameter and the ld command-line struct member.
Ok to commit?
bfd:
* elflink.h (struct elf_assign_sym_version_info): Remove member
export_dynamic. All users changed to use info member.
NAME(bfd_elf,size_dynamic_sections)): Remove parameter
export_dynamic, instead use member in parameter info.
* bfd-in.h (bfd_elf32_size_dynamic_sections,
bfd_elf64_size_dynamic_sections): Update prototype.
* bfd-in2.h: Regenerate.
ld:
* emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
Update for API change in bfd_elf${ELFSIZE}_size_dynamic_sections.
* mpw-elfmips.c (gldelf32ebmip_before_allocation): Ditto.
* ld.h (args_type): Remove member export_dynamic. All users
changed to use struct bfd_link_info member.
Index: bfd/bfd-in.h
===================================================================
RCS file: /cvs/src/src/bfd/bfd-in.h,v
retrieving revision 1.27
diff -c -p -r1.27 bfd-in.h
*** bfd/bfd-in.h 2001/05/24 20:50:50 1.27
--- bfd/bfd-in.h 2001/06/15 16:29:50
*************** extern struct bfd_link_needed_list *bfd_
*** 625,635 ****
extern boolean bfd_elf_get_bfd_needed_list
PARAMS ((bfd *, struct bfd_link_needed_list **));
extern boolean bfd_elf32_size_dynamic_sections
! PARAMS ((bfd *, const char *, const char *, boolean, const char *,
const char * const *, struct bfd_link_info *, struct sec **,
struct bfd_elf_version_tree *));
extern boolean bfd_elf64_size_dynamic_sections
! PARAMS ((bfd *, const char *, const char *, boolean, const char *,
const char * const *, struct bfd_link_info *, struct sec **,
struct bfd_elf_version_tree *));
extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
--- 625,635 ----
extern boolean bfd_elf_get_bfd_needed_list
PARAMS ((bfd *, struct bfd_link_needed_list **));
extern boolean bfd_elf32_size_dynamic_sections
! PARAMS ((bfd *, const char *, const char *, const char *,
const char * const *, struct bfd_link_info *, struct sec **,
struct bfd_elf_version_tree *));
extern boolean bfd_elf64_size_dynamic_sections
! PARAMS ((bfd *, const char *, const char *, const char *,
const char * const *, struct bfd_link_info *, struct sec **,
struct bfd_elf_version_tree *));
extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
Index: bfd/bfd-in2.h
===================================================================
RCS file: /cvs/src/src/bfd/bfd-in2.h,v
retrieving revision 1.100
diff -c -p -r1.100 bfd-in2.h
*** bfd/bfd-in2.h 2001/05/28 09:23:53 1.100
--- bfd/bfd-in2.h 2001/06/15 16:29:51
*************** extern struct bfd_link_needed_list *bfd_
*** 625,635 ****
extern boolean bfd_elf_get_bfd_needed_list
PARAMS ((bfd *, struct bfd_link_needed_list **));
extern boolean bfd_elf32_size_dynamic_sections
! PARAMS ((bfd *, const char *, const char *, boolean, const char *,
const char * const *, struct bfd_link_info *, struct sec **,
struct bfd_elf_version_tree *));
extern boolean bfd_elf64_size_dynamic_sections
! PARAMS ((bfd *, const char *, const char *, boolean, const char *,
const char * const *, struct bfd_link_info *, struct sec **,
struct bfd_elf_version_tree *));
extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
--- 625,635 ----
extern boolean bfd_elf_get_bfd_needed_list
PARAMS ((bfd *, struct bfd_link_needed_list **));
extern boolean bfd_elf32_size_dynamic_sections
! PARAMS ((bfd *, const char *, const char *, const char *,
const char * const *, struct bfd_link_info *, struct sec **,
struct bfd_elf_version_tree *));
extern boolean bfd_elf64_size_dynamic_sections
! PARAMS ((bfd *, const char *, const char *, const char *,
const char * const *, struct bfd_link_info *, struct sec **,
struct bfd_elf_version_tree *));
extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
Index: bfd/elflink.h
===================================================================
RCS file: /cvs/src/src/bfd/elflink.h,v
retrieving revision 1.95
diff -c -p -r1.95 elflink.h
*** bfd/elflink.h 2001/06/12 17:44:37 1.95
--- bfd/elflink.h 2001/06/15 16:29:52
*************** struct elf_assign_sym_version_info
*** 2679,2686 ****
struct bfd_link_info *info;
/* Version tree. */
struct bfd_elf_version_tree *verdefs;
- /* Whether we are exporting all dynamic symbols. */
- boolean export_dynamic;
/* Whether we had a failure. */
boolean failed;
};
--- 2679,2684 ----
*************** compute_bucket_count (info)
*** 2862,2874 ****
boolean
NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
! export_dynamic, filter_shlib,
auxiliary_filters, info, sinterpptr,
verdefs)
bfd *output_bfd;
const char *soname;
const char *rpath;
- boolean export_dynamic;
const char *filter_shlib;
const char * const *auxiliary_filters;
struct bfd_link_info *info;
--- 2860,2871 ----
boolean
NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
! filter_shlib,
auxiliary_filters, info, sinterpptr,
verdefs)
bfd *output_bfd;
const char *soname;
const char *rpath;
const char *filter_shlib;
const char * const *auxiliary_filters;
struct bfd_link_info *info;
*************** NAME(bfd_elf,size_dynamic_sections) (out
*** 2971,2977 ****
/* If we are supposed to export all symbols into the dynamic symbol
table (this is not the normal case), then do so. */
! if (export_dynamic)
{
elf_link_hash_traverse (elf_hash_table (info), elf_export_symbol,
(PTR) &eif);
--- 2968,2974 ----
/* If we are supposed to export all symbols into the dynamic symbol
table (this is not the normal case), then do so. */
! if (info->export_dynamic)
{
elf_link_hash_traverse (elf_hash_table (info), elf_export_symbol,
(PTR) &eif);
*************** NAME(bfd_elf,size_dynamic_sections) (out
*** 2983,2989 ****
asvinfo.output_bfd = output_bfd;
asvinfo.info = info;
asvinfo.verdefs = verdefs;
- asvinfo.export_dynamic = export_dynamic;
asvinfo.failed = false;
elf_link_hash_traverse (elf_hash_table (info),
--- 2980,2985 ----
*************** elf_link_assign_sym_version (h, data)
*** 3884,3890 ****
{
if (h->dynindx != -1
&& info->shared
! && ! sinfo->export_dynamic)
{
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
(*bed->elf_backend_hide_symbol) (info, h);
--- 3880,3886 ----
{
if (h->dynindx != -1
&& info->shared
! && ! info->export_dynamic)
{
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
(*bed->elf_backend_hide_symbol) (info, h);
*************** elf_link_assign_sym_version (h, data)
*** 3996,4002 ****
h->verinfo.vertree = t;
if (h->dynindx != -1
&& info->shared
! && ! sinfo->export_dynamic)
{
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
(*bed->elf_backend_hide_symbol) (info, h);
--- 3992,3998 ----
h->verinfo.vertree = t;
if (h->dynindx != -1
&& info->shared
! && ! info->export_dynamic)
{
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
(*bed->elf_backend_hide_symbol) (info, h);
*************** elf_link_assign_sym_version (h, data)
*** 4018,4024 ****
h->verinfo.vertree = deflt;
if (h->dynindx != -1
&& info->shared
! && ! sinfo->export_dynamic)
{
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
(*bed->elf_backend_hide_symbol) (info, h);
--- 4014,4020 ----
h->verinfo.vertree = deflt;
if (h->dynindx != -1
&& info->shared
! && ! info->export_dynamic)
{
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
(*bed->elf_backend_hide_symbol) (info, h);
Index: ld/ld.h
===================================================================
RCS file: /cvs/src/src/ld/ld.h,v
retrieving revision 1.11
diff -c -p -r1.11 ld.h
*** ld/ld.h 2001/04/13 02:22:23 1.11
--- ld/ld.h 2001/06/15 16:29:59
*************** typedef struct {
*** 115,124 ****
/* Big or little endian as set on command line. */
enum { ENDIAN_UNSET = 0, ENDIAN_BIG, ENDIAN_LITTLE } endian;
- /* If true, export all symbols in the dynamic symbol table of an ELF
- executable. */
- boolean export_dynamic;
-
/* If true, build MIPS embedded PIC relocation tables in the output
file. */
boolean embedded_relocs;
--- 115,120 ----
Index: ld/lexsup.c
===================================================================
RCS file: /cvs/src/src/ld/lexsup.c,v
retrieving revision 1.35
diff -c -p -r1.35 lexsup.c
*** ld/lexsup.c 2001/06/15 13:02:23 1.35
--- ld/lexsup.c 2001/06/15 16:29:59
*************** parse_args (argc, argv)
*** 666,672 ****
break;
case OPTION_EXPORT_DYNAMIC:
case 'E': /* HP/UX compatibility. */
- command_line.export_dynamic = true;
link_info.export_dynamic = true;
break;
case 'e':
--- 666,671 ----
Index: ld/mpw-elfmips.c
===================================================================
RCS file: /cvs/src/src/ld/mpw-elfmips.c,v
retrieving revision 1.4
diff -c -p -r1.4 mpw-elfmips.c
*** ld/mpw-elfmips.c 2001/03/13 06:14:27 1.4
--- ld/mpw-elfmips.c 2001/06/15 16:29:59
*************** gldelf32ebmip_before_allocation ()
*** 445,451 ****
rpath = (const char *) getenv ("LD_RUN_PATH");
if (! (bfd_elf32_size_dynamic_sections
(output_bfd, command_line.soname, rpath,
! command_line.export_dynamic, command_line.filter_shlib,
(const char * const *) command_line.auxiliary_filters,
&link_info, &sinterp, lang_elf_version_info)))
einfo (_("%P%F: failed to set dynamic section sizes: %E\n"));
--- 445,451 ----
rpath = (const char *) getenv ("LD_RUN_PATH");
if (! (bfd_elf32_size_dynamic_sections
(output_bfd, command_line.soname, rpath,
! command_line.filter_shlib,
(const char * const *) command_line.auxiliary_filters,
&link_info, &sinterp, lang_elf_version_info)))
einfo (_("%P%F: failed to set dynamic section sizes: %E\n"));
Index: ld/emultempl/elf32.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/elf32.em,v
retrieving revision 1.48
diff -c -p -r1.48 elf32.em
*** ld/emultempl/elf32.em 2001/05/25 05:39:22 1.48
--- ld/emultempl/elf32.em 2001/06/15 16:30:01
*************** gld${EMULATION_NAME}_before_allocation (
*** 837,843 ****
rpath = (const char *) getenv ("LD_RUN_PATH");
if (! (bfd_elf${ELFSIZE}_size_dynamic_sections
(output_bfd, command_line.soname, rpath,
! command_line.export_dynamic, command_line.filter_shlib,
(const char * const *) command_line.auxiliary_filters,
&link_info, &sinterp, lang_elf_version_info)))
einfo ("%P%F: failed to set dynamic section sizes: %E\n");
--- 837,843 ----
rpath = (const char *) getenv ("LD_RUN_PATH");
if (! (bfd_elf${ELFSIZE}_size_dynamic_sections
(output_bfd, command_line.soname, rpath,
! command_line.filter_shlib,
(const char * const *) command_line.auxiliary_filters,
&link_info, &sinterp, lang_elf_version_info)))
einfo ("%P%F: failed to set dynamic section sizes: %E\n");
brgds, H-P