(coff_bfd_reloc_type_lookup): Don't define if already defined.

(coff_slurp_line_table): Reformatted.
This commit is contained in:
Ken Raeburn 1993-11-19 16:30:08 +00:00
parent a179597c4e
commit ab31ae5384

View file

@ -1641,6 +1641,8 @@ DEFUN(coff_write_object_contents,(abfd),
architectures. architectures.
*/ */
memset (&internal_a, 0, sizeof internal_a);
/* Set up architecture-dependent stuff */ /* Set up architecture-dependent stuff */
{ unsigned int magic = 0; { unsigned int magic = 0;
@ -1859,27 +1861,33 @@ asection *asect;
asect->lineno_count)); asect->lineno_count));
lineno_cache = lineno_cache =
(alent *) bfd_alloc(abfd, (size_t) ((asect->lineno_count + 1) * sizeof(alent))); (alent *) bfd_alloc(abfd, (size_t) ((asect->lineno_count + 1) * sizeof(alent)));
if (lineno_cache == NULL) { if (lineno_cache == NULL)
{
bfd_error = no_memory; bfd_error = no_memory;
return false; return false;
} else { }
else
{
unsigned int counter = 0; unsigned int counter = 0;
alent *cache_ptr = lineno_cache; alent *cache_ptr = lineno_cache;
LINENO *src = native_lineno; LINENO *src = native_lineno;
while (counter < asect->lineno_count) { while (counter < asect->lineno_count)
{
struct internal_lineno dst; struct internal_lineno dst;
coff_swap_lineno_in(abfd, src, &dst); coff_swap_lineno_in(abfd, src, &dst);
cache_ptr->line_number = dst.l_lnno; cache_ptr->line_number = dst.l_lnno;
if (cache_ptr->line_number == 0) { if (cache_ptr->line_number == 0)
{
coff_symbol_type *sym = coff_symbol_type *sym =
(coff_symbol_type *) (dst.l_addr.l_symndx (coff_symbol_type *) (dst.l_addr.l_symndx
+ obj_raw_syments(abfd))->u.syment._n._n_n._n_zeroes; + obj_raw_syments(abfd))->u.syment._n._n_n._n_zeroes;
cache_ptr->u.sym = (asymbol *) sym; cache_ptr->u.sym = (asymbol *) sym;
sym->lineno = cache_ptr; sym->lineno = cache_ptr;
} }
else { else
{
cache_ptr->u.offset = dst.l_addr.l_paddr cache_ptr->u.offset = dst.l_addr.l_paddr
- bfd_section_vma(abfd, asect); - bfd_section_vma(abfd, asect);
} /* If no linenumber expect a symbol index */ } /* If no linenumber expect a symbol index */
@ -1894,7 +1902,7 @@ asection *asect;
asect->lineno = lineno_cache; asect->lineno = lineno_cache;
/* FIXME, free native_lineno here, or use alloca or something. */ /* FIXME, free native_lineno here, or use alloca or something. */
return true; return true;
} /* coff_slurp_line_table() */ }
static boolean static boolean
DEFUN(coff_slurp_symbol_table,(abfd), DEFUN(coff_slurp_symbol_table,(abfd),
@ -2380,5 +2388,7 @@ static CONST bfd_coff_backend_data bfd_coff_std_swap_table = {
#define coff_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents #define coff_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
#define coff_bfd_relax_section bfd_generic_relax_section #define coff_bfd_relax_section bfd_generic_relax_section
#define coff_bfd_seclet_link bfd_generic_seclet_link #define coff_bfd_seclet_link bfd_generic_seclet_link
#ifndef coff_bfd_reloc_type_lookup
#define coff_bfd_reloc_type_lookup \ #define coff_bfd_reloc_type_lookup \
((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr) ((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr)
#endif