make MSYMBOL_VALUE_ADDRESS an rvalue

This changes MSYMBOL_VALUE_ADDRESS to be an rvalue.  In a later patch
we change this macro to compute its value; this patch introduces a
setter to make the break a bit cleaner.

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.
This commit is contained in:
Tom Tromey 2013-08-15 08:44:43 -06:00
parent efd66ac669
commit 40c1a00737
5 changed files with 18 additions and 5 deletions

View file

@ -1,3 +1,13 @@
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.

View file

@ -944,7 +944,7 @@ prim_record_minimal_symbol_full (const char *name, int name_len, int copy_name,
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;

View file

@ -805,8 +805,9 @@ objfile_relocate1 (struct objfile *objfile,
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. */

View file

@ -224,7 +224,7 @@ sh64_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym)
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);
}
}

View file

@ -391,7 +391,9 @@ struct minimal_symbol
#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