summaryrefslogtreecommitdiff
path: root/bfd/mmo.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2003-02-04 12:34:08 +0000
committerAlan Modra <amodra@bigpond.net.au>2003-02-04 12:34:08 +0000
commit68008f32b95e81c57d5718dc18823fb2cc31ef4b (patch)
tree76b92aa9ff1cc63e53bd0920729a8ece8294706f /bfd/mmo.c
parent82dec91e832f4e1db386e75e2d425c6379a898e0 (diff)
downloadbinutils-redhat-68008f32b95e81c57d5718dc18823fb2cc31ef4b.tar.gz
bfd
* elf-bfd.h (enum elf_link_info_type): Remove. (struct bfd_elf_section_data): Move sec_info_type, use_rela_p fields to struct sec. Remove linkonce_p field. (elf_linkonce_p): Delete. (elf_discarded_section): Update for sec_info_type change. * section.c (struct sec): Add sec_info_type, use_rela_p, has_tls_reloc, flag11, flag12, flag13, flag14, flag15, flag16, flag20, flag24. (ELF_INFO_TYPE_NONE): Define. (ELF_INFO_TYPE_STABS): Define. (ELF_INFO_TYPE_MERGE): Define. (ELF_INFO_TYPE_EH_FRAME): Define. (ELF_INFO_TYPE_JUST_SYMS): Define. (STD_SECTION): Update struct sec initializer. * ecoff.c (bfd_debug_section): Likewise. * elf.c: Likewise. Update occurrences of sec_info_type and use_rela_p. * elflink.h: Likewise. * elf-eh-frame.c: Likewise. * elf64-alpha.c: Likewise. * elfxx-ia64.c: Likewise. * elfxx-mips.c: Likewise. * bfd-in2.h: Regenerate. * elf32-sparc.c (sec_do_relax): Use elf_section_data macro rather than referring to used_by_bfd. * elf64-sparc.c (sec_do_relax): Likewise. * elf64-mmix.c (mmix_elf_section_data): Likewise. * elfxx-mips.c (mips_elf_section_data): Likewise. * ieee.c (ieee_slurp_section_data): Use ieee_per_section macro. (ieee_get_section_contents): Likewise. (ieee_new_section_hook): Formatting. (ieee_canonicalize_reloc): Remove commented out code. * mmo.c (mmo_section_data): Define. Use throughout file. * oasys.c (oasys_get_section_contents): Use oasys_per_section macro. gas * config/obj-elf.c (obj_elf_change_section): Set SEC_LINK_ONCE and SEC_LINK_DUPLICATES_DISCARD directly rather than using elf_linkonce_p.
Diffstat (limited to 'bfd/mmo.c')
-rw-r--r--bfd/mmo.c46
1 files changed, 17 insertions, 29 deletions
diff --git a/bfd/mmo.c b/bfd/mmo.c
index f734fa93c8..56c9746031 100644
--- a/bfd/mmo.c
+++ b/bfd/mmo.c
@@ -1,5 +1,5 @@
/* BFD back-end for mmo objects (MMIX-specific object-format).
- Copyright 2001, 2002
+ Copyright 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Hans-Peter Nilsson (hp@bitrange.com).
Infrastructure and other bits originally copied from srec.c and
@@ -335,6 +335,9 @@ struct mmo_section_data_struct
mmo_data_list_type *tail;
};
+#define mmo_section_data(sec) \
+ ((struct mmo_section_data_struct *) (sec)->used_by_bfd)
+
/* These structures are used in bfd_map_over_sections constructs. */
/* Used when writing out sections; all but the register contents section
@@ -1177,12 +1180,11 @@ mmo_get_spec_section (abfd, spec_data_number)
}
loc->next = NULL;
- if (((struct mmo_section_data_struct *) (sec->used_by_bfd))->tail != NULL)
- ((struct mmo_section_data_struct *) (sec->used_by_bfd))->tail->next
- = loc;
+ if (mmo_section_data (sec)->tail != NULL)
+ mmo_section_data (sec)->tail->next = loc;
else
- ((struct mmo_section_data_struct *) (sec->used_by_bfd))->head = loc;
- ((struct mmo_section_data_struct *) (sec->used_by_bfd))->tail = loc;
+ mmo_section_data (sec)->head = loc;
+ mmo_section_data (sec)->tail = loc;
loc->where = section_vma;
return sec;
@@ -1517,8 +1519,7 @@ mmo_get_loc (sec, vma, size)
int size;
{
bfd_size_type allocated_size;
- struct mmo_section_data_struct *sdatap
- = (struct mmo_section_data_struct *) sec->used_by_bfd;
+ struct mmo_section_data_struct *sdatap = mmo_section_data (sec);
struct mmo_data_list_struct *datap = sdatap->head;
struct mmo_data_list_struct *entry;
@@ -2463,15 +2464,9 @@ mmo_internal_write_section (abfd, sec)
if (strcmp (sec->name, MMO_TEXT_SECTION_NAME) == 0)
/* FIXME: Output source file name and line number. */
- return
- mmo_write_loc_chunk_list (abfd,
- ((struct mmo_section_data_struct *)
- (sec->used_by_bfd))->head);
+ return mmo_write_loc_chunk_list (abfd, mmo_section_data (sec)->head);
else if (strcmp (sec->name, MMO_DATA_SECTION_NAME) == 0)
- return
- mmo_write_loc_chunk_list (abfd,
- ((struct mmo_section_data_struct *)
- (sec->used_by_bfd))->head);
+ return mmo_write_loc_chunk_list (abfd, mmo_section_data (sec)->head);
else if (strcmp (sec->name, MMIX_REG_CONTENTS_SECTION_NAME) == 0)
/* Not handled here. */
{
@@ -2486,9 +2481,7 @@ mmo_internal_write_section (abfd, sec)
int n = atoi (sec->name + strlen (MMIX_OTHER_SPEC_SECTION_PREFIX));
mmo_write_tetra_raw (abfd, (LOP << 24) | (LOP_SPEC << 16) | n);
return (! abfd->tdata.mmo_data->have_error
- && mmo_write_chunk_list (abfd,
- ((struct mmo_section_data_struct *)
- (sec->used_by_bfd))->head));
+ && mmo_write_chunk_list (abfd, mmo_section_data (sec)->head));
}
/* Ignore sections that are just allocated or empty; we write out
_contents_ here. */
@@ -2605,16 +2598,11 @@ EXAMPLE
/* Writing a LOP_LOC ends the LOP_SPEC data, and makes data actually
loaded. */
if (bfd_get_section_flags (abfd, sec) & SEC_LOAD)
- return
- ! abfd->tdata.mmo_data->have_error
- && mmo_write_loc_chunk_list (abfd,
- ((struct mmo_section_data_struct *)
- (sec->used_by_bfd))->head);
- return
- ! abfd->tdata.mmo_data->have_error
- && mmo_write_chunk_list (abfd,
- ((struct mmo_section_data_struct *)
- (sec->used_by_bfd))->head);
+ return (! abfd->tdata.mmo_data->have_error
+ && mmo_write_loc_chunk_list (abfd,
+ mmo_section_data (sec)->head));
+ return (! abfd->tdata.mmo_data->have_error
+ && mmo_write_chunk_list (abfd, mmo_section_data (sec)->head));
}
return TRUE;
}