Browse Source

* symbols.c (S_GET_VALUE): Don't treat O_constant and local

symbols specially.  Always resolve, adding fr_address to value.
	* write.c (write_object_file): Don't add fr_address to sym values.
	(relax_frag): Likewise.
	(relax_segment): Likewise.
	* config/obj-ieee.c (do_symbols): Likewise.
	* config/tc-cris.c (md_convert_frag): Likewise.
	* config/tc-fr30.c (md_convert_frag): Likewise.
	* config/tc-i386.c (md_convert_frag): Likewise.
	* config/tc-m32r.c (md_convert_frag): Likewise.
	* config/tc-m68hc11.c (md_convert_frag): Likewise.
	* config/tc-mcore.c (md_convert_frag): Likewise.
	* config/tc-mips.c (mips16_extended_frag): Likewise.
	* config/tc-ns32k.c (md_convert_frag): Likewise.
	* config/tc-m68k.c (md_convert_frag_1): Likewise.
	(BRANCHBWL, BRABSJUNC, BRABSJCOND, BRANCHBW, FBRANCH, DBCCLBR,
	DBCCABSJ, PCREL1632, PCINDEX, ABSTOPCREL): Decrement.
	(md_relax_table): Remove first four entries.  Format.
	(md_estimate_size_before_relax): Remove old_fix.  Don't bother
	setting fr_var.  Simplify byte branch checks.
gdb_s390-2001-09-26-branch
Alan Modra 25 years ago
parent
commit
ac62c3468d
  1. 69
      gas/ChangeLog
  2. 2
      gas/config/obj-ieee.c
  3. 5
      gas/config/tc-cris.c
  4. 1
      gas/config/tc-fr30.c
  5. 9
      gas/config/tc-i386.c
  6. 1
      gas/config/tc-m32r.c
  7. 3
      gas/config/tc-m68hc11.c
  8. 176
      gas/config/tc-m68k.c
  9. 1
      gas/config/tc-mcore.c
  10. 2
      gas/config/tc-mips.c
  11. 3
      gas/config/tc-ns32k.c
  12. 4
      gas/symbols.c
  13. 19
      gas/write.c

69
gas/ChangeLog

@ -1,3 +1,26 @@
2001-07-23 Alan Modra <amodra@bigpond.net.au>
* symbols.c (S_GET_VALUE): Don't treat O_constant and local
symbols specially. Always resolve, adding fr_address to value.
* write.c (write_object_file): Don't add fr_address to sym values.
(relax_frag): Likewise.
(relax_segment): Likewise.
* config/obj-ieee.c (do_symbols): Likewise.
* config/tc-cris.c (md_convert_frag): Likewise.
* config/tc-fr30.c (md_convert_frag): Likewise.
* config/tc-i386.c (md_convert_frag): Likewise.
* config/tc-m32r.c (md_convert_frag): Likewise.
* config/tc-m68hc11.c (md_convert_frag): Likewise.
* config/tc-mcore.c (md_convert_frag): Likewise.
* config/tc-mips.c (mips16_extended_frag): Likewise.
* config/tc-ns32k.c (md_convert_frag): Likewise.
* config/tc-m68k.c (md_convert_frag_1): Likewise.
(BRANCHBWL, BRABSJUNC, BRABSJCOND, BRANCHBW, FBRANCH, DBCCLBR,
DBCCABSJ, PCREL1632, PCINDEX, ABSTOPCREL): Decrement.
(md_relax_table): Remove first four entries. Format.
(md_estimate_size_before_relax): Remove old_fix. Don't bother
setting fr_var. Simplify byte branch checks.
2001-07-23 Alan Modra <amodra@bigpond.net.au> 2001-07-23 Alan Modra <amodra@bigpond.net.au>
* config/tc-hppa.c (pa_parse_nonneg_cmpsub_cmpltr): Remove * config/tc-hppa.c (pa_parse_nonneg_cmpsub_cmpltr): Remove
@ -165,11 +188,11 @@
fscan->fx_frag. fscan->fx_frag.
* write.c (TC_FINALIZE_SYMS_BEFORE_SIZE_SEG): Default to 1. * write.c (TC_FINALIZE_SYMS_BEFORE_SIZE_SEG): Default to 1.
(write_object_file): Set finalize_syms to (write_object_file): Set finalize_syms to
TC_FINALIZE_SYMS_BEFORE_SIZE_SEG just before size_segs is TC_FINALIZE_SYMS_BEFORE_SIZE_SEG just before size_segs is
called. called.
* doc/internals.texi; Document * doc/internals.texi; Document
TC_FINALIZE_SYMS_BEFORE_SIZE_SEG. TC_FINALIZE_SYMS_BEFORE_SIZE_SEG.
2001-07-02 Alan Modra <amodra@bigpond.net.au> 2001-07-02 Alan Modra <amodra@bigpond.net.au>
@ -294,11 +317,11 @@
2001-06-18 H.J. Lu <hjl@gnu.org> 2001-06-18 H.J. Lu <hjl@gnu.org>
* doc/Makefile.am (info): Depend on $(MANS). * doc/Makefile.am (info): Depend on $(MANS).
(as.1): Remove the prefix `$(srcdir)/'. (as.1): Remove the prefix `$(srcdir)/'.
* doc/Makefile.in: Regenerated. * doc/Makefile.in: Regenerated.
* as.1: Removed. * as.1: Removed.
2001-06-18 Philip Blundell <philb@gnu.org> 2001-06-18 Philip Blundell <philb@gnu.org>
@ -331,21 +354,21 @@
2001-06-12 Peter Jakubek <pjak@snafu.de> 2001-06-12 Peter Jakubek <pjak@snafu.de>
* gas/config/tc-m68k.c (parse_mri_control_operand): Fix handling * gas/config/tc-m68k.c (parse_mri_control_operand): Fix handling
of AND/OR. of AND/OR.
(swap_mri_condition): Add HS (alias fo CC) and LO (alias for CS). (swap_mri_condition): Add HS (alias fo CC) and LO (alias for CS).
(reverse_mri_condition): Likewise. (reverse_mri_condition): Likewise.
(swap_mri_condition): Issue warning for conditions that can not be (swap_mri_condition): Issue warning for conditions that can not be
swapped. swapped.
(build_mri_control_operand): Fix order of operands (swapped). (build_mri_control_operand): Fix order of operands (swapped).
(build_mri_control_operand): Allow upper case extension in structured (build_mri_control_operand): Allow upper case extension in structured
control directives. control directives.
(s_mri_else): Likewise. (s_mri_else): Likewise.
(s_mri_next): Likewise. (s_mri_next): Likewise.
(s_mri_for): Likewise. (s_mri_for): Likewise.
(s_mri_if): Fix handling comment ('*') in mri mode. (s_mri_if): Fix handling comment ('*') in mri mode.
(s_mri_while): Likewise. (s_mri_while): Likewise.
* gas/macro.c (macro_expand): Allow macro invocation with empty * gas/macro.c (macro_expand): Allow macro invocation with empty
extension. extension.
2001-06-12 Nick Clifton <nickc@cambridge.redhat.com> 2001-06-12 Nick Clifton <nickc@cambridge.redhat.com>

2
gas/config/obj-ieee.c

@ -292,7 +292,7 @@ do_symbols (abfd)
{ {
ptr->sy_symbol.sy.section = ptr->sy_symbol.sy.section =
(asection *) (segment_info[ptr->sy_symbol.seg].user_stuff); (asection *) (segment_info[ptr->sy_symbol.seg].user_stuff);
S_SET_VALUE (ptr, S_GET_VALUE (ptr) + ptr->sy_frag->fr_address); S_SET_VALUE (ptr, S_GET_VALUE (ptr));
if (ptr->sy_symbol.sy.flags == 0) if (ptr->sy_symbol.sy.flags == 0)
ptr->sy_symbol.sy.flags = BSF_LOCAL; ptr->sy_symbol.sy.flags = BSF_LOCAL;
} }

5
gas/config/tc-cris.c

@ -495,10 +495,7 @@ md_convert_frag (abfd, sec, fragP)
opcodep = fragP->fr_opcode; opcodep = fragP->fr_opcode;
symbolP = fragP->fr_symbol; symbolP = fragP->fr_symbol;
target_address target_address = (symbolP ? S_GET_VALUE (symbolP) : 0) + fragP->fr_offset;
= (symbolP
? S_GET_VALUE (symbolP) + symbol_get_frag(fragP->fr_symbol)->fr_address
: 0 ) + fragP->fr_offset;
address_of_var_part = fragP->fr_address + var_part_offset; address_of_var_part = fragP->fr_address + var_part_offset;
switch (fragP->fr_subtype) switch (fragP->fr_subtype)

1
gas/config/tc-fr30.c

@ -387,7 +387,6 @@ md_convert_frag (abfd, sec, fragP)
{ {
/* Address we want to reach in file space. */ /* Address we want to reach in file space. */
target_address = S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset; target_address = S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset;
target_address += symbol_get_frag (fragP->fr_symbol)->fr_address;
addend = (target_address - (opcode_address & -4)) >> 2; addend = (target_address - (opcode_address & -4)) >> 2;
} }

9
gas/config/tc-i386.c

@ -4088,15 +4088,6 @@ md_convert_frag (abfd, sec, fragP)
/* Address we want to reach in file space. */ /* Address we want to reach in file space. */
target_address = S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset; target_address = S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset;
#ifdef BFD_ASSEMBLER
/* Not needed otherwise? */
{
/* Local symbols which have already been resolved have a NULL frag. */
fragS *sym_frag = symbol_get_frag (fragP->fr_symbol);
if (sym_frag)
target_address += sym_frag->fr_address;
}
#endif
/* Address opcode resides at in file space. */ /* Address opcode resides at in file space. */
opcode_address = fragP->fr_address + fragP->fr_fix; opcode_address = fragP->fr_address + fragP->fr_fix;

1
gas/config/tc-m32r.c

@ -1564,7 +1564,6 @@ md_convert_frag (abfd, sec, fragP)
{ {
/* Address we want to reach in file space. */ /* Address we want to reach in file space. */
target_address = S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset; target_address = S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset;
target_address += symbol_get_frag (fragP->fr_symbol)->fr_address;
addend = (target_address - (opcode_address & -4)) >> 2; addend = (target_address - (opcode_address & -4)) >> 2;
} }

3
gas/config/tc-m68hc11.c

@ -2441,9 +2441,8 @@ md_convert_frag (abfd, sec, fragP)
buffer_address += fragP->fr_fix; buffer_address += fragP->fr_fix;
/* The displacement of the address, from current location. */ /* The displacement of the address, from current location. */
value = fragP->fr_symbol ? S_GET_VALUE (fragP->fr_symbol) : 0; value = S_GET_VALUE (fragP->fr_symbol);
disp = (value + fragP->fr_offset) - object_address; disp = (value + fragP->fr_offset) - object_address;
disp += symbol_get_frag (fragP->fr_symbol)->fr_address;
switch (fragP->fr_subtype) switch (fragP->fr_subtype)
{ {

176
gas/config/tc-m68k.c

@ -432,10 +432,10 @@ static const int n_archs = sizeof (archs) / sizeof (archs[0]);
BYTE and SHORT forms, punting if that isn't enough. This gives us four BYTE and SHORT forms, punting if that isn't enough. This gives us four
different relaxation modes for branches: */ different relaxation modes for branches: */
#define BRANCHBWL 1 /* branch byte, word, or long */ #define BRANCHBWL 0 /* branch byte, word, or long */
#define BRABSJUNC 2 /* absolute jump for LONG, unconditional */ #define BRABSJUNC 1 /* absolute jump for LONG, unconditional */
#define BRABSJCOND 3 /* absolute jump for LONG, conditional */ #define BRABSJCOND 2 /* absolute jump for LONG, conditional */
#define BRANCHBW 4 /* branch byte or word */ #define BRANCHBW 3 /* branch byte or word */
/* We also relax coprocessor branches and DBcc's. All CPUs that support /* We also relax coprocessor branches and DBcc's. All CPUs that support
coprocessor branches support them in word and long forms, so we have only coprocessor branches support them in word and long forms, so we have only
@ -445,9 +445,9 @@ static const int n_archs = sizeof (archs) / sizeof (archs[0]);
This gives us two relaxation modes. If long branches are not available and This gives us two relaxation modes. If long branches are not available and
absolute jumps are not acceptable, we don't relax DBcc's. */ absolute jumps are not acceptable, we don't relax DBcc's. */
#define FBRANCH 5 /* coprocessor branch */ #define FBRANCH 4 /* coprocessor branch */
#define DBCCLBR 6 /* DBcc relaxable with a long branch */ #define DBCCLBR 5 /* DBcc relaxable with a long branch */
#define DBCCABSJ 7 /* DBcc relaxable with an absolute jump */ #define DBCCABSJ 6 /* DBcc relaxable with an absolute jump */
/* That's all for instruction relaxation. However, we also relax PC-relative /* That's all for instruction relaxation. However, we also relax PC-relative
operands. Specifically, we have three operand relaxation modes. On the operands. Specifically, we have three operand relaxation modes. On the
@ -460,9 +460,9 @@ static const int n_archs = sizeof (archs) / sizeof (archs[0]);
form of the PC+displacement+index operand. Finally, some absolute operands form of the PC+displacement+index operand. Finally, some absolute operands
can be relaxed down to 16-bit PC-relative. */ can be relaxed down to 16-bit PC-relative. */
#define PCREL1632 8 /* 16-bit or 32-bit PC-relative */ #define PCREL1632 7 /* 16-bit or 32-bit PC-relative */
#define PCINDEX 9 /* PC+displacement+index */ #define PCINDEX 8 /* PC+displacement+index */
#define ABSTOPCREL 10 /* absolute relax down to 16-bit PC-relative */ #define ABSTOPCREL 9 /* absolute relax down to 16-bit PC-relative */
/* Note that calls to frag_var need to specify the maximum expansion /* Note that calls to frag_var need to specify the maximum expansion
needed; this is currently 10 bytes for DBCC. */ needed; this is currently 10 bytes for DBCC. */
@ -475,60 +475,55 @@ static const int n_archs = sizeof (archs) / sizeof (archs[0]);
*/ */
relax_typeS md_relax_table[] = relax_typeS md_relax_table[] =
{ {
{1, 1, 0, 0}, /* First entries aren't used */ { 127, -128, 0, TAB (BRANCHBWL, SHORT) },
{1, 1, 0, 0}, /* For no good reason except */ { 32767, -32768, 2, TAB (BRANCHBWL, LONG) },
{1, 1, 0, 0}, /* that the VAX doesn't either */ { 0, 0, 4, 0 },
{1, 1, 0, 0}, { 1, 1, 0, 0 },
{(127), (-128), 0, TAB (BRANCHBWL, SHORT)}, { 127, -128, 0, TAB (BRABSJUNC, SHORT) },
{(32767), (-32768), 2, TAB (BRANCHBWL, LONG)}, { 32767, -32768, 2, TAB (BRABSJUNC, LONG) },
{0, 0, 4, 0}, { 0, 0, 4, 0 },
{1, 1, 0, 0}, { 1, 1, 0, 0 },
{(127), (-128), 0, TAB (BRABSJUNC, SHORT)}, { 127, -128, 0, TAB (BRABSJCOND, SHORT) },
{(32767), (-32768), 2, TAB (BRABSJUNC, LONG)}, { 32767, -32768, 2, TAB (BRABSJCOND, LONG) },
{0, 0, 4, 0}, { 0, 0, 6, 0 },
{1, 1, 0, 0}, { 1, 1, 0, 0 },
{(127), (-128), 0, TAB (BRABSJCOND, SHORT)}, { 127, -128, 0, TAB (BRANCHBW, SHORT) },
{(32767), (-32768), 2, TAB (BRABSJCOND, LONG)}, { 0, 0, 2, 0 },
{0, 0, 6, 0}, { 1, 1, 0, 0 },
{1, 1, 0, 0}, { 1, 1, 0, 0 },
{(127), (-128), 0, TAB (BRANCHBW, SHORT)}, { 1, 1, 0, 0 }, /* FBRANCH doesn't come BYTE */
{0, 0, 2, 0}, { 32767, -32768, 2, TAB (FBRANCH, LONG) },
{1, 1, 0, 0}, { 0, 0, 4, 0 },
{1, 1, 0, 0}, { 1, 1, 0, 0 },
{1, 1, 0, 0}, /* FBRANCH doesn't come BYTE */ { 1, 1, 0, 0 }, /* DBCC doesn't come BYTE */
{(32767), (-32768), 2, TAB (FBRANCH, LONG)}, { 32767, -32768, 2, TAB (DBCCLBR, LONG) },
{0, 0, 4, 0}, { 0, 0, 10, 0 },
{1, 1, 0, 0}, { 1, 1, 0, 0 },
{1, 1, 0, 0}, /* DBCC doesn't come BYTE */ { 1, 1, 0, 0 }, /* DBCC doesn't come BYTE */
{(32767), (-32768), 2, TAB (DBCCLBR, LONG)}, { 32767, -32768, 2, TAB (DBCCABSJ, LONG) },
{0, 0, 10, 0}, { 0, 0, 10, 0 },
{1, 1, 0, 0}, { 1, 1, 0, 0 },
{1, 1, 0, 0}, /* DBCC doesn't come BYTE */ { 1, 1, 0, 0 }, /* PCREL1632 doesn't come BYTE */
{(32767), (-32768), 2, TAB (DBCCABSJ, LONG)}, { 32767, -32768, 2, TAB (PCREL1632, LONG) },
{0, 0, 10, 0}, { 0, 0, 6, 0 },
{1, 1, 0, 0}, { 1, 1, 0, 0 },
{1, 1, 0, 0}, /* PCREL1632 doesn't come BYTE */ { 125, -130, 0, TAB (PCINDEX, SHORT) },
{32767, -32768, 2, TAB (PCREL1632, LONG)}, { 32765, -32770, 2, TAB (PCINDEX, LONG) },
{0, 0, 6, 0}, { 0, 0, 4, 0 },
{1, 1, 0, 0}, { 1, 1, 0, 0 },
{125, -130, 0, TAB (PCINDEX, SHORT)}, { 1, 1, 0, 0 }, /* ABSTOPCREL doesn't come BYTE */
{32765, -32770, 2, TAB (PCINDEX, LONG)}, { 32767, -32768, 2, TAB (ABSTOPCREL, LONG) },
{0, 0, 4, 0}, { 0, 0, 4, 0 },
{1, 1, 0, 0}, { 1, 1, 0, 0 },
{1, 1, 0, 0}, /* ABSTOPCREL doesn't come BYTE */
{(32767), (-32768), 2, TAB (ABSTOPCREL, LONG)},
{0, 0, 4, 0},
{1, 1, 0, 0},
}; };
/* These are the machine dependent pseudo-ops. These are included so /* These are the machine dependent pseudo-ops. These are included so
@ -4375,10 +4370,6 @@ md_convert_frag_1 (fragP)
disp = fragP->fr_symbol ? S_GET_VALUE (fragP->fr_symbol) : 0; disp = fragP->fr_symbol ? S_GET_VALUE (fragP->fr_symbol) : 0;
disp = (disp + fragP->fr_offset) - object_address; disp = (disp + fragP->fr_offset) - object_address;
#ifdef BFD_ASSEMBLER
disp += symbol_get_frag (fragP->fr_symbol)->fr_address;
#endif
switch (fragP->fr_subtype) switch (fragP->fr_subtype)
{ {
case TAB (BRANCHBWL, BYTE): case TAB (BRANCHBWL, BYTE):
@ -4594,10 +4585,6 @@ md_estimate_size_before_relax (fragP, segment)
register fragS *fragP; register fragS *fragP;
segT segment; segT segment;
{ {
int old_fix;
old_fix = fragP->fr_fix;
/* Handle SZ_UNDEF first, it can be changed to BYTE or SHORT. */ /* Handle SZ_UNDEF first, it can be changed to BYTE or SHORT. */
switch (fragP->fr_subtype) switch (fragP->fr_subtype)
{ {
@ -4694,44 +4681,31 @@ md_estimate_size_before_relax (fragP, segment)
case TAB (BRABSJCOND, BYTE): case TAB (BRABSJCOND, BYTE):
case TAB (BRANCHBW, BYTE): case TAB (BRANCHBW, BYTE):
/* We can't do a short jump to the next instruction, so in that /* We can't do a short jump to the next instruction, so in that
case we force word mode. At this point S_GET_VALUE should case we force word mode. If the symbol is at the start of a
return the offset of the symbol within its frag. If the frag, and it is the next frag with any data in it (usually
symbol is at the start of a frag, and it is the next frag this is just the next frag, but assembler listings may
with any data in it (usually this is just the next frag, but introduce empty frags), we must use word mode. */
assembler listings may introduce empty frags), we must use if (fragP->fr_symbol)
word mode. */
if (fragP->fr_symbol && S_GET_VALUE (fragP->fr_symbol) == 0)
{ {
fragS *stop; fragS *sym_frag;
fragS *l;
stop = symbol_get_frag (fragP->fr_symbol); sym_frag = symbol_get_frag (fragP->fr_symbol);
if (S_GET_VALUE (fragP->fr_symbol) == sym_frag->fr_address)
for (l = fragP->fr_next; l != stop; l = l->fr_next)
{ {
/* Catch empty alignment frags whoes fr_offset field fragS *l;
is an alignment requirement of 2 bytes. The check
below will misinterpret this as evidence that real for (l = fragP->fr_next; l != sym_frag; l = l->fr_next)
code exists between the symbol and the instruction if (l->fr_fix != 0)
and so will not convert the short jump into a word break;
jump. */ if (l == sym_frag)
if (l->fr_fix == 0 fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT);
&& l->fr_var == 1
&& (l->fr_type == rs_align || l->fr_type == rs_align_code))
continue;
if (l->fr_fix + l->fr_var != 0)
break;
} }
if (l == stop)
fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT);
} }
break; break;
default: default:
break; break;
} }
fragP->fr_var = md_relax_table[fragP->fr_subtype].rlx_length; return md_relax_table[fragP->fr_subtype].rlx_length;
return fragP->fr_var + fragP->fr_fix - old_fix;
} }
#if defined(OBJ_AOUT) | defined(OBJ_BOUT) #if defined(OBJ_AOUT) | defined(OBJ_BOUT)

1
gas/config/tc-mcore.c

@ -1900,7 +1900,6 @@ md_convert_frag (abfd, sec, fragP)
int targ_addr = S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset; int targ_addr = S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset;
buffer = (unsigned char *) (fragP->fr_fix + fragP->fr_literal); buffer = (unsigned char *) (fragP->fr_fix + fragP->fr_literal);
targ_addr += symbol_get_frag (fragP->fr_symbol)->fr_address;
switch (fragP->fr_subtype) switch (fragP->fr_subtype)
{ {

2
gas/config/tc-mips.c

@ -10895,7 +10895,7 @@ mips16_extended_frag (fragp, sec, stretch)
} }
sym_frag = symbol_get_frag (fragp->fr_symbol); sym_frag = symbol_get_frag (fragp->fr_symbol);
val = S_GET_VALUE (fragp->fr_symbol) + sym_frag->fr_address; val = S_GET_VALUE (fragp->fr_symbol);
symsec = S_GET_SEGMENT (fragp->fr_symbol); symsec = S_GET_SEGMENT (fragp->fr_symbol);
if (op->pcrel) if (op->pcrel)

3
gas/config/tc-ns32k.c

@ -2051,9 +2051,6 @@ md_convert_frag (abfd, sec, fragP)
/* The displacement of the address, from current location. */ /* The displacement of the address, from current location. */
disp = (S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset) - object_address; disp = (S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset) - object_address;
#ifdef BFD_ASSEMBLER
disp += symbol_get_frag (fragP->fr_symbol)->fr_address;
#endif
disp += md_pcrel_adjust (fragP); disp += md_pcrel_adjust (fragP);
md_number_to_disp (buffer_address, (long) disp, (int) ext); md_number_to_disp (buffer_address, (long) disp, (int) ext);

4
gas/symbols.c

@ -1574,10 +1574,10 @@ S_GET_VALUE (s)
{ {
#ifdef BFD_ASSEMBLER #ifdef BFD_ASSEMBLER
if (LOCAL_SYMBOL_CHECK (s)) if (LOCAL_SYMBOL_CHECK (s))
return ((struct local_symbol *) s)->lsy_value; return resolve_symbol_value (s);
#endif #endif
if (!s->sy_resolved && s->sy_value.X_op != O_constant) if (!s->sy_resolved)
{ {
valueT val = resolve_symbol_value (s); valueT val = resolve_symbol_value (s);
if (!finalize_syms) if (!finalize_syms)

19
gas/write.c

@ -1750,9 +1750,6 @@ write_object_file ()
/* Patch the jump table. */ /* Patch the jump table. */
/* This is the offset from ??? to table_ptr+0. */ /* This is the offset from ??? to table_ptr+0. */
to_addr = table_addr - S_GET_VALUE (lie->sub); to_addr = table_addr - S_GET_VALUE (lie->sub);
#ifdef BFD_ASSEMBLER
to_addr -= symbol_get_frag (lie->sub)->fr_address;
#endif
#ifdef TC_CHECK_ADJUSTED_BROKEN_DOT_WORD #ifdef TC_CHECK_ADJUSTED_BROKEN_DOT_WORD
TC_CHECK_ADJUSTED_BROKEN_DOT_WORD (to_addr, lie); TC_CHECK_ADJUSTED_BROKEN_DOT_WORD (to_addr, lie);
#endif #endif
@ -1769,9 +1766,6 @@ write_object_file ()
/* This is a long jump from table_ptr+0 to the final target. */ /* This is a long jump from table_ptr+0 to the final target. */
from_addr = table_addr; from_addr = table_addr;
to_addr = S_GET_VALUE (lie->add) + lie->addnum; to_addr = S_GET_VALUE (lie->add) + lie->addnum;
#ifdef BFD_ASSEMBLER
to_addr += symbol_get_frag (lie->add)->fr_address;
#endif
md_create_long_jump (table_ptr, from_addr, to_addr, lie->dispfrag, md_create_long_jump (table_ptr, from_addr, to_addr, lie->dispfrag,
lie->add); lie->add);
table_ptr += md_long_jump_size; table_ptr += md_long_jump_size;
@ -2115,7 +2109,7 @@ relax_frag (segment, fragP, stretch)
#endif #endif
know (!(S_GET_SEGMENT (symbolP) == absolute_section) know (!(S_GET_SEGMENT (symbolP) == absolute_section)
|| sym_frag == &zero_address_frag); || sym_frag == &zero_address_frag);
target += S_GET_VALUE (symbolP) + sym_frag->fr_address; target += S_GET_VALUE (symbolP);
/* If frag has yet to be reached on this pass, /* If frag has yet to be reached on this pass,
assume it will move by STRETCH just as we did. assume it will move by STRETCH just as we did.
@ -2356,11 +2350,9 @@ relax_segment (segment_frag_root, segment)
if (lie->added) if (lie->added)
continue; continue;
offset = (symbol_get_frag (lie->add)->fr_address offset = (S_GET_VALUE (lie->add)
+ S_GET_VALUE (lie->add)
+ lie->addnum + lie->addnum
- (symbol_get_frag (lie->sub)->fr_address - S_GET_VALUE (lie->sub));
+ S_GET_VALUE (lie->sub)));
if (offset <= -32768 || offset >= 32767) if (offset <= -32768 || offset >= 32767)
{ {
if (flag_warn_displacement) if (flag_warn_displacement)
@ -2436,9 +2428,8 @@ relax_segment (segment_frag_root, segment)
know (!(S_GET_SEGMENT (symbolP) == SEG_ABSOLUTE) know (!(S_GET_SEGMENT (symbolP) == SEG_ABSOLUTE)
|| (symbolP->sy_frag == &zero_address_frag)); || (symbolP->sy_frag == &zero_address_frag));
#endif #endif
target += (S_GET_VALUE (symbolP) target += S_GET_VALUE (symbolP);
+ symbol_get_frag (symbolP)->fr_address); }
} /* if we have a symbol */
know (fragP->fr_next); know (fragP->fr_next);
after = fragP->fr_next->fr_address; after = fragP->fr_next->fr_address;

Loading…
Cancel
Save