diff options
author | Nick Clifton <nickc@redhat.com> | 2001-11-19 15:35:38 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2001-11-19 15:35:38 +0000 |
commit | 1109f04305cd6746a604a27a3988936d33847a38 (patch) | |
tree | eefe9e9235dc58c6d5a8580e9266079acdb6ea68 /bfd/coffgen.c | |
parent | 778e9b30d19bc409bab0e7c69f5290bf5df45b4f (diff) | |
download | gdb-1109f04305cd6746a604a27a3988936d33847a38.tar.gz |
Define and use bfd_is_const_section().
Diffstat (limited to 'bfd/coffgen.c')
-rw-r--r-- | bfd/coffgen.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/bfd/coffgen.c b/bfd/coffgen.c index 3ce9f7849d0..513f635aa0c 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -555,15 +555,18 @@ coff_count_linenumbers (abfd) section's linenumber count. */ alent *l = q->lineno; - ++q->symbol.section->output_section->lineno_count; - ++total; - ++l; - while (l->line_number != 0) + do { + asection * sec = q->symbol.section->output_section; + + /* Do not try to update fields in read-only sections. */ + if (! bfd_is_const_section (sec)) + sec->lineno_count ++; + ++total; - ++q->symbol.section->output_section->lineno_count; ++l; } + while (l->line_number != 0); } } } @@ -1145,8 +1148,9 @@ coff_write_native_symbol (abfd, symbol, written, string_size_p, } symbol->done_lineno = true; - symbol->symbol.section->output_section->moving_line_filepos += - count * bfd_coff_linesz (abfd); + if (! bfd_is_const_section (symbol->symbol.section->output_section)) + symbol->symbol.section->output_section->moving_line_filepos += + count * bfd_coff_linesz (abfd); } return coff_write_symbol (abfd, &(symbol->symbol), native, written, |