aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Chamberlain <sac@cygnus>1996-03-22 00:32:05 +0000
committerSteve Chamberlain <sac@cygnus>1996-03-22 00:32:05 +0000
commit51776a11a69e670c69a5f51c80d54c812b317425 (patch)
treeb1bffdf659f42ff0321208f6eba0c2eef33fa041
parentdf928c8f28aab3867ae2283c7425d1a9480c20a1 (diff)
downloadgdb-51776a11a69e670c69a5f51c80d54c812b317425.zip
gdb-51776a11a69e670c69a5f51c80d54c812b317425.tar.gz
gdb-51776a11a69e670c69a5f51c80d54c812b317425.tar.bz2
* coffcode.h (coff_write_object_contents): Allocate
buffers large enough for any FILEHDR or AOUTHDR.
-rw-r--r--bfd/ChangeLog17
-rw-r--r--bfd/coffcode.h30
2 files changed, 37 insertions, 10 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 76becd7..98b69d4 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,15 @@
+Thu Mar 21 11:00:47 1996 steve chamberlain <sac@slash.cygnus.com>
+
+ * coffcode.h (coff_write_object_contents): Allocate
+ buffers large enough for any FILEHDR or AOUTHDR.
+
+Thu Mar 21 16:28:17 1996 David Mosberger-Tang <davidm@azstarnet.com>
+
+ * ecofflink.c (lookup_line): New static function, renamed and
+ slighly changed from old _bfd_ecoff_locate_line.
+ (_bfd_ecoff_locate_line): Cache line number information. Use
+ lookup_line for actual lookup.
+
Thu Mar 21 14:59:11 1996 Michael Meissner <meissner@tiktok.cygnus.com>
* peicode.h (pe_print_pdata): Warn if the .pdata section is not a
@@ -5,6 +17,11 @@ Thu Mar 21 14:59:11 1996 Michael Meissner <meissner@tiktok.cygnus.com>
Thu Mar 21 13:54:40 1996 Ian Lance Taylor <ian@cygnus.com>
+ * ecoff.c (_bfd_ecoff_find_nearest_line): Use bfd_zalloc to
+ allocate ecoff_find_line, and don't initialize by hand.
+ * elf32-mips.c (mips_elf_find_nearest_line): Use bfd_zalloc for
+ mips_elf_find_line, and don't call memset.
+
* coffcode.h (coff_compute_section_file_positions): If not
producing a final executable, don't consider sofar when aligning
the section to the correct size.
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 80e655f..abdd119 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -2060,9 +2060,15 @@ coff_compute_section_file_positions (abfd)
#ifndef I960
/* make sure that this section is of the right size too */
- old_sofar = sofar;
- sofar = BFD_ALIGN (sofar, 1 << current->alignment_power);
- current->_raw_size += sofar - old_sofar;
+ if ((abfd->flags & EXEC_P) == 0)
+ current->_raw_size = BFD_ALIGN (current->_raw_size,
+ 1 << current->alignment_power);
+ else
+ {
+ old_sofar = sofar;
+ sofar = BFD_ALIGN (sofar, 1 << current->alignment_power);
+ current->_raw_size += sofar - old_sofar;
+ }
#endif
#ifdef _LIB
@@ -2081,7 +2087,11 @@ coff_compute_section_file_positions (abfd)
}
-#ifndef RS6000COFF_C
+#if 0
+
+/* This can never work, because it is called too late--after the
+ section positions have been set. I can't figure out what it is
+ for, so I am going to disable it--Ian Taylor 20 March 1996. */
/* If .file, .text, .data, .bss symbols are missing, add them. */
/* @@ Should we only be adding missing symbols, or overriding the aux
@@ -2151,9 +2161,7 @@ coff_add_missing_symbols (abfd)
return true;
}
-#endif /* ! defined (RS6000COFF_C) */
-
-
+#endif /* 0 */
/* SUPPRESS 558 */
/* SUPPRESS 529 */
@@ -2542,7 +2550,7 @@ coff_write_object_contents (abfd)
if (bfd_get_symcount (abfd) != 0)
{
int firstundef;
-#ifndef RS6000COFF_C
+#if 0
if (!coff_add_missing_symbols (abfd))
return false;
#endif
@@ -2687,14 +2695,16 @@ coff_write_object_contents (abfd)
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
return false;
{
- FILHDR buff;
+ char buff[FILHSZ];
coff_swap_filehdr_out (abfd, (PTR) & internal_f, (PTR) & buff);
if (bfd_write ((PTR) & buff, 1, FILHSZ, abfd) != FILHSZ)
return false;
}
if (abfd->flags & EXEC_P)
{
- AOUTHDR buff;
+ /* Note that peicode.h fills in a PEAOUTHDR, not an AOUTHDR.
+ include/coff/pe.h sets AOUTSZ == sizeof(PEAOUTHDR)) */
+ char buff[AOUTSZ];
coff_swap_aouthdr_out (abfd, (PTR) & internal_a, (PTR) & buff);
if (bfd_write ((PTR) & buff, 1, AOUTSZ, abfd) != AOUTSZ)
return false;