alent *lineno = symbol->lineno;
- if (lineno) {
+ if (lineno && !symbol->done_lineno) {
unsigned int count = 0;
lineno[count].u.offset = written;
if (native->u.syment.n_numaux) {
symbol->symbol.section->output_offset;
count++;
}
+ symbol->done_lineno = true;
+
symbol->symbol.section->output_section->moving_line_filepos +=
count * LINESZ;
}
} /* on error */
new->native = 0;
new->lineno = (alent *) NULL;
+ new->done_lineno = false;
new->symbol.the_bfd = abfd;
return &new->symbol;
}
}
+ {
+ struct lineno_cache_entry *l = coffsymbol(symbol)->lineno;
+ if (l)
+ {
+ printf("\n%s :", l->u.sym->name);
+ l++;
+ while (l->line_number)
+ {
+ printf("\n%4d : %x",
+ l->line_number,
+ l->u.offset);
+ l++;
+
+ }
+ }
+ }
return shrink;
}
-extern boolean
+static boolean
DEFUN(bfd_coff_relax_section,(abfd, i, symbols, seclet),
bfd *abfd AND
asection *i AND
bfd *input_bfd = i->owner;
asection *input_section = i;
int shrink = 0 ;
- int new = 0;
+ boolean new = false;
bfd_size_type reloc_size = bfd_get_reloc_upper_bound(input_bfd,
input_section);
case R_MOVB1:
shrink = movb1(input_section, symbols, r, shrink);
- new = 1;
+ new = true;
break;
case R_JMP1:
shrink = jmp1(input_section, symbols, r, shrink);
- new = 1;
+ new = true;
break;
}
bfd *input_bfd = seclet->u.indirect.section->owner;
asection *input_section = seclet->u.indirect.section;
- char *data = malloc(input_section->_raw_size);
- char *dst = data;
- char *prev_dst = data;
+ bfd_byte *data = (bfd_byte *)malloc(input_section->_raw_size);
+ bfd_byte *dst = data;
+ bfd_byte *prev_dst = data;
unsigned int gap = 0;
/* Object file tdata; access macros */
-#define coff_data(bfd) ((coff_data_type *) ((bfd)->tdata))
+#define coff_data(bfd) ((bfd)->tdata.coff_obj_data)
#define exec_hdr(bfd) (coff_data(bfd)->hdr)
#define obj_symbols(bfd) (coff_data(bfd)->symbols)
#define obj_sym_filepos(bfd) (coff_data(bfd)->sym_filepos)
/* And more taken from the source .. */
+typedef struct coff_ptr_struct
{
/* Remembers the offset from the first symbol in the file for
typedef struct coff_symbol_struct
{
- /* The actual symbol which the rest of BFD works with */
-asymbol symbol;
+ /* The actual symbol which the rest of BFD works with */
+ asymbol symbol;
- /* A pointer to the hidden information for this symbol */
-combined_entry_type *native;
-
- /* A pointer to the linenumber information for this symbol */
-struct lineno_cache_entry *lineno;
+ /* A pointer to the hidden information for this symbol */
+ combined_entry_type *native;
+ /* A pointer to the linenumber information for this symbol */
+ struct lineno_cache_entry *lineno;
+ boolean done_lineno;
} coff_symbol_type;