aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2001-11-19 15:35:38 +0000
committerNick Clifton <nickc@redhat.com>2001-11-19 15:35:38 +0000
commit84c254c6468727c14abf8f639a2605d5a08f4a14 (patch)
treef28e0b7b814c9ccb21fc49bfc42efe18b7274d91 /bfd
parent261a45adfff7bb0c49b661d7416eee3cfc2d2115 (diff)
downloadgdb-84c254c6468727c14abf8f639a2605d5a08f4a14.zip
gdb-84c254c6468727c14abf8f639a2605d5a08f4a14.tar.gz
gdb-84c254c6468727c14abf8f639a2605d5a08f4a14.tar.bz2
Define and use bfd_is_const_section().
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog19
-rw-r--r--bfd/bfd-in2.h6
-rw-r--r--bfd/coffgen.c18
-rw-r--r--bfd/section.c6
4 files changed, 42 insertions, 7 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 8e3b59b..b4d7829 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index b99a3d4..5f61853 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -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;
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,
diff --git a/bfd/section.c b/bfd/section.c
index 0d95f11..903f769 100644
--- a/bfd/section.c
+++ b/bfd/section.c
@@ -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;