From 489a93f3c3510823e2b33da6e2ec9c5c27696565 Mon Sep 17 00:00:00 2001 From: Steve Chamberlain Date: Tue, 13 Jul 1993 19:12:10 +0000 Subject: [PATCH] * config/tc-h8500.c (line_comment_chars): Add hash. (parse_exp, skip_colonthing, build_bytes): Add support for R_H8500_HIGH16 relocation type. --- gas/ChangeLog | 6 ++++++ gas/config/tc-h8500.c | 42 +++++++++++++++++++++++++++++++++++------- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index ee66ea023dd..e48f484d89e 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +Tue Jul 13 12:09:44 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * config/tc-h8500.c (line_comment_chars): Add hash. + (parse_exp, skip_colonthing, build_bytes): Add support for + R_H8500_HIGH16 relocation type. + Mon Jul 12 11:15:34 1993 Ken Raeburn (raeburn@deneb.cygnus.com) * config/obj-elf.c (obj_elf_section): Allow `@' to introduce an diff --git a/gas/config/tc-h8500.c b/gas/config/tc-h8500.c index baf4cb36860..4ad462ec486 100644 --- a/gas/config/tc-h8500.c +++ b/gas/config/tc-h8500.c @@ -33,7 +33,7 @@ const char comment_chars[] = "!"; const char line_separator_chars[] = ";"; -const char line_comment_chars[] = "!"; +const char line_comment_chars[] = "!#"; /* This table describes all the machine specific pseudo-ops the assembler has to support. The fields are: @@ -268,9 +268,13 @@ parse_exp (s, op, page) if (s[1] == 'p' && s[2] == 'a' && s[3] == 'g' && s[4] == 'e') { s += 5; - *page = 'p'; } + if (s[1] == 'h' && s[2] == 'i' && s[3] == '1' && s[4] == '6') + { + s += 5; + *page = 'h'; + } else if (s[1] == 'o' && s[2] == 'f' && s[3] == 'f') { s += 4; @@ -353,6 +357,10 @@ skip_colonthing (sign, ptr, exp, def, size8, size16, size24) { exp->type = IMM8; } + else if (exp->page == 'h') + { + exp->type = IMM16; + } else { /* Let's work out the size from the context */ @@ -982,9 +990,25 @@ build_bytes (opcode, operand) case FPIND_D8: insert (output, index, &displacement, R_H8500_IMM8, 0); break; + case IMM16: - insert (output, index, &immediate, immediate_inpage ? - R_H8500_LOW16 : R_H8500_IMM16, 0); + { + int p; + switch (immediate_inpage) { + case 'p': + p = R_H8500_LOW16; + break; + case 'h': + p = R_H8500_HIGH16; + break; + default: + p = R_H8500_IMM16; + break; + } + + insert (output, index, &immediate,p, 0); + } + index++; break; case RLIST: @@ -1403,9 +1427,9 @@ md_convert_frag (headers, fragP) } valueT -DEFUN (md_section_align, (seg, size), - segT seg AND - valueT size) +md_section_align (seg, size) + segT seg ; + valueT size; { return ((size + (1 << section_alignment[(int) seg]) - 1) & (-1 << section_alignment[(int) seg])); @@ -1440,6 +1464,10 @@ md_apply_fix (fixP, val) case R_H8500_HIGH8: *buf++ = val >> 16; break; + case R_H8500_HIGH16: + *buf++ = val >> 24; + *buf++ = val >> 16; + break; case R_H8500_IMM24: *buf++ = (val >> 16); *buf++ = (val >> 8); -- 2.30.2