aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2004-07-02 06:40:19 +0000
committerAlan Modra <amodra@gmail.com>2004-07-02 06:40:19 +0000
commit09b935accc9deb1b914b33090205574cee66b158 (patch)
treed8c12f33a7f61db10bcf5f1ee72827ac26778acb /gas/config/tc-ppc.c
parentd205ad70f2ce07f7cbe9debc8bc1859981613bb5 (diff)
downloadgdb-09b935accc9deb1b914b33090205574cee66b158.zip
gdb-09b935accc9deb1b914b33090205574cee66b158.tar.gz
gdb-09b935accc9deb1b914b33090205574cee66b158.tar.bz2
* frags.h (struct frag): Add has_code and insn_addr fields.
* write.c (cvt_frag_to_fill): Invoke md_frag_check. * config/tc-ppc.c (md_assemble): Check and set insn_addr. * config/tc-ppc.h (md_frag_check): Define.
Diffstat (limited to 'gas/config/tc-ppc.c')
-rw-r--r--gas/config/tc-ppc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index fe66d2b..d4893e7 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -2091,6 +2091,7 @@ md_assemble (str)
struct ppc_fixup fixups[MAX_INSN_FIXUPS];
int fc;
char *f;
+ int addr_mod;
int i;
#ifdef OBJ_ELF
bfd_reloc_code_real_type reloc;
@@ -2618,6 +2619,11 @@ md_assemble (str)
/* Write out the instruction. */
f = frag_more (4);
+ addr_mod = frag_now_fix () & 3;
+ if (frag_now->has_code && frag_now->insn_addr != addr_mod)
+ as_bad (_("instruction address is not a multiple of 4"));
+ frag_now->insn_addr = addr_mod;
+ frag_now->has_code = 1;
md_number_to_chars (f, insn, 4);
#ifdef OBJ_ELF