aboutsummaryrefslogtreecommitdiff
path: root/bfd/coff-mips.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1993-01-26 19:54:07 +0000
committerIan Lance Taylor <ian@airs.com>1993-01-26 19:54:07 +0000
commit382f2a3d75c1c09a1b63334d045d13f621a7a32b (patch)
tree442bc4c34e322ef510e5856c37cff5529f67cbf5 /bfd/coff-mips.c
parent388d8904711324aeccbfb9ef25851b15905f3736 (diff)
downloadgdb-382f2a3d75c1c09a1b63334d045d13f621a7a32b.zip
gdb-382f2a3d75c1c09a1b63334d045d13f621a7a32b.tar.gz
gdb-382f2a3d75c1c09a1b63334d045d13f621a7a32b.tar.bz2
Tue Jan 26 11:43:14 1993 Ian Lance Taylor (ian@cygnus.com)
* section.c (SEC_IS_COMMON): New section flag, needed for MIPS ECOFF which has two common sections. (bfd_com_section): Set SEC_IS_COMMON flag. * bfd-in.h (bfd_is_com_section): New macro to test SEC_IS_COMMON. * aoutx.h, archive.c, bout.c, coff-a29k.c, coff-m88k.c, coff-mips.c, coffgen.c, ieee.c, oasys.c, reloc.c, syms.: Use bfd_is_com_section macro rather than checking for equality to bfd_com_section.
Diffstat (limited to 'bfd/coff-mips.c')
-rw-r--r--bfd/coff-mips.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c
index 57dd096..210a493 100644
--- a/bfd/coff-mips.c
+++ b/bfd/coff-mips.c
@@ -191,7 +191,7 @@ DEFUN (ecoff_new_section_hook, (abfd, section),
section->flags |= SEC_DATA | SEC_LOAD | SEC_ALLOC | SEC_READONLY;
else if (strcmp (section->name, _BSS) == 0
|| strcmp (section->name, _SBSS) == 0)
- section->flags |= SEC_ALLOC;
+ section->flags |= SEC_ALLOC | SEC_IS_COMMON;
/* Probably any other section name is SEC_NEVER_LOAD, but I'm
uncertain about .init on some systems and I don't know how shared
@@ -617,17 +617,8 @@ DEFUN (ecoff_set_symbol_info, (abfd, ecoff_sym, asym, ext),
asym->value -= asym->section->vma;
break;
case scSBss:
- /* FIXME: putting global .sbss symbols in the common section is
- wrong, because it means they may not be accessible via the gp
- register. But the linker checks the section a symbol is in
- rather than checking the flags. */
- if (ext)
- asym->section = &bfd_com_section;
- else
- {
- asym->section = bfd_make_section_old_way (abfd, ".sbss");
- asym->value -= asym->section->vma;
- }
+ asym->section = bfd_make_section_old_way (abfd, ".sbss");
+ asym->value -= asym->section->vma;
break;
case scRData:
asym->section = bfd_make_section_old_way (abfd, ".rdata");
@@ -637,9 +628,12 @@ DEFUN (ecoff_set_symbol_info, (abfd, ecoff_sym, asym, ext),
asym->flags = BSF_DEBUGGING;
break;
case scCommon:
- case scSCommon:
asym->section = &bfd_com_section;
break;
+ case scSCommon:
+ asym->section = bfd_make_section_old_way (abfd, ".sbss");
+ asym->value -= asym->section->vma;
+ break;
case scVarRegister:
case scVariant:
asym->flags = BSF_DEBUGGING;
@@ -1408,7 +1402,7 @@ DEFUN (ecoff_refhi_reloc, (abfd,
BFD_ASSERT (rello->howto->type == ECOFF_R_REFLO
&& *rello->sym_ptr_ptr == *reloc_entry->sym_ptr_ptr);
- if (symbol->section == &bfd_com_section)
+ if (bfd_is_com_section (symbol->section))
relocation = 0;
else
relocation = symbol->value;
@@ -1527,7 +1521,7 @@ DEFUN (ecoff_gprel_reloc, (abfd,
}
}
- if (symbol->section == &bfd_com_section)
+ if (bfd_is_com_section (symbol->section))
relocation = 0;
else
relocation = symbol->value;
@@ -2355,7 +2349,7 @@ DEFUN (ecoff_get_debug, (output_bfd, seclet, section),
SYMR sym;
ecoff_swap_sym_in (input_bfd, esym_ptr->native.lnative, &sym);
- if (esym_ptr->symbol.section != &bfd_com_section
+ if (! bfd_is_com_section (esym_ptr->symbol.section)
&& (esym_ptr->symbol.flags & BSF_DEBUGGING) == 0
&& esym_ptr->symbol.section != &bfd_und_section)
sym.value = (esym_ptr->symbol.value
@@ -2814,7 +2808,7 @@ DEFUN (ecoff_bfd_seclet_link, (abfd, data, relocateable),
esym.asym.iss = symhdr->issExtMax;
- if (sym_ptr->section == &bfd_com_section
+ if (bfd_is_com_section (sym_ptr->section)
|| sym_ptr->section == &bfd_und_section)
esym.asym.value = sym_ptr->value;
else