summaryrefslogtreecommitdiffstats
path: root/src/backends/ia64_retval.c
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-02-18 22:19:45 -0800
committerElliott Hughes <enh@google.com>2015-02-18 23:24:43 -0800
commit03333823c75a1c1887e923828113a1b0fd12020c (patch)
treea63e40b5dd9927bd04ec7427c8797975c2a71f85 /src/backends/ia64_retval.c
parentb48bfdc826ebdd316d5d8a4ff8f213391f1c710b (diff)
downloadandroid_external_elfutils-03333823c75a1c1887e923828113a1b0fd12020c.tar.gz
android_external_elfutils-03333823c75a1c1887e923828113a1b0fd12020c.tar.bz2
android_external_elfutils-03333823c75a1c1887e923828113a1b0fd12020c.zip
Upgrade to elfutils 0.161.
Change-Id: Iee07e1329d9750f092afc6c2fbd6af8db32862b0
Diffstat (limited to 'src/backends/ia64_retval.c')
-rw-r--r--src/backends/ia64_retval.c88
1 files changed, 40 insertions, 48 deletions
diff --git a/src/backends/ia64_retval.c b/src/backends/ia64_retval.c
index 7645c3c8..b5928c58 100644
--- a/src/backends/ia64_retval.c
+++ b/src/backends/ia64_retval.c
@@ -1,27 +1,30 @@
/* Function return value location for IA64 ABI.
- Copyright (C) 2006-2010 Red Hat, Inc.
- This file is part of Red Hat elfutils.
+ Copyright (C) 2006-2010, 2014 Red Hat, Inc.
+ This file is part of elfutils.
- Red Hat elfutils is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by the
- Free Software Foundation; version 2 of the License.
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
- Red Hat elfutils is distributed in the hope that it will be useful, but
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
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 Red Hat elfutils; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-
- Red Hat elfutils is an included package of the Open Invention Network.
- An included package of the Open Invention Network is a package for which
- Open Invention Network licensees cross-license their patents. No patent
- license is granted, either expressly or impliedly, by designation as an
- included package. Should you wish to participate in the Open Invention
- Network licensing program, please visit www.openinventionnetwork.com
- <http://www.openinventionnetwork.com>. */
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -106,7 +109,7 @@ hfa_type (Dwarf_Die *typedie, Dwarf_Word size,
return fpregs_used + nregs;
}
- int tag = dwarf_tag (typedie);
+ int tag = DWARF_TAG_OR_RETURN (typedie);
switch (tag)
{
Dwarf_Attribute attr_mem;
@@ -235,27 +238,10 @@ ia64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
{
/* Start with the function's type, and get the DW_AT_type attribute,
which is the type of the return value. */
-
- Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
- &attr_mem);
- if (attr == NULL)
- /* The function has no return value, like a `void' function in C. */
- return 0;
-
- Dwarf_Die die_mem;
- Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem);
- int tag = dwarf_tag (typedie);
-
- /* Follow typedefs and qualifiers to get to the actual type. */
- while (tag == DW_TAG_typedef
- || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
- || tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
- {
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
- typedie = dwarf_formref_die (attr, &die_mem);
- tag = dwarf_tag (typedie);
- }
+ Dwarf_Die die_mem, *typedie = &die_mem;
+ int tag = dwarf_peeled_die_type (functypedie, typedie);
+ if (tag <= 0)
+ return tag;
Dwarf_Word size;
switch (tag)
@@ -266,9 +252,10 @@ ia64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
case DW_TAG_subrange_type:
if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
{
+ Dwarf_Attribute attr_mem, *attr;
attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
- tag = dwarf_tag (typedie);
+ tag = DWARF_TAG_OR_RETURN (typedie);
}
/* Fall through. */
@@ -276,16 +263,21 @@ ia64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
case DW_TAG_enumeration_type:
case DW_TAG_pointer_type:
case DW_TAG_ptr_to_member_type:
- if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
- {
- if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
- size = 8;
- else
- return -1;
- }
+ {
+ Dwarf_Attribute attr_mem;
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
+ {
+ if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
+ size = 8;
+ else
+ return -1;
+ }
+ }
+
if (tag == DW_TAG_base_type)
{
+ Dwarf_Attribute attr_mem;
Dwarf_Word encoding;
if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
&attr_mem),