* elf-bfd.h (struct elf_backend_data): Add want_dynbss.

* elflink.c (_bfd_elf_create_dynamic_sections): Only create
        .dynbss and .rel[a].bss if want_dynbss.
        * elfxx-target.h (elf_backend_want_dynbss): Provide default.
This commit is contained in:
Richard Henderson 1999-07-13 18:31:17 +00:00
parent 30b30c2181
commit 3018b44153
4 changed files with 36 additions and 20 deletions

View File

@ -1,7 +1,16 @@
1999-07-13 Richard Henderson <rth@cygnus.com>
* elf-bfd.h (struct elf_backend_data): Add want_dynbss.
* elflink.c (_bfd_elf_create_dynamic_sections): Only create
.dynbss and .rel[a].bss if want_dynbss.
* elfxx-target.h (elf_backend_want_dynbss): Provide default.
1999-07-13 Richard Henderson <rth@cygnus.com> 1999-07-13 Richard Henderson <rth@cygnus.com>
* elf.c (assign_file_positions_for_segments): Don't overwrite p_flags. * elf.c (assign_file_positions_for_segments): Don't overwrite p_flags.
1999-07-13 Richard Henderson <rth@cygnus.com>
* elf-bfd.h (struct elf_link_local_dynamic_entry): New. * elf-bfd.h (struct elf_link_local_dynamic_entry): New.
(struct elf_link_hash_table): Add dynlocal. (struct elf_link_hash_table): Add dynlocal.
(_bfd_elf_link_lookup_local_dynindx): Prototype. (_bfd_elf_link_lookup_local_dynindx): Prototype.

View File

@ -623,6 +623,7 @@ struct elf_backend_data
unsigned plt_not_loaded : 1; unsigned plt_not_loaded : 1;
unsigned plt_alignment : 4; unsigned plt_alignment : 4;
unsigned can_gc_sections : 1; unsigned can_gc_sections : 1;
unsigned want_dynbss : 1;
}; };
/* Information stored for each BFD section in an ELF file. This /* Information stored for each BFD section in an ELF file. This

View File

@ -157,6 +157,8 @@ _bfd_elf_create_dynamic_sections (abfd, info)
if (! _bfd_elf_create_got_section (abfd, info)) if (! _bfd_elf_create_got_section (abfd, info))
return false; return false;
if (bed->want_dynbss)
{
/* The .dynbss section is a place to put symbols which are defined /* The .dynbss section is a place to put symbols which are defined
by dynamic objects, are referenced by regular objects, and are by dynamic objects, are referenced by regular objects, and are
not functions. We must allocate space for them in the process not functions. We must allocate space for them in the process
@ -189,6 +191,7 @@ _bfd_elf_create_dynamic_sections (abfd, info)
|| ! bfd_set_section_alignment (abfd, s, ptralign)) || ! bfd_set_section_alignment (abfd, s, ptralign))
return false; return false;
} }
}
return true; return true;
} }

View File

@ -80,6 +80,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef elf_backend_plt_alignment #ifndef elf_backend_plt_alignment
#define elf_backend_plt_alignment 2 #define elf_backend_plt_alignment 2
#endif #endif
#ifndef elf_backend_want_dynbss
#define elf_backend_want_dynbss 1
#endif
#define bfd_elfNN_bfd_debug_info_start bfd_void #define bfd_elfNN_bfd_debug_info_start bfd_void
#define bfd_elfNN_bfd_debug_info_end bfd_void #define bfd_elfNN_bfd_debug_info_end bfd_void