aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1999-06-04 21:08:54 +0000
committerIan Lance Taylor <ian@airs.com>1999-06-04 21:08:54 +0000
commit993142d5a451c988ba5aceb164d49cbce681ea9a (patch)
tree7781225860c4a644574baebd009a6bda411c0dcb /gas
parent77e0b0efdb413771a7e3b2ff89d58ec21ffb9e58 (diff)
downloadgdb-993142d5a451c988ba5aceb164d49cbce681ea9a.zip
gdb-993142d5a451c988ba5aceb164d49cbce681ea9a.tar.gz
gdb-993142d5a451c988ba5aceb164d49cbce681ea9a.tar.bz2
1999-06-04 Mark Klein <mklein@dis.com>
* config/tc-hppa.c (md_begin): Convert local symbol dummy_symbol to real if OBJ_SOM (tc_gen_reloc): Still need bfd_abs_symbol in some relocs.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog4
-rw-r--r--gas/config/tc-hppa.c32
2 files changed, 21 insertions, 15 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 90ef7ae..684f4d9 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,9 @@
1999-06-04 Mark Klein <mklein@dis.com>
+ * config/tc-hppa.c (md_begin): Convert local symbol dummy_symbol
+ to real if OBJ_SOM
+ (tc_gen_reloc): Still need bfd_abs_symbol in some relocs.
+
* config/tc-hppa.c: Update for symbol handling changes.
1999-06-03 Ian Lance Taylor <ian@zembu.com>
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c
index f74b1ad..c2431d9 100644
--- a/gas/config/tc-hppa.c
+++ b/gas/config/tc-hppa.c
@@ -702,9 +702,10 @@ static label_symbol_struct *label_symbols_rootp = NULL;
/* Holds the last field selector. */
static int hppa_field_selector;
-
+#ifdef OBJ_SOM
/* A dummy bfd symbol so that all relocations have symbols of some kind. */
static symbolS *dummy_symbol;
+#endif
/* Nonzero if errors are to be printed. */
static int print_errors = 1;
@@ -1339,8 +1340,12 @@ md_begin ()
anything into the old one switch to the new one now. */
subseg_set (text_section, 0);
+#ifdef OBJ_SOM
dummy_symbol = symbol_find_or_make ("L$dummy");
S_SET_SEGMENT (dummy_symbol, text_section);
+ /* Force the symbol to be converted to a real symbol. */
+ (void) symbol_get_bfdsym (dummy_symbol);
+#endif
}
/* Assemble a single instruction storing it into a frag. */
@@ -2825,28 +2830,25 @@ tc_gen_reloc (section, fixp)
of two symbols. With that in mind we fill in all four
relocs now and break out of the loop. */
assert (i == 1);
- relocs[0]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
- *relocs[0]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
+ relocs[0]->sym_ptr_ptr = (asymbol **) &(bfd_abs_symbol);
relocs[0]->howto = bfd_reloc_type_lookup (stdoutput, *codes[0]);
relocs[0]->address = fixp->fx_frag->fr_address + fixp->fx_where;
relocs[0]->addend = 0;
- relocs[1]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
- *relocs[1]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
+ relocs[1]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+ *relocs[1]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
relocs[1]->howto = bfd_reloc_type_lookup (stdoutput, *codes[1]);
relocs[1]->address = fixp->fx_frag->fr_address + fixp->fx_where;
relocs[1]->addend = 0;
- relocs[2]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
- *relocs[2]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
+ relocs[2]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+ *relocs[2]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_subsy);
relocs[2]->howto = bfd_reloc_type_lookup (stdoutput, *codes[2]);
relocs[2]->address = fixp->fx_frag->fr_address + fixp->fx_where;
relocs[2]->addend = 0;
- relocs[3]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
- *relocs[3]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
+ relocs[3]->sym_ptr_ptr = (asymbol **) &(bfd_abs_symbol);
relocs[3]->howto = bfd_reloc_type_lookup (stdoutput, *codes[3]);
relocs[3]->address = fixp->fx_frag->fr_address + fixp->fx_where;
relocs[3]->addend = 0;
- relocs[4]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
- *relocs[4]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
+ relocs[4]->sym_ptr_ptr = (asymbol **) &(bfd_abs_symbol);
relocs[4]->howto = bfd_reloc_type_lookup (stdoutput, *codes[4]);
relocs[4]->address = fixp->fx_frag->fr_address + fixp->fx_where;
relocs[4]->addend = 0;
@@ -2884,8 +2886,8 @@ tc_gen_reloc (section, fixp)
case R_N0SEL:
case R_N1SEL:
/* There is no symbol or addend associated with these fixups. */
- relocs[i]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
- *relocs[i]->sym_ptr_ptr = symbol_get_bfdsym (dummy_symbol);
+ relocs[i]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+ *relocs[i]->sym_ptr_ptr = symbol_get_bfdsym (dummy_symbol);
relocs[i]->addend = 0;
break;
@@ -2893,8 +2895,8 @@ tc_gen_reloc (section, fixp)
case R_ENTRY:
case R_EXIT:
/* There is no symbol associated with these fixups. */
- relocs[i]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
- *relocs[i]->sym_ptr_ptr = symbol_get_bfdsym (dummy_symbol);
+ relocs[i]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+ *relocs[i]->sym_ptr_ptr = symbol_get_bfdsym (dummy_symbol);
relocs[i]->addend = fixp->fx_offset;
break;