/* b.out object file format
- Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+ Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1996
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
the GNU General Public License for more details.
- You should have received a copy of the GNU General Public
- License along with GAS; see the file COPYING. If not, write
- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU General Public License
+ along with GAS; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
#include "as.h"
#include "obstack.h"
{
for (; fixP; fixP = fixP->fx_next)
{
- if (fixP->fx_addsy != NULL
+ if (fixP->fx_done == 0
|| fixP->fx_r_type != NO_RELOC)
{
+ symbolS *sym;
+
+ sym = fixP->fx_addsy;
+ while (sym->sy_value.X_op == O_symbol
+ && (! S_IS_DEFINED (sym) || S_IS_COMMON (sym)))
+ sym = sym->sy_value.X_add_symbol;
+ fixP->fx_addsy = sym;
+
tc_bout_fix_to_chars (*where, fixP, segment_address_in_file);
*where += sizeof (struct relocation_info);
} /* if there's a symbol */
{
S_SET_OTHER (symbolP, 0);
S_SET_DESC (symbolP, 0);
- return;
-} /* obj_symbol_new_hook() */
+}
static void
obj_bout_line (ignore)
void
obj_read_begin_hook ()
{
- return;
-} /* obj_read_begin_hook() */
+}
void
obj_crawl_symbol_chain (headers)
symbolPP = &symbol_rootP; /*->last symbol chain link. */
while ((symbolP = *symbolPP) != NULL)
{
- if (flagseen['R'] && (S_GET_SEGMENT (symbolP) == SEG_DATA))
+ if (flag_readonly_data_in_text && (S_GET_SEGMENT (symbolP) == SEG_DATA))
{
S_SET_SEGMENT (symbolP, SEG_TEXT);
} /* if pusing data into text */
- resolve_symbol_value (symbolP);
+ resolve_symbol_value (symbolP, 1);
+
+ /* Skip symbols which were equated to undefined or common
+ symbols. */
+ if (symbolP->sy_value.X_op == O_symbol
+ && (! S_IS_DEFINED (symbolP) || S_IS_COMMON (symbolP)))
+ {
+ *symbolPP = symbol_next (symbolP);
+ continue;
+ }
/* OK, here is how we decide which symbols go out into the
brave new symtab. Symbols that do are:
|| !S_IS_DEFINED (symbolP)
|| S_IS_EXTERNAL (symbolP)
#endif /* TC_I960 */
- || (S_GET_NAME (symbolP)[0] != '\001' && (flagseen['L'] || !S_LOCAL_NAME (symbolP)))))
+ || (S_GET_NAME (symbolP)[0] != '\001' && (flag_keep_locals || !S_LOCAL_NAME (symbolP)))))
{
symbolP->sy_number = symbol_number++;
{
if (S_IS_EXTERNAL (symbolP) || !S_IS_DEFINED (symbolP))
{
- as_bad ("Local symbol %s never defined", S_GET_NAME (symbolP));
+ as_bad (_("Local symbol %s never defined"), S_GET_NAME (symbolP));
} /* oops. */
/* Unhook it from the chain */
} /* for each symbol */
H_SET_SYMBOL_TABLE_SIZE (headers, symbol_number);
-
- return;
-} /* obj_crawl_symbol_chain() */
+}
/*
* Find strings by crawling along symbol table chain.
if (S_GET_NAME (symbolP))
append (where, S_GET_NAME (symbolP), (unsigned long) (strlen (S_GET_NAME (symbolP)) + 1));
} /* walk symbol chain */
-
- return;
-} /* obj_emit_strings() */
+}
/* end of obj-bout.c */