Merge upstream SHA '9d1e236'

* git merge 9d1e236
* See all upstream changes since the previous merge
  in branch aosp/upstream-master:
    git diff b47fb23..9d1e236
* Android relevant upstream changes:
    Move nested functions to file scope to compile with clang/llvm:
      libdw/dwarf_entry_breakpoints.c
      libdw/libdw_visit_scopes.c
      libdwfl/core-file.c
      libdwfl/dwfl_module_addrsym.c
      libdwfl/dwfl_module_getdwarf.c
      libdwfl/link_map.c
      libdwfl/linux-proc-maps.c
* Other upstream changes:
    backends: sparc: support for live backtraces
    elfcmp: Fix leaking Ebl handles.
    libdw: Don't leak fake_loc_cu.
    libdw: Don't leak duplicate FDEs.
    libdw: Don't use a FDE if it doesn't actually cover a real code range.
    libdw: Make sure Ebl is always freed from cfi frame cache.
    libdwfl: Don't leak core Elf and core file descriptor from argp-std.
    libdwfl: Fix memory leak in link_map.c dwfl_link_map_report.
    libdwfl: make the unwinder aware of the backend defined ra_offset.
    libebl: new backend attribute ra_offset.
    nm: Don't leak duplicate Dwarf local names.
    nm: If the file is ET_REL and we need Dwarf use libdwfl to get it relocated.
    tests: Fix some memory leaks in testcases.
    tests: Use valgrind --leak-check=full.
    unstrip: Don't leak new section data.
* No changes to the following generated files:
    version.h, config.h, libdw/known-dwarf.h
* Post merge change:
    Enable clang compilation in the libdw directory.

Change-Id: Ifa9e60b1d5ab1c70da69410509cc9f3abdf58661
diff --git a/Android.mk b/Android.mk
new file mode 100755
index 0000000..260fae2
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,15 @@
+# Copyright (C) 2013 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+include $(call all-subdir-makefiles)
diff --git a/CleanSpec.mk b/CleanSpec.mk
new file mode 100644
index 0000000..b083f67
--- /dev/null
+++ b/CleanSpec.mk
@@ -0,0 +1,58 @@
+# Copyright (C) 2007 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# If you don't need to do a full clean build but would like to touch
+# a file or delete some intermediate files, add a clean step to the end
+# of the list.  These steps will only be run once, if they haven't been
+# run before.
+#
+# E.g.:
+#     $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
+#     $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
+#
+# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
+# files that are missing or have been moved.
+#
+# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
+# Use $(OUT_DIR) to refer to the "out" directory.
+#
+# If you need to re-do something that's already mentioned, just copy
+# the command and add it to the bottom of the list.  E.g., if a change
+# that you made last week required touching a file and a change you
+# made today requires touching the same file, just copy the old
+# touch step and add it to the end of the list.
+#
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
+
+# For example:
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
+#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
+#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
+
+$(call add-clean-step, rm -rf $(OUT)/obj/STATIC_LIBRARIES/libdw_intermediates)
+$(call add-clean-step, rm -rf $(OUT)/obj/STATIC_LIBRARIES/libdwfl_intermediates)
+$(call add-clean-step, rm -rf $(OUT)/obj/STATIC_LIBRARIES/libelf_intermediates)
+$(call add-clean-step, rm -rf $(OUT)/obj/STATIC_LIBRARIES/libebl_intermediates)
+$(call add-clean-step, rm -rf $(ANDROID_HOST_OUT)/obj/STATIC_LIBRARIES/libdw_intermediates)
+$(call add-clean-step, rm -rf $(ANDROID_HOST_OUT)/obj/STATIC_LIBRARIES/libdwfl_intermediates)
+$(call add-clean-step, rm -rf $(ANDROID_HOST_OUT)/obj/STATIC_LIBRARIES/libelf_intermediates)
+$(call add-clean-step, rm -rf $(ANDROID_HOST_OUT)/obj/STATIC_LIBRARIES/libebl_intermediates)
+
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
diff --git a/MODULE_LICENSE_GPL b/MODULE_LICENSE_GPL
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/MODULE_LICENSE_GPL
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..60549be
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,340 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 19yy  <name of author>
+
+    This program 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; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program 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 this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) 19yy name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/bionic-fixup/AndroidFixup.h b/bionic-fixup/AndroidFixup.h
new file mode 100644
index 0000000..83d2952
--- /dev/null
+++ b/bionic-fixup/AndroidFixup.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2013, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_FIXUP_H
+#define ANDROID_FIXUP_H
+
+static inline void *rawmemchr(const void *s, int c)
+{
+    const unsigned char *ptr = s;
+    while (1) {
+        if (*ptr == c) return (void *) ptr;
+        ptr++;
+    }
+}
+
+/* workaround for canonicalize_file_name */
+#define canonicalize_file_name(path) realpath(path, NULL)
+
+#endif /* ANDROID_FIXUP_H */
diff --git a/bionic-fixup/argp.h b/bionic-fixup/argp.h
new file mode 100644
index 0000000..fe53b6d
--- /dev/null
+++ b/bionic-fixup/argp.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2013, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ELFUTILS_ARGP_H
+#define ELFUTILS_ARGP_H
+
+// We don't have an implementation, but elfutils unconditionally includes this,
+// and relies on its transitive includes in places.
+
+#include <errno.h>
+
+#endif /* ELFUTILS_ARGP_H */
diff --git a/bionic-fixup/libintl.h b/bionic-fixup/libintl.h
new file mode 100644
index 0000000..c35a06d
--- /dev/null
+++ b/bionic-fixup/libintl.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2013, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ELFUTILS_LIBINTL_H
+#define ELFUTILS_LIBINTL_H
+
+/* no internalization */
+#define gettext(x)      (x)
+#define dgettext(x,y)   (y)
+
+#endif /* ELFUTILS_LIBINTL_H */
diff --git a/config.h b/config.h
new file mode 100644
index 0000000..07f2ff7
--- /dev/null
+++ b/config.h
@@ -0,0 +1,113 @@
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Building with -fsanitize=undefined or not */
+#define CHECK_UNDEFINED 0
+
+/* Should ar and ranlib use -D behavior by default? */
+#define DEFAULT_AR_DETERMINISTIC false
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if <sys/user.h> defines struct user_regs_struct */
+#define HAVE_SYS_USER_REGS 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* $libdir subdirectory containing libebl modules. */
+#define LIBEBL_SUBDIR "elfutils"
+
+/* Identifier for modules in the build. */
+#define MODVERSION "Build for elfutils 164 x86_64-unknown-linux-gnu"
+
+/* Define to 32 or 64 if a specific implementation is wanted. */
+/* #undef NATIVE_ELF */
+
+/* Name of package */
+#define PACKAGE "elfutils"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "https://bugzilla.redhat.com/"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "elfutils"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "elfutils 0.164"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "elfutils"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "0.164"
+
+/* The size of `long', as computed by sizeof. */
+#if __LP64__
+#define SIZEOF_LONG 8
+#else
+#define SIZEOF_LONG 4
+#endif
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Support bzip2 decompression via -lbz2. */
+/* #undef USE_BZLIB */
+
+/* Defined if demangling is enabled */
+#define USE_DEMANGLE 1
+
+/* Defined if libraries should be thread-safe. */
+/* #undef USE_LOCKS */
+
+/* Support LZMA (xz) decompression via -llzma. */
+/* #undef USE_LZMA */
+
+/* Support gzip decompression via -lz. */
+#define USE_ZLIB 1
+
+/* Version number of package */
+#define VERSION "0.164"
+
+/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
+   `char[]'. */
+#define YYTEXT_POINTER 1
+
+/* Enable large inode numbers on Mac OS X 10.5.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+#include <eu-config.h>
diff --git a/include/elfutils/libdw.h b/include/elfutils/libdw.h
new file mode 120000
index 0000000..b7328a2
--- /dev/null
+++ b/include/elfutils/libdw.h
@@ -0,0 +1 @@
+../../libdw/libdw.h
\ No newline at end of file
diff --git a/include/elfutils/libdwfl.h b/include/elfutils/libdwfl.h
new file mode 120000
index 0000000..240eb56
--- /dev/null
+++ b/include/elfutils/libdwfl.h
@@ -0,0 +1 @@
+../../libdwfl/libdwfl.h
\ No newline at end of file
diff --git a/include/elfutils/version.h b/include/elfutils/version.h
new file mode 120000
index 0000000..ea58c60
--- /dev/null
+++ b/include/elfutils/version.h
@@ -0,0 +1 @@
+../../version.h
\ No newline at end of file
diff --git a/libdw/Android.mk b/libdw/Android.mk
new file mode 100755
index 0000000..5558a1a
--- /dev/null
+++ b/libdw/Android.mk
@@ -0,0 +1,203 @@
+# Copyright (C) 2013 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH := $(call my-dir)
+
+LIBDW_SRC_FILES := \
+    cfi.c \
+    cie.c \
+    dwarf_abbrevhaschildren.c \
+    dwarf_abbrev_hash.c \
+    dwarf_addrdie.c \
+    dwarf_aggregate_size.c \
+    dwarf_arrayorder.c \
+    dwarf_attr.c \
+    dwarf_attr_integrate.c \
+    dwarf_begin.c \
+    dwarf_begin_elf.c \
+    dwarf_bitoffset.c \
+    dwarf_bitsize.c \
+    dwarf_bytesize.c \
+    dwarf_cfi_addrframe.c \
+    dwarf_cfi_end.c \
+    dwarf_child.c \
+    dwarf_cu_die.c \
+    dwarf_cu_getdwarf.c \
+    dwarf_cuoffset.c \
+    dwarf_decl_column.c \
+    dwarf_decl_file.c \
+    dwarf_decl_line.c \
+    dwarf_diecu.c \
+    dwarf_diename.c \
+    dwarf_dieoffset.c \
+    dwarf_end.c \
+    dwarf_entry_breakpoints.c \
+    dwarf_entrypc.c \
+    dwarf_error.c \
+    dwarf_filesrc.c \
+    dwarf_formaddr.c \
+    dwarf_formblock.c \
+    dwarf_formflag.c \
+    dwarf_formref.c \
+    dwarf_formref_die.c \
+    dwarf_formsdata.c \
+    dwarf_formstring.c \
+    dwarf_formudata.c \
+    dwarf_frame_cfa.c \
+    dwarf_frame_info.c \
+    dwarf_frame_register.c \
+    dwarf_func_inline.c \
+    dwarf_getabbrevattr.c \
+    dwarf_getabbrev.c \
+    dwarf_getabbrevcode.c \
+    dwarf_getabbrevtag.c \
+    dwarf_getalt.c \
+    dwarf_getarange_addr.c \
+    dwarf_getarangeinfo.c \
+    dwarf_getaranges.c \
+    dwarf_getattrcnt.c \
+    dwarf_getattrs.c \
+    dwarf_getcfi.c \
+    dwarf_getcfi_elf.c \
+    dwarf_getelf.c \
+    dwarf_getfuncs.c \
+    dwarf_getlocation_attr.c \
+    dwarf_getlocation.c \
+    dwarf_getlocation_die.c \
+    dwarf_getlocation_implicit_pointer.c \
+    dwarf_getmacros.c \
+    dwarf_getpubnames.c \
+    dwarf_getscopes.c \
+    dwarf_getscopes_die.c \
+    dwarf_getscopevar.c \
+    dwarf_getsrc_die.c \
+    dwarf_getsrcdirs.c \
+    dwarf_getsrc_file.c \
+    dwarf_getsrcfiles.c \
+    dwarf_getsrclines.c \
+    dwarf_getstring.c \
+    dwarf_hasattr.c \
+    dwarf_hasattr_integrate.c \
+    dwarf_haschildren.c \
+    dwarf_hasform.c \
+    dwarf_haspc.c \
+    dwarf_highpc.c \
+    dwarf_lineaddr.c \
+    dwarf_linebeginstatement.c \
+    dwarf_lineblock.c \
+    dwarf_linecol.c \
+    dwarf_linediscriminator.c \
+    dwarf_lineendsequence.c \
+    dwarf_lineepiloguebegin.c \
+    dwarf_lineisa.c \
+    dwarf_lineno.c \
+    dwarf_lineop_index.c \
+    dwarf_lineprologueend.c \
+    dwarf_linesrc.c \
+    dwarf_lowpc.c \
+    dwarf_macro_getparamcnt.c \
+    dwarf_macro_getsrcfiles.c \
+    dwarf_macro_opcode.c \
+    dwarf_macro_param1.c \
+    dwarf_macro_param2.c \
+    dwarf_macro_param.c \
+    dwarf_next_cfi.c \
+    dwarf_nextcu.c \
+    dwarf_offabbrev.c \
+    dwarf_offdie.c \
+    dwarf_onearange.c \
+    dwarf_onesrcline.c \
+    dwarf_peel_type.c \
+    dwarf_ranges.c \
+    dwarf_setalt.c \
+    dwarf_siblingof.c \
+    dwarf_sig8_hash.c \
+    dwarf_srclang.c \
+    dwarf_tag.c \
+    dwarf_whatattr.c \
+    dwarf_whatform.c \
+    fde.c \
+    frame-cache.c \
+    libdw_alloc.c \
+    libdw_findcu.c \
+    libdw_form.c \
+    libdw_visit_scopes.c \
+
+
+ifeq ($(HOST_OS),linux)
+
+#
+# host libdw
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(LIBDW_SRC_FILES)
+
+LOCAL_C_INCLUDES := \
+	$(LOCAL_PATH)/.. \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../libdw \
+	$(LOCAL_PATH)/../libelf
+
+LOCAL_CFLAGS += -DHAVE_CONFIG_H -std=gnu99 -D_GNU_SOURCE -D_BSD_SOURCE -DIS_LIBDW
+
+# to suppress the "pointer of type ‘void *’ used in arithmetic" warning
+LOCAL_CFLAGS += -Wno-pointer-arith
+
+LOCAL_MODULE:= libdw
+
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
+
+LOCAL_STATIC_LIBRARIES := libz
+
+include $(BUILD_HOST_STATIC_LIBRARY)
+
+endif # linux
+
+#
+# target libdw
+#
+
+include $(CLEAR_VARS)
+
+# b/25642296, local __thread variable does not work with arm64 clang/llvm.
+LOCAL_CLANG_arm64 := false
+
+LOCAL_SRC_FILES := $(LIBDW_SRC_FILES)
+
+LOCAL_C_INCLUDES := \
+	$(LOCAL_PATH)/.. \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../libdw \
+	$(LOCAL_PATH)/../libelf
+
+LOCAL_C_INCLUDES += $(LOCAL_PATH)/../bionic-fixup
+
+LOCAL_CFLAGS += -include $(LOCAL_PATH)/../bionic-fixup/AndroidFixup.h
+
+LOCAL_CFLAGS += -DHAVE_CONFIG_H -std=gnu99 -D_GNU_SOURCE -D_BSD_SOURCE -DIS_LIBDW -Werror
+
+# to suppress the "pointer of type ‘void *’ used in arithmetic" warning
+LOCAL_CFLAGS += -Wno-pointer-arith
+
+LOCAL_MODULE_TAGS := eng
+
+LOCAL_MODULE:= libdw
+
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
+
+LOCAL_STATIC_LIBRARIES := libz
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/libdw/known-dwarf.h b/libdw/known-dwarf.h
new file mode 100644
index 0000000..364d7ca
--- /dev/null
+++ b/libdw/known-dwarf.h
@@ -0,0 +1,633 @@
+/* Generated by config/known-dwarf.awk from libdw/dwarf.h contents.  */
+
+#define DWARF_ALL_KNOWN_DW_ACCESS \
+  DWARF_ONE_KNOWN_DW_ACCESS (private, DW_ACCESS_private) \
+  DWARF_ONE_KNOWN_DW_ACCESS (protected, DW_ACCESS_protected) \
+  DWARF_ONE_KNOWN_DW_ACCESS (public, DW_ACCESS_public) \
+  /* End of DW_ACCESS_*.  */
+
+#define DWARF_ALL_KNOWN_DW_AT \
+  DWARF_ONE_KNOWN_DW_AT (GNU_all_call_sites, DW_AT_GNU_all_call_sites) \
+  DWARF_ONE_KNOWN_DW_AT (GNU_all_source_call_sites, DW_AT_GNU_all_source_call_sites) \
+  DWARF_ONE_KNOWN_DW_AT (GNU_all_tail_call_sites, DW_AT_GNU_all_tail_call_sites) \
+  DWARF_ONE_KNOWN_DW_AT (GNU_call_site_data_value, DW_AT_GNU_call_site_data_value) \
+  DWARF_ONE_KNOWN_DW_AT (GNU_call_site_target, DW_AT_GNU_call_site_target) \
+  DWARF_ONE_KNOWN_DW_AT (GNU_call_site_target_clobbered, DW_AT_GNU_call_site_target_clobbered) \
+  DWARF_ONE_KNOWN_DW_AT (GNU_call_site_value, DW_AT_GNU_call_site_value) \
+  DWARF_ONE_KNOWN_DW_AT (GNU_deleted, DW_AT_GNU_deleted) \
+  DWARF_ONE_KNOWN_DW_AT (GNU_exclusive_locks_required, DW_AT_GNU_exclusive_locks_required) \
+  DWARF_ONE_KNOWN_DW_AT (GNU_guarded, DW_AT_GNU_guarded) \
+  DWARF_ONE_KNOWN_DW_AT (GNU_guarded_by, DW_AT_GNU_guarded_by) \
+  DWARF_ONE_KNOWN_DW_AT (GNU_locks_excluded, DW_AT_GNU_locks_excluded) \
+  DWARF_ONE_KNOWN_DW_AT (GNU_macros, DW_AT_GNU_macros) \
+  DWARF_ONE_KNOWN_DW_AT (GNU_odr_signature, DW_AT_GNU_odr_signature) \
+  DWARF_ONE_KNOWN_DW_AT (GNU_pt_guarded, DW_AT_GNU_pt_guarded) \
+  DWARF_ONE_KNOWN_DW_AT (GNU_pt_guarded_by, DW_AT_GNU_pt_guarded_by) \
+  DWARF_ONE_KNOWN_DW_AT (GNU_shared_locks_required, DW_AT_GNU_shared_locks_required) \
+  DWARF_ONE_KNOWN_DW_AT (GNU_tail_call, DW_AT_GNU_tail_call) \
+  DWARF_ONE_KNOWN_DW_AT (GNU_template_name, DW_AT_GNU_template_name) \
+  DWARF_ONE_KNOWN_DW_AT (GNU_vector, DW_AT_GNU_vector) \
+  DWARF_ONE_KNOWN_DW_AT (MIPS_abstract_name, DW_AT_MIPS_abstract_name) \
+  DWARF_ONE_KNOWN_DW_AT (MIPS_allocatable_dopetype, DW_AT_MIPS_allocatable_dopetype) \
+  DWARF_ONE_KNOWN_DW_AT (MIPS_assumed_shape_dopetype, DW_AT_MIPS_assumed_shape_dopetype) \
+  DWARF_ONE_KNOWN_DW_AT (MIPS_assumed_size, DW_AT_MIPS_assumed_size) \
+  DWARF_ONE_KNOWN_DW_AT (MIPS_clone_origin, DW_AT_MIPS_clone_origin) \
+  DWARF_ONE_KNOWN_DW_AT (MIPS_epilog_begin, DW_AT_MIPS_epilog_begin) \
+  DWARF_ONE_KNOWN_DW_AT (MIPS_fde, DW_AT_MIPS_fde) \
+  DWARF_ONE_KNOWN_DW_AT (MIPS_has_inlines, DW_AT_MIPS_has_inlines) \
+  DWARF_ONE_KNOWN_DW_AT (MIPS_linkage_name, DW_AT_MIPS_linkage_name) \
+  DWARF_ONE_KNOWN_DW_AT (MIPS_loop_begin, DW_AT_MIPS_loop_begin) \
+  DWARF_ONE_KNOWN_DW_AT (MIPS_loop_unroll_factor, DW_AT_MIPS_loop_unroll_factor) \
+  DWARF_ONE_KNOWN_DW_AT (MIPS_ptr_dopetype, DW_AT_MIPS_ptr_dopetype) \
+  DWARF_ONE_KNOWN_DW_AT (MIPS_software_pipeline_depth, DW_AT_MIPS_software_pipeline_depth) \
+  DWARF_ONE_KNOWN_DW_AT (MIPS_stride, DW_AT_MIPS_stride) \
+  DWARF_ONE_KNOWN_DW_AT (MIPS_stride_byte, DW_AT_MIPS_stride_byte) \
+  DWARF_ONE_KNOWN_DW_AT (MIPS_stride_elem, DW_AT_MIPS_stride_elem) \
+  DWARF_ONE_KNOWN_DW_AT (MIPS_tail_loop_begin, DW_AT_MIPS_tail_loop_begin) \
+  DWARF_ONE_KNOWN_DW_AT (abstract_origin, DW_AT_abstract_origin) \
+  DWARF_ONE_KNOWN_DW_AT (accessibility, DW_AT_accessibility) \
+  DWARF_ONE_KNOWN_DW_AT (address_class, DW_AT_address_class) \
+  DWARF_ONE_KNOWN_DW_AT (allocated, DW_AT_allocated) \
+  DWARF_ONE_KNOWN_DW_AT (artificial, DW_AT_artificial) \
+  DWARF_ONE_KNOWN_DW_AT (associated, DW_AT_associated) \
+  DWARF_ONE_KNOWN_DW_AT (base_types, DW_AT_base_types) \
+  DWARF_ONE_KNOWN_DW_AT (binary_scale, DW_AT_binary_scale) \
+  DWARF_ONE_KNOWN_DW_AT (bit_offset, DW_AT_bit_offset) \
+  DWARF_ONE_KNOWN_DW_AT (bit_size, DW_AT_bit_size) \
+  DWARF_ONE_KNOWN_DW_AT (bit_stride, DW_AT_bit_stride) \
+  DWARF_ONE_KNOWN_DW_AT (body_begin, DW_AT_body_begin) \
+  DWARF_ONE_KNOWN_DW_AT (body_end, DW_AT_body_end) \
+  DWARF_ONE_KNOWN_DW_AT (byte_size, DW_AT_byte_size) \
+  DWARF_ONE_KNOWN_DW_AT (byte_stride, DW_AT_byte_stride) \
+  DWARF_ONE_KNOWN_DW_AT (call_column, DW_AT_call_column) \
+  DWARF_ONE_KNOWN_DW_AT (call_file, DW_AT_call_file) \
+  DWARF_ONE_KNOWN_DW_AT (call_line, DW_AT_call_line) \
+  DWARF_ONE_KNOWN_DW_AT (calling_convention, DW_AT_calling_convention) \
+  DWARF_ONE_KNOWN_DW_AT (common_reference, DW_AT_common_reference) \
+  DWARF_ONE_KNOWN_DW_AT (comp_dir, DW_AT_comp_dir) \
+  DWARF_ONE_KNOWN_DW_AT (const_expr, DW_AT_const_expr) \
+  DWARF_ONE_KNOWN_DW_AT (const_value, DW_AT_const_value) \
+  DWARF_ONE_KNOWN_DW_AT (containing_type, DW_AT_containing_type) \
+  DWARF_ONE_KNOWN_DW_AT (count, DW_AT_count) \
+  DWARF_ONE_KNOWN_DW_AT (data_bit_offset, DW_AT_data_bit_offset) \
+  DWARF_ONE_KNOWN_DW_AT (data_location, DW_AT_data_location) \
+  DWARF_ONE_KNOWN_DW_AT (data_member_location, DW_AT_data_member_location) \
+  DWARF_ONE_KNOWN_DW_AT (decimal_scale, DW_AT_decimal_scale) \
+  DWARF_ONE_KNOWN_DW_AT (decimal_sign, DW_AT_decimal_sign) \
+  DWARF_ONE_KNOWN_DW_AT (decl_column, DW_AT_decl_column) \
+  DWARF_ONE_KNOWN_DW_AT (decl_file, DW_AT_decl_file) \
+  DWARF_ONE_KNOWN_DW_AT (decl_line, DW_AT_decl_line) \
+  DWARF_ONE_KNOWN_DW_AT (declaration, DW_AT_declaration) \
+  DWARF_ONE_KNOWN_DW_AT (default_value, DW_AT_default_value) \
+  DWARF_ONE_KNOWN_DW_AT (description, DW_AT_description) \
+  DWARF_ONE_KNOWN_DW_AT (digit_count, DW_AT_digit_count) \
+  DWARF_ONE_KNOWN_DW_AT (discr, DW_AT_discr) \
+  DWARF_ONE_KNOWN_DW_AT (discr_list, DW_AT_discr_list) \
+  DWARF_ONE_KNOWN_DW_AT (discr_value, DW_AT_discr_value) \
+  DWARF_ONE_KNOWN_DW_AT (element_list, DW_AT_element_list) \
+  DWARF_ONE_KNOWN_DW_AT (elemental, DW_AT_elemental) \
+  DWARF_ONE_KNOWN_DW_AT (encoding, DW_AT_encoding) \
+  DWARF_ONE_KNOWN_DW_AT (endianity, DW_AT_endianity) \
+  DWARF_ONE_KNOWN_DW_AT (entry_pc, DW_AT_entry_pc) \
+  DWARF_ONE_KNOWN_DW_AT (enum_class, DW_AT_enum_class) \
+  DWARF_ONE_KNOWN_DW_AT (explicit, DW_AT_explicit) \
+  DWARF_ONE_KNOWN_DW_AT (extension, DW_AT_extension) \
+  DWARF_ONE_KNOWN_DW_AT (external, DW_AT_external) \
+  DWARF_ONE_KNOWN_DW_AT (frame_base, DW_AT_frame_base) \
+  DWARF_ONE_KNOWN_DW_AT (friend, DW_AT_friend) \
+  DWARF_ONE_KNOWN_DW_AT (high_pc, DW_AT_high_pc) \
+  DWARF_ONE_KNOWN_DW_AT (identifier_case, DW_AT_identifier_case) \
+  DWARF_ONE_KNOWN_DW_AT (import, DW_AT_import) \
+  DWARF_ONE_KNOWN_DW_AT (inline, DW_AT_inline) \
+  DWARF_ONE_KNOWN_DW_AT (is_optional, DW_AT_is_optional) \
+  DWARF_ONE_KNOWN_DW_AT (language, DW_AT_language) \
+  DWARF_ONE_KNOWN_DW_AT (linkage_name, DW_AT_linkage_name) \
+  DWARF_ONE_KNOWN_DW_AT (location, DW_AT_location) \
+  DWARF_ONE_KNOWN_DW_AT (low_pc, DW_AT_low_pc) \
+  DWARF_ONE_KNOWN_DW_AT (lower_bound, DW_AT_lower_bound) \
+  DWARF_ONE_KNOWN_DW_AT (mac_info, DW_AT_mac_info) \
+  DWARF_ONE_KNOWN_DW_AT (macro_info, DW_AT_macro_info) \
+  DWARF_ONE_KNOWN_DW_AT (main_subprogram, DW_AT_main_subprogram) \
+  DWARF_ONE_KNOWN_DW_AT (member, DW_AT_member) \
+  DWARF_ONE_KNOWN_DW_AT (mutable, DW_AT_mutable) \
+  DWARF_ONE_KNOWN_DW_AT (name, DW_AT_name) \
+  DWARF_ONE_KNOWN_DW_AT (namelist_item, DW_AT_namelist_item) \
+  DWARF_ONE_KNOWN_DW_AT (noreturn, DW_AT_noreturn) \
+  DWARF_ONE_KNOWN_DW_AT (object_pointer, DW_AT_object_pointer) \
+  DWARF_ONE_KNOWN_DW_AT (ordering, DW_AT_ordering) \
+  DWARF_ONE_KNOWN_DW_AT (picture_string, DW_AT_picture_string) \
+  DWARF_ONE_KNOWN_DW_AT (priority, DW_AT_priority) \
+  DWARF_ONE_KNOWN_DW_AT (producer, DW_AT_producer) \
+  DWARF_ONE_KNOWN_DW_AT (prototyped, DW_AT_prototyped) \
+  DWARF_ONE_KNOWN_DW_AT (pure, DW_AT_pure) \
+  DWARF_ONE_KNOWN_DW_AT (ranges, DW_AT_ranges) \
+  DWARF_ONE_KNOWN_DW_AT (recursive, DW_AT_recursive) \
+  DWARF_ONE_KNOWN_DW_AT (return_addr, DW_AT_return_addr) \
+  DWARF_ONE_KNOWN_DW_AT (segment, DW_AT_segment) \
+  DWARF_ONE_KNOWN_DW_AT (sf_names, DW_AT_sf_names) \
+  DWARF_ONE_KNOWN_DW_AT (sibling, DW_AT_sibling) \
+  DWARF_ONE_KNOWN_DW_AT (signature, DW_AT_signature) \
+  DWARF_ONE_KNOWN_DW_AT (small, DW_AT_small) \
+  DWARF_ONE_KNOWN_DW_AT (specification, DW_AT_specification) \
+  DWARF_ONE_KNOWN_DW_AT (src_coords, DW_AT_src_coords) \
+  DWARF_ONE_KNOWN_DW_AT (src_info, DW_AT_src_info) \
+  DWARF_ONE_KNOWN_DW_AT (start_scope, DW_AT_start_scope) \
+  DWARF_ONE_KNOWN_DW_AT (static_link, DW_AT_static_link) \
+  DWARF_ONE_KNOWN_DW_AT (stmt_list, DW_AT_stmt_list) \
+  DWARF_ONE_KNOWN_DW_AT (string_length, DW_AT_string_length) \
+  DWARF_ONE_KNOWN_DW_AT (subscr_data, DW_AT_subscr_data) \
+  DWARF_ONE_KNOWN_DW_AT (threads_scaled, DW_AT_threads_scaled) \
+  DWARF_ONE_KNOWN_DW_AT (trampoline, DW_AT_trampoline) \
+  DWARF_ONE_KNOWN_DW_AT (type, DW_AT_type) \
+  DWARF_ONE_KNOWN_DW_AT (upper_bound, DW_AT_upper_bound) \
+  DWARF_ONE_KNOWN_DW_AT (use_UTF8, DW_AT_use_UTF8) \
+  DWARF_ONE_KNOWN_DW_AT (use_location, DW_AT_use_location) \
+  DWARF_ONE_KNOWN_DW_AT (variable_parameter, DW_AT_variable_parameter) \
+  DWARF_ONE_KNOWN_DW_AT (virtuality, DW_AT_virtuality) \
+  DWARF_ONE_KNOWN_DW_AT (visibility, DW_AT_visibility) \
+  DWARF_ONE_KNOWN_DW_AT (vtable_elem_location, DW_AT_vtable_elem_location) \
+  /* End of DW_AT_*.  */
+
+#define DWARF_ALL_KNOWN_DW_ATE \
+  DWARF_ONE_KNOWN_DW_ATE (UTF, DW_ATE_UTF) \
+  DWARF_ONE_KNOWN_DW_ATE (address, DW_ATE_address) \
+  DWARF_ONE_KNOWN_DW_ATE (boolean, DW_ATE_boolean) \
+  DWARF_ONE_KNOWN_DW_ATE (complex_float, DW_ATE_complex_float) \
+  DWARF_ONE_KNOWN_DW_ATE (decimal_float, DW_ATE_decimal_float) \
+  DWARF_ONE_KNOWN_DW_ATE (edited, DW_ATE_edited) \
+  DWARF_ONE_KNOWN_DW_ATE (float, DW_ATE_float) \
+  DWARF_ONE_KNOWN_DW_ATE (imaginary_float, DW_ATE_imaginary_float) \
+  DWARF_ONE_KNOWN_DW_ATE (numeric_string, DW_ATE_numeric_string) \
+  DWARF_ONE_KNOWN_DW_ATE (packed_decimal, DW_ATE_packed_decimal) \
+  DWARF_ONE_KNOWN_DW_ATE (signed, DW_ATE_signed) \
+  DWARF_ONE_KNOWN_DW_ATE (signed_char, DW_ATE_signed_char) \
+  DWARF_ONE_KNOWN_DW_ATE (signed_fixed, DW_ATE_signed_fixed) \
+  DWARF_ONE_KNOWN_DW_ATE (unsigned, DW_ATE_unsigned) \
+  DWARF_ONE_KNOWN_DW_ATE (unsigned_char, DW_ATE_unsigned_char) \
+  DWARF_ONE_KNOWN_DW_ATE (unsigned_fixed, DW_ATE_unsigned_fixed) \
+  DWARF_ONE_KNOWN_DW_ATE (void, DW_ATE_void) \
+  /* End of DW_ATE_*.  */
+
+#define DWARF_ALL_KNOWN_DW_CC \
+  DWARF_ONE_KNOWN_DW_CC (nocall, DW_CC_nocall) \
+  DWARF_ONE_KNOWN_DW_CC (normal, DW_CC_normal) \
+  DWARF_ONE_KNOWN_DW_CC (program, DW_CC_program) \
+  /* End of DW_CC_*.  */
+
+#define DWARF_ALL_KNOWN_DW_CFA \
+  DWARF_ONE_KNOWN_DW_CFA (GNU_args_size, DW_CFA_GNU_args_size) \
+  DWARF_ONE_KNOWN_DW_CFA (GNU_negative_offset_extended, DW_CFA_GNU_negative_offset_extended) \
+  DWARF_ONE_KNOWN_DW_CFA (GNU_window_save, DW_CFA_GNU_window_save) \
+  DWARF_ONE_KNOWN_DW_CFA (MIPS_advance_loc8, DW_CFA_MIPS_advance_loc8) \
+  DWARF_ONE_KNOWN_DW_CFA (advance_loc, DW_CFA_advance_loc) \
+  DWARF_ONE_KNOWN_DW_CFA (advance_loc1, DW_CFA_advance_loc1) \
+  DWARF_ONE_KNOWN_DW_CFA (advance_loc2, DW_CFA_advance_loc2) \
+  DWARF_ONE_KNOWN_DW_CFA (advance_loc4, DW_CFA_advance_loc4) \
+  DWARF_ONE_KNOWN_DW_CFA (def_cfa, DW_CFA_def_cfa) \
+  DWARF_ONE_KNOWN_DW_CFA (def_cfa_expression, DW_CFA_def_cfa_expression) \
+  DWARF_ONE_KNOWN_DW_CFA (def_cfa_offset, DW_CFA_def_cfa_offset) \
+  DWARF_ONE_KNOWN_DW_CFA (def_cfa_offset_sf, DW_CFA_def_cfa_offset_sf) \
+  DWARF_ONE_KNOWN_DW_CFA (def_cfa_register, DW_CFA_def_cfa_register) \
+  DWARF_ONE_KNOWN_DW_CFA (def_cfa_sf, DW_CFA_def_cfa_sf) \
+  DWARF_ONE_KNOWN_DW_CFA (expression, DW_CFA_expression) \
+  DWARF_ONE_KNOWN_DW_CFA (extended, DW_CFA_extended) \
+  DWARF_ONE_KNOWN_DW_CFA (nop, DW_CFA_nop) \
+  DWARF_ONE_KNOWN_DW_CFA (offset, DW_CFA_offset) \
+  DWARF_ONE_KNOWN_DW_CFA (offset_extended, DW_CFA_offset_extended) \
+  DWARF_ONE_KNOWN_DW_CFA (offset_extended_sf, DW_CFA_offset_extended_sf) \
+  DWARF_ONE_KNOWN_DW_CFA (register, DW_CFA_register) \
+  DWARF_ONE_KNOWN_DW_CFA (remember_state, DW_CFA_remember_state) \
+  DWARF_ONE_KNOWN_DW_CFA (restore, DW_CFA_restore) \
+  DWARF_ONE_KNOWN_DW_CFA (restore_extended, DW_CFA_restore_extended) \
+  DWARF_ONE_KNOWN_DW_CFA (restore_state, DW_CFA_restore_state) \
+  DWARF_ONE_KNOWN_DW_CFA (same_value, DW_CFA_same_value) \
+  DWARF_ONE_KNOWN_DW_CFA (set_loc, DW_CFA_set_loc) \
+  DWARF_ONE_KNOWN_DW_CFA (undefined, DW_CFA_undefined) \
+  DWARF_ONE_KNOWN_DW_CFA (val_expression, DW_CFA_val_expression) \
+  DWARF_ONE_KNOWN_DW_CFA (val_offset, DW_CFA_val_offset) \
+  DWARF_ONE_KNOWN_DW_CFA (val_offset_sf, DW_CFA_val_offset_sf) \
+  /* End of DW_CFA_*.  */
+
+#define DWARF_ALL_KNOWN_DW_CHILDREN \
+  DWARF_ONE_KNOWN_DW_CHILDREN (no, DW_CHILDREN_no) \
+  DWARF_ONE_KNOWN_DW_CHILDREN (yes, DW_CHILDREN_yes) \
+  /* End of DW_CHILDREN_*.  */
+
+#define DWARF_ALL_KNOWN_DW_CIE_ID \
+  DWARF_ONE_KNOWN_DW_CIE_ID (32, DW_CIE_ID_32) \
+  DWARF_ONE_KNOWN_DW_CIE_ID (64, DW_CIE_ID_64) \
+  /* End of DW_CIE_ID_*.  */
+
+#define DWARF_ALL_KNOWN_DW_DS \
+  DWARF_ONE_KNOWN_DW_DS (leading_overpunch, DW_DS_leading_overpunch) \
+  DWARF_ONE_KNOWN_DW_DS (leading_separate, DW_DS_leading_separate) \
+  DWARF_ONE_KNOWN_DW_DS (trailing_overpunch, DW_DS_trailing_overpunch) \
+  DWARF_ONE_KNOWN_DW_DS (trailing_separate, DW_DS_trailing_separate) \
+  DWARF_ONE_KNOWN_DW_DS (unsigned, DW_DS_unsigned) \
+  /* End of DW_DS_*.  */
+
+#define DWARF_ALL_KNOWN_DW_DSC \
+  DWARF_ONE_KNOWN_DW_DSC (label, DW_DSC_label) \
+  DWARF_ONE_KNOWN_DW_DSC (range, DW_DSC_range) \
+  /* End of DW_DSC_*.  */
+
+#define DWARF_ALL_KNOWN_DW_EH_PE \
+  DWARF_ONE_KNOWN_DW_EH_PE (absptr, DW_EH_PE_absptr) \
+  DWARF_ONE_KNOWN_DW_EH_PE (aligned, DW_EH_PE_aligned) \
+  DWARF_ONE_KNOWN_DW_EH_PE (datarel, DW_EH_PE_datarel) \
+  DWARF_ONE_KNOWN_DW_EH_PE (funcrel, DW_EH_PE_funcrel) \
+  DWARF_ONE_KNOWN_DW_EH_PE (indirect, DW_EH_PE_indirect) \
+  DWARF_ONE_KNOWN_DW_EH_PE (omit, DW_EH_PE_omit) \
+  DWARF_ONE_KNOWN_DW_EH_PE (pcrel, DW_EH_PE_pcrel) \
+  DWARF_ONE_KNOWN_DW_EH_PE (sdata2, DW_EH_PE_sdata2) \
+  DWARF_ONE_KNOWN_DW_EH_PE (sdata4, DW_EH_PE_sdata4) \
+  DWARF_ONE_KNOWN_DW_EH_PE (sdata8, DW_EH_PE_sdata8) \
+  DWARF_ONE_KNOWN_DW_EH_PE (signed, DW_EH_PE_signed) \
+  DWARF_ONE_KNOWN_DW_EH_PE (sleb128, DW_EH_PE_sleb128) \
+  DWARF_ONE_KNOWN_DW_EH_PE (textrel, DW_EH_PE_textrel) \
+  DWARF_ONE_KNOWN_DW_EH_PE (udata2, DW_EH_PE_udata2) \
+  DWARF_ONE_KNOWN_DW_EH_PE (udata4, DW_EH_PE_udata4) \
+  DWARF_ONE_KNOWN_DW_EH_PE (udata8, DW_EH_PE_udata8) \
+  DWARF_ONE_KNOWN_DW_EH_PE (uleb128, DW_EH_PE_uleb128) \
+  /* End of DW_EH_PE_*.  */
+
+#define DWARF_ALL_KNOWN_DW_END \
+  DWARF_ONE_KNOWN_DW_END (big, DW_END_big) \
+  DWARF_ONE_KNOWN_DW_END (default, DW_END_default) \
+  DWARF_ONE_KNOWN_DW_END (little, DW_END_little) \
+  /* End of DW_END_*.  */
+
+#define DWARF_ALL_KNOWN_DW_FORM \
+  DWARF_ONE_KNOWN_DW_FORM (GNU_ref_alt, DW_FORM_GNU_ref_alt) \
+  DWARF_ONE_KNOWN_DW_FORM (GNU_strp_alt, DW_FORM_GNU_strp_alt) \
+  DWARF_ONE_KNOWN_DW_FORM (addr, DW_FORM_addr) \
+  DWARF_ONE_KNOWN_DW_FORM (block, DW_FORM_block) \
+  DWARF_ONE_KNOWN_DW_FORM (block1, DW_FORM_block1) \
+  DWARF_ONE_KNOWN_DW_FORM (block2, DW_FORM_block2) \
+  DWARF_ONE_KNOWN_DW_FORM (block4, DW_FORM_block4) \
+  DWARF_ONE_KNOWN_DW_FORM (data1, DW_FORM_data1) \
+  DWARF_ONE_KNOWN_DW_FORM (data2, DW_FORM_data2) \
+  DWARF_ONE_KNOWN_DW_FORM (data4, DW_FORM_data4) \
+  DWARF_ONE_KNOWN_DW_FORM (data8, DW_FORM_data8) \
+  DWARF_ONE_KNOWN_DW_FORM (exprloc, DW_FORM_exprloc) \
+  DWARF_ONE_KNOWN_DW_FORM (flag, DW_FORM_flag) \
+  DWARF_ONE_KNOWN_DW_FORM (flag_present, DW_FORM_flag_present) \
+  DWARF_ONE_KNOWN_DW_FORM (indirect, DW_FORM_indirect) \
+  DWARF_ONE_KNOWN_DW_FORM (ref1, DW_FORM_ref1) \
+  DWARF_ONE_KNOWN_DW_FORM (ref2, DW_FORM_ref2) \
+  DWARF_ONE_KNOWN_DW_FORM (ref4, DW_FORM_ref4) \
+  DWARF_ONE_KNOWN_DW_FORM (ref8, DW_FORM_ref8) \
+  DWARF_ONE_KNOWN_DW_FORM (ref_addr, DW_FORM_ref_addr) \
+  DWARF_ONE_KNOWN_DW_FORM (ref_sig8, DW_FORM_ref_sig8) \
+  DWARF_ONE_KNOWN_DW_FORM (ref_udata, DW_FORM_ref_udata) \
+  DWARF_ONE_KNOWN_DW_FORM (sdata, DW_FORM_sdata) \
+  DWARF_ONE_KNOWN_DW_FORM (sec_offset, DW_FORM_sec_offset) \
+  DWARF_ONE_KNOWN_DW_FORM (string, DW_FORM_string) \
+  DWARF_ONE_KNOWN_DW_FORM (strp, DW_FORM_strp) \
+  DWARF_ONE_KNOWN_DW_FORM (udata, DW_FORM_udata) \
+  /* End of DW_FORM_*.  */
+
+#define DWARF_ALL_KNOWN_DW_ID \
+  DWARF_ONE_KNOWN_DW_ID (case_insensitive, DW_ID_case_insensitive) \
+  DWARF_ONE_KNOWN_DW_ID (case_sensitive, DW_ID_case_sensitive) \
+  DWARF_ONE_KNOWN_DW_ID (down_case, DW_ID_down_case) \
+  DWARF_ONE_KNOWN_DW_ID (up_case, DW_ID_up_case) \
+  /* End of DW_ID_*.  */
+
+#define DWARF_ALL_KNOWN_DW_INL \
+  DWARF_ONE_KNOWN_DW_INL (declared_inlined, DW_INL_declared_inlined) \
+  DWARF_ONE_KNOWN_DW_INL (declared_not_inlined, DW_INL_declared_not_inlined) \
+  DWARF_ONE_KNOWN_DW_INL (inlined, DW_INL_inlined) \
+  DWARF_ONE_KNOWN_DW_INL (not_inlined, DW_INL_not_inlined) \
+  /* End of DW_INL_*.  */
+
+#define DWARF_ALL_KNOWN_DW_LANG \
+  DWARF_ONE_KNOWN_DW_LANG (Ada83, DW_LANG_Ada83) \
+  DWARF_ONE_KNOWN_DW_LANG (Ada95, DW_LANG_Ada95) \
+  DWARF_ONE_KNOWN_DW_LANG (C, DW_LANG_C) \
+  DWARF_ONE_KNOWN_DW_LANG (C11, DW_LANG_C11) \
+  DWARF_ONE_KNOWN_DW_LANG (C89, DW_LANG_C89) \
+  DWARF_ONE_KNOWN_DW_LANG (C99, DW_LANG_C99) \
+  DWARF_ONE_KNOWN_DW_LANG (C_plus_plus, DW_LANG_C_plus_plus) \
+  DWARF_ONE_KNOWN_DW_LANG (C_plus_plus_11, DW_LANG_C_plus_plus_11) \
+  DWARF_ONE_KNOWN_DW_LANG (C_plus_plus_14, DW_LANG_C_plus_plus_14) \
+  DWARF_ONE_KNOWN_DW_LANG (Cobol74, DW_LANG_Cobol74) \
+  DWARF_ONE_KNOWN_DW_LANG (Cobol85, DW_LANG_Cobol85) \
+  DWARF_ONE_KNOWN_DW_LANG (D, DW_LANG_D) \
+  DWARF_ONE_KNOWN_DW_LANG (Fortran03, DW_LANG_Fortran03) \
+  DWARF_ONE_KNOWN_DW_LANG (Fortran08, DW_LANG_Fortran08) \
+  DWARF_ONE_KNOWN_DW_LANG (Fortran77, DW_LANG_Fortran77) \
+  DWARF_ONE_KNOWN_DW_LANG (Fortran90, DW_LANG_Fortran90) \
+  DWARF_ONE_KNOWN_DW_LANG (Fortran95, DW_LANG_Fortran95) \
+  DWARF_ONE_KNOWN_DW_LANG (Go, DW_LANG_Go) \
+  DWARF_ONE_KNOWN_DW_LANG (Haskell, DW_LANG_Haskell) \
+  DWARF_ONE_KNOWN_DW_LANG (Java, DW_LANG_Java) \
+  DWARF_ONE_KNOWN_DW_LANG (Mips_Assembler, DW_LANG_Mips_Assembler) \
+  DWARF_ONE_KNOWN_DW_LANG (Modula2, DW_LANG_Modula2) \
+  DWARF_ONE_KNOWN_DW_LANG (ObjC, DW_LANG_ObjC) \
+  DWARF_ONE_KNOWN_DW_LANG (ObjC_plus_plus, DW_LANG_ObjC_plus_plus) \
+  DWARF_ONE_KNOWN_DW_LANG (PL1, DW_LANG_PL1) \
+  DWARF_ONE_KNOWN_DW_LANG (Pascal83, DW_LANG_Pascal83) \
+  DWARF_ONE_KNOWN_DW_LANG (Python, DW_LANG_Python) \
+  DWARF_ONE_KNOWN_DW_LANG (UPC, DW_LANG_UPC) \
+  /* End of DW_LANG_*.  */
+
+#define DWARF_ALL_KNOWN_DW_LNE \
+  DWARF_ONE_KNOWN_DW_LNE (define_file, DW_LNE_define_file) \
+  DWARF_ONE_KNOWN_DW_LNE (end_sequence, DW_LNE_end_sequence) \
+  DWARF_ONE_KNOWN_DW_LNE (set_address, DW_LNE_set_address) \
+  DWARF_ONE_KNOWN_DW_LNE (set_discriminator, DW_LNE_set_discriminator) \
+  /* End of DW_LNE_*.  */
+
+#define DWARF_ALL_KNOWN_DW_LNS \
+  DWARF_ONE_KNOWN_DW_LNS (advance_line, DW_LNS_advance_line) \
+  DWARF_ONE_KNOWN_DW_LNS (advance_pc, DW_LNS_advance_pc) \
+  DWARF_ONE_KNOWN_DW_LNS (const_add_pc, DW_LNS_const_add_pc) \
+  DWARF_ONE_KNOWN_DW_LNS (copy, DW_LNS_copy) \
+  DWARF_ONE_KNOWN_DW_LNS (fixed_advance_pc, DW_LNS_fixed_advance_pc) \
+  DWARF_ONE_KNOWN_DW_LNS (negate_stmt, DW_LNS_negate_stmt) \
+  DWARF_ONE_KNOWN_DW_LNS (set_basic_block, DW_LNS_set_basic_block) \
+  DWARF_ONE_KNOWN_DW_LNS (set_column, DW_LNS_set_column) \
+  DWARF_ONE_KNOWN_DW_LNS (set_epilogue_begin, DW_LNS_set_epilogue_begin) \
+  DWARF_ONE_KNOWN_DW_LNS (set_file, DW_LNS_set_file) \
+  DWARF_ONE_KNOWN_DW_LNS (set_isa, DW_LNS_set_isa) \
+  DWARF_ONE_KNOWN_DW_LNS (set_prologue_end, DW_LNS_set_prologue_end) \
+  /* End of DW_LNS_*.  */
+
+#define DWARF_ALL_KNOWN_DW_MACINFO \
+  DWARF_ONE_KNOWN_DW_MACINFO (define, DW_MACINFO_define) \
+  DWARF_ONE_KNOWN_DW_MACINFO (end_file, DW_MACINFO_end_file) \
+  DWARF_ONE_KNOWN_DW_MACINFO (start_file, DW_MACINFO_start_file) \
+  DWARF_ONE_KNOWN_DW_MACINFO (undef, DW_MACINFO_undef) \
+  DWARF_ONE_KNOWN_DW_MACINFO (vendor_ext, DW_MACINFO_vendor_ext) \
+  /* End of DW_MACINFO_*.  */
+
+#define DWARF_ALL_KNOWN_DW_MACRO_GNU \
+  DWARF_ONE_KNOWN_DW_MACRO_GNU (define, DW_MACRO_GNU_define) \
+  DWARF_ONE_KNOWN_DW_MACRO_GNU (define_indirect, DW_MACRO_GNU_define_indirect) \
+  DWARF_ONE_KNOWN_DW_MACRO_GNU (end_file, DW_MACRO_GNU_end_file) \
+  DWARF_ONE_KNOWN_DW_MACRO_GNU (start_file, DW_MACRO_GNU_start_file) \
+  DWARF_ONE_KNOWN_DW_MACRO_GNU (transparent_include, DW_MACRO_GNU_transparent_include) \
+  DWARF_ONE_KNOWN_DW_MACRO_GNU (undef, DW_MACRO_GNU_undef) \
+  DWARF_ONE_KNOWN_DW_MACRO_GNU (undef_indirect, DW_MACRO_GNU_undef_indirect) \
+  /* End of DW_MACRO_GNU_*.  */
+
+#define DWARF_ALL_KNOWN_DW_OP \
+  DWARF_ONE_KNOWN_DW_OP (GNU_const_type, DW_OP_GNU_const_type) \
+  DWARF_ONE_KNOWN_DW_OP (GNU_convert, DW_OP_GNU_convert) \
+  DWARF_ONE_KNOWN_DW_OP (GNU_deref_type, DW_OP_GNU_deref_type) \
+  DWARF_ONE_KNOWN_DW_OP (GNU_encoded_addr, DW_OP_GNU_encoded_addr) \
+  DWARF_ONE_KNOWN_DW_OP (GNU_entry_value, DW_OP_GNU_entry_value) \
+  DWARF_ONE_KNOWN_DW_OP (GNU_implicit_pointer, DW_OP_GNU_implicit_pointer) \
+  DWARF_ONE_KNOWN_DW_OP (GNU_parameter_ref, DW_OP_GNU_parameter_ref) \
+  DWARF_ONE_KNOWN_DW_OP (GNU_push_tls_address, DW_OP_GNU_push_tls_address) \
+  DWARF_ONE_KNOWN_DW_OP (GNU_regval_type, DW_OP_GNU_regval_type) \
+  DWARF_ONE_KNOWN_DW_OP (GNU_reinterpret, DW_OP_GNU_reinterpret) \
+  DWARF_ONE_KNOWN_DW_OP (GNU_uninit, DW_OP_GNU_uninit) \
+  DWARF_ONE_KNOWN_DW_OP (abs, DW_OP_abs) \
+  DWARF_ONE_KNOWN_DW_OP (addr, DW_OP_addr) \
+  DWARF_ONE_KNOWN_DW_OP (and, DW_OP_and) \
+  DWARF_ONE_KNOWN_DW_OP (bit_piece, DW_OP_bit_piece) \
+  DWARF_ONE_KNOWN_DW_OP (bra, DW_OP_bra) \
+  DWARF_ONE_KNOWN_DW_OP (breg0, DW_OP_breg0) \
+  DWARF_ONE_KNOWN_DW_OP (breg1, DW_OP_breg1) \
+  DWARF_ONE_KNOWN_DW_OP (breg10, DW_OP_breg10) \
+  DWARF_ONE_KNOWN_DW_OP (breg11, DW_OP_breg11) \
+  DWARF_ONE_KNOWN_DW_OP (breg12, DW_OP_breg12) \
+  DWARF_ONE_KNOWN_DW_OP (breg13, DW_OP_breg13) \
+  DWARF_ONE_KNOWN_DW_OP (breg14, DW_OP_breg14) \
+  DWARF_ONE_KNOWN_DW_OP (breg15, DW_OP_breg15) \
+  DWARF_ONE_KNOWN_DW_OP (breg16, DW_OP_breg16) \
+  DWARF_ONE_KNOWN_DW_OP (breg17, DW_OP_breg17) \
+  DWARF_ONE_KNOWN_DW_OP (breg18, DW_OP_breg18) \
+  DWARF_ONE_KNOWN_DW_OP (breg19, DW_OP_breg19) \
+  DWARF_ONE_KNOWN_DW_OP (breg2, DW_OP_breg2) \
+  DWARF_ONE_KNOWN_DW_OP (breg20, DW_OP_breg20) \
+  DWARF_ONE_KNOWN_DW_OP (breg21, DW_OP_breg21) \
+  DWARF_ONE_KNOWN_DW_OP (breg22, DW_OP_breg22) \
+  DWARF_ONE_KNOWN_DW_OP (breg23, DW_OP_breg23) \
+  DWARF_ONE_KNOWN_DW_OP (breg24, DW_OP_breg24) \
+  DWARF_ONE_KNOWN_DW_OP (breg25, DW_OP_breg25) \
+  DWARF_ONE_KNOWN_DW_OP (breg26, DW_OP_breg26) \
+  DWARF_ONE_KNOWN_DW_OP (breg27, DW_OP_breg27) \
+  DWARF_ONE_KNOWN_DW_OP (breg28, DW_OP_breg28) \
+  DWARF_ONE_KNOWN_DW_OP (breg29, DW_OP_breg29) \
+  DWARF_ONE_KNOWN_DW_OP (breg3, DW_OP_breg3) \
+  DWARF_ONE_KNOWN_DW_OP (breg30, DW_OP_breg30) \
+  DWARF_ONE_KNOWN_DW_OP (breg31, DW_OP_breg31) \
+  DWARF_ONE_KNOWN_DW_OP (breg4, DW_OP_breg4) \
+  DWARF_ONE_KNOWN_DW_OP (breg5, DW_OP_breg5) \
+  DWARF_ONE_KNOWN_DW_OP (breg6, DW_OP_breg6) \
+  DWARF_ONE_KNOWN_DW_OP (breg7, DW_OP_breg7) \
+  DWARF_ONE_KNOWN_DW_OP (breg8, DW_OP_breg8) \
+  DWARF_ONE_KNOWN_DW_OP (breg9, DW_OP_breg9) \
+  DWARF_ONE_KNOWN_DW_OP (bregx, DW_OP_bregx) \
+  DWARF_ONE_KNOWN_DW_OP (call2, DW_OP_call2) \
+  DWARF_ONE_KNOWN_DW_OP (call4, DW_OP_call4) \
+  DWARF_ONE_KNOWN_DW_OP (call_frame_cfa, DW_OP_call_frame_cfa) \
+  DWARF_ONE_KNOWN_DW_OP (call_ref, DW_OP_call_ref) \
+  DWARF_ONE_KNOWN_DW_OP (const1s, DW_OP_const1s) \
+  DWARF_ONE_KNOWN_DW_OP (const1u, DW_OP_const1u) \
+  DWARF_ONE_KNOWN_DW_OP (const2s, DW_OP_const2s) \
+  DWARF_ONE_KNOWN_DW_OP (const2u, DW_OP_const2u) \
+  DWARF_ONE_KNOWN_DW_OP (const4s, DW_OP_const4s) \
+  DWARF_ONE_KNOWN_DW_OP (const4u, DW_OP_const4u) \
+  DWARF_ONE_KNOWN_DW_OP (const8s, DW_OP_const8s) \
+  DWARF_ONE_KNOWN_DW_OP (const8u, DW_OP_const8u) \
+  DWARF_ONE_KNOWN_DW_OP (consts, DW_OP_consts) \
+  DWARF_ONE_KNOWN_DW_OP (constu, DW_OP_constu) \
+  DWARF_ONE_KNOWN_DW_OP (deref, DW_OP_deref) \
+  DWARF_ONE_KNOWN_DW_OP (deref_size, DW_OP_deref_size) \
+  DWARF_ONE_KNOWN_DW_OP (div, DW_OP_div) \
+  DWARF_ONE_KNOWN_DW_OP (drop, DW_OP_drop) \
+  DWARF_ONE_KNOWN_DW_OP (dup, DW_OP_dup) \
+  DWARF_ONE_KNOWN_DW_OP (eq, DW_OP_eq) \
+  DWARF_ONE_KNOWN_DW_OP (fbreg, DW_OP_fbreg) \
+  DWARF_ONE_KNOWN_DW_OP (form_tls_address, DW_OP_form_tls_address) \
+  DWARF_ONE_KNOWN_DW_OP (ge, DW_OP_ge) \
+  DWARF_ONE_KNOWN_DW_OP (gt, DW_OP_gt) \
+  DWARF_ONE_KNOWN_DW_OP (implicit_value, DW_OP_implicit_value) \
+  DWARF_ONE_KNOWN_DW_OP (le, DW_OP_le) \
+  DWARF_ONE_KNOWN_DW_OP (lit0, DW_OP_lit0) \
+  DWARF_ONE_KNOWN_DW_OP (lit1, DW_OP_lit1) \
+  DWARF_ONE_KNOWN_DW_OP (lit10, DW_OP_lit10) \
+  DWARF_ONE_KNOWN_DW_OP (lit11, DW_OP_lit11) \
+  DWARF_ONE_KNOWN_DW_OP (lit12, DW_OP_lit12) \
+  DWARF_ONE_KNOWN_DW_OP (lit13, DW_OP_lit13) \
+  DWARF_ONE_KNOWN_DW_OP (lit14, DW_OP_lit14) \
+  DWARF_ONE_KNOWN_DW_OP (lit15, DW_OP_lit15) \
+  DWARF_ONE_KNOWN_DW_OP (lit16, DW_OP_lit16) \
+  DWARF_ONE_KNOWN_DW_OP (lit17, DW_OP_lit17) \
+  DWARF_ONE_KNOWN_DW_OP (lit18, DW_OP_lit18) \
+  DWARF_ONE_KNOWN_DW_OP (lit19, DW_OP_lit19) \
+  DWARF_ONE_KNOWN_DW_OP (lit2, DW_OP_lit2) \
+  DWARF_ONE_KNOWN_DW_OP (lit20, DW_OP_lit20) \
+  DWARF_ONE_KNOWN_DW_OP (lit21, DW_OP_lit21) \
+  DWARF_ONE_KNOWN_DW_OP (lit22, DW_OP_lit22) \
+  DWARF_ONE_KNOWN_DW_OP (lit23, DW_OP_lit23) \
+  DWARF_ONE_KNOWN_DW_OP (lit24, DW_OP_lit24) \
+  DWARF_ONE_KNOWN_DW_OP (lit25, DW_OP_lit25) \
+  DWARF_ONE_KNOWN_DW_OP (lit26, DW_OP_lit26) \
+  DWARF_ONE_KNOWN_DW_OP (lit27, DW_OP_lit27) \
+  DWARF_ONE_KNOWN_DW_OP (lit28, DW_OP_lit28) \
+  DWARF_ONE_KNOWN_DW_OP (lit29, DW_OP_lit29) \
+  DWARF_ONE_KNOWN_DW_OP (lit3, DW_OP_lit3) \
+  DWARF_ONE_KNOWN_DW_OP (lit30, DW_OP_lit30) \
+  DWARF_ONE_KNOWN_DW_OP (lit31, DW_OP_lit31) \
+  DWARF_ONE_KNOWN_DW_OP (lit4, DW_OP_lit4) \
+  DWARF_ONE_KNOWN_DW_OP (lit5, DW_OP_lit5) \
+  DWARF_ONE_KNOWN_DW_OP (lit6, DW_OP_lit6) \
+  DWARF_ONE_KNOWN_DW_OP (lit7, DW_OP_lit7) \
+  DWARF_ONE_KNOWN_DW_OP (lit8, DW_OP_lit8) \
+  DWARF_ONE_KNOWN_DW_OP (lit9, DW_OP_lit9) \
+  DWARF_ONE_KNOWN_DW_OP (lt, DW_OP_lt) \
+  DWARF_ONE_KNOWN_DW_OP (minus, DW_OP_minus) \
+  DWARF_ONE_KNOWN_DW_OP (mod, DW_OP_mod) \
+  DWARF_ONE_KNOWN_DW_OP (mul, DW_OP_mul) \
+  DWARF_ONE_KNOWN_DW_OP (ne, DW_OP_ne) \
+  DWARF_ONE_KNOWN_DW_OP (neg, DW_OP_neg) \
+  DWARF_ONE_KNOWN_DW_OP (nop, DW_OP_nop) \
+  DWARF_ONE_KNOWN_DW_OP (not, DW_OP_not) \
+  DWARF_ONE_KNOWN_DW_OP (or, DW_OP_or) \
+  DWARF_ONE_KNOWN_DW_OP (over, DW_OP_over) \
+  DWARF_ONE_KNOWN_DW_OP (pick, DW_OP_pick) \
+  DWARF_ONE_KNOWN_DW_OP (piece, DW_OP_piece) \
+  DWARF_ONE_KNOWN_DW_OP (plus, DW_OP_plus) \
+  DWARF_ONE_KNOWN_DW_OP (plus_uconst, DW_OP_plus_uconst) \
+  DWARF_ONE_KNOWN_DW_OP (push_object_address, DW_OP_push_object_address) \
+  DWARF_ONE_KNOWN_DW_OP (reg0, DW_OP_reg0) \
+  DWARF_ONE_KNOWN_DW_OP (reg1, DW_OP_reg1) \
+  DWARF_ONE_KNOWN_DW_OP (reg10, DW_OP_reg10) \
+  DWARF_ONE_KNOWN_DW_OP (reg11, DW_OP_reg11) \
+  DWARF_ONE_KNOWN_DW_OP (reg12, DW_OP_reg12) \
+  DWARF_ONE_KNOWN_DW_OP (reg13, DW_OP_reg13) \
+  DWARF_ONE_KNOWN_DW_OP (reg14, DW_OP_reg14) \
+  DWARF_ONE_KNOWN_DW_OP (reg15, DW_OP_reg15) \
+  DWARF_ONE_KNOWN_DW_OP (reg16, DW_OP_reg16) \
+  DWARF_ONE_KNOWN_DW_OP (reg17, DW_OP_reg17) \
+  DWARF_ONE_KNOWN_DW_OP (reg18, DW_OP_reg18) \
+  DWARF_ONE_KNOWN_DW_OP (reg19, DW_OP_reg19) \
+  DWARF_ONE_KNOWN_DW_OP (reg2, DW_OP_reg2) \
+  DWARF_ONE_KNOWN_DW_OP (reg20, DW_OP_reg20) \
+  DWARF_ONE_KNOWN_DW_OP (reg21, DW_OP_reg21) \
+  DWARF_ONE_KNOWN_DW_OP (reg22, DW_OP_reg22) \
+  DWARF_ONE_KNOWN_DW_OP (reg23, DW_OP_reg23) \
+  DWARF_ONE_KNOWN_DW_OP (reg24, DW_OP_reg24) \
+  DWARF_ONE_KNOWN_DW_OP (reg25, DW_OP_reg25) \
+  DWARF_ONE_KNOWN_DW_OP (reg26, DW_OP_reg26) \
+  DWARF_ONE_KNOWN_DW_OP (reg27, DW_OP_reg27) \
+  DWARF_ONE_KNOWN_DW_OP (reg28, DW_OP_reg28) \
+  DWARF_ONE_KNOWN_DW_OP (reg29, DW_OP_reg29) \
+  DWARF_ONE_KNOWN_DW_OP (reg3, DW_OP_reg3) \
+  DWARF_ONE_KNOWN_DW_OP (reg30, DW_OP_reg30) \
+  DWARF_ONE_KNOWN_DW_OP (reg31, DW_OP_reg31) \
+  DWARF_ONE_KNOWN_DW_OP (reg4, DW_OP_reg4) \
+  DWARF_ONE_KNOWN_DW_OP (reg5, DW_OP_reg5) \
+  DWARF_ONE_KNOWN_DW_OP (reg6, DW_OP_reg6) \
+  DWARF_ONE_KNOWN_DW_OP (reg7, DW_OP_reg7) \
+  DWARF_ONE_KNOWN_DW_OP (reg8, DW_OP_reg8) \
+  DWARF_ONE_KNOWN_DW_OP (reg9, DW_OP_reg9) \
+  DWARF_ONE_KNOWN_DW_OP (regx, DW_OP_regx) \
+  DWARF_ONE_KNOWN_DW_OP (rot, DW_OP_rot) \
+  DWARF_ONE_KNOWN_DW_OP (shl, DW_OP_shl) \
+  DWARF_ONE_KNOWN_DW_OP (shr, DW_OP_shr) \
+  DWARF_ONE_KNOWN_DW_OP (shra, DW_OP_shra) \
+  DWARF_ONE_KNOWN_DW_OP (skip, DW_OP_skip) \
+  DWARF_ONE_KNOWN_DW_OP (stack_value, DW_OP_stack_value) \
+  DWARF_ONE_KNOWN_DW_OP (swap, DW_OP_swap) \
+  DWARF_ONE_KNOWN_DW_OP (xderef, DW_OP_xderef) \
+  DWARF_ONE_KNOWN_DW_OP (xderef_size, DW_OP_xderef_size) \
+  DWARF_ONE_KNOWN_DW_OP (xor, DW_OP_xor) \
+  /* End of DW_OP_*.  */
+
+#define DWARF_ALL_KNOWN_DW_ORD \
+  DWARF_ONE_KNOWN_DW_ORD (col_major, DW_ORD_col_major) \
+  DWARF_ONE_KNOWN_DW_ORD (row_major, DW_ORD_row_major) \
+  /* End of DW_ORD_*.  */
+
+#define DWARF_ALL_KNOWN_DW_TAG \
+  DWARF_ONE_KNOWN_DW_TAG (GNU_BINCL, DW_TAG_GNU_BINCL) \
+  DWARF_ONE_KNOWN_DW_TAG (GNU_EINCL, DW_TAG_GNU_EINCL) \
+  DWARF_ONE_KNOWN_DW_TAG (GNU_call_site, DW_TAG_GNU_call_site) \
+  DWARF_ONE_KNOWN_DW_TAG (GNU_call_site_parameter, DW_TAG_GNU_call_site_parameter) \
+  DWARF_ONE_KNOWN_DW_TAG (GNU_formal_parameter_pack, DW_TAG_GNU_formal_parameter_pack) \
+  DWARF_ONE_KNOWN_DW_TAG (GNU_template_parameter_pack, DW_TAG_GNU_template_parameter_pack) \
+  DWARF_ONE_KNOWN_DW_TAG (GNU_template_template_param, DW_TAG_GNU_template_template_param) \
+  DWARF_ONE_KNOWN_DW_TAG (MIPS_loop, DW_TAG_MIPS_loop) \
+  DWARF_ONE_KNOWN_DW_TAG (access_declaration, DW_TAG_access_declaration) \
+  DWARF_ONE_KNOWN_DW_TAG (array_type, DW_TAG_array_type) \
+  DWARF_ONE_KNOWN_DW_TAG (atomic_type, DW_TAG_atomic_type) \
+  DWARF_ONE_KNOWN_DW_TAG (base_type, DW_TAG_base_type) \
+  DWARF_ONE_KNOWN_DW_TAG (catch_block, DW_TAG_catch_block) \
+  DWARF_ONE_KNOWN_DW_TAG (class_template, DW_TAG_class_template) \
+  DWARF_ONE_KNOWN_DW_TAG (class_type, DW_TAG_class_type) \
+  DWARF_ONE_KNOWN_DW_TAG (common_block, DW_TAG_common_block) \
+  DWARF_ONE_KNOWN_DW_TAG (common_inclusion, DW_TAG_common_inclusion) \
+  DWARF_ONE_KNOWN_DW_TAG (compile_unit, DW_TAG_compile_unit) \
+  DWARF_ONE_KNOWN_DW_TAG (condition, DW_TAG_condition) \
+  DWARF_ONE_KNOWN_DW_TAG (const_type, DW_TAG_const_type) \
+  DWARF_ONE_KNOWN_DW_TAG (constant, DW_TAG_constant) \
+  DWARF_ONE_KNOWN_DW_TAG (dwarf_procedure, DW_TAG_dwarf_procedure) \
+  DWARF_ONE_KNOWN_DW_TAG (entry_point, DW_TAG_entry_point) \
+  DWARF_ONE_KNOWN_DW_TAG (enumeration_type, DW_TAG_enumeration_type) \
+  DWARF_ONE_KNOWN_DW_TAG (enumerator, DW_TAG_enumerator) \
+  DWARF_ONE_KNOWN_DW_TAG (file_type, DW_TAG_file_type) \
+  DWARF_ONE_KNOWN_DW_TAG (formal_parameter, DW_TAG_formal_parameter) \
+  DWARF_ONE_KNOWN_DW_TAG (format_label, DW_TAG_format_label) \
+  DWARF_ONE_KNOWN_DW_TAG (friend, DW_TAG_friend) \
+  DWARF_ONE_KNOWN_DW_TAG (function_template, DW_TAG_function_template) \
+  DWARF_ONE_KNOWN_DW_TAG (imported_declaration, DW_TAG_imported_declaration) \
+  DWARF_ONE_KNOWN_DW_TAG (imported_module, DW_TAG_imported_module) \
+  DWARF_ONE_KNOWN_DW_TAG (imported_unit, DW_TAG_imported_unit) \
+  DWARF_ONE_KNOWN_DW_TAG (inheritance, DW_TAG_inheritance) \
+  DWARF_ONE_KNOWN_DW_TAG (inlined_subroutine, DW_TAG_inlined_subroutine) \
+  DWARF_ONE_KNOWN_DW_TAG (interface_type, DW_TAG_interface_type) \
+  DWARF_ONE_KNOWN_DW_TAG (label, DW_TAG_label) \
+  DWARF_ONE_KNOWN_DW_TAG (lexical_block, DW_TAG_lexical_block) \
+  DWARF_ONE_KNOWN_DW_TAG (member, DW_TAG_member) \
+  DWARF_ONE_KNOWN_DW_TAG (module, DW_TAG_module) \
+  DWARF_ONE_KNOWN_DW_TAG (namelist, DW_TAG_namelist) \
+  DWARF_ONE_KNOWN_DW_TAG (namelist_item, DW_TAG_namelist_item) \
+  DWARF_ONE_KNOWN_DW_TAG (namespace, DW_TAG_namespace) \
+  DWARF_ONE_KNOWN_DW_TAG (packed_type, DW_TAG_packed_type) \
+  DWARF_ONE_KNOWN_DW_TAG (partial_unit, DW_TAG_partial_unit) \
+  DWARF_ONE_KNOWN_DW_TAG (pointer_type, DW_TAG_pointer_type) \
+  DWARF_ONE_KNOWN_DW_TAG (ptr_to_member_type, DW_TAG_ptr_to_member_type) \
+  DWARF_ONE_KNOWN_DW_TAG (reference_type, DW_TAG_reference_type) \
+  DWARF_ONE_KNOWN_DW_TAG (restrict_type, DW_TAG_restrict_type) \
+  DWARF_ONE_KNOWN_DW_TAG (rvalue_reference_type, DW_TAG_rvalue_reference_type) \
+  DWARF_ONE_KNOWN_DW_TAG (set_type, DW_TAG_set_type) \
+  DWARF_ONE_KNOWN_DW_TAG (shared_type, DW_TAG_shared_type) \
+  DWARF_ONE_KNOWN_DW_TAG (string_type, DW_TAG_string_type) \
+  DWARF_ONE_KNOWN_DW_TAG (structure_type, DW_TAG_structure_type) \
+  DWARF_ONE_KNOWN_DW_TAG (subprogram, DW_TAG_subprogram) \
+  DWARF_ONE_KNOWN_DW_TAG (subrange_type, DW_TAG_subrange_type) \
+  DWARF_ONE_KNOWN_DW_TAG (subroutine_type, DW_TAG_subroutine_type) \
+  DWARF_ONE_KNOWN_DW_TAG (template_alias, DW_TAG_template_alias) \
+  DWARF_ONE_KNOWN_DW_TAG (template_type_parameter, DW_TAG_template_type_parameter) \
+  DWARF_ONE_KNOWN_DW_TAG (template_value_parameter, DW_TAG_template_value_parameter) \
+  DWARF_ONE_KNOWN_DW_TAG (thrown_type, DW_TAG_thrown_type) \
+  DWARF_ONE_KNOWN_DW_TAG (try_block, DW_TAG_try_block) \
+  DWARF_ONE_KNOWN_DW_TAG (type_unit, DW_TAG_type_unit) \
+  DWARF_ONE_KNOWN_DW_TAG (typedef, DW_TAG_typedef) \
+  DWARF_ONE_KNOWN_DW_TAG (union_type, DW_TAG_union_type) \
+  DWARF_ONE_KNOWN_DW_TAG (unspecified_parameters, DW_TAG_unspecified_parameters) \
+  DWARF_ONE_KNOWN_DW_TAG (unspecified_type, DW_TAG_unspecified_type) \
+  DWARF_ONE_KNOWN_DW_TAG (variable, DW_TAG_variable) \
+  DWARF_ONE_KNOWN_DW_TAG (variant, DW_TAG_variant) \
+  DWARF_ONE_KNOWN_DW_TAG (variant_part, DW_TAG_variant_part) \
+  DWARF_ONE_KNOWN_DW_TAG (volatile_type, DW_TAG_volatile_type) \
+  DWARF_ONE_KNOWN_DW_TAG (with_stmt, DW_TAG_with_stmt) \
+  /* End of DW_TAG_*.  */
+
+#define DWARF_ALL_KNOWN_DW_VIRTUALITY \
+  DWARF_ONE_KNOWN_DW_VIRTUALITY (none, DW_VIRTUALITY_none) \
+  DWARF_ONE_KNOWN_DW_VIRTUALITY (pure_virtual, DW_VIRTUALITY_pure_virtual) \
+  DWARF_ONE_KNOWN_DW_VIRTUALITY (virtual, DW_VIRTUALITY_virtual) \
+  /* End of DW_VIRTUALITY_*.  */
+
+#define DWARF_ALL_KNOWN_DW_VIS \
+  DWARF_ONE_KNOWN_DW_VIS (exported, DW_VIS_exported) \
+  DWARF_ONE_KNOWN_DW_VIS (local, DW_VIS_local) \
+  DWARF_ONE_KNOWN_DW_VIS (qualified, DW_VIS_qualified) \
+  /* End of DW_VIS_*.  */
diff --git a/libdwelf/Android.mk b/libdwelf/Android.mk
new file mode 100755
index 0000000..26b7d82
--- /dev/null
+++ b/libdwelf/Android.mk
@@ -0,0 +1,89 @@
+# Copyright (C) 2015 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH := $(call my-dir)
+
+LIBDWELF_SRC_FILES := \
+    dwelf_dwarf_gnu_debugaltlink.c \
+    dwelf_elf_gnu_build_id.c \
+    dwelf_elf_gnu_debuglink.c \
+
+
+ifeq ($(HOST_OS),linux)
+
+#
+# host libdwelf
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(LIBDWELF_SRC_FILES)
+
+LOCAL_C_INCLUDES := \
+	$(LOCAL_PATH)/.. \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../libdw \
+	$(LOCAL_PATH)/../libdwfl \
+	$(LOCAL_PATH)/../libebl \
+	$(LOCAL_PATH)/../libelf
+
+LOCAL_CFLAGS += -DHAVE_CONFIG_H -std=gnu99 -D_GNU_SOURCE -D_BSD_SOURCE
+
+# to suppress the "pointer of type ‘void *’ used in arithmetic" warning
+LOCAL_CFLAGS += -Wno-pointer-arith
+
+LOCAL_MODULE:= libdwelf
+
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
+
+LOCAL_STATIC_LIBRARIES := libz
+
+include $(BUILD_HOST_STATIC_LIBRARY)
+
+endif # linux
+
+#
+# target libdwelf
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(LIBDWELF_SRC_FILES)
+
+LOCAL_C_INCLUDES := \
+	$(LOCAL_PATH)/.. \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../libdw \
+	$(LOCAL_PATH)/../libdwfl \
+	$(LOCAL_PATH)/../libebl \
+	$(LOCAL_PATH)/../libelf
+
+LOCAL_C_INCLUDES += $(LOCAL_PATH)/../bionic-fixup
+
+LOCAL_CFLAGS += -include $(LOCAL_PATH)/../bionic-fixup/AndroidFixup.h
+
+LOCAL_CFLAGS += -DHAVE_CONFIG_H -std=gnu99 -D_GNU_SOURCE -D_BSD_SOURCE -Werror
+
+# to suppress the "pointer of type ‘void *’ used in arithmetic" warning
+LOCAL_CFLAGS += -Wno-pointer-arith
+
+LOCAL_MODULE_TAGS := eng
+
+LOCAL_MODULE:= libdwelf
+
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
+
+LOCAL_STATIC_LIBRARIES := libz
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/libdwfl/Android.mk b/libdwfl/Android.mk
new file mode 100755
index 0000000..a2c0993
--- /dev/null
+++ b/libdwfl/Android.mk
@@ -0,0 +1,170 @@
+# Copyright (C) 2013 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH := $(call my-dir)
+
+LIBDWFL_SRC_FILES := \
+    core-file.c \
+    cu.c \
+    derelocate.c \
+    dwfl_addrdie.c \
+    dwfl_addrdwarf.c \
+    dwfl_addrmodule.c \
+    dwfl_begin.c \
+    dwfl_build_id_find_debuginfo.c \
+    dwfl_build_id_find_elf.c \
+    dwfl_cumodule.c \
+    dwfl_dwarf_line.c \
+    dwfl_end.c \
+    dwfl_error.c \
+    dwfl_frame.c \
+    dwfl_frame_pc.c \
+    dwfl_frame_regs.c \
+    dwfl_getdwarf.c \
+    dwfl_getmodules.c \
+    dwfl_getsrc.c \
+    dwfl_getsrclines.c \
+    dwfl_line_comp_dir.c \
+    dwfl_linecu.c \
+    dwfl_lineinfo.c \
+    dwfl_linemodule.c \
+    dwfl_module_addrdie.c \
+    dwfl_module_addrname.c \
+    dwfl_module_addrsym.c \
+    dwfl_module_build_id.c \
+    dwfl_module.c \
+    dwfl_module_dwarf_cfi.c \
+    dwfl_module_eh_cfi.c \
+    dwfl_module_getdwarf.c \
+    dwfl_module_getelf.c \
+    dwfl_module_getsrc.c \
+    dwfl_module_getsrc_file.c \
+    dwfl_module_getsym.c \
+    dwfl_module_info.c \
+    dwfl_module_nextcu.c \
+    dwfl_module_register_names.c \
+    dwfl_module_report_build_id.c \
+    dwfl_module_return_value_location.c \
+    dwfl_nextcu.c \
+    dwfl_onesrcline.c \
+    dwfl_report_elf.c \
+    dwfl_segment_report_module.c \
+    dwfl_validate_address.c \
+    dwfl_version.c \
+    elf-from-memory.c \
+    find-debuginfo.c \
+    frame_unwind.c \
+    gzip.c \
+    image-header.c \
+    libdwfl_crc32.c \
+    libdwfl_crc32_file.c \
+    lines.c \
+    link_map.c \
+    linux-core-attach.c \
+    linux-kernel-modules.c \
+    linux-pid-attach.c \
+    linux-proc-maps.c \
+    offline.c \
+    open.c \
+    relocate.c \
+    segment.c \
+
+
+ifeq ($(HOST_OS),linux)
+
+#
+# host libdwfl
+#
+
+include $(CLEAR_VARS)
+
+# Clang has no nested functions.
+LOCAL_CLANG := false
+
+LOCAL_SRC_FILES := $(LIBDWFL_SRC_FILES)
+
+LOCAL_C_INCLUDES := \
+	$(LOCAL_PATH)/.. \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../libdwelf \
+	$(LOCAL_PATH)/../libdwfl \
+	$(LOCAL_PATH)/../libebl \
+	$(LOCAL_PATH)/../libdw \
+	$(LOCAL_PATH)/../libelf
+
+LOCAL_CFLAGS += -DHAVE_CONFIG_H -std=gnu99 -D_GNU_SOURCE
+
+# to suppress the "pointer of type ‘void *’ used in arithmetic" warning
+LOCAL_CFLAGS += -Wno-pointer-arith
+
+# Asserts are not compiled, so some debug variables appear unused. Rather than
+# fix, we prefer to turn off the warning locally.
+LOCAL_CFLAGS += -Wno-unused-but-set-variable
+
+# Similar to the above. To stay in line with upstream, ignore the warning.
+LOCAL_CFLAGS += -Wno-unused-variable
+
+LOCAL_MODULE:= libdwfl
+
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
+
+LOCAL_STATIC_LIBRARIES := libz
+
+include $(BUILD_HOST_STATIC_LIBRARY)
+
+endif # linux
+
+#
+# target libdwfl
+#
+
+include $(CLEAR_VARS)
+
+# Clang has no nested functions.
+LOCAL_CLANG := false
+
+# b/25642296, local __thread variable does not work with arm64 clang/llvm.
+LOCAL_CLANG_arm64 := false
+
+LOCAL_SRC_FILES := $(LIBDWFL_SRC_FILES)
+
+LOCAL_C_INCLUDES := \
+	$(LOCAL_PATH)/.. \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../libdwelf \
+	$(LOCAL_PATH)/../libdwfl \
+	$(LOCAL_PATH)/../libebl \
+	$(LOCAL_PATH)/../libdw \
+	$(LOCAL_PATH)/../libelf
+
+LOCAL_C_INCLUDES += $(LOCAL_PATH)/../bionic-fixup
+
+LOCAL_CFLAGS += -include $(LOCAL_PATH)/../bionic-fixup/AndroidFixup.h
+
+LOCAL_CFLAGS += -DHAVE_CONFIG_H -std=gnu99 -D_GNU_SOURCE -Werror
+
+# to suppress the "pointer of type ‘void *’ used in arithmetic" warning
+LOCAL_CFLAGS += -Wno-pointer-arith
+
+# See above.
+LOCAL_CFLAGS += -Wno-unused-but-set-variable
+LOCAL_CFLAGS += -Wno-unused-variable
+
+LOCAL_MODULE:= libdwfl
+
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
+
+LOCAL_STATIC_LIBRARIES := libz
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c
index 38b5170..d8020fc 100644
--- a/libdwfl/linux-kernel-modules.c
+++ b/libdwfl/linux-kernel-modules.c
@@ -28,7 +28,8 @@
 
 /* We include this before config.h because it can't handle _FILE_OFFSET_BITS.
    Everything we need here is fine if its declarations just come first.  */
-
+/* Some makefiles, e.g. HOST_linux-x86.mk, predefine _FILE_OFFSET_BITS.  */
+#undef _FILE_OFFSET_BITS
 #include <fts.h>
 
 #include <config.h>
diff --git a/libebl/Android.mk b/libebl/Android.mk
new file mode 100755
index 0000000..7c33428
--- /dev/null
+++ b/libebl/Android.mk
@@ -0,0 +1,127 @@
+# Copyright (C) 2013 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH := $(call my-dir)
+
+LIBEBL_SRC_FILES := \
+eblabicfi.c \
+eblauxvinfo.c \
+eblbackendname.c \
+eblbsspltp.c \
+eblcheckobjattr.c \
+eblcheckreloctargettype.c \
+ebl_check_special_section.c \
+ebl_check_special_symbol.c \
+eblclosebackend.c \
+eblcopyrelocp.c \
+eblcorenote.c \
+eblcorenotetypename.c \
+ebldebugscnp.c \
+ebldwarftoregno.c \
+ebldynamictagcheck.c \
+ebldynamictagname.c \
+eblelfclass.c \
+eblelfdata.c \
+eblelfmachine.c \
+eblgotpcreloccheck.c \
+eblgstrtab.c \
+eblinitreg.c \
+eblmachineflagcheck.c \
+eblmachineflagname.c \
+eblmachinesectionflagcheck.c \
+eblnonerelocp.c \
+eblnormalizepc.c \
+eblobjecttypename.c \
+eblobjnote.c \
+eblobjnotetypename.c \
+eblopenbackend.c \
+eblosabiname.c \
+eblreginfo.c \
+eblrelativerelocp.c \
+eblrelocsimpletype.c \
+eblreloctypecheck.c \
+eblreloctypename.c \
+eblrelocvaliduse.c \
+eblresolvesym.c \
+eblretval.c \
+eblsectionname.c \
+eblsectionstripp.c \
+eblsectiontypename.c \
+eblsegmenttypename.c \
+eblshflagscombine.c \
+eblstother.c \
+eblstrtab.c \
+eblsymbolbindingname.c \
+eblsymboltypename.c \
+ebl_syscall_abi.c \
+eblsysvhashentrysize.c \
+eblunwind.c \
+eblwstrtab.c \
+
+
+ifeq ($(HOST_OS),linux)
+
+#
+# host libebl
+#
+#
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(LIBEBL_SRC_FILES)
+
+LOCAL_C_INCLUDES := \
+	$(LOCAL_PATH)/.. \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../libebl \
+	$(LOCAL_PATH)/../libasm \
+	$(LOCAL_PATH)/../libelf \
+	$(LOCAL_PATH)/../libdw
+
+LOCAL_CFLAGS += -DHAVE_CONFIG_H -std=gnu99 -D_GNU_SOURCE
+
+LOCAL_MODULE:= libebl
+
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
+
+include $(BUILD_HOST_STATIC_LIBRARY)
+
+endif # linux
+
+#
+# target libebl
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(LIBEBL_SRC_FILES)
+
+LOCAL_C_INCLUDES := \
+	$(LOCAL_PATH)/.. \
+	$(LOCAL_PATH)/../lib \
+	$(LOCAL_PATH)/../libebl \
+	$(LOCAL_PATH)/../libasm \
+	$(LOCAL_PATH)/../libelf \
+	$(LOCAL_PATH)/../libdw
+
+LOCAL_C_INCLUDES += $(LOCAL_PATH)/../bionic-fixup
+
+LOCAL_CFLAGS += -include $(LOCAL_PATH)/../bionic-fixup/AndroidFixup.h
+
+LOCAL_CFLAGS += -DHAVE_CONFIG_H -std=gnu99 -D_GNU_SOURCE -Werror -Wno-error=pointer-arith
+
+LOCAL_MODULE:= libebl
+
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/libelf/Android.mk b/libelf/Android.mk
new file mode 100755
index 0000000..1c0195c
--- /dev/null
+++ b/libelf/Android.mk
@@ -0,0 +1,185 @@
+# Copyright (C) 2013 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH := $(call my-dir)
+
+LIBELF_SRC_FILES := \
+	elf32_checksum.c \
+	elf32_fsize.c \
+	elf32_getehdr.c \
+	elf32_getphdr.c \
+	elf32_getshdr.c \
+	elf32_newehdr.c \
+	elf32_newphdr.c \
+	elf32_offscn.c \
+	elf32_updatefile.c \
+	elf32_updatenull.c \
+	elf32_xlatetof.c \
+	elf32_xlatetom.c \
+	elf64_checksum.c \
+	elf64_fsize.c \
+	elf64_getehdr.c \
+	elf64_getphdr.c \
+	elf64_getshdr.c \
+	elf64_newehdr.c \
+	elf64_newphdr.c \
+	elf64_offscn.c \
+	elf64_updatefile.c \
+	elf64_updatenull.c \
+	elf64_xlatetof.c \
+	elf64_xlatetom.c \
+	elf_begin.c \
+	elf_clone.c \
+	elf_cntl.c \
+	elf_end.c \
+	elf_error.c \
+	elf_fill.c \
+	elf_flagdata.c \
+	elf_flagehdr.c \
+	elf_flagelf.c \
+	elf_flagphdr.c \
+	elf_flagscn.c \
+	elf_flagshdr.c \
+	elf_getarhdr.c \
+	elf_getaroff.c \
+	elf_getarsym.c \
+	elf_getbase.c \
+	elf_getdata.c \
+	elf_getdata_rawchunk.c \
+	elf_getident.c \
+	elf_getphdrnum.c \
+	elf_getscn.c \
+	elf_getshdrnum.c \
+	elf_getshdrstrndx.c \
+	elf_gnu_hash.c \
+	elf_hash.c \
+	elf_kind.c \
+	elf_memory.c \
+	elf_ndxscn.c \
+	elf_newdata.c \
+	elf_newscn.c \
+	elf_next.c \
+	elf_nextscn.c \
+	elf_rand.c \
+	elf_rawdata.c \
+	elf_rawfile.c \
+	elf_readall.c \
+	elf_scnshndx.c \
+	elf_strptr.c \
+	elf_update.c \
+	elf_version.c \
+	gelf_checksum.c \
+	gelf_fsize.c \
+	gelf_getauxv.c \
+	gelf_getclass.c \
+	gelf_getdyn.c \
+	gelf_getehdr.c \
+	gelf_getlib.c \
+	gelf_getmove.c \
+	gelf_getnote.c \
+	gelf_getphdr.c \
+	gelf_getrela.c \
+	gelf_getrel.c \
+	gelf_getshdr.c \
+	gelf_getsym.c \
+	gelf_getsyminfo.c \
+	gelf_getsymshndx.c \
+	gelf_getverdaux.c \
+	gelf_getverdef.c \
+	gelf_getvernaux.c \
+	gelf_getverneed.c \
+	gelf_getversym.c \
+	gelf_newehdr.c \
+	gelf_newphdr.c \
+	gelf_offscn.c \
+	gelf_update_auxv.c \
+	gelf_update_dyn.c \
+	gelf_update_ehdr.c \
+	gelf_update_lib.c \
+	gelf_update_move.c \
+	gelf_update_phdr.c \
+	gelf_update_rela.c \
+	gelf_update_rel.c \
+	gelf_update_shdr.c \
+	gelf_update_sym.c \
+	gelf_update_syminfo.c \
+	gelf_update_symshndx.c \
+	gelf_update_verdaux.c \
+	gelf_update_verdef.c \
+	gelf_update_vernaux.c \
+	gelf_update_verneed.c \
+	gelf_update_versym.c \
+	gelf_xlate.c \
+	gelf_xlatetof.c \
+	gelf_xlatetom.c \
+	libelf_crc32.c \
+	libelf_next_prime.c \
+	nlist.c
+
+ifeq ($(HOST_OS),linux)
+
+#
+# host libelf
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(LIBELF_SRC_FILES)
+
+LOCAL_C_INCLUDES := \
+	$(LOCAL_PATH)/.. \
+	$(LOCAL_PATH)/../lib \
+
+LOCAL_CFLAGS += -DHAVE_CONFIG_H -std=gnu99 -D_GNU_SOURCE
+
+# to suppress the "pointer of type ‘void *’ used in arithmetic" warning
+LOCAL_CFLAGS += -Wno-pointer-arith
+
+LOCAL_MODULE := libelf
+
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
+
+include $(BUILD_HOST_STATIC_LIBRARY)
+
+endif # linux
+
+#
+# target libelf
+#
+
+include $(CLEAR_VARS)
+
+# b/25642296, local __thread variable does not work with arm64 clang/llvm.
+LOCAL_CLANG_arm64 := false
+
+LOCAL_SRC_FILES := $(LIBELF_SRC_FILES)
+
+LOCAL_C_INCLUDES := \
+	$(LOCAL_PATH)/.. \
+	$(LOCAL_PATH)/../lib \
+
+LOCAL_C_INCLUDES += $(LOCAL_PATH)/../bionic-fixup
+
+LOCAL_CFLAGS += -DHAVE_CONFIG_H -std=gnu99 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
+
+# to suppress the "pointer of type ‘void *’ used in arithmetic" warning
+LOCAL_CFLAGS += -Wno-pointer-arith
+
+LOCAL_CFLAGS += -include $(LOCAL_PATH)/../bionic-fixup/AndroidFixup.h
+
+LOCAL_MODULE := libelf
+
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/version.h b/version.h
new file mode 100644
index 0000000..67f6759
--- /dev/null
+++ b/version.h
@@ -0,0 +1,38 @@
+/* Version information about elfutils development libraries.
+   Copyright (C) 2008 Red Hat, Inc.
+
+   This file is part of elfutils.
+
+   This file is free software; you can redistribute it and/or modify
+   it under the terms of either
+
+     * 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 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/>.  */
+
+#ifndef _ELFUTILS_VERSION_H
+#define _ELFUTILS_VERSION_H	1
+
+#define _ELFUTILS_VERSION	164
+
+#define _ELFUTILS_PREREQ(major, minor) \
+  (_ELFUTILS_VERSION >= ((major) * 1000 + (minor)))
+
+#endif	/* elfutils/version.h */