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 | 84c254c6468727c14abf8f639a2605d5a08f4a14 (patch) | |
tree | f28e0b7b814c9ccb21fc49bfc42efe18b7274d91 /bfd/coffgen.c | |
parent | 261a45adfff7bb0c49b661d7416eee3cfc2d2115 (diff) | |
download | gdb-84c254c6468727c14abf8f639a2605d5a08f4a14.zip gdb-84c254c6468727c14abf8f639a2605d5a08f4a14.tar.gz gdb-84c254c6468727c14abf8f639a2605d5a08f4a14.tar.bz2 |
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 3ce9f78..513f635 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, |