2014-02-26 Tom Tromey <tromey@redhat.com>
+ * minsyms.c (prim_record_minimal_symbol_full): Use
+ SET_MSYMBOL_VALUE_ADDRESS.
+ * objfiles.c (objfile_relocate1): Use SET_MSYMBOL_VALUE_ADDRESS.
+ * sh64-tdep.c (sh64_elf_make_msymbol_special): Use
+ SET_MSYMBOL_VALUE_ADDRESS.
+ * symtab.h (MSYMBOL_VALUE_ADDRESS): Expand to an rvalue.
+ (SET_MSYMBOL_VALUE_ADDRESS): New macro.
+
+2014-02-26 Tom Tromey <tromey@redhat.com>
+
* symtab.h (struct minimal_symbol) <mginfo>: Rename from ginfo.
(MSYMBOL_VALUE, MSYMBOL_VALUE_ADDRESS, MSYMBOL_VALUE_BYTES)
(MSYMBOL_BLOCK_VALUE, MSYMBOL_VALUE_CHAIN, MSYMBOL_LANGUAGE)
MSYMBOL_SET_LANGUAGE (msymbol, language_auto, &objfile->objfile_obstack);
MSYMBOL_SET_NAMES (msymbol, name, name_len, copy_name, objfile);
- MSYMBOL_VALUE_ADDRESS (msymbol) = address;
+ SET_MSYMBOL_VALUE_ADDRESS (msymbol, address);
MSYMBOL_SECTION (msymbol) = section;
MSYMBOL_TYPE (msymbol) = ms_type;
ALL_OBJFILE_MSYMBOLS (objfile, msym)
if (MSYMBOL_SECTION (msym) >= 0)
- MSYMBOL_VALUE_ADDRESS (msym) += ANOFFSET (delta,
- MSYMBOL_SECTION (msym));
+ SET_MSYMBOL_VALUE_ADDRESS (msym, (MSYMBOL_VALUE_ADDRESS (msym)
+ + ANOFFSET (delta,
+ MSYMBOL_SECTION (msym))));
}
/* Relocating different sections by different amounts may cause the symbols
to be out of order. */
if (((elf_symbol_type *)(sym))->internal_elf_sym.st_other == STO_SH5_ISA32)
{
MSYMBOL_TARGET_FLAG_1 (msym) = 1;
- MSYMBOL_VALUE_ADDRESS (msym) |= 1;
+ SET_MSYMBOL_VALUE_ADDRESS (msym, MSYMBOL_VALUE_ADDRESS (msym) | 1);
}
}
#define MSYMBOL_TYPE(msymbol) (msymbol)->type
#define MSYMBOL_VALUE(symbol) (symbol)->mginfo.value.ivalue
-#define MSYMBOL_VALUE_ADDRESS(symbol) (symbol)->mginfo.value.address
+#define MSYMBOL_VALUE_ADDRESS(symbol) ((symbol)->mginfo.value.address + 0)
+#define SET_MSYMBOL_VALUE_ADDRESS(symbol, new_value) \
+ ((symbol)->mginfo.value.address = (new_value))
#define MSYMBOL_VALUE_BYTES(symbol) (symbol)->mginfo.value.bytes
#define MSYMBOL_BLOCK_VALUE(symbol) (symbol)->mginfo.value.block
#define MSYMBOL_VALUE_CHAIN(symbol) (symbol)->mginfo.value.chain