Define and use bfd_is_const_section().

This commit is contained in:
Nick Clifton 2001-11-19 15:35:38 +00:00
parent 261a45adff
commit 84c254c646
4 changed files with 42 additions and 7 deletions

View file

@ -1,3 +1,11 @@
2001-11-19 Nick Clifton <nickc@cambridge.redhat.com>
* section.c (bfd_is_const_section): New macro. Return true if the
given seciton is one of the special, constant, sections.
* bfd-in2.h: Regenerate.
* coffgen.c (coff_count_linenumbers): Use bfd_is_const_section.
(coff_write_native_symbol): Use bfd_is_const_section.
2001-11-19 Alan Modra <amodra@bigpond.net.au>
* elf32-hppa.c (clobber_millicode_symbols): Dec dynstr refcount.
@ -14,6 +22,17 @@
* mmo.c: Adjust documentation tags to use texinfo 4 features.
2001-11-16 Nick Clifton <nickc@cambridge.redhat.com>
* section.c (bfd_is_const_section): New macro. Return true if the
section pointer refers to one of the special, constant sections.
* bfd-in2.h: Regenerate.
* coffgen.c (coff_count_linenumbers): Only update the line number
count in non-special sections.
(coff_write_native_symbol): Only update the line number file
position in non-special sections.
2001-11-15 Daniel Jacobowitz <drow@mvista.com>
* elflink.h (elf_reloc_symbol_deleted_p): Catch all relocs against

View file

@ -1354,6 +1354,12 @@ extern const asection bfd_ind_section;
#define bfd_ind_section_ptr ((asection *) &bfd_ind_section)
#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
#define bfd_is_const_section(SEC) \
( ((SEC) == bfd_abs_section_ptr) \
|| ((SEC) == bfd_und_section_ptr) \
|| ((SEC) == bfd_com_section_ptr) \
|| ((SEC) == bfd_ind_section_ptr))
extern const struct symbol_cache_entry * const bfd_abs_symbol;
extern const struct symbol_cache_entry * const bfd_com_symbol;
extern const struct symbol_cache_entry * const bfd_und_symbol;

View file

@ -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,

View file

@ -544,6 +544,12 @@ CODE_FRAGMENT
.#define bfd_ind_section_ptr ((asection *) &bfd_ind_section)
.#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
.
.#define bfd_is_const_section(SEC) \
. ( ((SEC) == bfd_abs_section_ptr) \
. || ((SEC) == bfd_und_section_ptr) \
. || ((SEC) == bfd_com_section_ptr) \
. || ((SEC) == bfd_ind_section_ptr))
.
.extern const struct symbol_cache_entry * const bfd_abs_symbol;
.extern const struct symbol_cache_entry * const bfd_com_symbol;
.extern const struct symbol_cache_entry * const bfd_und_symbol;