varasm.c (get_variable_section): Walk aliases.

* varasm.c (get_variable_section): Walk aliases.
	(place_block_symbol): Walk aliases.

From-SVN: r211045
This commit is contained in:
Jan Hubicka 2014-05-29 08:14:52 +02:00 committed by Jan Hubicka
parent 886508277f
commit 726f0774e0
2 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2014-05-28 Jan Hubicka <hubicka@ucw.cz>
* varasm.c (get_variable_section): Walk aliases.
(place_block_symbol): Walk aliases.
2014-05-28 Tom de Vries <tom@codesourcery.com>
Revert:

View File

@ -1083,6 +1083,9 @@ get_variable_section (tree decl, bool prefer_noswitch_p)
{
addr_space_t as = ADDR_SPACE_GENERIC;
int reloc;
symtab_node *snode = symtab_get_node (decl);
if (snode)
decl = symtab_alias_ultimate_target (snode)->decl;
if (TREE_TYPE (decl) != error_mark_node)
as = TYPE_ADDR_SPACE (TREE_TYPE (decl));
@ -7084,7 +7087,16 @@ place_block_symbol (rtx symbol)
}
else
{
struct symtab_node *snode;
decl = SYMBOL_REF_DECL (symbol);
snode = symtab_get_node (decl);
if (snode->alias)
{
rtx target = DECL_RTL (symtab_alias_ultimate_target (snode)->decl);
SYMBOL_REF_BLOCK_OFFSET (symbol) = SYMBOL_REF_BLOCK_OFFSET (target);
return;
}
alignment = get_variable_align (decl);
size = tree_to_uhwi (DECL_SIZE_UNIT (decl));
if ((flag_sanitize & SANITIZE_ADDRESS)