aboutsummaryrefslogtreecommitdiff
path: root/gas/config/obj-coff.c
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@cygnus>1994-12-20 20:07:41 +0000
committerKen Raeburn <raeburn@cygnus>1994-12-20 20:07:41 +0000
commitd675782a06250d9f0b6d17cfa3be850634ffc27f (patch)
treef269f7aba9aa65f7899d90bc5d05f21b10784282 /gas/config/obj-coff.c
parent7e2283d46cbc0f342eed40e5e35596264f8fe104 (diff)
downloadgdb-d675782a06250d9f0b6d17cfa3be850634ffc27f.zip
gdb-d675782a06250d9f0b6d17cfa3be850634ffc27f.tar.gz
gdb-d675782a06250d9f0b6d17cfa3be850634ffc27f.tar.bz2
* config/obj-aout.h, config/obj-coff.c, config/obj-elf.h, config/obj-som.h,
config/tc-h8500.c, config/tc-hppa.c, config/tc-hppa.h, config/tc-sh.c, config/tc-z8k.c: Don't rely on use of ".." when including header files. * config/tc-rce.c: Ditto. * config/obj-coff.c (fixup_segment): Reformat condition in an `if' statement.
Diffstat (limited to 'gas/config/obj-coff.c')
-rw-r--r--gas/config/obj-coff.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c
index 41e3b0a..b263fe3 100644
--- a/gas/config/obj-coff.c
+++ b/gas/config/obj-coff.c
@@ -1014,18 +1014,23 @@ coff_frob_symbol (symp, punt)
if (coffsymbol (symp->bsym)->lineno)
{
- int i, n;
+ int i;
struct line_no *lptr;
alent *l;
lptr = (struct line_no *) coffsymbol (symp->bsym)->lineno;
for (i = 0; lptr; lptr = lptr->next)
i++;
- n = i + 1;
lptr = (struct line_no *) coffsymbol (symp->bsym)->lineno;
- l = (alent *) bfd_alloc_by_size_t (stdoutput, n * sizeof (alent));
+
+ /* We need i entries for line numbers, plus 1 for the first
+ entry which BFD will override, plus 1 for the last zero
+ entry (a marker for BFD). */
+ l = (alent *) bfd_alloc_by_size_t (stdoutput, (i + 2) * sizeof (alent));
coffsymbol (symp->bsym)->lineno = l;
- for (i = n - 1; i > 0; i--)
+ l[i + 1].line_number = 0;
+ l[i + 1].u.sym = NULL;
+ for (; i > 0; i--)
{
if (lptr->frag)
lptr->l.u.offset += lptr->frag->fr_address;
@@ -1045,6 +1050,11 @@ coff_adjust_section_syms (abfd, sec, x)
segment_info_type *seginfo = seg_info (sec);
int nlnno, nrelocs = 0;
+ /* RS/6000 gas creates a .debug section manually in ppc_frob_file in
+ tc-ppc.c. Do not get confused by it. */
+ if (seginfo == NULL)
+ return;
+
if (!strcmp (sec->name, ".text"))
nlnno = n_line_nos;
else
@@ -1291,8 +1301,8 @@ symbol_dump ()
#include "frags.h"
/* This is needed because we include internal bfd things. */
#include <time.h>
-#include "../bfd/libbfd.h"
-#include "../bfd/libcoff.h"
+#include "bfd/libbfd.h"
+#include "bfd/libcoff.h"
/* The NOP_OPCODE is for the alignment fill value. Fill with nop so
that we can stick sections together without causing trouble. */
@@ -3687,16 +3697,18 @@ fixup_segment (segP, this_segment_type)
#ifndef TC_M88K
/* The m88k uses the offset field of the reloc to get around
this problem. */
- if ((size == 1 &&
- (add_number & ~0xFF) && ((add_number & ~0xFF) != (-1 & ~0xFF))) ||
- (size == 2 &&
- (add_number & ~0xFFFF) && ((add_number & ~0xFFFF) != (-1 & ~0xFFFF))))
+ if ((size == 1
+ && (add_number & ~0xFF)
+ && ((add_number & ~0xFF) != (-1 & ~0xFF)))
+ || (size == 2
+ && (add_number & ~0xFFFF)
+ && ((add_number & ~0xFFFF) != (-1 & ~0xFFFF))))
{
as_bad_where (fixP->fx_file, fixP->fx_line,
"Value of %ld too large for field of %d bytes at 0x%lx",
(long) add_number, size,
(unsigned long) (fragP->fr_address + where));
- } /* generic error checking */
+ }
#endif
#ifdef WARN_SIGNED_OVERFLOW_WORD
/* Warn if a .word value is too large when treated as