Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu/dist/bfd Make sure the dynsym section and the reserved b...



details:   https://anonhg.NetBSD.org/src/rev/59344bd1bdf7
branches:  trunk
changeset: 487715:59344bd1bdf7
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Sun Jun 11 23:47:56 2000 +0000

description:
Make sure the dynsym section and the reserved bits in the RPDR are fully
initialized.

diffstat:

 gnu/dist/bfd/elf32-mips.c |  3 +++
 gnu/dist/bfd/elflink.h    |  6 ++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 6324eeaae2b5 -r 59344bd1bdf7 gnu/dist/bfd/elf32-mips.c
--- a/gnu/dist/bfd/elf32-mips.c Sun Jun 11 23:43:17 2000 +0000
+++ b/gnu/dist/bfd/elf32-mips.c Sun Jun 11 23:47:56 2000 +0000
@@ -2894,8 +2894,11 @@
   bfd_h_put_16 (abfd, in->pcreg, (bfd_byte *) ex->p_pcreg);
 
   bfd_h_put_32 (abfd, in->irpss, (bfd_byte *) ex->p_irpss);
+  bfd_h_put_32 (abfd, 0, (bfd_byte *) ex->p_reserved);
 #if 0 /* FIXME */
   ecoff_put_off (abfd, in->exception_info, (bfd_byte *) ex->p_exception_info);
+#else
+  bfd_h_put_32 (abfd, 0, (bfd_byte *) ex->p_exception_info);
 #endif
 }
 
diff -r 6324eeaae2b5 -r 59344bd1bdf7 gnu/dist/bfd/elflink.h
--- a/gnu/dist/bfd/elflink.h    Sun Jun 11 23:43:17 2000 +0000
+++ b/gnu/dist/bfd/elflink.h    Sun Jun 11 23:47:56 2000 +0000
@@ -2730,11 +2730,13 @@
         We will build the contents of .dynsym and .hash when we build
         the final symbol table, because until then we do not know the
         correct value to give the symbols.  We built the .dynstr
-        section as we went along in elf_link_add_object_symbols.  */
+        section as we went along in elf_link_add_object_symbols.
+        FIXME: We use bfd_zalloc() here because there may be holes
+        where sections were deleted above.  */
       s = bfd_get_section_by_name (dynobj, ".dynsym");
       BFD_ASSERT (s != NULL);
       s->_raw_size = dynsymcount * sizeof (Elf_External_Sym);
-      s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size);
+      s->contents = (bfd_byte *) bfd_zalloc (output_bfd, s->_raw_size);
       if (s->contents == NULL && s->_raw_size != 0)
        return false;
 



Home | Main Index | Thread Index | Old Index