mirror of
https://github.com/autc04/Retro68.git
synced 2025-02-16 19:32:07 +00:00
remove elfutils directory
This commit is contained in:
parent
c70816ace7
commit
16b6ab7a7a
1068
elfutils/ABOUT-NLS
1068
elfutils/ABOUT-NLS
File diff suppressed because it is too large
Load Diff
@ -1,4 +0,0 @@
|
||||
For Now:
|
||||
Ulrich Drepper.
|
||||
Roland McGrath
|
||||
Petr Machata
|
@ -1,106 +0,0 @@
|
||||
The project home is http://elfutils.org/
|
||||
|
||||
The current elfutils source code can be checked out with
|
||||
git clone git://sourceware.org/git/elfutils.git
|
||||
|
||||
The developer mailinglist to send patches to is
|
||||
elfutils-devel@sourceware.org.
|
||||
https://sourceware.org/ml/elfutils-devel/
|
||||
|
||||
To subscribe send an email to elfutils-devel-subscribe@sourceware.org
|
||||
Or use the form at https://sourceware.org/lists.html#ml-requestor
|
||||
|
||||
Please supply patches using git format-patch or using git send-email.
|
||||
|
||||
Sign your work
|
||||
|
||||
To facilitate tracking of who did what, we've adopted a "sign-off"
|
||||
procedure for patches based on the procedure used by the Linux kernel
|
||||
project.
|
||||
|
||||
The sign-off is a simple line at the end of the explanation for the
|
||||
patch, which certifies that you wrote it or otherwise have the right
|
||||
to pass it on as a patch under an appropriate license. The rules are
|
||||
pretty simple: if you can certify the below:
|
||||
|
||||
Developer's Certificate of Origin
|
||||
|
||||
By making a contribution to this project, I certify that:
|
||||
|
||||
(a) The contribution was created in whole or in part by me,
|
||||
and I have the right to submit the contribution under each
|
||||
license indicated in, or otherwise designated as being
|
||||
applicable to, the file.
|
||||
|
||||
(b) The contribution was provided directly to me by some other
|
||||
person who certified (a), and I have not modified it.
|
||||
|
||||
(c) I understand and agree that the project and the
|
||||
contribution are public and that a record of the
|
||||
contribution (including all personal information I submit
|
||||
with it, including my sign-off) is maintained indefinitely
|
||||
and may be redistributed.
|
||||
|
||||
then you just add a line saying
|
||||
|
||||
Signed-off-by: Random J Developer <random@developer.example.org>
|
||||
|
||||
using your real name (sorry, no pseudonyms or anonymous contributions.)
|
||||
|
||||
git commit --signoff will add such a Signed-off-by line at the end of
|
||||
the commit log message for you.
|
||||
|
||||
The ideal patch contains a ChangeLog entry and a test case for the
|
||||
bug fixed or feature added.
|
||||
|
||||
The testsuite (make check) is expected to have zero failing tests.
|
||||
Do not knowingly add tests that FAIL. If there are architectures or
|
||||
configurations where a tests is not supported make sure they are
|
||||
skipped instead of failing. Adding "exit 77" in the test shell wrapper
|
||||
indicates that a test was SKIPPED.
|
||||
|
||||
We do allow binaries in the testsuite for tests that only need to
|
||||
read ELF or DWARF data and if generating the data in the testcase
|
||||
itself is difficult or would be architecture specific.
|
||||
The binaries should be bzip2 compressed. Add a note in the test
|
||||
wrapper run-<testcase>.sh script how to regenerate the binary.
|
||||
|
||||
After sending your patch to the mailinglist one of the committers
|
||||
to the project will review it, give feedback, and if perfect they
|
||||
will commit it for you.
|
||||
|
||||
You can become a maintainer/committer yourself after you have provided
|
||||
at least a handful of accepted patches and agree to the guidelines in
|
||||
this document for creating, reviewing, accepting and committing patches.
|
||||
|
||||
To become a committer you need a sourceware account:
|
||||
https://sourceware.org/cgi-bin/pdw/ps_form.cgi
|
||||
Upload a SSH public key and have an existing maintainer sponsor you
|
||||
for the elfutils group.
|
||||
|
||||
committers can push patches through:
|
||||
ssh://<user>@sourceware.org/git/elfutils.git
|
||||
|
||||
The current webpages published at https://sourceware.org/elfutils/
|
||||
can be checked out with:
|
||||
git clone ssh://<user>@sourceware.org/git/elfutils-htdocs.git
|
||||
Patches should also be posted to the mailinglist.
|
||||
|
||||
As a maintainer/committer you should still post patches as described
|
||||
above. And ideally they are reviewed and approved as above. If no
|
||||
other committer has reviewed or objected to your patch for a week
|
||||
you may use your own judgement whether you ping your patch or push
|
||||
it after "self-review". If you do, you should post a message to the
|
||||
mailinglist that the patch has been pushed.
|
||||
|
||||
committers may also create git branches starting with <nickname>/...
|
||||
patches on these branches are works in progress, so might not be perfect
|
||||
yet, but should follow the above guidelines as much as possible and should
|
||||
be aimed at integration into master. For merging a branch into master
|
||||
the same process as above should be followed by posting the patches
|
||||
to the list first.
|
||||
|
||||
committers/maintainers who repeatedly ignore the above guidelines,
|
||||
are hostile or offensive towards other committers or contributors,
|
||||
and don't correct their behavior after being asked by other committers
|
||||
will be removed as maintainer/committer.
|
@ -1,715 +0,0 @@
|
||||
2017-08-02 Mark Wielaard <mark@klomp.org>
|
||||
|
||||
* configure.ac: Set version to 0.170.
|
||||
* NEWS: Mention new libdw dwarf_line_file function.
|
||||
|
||||
2017-07-26 Mark Wielaard <mark@klomp.org>
|
||||
|
||||
* NEWS: Mention dwarf_getmacros handling version 5 .debug_macro.
|
||||
|
||||
2017-07-26 Mark Wielaard <mark@klomp.org>
|
||||
|
||||
* NEWS: Mention dwarf_peel_type DWARF5 tags improvement.
|
||||
|
||||
2017-07-26 Mark Wielaard <mark@klomp.org>
|
||||
|
||||
* NEWS: Mention new DWARF5 calling conventions and defaulted member
|
||||
function.
|
||||
|
||||
2017-07-26 Mark Wielaard <mark@klomp.org>
|
||||
|
||||
* NEWS: Mention new dwarf_default_lower_bound function.
|
||||
|
||||
2017-07-25 Mark Wielaard <mark@klomp.org>
|
||||
|
||||
* NEWS: Mention new DWARF5 attributes, tags, character encodings
|
||||
and language codes in dwarf.h.
|
||||
|
||||
2017-07-18 Mark Wielaard <mark@klomp.org>
|
||||
|
||||
* configure.ac: Don't check for linux/bpf.h.
|
||||
* NEWS: Mention always build bpf backend.
|
||||
|
||||
2017-07-14 Mark Wielaard <mark@klomp.org>
|
||||
|
||||
* NEWS: Add 0.170 section and new strip options.
|
||||
|
||||
2017-05-05 Mark Wielaard <mark@klomp.org>
|
||||
|
||||
* configure.ac: Set version to 0.169. Update copyright year.
|
||||
* NEWS: Add 0.169 section.
|
||||
|
||||
2017-04-21 Ulf Hermann <ulf.hermann@qt.io>
|
||||
|
||||
* .gitignore: Add fillfile and peel_type tests.
|
||||
|
||||
2017-02-15 Ulf Hermann <ulf.hermann@qt.io>
|
||||
|
||||
* configure.ac: Add check for mempcpy.
|
||||
|
||||
2017-02-09 Mark Wielaard <mark@klomp.org>
|
||||
|
||||
* configure.ac: Add check for adding -D_FORTIFY_SOURCE=2 to CFLAGS.
|
||||
|
||||
2017-01-12 Mark Wielaard <mark@klomp.org>
|
||||
|
||||
* configure.ac: Define PACKAGE_URL for older autoconf.
|
||||
|
||||
2016-12-27 Mark Wielaard <mark@klomp.org>
|
||||
|
||||
* configure.ac: Set version to 0.168.
|
||||
* NEWS: Add 0.168 updates.
|
||||
|
||||
2016-12-24 Mark Wielaard <mark@klomp.org>
|
||||
|
||||
* README: Move design notes to NOTES. Add URLs for home, releases,
|
||||
bugs, git and mailinglist now on sourceware.
|
||||
* NOTES: Add notes from README.
|
||||
* CONTRIBUTING: Change fedorahosted.org references to new
|
||||
sourceware.org locations.
|
||||
* configure.ac (AC_INIT): Add package URL http://elfutils.org/
|
||||
change bug-report to https://sourceware.org/bugzilla/
|
||||
(AC_COPYRIGHT): Set to the elfutils developers.
|
||||
|
||||
2016-11-23 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Add test for bad fts.h. Add -DBAD_FTS=1 to CFLAGS
|
||||
if necessary.
|
||||
|
||||
2016-11-02 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Add check for whether gcc accepts
|
||||
-Wimplict-fallthrough.
|
||||
|
||||
2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
|
||||
|
||||
* configure.ac: Add memrchr, rawmemchr and powerof2 checks.
|
||||
|
||||
2016-08-04 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Set version to 0.167.
|
||||
* NEWS: Add 0.167 section.
|
||||
|
||||
2016-07-06 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* .gitignore: Remove src/ld. ldlex.c, ldscript.c and ldscript.h.
|
||||
* configure.ac (enable generic): Removed.
|
||||
|
||||
2016-06-28 Richard Henderson <rth@redhat.com>
|
||||
|
||||
* configure.ac (HAVE_LINUX_BPF_H): New test and conditional.
|
||||
|
||||
2016-06-10 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* CONTRIBUTING: Extend patch, committer and maintainer guidelines.
|
||||
|
||||
2016-05-02 Filipe Brandenburger <filbranden@google.com>
|
||||
|
||||
* configure.ac (argp check): Pass pass &argv.
|
||||
* configure.ac (-W<...> checks): Pass -Werror to the warning checks,
|
||||
to ensure unsupported warning options are noticed during ./configure
|
||||
time and not only later during build.
|
||||
|
||||
2016-03-31 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Set version to 0.166.
|
||||
|
||||
2016-03-02 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Set program_prefix to eu- by default.
|
||||
* NEWS (0.166): New sections, document --program-prefix default.
|
||||
|
||||
2016-02-13 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Add check for whether gcc accepts -Wnull-dereference.
|
||||
|
||||
2016-02-08 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Add checks for sane -Wlogical-op and whether gcc
|
||||
accepts -Wduplicated-cond.
|
||||
|
||||
2016-01-08 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Set version to 0.165.
|
||||
* NEWS: Add 0.164 section.
|
||||
|
||||
2016-01-04 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Add BZ2_LIBS and LIBLZMA substitutions.
|
||||
Add config/libelf.pc and config/libdw.pc config files.
|
||||
|
||||
2015-12-31 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* Makefile.am (AM_MAKEFLAGS): Set --no-print-directory.
|
||||
|
||||
2015-10-16 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Make zlib mandatory.
|
||||
|
||||
2015-10-15 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Set version to 0.164.
|
||||
* NEWS: Add 0.164 additions.
|
||||
|
||||
2015-10-07 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Add AM_SILENT_RULES([yes]).
|
||||
|
||||
2015-09-24 Jose E. Marchesi <jose.marchesi@oracle.com>
|
||||
|
||||
* configure.ac: Use -fPIC instead of -fpic to avoid relocation
|
||||
overflows in some platforms.
|
||||
|
||||
2015-07-11 Pino Toscano <toscano.pino@tiscali.it>
|
||||
|
||||
* .gitignore: Add more generated files, and anchor some of the
|
||||
existing ones.
|
||||
|
||||
2015-06-19 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Set version to 0.163.
|
||||
* NEWS: Mention 0.163 is bug fixes only.
|
||||
|
||||
2015-06-10 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Set version to 0.162.
|
||||
* NEWS: Add 0.162 additions.
|
||||
|
||||
2015-06-08 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac (ADD_STACK_USAGE_WARNING): New conditional based on
|
||||
gcc -Wstack-usage check.
|
||||
|
||||
2015-05-31 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac (MODVERSION): Define using LIBEBL_SUBDIR, eu_version
|
||||
and ac_cv_build.
|
||||
|
||||
2015-05-31 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac (use_undefined): Use AC_LINK_IFELSE. AC_DEFINE
|
||||
CHECK_UNDEFINED.
|
||||
|
||||
2015-05-30 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Check for bunzip2. Check flex and bison are
|
||||
installed in maintainer-mode. Otherwise check libdw/known-dwarf.h
|
||||
is already generated.
|
||||
|
||||
2015-05-21 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Add --enable-sanitize-undefined.
|
||||
* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Rename to...
|
||||
(AM_DISTCHECK_CONFIGURE_FLAGS): this. Add --enable-sanitize-undefined.
|
||||
|
||||
2015-05-04 Anthony G. Basile <blueness@gentoo.org>
|
||||
|
||||
* configure.ac (argp_LDADD): Check if libc has argp and set
|
||||
argp_LDADD accordingly.
|
||||
|
||||
2015-05-03 Max Filippov <jcmvbkbc@gmail.com>
|
||||
|
||||
* configure.ac (DEMANGLE): Fix enable_demangler setting.
|
||||
|
||||
2015-05-01 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac (DEMANGLE): Explicitly set enable_demangler.
|
||||
|
||||
2015-05-01 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac (debugpred): Use and set use_debugpred_val.
|
||||
(textrelcheck): Explicitly set enable_textrelcheck to yes or no.
|
||||
(symbol-versioning): Likewise for enable_symbol_versioning.
|
||||
AC_MSG_NOTICE overview of enabled/disabled features.
|
||||
|
||||
2015-04-23 Max Filippov <jcmvbkbc@gmail.com>
|
||||
|
||||
* configure.ac: Add --disable-symbol-versioning.
|
||||
|
||||
2015-04-14 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac (ac_cv_c99): Add explicit checks for all GNU99
|
||||
extensions used.
|
||||
|
||||
2015-03-13 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac (ac_cv_c99): Add explicit return.
|
||||
(ac_cv_tls): Add stdlib.h include.
|
||||
|
||||
2014-12-18 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Set version to 0.161.
|
||||
* NEWS: Add dwarf.h additions.
|
||||
|
||||
2014-12-15 Josh Stone <jistone@redhat.com>
|
||||
|
||||
* .gitignore: Add config/compile as installed by automake 1.14.
|
||||
|
||||
2014-11-27 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Add --disable-textrelcheck.
|
||||
|
||||
2014-10-06 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* NEWS: New section 0.161. Add dwarf_peel_type.
|
||||
|
||||
2014-08-25 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Set version to 0.160.
|
||||
* NEWS: Add removal of DW_TAG_mutable_type, LZMA .ko.xz kernel
|
||||
module support, ARM THUMB functions and ppc64le ELFv2 abi backends.
|
||||
|
||||
2014-08-15 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* NEWS: Add dwarf_cu_die.
|
||||
|
||||
2014-08-15 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* NEWS: Add dwarf_cu_getdwarf.
|
||||
|
||||
2014-07-18 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac (AC_CHECK_TYPE): Test for struct user_regs_struct.
|
||||
|
||||
2014-05-26 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* NEWS: New section 0.160. Add unstrip --force.
|
||||
|
||||
2014-05-17 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Set version to 0.159.
|
||||
* NEWS: Add entries for version 0.159.
|
||||
|
||||
2014-05-02 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* NEWS: Add note about dwz support no longer being experimental and
|
||||
new helper functions.
|
||||
* configure.ac: Remove --enable-dwz.
|
||||
* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Remove --enable-dwz.
|
||||
|
||||
2014-04-11 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* Makefile.am (SUBDIRS): Add libdwelf.
|
||||
* configure.ac (AC_CONFIG_FILES): Add libdwelf/Makefile.
|
||||
* NEWS: Add note about libdwelf.
|
||||
|
||||
2014-04-13 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Remove mudflap enable arg and MUDFLAP conditional.
|
||||
|
||||
2014-01-21 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* NEWS (Version 0.159): Add stack -i.
|
||||
|
||||
2014-01-20 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* NEWS (Version 0.159): New. Add stack -d.
|
||||
|
||||
2014-01-03 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Set version to 0.158.
|
||||
* NEWS: Add entries for version 0.158.
|
||||
|
||||
2013-12-20 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* NEWS (libdwfl): Add dwfl_getthread_frames.
|
||||
(stack): New entry.
|
||||
|
||||
2013-12-18 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* NEWS (libdwfl): Add dwfl_module_getsym_info and
|
||||
dwfl_module_addrinfo.
|
||||
(addr2line): Add -x option.
|
||||
|
||||
2013-12-17 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* NEWS (Version 0.158) (libdwfl): Added Dwfl_Thread_Callbacks,
|
||||
Dwfl_Thread, Dwfl_Frame, dwfl_attach_state, dwfl_pid, dwfl_thread_dwfl,
|
||||
dwfl_thread_tid, dwfl_frame_thread, dwfl_thread_state_registers,
|
||||
dwfl_thread_state_register_pc, dwfl_getthreads, dwfl_thread_getframes
|
||||
and dwfl_frame_pc.
|
||||
|
||||
2013-12-16 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* NEWS (libdwfl): Add dwfl_module_getsymtab_first_global.
|
||||
|
||||
2013-12-09 Josh Stone <jistone@redhat.com>
|
||||
|
||||
* .gitignore: Add config/ar-lib, installed due to AM_PROG_AR.
|
||||
|
||||
2013-12-02 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* configure.ac (CC_BIARCH): Remove AS_IF for it.
|
||||
|
||||
2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* configure.ac: New AC_CHECK_SIZEOF for long. Call utrace_BIARCH, new
|
||||
AC_SUBST for CC_BIARCH.
|
||||
|
||||
2013-11-06 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac (--enable-dwz): Add AC_MSG_WARN when disabled but
|
||||
local system does have /usr/lib/debug/.dwz.
|
||||
|
||||
2013-11-06 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac (--enable-thread-safety): Add AC_MSG_WARN experimental
|
||||
option.
|
||||
|
||||
2013-11-01 Michael Forney <mforney@mforney.org>
|
||||
|
||||
* configure.ac: Call AM_PROG_AR and AC_CHECK_TOOL for readelf and nm.
|
||||
|
||||
2013-10-30 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* NEWS (Version 0.158): New.
|
||||
|
||||
2013-09-30 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* NEWS: Update for readelf NT_SIGINFO and NT_FILE core notes.
|
||||
|
||||
2013-09-27 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Set version to 0.157.
|
||||
* NEWS: Add entries for version 0.157.
|
||||
|
||||
2013-09-20 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Add --enable-dwz.
|
||||
|
||||
2013-07-25 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* configure.ac: Set version to 0.156.
|
||||
|
||||
2013-07-19 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* NEWS: Remove bugfix only entries from Version 0.156.
|
||||
|
||||
2013-07-18 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* NEWS: Add entries for Version 0.156.
|
||||
|
||||
2013-04-28 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* NEWS (Version 0.156): New.
|
||||
|
||||
2013-04-26 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac (AM_INIT_AUTOMAKE): Request parallel-tests.
|
||||
|
||||
2013-04-25 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* .gitignore: Add config/test-driver as installed by automake 1.13.
|
||||
* configure.ac (AM_INIT_AUTOMAKE): Require at least automake 1.11.
|
||||
|
||||
2012-10-01 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Add --enable-valgrind check.
|
||||
* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Add --enable-valgrind.
|
||||
|
||||
2012-08-27 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Set version to 0.155.
|
||||
|
||||
2012-08-24 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Add --enable-dwz check, defaults to no.
|
||||
|
||||
2012-07-24 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* TODO: Add note on shdrs after elf_cntl (ELF_C_FDREAD).
|
||||
|
||||
2012-06-22 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Set version to 0.154.
|
||||
|
||||
2012-01-24 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* COPYING: Fix address. Updated version from gnulib.
|
||||
|
||||
2012-01-23 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* configure.ac: Set version to 0.153, update copyright years.
|
||||
|
||||
2012-01-20 Roland McGrath <roland@hack.frob.com>
|
||||
|
||||
* configure.ac: Handle --enable-deterministic-archives.
|
||||
|
||||
2011-10-08 Roland McGrath <roland@hack.frob.com>
|
||||
|
||||
* configure.ac (eu_version): Use sed instead of ${x/y/z} syntax.
|
||||
Use POSIX.2 $((...)) syntax instead of $[...].
|
||||
Reported by Mike Frysinger <vapier@gentoo.org>.
|
||||
|
||||
2011-10-08 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* configure.ac: Fix use of AC_ARG_ENABLE to handle $enableval correctly.
|
||||
|
||||
2011-10-02 Ulrich Drepper <drepper@gmail.com>
|
||||
|
||||
* configure.ac: Check for __cxa_demangle in libstdc++.
|
||||
|
||||
2011-02-08 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* configure.ac (C99 check): Use AC_LANG_SOURCE.
|
||||
|
||||
* configure.ac (ALL_LINGUAS): Remove variable, now obsolete.
|
||||
|
||||
2010-09-13 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac (ALL_LINGUAS): Add languages which have some
|
||||
translations.
|
||||
|
||||
2010-04-15 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* configure.ac (LOCALEDIR, DATADIRNAME): Removed.
|
||||
|
||||
2009-09-21 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac: Update for more modern autoconf.
|
||||
|
||||
2009-08-26 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* configure.ac (zip_LIBS): Check for liblzma too.
|
||||
|
||||
2009-04-19 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* configure.ac (eu_version): Round down here, not in version.h macros.
|
||||
|
||||
2009-04-17 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* configure.ac (eu_version): Compute number 1000 times larger,
|
||||
let $PACKAGE_VERSION be x.y.z as well as x.y (implied x.y.0).
|
||||
|
||||
2009-01-23 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3.
|
||||
|
||||
* configure.ac (__thread check): Use AC_LINK_IFELSE, in case of
|
||||
building with compiler support but no working runtime support.
|
||||
|
||||
2009-01-22 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* Makefile.am (rpm): The tarball is now bzip2-compressed.
|
||||
|
||||
2009-01-10 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac: Require gcc with TLS support.
|
||||
Rename USE_TLS to USE_LOCKS. The option is renamed to
|
||||
--enable-thread-safety.
|
||||
|
||||
2009-01-08 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* configure.ac (eu_ZIPLIB): Moved to m4/zip.am.
|
||||
|
||||
2009-01-05 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* configure.ac (eu_ZIPLIB): New macro.
|
||||
Use it to test for -lz, -lbz2, set .am ZLIB, BZLIB, zip_LIBS.
|
||||
|
||||
2008-12-30 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac: We need automake 1.8 now.
|
||||
|
||||
2008-12-24 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* configure.ac: Use automake flags dist-bzip2 no-dist-gzip,
|
||||
distribute only in .tar.bz2 form now.
|
||||
|
||||
2008-12-16 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* Makefile.am (pkginclude_HEADERS): New variable, install version.h.
|
||||
* configure.ac: Create it, substituting @eu_version@ with
|
||||
PACKAGE_VERSION canonicalized to four digits of decimal.
|
||||
|
||||
2008-08-25 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* configure.ac (--enable-tls): Set AM_CONDITIONAL USE_TLS too.
|
||||
|
||||
2008-08-21 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* configure.ac (AH_BOTTOM): Emit #include <eu-config.h> and
|
||||
move the contents to lib/eu-config.h instead of keeping them here.
|
||||
|
||||
2007-12-20 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac: Add support for --enable-debugpred.
|
||||
Update likely/unlikely macros for it.
|
||||
|
||||
2007-06-05 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* Makefile.am: Remove traces of mini builds.
|
||||
* configure.ac: Don't use libelf-po/POTFILES.in as config file
|
||||
anymore.
|
||||
|
||||
2007-05-16 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* configure.ac (AM_INIT_AUTOMAKE): Use -Wno-portability.
|
||||
|
||||
2006-11-02 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Add EXCEPTION file.
|
||||
|
||||
2006-08-29 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* configure.ac: Use AM_MAINTAINER_MODE.
|
||||
|
||||
2006-07-12 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac (internal_function): Don't use internal visibility.
|
||||
|
||||
2006-07-05 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac: Add dummy automake conditional to get dependencies
|
||||
for non-generic linker right. See src/Makefile.am.
|
||||
|
||||
2005-11-18 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
|
||||
|
||||
2005-11-16 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* configure.ac: Define HAVE_LIBASM and STANDALONE conditionals.
|
||||
In config.h, define ELFUTILS_HEADER macro.
|
||||
|
||||
2005-11-15 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* Makefile.am (all_SUBDIRS): Add backends.
|
||||
* configure.ac: Write backends/Makefile.
|
||||
|
||||
* configure.ac: Add --enable-tests-rpath option.
|
||||
|
||||
2005-09-16 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* configure.ac (ALLOW_UNALIGNED) [__ia64__ || __alpha__]:
|
||||
Don't set it, since on IA64 you get error messages for unaligned
|
||||
accesses, and on Alpha it's at least very slow.
|
||||
|
||||
2005-08-29 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac: Fix GCOV make condition generation.
|
||||
|
||||
2005-08-28 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac: Add --enable-gcov option.
|
||||
|
||||
2005-08-06 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac: Add --enable-gprof option.
|
||||
|
||||
2005-07-27 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* Makefile.am (all_SUBDIRS): Put libdwfl before libdw.
|
||||
|
||||
2005-07-21 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* configure.ac: Take --enable-libebl-subdir=DIR to set LIBEBL_SUBDIR.
|
||||
|
||||
2005-06-01 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* Makefile.am (all_SUBDIRS): Add libdwfl.
|
||||
* configure.ac: Write libdwfl/Makefile.
|
||||
|
||||
2005-05-19 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
|
||||
|
||||
2005-05-10 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac: Define MODVERSION in config.h.
|
||||
|
||||
2005-02-22 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* Makefile.am (all_SUBDIRS): Don't add doc subdir for now.
|
||||
* configure.ac: Don't use doc subdir for now.
|
||||
|
||||
2005-02-15 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac: Remove AM_GNU_GETTEXT use. Use only AM_PO_SUBDIRS.
|
||||
|
||||
2005-02-06 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac (AM_INIT_AUTOMAKE): Removed dist-bzip2.
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Remove splint.rc.
|
||||
* splint.rc: Removed.
|
||||
|
||||
2004-09-25 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac: Make compile with gcc 4.0.
|
||||
|
||||
2004-03-06 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac: Use AS_HELP_STRING where applicable.
|
||||
|
||||
2004-01-23 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac: Check for C99 compiler.
|
||||
|
||||
* configure.ac: Change locking macros in config.h to at least
|
||||
evaluate the parameter. Define base_cpu to none for generic linker.
|
||||
|
||||
2004-01-21 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac: Print error message in case --disable-generic is
|
||||
used if no linker support for the architecture is available.
|
||||
|
||||
2004-01-18 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac: Dont generate libebl-po/Makefile.in,
|
||||
libdw-po/Makefile.in, libasm-po/Makefile.in.
|
||||
|
||||
* Makefile.am (all_SUBDIRS): Remove libebl-po, libdw-po, libasm-po.
|
||||
|
||||
2004-01-17 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac: Pretty printing of help message.
|
||||
|
||||
* configure.ac: Move AC_SYS_LARGEFILE test to the front.
|
||||
|
||||
* configure.ac: Add --enable-mudflap option.
|
||||
|
||||
2004-01-17 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac: Major cleanups. Use aux dir.
|
||||
* config.guess: Moved to new config subdir.
|
||||
* config.rpath: Likewise.
|
||||
* config.sub: Likewise.
|
||||
* depcomp: Likewise.
|
||||
* install-sh: Likewise.
|
||||
* missing: Likewise.
|
||||
* mkinstalldirs: Likewise.
|
||||
* Makefile.am (mini_SUBDIRS): Add config.
|
||||
(EXTRA_DIST): Remove config.rpath.
|
||||
|
||||
* configure.ac: Add AC_REVISION.
|
||||
|
||||
* configure.ac: Add --enable-mudflap option.
|
||||
|
||||
2004-01-11 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* configure.ac: Drop libdwarf directory. Add libdw-po.
|
||||
* Makefile.am (all_SUBDIRS): Likewise.
|
||||
* elfutils.spec: Don't distribute anything from libdwarf.
|
||||
|
||||
2004-01-05 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* Makefile.am: Support separate libelf built.
|
||||
|
||||
* elfutils.spec.in: Create separata elfutils-libelf-devel package.
|
||||
Install libdw DSOs.
|
||||
|
||||
* configure.ac (AC_CONFIG_SRCDIR): Use libelf/libelf.h as the file
|
||||
name.
|
||||
|
||||
2003-08-13 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* elfutils.spec.in: Remove references to libebl.so.
|
||||
|
||||
2003-08-11 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* Moved to CVS archive.
|
||||
|
||||
2000-08-25 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* The beginning. See the NEWS file for the time being.
|
@ -1,33 +0,0 @@
|
||||
Public key for drepper@redhat.com
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v1.2.1 (GNU/Linux)
|
||||
|
||||
mQGiBDuFth0RBACPcHEkyqJE26wTXuuuCxpqJjxlBnNFkJGkWUoeu89QjzWgzXy/
|
||||
EA8+ptNBgCTPKnLEqhkRUyxAT/Uz+t+xbKqUtL54IzYfxO4NQsN/VVM0uppNfIJb
|
||||
MWvAjvpp2HCkd/32i693rlH+G9dvG8K57by3PBRHBgH2L8Q7t/QvA2AWpwCgzokX
|
||||
DDUiitysGn4rWO0rBBoR6OED/3ehpcHtbGixNoubRZAxpw99VTKs/I76OkrQzqcm
|
||||
+w+zwZeihJXC88yAHA77/LBB3YKaX3G4CmDQUbeRJ9zPlETTLmRMcF61dQdq/3qV
|
||||
Biq1sm6ctZ4uEpm8HnysKMT+VY4Xmj9LLzF2BdING9frcX9rk8Vk25iCLBronS0M
|
||||
IU3WA/sEvlUFlfbyCBRBoq+Rlr9u05fnHc7CLMKI7EIS1T1dLPxH1ivuUhyYNGAM
|
||||
RhCivBbT2Z0t/R4ksu3VdnPGkCyAAdWNSafSGqCYUzQH0u5Z8HK6c2iXrIX3Ipk5
|
||||
DhQOQ6k1tyYzuQw3cCf7RYRJ9/iup8RlscVt2kmGnSucqpxJCbQjVWxyaWNoIERy
|
||||
ZXBwZXIgPGRyZXBwZXJAcmVkaGF0LmNvbT6IVwQTEQIAFwUCO4W2HQULBwoDBAMV
|
||||
AwIDFgIBAheAAAoJENoowjp5/0R0SqUAoL5HBbaRWR19vjldUeJvYCG2AR94AKDL
|
||||
nmVEaykaZWyyNg0OTuxLe1boa4hGBBARAgAGBQI8iQDvAAoJEFWW3Qzpv2U97wgA
|
||||
n1RVl6FbIHVVmT224nOp5b98OZVnAJ9ehXzM60RbmGi3kJNS30II+SGft4hGBBMR
|
||||
AgAGBQI9Tvt0AAoJEP3S3qzTM8uhUy0AoNqATBj2usEtJduGHukKZ9mQaycFAJ9y
|
||||
lq0MmZJwMZ3699e6rgMiHAMAVbkCDQQ7hbZPEAgAzuFAPq1sYUtpJClwX7+pdz1K
|
||||
dIgbxDKoSHh2rSRx24HLYY/xg9ps6fZF21/SBialKaB8BFnIeh8S9LXUtWt9aUeC
|
||||
klnnQwPbR0BGRcZAS7+nHZ9agiMd4CRe4RWFmS6KhIeUsDa70+8XhIm/C+Ogd7ag
|
||||
kBw7ykTb/jWHMyvcP9iY0QtmIatfVTDJUm7Rm5TtM1mDCml/gWIQJ5ezr9gv2NUG
|
||||
3kpNYwP+G9o4BLyTOHamix/0YHI/HiZSYiwq40ao0zROd/yXY6/a3mitN96AidJL
|
||||
5I5tbqnrFy6LmRvWmyOxWkJD/bF31rrO5PfVUgcVpUxbtW44PtVilhLuh+qjTwAD
|
||||
BQf+NTHwjUw1j+PZs/y5XnPw0x0ZdYGEl0I7NqtMgCxI4ZHT9jaLcLXARb3UVEuc
|
||||
1LuJ1tAA1ss1c1NLK3Lg+uZzeKMRffRYEUg0Emer8QGWr1uSOxDHcAzuRZX3PYNX
|
||||
cEGEyEm443DDnXr/4b8zYK6O+sy1Ld+SVxxp6jwtk0LyT7okgD0E1dDUzX+qxpsV
|
||||
ujbzdH4bdqocKouMNMT+BHeobNZpR4Tyz5+pwW+rw1+XZebyBUkIPXOoWPZpUTDG
|
||||
fZ+om9xfg0JOcKZIZ0X91dLQp5x99aCmzwWeWy9LFPTAf9pYky8wXzteEotE/Tkm
|
||||
DeA1caPC9IEK9BBrrS9TeubrEIhGBBgRAgAGBQI7hbZPAAoJENoowjp5/0R0Z38A
|
||||
mgM4FAquwltH0ooTdAmBMoCfKb4/AJ9ufAh4Rl9sFaCie/j8jdo02bcV1A==
|
||||
=Yeua
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
370
elfutils/INSTALL
370
elfutils/INSTALL
@ -1,370 +0,0 @@
|
||||
Installation Instructions
|
||||
*************************
|
||||
|
||||
Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved. This file is offered as-is,
|
||||
without warranty of any kind.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
Briefly, the shell command `./configure && make && make install'
|
||||
should configure, build, and install this package. The following
|
||||
more-detailed instructions are generic; see the `README' file for
|
||||
instructions specific to this package. Some packages provide this
|
||||
`INSTALL' file but do not implement all of the features documented
|
||||
below. The lack of an optional feature in a given package is not
|
||||
necessarily a bug. More recommendations for GNU packages can be found
|
||||
in *note Makefile Conventions: (standards)Makefile Conventions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, and a
|
||||
file `config.log' containing compiler output (useful mainly for
|
||||
debugging `configure').
|
||||
|
||||
It can also use an optional file (typically called `config.cache'
|
||||
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||
the results of its tests to speed up reconfiguring. Caching is
|
||||
disabled by default to prevent problems with accidental use of stale
|
||||
cache files.
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point `config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file `configure.ac' (or `configure.in') is used to create
|
||||
`configure' by a program called `autoconf'. You need `configure.ac' if
|
||||
you want to change it or regenerate `configure' using a newer version
|
||||
of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system.
|
||||
|
||||
Running `configure' might take a while. While running, it prints
|
||||
some messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package, generally using the just-built uninstalled binaries.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation. When installing into a prefix owned by root, it is
|
||||
recommended that the package be configured and built as a regular
|
||||
user, and only the `make install' phase executed with root
|
||||
privileges.
|
||||
|
||||
5. Optionally, type `make installcheck' to repeat any self-tests, but
|
||||
this time using the binaries in their final installed location.
|
||||
This target does not install anything. Running this target as a
|
||||
regular user, particularly if the prior `make install' required
|
||||
root privileges, verifies that the installation completed
|
||||
correctly.
|
||||
|
||||
6. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
7. Often, you can also type `make uninstall' to remove the installed
|
||||
files again. In practice, not all packages have tested that
|
||||
uninstallation works correctly, even though it is required by the
|
||||
GNU Coding Standards.
|
||||
|
||||
8. Some packages, particularly those that use Automake, provide `make
|
||||
distcheck', which can by used by developers to test that all other
|
||||
targets like `make install' and `make uninstall' work correctly.
|
||||
This target is generally not run by end users.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. Run `./configure --help'
|
||||
for details on some of the pertinent environment variables.
|
||||
|
||||
You can give `configure' initial values for configuration parameters
|
||||
by setting variables in the command line or in the environment. Here
|
||||
is an example:
|
||||
|
||||
./configure CC=c99 CFLAGS=-g LIBS=-lposix
|
||||
|
||||
*Note Defining Variables::, for more details.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you can use GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'. This
|
||||
is known as a "VPATH" build.
|
||||
|
||||
With a non-GNU `make', it is safer to compile the package for one
|
||||
architecture at a time in the source code directory. After you have
|
||||
installed the package for one architecture, use `make distclean' before
|
||||
reconfiguring for another architecture.
|
||||
|
||||
On MacOS X 10.5 and later systems, you can create libraries and
|
||||
executables that work on multiple system types--known as "fat" or
|
||||
"universal" binaries--by specifying multiple `-arch' options to the
|
||||
compiler but only a single `-arch' option to the preprocessor. Like
|
||||
this:
|
||||
|
||||
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
||||
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
||||
CPP="gcc -E" CXXCPP="g++ -E"
|
||||
|
||||
This is not guaranteed to produce working output in all cases, you
|
||||
may have to build one architecture at a time and combine the results
|
||||
using the `lipo' tool if you have problems.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' installs the package's commands under
|
||||
`/usr/local/bin', include files under `/usr/local/include', etc. You
|
||||
can specify an installation prefix other than `/usr/local' by giving
|
||||
`configure' the option `--prefix=PREFIX', where PREFIX must be an
|
||||
absolute file name.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
|
||||
PREFIX as the prefix for installing programs and libraries.
|
||||
Documentation and other data files still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=DIR' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them. In general, the
|
||||
default for these options is expressed in terms of `${prefix}', so that
|
||||
specifying just `--prefix' will affect all of the other directory
|
||||
specifications that were not explicitly provided.
|
||||
|
||||
The most portable way to affect installation locations is to pass the
|
||||
correct locations to `configure'; however, many packages provide one or
|
||||
both of the following shortcuts of passing variable assignments to the
|
||||
`make install' command line to change installation locations without
|
||||
having to reconfigure or recompile.
|
||||
|
||||
The first method involves providing an override variable for each
|
||||
affected directory. For example, `make install
|
||||
prefix=/alternate/directory' will choose an alternate location for all
|
||||
directory configuration variables that were expressed in terms of
|
||||
`${prefix}'. Any directories that were specified during `configure',
|
||||
but not in terms of `${prefix}', must each be overridden at install
|
||||
time for the entire installation to be relocated. The approach of
|
||||
makefile variable overrides for each directory variable is required by
|
||||
the GNU Coding Standards, and ideally causes no recompilation.
|
||||
However, some platforms have known limitations with the semantics of
|
||||
shared libraries that end up requiring recompilation when using this
|
||||
method, particularly noticeable in packages that use GNU Libtool.
|
||||
|
||||
The second method involves providing the `DESTDIR' variable. For
|
||||
example, `make install DESTDIR=/alternate/directory' will prepend
|
||||
`/alternate/directory' before all installation names. The approach of
|
||||
`DESTDIR' overrides is not required by the GNU Coding Standards, and
|
||||
does not work on platforms that have drive letters. On the other hand,
|
||||
it does better at avoiding recompilation issues, and works well even
|
||||
when some directory options were not specified in terms of `${prefix}'
|
||||
at `configure' time.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Some packages offer the ability to configure how verbose the
|
||||
execution of `make' will be. For these packages, running `./configure
|
||||
--enable-silent-rules' sets the default to minimal output, which can be
|
||||
overridden with `make V=1'; while running `./configure
|
||||
--disable-silent-rules' sets the default to verbose, which can be
|
||||
overridden with `make V=0'.
|
||||
|
||||
Particular systems
|
||||
==================
|
||||
|
||||
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
|
||||
CC is not installed, it is recommended to use the following options in
|
||||
order to use an ANSI C compiler:
|
||||
|
||||
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
|
||||
|
||||
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
|
||||
|
||||
HP-UX `make' updates targets which have the same time stamps as
|
||||
their prerequisites, which makes it generally unusable when shipped
|
||||
generated files such as `configure' are involved. Use GNU `make'
|
||||
instead.
|
||||
|
||||
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
|
||||
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
|
||||
a workaround. If GNU CC is not installed, it is therefore recommended
|
||||
to try
|
||||
|
||||
./configure CC="cc"
|
||||
|
||||
and if that doesn't work, try
|
||||
|
||||
./configure CC="cc -nodtk"
|
||||
|
||||
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
|
||||
directory contains several dysfunctional programs; working variants of
|
||||
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
|
||||
in your `PATH', put it _after_ `/usr/bin'.
|
||||
|
||||
On Haiku, software installed for all users goes in `/boot/common',
|
||||
not `/usr/local'. It is recommended to use the following options:
|
||||
|
||||
./configure --prefix=/boot/common
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' cannot figure out
|
||||
automatically, but needs to determine by the type of machine the package
|
||||
will run on. Usually, assuming the package is built to be run on the
|
||||
_same_ architectures, `configure' can figure that out, but if it prints
|
||||
a message saying it cannot guess the machine type, give it the
|
||||
`--build=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name which has the form:
|
||||
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
where SYSTEM can have one of these forms:
|
||||
|
||||
OS
|
||||
KERNEL-OS
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the machine type.
|
||||
|
||||
If you are _building_ compiler tools for cross-compiling, you should
|
||||
use the option `--target=TYPE' to select the type of system they will
|
||||
produce code for.
|
||||
|
||||
If you want to _use_ a cross compiler, that generates code for a
|
||||
platform different from the build platform, you should specify the
|
||||
"host" platform (i.e., that on which the generated programs will
|
||||
eventually be run) with `--host=TYPE'.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Defining Variables
|
||||
==================
|
||||
|
||||
Variables not defined in a site shell script can be set in the
|
||||
environment passed to `configure'. However, some packages may run
|
||||
configure again during the build, and the customized values of these
|
||||
variables may be lost. In order to avoid this problem, you should set
|
||||
them in the `configure' command line, using `VAR=value'. For example:
|
||||
|
||||
./configure CC=/usr/local2/bin/gcc
|
||||
|
||||
causes the specified `gcc' to be used as the C compiler (unless it is
|
||||
overridden in the site shell script).
|
||||
|
||||
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
|
||||
an Autoconf limitation. Until the limitation is lifted, you can use
|
||||
this workaround:
|
||||
|
||||
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||
|
||||
`configure' Invocation
|
||||
======================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--help'
|
||||
`-h'
|
||||
Print a summary of all of the options to `configure', and exit.
|
||||
|
||||
`--help=short'
|
||||
`--help=recursive'
|
||||
Print a summary of the options unique to this package's
|
||||
`configure', and exit. The `short' variant lists options used
|
||||
only in the top level, while the `recursive' variant lists options
|
||||
also present in any nested packages.
|
||||
|
||||
`--version'
|
||||
`-V'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Enable the cache: use and save the results of the tests in FILE,
|
||||
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
||||
disable caching.
|
||||
|
||||
`--config-cache'
|
||||
`-C'
|
||||
Alias for `--cache-file=config.cache'.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--prefix=DIR'
|
||||
Use DIR as the installation prefix. *note Installation Names::
|
||||
for more details, including other options available for fine-tuning
|
||||
the installation locations.
|
||||
|
||||
`--no-create'
|
||||
`-n'
|
||||
Run the configure checks, but stop before creating any output
|
||||
files.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options. Run
|
||||
`configure --help' for more details.
|
@ -1,53 +0,0 @@
|
||||
## Process this file with automake to create Makefile.in
|
||||
## Configure input file for elfutils.
|
||||
##
|
||||
## Copyright (C) 1996-2006, 2008, 2009, 2015 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 the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 3 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
# automake already tells which subdir is being entered.
|
||||
# Don't make make repeat.
|
||||
AM_MAKEFLAGS = --no-print-directory
|
||||
|
||||
pkginclude_HEADERS = version.h
|
||||
|
||||
# Add doc back when we have some real content.
|
||||
SUBDIRS = config m4 lib libelf libebl libdwelf libdwfl libdw libcpu libasm \
|
||||
backends src po tests
|
||||
|
||||
EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \
|
||||
COPYING COPYING-GPLV2 COPYING-LGPLV3
|
||||
|
||||
# Make sure the test install uses lib64 when $LIB will yield lib64.
|
||||
# Make sure the test build uses the same compiler, which on e.g. ppc64
|
||||
# determines which platform we are actually testing.
|
||||
# Run all tests under valgrind.
|
||||
AM_DISTCHECK_CONFIGURE_FLAGS = \
|
||||
--libdir=`echo $(libdir) | sed "s,^$(exec_prefix),$$dc_install_base,"`\
|
||||
--enable-valgrind --enable-sanitize-undefined \
|
||||
CC="$(CC)"
|
||||
|
||||
distcheck-hook:
|
||||
chmod -R u+w $(distdir)
|
||||
|
||||
rpm: dist
|
||||
rpmbuild -ts --sign elfutils-@PACKAGE_VERSION@.tar.bz2
|
||||
|
||||
# Tell version 3.79 and up of GNU make to not build goals in this
|
||||
# directory in parallel.
|
||||
.NOTPARALLEL:
|
@ -1,915 +0,0 @@
|
||||
# Makefile.in generated by automake 1.15 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/biarch.m4 \
|
||||
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
|
||||
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/zip.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
|
||||
$(am__configure_deps) $(pkginclude_HEADERS) $(am__DIST_COMMON)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno config.status.lineno
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES = elfutils.spec version.h
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
|
||||
ctags-recursive dvi-recursive html-recursive info-recursive \
|
||||
install-data-recursive install-dvi-recursive \
|
||||
install-exec-recursive install-html-recursive \
|
||||
install-info-recursive install-pdf-recursive \
|
||||
install-ps-recursive install-recursive installcheck-recursive \
|
||||
installdirs-recursive pdf-recursive ps-recursive \
|
||||
tags-recursive uninstall-recursive
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__installdirs = "$(DESTDIR)$(pkgincludedir)"
|
||||
HEADERS = $(pkginclude_HEADERS)
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
am__recursive_targets = \
|
||||
$(RECURSIVE_TARGETS) \
|
||||
$(RECURSIVE_CLEAN_TARGETS) \
|
||||
$(am__extra_recursive_targets)
|
||||
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
|
||||
cscope distdir dist dist-all distcheck
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
|
||||
$(LISP)config.h.in
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
CSCOPE = cscope
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||
$(top_srcdir)/config/ar-lib $(top_srcdir)/config/compile \
|
||||
$(top_srcdir)/config/config.guess \
|
||||
$(top_srcdir)/config/config.sub \
|
||||
$(top_srcdir)/config/elfutils.spec.in \
|
||||
$(top_srcdir)/config/install-sh $(top_srcdir)/config/missing \
|
||||
$(top_srcdir)/config/version.h.in ABOUT-NLS AUTHORS COPYING \
|
||||
ChangeLog INSTALL NEWS README THANKS TODO
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
if test -d "$(distdir)"; then \
|
||||
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -rf "$(distdir)" \
|
||||
|| { sleep 5 && rm -rf "$(distdir)"; }; \
|
||||
else :; fi
|
||||
am__post_remove_distdir = $(am__remove_distdir)
|
||||
am__relativize = \
|
||||
dir0=`pwd`; \
|
||||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
||||
sed_rest='s,^[^/]*/*,,'; \
|
||||
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
|
||||
sed_butlast='s,/*[^/]*$$,,'; \
|
||||
while test -n "$$dir1"; do \
|
||||
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
|
||||
if test "$$first" != "."; then \
|
||||
if test "$$first" = ".."; then \
|
||||
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
|
||||
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
|
||||
else \
|
||||
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
|
||||
if test "$$first2" = "$$first"; then \
|
||||
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
|
||||
else \
|
||||
dir2="../$$dir2"; \
|
||||
fi; \
|
||||
dir0="$$dir0"/"$$first"; \
|
||||
fi; \
|
||||
fi; \
|
||||
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
|
||||
done; \
|
||||
reldir="$$dir2"
|
||||
GZIP_ENV = --best
|
||||
DIST_ARCHIVES = $(distdir).tar.bz2
|
||||
DIST_TARGETS = dist-bzip2
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
|
||||
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BZ2_LIB = @BZ2_LIB@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CC_BIARCH = @CC_BIARCH@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEBUGPRED = @DEBUGPRED@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GMSGFMT_015 = @GMSGFMT_015@
|
||||
GREP = @GREP@
|
||||
HAVE_BISON = @HAVE_BISON@
|
||||
HAVE_BUNZIP2 = @HAVE_BUNZIP2@
|
||||
HAVE_FLEX = @HAVE_FLEX@
|
||||
HAVE_VALGRIND = @HAVE_VALGRIND@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LEX = @LEX@
|
||||
LEXLIB = @LEXLIB@
|
||||
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
|
||||
LIBEBL_SUBDIR = @LIBEBL_SUBDIR@
|
||||
LIBLZMA = @LIBLZMA@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MODVERSION = @MODVERSION@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGFMT_015 = @MSGFMT_015@
|
||||
MSGMERGE = @MSGMERGE@
|
||||
NM = @NM@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
READELF = @READELF@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
XGETTEXT_015 = @XGETTEXT_015@
|
||||
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
|
||||
YACC = @YACC@
|
||||
YFLAGS = @YFLAGS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
argp_LDADD = @argp_LDADD@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
eu_version = @eu_version@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
zip_LIBS = @zip_LIBS@
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
# automake already tells which subdir is being entered.
|
||||
# Don't make make repeat.
|
||||
AM_MAKEFLAGS = --no-print-directory
|
||||
pkginclude_HEADERS = version.h
|
||||
|
||||
# Add doc back when we have some real content.
|
||||
SUBDIRS = config m4 lib libelf libebl libdwelf libdwfl libdw libcpu libasm \
|
||||
backends src po tests
|
||||
|
||||
EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \
|
||||
COPYING COPYING-GPLV2 COPYING-LGPLV3
|
||||
|
||||
|
||||
# Make sure the test install uses lib64 when $LIB will yield lib64.
|
||||
# Make sure the test build uses the same compiler, which on e.g. ppc64
|
||||
# determines which platform we are actually testing.
|
||||
# Run all tests under valgrind.
|
||||
AM_DISTCHECK_CONFIGURE_FLAGS = \
|
||||
--libdir=`echo $(libdir) | sed "s,^$(exec_prefix),$$dc_install_base,"`\
|
||||
--enable-valgrind --enable-sanitize-undefined \
|
||||
CC="$(CC)"
|
||||
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
am--refresh: Makefile
|
||||
@:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --gnits'; \
|
||||
$(am__cd) $(srcdir) && $(AUTOMAKE) --gnits \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnits Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
$(am__cd) $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
config.h: stamp-h1
|
||||
@test -f $@ || rm -f stamp-h1
|
||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
|
||||
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status config.h
|
||||
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
elfutils.spec: $(top_builddir)/config.status $(top_srcdir)/config/elfutils.spec.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
version.h: $(top_builddir)/config.status $(top_srcdir)/config/version.h.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
install-pkgincludeHEADERS: $(pkginclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \
|
||||
$(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-pkgincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir)
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run 'make' without going through this Makefile.
|
||||
# To change the values of 'make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in 'config.status', edit 'config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run 'make');
|
||||
# (2) otherwise, pass the desired values on the 'make' command line.
|
||||
$(am__recursive_targets):
|
||||
@fail=; \
|
||||
if $(am__make_keepgoing); then \
|
||||
failcom='fail=yes'; \
|
||||
else \
|
||||
failcom='exit 1'; \
|
||||
fi; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-recursive
|
||||
TAGS: tags
|
||||
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: ctags-recursive
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscope: cscope.files
|
||||
test ! -s cscope.files \
|
||||
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
|
||||
clean-cscope:
|
||||
-rm -f cscope.files
|
||||
cscope.files: clean-cscope cscopelist
|
||||
cscopelist: cscopelist-recursive
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@case `sed 15q $(srcdir)/NEWS` in \
|
||||
*"$(VERSION)"*) : ;; \
|
||||
*) \
|
||||
echo "NEWS not updated; not releasing" 1>&2; \
|
||||
exit 1;; \
|
||||
esac
|
||||
$(am__remove_distdir)
|
||||
test -d "$(distdir)" || mkdir "$(distdir)"
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
$(am__make_dryrun) \
|
||||
|| test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
||||
$(am__relativize); \
|
||||
new_distdir=$$reldir; \
|
||||
dir1=$$subdir; dir2="$(top_distdir)"; \
|
||||
$(am__relativize); \
|
||||
new_top_distdir=$$reldir; \
|
||||
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
|
||||
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
|
||||
($(am__cd) $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$new_top_distdir" \
|
||||
distdir="$$new_distdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
am__skip_mode_fix=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-test -n "$(am__skip_mode_fix)" \
|
||||
|| find "$(distdir)" -type d ! -perm -755 \
|
||||
-exec chmod u+rwx,go+rx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r "$(distdir)"
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
|
||||
$(am__post_remove_distdir)
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-lzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-xz: distdir
|
||||
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
@echo WARNING: "Support for distribution archives compressed with" \
|
||||
"legacy program 'compress' is deprecated." >&2
|
||||
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
@echo WARNING: "Support for shar distribution archives is" \
|
||||
"deprecated." >&2
|
||||
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
|
||||
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist dist-all:
|
||||
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.lz*) \
|
||||
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
|
||||
*.tar.xz*) \
|
||||
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir)
|
||||
chmod u+w $(distdir)
|
||||
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
test -d $(distdir)/_build || exit 0; \
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \
|
||||
&& am__cwd=`pwd` \
|
||||
&& $(am__cd) $(distdir)/_build/sub \
|
||||
&& ../../configure \
|
||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
--srcdir=../.. --prefix="$$dc_install_base" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& rm -rf $(DIST_ARCHIVES) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
|
||||
&& cd "$$am__cwd" \
|
||||
|| exit 1
|
||||
$(am__post_remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
||||
distuninstallcheck:
|
||||
@test -n '$(distuninstallcheck_dir)' || { \
|
||||
echo 'ERROR: trying to run $@ with an empty' \
|
||||
'$$(distuninstallcheck_dir)' >&2; \
|
||||
exit 1; \
|
||||
}; \
|
||||
$(am__cd) '$(distuninstallcheck_dir)' || { \
|
||||
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
|
||||
exit 1; \
|
||||
}; \
|
||||
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile $(HEADERS) config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(pkgincludedir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-pkgincludeHEADERS
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-pkgincludeHEADERS
|
||||
|
||||
.MAKE: $(am__recursive_targets) all install-am install-strip
|
||||
|
||||
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
|
||||
am--refresh check check-am clean clean-cscope clean-generic \
|
||||
cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
|
||||
dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
|
||||
distcheck distclean distclean-generic distclean-hdr \
|
||||
distclean-tags distcleancheck distdir distuninstallcheck dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-pkgincludeHEADERS install-ps \
|
||||
install-ps-am install-strip installcheck installcheck-am \
|
||||
installdirs installdirs-am maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
|
||||
pdf-am ps ps-am tags tags-am uninstall uninstall-am \
|
||||
uninstall-pkgincludeHEADERS
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
distcheck-hook:
|
||||
chmod -R u+w $(distdir)
|
||||
|
||||
rpm: dist
|
||||
rpmbuild -ts --sign elfutils-@PACKAGE_VERSION@.tar.bz2
|
||||
|
||||
# Tell version 3.79 and up of GNU make to not build goals in this
|
||||
# directory in parallel.
|
||||
.NOTPARALLEL:
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
1465
elfutils/NEWS
1465
elfutils/NEWS
File diff suppressed because it is too large
Load Diff
@ -1,95 +0,0 @@
|
||||
Fundamental design decision:
|
||||
|
||||
- the sizes of external and internal types are assumed to be the same.
|
||||
This leaves byte ordering aside. While assuming this the code can be
|
||||
greatly simplified and speed increases. Since no change violating this
|
||||
assumption is in sight this is believed to be a worthwhile optimization.
|
||||
|
||||
- the ABI of the backend modules is not guaranteed. Really, no guarantee
|
||||
whatsoever. We are enforcing this in the code. The modules and their
|
||||
users must match. No third-party EBL module are supported or allowed.
|
||||
The only reason there are separate modules is to not have the code for
|
||||
all architectures in all the binaries.
|
||||
|
||||
- although the public libraries (libasm, libdw) have a stable API and are
|
||||
backwards ABI compatible they, and the elfutils tools, do depend on each
|
||||
others internals, and on internals of libelf to provide their interfaces.
|
||||
So they should always be upgraded in lockstep when packaging the tools
|
||||
and libraries separately. For one example of how to do that, see the
|
||||
config/elfutils.spec.
|
||||
|
||||
Some notes:
|
||||
|
||||
- old GNU ld's behavior wrt DSOs seems to be severely broken.
|
||||
|
||||
y.o reference foo()
|
||||
y1.o defines foo(), references bar()
|
||||
y2.o defines bar()
|
||||
libbar.so defines bar()
|
||||
|
||||
Running
|
||||
|
||||
gcc -o y y.o -lbar y1.o y2.o
|
||||
|
||||
uses the bar() definition from libbar.so and does not mention the definition
|
||||
in y2.o at all (no duplicate symbol message). Correct is to use the
|
||||
definition in y2.o.
|
||||
|
||||
|
||||
y.o reference foo()
|
||||
y1.o defines foo(), references bar()
|
||||
y2.o in liby2.a defines bar()
|
||||
libbar.so defines bar()
|
||||
|
||||
Running
|
||||
|
||||
gcc -o y y.o -lbar y1.o -ly3
|
||||
|
||||
has to use the definition in -lbar and not pull the definition from liby3.a.
|
||||
|
||||
|
||||
- the old linker follows DT_NEEDED entries and adds the objects referenced
|
||||
this way which define a symbol which is needed as a DT_NEEDED to the
|
||||
generated binary. This is wrong since the DT_NEEDED changes the search
|
||||
path in the object (which is breadth first).
|
||||
|
||||
|
||||
- the old linker supported extern "C++", extern "java" in version scripts.
|
||||
I believe this implementation is severly broken and needs a redesign
|
||||
(how do wildcards work with these languages*?). Therefore it is left
|
||||
out for now.
|
||||
|
||||
|
||||
- what should happen if two sections in different files with the same
|
||||
name have different types and/or the flags are different
|
||||
|
||||
|
||||
- section names in input files are mostly irrelevant. Exceptions:
|
||||
|
||||
.comment/SHT_PROGBITS in strip, ld
|
||||
|
||||
.debug \
|
||||
.line |
|
||||
.debug_srcinfo |
|
||||
.debug_sfnames |
|
||||
.debug_aranges |
|
||||
.debug_pubnames |
|
||||
.debug_info |
|
||||
.debug_abbrev |
|
||||
.debug_line |
|
||||
.debug_abbrev > DWARF sections in ld
|
||||
.debug_line |
|
||||
.debug_frame |
|
||||
.debug_str |
|
||||
.debug_loc |
|
||||
.debug_macinfo |
|
||||
.debug_weaknames |
|
||||
.debug_funcnames |
|
||||
.debug_typenames |
|
||||
.debug_varnames /
|
||||
|
||||
Sections created in output files follow the naming of special section
|
||||
from the gABI.
|
||||
|
||||
In no place is a section solely indentified by its name. Internal
|
||||
references always use the section index.
|
@ -1,6 +0,0 @@
|
||||
At least the following have submitted valuable patches:
|
||||
|
||||
Jeff Johnson building. rpm wrestling
|
||||
Alexander Larsson separate debug info
|
||||
Jakub Jelinek bug fixes, testing
|
||||
Denys Vlasenko bug fuxes
|
195
elfutils/TODO
195
elfutils/TODO
@ -1,195 +0,0 @@
|
||||
ToDo list for elfutils -*-outline-*-
|
||||
----------------------
|
||||
|
||||
Time-stamp: <2009-02-05 22:08:01 drepper>
|
||||
|
||||
* mkinstalldirs
|
||||
|
||||
Remove everywhere. Use mkdir -p.
|
||||
|
||||
* libelf:
|
||||
|
||||
** verify section
|
||||
|
||||
Currently the elf_update function trusts the user blindly if the
|
||||
ELF_F_LAYOUT flag is set. This is OK if the data is prepared by a
|
||||
ELF_C_NULL call but not if the user prepared the data herself
|
||||
|
||||
** break out archive handling from elf_begin
|
||||
|
||||
The handling of archives (especially of the symbol tables) must be
|
||||
broken out of elf_begin. There are several different forms of
|
||||
archives and only when having the archive handling separately this
|
||||
remains maintainable.
|
||||
|
||||
** shdrs in read-only files
|
||||
|
||||
When reading (ELF_C_READ*) then there is no need to malloc Shdr
|
||||
structure in elfXX_getshdr if file is mmaped and unaligned access
|
||||
is allowed or the structure is aligned. Use ELF_F_MALLOCED flag
|
||||
to differentiate.
|
||||
|
||||
** shdrs after elf_cntl (ELF_C_FDREAD)
|
||||
|
||||
Similar to the above. After ELF_C_FDREAD the file is completely
|
||||
in memory. See also this mailing list thread:
|
||||
https://fedorahosted.org/pipermail/elfutils-devel/2012-July/002368.html
|
||||
|
||||
* libdw
|
||||
|
||||
** More memory access checks needed
|
||||
|
||||
All accesses to the debug sections should make sure the offsets are
|
||||
valid. This is currently especially a problem with leb128 accesses.
|
||||
|
||||
** Low level macro information operations
|
||||
|
||||
in 5.11.3 are not implemented. gcc currently does not emit this
|
||||
information so I cannot test it.
|
||||
|
||||
** Rename dwarf_getabbrev
|
||||
|
||||
|
||||
* libcpu
|
||||
|
||||
** x86
|
||||
|
||||
*** Opcodes
|
||||
|
||||
crc32
|
||||
extractps
|
||||
pextrb
|
||||
pextrd/pextrq
|
||||
pextrw
|
||||
pinsrq
|
||||
popcnt 64-bit reg
|
||||
|
||||
* nm:
|
||||
|
||||
** add demangler support
|
||||
|
||||
Use demangler from libiberty.
|
||||
|
||||
** add support to read debugging symbols
|
||||
|
||||
Implement -l option for BSD and POSIX format
|
||||
|
||||
|
||||
* strip:
|
||||
|
||||
** support SHT_SYMTAB_SHNDX
|
||||
|
||||
should be removed if not needed anymore
|
||||
|
||||
* ld:
|
||||
|
||||
** sanity check .rel sh_info content
|
||||
|
||||
the sh_info of all .rel sections with the same name must point to
|
||||
sections which also have the same name
|
||||
|
||||
** use ld.so.conf
|
||||
|
||||
to locate shared libraries also use /etc/ld.so.conf
|
||||
|
||||
** handle object files for different architectures
|
||||
|
||||
ld.so is expected to ignore object files for different architectures and
|
||||
continue looking for a matching file (e.g., ignore 32-bit binaries on
|
||||
64-bit platforms and vice versa). We probably need the same in ld.
|
||||
|
||||
** reuse after elf_end
|
||||
|
||||
Some files are closed using elf_end. They are removed from memory only
|
||||
if no reference is left (especially for archives this is a problem).
|
||||
The old mapping should be reused in that case. The problem is worse
|
||||
for files which are not mapped read-only (archives again).
|
||||
|
||||
** size for STT_SECTION entries
|
||||
|
||||
The STT_SECTION entries have zero for the size but can easily get
|
||||
the size of the section.
|
||||
|
||||
** .eh_frame_hdr
|
||||
|
||||
Not implemented at all in the moment except for recognition of the option
|
||||
itself.
|
||||
|
||||
** variables with aliases in executables
|
||||
|
||||
When linking an executable with a references against a variable in a
|
||||
DSO, create symbol table entries for all the aliases of the variable
|
||||
in the DSO and create a relocation for one of them (a non-weak
|
||||
definition)
|
||||
|
||||
* elflint
|
||||
|
||||
** additional checks
|
||||
|
||||
1st GOT entry == _DYNAMIC
|
||||
|
||||
check versioning info:
|
||||
|
||||
always BASE in verdef
|
||||
sh_size/sh_entsize matches last offset != 0
|
||||
|
||||
check whether any relocation is for a merge-able section
|
||||
|
||||
check TLS relocation depencies
|
||||
|
||||
Check content of .eh_frame_hdr, .eh_frame, .gcc_except_table
|
||||
|
||||
*** for x86
|
||||
|
||||
check that R_386_TLS_GD is followed by R_386_PLT32 for __tls_get_addr
|
||||
|
||||
** relax
|
||||
|
||||
prelink generated files
|
||||
|
||||
* elfcmp
|
||||
|
||||
** treat relocation sections special
|
||||
|
||||
Differences in the relocation sections can be ignored if all
|
||||
the same symbols with the same targets are present and the order
|
||||
of overlapping relocations doesn't change. There really never
|
||||
should be overlapping relocations but who knows.
|
||||
|
||||
* mcs
|
||||
|
||||
Sun has it. Can modify sections which are not in segments.
|
||||
|
||||
-a string
|
||||
Append string to the comment section of the ELF object
|
||||
files. If string contains embedded blanks, it must be
|
||||
enclosed in quotation marks.
|
||||
|
||||
-c Compress the contents of the comment section of the
|
||||
ELF object files. All duplicate entries are removed.
|
||||
The ordering of the remaining entries is not dis-
|
||||
turbed.
|
||||
|
||||
-d Delete the contents of the comment section from the
|
||||
ELF object files. The section header for the comment
|
||||
section is also removed.
|
||||
|
||||
-n name
|
||||
Specify the name of the comment section to access if
|
||||
other than .comment. By default, mcs deals with the
|
||||
section named .comment. This option can be used to
|
||||
specify another section. mcs can take multiple -n
|
||||
options to allow for specification of multiple sec-
|
||||
tion comments.
|
||||
|
||||
-p Print the contents of the comment section on the stan-
|
||||
dard output. Each section printed is tagged by the
|
||||
name of the file from which it was extracted, using
|
||||
the format file[member_name]: for archive files and
|
||||
file: for other files.
|
||||
|
||||
-V Print on standard error the version number of mcs.
|
||||
|
||||
Local Variables:
|
||||
eval:(hide-sublevels 3)
|
||||
End:
|
1271
elfutils/aclocal.m4
vendored
1271
elfutils/aclocal.m4
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,162 +0,0 @@
|
||||
## Process this file with automake to create Makefile.in
|
||||
##
|
||||
## Copyright (C) 2000-2010, 2013, 2014 Red Hat, Inc.
|
||||
## Copyright (C) 2012 Tilera Corporation
|
||||
## 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/>.
|
||||
include $(top_srcdir)/config/eu.am
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
|
||||
-I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
|
||||
|
||||
|
||||
modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
|
||||
tilegx m68k bpf
|
||||
libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
|
||||
libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
|
||||
libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
|
||||
libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
|
||||
libebl_m68k_pic.a libebl_bpf_pic.a
|
||||
noinst_LIBRARIES = $(libebl_pic)
|
||||
noinst_DATA = $(libebl_pic:_pic.a=.so)
|
||||
|
||||
|
||||
libelf = ../libelf/libelf.so
|
||||
libdw = ../libdw/libdw.so
|
||||
libeu = ../lib/libeu.a
|
||||
|
||||
i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c i386_cfi.c \
|
||||
i386_retval.c i386_regs.c i386_auxv.c i386_syscall.c \
|
||||
i386_initreg.c i386_unwind.c
|
||||
cpu_i386 = ../libcpu/libcpu_i386.a
|
||||
libebl_i386_pic_a_SOURCES = $(i386_SRCS)
|
||||
am_libebl_i386_pic_a_OBJECTS = $(i386_SRCS:.c=.os)
|
||||
|
||||
sh_SRCS = sh_init.c sh_symbol.c sh_corenote.c sh_regs.c sh_retval.c
|
||||
libebl_sh_pic_a_SOURCES = $(sh_SRCS)
|
||||
am_libebl_sh_pic_a_OBJECTS = $(sh_SRCS:.c=.os)
|
||||
|
||||
x86_64_SRCS = x86_64_init.c x86_64_symbol.c x86_64_corenote.c x86_64_cfi.c \
|
||||
x86_64_retval.c x86_64_regs.c i386_auxv.c x86_64_syscall.c \
|
||||
x86_64_initreg.c x86_64_unwind.c x32_corenote.c
|
||||
cpu_x86_64 = ../libcpu/libcpu_x86_64.a
|
||||
libebl_x86_64_pic_a_SOURCES = $(x86_64_SRCS)
|
||||
am_libebl_x86_64_pic_a_OBJECTS = $(x86_64_SRCS:.c=.os)
|
||||
|
||||
ia64_SRCS = ia64_init.c ia64_symbol.c ia64_regs.c ia64_retval.c
|
||||
libebl_ia64_pic_a_SOURCES = $(ia64_SRCS)
|
||||
am_libebl_ia64_pic_a_OBJECTS = $(ia64_SRCS:.c=.os)
|
||||
|
||||
alpha_SRCS = alpha_init.c alpha_symbol.c alpha_retval.c alpha_regs.c \
|
||||
alpha_corenote.c alpha_auxv.c
|
||||
libebl_alpha_pic_a_SOURCES = $(alpha_SRCS)
|
||||
am_libebl_alpha_pic_a_OBJECTS = $(alpha_SRCS:.c=.os)
|
||||
|
||||
arm_SRCS = arm_init.c arm_symbol.c arm_regs.c arm_corenote.c \
|
||||
arm_auxv.c arm_attrs.c arm_retval.c arm_cfi.c arm_initreg.c
|
||||
libebl_arm_pic_a_SOURCES = $(arm_SRCS)
|
||||
am_libebl_arm_pic_a_OBJECTS = $(arm_SRCS:.c=.os)
|
||||
|
||||
aarch64_SRCS = aarch64_init.c aarch64_regs.c aarch64_symbol.c \
|
||||
aarch64_corenote.c aarch64_retval.c aarch64_cfi.c \
|
||||
aarch64_initreg.c aarch64_unwind.c
|
||||
libebl_aarch64_pic_a_SOURCES = $(aarch64_SRCS)
|
||||
am_libebl_aarch64_pic_a_OBJECTS = $(aarch64_SRCS:.c=.os)
|
||||
|
||||
sparc_SRCS = sparc_init.c sparc_symbol.c sparc_regs.c sparc_retval.c \
|
||||
sparc_corenote.c sparc64_corenote.c sparc_auxv.c sparc_attrs.c \
|
||||
sparc_cfi.c sparc_initreg.c
|
||||
libebl_sparc_pic_a_SOURCES = $(sparc_SRCS)
|
||||
am_libebl_sparc_pic_a_OBJECTS = $(sparc_SRCS:.c=.os)
|
||||
|
||||
ppc_SRCS = ppc_init.c ppc_symbol.c ppc_retval.c ppc_regs.c \
|
||||
ppc_corenote.c ppc_auxv.c ppc_attrs.c ppc_syscall.c \
|
||||
ppc_cfi.c ppc_initreg.c
|
||||
libebl_ppc_pic_a_SOURCES = $(ppc_SRCS)
|
||||
am_libebl_ppc_pic_a_OBJECTS = $(ppc_SRCS:.c=.os)
|
||||
|
||||
ppc64_SRCS = ppc64_init.c ppc64_symbol.c ppc64_retval.c \
|
||||
ppc64_corenote.c ppc_regs.c ppc_auxv.c ppc_attrs.c ppc_syscall.c \
|
||||
ppc_cfi.c ppc_initreg.c ppc64_unwind.c ppc64_resolve_sym.c
|
||||
libebl_ppc64_pic_a_SOURCES = $(ppc64_SRCS)
|
||||
am_libebl_ppc64_pic_a_OBJECTS = $(ppc64_SRCS:.c=.os)
|
||||
|
||||
s390_SRCS = s390_init.c s390_symbol.c s390_regs.c s390_retval.c \
|
||||
s390_corenote.c s390x_corenote.c s390_cfi.c s390_initreg.c \
|
||||
s390_unwind.c
|
||||
libebl_s390_pic_a_SOURCES = $(s390_SRCS)
|
||||
am_libebl_s390_pic_a_OBJECTS = $(s390_SRCS:.c=.os)
|
||||
|
||||
tilegx_SRCS = tilegx_init.c tilegx_symbol.c tilegx_regs.c \
|
||||
tilegx_retval.c tilegx_corenote.c
|
||||
libebl_tilegx_pic_a_SOURCES = $(tilegx_SRCS)
|
||||
am_libebl_tilegx_pic_a_OBJECTS = $(tilegx_SRCS:.c=.os)
|
||||
|
||||
m68k_SRCS = m68k_init.c m68k_symbol.c m68k_regs.c \
|
||||
m68k_retval.c m68k_corenote.c
|
||||
libebl_m68k_pic_a_SOURCES = $(m68k_SRCS)
|
||||
am_libebl_m68k_pic_a_OBJECTS = $(m68k_SRCS:.c=.os)
|
||||
|
||||
bpf_SRCS = bpf_init.c bpf_regs.c
|
||||
cpu_bpf = ../libcpu/libcpu_bpf.a
|
||||
libebl_bpf_pic_a_SOURCES = $(bpf_SRCS)
|
||||
am_libebl_bpf_pic_a_OBJECTS = $(bpf_SRCS:.c=.os)
|
||||
|
||||
|
||||
libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw) $(libeu)
|
||||
@rm -f $(@:.so=.map)
|
||||
$(AM_V_at)echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \
|
||||
> $(@:.so=.map)
|
||||
$(AM_V_CCLD)$(LINK) -shared -o $(@:.map=.so) \
|
||||
-Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
|
||||
-Wl,--version-script,$(@:.so=.map),--no-undefined \
|
||||
-Wl,-z,defs,-z,relro -Wl,--as-needed $(libelf) $(libdw) $(libeu)
|
||||
@$(textrel_check)
|
||||
|
||||
libebl_i386.so: $(cpu_i386)
|
||||
libebl_x86_64.so: $(cpu_x86_64)
|
||||
libebl_bpf.so: $(cpu_bpf)
|
||||
|
||||
install: install-am install-ebl-modules
|
||||
install-ebl-modules:
|
||||
$(mkinstalldirs) $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)
|
||||
for m in $(modules); do \
|
||||
$(INSTALL_PROGRAM) libebl_$${m}.so $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}-$(PACKAGE_VERSION).so; \
|
||||
ln -fs libebl_$${m}-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}.so; \
|
||||
done
|
||||
|
||||
uninstall: uninstall-am
|
||||
for m in $(modules); do \
|
||||
rm -f $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}-$(PACKAGE_VERSION).so; \
|
||||
rm -f $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}.so; \
|
||||
done
|
||||
rmdir --ignore-fail-on-non-empty $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)
|
||||
|
||||
noinst_HEADERS = libebl_CPU.h common-reloc.c linux-core-note.c x86_corenote.c
|
||||
EXTRA_DIST = $(foreach m,$(modules),$($(m)_SRCS)) $(modules:=_reloc.def)
|
||||
|
||||
CLEANFILES += $(foreach m,$(modules),\
|
||||
libebl_$(m).map libebl_$(m).so \
|
||||
$(am_libebl_$(m)_pic_a_OBJECTS))
|
File diff suppressed because it is too large
Load Diff
@ -1,82 +0,0 @@
|
||||
/* arm ABI-specified defaults for DWARF CFI.
|
||||
Copyright (C) 2013 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND aarch64_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
/* ABI-specified state of DWARF CFI based on:
|
||||
|
||||
"DWARF for the ARM 64 bit architecture (AArch64) 1.0"
|
||||
http://infocenter.arm.com/help/topic/com.arm.doc.ihi0057b/IHI0057B_aadwarf64.pdf
|
||||
|
||||
"Procedure Call Standard for the ARM 64 bit Architecture 1.0"
|
||||
http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055b/IHI0055B_aapcs64.pdf
|
||||
*/
|
||||
|
||||
int
|
||||
aarch64_abi_cfi (Ebl *ebl __attribute__ ((unused)), Dwarf_CIE *abi_info)
|
||||
{
|
||||
static const uint8_t abi_cfi[] =
|
||||
{
|
||||
/* The initial Canonical Frame Address is the value of the
|
||||
Stack Pointer (r31) as setup in the previous frame. */
|
||||
DW_CFA_def_cfa, ULEB128_7 (30), ULEB128_7 (0),
|
||||
|
||||
#define SV(n) DW_CFA_same_value, ULEB128_7 (n)
|
||||
/* Callee-saved regs r19-r28. */
|
||||
SV (19), SV (20), SV (21), SV (22), SV (23),
|
||||
SV (24), SV (25), SV (26), SV (27), SV (28),
|
||||
|
||||
/* The Frame Pointer (FP, r29) and Link Register (LR, r30). */
|
||||
SV (29), SV (30),
|
||||
|
||||
/* Callee-saved fpregs v8-v15. v0 == 64. */
|
||||
SV (72), SV (73), SV (74), SV (75),
|
||||
SV (76), SV (77), SV (78), SV (79),
|
||||
#undef SV
|
||||
|
||||
/* XXX Note: registers intentionally unused by the program,
|
||||
for example as a consequence of the procedure call standard
|
||||
should be initialized as if by DW_CFA_same_value. */
|
||||
};
|
||||
|
||||
abi_info->initial_instructions = abi_cfi;
|
||||
abi_info->initial_instructions_end = &abi_cfi[sizeof abi_cfi];
|
||||
abi_info->data_alignment_factor = -4;
|
||||
|
||||
abi_info->return_address_register = 30; /* lr. */
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,172 +0,0 @@
|
||||
/* AArch64 specific core note handling.
|
||||
Copyright (C) 2013 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <elf.h>
|
||||
#include <inttypes.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#define BACKEND aarch64_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
#define ULONG uint64_t
|
||||
#define PID_T int32_t
|
||||
#define UID_T uint32_t
|
||||
#define GID_T uint32_t
|
||||
#define ALIGN_ULONG 8
|
||||
#define ALIGN_PID_T 4
|
||||
#define ALIGN_UID_T 4
|
||||
#define ALIGN_GID_T 4
|
||||
#define TYPE_ULONG ELF_T_XWORD
|
||||
#define TYPE_PID_T ELF_T_SWORD
|
||||
#define TYPE_UID_T ELF_T_WORD
|
||||
#define TYPE_GID_T ELF_T_WORD
|
||||
|
||||
#define PRSTATUS_REGS_SIZE (34 * 8)
|
||||
|
||||
static const Ebl_Register_Location prstatus_regs[] =
|
||||
{
|
||||
{ .offset = 0, .regno = 0, .count = 32, .bits = 64 }, /* x0..x30, sp */
|
||||
};
|
||||
|
||||
#define PRSTATUS_REGSET_ITEMS \
|
||||
{ \
|
||||
.name = "pc", .type = ELF_T_XWORD, .format = 'x', \
|
||||
.offset = (offsetof (struct EBLHOOK(prstatus), pr_reg) \
|
||||
+ PRSTATUS_REGS_SIZE - 16), \
|
||||
.group = "register", \
|
||||
.pc_register = true \
|
||||
}, \
|
||||
{ \
|
||||
.name = "pstate", .type = ELF_T_XWORD, .format = 'x', \
|
||||
.offset = (offsetof (struct EBLHOOK(prstatus), pr_reg) \
|
||||
+ PRSTATUS_REGS_SIZE - 8), \
|
||||
.group = "register" \
|
||||
}
|
||||
|
||||
static const Ebl_Register_Location aarch64_fpregset_regs[] =
|
||||
{
|
||||
{ .offset = 0, .regno = 64, .count = 32, .bits = 128 }, /* v0..v31 */
|
||||
};
|
||||
|
||||
static const Ebl_Core_Item aarch64_fpregset_items[] =
|
||||
{
|
||||
{
|
||||
.name = "fpsr", .type = ELF_T_WORD, .format = 'x',
|
||||
.offset = 512, .group = "register"
|
||||
},
|
||||
{
|
||||
.name = "fpcr", .type = ELF_T_WORD, .format = 'x',
|
||||
.offset = 516, .group = "register"
|
||||
}
|
||||
};
|
||||
|
||||
static const Ebl_Core_Item aarch64_tls_items[] =
|
||||
{
|
||||
{
|
||||
.name = "tls", .type = ELF_T_XWORD, .format = 'x',
|
||||
.offset = 0, .group = "register"
|
||||
}
|
||||
};
|
||||
|
||||
static const Ebl_Core_Item aarch64_syscall_items [] =
|
||||
{
|
||||
{
|
||||
.name = "syscall", .type = ELF_T_WORD, .format = 'x',
|
||||
.offset = 0, .group = "register"
|
||||
}
|
||||
};
|
||||
|
||||
#define AARCH64_HWBP_REG(KIND, N) \
|
||||
{ \
|
||||
.name = "DBG" KIND "VR" #N "_EL1", .type = ELF_T_XWORD, .format = 'x', \
|
||||
.offset = 8 + N * 16, .group = "register" \
|
||||
}, \
|
||||
{ \
|
||||
.name = "DBG" KIND "CR" #N "_EL1", .type = ELF_T_WORD, .format = 'x', \
|
||||
.offset = 16 + N * 16, .group = "register" \
|
||||
}
|
||||
|
||||
#define AARCH64_BP_WP_GROUP(KIND, NAME) \
|
||||
static const Ebl_Core_Item NAME[] = \
|
||||
{ \
|
||||
{ \
|
||||
.name = "dbg_info", .type = ELF_T_WORD, .format = 'x', \
|
||||
.offset = 0, .group = "control" \
|
||||
}, \
|
||||
/* N.B.: 4 bytes of padding here. */ \
|
||||
\
|
||||
AARCH64_HWBP_REG(KIND, 0), \
|
||||
AARCH64_HWBP_REG(KIND, 1), \
|
||||
AARCH64_HWBP_REG(KIND, 2), \
|
||||
AARCH64_HWBP_REG(KIND, 3), \
|
||||
AARCH64_HWBP_REG(KIND, 4), \
|
||||
AARCH64_HWBP_REG(KIND, 5), \
|
||||
AARCH64_HWBP_REG(KIND, 6), \
|
||||
AARCH64_HWBP_REG(KIND, 7), \
|
||||
AARCH64_HWBP_REG(KIND, 8), \
|
||||
AARCH64_HWBP_REG(KIND, 9), \
|
||||
AARCH64_HWBP_REG(KIND, 10), \
|
||||
AARCH64_HWBP_REG(KIND, 11), \
|
||||
AARCH64_HWBP_REG(KIND, 12), \
|
||||
AARCH64_HWBP_REG(KIND, 13), \
|
||||
AARCH64_HWBP_REG(KIND, 14), \
|
||||
AARCH64_HWBP_REG(KIND, 15), \
|
||||
\
|
||||
/* The DBGBVR+DBGBCR pair only takes 12 bytes. There are 4 bytes \
|
||||
of padding at the end of each pair. The item formatter in \
|
||||
readelf can skip those, but the missing 4 bytes at the end of \
|
||||
the whole block cause it to assume the whole item bunch \
|
||||
repeats, so it loops around to read more. Insert an explicit \
|
||||
(but invisible) padding word. */ \
|
||||
{ \
|
||||
.name = "", .type = ELF_T_WORD, .format = 'h', \
|
||||
.offset = 260, .group = "register" \
|
||||
} \
|
||||
}
|
||||
|
||||
AARCH64_BP_WP_GROUP ("B", aarch64_hw_bp_items);
|
||||
AARCH64_BP_WP_GROUP ("W", aarch64_hw_wp_items);
|
||||
|
||||
#undef AARCH64_BP_WP_GROUP
|
||||
#undef AARCH64_HWBP_REG
|
||||
|
||||
#define EXTRA_NOTES \
|
||||
EXTRA_REGSET_ITEMS (NT_FPREGSET, 528, \
|
||||
aarch64_fpregset_regs, aarch64_fpregset_items) \
|
||||
EXTRA_ITEMS (NT_ARM_TLS, 8, aarch64_tls_items) \
|
||||
EXTRA_ITEMS (NT_ARM_HW_BREAK, 264, aarch64_hw_bp_items) \
|
||||
EXTRA_ITEMS (NT_ARM_HW_WATCH, 264, aarch64_hw_wp_items) \
|
||||
EXTRA_ITEMS (NT_ARM_SYSTEM_CALL, 4, aarch64_syscall_items)
|
||||
|
||||
#include "linux-core-note.c"
|
@ -1,70 +0,0 @@
|
||||
/* Initialization of AArch64 specific backend library.
|
||||
Copyright (C) 2013, 2017 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND aarch64_
|
||||
#define RELOC_PREFIX R_AARCH64_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
/* This defines the common reloc hooks based on aarch64_reloc.def. */
|
||||
#include "common-reloc.c"
|
||||
|
||||
|
||||
const char *
|
||||
aarch64_init (Elf *elf __attribute__ ((unused)),
|
||||
GElf_Half machine __attribute__ ((unused)),
|
||||
Ebl *eh,
|
||||
size_t ehlen)
|
||||
{
|
||||
/* Check whether the Elf_BH object has a sufficent size. */
|
||||
if (ehlen < sizeof (Ebl))
|
||||
return NULL;
|
||||
|
||||
/* We handle it. */
|
||||
eh->name = "AARCH64";
|
||||
aarch64_init_reloc (eh);
|
||||
HOOK (eh, register_info);
|
||||
HOOK (eh, core_note);
|
||||
HOOK (eh, reloc_simple_type);
|
||||
HOOK (eh, return_value_location);
|
||||
HOOK (eh, check_special_symbol);
|
||||
HOOK (eh, data_marker_symbol);
|
||||
HOOK (eh, abi_cfi);
|
||||
|
||||
/* X0-X30 (31 regs) + SP + 1 Reserved + ELR, 30 Reserved regs (34-43)
|
||||
+ V0-V31 (32 regs, least significant 64 bits only)
|
||||
+ ALT_FRAME_RETURN_COLUMN (used when LR isn't used) = 97 DWARF regs. */
|
||||
eh->frame_nregs = 97;
|
||||
HOOK (eh, set_initial_registers_tid);
|
||||
HOOK (eh, unwind);
|
||||
|
||||
return MODVERSION;
|
||||
}
|
@ -1,92 +0,0 @@
|
||||
/* Fetch live process registers from TID.
|
||||
Copyright (C) 2013, 2014 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "system.h"
|
||||
#include <assert.h>
|
||||
#if defined(__aarch64__) && defined(__linux__)
|
||||
# include <linux/uio.h>
|
||||
# include <sys/user.h>
|
||||
# include <sys/ptrace.h>
|
||||
/* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */
|
||||
# ifndef HAVE_SYS_USER_REGS
|
||||
# define user_regs_struct user_pt_regs
|
||||
# define user_fpsimd_struct user_fpsimd_state
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define BACKEND aarch64_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
bool
|
||||
aarch64_set_initial_registers_tid (pid_t tid __attribute__ ((unused)),
|
||||
ebl_tid_registers_t *setfunc __attribute__ ((unused)),
|
||||
void *arg __attribute__ ((unused)))
|
||||
{
|
||||
#if !defined(__aarch64__) || !defined(__linux__)
|
||||
return false;
|
||||
#else /* __aarch64__ */
|
||||
|
||||
/* General registers. */
|
||||
struct user_regs_struct gregs;
|
||||
struct iovec iovec;
|
||||
iovec.iov_base = &gregs;
|
||||
iovec.iov_len = sizeof (gregs);
|
||||
if (ptrace (PTRACE_GETREGSET, tid, NT_PRSTATUS, &iovec) != 0)
|
||||
return false;
|
||||
|
||||
/* X0..X30 plus SP. */
|
||||
if (! setfunc (0, 32, (Dwarf_Word *) &gregs.regs[0], arg))
|
||||
return false;
|
||||
|
||||
/* PC. */
|
||||
if (! setfunc (-1, 1, (Dwarf_Word *) &gregs.pc, arg))
|
||||
return false;
|
||||
|
||||
/* ELR cannot be found. */
|
||||
|
||||
/* FP registers (only 64bits are used). */
|
||||
struct user_fpsimd_struct fregs;
|
||||
iovec.iov_base = &fregs;
|
||||
iovec.iov_len = sizeof (fregs);
|
||||
if (ptrace (PTRACE_GETREGSET, tid, NT_FPREGSET, &iovec) != 0)
|
||||
return false;
|
||||
|
||||
Dwarf_Word dwarf_fregs[32];
|
||||
for (int r = 0; r < 32; r++)
|
||||
dwarf_fregs[r] = fregs.vregs[r] & 0xFFFFFFFF;
|
||||
|
||||
if (! setfunc (64, 32, dwarf_fregs, arg))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
#endif /* __aarch64__ */
|
||||
}
|
@ -1,108 +0,0 @@
|
||||
/* Register names and numbers for AArch64 DWARF.
|
||||
Copyright (C) 2013, 2014 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <dwarf.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#define BACKEND aarch64_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
__attribute__ ((format (printf, 7, 8)))
|
||||
static ssize_t
|
||||
do_regtype (const char *setname, int type,
|
||||
const char **setnamep, int *typep,
|
||||
char *name, size_t namelen, const char *fmt, ...)
|
||||
{
|
||||
*setnamep = setname;
|
||||
*typep = type;
|
||||
|
||||
va_list ap;
|
||||
va_start (ap, fmt);
|
||||
int s = vsnprintf (name, namelen, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (s < 0 || (unsigned) s >= namelen)
|
||||
return -1;
|
||||
return s + 1;
|
||||
}
|
||||
|
||||
ssize_t
|
||||
aarch64_register_info (Ebl *ebl __attribute__ ((unused)),
|
||||
int regno, char *name, size_t namelen,
|
||||
const char **prefix, const char **setnamep,
|
||||
int *bits, int *typep)
|
||||
{
|
||||
if (name == NULL)
|
||||
return 128;
|
||||
|
||||
|
||||
*prefix = "";
|
||||
*bits = 64;
|
||||
|
||||
#define regtype(setname, type, ...) \
|
||||
do_regtype(setname, type, setnamep, typep, name, namelen, __VA_ARGS__)
|
||||
|
||||
switch (regno)
|
||||
{
|
||||
case 0 ... 30:
|
||||
return regtype ("integer", DW_ATE_signed, "x%d", regno);
|
||||
|
||||
case 31:
|
||||
return regtype ("integer", DW_ATE_address, "sp");
|
||||
|
||||
case 32:
|
||||
return 0;
|
||||
|
||||
case 33:
|
||||
return regtype ("integer", DW_ATE_address, "elr");
|
||||
|
||||
case 34 ... 63:
|
||||
return 0;
|
||||
|
||||
case 64 ... 95:
|
||||
/* FP/SIMD register file supports a variety of data types--it
|
||||
can be thought of as a register holding a single integer or
|
||||
floating-point value, or a vector of 8-, 16-, 32- or 64-bit
|
||||
integers. 128-bit quad-word is the only singular value that
|
||||
covers the whole register, so mark the register thus. */
|
||||
*bits = 128;
|
||||
return regtype ("FP/SIMD", DW_ATE_unsigned, "v%d", regno - 64);
|
||||
|
||||
case 96 ... 127:
|
||||
return 0;
|
||||
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
@ -1,157 +0,0 @@
|
||||
/* List the relocation types for AArch64. -*- C -*-
|
||||
Copyright (C) 2013, 2014, 2015 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/>. */
|
||||
|
||||
/* NAME, REL|EXEC|DYN */
|
||||
|
||||
RELOC_TYPE (ABS64, REL|EXEC|DYN)
|
||||
RELOC_TYPE (ABS32, REL|EXEC|DYN)
|
||||
RELOC_TYPE (COPY, EXEC|DYN)
|
||||
RELOC_TYPE (GLOB_DAT, EXEC|DYN)
|
||||
RELOC_TYPE (JUMP_SLOT, EXEC|DYN)
|
||||
RELOC_TYPE (RELATIVE, EXEC|DYN)
|
||||
RELOC_TYPE (TLS_DTPMOD, EXEC|DYN)
|
||||
RELOC_TYPE (TLS_DTPREL, EXEC|DYN)
|
||||
RELOC_TYPE (TLS_TPREL, EXEC|DYN)
|
||||
RELOC_TYPE (TLSDESC, EXEC|DYN)
|
||||
|
||||
/* R_AARCH64_NONE records that the section containing the place to be
|
||||
relocated depends on the section defining the symbol mentioned in
|
||||
the relocation directive[.] (ARM IHI 0056B). */
|
||||
RELOC_TYPE (NONE, REL)
|
||||
|
||||
RELOC_TYPE (ABS16, REL)
|
||||
RELOC_TYPE (PREL64, REL)
|
||||
RELOC_TYPE (PREL32, REL)
|
||||
RELOC_TYPE (PREL16, REL)
|
||||
RELOC_TYPE (MOVW_UABS_G0, REL)
|
||||
RELOC_TYPE (MOVW_UABS_G0_NC, REL)
|
||||
RELOC_TYPE (MOVW_UABS_G1, REL)
|
||||
RELOC_TYPE (MOVW_UABS_G1_NC, REL)
|
||||
RELOC_TYPE (MOVW_UABS_G2, REL)
|
||||
RELOC_TYPE (MOVW_UABS_G2_NC, REL)
|
||||
RELOC_TYPE (MOVW_UABS_G3, REL)
|
||||
RELOC_TYPE (MOVW_SABS_G0, REL)
|
||||
RELOC_TYPE (MOVW_SABS_G1, REL)
|
||||
RELOC_TYPE (MOVW_SABS_G2, REL)
|
||||
RELOC_TYPE (LD_PREL_LO19, REL)
|
||||
RELOC_TYPE (ADR_PREL_LO21, REL)
|
||||
RELOC_TYPE (ADR_PREL_PG_HI21, REL)
|
||||
RELOC_TYPE (ADR_PREL_PG_HI21_NC, REL)
|
||||
RELOC_TYPE (ADD_ABS_LO12_NC, REL)
|
||||
RELOC_TYPE (LDST8_ABS_LO12_NC, REL)
|
||||
RELOC_TYPE (LDST16_ABS_LO12_NC, REL)
|
||||
RELOC_TYPE (LDST32_ABS_LO12_NC, REL)
|
||||
RELOC_TYPE (LDST64_ABS_LO12_NC, REL)
|
||||
RELOC_TYPE (LDST128_ABS_LO12_NC, REL)
|
||||
RELOC_TYPE (TSTBR14, REL)
|
||||
RELOC_TYPE (CONDBR19, REL)
|
||||
RELOC_TYPE (JUMP26, REL)
|
||||
RELOC_TYPE (CALL26, REL)
|
||||
RELOC_TYPE (MOVW_PREL_G0, REL)
|
||||
RELOC_TYPE (MOVW_PREL_G0_NC, REL)
|
||||
RELOC_TYPE (MOVW_PREL_G1, REL)
|
||||
RELOC_TYPE (MOVW_PREL_G1_NC, REL)
|
||||
RELOC_TYPE (MOVW_PREL_G2, REL)
|
||||
RELOC_TYPE (MOVW_PREL_G2_NC, REL)
|
||||
RELOC_TYPE (MOVW_PREL_G3, REL)
|
||||
RELOC_TYPE (MOVW_GOTOFF_G0, REL)
|
||||
RELOC_TYPE (MOVW_GOTOFF_G0_NC, REL)
|
||||
RELOC_TYPE (MOVW_GOTOFF_G1, REL)
|
||||
RELOC_TYPE (MOVW_GOTOFF_G1_NC, REL)
|
||||
RELOC_TYPE (MOVW_GOTOFF_G2, REL)
|
||||
RELOC_TYPE (MOVW_GOTOFF_G2_NC, REL)
|
||||
RELOC_TYPE (MOVW_GOTOFF_G3, REL)
|
||||
RELOC_TYPE (GOTREL64, REL)
|
||||
RELOC_TYPE (GOTREL32, REL)
|
||||
RELOC_TYPE (GOT_LD_PREL19, REL)
|
||||
RELOC_TYPE (LD64_GOTOFF_LO15, REL)
|
||||
RELOC_TYPE (ADR_GOT_PAGE, REL)
|
||||
RELOC_TYPE (LD64_GOT_LO12_NC, REL)
|
||||
RELOC_TYPE (LD64_GOTPAGE_LO15, REL)
|
||||
RELOC_TYPE (TLSGD_ADR_PREL21, REL)
|
||||
RELOC_TYPE (TLSGD_ADR_PAGE21, REL)
|
||||
RELOC_TYPE (TLSGD_ADD_LO12_NC, REL)
|
||||
RELOC_TYPE (TLSGD_MOVW_G1, REL)
|
||||
RELOC_TYPE (TLSGD_MOVW_G0_NC, REL)
|
||||
RELOC_TYPE (TLSLD_ADR_PREL21, REL)
|
||||
RELOC_TYPE (TLSLD_ADR_PAGE21, REL)
|
||||
RELOC_TYPE (TLSLD_ADD_LO12_NC, REL)
|
||||
RELOC_TYPE (TLSLD_MOVW_G1, REL)
|
||||
RELOC_TYPE (TLSLD_MOVW_G0_NC, REL)
|
||||
RELOC_TYPE (TLSLD_LD_PREL19, REL)
|
||||
RELOC_TYPE (TLSLD_MOVW_DTPREL_G2, REL)
|
||||
RELOC_TYPE (TLSLD_MOVW_DTPREL_G1, REL)
|
||||
RELOC_TYPE (TLSLD_MOVW_DTPREL_G1_NC, REL)
|
||||
RELOC_TYPE (TLSLD_MOVW_DTPREL_G0, REL)
|
||||
RELOC_TYPE (TLSLD_MOVW_DTPREL_G0_NC, REL)
|
||||
RELOC_TYPE (TLSLD_ADD_DTPREL_HI12, REL)
|
||||
RELOC_TYPE (TLSLD_ADD_DTPREL_LO12, REL)
|
||||
RELOC_TYPE (TLSLD_ADD_DTPREL_LO12_NC, REL)
|
||||
RELOC_TYPE (TLSLD_LDST8_DTPREL_LO12, REL)
|
||||
RELOC_TYPE (TLSLD_LDST8_DTPREL_LO12_NC, REL)
|
||||
RELOC_TYPE (TLSLD_LDST16_DTPREL_LO12, REL)
|
||||
RELOC_TYPE (TLSLD_LDST16_DTPREL_LO12_NC, REL)
|
||||
RELOC_TYPE (TLSLD_LDST32_DTPREL_LO12, REL)
|
||||
RELOC_TYPE (TLSLD_LDST32_DTPREL_LO12_NC, REL)
|
||||
RELOC_TYPE (TLSLD_LDST64_DTPREL_LO12, REL)
|
||||
RELOC_TYPE (TLSLD_LDST64_DTPREL_LO12_NC, REL)
|
||||
RELOC_TYPE (TLSLD_LDST128_DTPREL_LO12, REL)
|
||||
RELOC_TYPE (TLSLD_LDST128_DTPREL_LO12_NC, REL)
|
||||
RELOC_TYPE (TLSIE_MOVW_GOTTPREL_G1, REL)
|
||||
RELOC_TYPE (TLSIE_MOVW_GOTTPREL_G0_NC, REL)
|
||||
RELOC_TYPE (TLSIE_ADR_GOTTPREL_PAGE21, REL)
|
||||
RELOC_TYPE (TLSIE_LD64_GOTTPREL_LO12_NC, REL)
|
||||
RELOC_TYPE (TLSIE_LD_GOTTPREL_PREL19, REL)
|
||||
RELOC_TYPE (TLSLE_MOVW_TPREL_G2, REL)
|
||||
RELOC_TYPE (TLSLE_MOVW_TPREL_G1, REL)
|
||||
RELOC_TYPE (TLSLE_MOVW_TPREL_G1_NC, REL)
|
||||
RELOC_TYPE (TLSLE_MOVW_TPREL_G0, REL)
|
||||
RELOC_TYPE (TLSLE_MOVW_TPREL_G0_NC, REL)
|
||||
RELOC_TYPE (TLSLE_ADD_TPREL_HI12, REL)
|
||||
RELOC_TYPE (TLSLE_ADD_TPREL_LO12, REL)
|
||||
RELOC_TYPE (TLSLE_ADD_TPREL_LO12_NC, REL)
|
||||
RELOC_TYPE (TLSLE_LDST8_TPREL_LO12, REL)
|
||||
RELOC_TYPE (TLSLE_LDST8_TPREL_LO12_NC, REL)
|
||||
RELOC_TYPE (TLSLE_LDST16_TPREL_LO12, REL)
|
||||
RELOC_TYPE (TLSLE_LDST16_TPREL_LO12_NC, REL)
|
||||
RELOC_TYPE (TLSLE_LDST32_TPREL_LO12, REL)
|
||||
RELOC_TYPE (TLSLE_LDST32_TPREL_LO12_NC, REL)
|
||||
RELOC_TYPE (TLSLE_LDST64_TPREL_LO12, REL)
|
||||
RELOC_TYPE (TLSLE_LDST64_TPREL_LO12_NC, REL)
|
||||
RELOC_TYPE (TLSLE_LDST128_TPREL_LO12, REL)
|
||||
RELOC_TYPE (TLSLE_LDST128_TPREL_LO12_NC, REL)
|
||||
RELOC_TYPE (TLSDESC_LD_PREL19, REL)
|
||||
RELOC_TYPE (TLSDESC_ADR_PREL21, REL)
|
||||
RELOC_TYPE (TLSDESC_ADR_PAGE21, REL)
|
||||
RELOC_TYPE (TLSDESC_LD64_LO12, REL)
|
||||
RELOC_TYPE (TLSDESC_ADD_LO12, REL)
|
||||
RELOC_TYPE (TLSDESC_OFF_G1, REL)
|
||||
RELOC_TYPE (TLSDESC_OFF_G0_NC, REL)
|
||||
RELOC_TYPE (TLSDESC_LDR, REL)
|
||||
RELOC_TYPE (TLSDESC_ADD, REL)
|
||||
RELOC_TYPE (TLSDESC_CALL, REL)
|
@ -1,376 +0,0 @@
|
||||
/* Function return value location for Linux/AArch64 ABI.
|
||||
Copyright (C) 2013 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND aarch64_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
static int
|
||||
skip_until (Dwarf_Die *child, int tag)
|
||||
{
|
||||
int i;
|
||||
while (DWARF_TAG_OR_RETURN (child) != tag)
|
||||
if ((i = dwarf_siblingof (child, child)) != 0)
|
||||
/* If there are no members, then this is not a HFA. Errors
|
||||
are propagated. */
|
||||
return i;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
dwarf_bytesize_aux (Dwarf_Die *die, Dwarf_Word *sizep)
|
||||
{
|
||||
int bits;
|
||||
if (((bits = 8 * dwarf_bytesize (die)) < 0
|
||||
&& (bits = dwarf_bitsize (die)) < 0)
|
||||
|| bits % 8 != 0)
|
||||
return -1;
|
||||
|
||||
*sizep = bits / 8;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* HFA (Homogeneous Floating-point Aggregate) is an aggregate type
|
||||
whose members are all of the same floating-point type, which is
|
||||
then base type of this HFA. Instead of being floating-point types
|
||||
directly, members can instead themselves be HFA. Such HFA fields
|
||||
are handled as if their type were HFA base type.
|
||||
|
||||
This function returns 0 if TYPEDIE is HFA, 1 if it is not, or -1 if
|
||||
there were errors. In the former case, *SIZEP contains byte size
|
||||
of the base type (e.g. 8 for IEEE double). *COUNT is set to the
|
||||
number of leaf members of the HFA. */
|
||||
static int hfa_type (Dwarf_Die *ftypedie, int tag,
|
||||
Dwarf_Word *sizep, Dwarf_Word *countp);
|
||||
|
||||
/* Return 0 if MEMBDIE refers to a member with a floating-point or HFA
|
||||
type, or 1 if it's not. Return -1 for errors. The meaning of the
|
||||
remaining arguments is as documented at hfa_type. */
|
||||
static int
|
||||
member_is_fp (Dwarf_Die *membdie, Dwarf_Word *sizep, Dwarf_Word *countp)
|
||||
{
|
||||
Dwarf_Die typedie;
|
||||
int tag = dwarf_peeled_die_type (membdie, &typedie);
|
||||
switch (tag)
|
||||
{
|
||||
case DW_TAG_base_type:;
|
||||
Dwarf_Word encoding;
|
||||
Dwarf_Attribute attr_mem;
|
||||
if (dwarf_attr_integrate (&typedie, DW_AT_encoding, &attr_mem) == NULL
|
||||
|| dwarf_formudata (&attr_mem, &encoding) != 0)
|
||||
return -1;
|
||||
|
||||
switch (encoding)
|
||||
{
|
||||
case DW_ATE_complex_float:
|
||||
*countp = 2;
|
||||
break;
|
||||
|
||||
case DW_ATE_float:
|
||||
*countp = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (dwarf_bytesize_aux (&typedie, sizep) < 0)
|
||||
return -1;
|
||||
|
||||
*sizep /= *countp;
|
||||
return 0;
|
||||
|
||||
case DW_TAG_structure_type:
|
||||
case DW_TAG_union_type:
|
||||
case DW_TAG_array_type:
|
||||
return hfa_type (&typedie, tag, sizep, countp);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
hfa_type (Dwarf_Die *ftypedie, int tag, Dwarf_Word *sizep, Dwarf_Word *countp)
|
||||
{
|
||||
assert (tag == DW_TAG_structure_type || tag == DW_TAG_class_type
|
||||
|| tag == DW_TAG_union_type || tag == DW_TAG_array_type);
|
||||
|
||||
int i;
|
||||
if (tag == DW_TAG_array_type)
|
||||
{
|
||||
Dwarf_Word tot_size;
|
||||
if (dwarf_aggregate_size (ftypedie, &tot_size) < 0)
|
||||
return -1;
|
||||
|
||||
/* For vector types, we don't care about the underlying
|
||||
type, but only about the vector type itself. */
|
||||
bool vec;
|
||||
Dwarf_Attribute attr_mem;
|
||||
if (dwarf_formflag (dwarf_attr_integrate (ftypedie, DW_AT_GNU_vector,
|
||||
&attr_mem), &vec) == 0
|
||||
&& vec)
|
||||
{
|
||||
*sizep = tot_size;
|
||||
*countp = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((i = member_is_fp (ftypedie, sizep, countp)) == 0)
|
||||
{
|
||||
*countp = tot_size / *sizep;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
/* Find first DW_TAG_member and determine its type. */
|
||||
Dwarf_Die member;
|
||||
if ((i = dwarf_child (ftypedie, &member) != 0))
|
||||
return i;
|
||||
|
||||
if ((i = skip_until (&member, DW_TAG_member)) != 0)
|
||||
return i;
|
||||
|
||||
*countp = 0;
|
||||
if ((i = member_is_fp (&member, sizep, countp)) != 0)
|
||||
return i;
|
||||
|
||||
while ((i = dwarf_siblingof (&member, &member)) == 0
|
||||
&& (i = skip_until (&member, DW_TAG_member)) == 0)
|
||||
{
|
||||
Dwarf_Word size, count;
|
||||
if ((i = member_is_fp (&member, &size, &count)) != 0)
|
||||
return i;
|
||||
|
||||
if (*sizep != size)
|
||||
return 1;
|
||||
|
||||
*countp += count;
|
||||
}
|
||||
|
||||
/* At this point we already have at least one FP member, which means
|
||||
FTYPEDIE is an HFA. So either return 0, or propagate error. */
|
||||
return i < 0 ? i : 0;
|
||||
}
|
||||
|
||||
static int
|
||||
pass_in_gpr (const Dwarf_Op **locp, Dwarf_Word size)
|
||||
{
|
||||
static const Dwarf_Op loc[] =
|
||||
{
|
||||
{ .atom = DW_OP_reg0 }, { .atom = DW_OP_piece, .number = 8 },
|
||||
{ .atom = DW_OP_reg1 }, { .atom = DW_OP_piece, .number = 8 }
|
||||
};
|
||||
|
||||
*locp = loc;
|
||||
return size <= 8 ? 1 : 4;
|
||||
}
|
||||
|
||||
static int
|
||||
pass_by_ref (const Dwarf_Op **locp)
|
||||
{
|
||||
static const Dwarf_Op loc[] = { { .atom = DW_OP_breg0 } };
|
||||
|
||||
*locp = loc;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
pass_hfa (const Dwarf_Op **locp, Dwarf_Word size, Dwarf_Word count)
|
||||
{
|
||||
assert (count >= 1 && count <= 4);
|
||||
assert (size == 2 || size == 4 || size == 8 || size == 16);
|
||||
|
||||
#define DEFINE_FPREG(NAME, SIZE) \
|
||||
static const Dwarf_Op NAME[] = { \
|
||||
{ .atom = DW_OP_regx, .number = 64 }, \
|
||||
{ .atom = DW_OP_piece, .number = SIZE }, \
|
||||
{ .atom = DW_OP_regx, .number = 65 }, \
|
||||
{ .atom = DW_OP_piece, .number = SIZE }, \
|
||||
{ .atom = DW_OP_regx, .number = 66 }, \
|
||||
{ .atom = DW_OP_piece, .number = SIZE }, \
|
||||
{ .atom = DW_OP_regx, .number = 67 }, \
|
||||
{ .atom = DW_OP_piece, .number = SIZE } \
|
||||
}
|
||||
|
||||
switch (size)
|
||||
{
|
||||
case 2:;
|
||||
DEFINE_FPREG (loc_hfa_2, 2);
|
||||
*locp = loc_hfa_2;
|
||||
break;
|
||||
|
||||
case 4:;
|
||||
DEFINE_FPREG (loc_hfa_4, 4);
|
||||
*locp = loc_hfa_4;
|
||||
break;
|
||||
|
||||
case 8:;
|
||||
DEFINE_FPREG (loc_hfa_8, 8);
|
||||
*locp = loc_hfa_8;
|
||||
break;
|
||||
|
||||
case 16:;
|
||||
DEFINE_FPREG (loc_hfa_16, 16);
|
||||
*locp = loc_hfa_16;
|
||||
break;
|
||||
}
|
||||
#undef DEFINE_FPREG
|
||||
|
||||
return count == 1 ? 1 : 2 * count;
|
||||
}
|
||||
|
||||
static int
|
||||
pass_in_simd (const Dwarf_Op **locp)
|
||||
{
|
||||
/* This is like passing single-element HFA. Size doesn't matter, so
|
||||
pretend it's for example double. */
|
||||
return pass_hfa (locp, 8, 1);
|
||||
}
|
||||
|
||||
int
|
||||
aarch64_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_Die typedie;
|
||||
int tag = dwarf_peeled_die_type (functypedie, &typedie);
|
||||
if (tag <= 0)
|
||||
return tag;
|
||||
|
||||
Dwarf_Word size = (Dwarf_Word)-1;
|
||||
|
||||
/* If the argument type is a Composite Type that is larger than 16
|
||||
bytes, then the argument is copied to memory allocated by the
|
||||
caller and the argument is replaced by a pointer to the copy. */
|
||||
if (tag == DW_TAG_structure_type || tag == DW_TAG_union_type
|
||||
|| tag == DW_TAG_class_type || tag == DW_TAG_array_type)
|
||||
{
|
||||
Dwarf_Word base_size, count;
|
||||
switch (hfa_type (&typedie, tag, &base_size, &count))
|
||||
{
|
||||
default:
|
||||
return -1;
|
||||
|
||||
case 0:
|
||||
assert (count > 0);
|
||||
if (count <= 4)
|
||||
return pass_hfa (locp, base_size, count);
|
||||
/* Fall through. */
|
||||
|
||||
case 1:
|
||||
/* Not a HFA. */
|
||||
if (dwarf_aggregate_size (&typedie, &size) < 0)
|
||||
return -1;
|
||||
if (size > 16)
|
||||
return pass_by_ref (locp);
|
||||
}
|
||||
}
|
||||
|
||||
if (tag == DW_TAG_base_type
|
||||
|| tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
|
||||
{
|
||||
if (dwarf_bytesize_aux (&typedie, &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 (tag == DW_TAG_base_type)
|
||||
{
|
||||
Dwarf_Word encoding;
|
||||
if (dwarf_formudata (dwarf_attr_integrate (&typedie, DW_AT_encoding,
|
||||
&attr_mem),
|
||||
&encoding) != 0)
|
||||
return -1;
|
||||
|
||||
switch (encoding)
|
||||
{
|
||||
/* If the argument is a Half-, Single-, Double- or Quad-
|
||||
precision Floating-point [...] the argument is allocated
|
||||
to the least significant bits of register v[NSRN]. */
|
||||
case DW_ATE_float:
|
||||
switch (size)
|
||||
{
|
||||
case 2: /* half */
|
||||
case 4: /* sigle */
|
||||
case 8: /* double */
|
||||
case 16: /* quad */
|
||||
return pass_in_simd (locp);
|
||||
|
||||
default:
|
||||
return -2;
|
||||
}
|
||||
|
||||
case DW_ATE_complex_float:
|
||||
switch (size)
|
||||
{
|
||||
case 8: /* float _Complex */
|
||||
case 16: /* double _Complex */
|
||||
case 32: /* long double _Complex */
|
||||
return pass_hfa (locp, size / 2, 2);
|
||||
|
||||
default:
|
||||
return -2;
|
||||
}
|
||||
|
||||
/* If the argument is an Integral or Pointer Type, the
|
||||
size of the argument is less than or equal to 8 bytes
|
||||
[...] the argument is copied to the least significant
|
||||
bits in x[NGRN]. */
|
||||
case DW_ATE_boolean:
|
||||
case DW_ATE_signed:
|
||||
case DW_ATE_unsigned:
|
||||
case DW_ATE_unsigned_char:
|
||||
case DW_ATE_signed_char:
|
||||
return pass_in_gpr (locp, size);
|
||||
}
|
||||
|
||||
return -2;
|
||||
}
|
||||
else
|
||||
return pass_in_gpr (locp, size);
|
||||
}
|
||||
|
||||
*locp = NULL;
|
||||
return 0;
|
||||
}
|
@ -1,104 +0,0 @@
|
||||
/* AArch64 specific symbolic name handling.
|
||||
Copyright (C) 2013, 2015, 2017 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <elf.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#define BACKEND aarch64_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
/* Check for the simple reloc types. */
|
||||
Elf_Type
|
||||
aarch64_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case R_AARCH64_ABS64:
|
||||
return ELF_T_XWORD;
|
||||
case R_AARCH64_ABS32:
|
||||
return ELF_T_WORD;
|
||||
case R_AARCH64_ABS16:
|
||||
return ELF_T_HALF;
|
||||
|
||||
default:
|
||||
return ELF_T_NUM;
|
||||
}
|
||||
}
|
||||
|
||||
/* If this is the _GLOBAL_OFFSET_TABLE_ symbol, then it should point in
|
||||
the .got even if there is a .got.plt section.
|
||||
https://sourceware.org/ml/libc-ports/2013-06/msg00057.html
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1201778
|
||||
*/
|
||||
bool
|
||||
aarch64_check_special_symbol (Elf *elf, GElf_Ehdr *ehdr, const GElf_Sym *sym,
|
||||
const char *name, const GElf_Shdr *destshdr)
|
||||
{
|
||||
if (name != NULL
|
||||
&& strcmp (name, "_GLOBAL_OFFSET_TABLE_") == 0)
|
||||
{
|
||||
const char *sname = elf_strptr (elf, ehdr->e_shstrndx, destshdr->sh_name);
|
||||
if (sname != NULL
|
||||
&& (strcmp (sname, ".got") == 0 || strcmp (sname, ".got.plt") == 0))
|
||||
{
|
||||
Elf_Scn *scn = NULL;
|
||||
while ((scn = elf_nextscn (elf, scn)) != NULL)
|
||||
{
|
||||
GElf_Shdr shdr_mem;
|
||||
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
|
||||
if (shdr != NULL)
|
||||
{
|
||||
sname = elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name);
|
||||
if (sname != NULL && strcmp (sname, ".got") == 0)
|
||||
return (sym->st_value >= shdr->sh_addr
|
||||
&& sym->st_value < shdr->sh_addr + shdr->sh_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* A data mapping symbol is a symbol with "$d" name or "$d.<any...>" name,
|
||||
STT_NOTYPE, STB_LOCAL and st_size of zero. The indicate the stat of a
|
||||
sequence of data items. */
|
||||
bool
|
||||
aarch64_data_marker_symbol (const GElf_Sym *sym, const char *sname)
|
||||
{
|
||||
return (sym != NULL && sname != NULL
|
||||
&& sym->st_size == 0 && GELF_ST_BIND (sym->st_info) == STB_LOCAL
|
||||
&& GELF_ST_TYPE (sym->st_info) == STT_NOTYPE
|
||||
&& (strcmp (sname, "$d") == 0 || strncmp (sname, "$d.", 3) == 0));
|
||||
}
|
@ -1,83 +0,0 @@
|
||||
/* Get previous frame state for an existing frame state.
|
||||
Copyright (C) 2016 The Qt Company Ltd.
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND aarch64_
|
||||
#define FP_REG 29
|
||||
#define LR_REG 30
|
||||
#define SP_REG 31
|
||||
#define FP_OFFSET 0
|
||||
#define LR_OFFSET 8
|
||||
#define SP_OFFSET 16
|
||||
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
/* There was no CFI. Maybe we happen to have a frame pointer and can unwind from that? */
|
||||
|
||||
bool
|
||||
EBLHOOK(unwind) (Ebl *ebl __attribute__ ((unused)), Dwarf_Addr pc __attribute__ ((unused)),
|
||||
ebl_tid_registers_t *setfunc, ebl_tid_registers_get_t *getfunc,
|
||||
ebl_pid_memory_read_t *readfunc, void *arg,
|
||||
bool *signal_framep __attribute__ ((unused)))
|
||||
{
|
||||
Dwarf_Word fp, lr, sp;
|
||||
|
||||
if (!getfunc(LR_REG, 1, &lr, arg))
|
||||
return false;
|
||||
|
||||
if (lr == 0 || !setfunc(-1, 1, &lr, arg))
|
||||
return false;
|
||||
|
||||
if (!getfunc(FP_REG, 1, &fp, arg))
|
||||
fp = 0;
|
||||
|
||||
if (!getfunc(SP_REG, 1, &sp, arg))
|
||||
sp = 0;
|
||||
|
||||
Dwarf_Word newLr, newFp, newSp;
|
||||
|
||||
if (!readfunc(fp + LR_OFFSET, &newLr, arg))
|
||||
newLr = 0;
|
||||
|
||||
if (!readfunc(fp + FP_OFFSET, &newFp, arg))
|
||||
newFp = 0;
|
||||
|
||||
newSp = fp + SP_OFFSET;
|
||||
|
||||
// These are not fatal if they don't work. They will just prevent unwinding at the next frame.
|
||||
setfunc(LR_REG, 1, &newLr, arg);
|
||||
setfunc(FP_REG, 1, &newFp, arg);
|
||||
setfunc(SP_REG, 1, &newSp, arg);
|
||||
|
||||
// If the fp is invalid, we might still have a valid lr.
|
||||
// But if the fp is valid, then the stack should be moving in the right direction.
|
||||
return fp == 0 || newSp > sp;
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
/* Alpha-specific auxv handling.
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND alpha_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
int
|
||||
EBLHOOK(auxv_info) (GElf_Xword a_type, const char **name, const char **format)
|
||||
{
|
||||
if (a_type != AT_HWCAP)
|
||||
return 0;
|
||||
|
||||
*name = "HWCAP";
|
||||
*format = "b"
|
||||
"bwx\0" "fix\0" "cix\0" "0x08\0"
|
||||
"0x10\0" "0x20\0" "0x40\0" "0x80\0"
|
||||
"max\0" "precise_trap\0"
|
||||
"\0";
|
||||
return 1;
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
/* PowerPC specific core note handling.
|
||||
Copyright (C) 2007 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <elf.h>
|
||||
#include <inttypes.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#define BACKEND alpha_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
static const Ebl_Register_Location prstatus_regs[] =
|
||||
{
|
||||
{ .offset = 0, .regno = 0, .count = 31, .bits = 64 }, /* r0-r30 */
|
||||
{ .offset = 32 * 8, .regno = 64, .count = 1, .bits = 64 }, /* pc */
|
||||
{ .offset = 33 * 8, .regno = 66, .count = 1, .bits = 64 }, /* unique */
|
||||
};
|
||||
#define PRSTATUS_REGS_SIZE (33 * 8)
|
||||
|
||||
static const Ebl_Register_Location fpregset_regs[] =
|
||||
{
|
||||
{ .offset = 0, .regno = 32, .count = 32, .bits = 64 }, /* f0-f30, fpcr */
|
||||
};
|
||||
#define FPREGSET_SIZE (32 * 8)
|
||||
|
||||
#define ULONG uint64_t
|
||||
#define ALIGN_ULONG 8
|
||||
#define TYPE_ULONG ELF_T_XWORD
|
||||
#define TYPE_LONG ELF_T_SXWORD
|
||||
#define PID_T int32_t
|
||||
#define UID_T uint32_t
|
||||
#define GID_T uint32_t
|
||||
#define ALIGN_PID_T 4
|
||||
#define ALIGN_UID_T 4
|
||||
#define ALIGN_GID_T 4
|
||||
#define TYPE_PID_T ELF_T_SWORD
|
||||
#define TYPE_UID_T ELF_T_WORD
|
||||
#define TYPE_GID_T ELF_T_WORD
|
||||
|
||||
#include "linux-core-note.c"
|
@ -1,69 +0,0 @@
|
||||
/* Initialization of Alpha specific backend library.
|
||||
Copyright (C) 2002-2011 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND alpha_
|
||||
#define RELOC_PREFIX R_ALPHA_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
/* This defines the common reloc hooks based on alpha_reloc.def. */
|
||||
#include "common-reloc.c"
|
||||
|
||||
|
||||
const char *
|
||||
alpha_init (Elf *elf __attribute__ ((unused)),
|
||||
GElf_Half machine __attribute__ ((unused)),
|
||||
Ebl *eh,
|
||||
size_t ehlen)
|
||||
{
|
||||
/* Check whether the Elf_BH object has a sufficent size. */
|
||||
if (ehlen < sizeof (Ebl))
|
||||
return NULL;
|
||||
|
||||
/* We handle it. */
|
||||
eh->name = "Alpha";
|
||||
alpha_init_reloc (eh);
|
||||
HOOK (eh, dynamic_tag_name);
|
||||
HOOK (eh, dynamic_tag_check);
|
||||
HOOK (eh, reloc_simple_type);
|
||||
HOOK (eh, return_value_location);
|
||||
HOOK (eh, machine_section_flag_check);
|
||||
HOOK (eh, check_special_section);
|
||||
HOOK (eh, check_special_symbol);
|
||||
HOOK (eh, check_st_other_bits);
|
||||
HOOK (eh, register_info);
|
||||
HOOK (eh, core_note);
|
||||
HOOK (eh, auxv_info);
|
||||
eh->sysvhash_entrysize = sizeof (Elf64_Xword);
|
||||
|
||||
return MODVERSION;
|
||||
}
|
@ -1,164 +0,0 @@
|
||||
/* Register names and numbers for Alpha DWARF.
|
||||
Copyright (C) 2007 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND alpha_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
ssize_t
|
||||
alpha_register_info (Ebl *ebl __attribute__ ((unused)),
|
||||
int regno, char *name, size_t namelen,
|
||||
const char **prefix, const char **setname,
|
||||
int *bits, int *type)
|
||||
{
|
||||
if (name == NULL)
|
||||
return 67;
|
||||
|
||||
if (regno < 0 || regno > 66 || namelen < 7)
|
||||
return -1;
|
||||
|
||||
*prefix = "$";
|
||||
|
||||
*bits = 64;
|
||||
*type = DW_ATE_signed;
|
||||
*setname = "integer";
|
||||
if (regno >= 32 && regno < 64)
|
||||
{
|
||||
*setname = "FPU";
|
||||
*type = DW_ATE_float;
|
||||
}
|
||||
|
||||
switch (regno)
|
||||
{
|
||||
case 0:
|
||||
name[0] = 'v';
|
||||
name[1] = '0';
|
||||
namelen = 2;
|
||||
break;
|
||||
|
||||
case 1 ... 8:
|
||||
name[0] = 't';
|
||||
name[1] = regno - 1 + '0';
|
||||
namelen = 2;
|
||||
break;
|
||||
|
||||
case 9 ... 15:
|
||||
name[0] = 's';
|
||||
name[1] = regno - 9 + '0';
|
||||
namelen = 2;
|
||||
break;
|
||||
|
||||
case 16 ... 21:
|
||||
name[0] = 'a';
|
||||
name[1] = regno - 16 + '0';
|
||||
namelen = 2;
|
||||
break;
|
||||
|
||||
case 22 ... 23:
|
||||
name[0] = 't';
|
||||
name[1] = regno - 22 + '8';
|
||||
namelen = 2;
|
||||
break;
|
||||
|
||||
case 24 ... 25:
|
||||
name[0] = 't';
|
||||
name[1] = '1';
|
||||
name[2] = regno - 24 + '0';
|
||||
namelen = 3;
|
||||
break;
|
||||
|
||||
case 26:
|
||||
*type = DW_ATE_address;
|
||||
return stpcpy (name, "ra") + 1 - name;
|
||||
|
||||
case 27:
|
||||
return stpcpy (name, "t12") + 1 - name;
|
||||
|
||||
case 28:
|
||||
return stpcpy (name, "at") + 1 - name;
|
||||
|
||||
case 29:
|
||||
*type = DW_ATE_address;
|
||||
return stpcpy (name, "gp") + 1 - name;
|
||||
|
||||
case 30:
|
||||
*type = DW_ATE_address;
|
||||
return stpcpy (name, "sp") + 1 - name;
|
||||
|
||||
case 31:
|
||||
return stpcpy (name, "zero") + 1 - name;
|
||||
|
||||
case 32 ... 32 + 9:
|
||||
name[0] = 'f';
|
||||
name[1] = regno - 32 + '0';
|
||||
namelen = 2;
|
||||
break;
|
||||
|
||||
case 32 + 10 ... 32 + 19:
|
||||
name[0] = 'f';
|
||||
name[1] = '1';
|
||||
name[2] = regno - 32 - 10 + '0';
|
||||
namelen = 3;
|
||||
break;
|
||||
|
||||
case 32 + 20 ... 32 + 29:
|
||||
name[0] = 'f';
|
||||
name[1] = '2';
|
||||
name[2] = regno - 32 - 20 + '0';
|
||||
namelen = 3;
|
||||
break;
|
||||
|
||||
case 32 + 30:
|
||||
return stpcpy (name, "f30") + 1 - name;
|
||||
|
||||
case 32 + 31:
|
||||
*type = DW_ATE_unsigned;
|
||||
return stpcpy (name, "fpcr") + 1 - name;
|
||||
|
||||
case 64:
|
||||
*type = DW_ATE_address;
|
||||
return stpcpy (name, "pc") + 1 - name;
|
||||
|
||||
case 66:
|
||||
*type = DW_ATE_address;
|
||||
return stpcpy (name, "unique") + 1 - name;
|
||||
|
||||
default:
|
||||
*setname = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
name[namelen++] = '\0';
|
||||
return namelen;
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
/* List the relocation types for alpha. -*- C -*-
|
||||
Copyright (C) 2005 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/>. */
|
||||
|
||||
/* NAME, REL|EXEC|DYN */
|
||||
|
||||
RELOC_TYPE (NONE, 0)
|
||||
RELOC_TYPE (REFLONG, REL|EXEC|DYN)
|
||||
RELOC_TYPE (REFQUAD, REL|EXEC|DYN)
|
||||
RELOC_TYPE (GPREL32, REL)
|
||||
RELOC_TYPE (LITERAL, REL)
|
||||
RELOC_TYPE (LITUSE, REL)
|
||||
RELOC_TYPE (GPDISP, REL)
|
||||
RELOC_TYPE (BRADDR, REL)
|
||||
RELOC_TYPE (HINT, REL)
|
||||
RELOC_TYPE (SREL16, REL)
|
||||
RELOC_TYPE (SREL32, REL)
|
||||
RELOC_TYPE (SREL64, REL)
|
||||
RELOC_TYPE (GPRELHIGH, REL)
|
||||
RELOC_TYPE (GPRELLOW, REL)
|
||||
RELOC_TYPE (GPREL16, REL)
|
||||
RELOC_TYPE (COPY, 0)
|
||||
RELOC_TYPE (GLOB_DAT, EXEC|DYN)
|
||||
RELOC_TYPE (JMP_SLOT, EXEC|DYN)
|
||||
RELOC_TYPE (RELATIVE, EXEC|DYN)
|
||||
RELOC_TYPE (TLS_GD_HI, REL)
|
||||
RELOC_TYPE (TLSGD, REL)
|
||||
RELOC_TYPE (TLS_LDM, REL)
|
||||
RELOC_TYPE (DTPMOD64, REL|EXEC|DYN)
|
||||
RELOC_TYPE (GOTDTPREL, REL)
|
||||
RELOC_TYPE (DTPREL64, REL|EXEC|DYN)
|
||||
RELOC_TYPE (DTPRELHI, REL)
|
||||
RELOC_TYPE (DTPRELLO, REL)
|
||||
RELOC_TYPE (DTPREL16, REL)
|
||||
RELOC_TYPE (GOTTPREL, REL)
|
||||
RELOC_TYPE (TPREL64, REL|EXEC|DYN)
|
||||
RELOC_TYPE (TPRELHI, REL)
|
||||
RELOC_TYPE (TPRELLO, REL)
|
||||
RELOC_TYPE (TPREL16, REL)
|
@ -1,150 +0,0 @@
|
||||
/* Function return value location for Alpha ELF ABI.
|
||||
Copyright (C) 2005, 2007, 2014 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND alpha_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
/* $0. */
|
||||
static const Dwarf_Op loc_intreg[] =
|
||||
{
|
||||
{ .atom = DW_OP_reg0 }
|
||||
};
|
||||
#define nloc_intreg 1
|
||||
|
||||
/* $f0, or pair $f0, $f1. */
|
||||
static const Dwarf_Op loc_fpreg[] =
|
||||
{
|
||||
{ .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
{ .atom = DW_OP_regx, .number = 33 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
};
|
||||
#define nloc_fpreg 1
|
||||
#define nloc_fpregpair 4
|
||||
|
||||
/* The return value is a structure and is actually stored in stack space
|
||||
passed in a hidden argument by the caller. But, the compiler
|
||||
helpfully returns the address of that space in $0. */
|
||||
static const Dwarf_Op loc_aggregate[] =
|
||||
{
|
||||
{ .atom = DW_OP_breg0, .number = 0 }
|
||||
};
|
||||
#define nloc_aggregate 1
|
||||
|
||||
int
|
||||
alpha_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_Die die_mem, *typedie = &die_mem;
|
||||
int tag = dwarf_peeled_die_type (functypedie, typedie);
|
||||
if (tag <= 0)
|
||||
return tag;
|
||||
|
||||
switch (tag)
|
||||
{
|
||||
case -1:
|
||||
return -1;
|
||||
|
||||
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_OR_RETURN (typedie);
|
||||
}
|
||||
/* Fall through. */
|
||||
|
||||
case DW_TAG_base_type:
|
||||
case DW_TAG_enumeration_type:
|
||||
case DW_TAG_pointer_type:
|
||||
case DW_TAG_ptr_to_member_type:
|
||||
{
|
||||
Dwarf_Attribute attr_mem;
|
||||
Dwarf_Word size;
|
||||
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_Word encoding;
|
||||
if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
|
||||
&attr_mem),
|
||||
&encoding) != 0)
|
||||
return -1;
|
||||
|
||||
*locp = loc_fpreg;
|
||||
if (encoding == DW_ATE_float)
|
||||
{
|
||||
if (size <= 8)
|
||||
return nloc_fpreg;
|
||||
goto aggregate;
|
||||
}
|
||||
if (encoding == DW_ATE_complex_float)
|
||||
{
|
||||
if (size <= 8 * 2)
|
||||
return nloc_fpregpair;
|
||||
goto aggregate;
|
||||
}
|
||||
}
|
||||
if (size <= 8)
|
||||
{
|
||||
*locp = loc_intreg;
|
||||
return nloc_intreg;
|
||||
}
|
||||
}
|
||||
|
||||
/* Else fall through. */
|
||||
|
||||
case DW_TAG_structure_type:
|
||||
case DW_TAG_class_type:
|
||||
case DW_TAG_union_type:
|
||||
case DW_TAG_string_type:
|
||||
case DW_TAG_array_type:
|
||||
aggregate:
|
||||
*locp = loc_aggregate;
|
||||
return nloc_aggregate;
|
||||
}
|
||||
|
||||
/* XXX We don't have a good way to return specific errors from ebl calls.
|
||||
This value means we do not understand the type, but it is well-formed
|
||||
DWARF and might be valid. */
|
||||
return -2;
|
||||
}
|
@ -1,156 +0,0 @@
|
||||
/* Alpha specific symbolic name handling.
|
||||
Copyright (C) 2002-2011 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <elf.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#define BACKEND alpha_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
const char *
|
||||
alpha_dynamic_tag_name (int64_t tag, char *buf __attribute__ ((unused)),
|
||||
size_t len __attribute__ ((unused)))
|
||||
{
|
||||
switch (tag)
|
||||
{
|
||||
case DT_ALPHA_PLTRO:
|
||||
return "ALPHA_PLTRO";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool
|
||||
alpha_dynamic_tag_check (int64_t tag)
|
||||
{
|
||||
return tag == DT_ALPHA_PLTRO;
|
||||
}
|
||||
|
||||
/* Check for the simple reloc types. */
|
||||
Elf_Type
|
||||
alpha_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case R_ALPHA_REFLONG:
|
||||
return ELF_T_WORD;
|
||||
case R_ALPHA_REFQUAD:
|
||||
return ELF_T_XWORD;
|
||||
default:
|
||||
return ELF_T_NUM;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Check whether SHF_MASKPROC flags are valid. */
|
||||
bool
|
||||
alpha_machine_section_flag_check (GElf_Xword sh_flags)
|
||||
{
|
||||
return (sh_flags &~ (SHF_ALPHA_GPREL)) == 0;
|
||||
}
|
||||
|
||||
bool
|
||||
alpha_check_special_section (Ebl *ebl,
|
||||
int ndx __attribute__ ((unused)),
|
||||
const GElf_Shdr *shdr,
|
||||
const char *sname __attribute__ ((unused)))
|
||||
{
|
||||
if ((shdr->sh_flags
|
||||
& (SHF_WRITE | SHF_EXECINSTR)) == (SHF_WRITE | SHF_EXECINSTR)
|
||||
&& shdr->sh_addr != 0)
|
||||
{
|
||||
/* This is ordinarily flagged, but is valid for an old-style PLT.
|
||||
|
||||
Look for the SHT_DYNAMIC section and the DT_PLTGOT tag in it.
|
||||
Its d_ptr should match the .plt section's sh_addr. */
|
||||
|
||||
Elf_Scn *scn = NULL;
|
||||
while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
|
||||
{
|
||||
GElf_Shdr scn_shdr;
|
||||
if (likely (gelf_getshdr (scn, &scn_shdr) != NULL)
|
||||
&& scn_shdr.sh_type == SHT_DYNAMIC
|
||||
&& scn_shdr.sh_entsize != 0)
|
||||
{
|
||||
GElf_Addr pltgot = 0;
|
||||
Elf_Data *data = elf_getdata (scn, NULL);
|
||||
if (data != NULL)
|
||||
for (size_t i = 0; i < data->d_size / scn_shdr.sh_entsize; ++i)
|
||||
{
|
||||
GElf_Dyn dyn;
|
||||
if (unlikely (gelf_getdyn (data, i, &dyn) == NULL))
|
||||
break;
|
||||
if (dyn.d_tag == DT_PLTGOT)
|
||||
pltgot = dyn.d_un.d_ptr;
|
||||
else if (dyn.d_tag == DT_ALPHA_PLTRO && dyn.d_un.d_val != 0)
|
||||
return false; /* This PLT should not be writable. */
|
||||
}
|
||||
return pltgot == shdr->sh_addr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Check whether given symbol's st_value and st_size are OK despite failing
|
||||
normal checks. */
|
||||
bool
|
||||
alpha_check_special_symbol (Elf *elf __attribute__ ((unused)),
|
||||
GElf_Ehdr *ehdr __attribute__ ((unused)),
|
||||
const GElf_Sym *sym __attribute__ ((unused)),
|
||||
const char *name,
|
||||
const GElf_Shdr *destshdr __attribute__ ((unused)))
|
||||
{
|
||||
if (name == NULL)
|
||||
return false;
|
||||
|
||||
if (strcmp (name, "_GLOBAL_OFFSET_TABLE_") == 0)
|
||||
/* On Alpha any place in the section is valid. */
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Check whether only valid bits are set on the st_other symbol flag.
|
||||
Standard ST_VISIBILITY have already been masked off. */
|
||||
bool
|
||||
alpha_check_st_other_bits (unsigned char st_other)
|
||||
{
|
||||
return ((((st_other & STO_ALPHA_STD_GPLOAD) == STO_ALPHA_NOPV)
|
||||
|| ((st_other & STO_ALPHA_STD_GPLOAD) == STO_ALPHA_STD_GPLOAD))
|
||||
&& (st_other &~ STO_ALPHA_STD_GPLOAD) == 0);
|
||||
}
|
@ -1,241 +0,0 @@
|
||||
/* Object attribute tags for ARM.
|
||||
Copyright (C) 2009 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND arm_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
#define KNOWN_VALUES(...) do \
|
||||
{ \
|
||||
static const char *table[] = { __VA_ARGS__ }; \
|
||||
if (value < sizeof table / sizeof table[0]) \
|
||||
*value_name = table[value]; \
|
||||
} while (0)
|
||||
|
||||
bool
|
||||
arm_check_object_attribute (Ebl *ebl __attribute__ ((unused)),
|
||||
const char *vendor, int tag, uint64_t value,
|
||||
const char **tag_name, const char **value_name)
|
||||
{
|
||||
if (!strcmp (vendor, "aeabi"))
|
||||
switch (tag)
|
||||
{
|
||||
case 4:
|
||||
*tag_name = "CPU_raw_name";
|
||||
return true;
|
||||
case 5:
|
||||
*tag_name = "CPU_name";
|
||||
return true;
|
||||
case 6:
|
||||
*tag_name = "CPU_arch";
|
||||
KNOWN_VALUES ("Pre-v4",
|
||||
"v4",
|
||||
"v4T",
|
||||
"v5T",
|
||||
"v5TE",
|
||||
"v5TEJ",
|
||||
"v6",
|
||||
"v6KZ",
|
||||
"v6T2",
|
||||
"v6K",
|
||||
"v7",
|
||||
"v6-M",
|
||||
"v6S-M");
|
||||
return true;
|
||||
case 7:
|
||||
*tag_name = "CPU_arch_profile";
|
||||
switch (value)
|
||||
{
|
||||
case 'A':
|
||||
*value_name = "Application";
|
||||
break;
|
||||
case 'R':
|
||||
*value_name = "Realtime";
|
||||
break;
|
||||
case 'M':
|
||||
*value_name = "Microcontroller";
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
case 8:
|
||||
*tag_name = "ARM_ISA_use";
|
||||
KNOWN_VALUES ("No", "Yes");
|
||||
return true;
|
||||
case 9:
|
||||
*tag_name = "THUMB_ISA_use";
|
||||
KNOWN_VALUES ("No", "Thumb-1", "Thumb-2");
|
||||
return true;
|
||||
case 10:
|
||||
*tag_name = "VFP_arch";
|
||||
KNOWN_VALUES ("No", "VFPv1", "VFPv2", "VFPv3", "VFPv3-D16");
|
||||
return true;
|
||||
case 11:
|
||||
*tag_name = "WMMX_arch";
|
||||
KNOWN_VALUES ("No", "WMMXv1", "WMMXv2");
|
||||
return true;
|
||||
case 12:
|
||||
*tag_name = "Advanced_SIMD_arch";
|
||||
KNOWN_VALUES ("No", "NEONv1");
|
||||
return true;
|
||||
case 13:
|
||||
*tag_name = "PCS_config";
|
||||
KNOWN_VALUES ("None",
|
||||
"Bare platform",
|
||||
"Linux application",
|
||||
"Linux DSO",
|
||||
"PalmOS 2004",
|
||||
"PalmOS (reserved)",
|
||||
"SymbianOS 2004",
|
||||
"SymbianOS (reserved)");
|
||||
return true;
|
||||
case 14:
|
||||
*tag_name = "ABI_PCS_R9_use";
|
||||
KNOWN_VALUES ("V6", "SB", "TLS", "Unused");
|
||||
return true;
|
||||
case 15:
|
||||
*tag_name = "ABI_PCS_RW_data";
|
||||
KNOWN_VALUES ("Absolute", "PC-relative", "SB-relative", "None");
|
||||
return true;
|
||||
case 16:
|
||||
*tag_name = "ABI_PCS_RO_data";
|
||||
KNOWN_VALUES ("Absolute", "PC-relative", "None");
|
||||
return true;
|
||||
case 17:
|
||||
*tag_name = "ABI_PCS_GOT_use";
|
||||
KNOWN_VALUES ("None", "direct", "GOT-indirect");
|
||||
return true;
|
||||
case 18:
|
||||
*tag_name = "ABI_PCS_wchar_t";
|
||||
return true;
|
||||
case 19:
|
||||
*tag_name = "ABI_FP_rounding";
|
||||
KNOWN_VALUES ("Unused", "Needed");
|
||||
return true;
|
||||
case 20:
|
||||
*tag_name = "ABI_FP_denormal";
|
||||
KNOWN_VALUES ("Unused", "Needed", "Sign only");
|
||||
return true;
|
||||
case 21:
|
||||
*tag_name = "ABI_FP_exceptions";
|
||||
KNOWN_VALUES ("Unused", "Needed");
|
||||
return true;
|
||||
case 22:
|
||||
*tag_name = "ABI_FP_user_exceptions";
|
||||
KNOWN_VALUES ("Unused", "Needed");
|
||||
return true;
|
||||
case 23:
|
||||
*tag_name = "ABI_FP_number_model";
|
||||
KNOWN_VALUES ("Unused", "Finite", "RTABI", "IEEE 754");
|
||||
return true;
|
||||
case 24:
|
||||
*tag_name = "ABI_align8_needed";
|
||||
KNOWN_VALUES ("No", "Yes", "4-byte");
|
||||
return true;
|
||||
case 25:
|
||||
*tag_name = "ABI_align8_preserved";
|
||||
KNOWN_VALUES ("No", "Yes, except leaf SP", "Yes");
|
||||
return true;
|
||||
case 26:
|
||||
*tag_name = "ABI_enum_size";
|
||||
KNOWN_VALUES ("Unused", "small", "int", "forced to int");
|
||||
return true;
|
||||
case 27:
|
||||
*tag_name = "ABI_HardFP_use";
|
||||
KNOWN_VALUES ("as VFP_arch", "SP only", "DP only", "SP and DP");
|
||||
return true;
|
||||
case 28:
|
||||
*tag_name = "ABI_VFP_args";
|
||||
KNOWN_VALUES ("AAPCS", "VFP registers", "custom");
|
||||
return true;
|
||||
case 29:
|
||||
*tag_name = "ABI_WMMX_args";
|
||||
KNOWN_VALUES ("AAPCS", "WMMX registers", "custom");
|
||||
return true;
|
||||
case 30:
|
||||
*tag_name = "ABI_optimization_goals";
|
||||
KNOWN_VALUES ("None",
|
||||
"Prefer Speed",
|
||||
"Aggressive Speed",
|
||||
"Prefer Size",
|
||||
"Aggressive Size",
|
||||
"Prefer Debug",
|
||||
"Aggressive Debug");
|
||||
return true;
|
||||
case 31:
|
||||
*tag_name = "ABI_FP_optimization_goals";
|
||||
KNOWN_VALUES ("None",
|
||||
"Prefer Speed",
|
||||
"Aggressive Speed",
|
||||
"Prefer Size",
|
||||
"Aggressive Size",
|
||||
"Prefer Accuracy",
|
||||
"Aggressive Accuracy");
|
||||
return true;
|
||||
case 34:
|
||||
*tag_name = "CPU_unaligned_access";
|
||||
KNOWN_VALUES ("None", "v6");
|
||||
return true;
|
||||
case 36:
|
||||
*tag_name = "VFP_HP_extension";
|
||||
KNOWN_VALUES ("Not Allowed", "Allowed");
|
||||
return true;
|
||||
case 38:
|
||||
*tag_name = "ABI_FP_16bit_format";
|
||||
KNOWN_VALUES ("None", "IEEE 754", "Alternative Format");
|
||||
return true;
|
||||
case 64:
|
||||
*tag_name = "nodefaults";
|
||||
return true;
|
||||
case 65:
|
||||
*tag_name = "also_compatible_with";
|
||||
return true;
|
||||
case 66:
|
||||
*tag_name = "T2EE_use";
|
||||
KNOWN_VALUES ("Not Allowed", "Allowed");
|
||||
return true;
|
||||
case 67:
|
||||
*tag_name = "conformance";
|
||||
return true;
|
||||
case 68:
|
||||
*tag_name = "Virtualization_use";
|
||||
KNOWN_VALUES ("Not Allowed", "Allowed");
|
||||
return true;
|
||||
case 70:
|
||||
*tag_name = "MPextension_use";
|
||||
KNOWN_VALUES ("Not Allowed", "Allowed");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
/* ARM-specific auxv handling.
|
||||
Copyright (C) 2009 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND arm_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
int
|
||||
EBLHOOK(auxv_info) (GElf_Xword a_type, const char **name, const char **format)
|
||||
{
|
||||
if (a_type != AT_HWCAP)
|
||||
return 0;
|
||||
|
||||
*name = "HWCAP";
|
||||
*format = "b"
|
||||
"swp\0" "half\0" "thumb\0" "26bit\0"
|
||||
"fast-mult\0" "fpa\0" "vfp\0" "edsp\0"
|
||||
"java\0" "iwmmxt\0"
|
||||
"\0";
|
||||
return 1;
|
||||
}
|
@ -1,90 +0,0 @@
|
||||
/* arm ABI-specified defaults for DWARF CFI.
|
||||
Copyright (C) 2013 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND arm_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
/* ABI-specified state of DWARF CFI based on:
|
||||
|
||||
"DWARF for the ARM Architecture ABI r2.09"
|
||||
http://infocenter.arm.com/help/topic/com.arm.doc.ihi0040b/IHI0040B_aadwarf.pdf
|
||||
|
||||
"Procedure Call Standard for the ARM Architecture ABI r2.09"
|
||||
http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042e/IHI0042E_aapcs.pdf
|
||||
*/
|
||||
|
||||
int
|
||||
arm_abi_cfi (Ebl *ebl __attribute__ ((unused)), Dwarf_CIE *abi_info)
|
||||
{
|
||||
static const uint8_t abi_cfi[] =
|
||||
{
|
||||
/* The initial Canonical Frame Address is the value of the
|
||||
Stack Pointer (r13) as setup in the previous frame. */
|
||||
DW_CFA_def_cfa, ULEB128_7 (13), ULEB128_7 (0),
|
||||
|
||||
/* The Stack Pointer (r13) is restored from CFA address by default. */
|
||||
DW_CFA_val_offset, ULEB128_7 (13), ULEB128_7 (0),
|
||||
|
||||
#define SV(n) DW_CFA_same_value, ULEB128_7 (n)
|
||||
/* Callee-saved regs r4-r8, r10, r11. */
|
||||
SV (4), SV (5), SV (6), SV (7), SV (8), SV (10), SV (11),
|
||||
|
||||
/* The link register contains the return address setup by caller. */
|
||||
SV (14),
|
||||
DW_CFA_register, ULEB128_7 (15), ULEB128_7 (14), /* pc = lr */
|
||||
#undef SV
|
||||
|
||||
/* VFP S16-S31/D8-D15/Q4-Q7 are callee saved.
|
||||
And uleb128 encoded with two bytes. */
|
||||
#define ULEB128_8_2(x) ((x & 0x7f) | 0x80), 0x02
|
||||
#define SV(n) DW_CFA_same_value, ULEB128_8_2 (n)
|
||||
SV (264), SV (265), SV (266), SV (267),
|
||||
SV (268), SV (269), SV (270), SV (271),
|
||||
|
||||
/* XXX Note: registers intentionally unused by the program,
|
||||
for example as a consequence of the procedure call standard
|
||||
should be initialized as if by DW_CFA_same_value. */
|
||||
};
|
||||
#undef ULEB128_8_2
|
||||
#undef SV
|
||||
|
||||
abi_info->initial_instructions = abi_cfi;
|
||||
abi_info->initial_instructions_end = &abi_cfi[sizeof abi_cfi];
|
||||
abi_info->data_alignment_factor = 4;
|
||||
|
||||
abi_info->return_address_register = 15; /* pc. */
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,94 +0,0 @@
|
||||
/* ARM specific core note handling.
|
||||
Copyright (C) 2009, 2012 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <elf.h>
|
||||
#include <inttypes.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#define BACKEND arm_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
static const Ebl_Register_Location prstatus_regs[] =
|
||||
{
|
||||
{ .offset = 0, .regno = 0, .count = 16, .bits = 32 }, /* r0..r15 */
|
||||
{ .offset = 16 * 4, .regno = 128, .count = 1, .bits = 32 }, /* cpsr */
|
||||
};
|
||||
#define PRSTATUS_REGS_SIZE (18 * 4)
|
||||
|
||||
#define PRSTATUS_REGSET_ITEMS \
|
||||
{ \
|
||||
.name = "orig_r0", .type = ELF_T_SWORD, .format = 'd', \
|
||||
.offset = offsetof (struct EBLHOOK(prstatus), pr_reg) + (4 * 17), \
|
||||
.group = "register" \
|
||||
}
|
||||
|
||||
static const Ebl_Register_Location fpregset_regs[] =
|
||||
{
|
||||
{ .offset = 0, .regno = 96, .count = 8, .bits = 96 }, /* f0..f7 */
|
||||
};
|
||||
#define FPREGSET_SIZE 116
|
||||
|
||||
#define ULONG uint32_t
|
||||
#define PID_T int32_t
|
||||
#define UID_T uint16_t
|
||||
#define GID_T uint16_t
|
||||
#define ALIGN_ULONG 4
|
||||
#define ALIGN_PID_T 4
|
||||
#define ALIGN_UID_T 2
|
||||
#define ALIGN_GID_T 2
|
||||
#define TYPE_ULONG ELF_T_WORD
|
||||
#define TYPE_PID_T ELF_T_SWORD
|
||||
#define TYPE_UID_T ELF_T_HALF
|
||||
#define TYPE_GID_T ELF_T_HALF
|
||||
|
||||
#define ARM_VFPREGS_SIZE ( 32 * 8 /*fpregs*/ + 4 /*fpscr*/ )
|
||||
static const Ebl_Register_Location vfp_regs[] =
|
||||
{
|
||||
{ .offset = 0, .regno = 256, .count = 32, .bits = 64 }, /* fpregs */
|
||||
};
|
||||
|
||||
static const Ebl_Core_Item vfp_items[] =
|
||||
{
|
||||
{
|
||||
.name = "fpscr", .group = "register",
|
||||
.offset = 0,
|
||||
.type = ELF_T_WORD, .format = 'x',
|
||||
},
|
||||
};
|
||||
|
||||
#define EXTRA_NOTES \
|
||||
EXTRA_REGSET_ITEMS (NT_ARM_VFP, ARM_VFPREGS_SIZE, vfp_regs, vfp_items)
|
||||
|
||||
#include "linux-core-note.c"
|
@ -1,77 +0,0 @@
|
||||
/* Initialization of Arm specific backend library.
|
||||
Copyright (C) 2002, 2005, 2009, 2013, 2014, 2015, 2017 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND arm_
|
||||
#define RELOC_PREFIX R_ARM_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
/* This defines the common reloc hooks based on arm_reloc.def. */
|
||||
#include "common-reloc.c"
|
||||
|
||||
|
||||
const char *
|
||||
arm_init (Elf *elf __attribute__ ((unused)),
|
||||
GElf_Half machine __attribute__ ((unused)),
|
||||
Ebl *eh,
|
||||
size_t ehlen)
|
||||
{
|
||||
/* Check whether the Elf_BH object has a sufficent size. */
|
||||
if (ehlen < sizeof (Ebl))
|
||||
return NULL;
|
||||
|
||||
/* We handle it. */
|
||||
eh->name = "ARM";
|
||||
arm_init_reloc (eh);
|
||||
HOOK (eh, segment_type_name);
|
||||
HOOK (eh, section_type_name);
|
||||
HOOK (eh, machine_flag_check);
|
||||
HOOK (eh, reloc_simple_type);
|
||||
HOOK (eh, register_info);
|
||||
HOOK (eh, core_note);
|
||||
HOOK (eh, auxv_info);
|
||||
HOOK (eh, check_object_attribute);
|
||||
HOOK (eh, return_value_location);
|
||||
HOOK (eh, abi_cfi);
|
||||
HOOK (eh, check_reloc_target_type);
|
||||
HOOK (eh, symbol_type_name);
|
||||
HOOK (eh, data_marker_symbol);
|
||||
|
||||
/* We only unwind the core integer registers. */
|
||||
eh->frame_nregs = 16;
|
||||
HOOK (eh, set_initial_registers_tid);
|
||||
|
||||
/* Bit zero encodes whether an function address is THUMB or ARM. */
|
||||
eh->func_addr_mask = ~(GElf_Addr)1;
|
||||
|
||||
return MODVERSION;
|
||||
}
|
@ -1,94 +0,0 @@
|
||||
/* Fetch live process registers from TID.
|
||||
Copyright (C) 2014 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
#if defined __arm__
|
||||
# include <sys/types.h>
|
||||
# include <sys/user.h>
|
||||
# include <sys/ptrace.h>
|
||||
#endif
|
||||
|
||||
#ifdef __aarch64__
|
||||
# include <linux/uio.h>
|
||||
# include <sys/user.h>
|
||||
# include <sys/ptrace.h>
|
||||
/* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */
|
||||
# ifndef HAVE_SYS_USER_REGS
|
||||
# define user_regs_struct user_pt_regs
|
||||
# endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define BACKEND arm_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
bool
|
||||
arm_set_initial_registers_tid (pid_t tid __attribute__ ((unused)),
|
||||
ebl_tid_registers_t *setfunc __attribute__ ((unused)),
|
||||
void *arg __attribute__ ((unused)))
|
||||
{
|
||||
#if !defined(__linux__) || (!defined __arm__ && !defined __aarch64__)
|
||||
return false;
|
||||
#else /* __arm__ || __aarch64__ */
|
||||
#if defined __arm__
|
||||
struct user_regs user_regs;
|
||||
if (ptrace (PTRACE_GETREGS, tid, NULL, &user_regs) != 0)
|
||||
return false;
|
||||
|
||||
Dwarf_Word dwarf_regs[16];
|
||||
/* R0..R12 SP LR PC */
|
||||
for (int i = 0; i < 16; i++)
|
||||
dwarf_regs[i] = user_regs.uregs[i];
|
||||
|
||||
return setfunc (0, 16, dwarf_regs, arg);
|
||||
#elif defined __aarch64__
|
||||
/* Compat mode: arm compatible code running on aarch64 */
|
||||
int i;
|
||||
struct user_regs_struct gregs;
|
||||
struct iovec iovec;
|
||||
iovec.iov_base = &gregs;
|
||||
iovec.iov_len = sizeof (gregs);
|
||||
if (ptrace (PTRACE_GETREGSET, tid, NT_PRSTATUS, &iovec) != 0)
|
||||
return false;
|
||||
|
||||
Dwarf_Word dwarf_regs[16];
|
||||
/* R0..R12 SP LR PC, encoded as 32 bit quantities */
|
||||
uint32_t *u32_ptr = (uint32_t *) &gregs.regs[0];
|
||||
for (i = 0; i < 16; i++)
|
||||
dwarf_regs[i] = u32_ptr[i];
|
||||
|
||||
return setfunc (0, 16, dwarf_regs, arg);
|
||||
#else
|
||||
# error "source file error, it cannot happen"
|
||||
#endif
|
||||
#endif
|
||||
}
|
@ -1,120 +0,0 @@
|
||||
/* Register names and numbers for ARM DWARF.
|
||||
Copyright (C) 2009 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND arm_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
ssize_t
|
||||
arm_register_info (Ebl *ebl __attribute__ ((unused)),
|
||||
int regno, char *name, size_t namelen,
|
||||
const char **prefix, const char **setname,
|
||||
int *bits, int *type)
|
||||
{
|
||||
if (name == NULL)
|
||||
return 320;
|
||||
|
||||
if (regno < 0 || regno > 320 || namelen < 5)
|
||||
return -1;
|
||||
|
||||
*prefix = "";
|
||||
*bits = 32;
|
||||
*type = DW_ATE_signed;
|
||||
*setname = "integer";
|
||||
|
||||
switch (regno)
|
||||
{
|
||||
case 0 ... 9:
|
||||
name[0] = 'r';
|
||||
name[1] = regno + '0';
|
||||
namelen = 2;
|
||||
break;
|
||||
|
||||
case 10 ... 12:
|
||||
name[0] = 'r';
|
||||
name[1] = '1';
|
||||
name[2] = regno % 10 + '0';
|
||||
namelen = 3;
|
||||
break;
|
||||
|
||||
case 13 ... 15:
|
||||
*type = DW_ATE_address;
|
||||
name[0] = "slp"[regno - 13];
|
||||
name[1] = "prc"[regno - 13];
|
||||
namelen = 2;
|
||||
break;
|
||||
|
||||
case 16 + 0 ... 16 + 7:
|
||||
regno += 96 - 16;
|
||||
/* Fall through. */
|
||||
case 96 + 0 ... 96 + 7:
|
||||
*setname = "FPA";
|
||||
*type = DW_ATE_float;
|
||||
*bits = 96;
|
||||
name[0] = 'f';
|
||||
name[1] = regno - 96 + '0';
|
||||
namelen = 2;
|
||||
break;
|
||||
|
||||
case 128:
|
||||
*type = DW_ATE_unsigned;
|
||||
return stpcpy (name, "spsr") + 1 - name;
|
||||
|
||||
case 256 + 0 ... 256 + 9:
|
||||
*setname = "VFP";
|
||||
*type = DW_ATE_float;
|
||||
*bits = 64;
|
||||
name[0] = 'd';
|
||||
name[1] = regno - 256 + '0';
|
||||
namelen = 2;
|
||||
break;
|
||||
|
||||
case 256 + 10 ... 256 + 31:
|
||||
*setname = "VFP";
|
||||
*type = DW_ATE_float;
|
||||
*bits = 64;
|
||||
name[0] = 'd';
|
||||
name[1] = (regno - 256) / 10 + '0';
|
||||
name[2] = (regno - 256) % 10 + '0';
|
||||
namelen = 3;
|
||||
break;
|
||||
|
||||
default:
|
||||
*setname = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
name[namelen++] = '\0';
|
||||
return namelen;
|
||||
}
|
@ -1,157 +0,0 @@
|
||||
/* List the relocation types for arm. -*- C -*-
|
||||
Copyright (C) 2005-2010, 2014, 2015 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/>. */
|
||||
|
||||
/* NAME, REL|EXEC|DYN */
|
||||
|
||||
RELOC_TYPE (NONE, REL) /* It really is used in ET_REL on ARM. */
|
||||
RELOC_TYPE (PC24, REL|EXEC|DYN)
|
||||
RELOC_TYPE (ABS32, REL|EXEC|DYN)
|
||||
RELOC_TYPE (REL32, REL)
|
||||
RELOC_TYPE (PC13, REL)
|
||||
RELOC_TYPE (ABS16, REL)
|
||||
RELOC_TYPE (ABS12, REL)
|
||||
RELOC_TYPE (THM_ABS5, REL)
|
||||
RELOC_TYPE (ABS8, REL)
|
||||
RELOC_TYPE (SBREL32, REL)
|
||||
RELOC_TYPE (THM_PC22, REL)
|
||||
RELOC_TYPE (THM_PC8, REL)
|
||||
RELOC_TYPE (AMP_VCALL9, REL)
|
||||
RELOC_TYPE (TLS_DESC, EXEC|DYN)
|
||||
RELOC_TYPE (THM_SWI8, REL)
|
||||
RELOC_TYPE (XPC25, REL)
|
||||
RELOC_TYPE (THM_XPC22, REL)
|
||||
RELOC_TYPE (TLS_DTPMOD32, EXEC|DYN)
|
||||
RELOC_TYPE (TLS_DTPOFF32, EXEC|DYN)
|
||||
RELOC_TYPE (TLS_TPOFF32, EXEC|DYN)
|
||||
RELOC_TYPE (COPY, EXEC|DYN)
|
||||
RELOC_TYPE (GLOB_DAT, EXEC|DYN)
|
||||
RELOC_TYPE (JUMP_SLOT, EXEC|DYN)
|
||||
RELOC_TYPE (RELATIVE, EXEC|DYN)
|
||||
RELOC_TYPE (GOTOFF, REL)
|
||||
RELOC_TYPE (GOTPC, REL)
|
||||
RELOC_TYPE (GOT32, REL)
|
||||
RELOC_TYPE (PLT32, REL)
|
||||
RELOC_TYPE (CALL, REL)
|
||||
RELOC_TYPE (JUMP24, REL)
|
||||
RELOC_TYPE (THM_JUMP24, REL)
|
||||
RELOC_TYPE (BASE_ABS, REL)
|
||||
RELOC_TYPE (ALU_PCREL_7_0, REL)
|
||||
RELOC_TYPE (ALU_PCREL_15_8, REL)
|
||||
RELOC_TYPE (ALU_PCREL_23_15, REL)
|
||||
RELOC_TYPE (LDR_SBREL_11_0, REL)
|
||||
RELOC_TYPE (ALU_SBREL_19_12, REL)
|
||||
RELOC_TYPE (ALU_SBREL_27_20, REL)
|
||||
RELOC_TYPE (TARGET1, REL)
|
||||
RELOC_TYPE (SBREL31, REL)
|
||||
RELOC_TYPE (V4BX, REL)
|
||||
RELOC_TYPE (TARGET2, REL)
|
||||
RELOC_TYPE (PREL31, REL)
|
||||
RELOC_TYPE (MOVW_ABS_NC, REL)
|
||||
RELOC_TYPE (MOVT_ABS, REL)
|
||||
RELOC_TYPE (MOVW_PREL_NC, REL)
|
||||
RELOC_TYPE (MOVT_PREL, REL)
|
||||
RELOC_TYPE (THM_MOVW_ABS_NC, REL)
|
||||
RELOC_TYPE (THM_MOVT_ABS, REL)
|
||||
RELOC_TYPE (THM_MOVW_PREL_NC, REL)
|
||||
RELOC_TYPE (THM_MOVT_PREL, REL)
|
||||
RELOC_TYPE (THM_JUMP19, REL)
|
||||
RELOC_TYPE (THM_JUMP6, REL)
|
||||
RELOC_TYPE (THM_ALU_PREL_11_0, REL)
|
||||
RELOC_TYPE (THM_PC12, REL)
|
||||
RELOC_TYPE (ABS32_NOI, REL)
|
||||
RELOC_TYPE (REL32_NOI, REL)
|
||||
RELOC_TYPE (ALU_PC_G0_NC, REL)
|
||||
RELOC_TYPE (ALU_PC_G0, REL)
|
||||
RELOC_TYPE (ALU_PC_G1_NC, REL)
|
||||
RELOC_TYPE (ALU_PC_G1, REL)
|
||||
RELOC_TYPE (ALU_PC_G2, REL)
|
||||
RELOC_TYPE (LDR_PC_G1, REL)
|
||||
RELOC_TYPE (LDR_PC_G2, REL)
|
||||
RELOC_TYPE (LDRS_PC_G0, REL)
|
||||
RELOC_TYPE (LDRS_PC_G1, REL)
|
||||
RELOC_TYPE (LDRS_PC_G2, REL)
|
||||
RELOC_TYPE (LDC_PC_G0, REL)
|
||||
RELOC_TYPE (LDC_PC_G1, REL)
|
||||
RELOC_TYPE (LDC_PC_G2, REL)
|
||||
RELOC_TYPE (ALU_SB_G0_NC, REL)
|
||||
RELOC_TYPE (ALU_SB_G0, REL)
|
||||
RELOC_TYPE (ALU_SB_G1_NC, REL)
|
||||
RELOC_TYPE (ALU_SB_G1, REL)
|
||||
RELOC_TYPE (ALU_SB_G2, REL)
|
||||
RELOC_TYPE (LDR_SB_G0, REL)
|
||||
RELOC_TYPE (LDR_SB_G1, REL)
|
||||
RELOC_TYPE (LDR_SB_G2, REL)
|
||||
RELOC_TYPE (LDRS_SB_G0, REL)
|
||||
RELOC_TYPE (LDRS_SB_G1, REL)
|
||||
RELOC_TYPE (LDRS_SB_G2, REL)
|
||||
RELOC_TYPE (LDC_SB_G0, REL)
|
||||
RELOC_TYPE (LDC_SB_G1, REL)
|
||||
RELOC_TYPE (LDC_SB_G2, REL)
|
||||
RELOC_TYPE (MOVW_BREL_NC, REL)
|
||||
RELOC_TYPE (MOVT_BREL, REL)
|
||||
RELOC_TYPE (MOVW_BREL, REL)
|
||||
RELOC_TYPE (THM_MOVW_BREL_NC, REL)
|
||||
RELOC_TYPE (THM_MOVT_BREL, REL)
|
||||
RELOC_TYPE (THM_MOVW_BREL, REL)
|
||||
RELOC_TYPE (TLS_GOTDESC, REL)
|
||||
RELOC_TYPE (TLS_CALL, REL)
|
||||
RELOC_TYPE (TLS_DESCSEQ, REL)
|
||||
RELOC_TYPE (THM_TLS_CALL, REL)
|
||||
RELOC_TYPE (PLT32_ABS, REL)
|
||||
RELOC_TYPE (GOT_ABS, REL)
|
||||
RELOC_TYPE (GOT_PREL, REL)
|
||||
RELOC_TYPE (GOT_BREL12, REL)
|
||||
RELOC_TYPE (GOTOFF12, REL)
|
||||
RELOC_TYPE (GOTRELAX, REL)
|
||||
RELOC_TYPE (GNU_VTENTRY, REL)
|
||||
RELOC_TYPE (GNU_VTINHERIT, REL)
|
||||
RELOC_TYPE (THM_PC11, REL)
|
||||
RELOC_TYPE (THM_PC9, REL)
|
||||
RELOC_TYPE (TLS_GD32, REL)
|
||||
RELOC_TYPE (TLS_LDM32, REL)
|
||||
RELOC_TYPE (TLS_LDO32, REL)
|
||||
RELOC_TYPE (TLS_IE32, REL)
|
||||
RELOC_TYPE (TLS_LE32, REL)
|
||||
RELOC_TYPE (TLS_LDO12, REL)
|
||||
RELOC_TYPE (TLS_LE12, REL)
|
||||
RELOC_TYPE (TLS_IE12GP, REL)
|
||||
|
||||
RELOC_TYPE (ME_TOO, REL)
|
||||
RELOC_TYPE (THM_TLS_DESCSEQ16, REL)
|
||||
RELOC_TYPE (THM_TLS_DESCSEQ32, REL)
|
||||
RELOC_TYPE (THM_GOT_BREL12, REL)
|
||||
|
||||
RELOC_TYPE (IRELATIVE, EXEC|DYN)
|
||||
|
||||
RELOC_TYPE (RXPC25, REL)
|
||||
RELOC_TYPE (RSBREL32, REL)
|
||||
RELOC_TYPE (THM_RPC22, REL)
|
||||
RELOC_TYPE (RREL32, REL)
|
||||
RELOC_TYPE (RABS22, REL)
|
||||
RELOC_TYPE (RPC24, REL)
|
||||
RELOC_TYPE (RBASE, REL)
|
@ -1,127 +0,0 @@
|
||||
/* Function return value location for ARM EABI.
|
||||
Copyright (C) 2009-2010, 2014 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND arm_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
/* r0, or pair r0, r1, or aggregate up to r0-r3. */
|
||||
static const Dwarf_Op loc_intreg[] =
|
||||
{
|
||||
{ .atom = DW_OP_reg0 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
{ .atom = DW_OP_reg1 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
{ .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
{ .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
};
|
||||
#define nloc_intreg 1
|
||||
#define nloc_intregs(n) (2 * (n))
|
||||
|
||||
/* The return value is a structure and is actually stored in stack space
|
||||
passed in a hidden argument by the caller. But, the compiler
|
||||
helpfully returns the address of that space in r0. */
|
||||
static const Dwarf_Op loc_aggregate[] =
|
||||
{
|
||||
{ .atom = DW_OP_breg0, .number = 0 }
|
||||
};
|
||||
#define nloc_aggregate 1
|
||||
|
||||
|
||||
int
|
||||
arm_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_Die die_mem, *typedie = &die_mem;
|
||||
int tag = dwarf_peeled_die_type (functypedie, typedie);
|
||||
if (tag <= 0)
|
||||
return tag;
|
||||
|
||||
Dwarf_Word size;
|
||||
switch (tag)
|
||||
{
|
||||
case -1:
|
||||
return -1;
|
||||
|
||||
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_OR_RETURN (typedie);
|
||||
}
|
||||
/* Fall through. */
|
||||
|
||||
case DW_TAG_base_type:
|
||||
case DW_TAG_enumeration_type:
|
||||
case DW_TAG_pointer_type:
|
||||
case DW_TAG_ptr_to_member_type:
|
||||
{
|
||||
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 = 4;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
if (size <= 16)
|
||||
{
|
||||
intreg:
|
||||
*locp = loc_intreg;
|
||||
return size <= 4 ? nloc_intreg : nloc_intregs ((size + 3) / 4);
|
||||
}
|
||||
|
||||
aggregate:
|
||||
*locp = loc_aggregate;
|
||||
return nloc_aggregate;
|
||||
}
|
||||
|
||||
case DW_TAG_structure_type:
|
||||
case DW_TAG_class_type:
|
||||
case DW_TAG_union_type:
|
||||
case DW_TAG_array_type:
|
||||
if (dwarf_aggregate_size (typedie, &size) == 0
|
||||
&& size > 0 && size <= 4)
|
||||
goto intreg;
|
||||
goto aggregate;
|
||||
}
|
||||
|
||||
/* XXX We don't have a good way to return specific errors from ebl calls.
|
||||
This value means we do not understand the type, but it is well-formed
|
||||
DWARF and might be valid. */
|
||||
return -2;
|
||||
}
|
@ -1,157 +0,0 @@
|
||||
/* Arm specific symbolic name handling.
|
||||
Copyright (C) 2002-2009, 2014, 2015, 2017 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <elf.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#define BACKEND arm_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
const char *
|
||||
arm_segment_type_name (int segment, char *buf __attribute__ ((unused)),
|
||||
size_t len __attribute__ ((unused)))
|
||||
{
|
||||
switch (segment)
|
||||
{
|
||||
case PT_ARM_EXIDX:
|
||||
return "ARM_EXIDX";
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Return symbolic representation of section type. */
|
||||
const char *
|
||||
arm_section_type_name (int type,
|
||||
char *buf __attribute__ ((unused)),
|
||||
size_t len __attribute__ ((unused)))
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case SHT_ARM_EXIDX:
|
||||
return "ARM_EXIDX";
|
||||
case SHT_ARM_PREEMPTMAP:
|
||||
return "ARM_PREEMPTMAP";
|
||||
case SHT_ARM_ATTRIBUTES:
|
||||
return "ARM_ATTRIBUTES";
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Check whether machine flags are valid. */
|
||||
bool
|
||||
arm_machine_flag_check (GElf_Word flags)
|
||||
{
|
||||
switch (flags & EF_ARM_EABIMASK)
|
||||
{
|
||||
case EF_ARM_EABI_UNKNOWN:
|
||||
case EF_ARM_EABI_VER1:
|
||||
case EF_ARM_EABI_VER2:
|
||||
case EF_ARM_EABI_VER3:
|
||||
case EF_ARM_EABI_VER4:
|
||||
case EF_ARM_EABI_VER5:
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return ((flags &~ (EF_ARM_EABIMASK
|
||||
| EF_ARM_RELEXEC
|
||||
| EF_ARM_HASENTRY
|
||||
| EF_ARM_INTERWORK
|
||||
| EF_ARM_APCS_26
|
||||
| EF_ARM_APCS_FLOAT
|
||||
| EF_ARM_PIC
|
||||
| EF_ARM_ALIGN8
|
||||
| EF_ARM_NEW_ABI
|
||||
| EF_ARM_OLD_ABI
|
||||
| EF_ARM_SOFT_FLOAT
|
||||
| EF_ARM_VFP_FLOAT
|
||||
| EF_ARM_MAVERICK_FLOAT
|
||||
| EF_ARM_SYMSARESORTED
|
||||
| EF_ARM_DYNSYMSUSESEGIDX
|
||||
| EF_ARM_MAPSYMSFIRST
|
||||
| EF_ARM_EABIMASK
|
||||
| EF_ARM_BE8
|
||||
| EF_ARM_LE8)) == 0);
|
||||
}
|
||||
|
||||
/* Check for the simple reloc types. */
|
||||
Elf_Type
|
||||
arm_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case R_ARM_ABS32:
|
||||
return ELF_T_WORD;
|
||||
case R_ARM_ABS16:
|
||||
return ELF_T_HALF;
|
||||
case R_ARM_ABS8:
|
||||
return ELF_T_BYTE;
|
||||
default:
|
||||
return ELF_T_NUM;
|
||||
}
|
||||
}
|
||||
|
||||
/* The SHT_ARM_EXIDX section type is a valid target for relocation. */
|
||||
bool
|
||||
arm_check_reloc_target_type (Ebl *ebl __attribute__ ((unused)), Elf64_Word sh_type)
|
||||
{
|
||||
return sh_type == SHT_ARM_EXIDX;
|
||||
}
|
||||
|
||||
const char *
|
||||
arm_symbol_type_name (int type,
|
||||
char *buf __attribute__ ((unused)),
|
||||
size_t len __attribute__ ((unused)))
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case STT_ARM_TFUNC:
|
||||
return "ARM_TFUNC";
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* A data mapping symbol is a symbol with "$d" name or "$d.<any...>" name,
|
||||
* STT_NOTYPE, STB_LOCAL and st_size of zero. The indicate the stat of a
|
||||
* sequence of data items. */
|
||||
bool
|
||||
arm_data_marker_symbol (const GElf_Sym *sym, const char *sname)
|
||||
{
|
||||
return (sym != NULL && sname != NULL
|
||||
&& sym->st_size == 0 && GELF_ST_BIND (sym->st_info) == STB_LOCAL
|
||||
&& GELF_ST_TYPE (sym->st_info) == STT_NOTYPE
|
||||
&& (strcmp (sname, "$d") == 0 || strncmp (sname, "$d.", 3) == 0));
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
/* Initialization of BPF specific backend library.
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND bpf_
|
||||
#define RELOC_PREFIX R_BPF_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
/* This defines the common reloc hooks based on bpf_reloc.def. */
|
||||
#define NO_RELATIVE_RELOC
|
||||
#define NO_COPY_RELOC
|
||||
#include "common-reloc.c"
|
||||
|
||||
|
||||
const char *
|
||||
bpf_init (Elf *elf __attribute__ ((unused)),
|
||||
GElf_Half machine __attribute__ ((unused)),
|
||||
Ebl *eh, size_t ehlen)
|
||||
{
|
||||
/* Check whether the Elf_BH object has a sufficent size. */
|
||||
if (ehlen < sizeof (Ebl))
|
||||
return NULL;
|
||||
|
||||
/* We handle it. */
|
||||
eh->name = "BPF";
|
||||
bpf_init_reloc (eh);
|
||||
HOOK (eh, register_info);
|
||||
HOOK (eh, disasm);
|
||||
|
||||
return MODVERSION;
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
/* Register names and numbers for BPF DWARF.
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "bpf.h"
|
||||
|
||||
#define BACKEND bpf_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
ssize_t
|
||||
bpf_register_info (Ebl *ebl __attribute__ ((unused)),
|
||||
int regno, char *name, size_t namelen,
|
||||
const char **prefix, const char **setname,
|
||||
int *bits, int *type)
|
||||
{
|
||||
ssize_t len;
|
||||
|
||||
if (name == NULL)
|
||||
return MAX_BPF_REG;
|
||||
if (regno < 0 || regno >= MAX_BPF_REG)
|
||||
return -1;
|
||||
|
||||
*prefix = "";
|
||||
*setname = "integer";
|
||||
*bits = 64;
|
||||
*type = DW_ATE_signed;
|
||||
|
||||
len = snprintf(name, namelen, "r%d", regno);
|
||||
return ((size_t)len < namelen ? len : -1);
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
/* List the relocation types for BPF. -*- C -*-
|
||||
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/>. */
|
||||
|
||||
/* NAME, REL|EXEC|DYN */
|
||||
|
||||
RELOC_TYPE (NONE, EXEC|DYN)
|
||||
RELOC_TYPE (MAP_FD, REL|EXEC|DYN)
|
@ -1,162 +0,0 @@
|
||||
/* Common code for ebl reloc functions.
|
||||
Copyright (C) 2005, 2006 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/>. */
|
||||
|
||||
#include "libebl_CPU.h"
|
||||
#include <assert.h>
|
||||
|
||||
#define R_TYPE(name) PASTE (RELOC_PREFIX, name)
|
||||
#define PASTE(a, b) PASTE_1 (a, b)
|
||||
#define PASTE_1(a, b) a##b
|
||||
#define R_NAME(name) R_NAME_1 (RELOC_PREFIX, name)
|
||||
#define R_NAME_1(prefix, type) R_NAME_2 (prefix, type)
|
||||
#define R_NAME_2(prefix, type) #prefix #type
|
||||
|
||||
#define RELOC_TYPES STRINGIFIED_PASTE (BACKEND, reloc.def)
|
||||
#define STRINGIFIED_PASTE(a, b) STRINGIFY (PASTE (a, b))
|
||||
#define STRINGIFY(x) STRINGIFY_1 (x)
|
||||
#define STRINGIFY_1(x) #x
|
||||
|
||||
/* Provide a table of reloc type names, in a PIC-friendly fashion. */
|
||||
|
||||
static const struct EBLHOOK(reloc_nametable)
|
||||
{
|
||||
char zero;
|
||||
#define RELOC_TYPE(type, uses) \
|
||||
char name_##type[sizeof R_NAME (type)];
|
||||
#include RELOC_TYPES
|
||||
#undef RELOC_TYPE
|
||||
} EBLHOOK(reloc_nametable) =
|
||||
{
|
||||
'\0',
|
||||
#define RELOC_TYPE(type, uses) R_NAME (type),
|
||||
#include RELOC_TYPES
|
||||
#undef RELOC_TYPE
|
||||
};
|
||||
#define reloc_namestr (&EBLHOOK(reloc_nametable).zero)
|
||||
|
||||
static const uint_fast16_t EBLHOOK(reloc_nameidx)[] =
|
||||
{
|
||||
#define RELOC_TYPE(type, uses) \
|
||||
[R_TYPE (type)] = offsetof (struct EBLHOOK(reloc_nametable), name_##type),
|
||||
#include RELOC_TYPES
|
||||
#undef RELOC_TYPE
|
||||
};
|
||||
#define nreloc \
|
||||
((int) (sizeof EBLHOOK(reloc_nameidx) / sizeof EBLHOOK(reloc_nameidx)[0]))
|
||||
|
||||
#define REL (1 << (ET_REL - 1))
|
||||
#define EXEC (1 << (ET_EXEC - 1))
|
||||
#define DYN (1 << (ET_DYN - 1))
|
||||
static const uint8_t EBLHOOK(reloc_valid)[] =
|
||||
{
|
||||
#define RELOC_TYPE(type, uses) [R_TYPE (type)] = uses,
|
||||
#include RELOC_TYPES
|
||||
#undef RELOC_TYPE
|
||||
};
|
||||
#undef REL
|
||||
#undef EXEC
|
||||
#undef DYN
|
||||
|
||||
const char *
|
||||
EBLHOOK(reloc_type_name) (int reloc,
|
||||
char *buf __attribute__ ((unused)),
|
||||
size_t len __attribute__ ((unused)))
|
||||
{
|
||||
#ifdef RELOC_TYPE_ID
|
||||
reloc = RELOC_TYPE_ID (reloc);
|
||||
#endif
|
||||
|
||||
if (reloc >= 0 && reloc < nreloc && EBLHOOK(reloc_nameidx)[reloc] != 0)
|
||||
return &reloc_namestr[EBLHOOK(reloc_nameidx)[reloc]];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool
|
||||
EBLHOOK(reloc_type_check) (int reloc)
|
||||
{
|
||||
#ifdef RELOC_TYPE_ID
|
||||
reloc = RELOC_TYPE_ID (reloc);
|
||||
#endif
|
||||
|
||||
return reloc >= 0 && reloc < nreloc && EBLHOOK(reloc_nameidx)[reloc] != 0;
|
||||
}
|
||||
|
||||
bool
|
||||
EBLHOOK(reloc_valid_use) (Elf *elf, int reloc)
|
||||
{
|
||||
uint8_t uses;
|
||||
|
||||
GElf_Ehdr ehdr_mem;
|
||||
GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
|
||||
assert (ehdr != NULL);
|
||||
uint8_t type = ehdr->e_type;
|
||||
|
||||
#ifdef RELOC_TYPE_ID
|
||||
reloc = RELOC_TYPE_ID (reloc);
|
||||
#endif
|
||||
|
||||
uses = EBLHOOK(reloc_valid)[reloc];
|
||||
return type > ET_NONE && type < ET_CORE && (uses & (1 << (type - 1)));
|
||||
}
|
||||
|
||||
#ifndef NO_COPY_RELOC
|
||||
bool
|
||||
EBLHOOK(copy_reloc_p) (int reloc)
|
||||
{
|
||||
return reloc == R_TYPE (COPY);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool
|
||||
EBLHOOK(none_reloc_p) (int reloc)
|
||||
{
|
||||
return reloc == R_TYPE (NONE);
|
||||
}
|
||||
|
||||
#ifndef NO_RELATIVE_RELOC
|
||||
bool
|
||||
EBLHOOK(relative_reloc_p) (int reloc)
|
||||
{
|
||||
return reloc == R_TYPE (RELATIVE);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
EBLHOOK(init_reloc) (Ebl *ebl)
|
||||
{
|
||||
ebl->reloc_type_name = EBLHOOK(reloc_type_name);
|
||||
ebl->reloc_type_check = EBLHOOK(reloc_type_check);
|
||||
ebl->reloc_valid_use = EBLHOOK(reloc_valid_use);
|
||||
ebl->none_reloc_p = EBLHOOK(none_reloc_p);
|
||||
#ifndef NO_COPY_RELOC
|
||||
ebl->copy_reloc_p = EBLHOOK(copy_reloc_p);
|
||||
#endif
|
||||
#ifndef NO_RELATIVE_RELOC
|
||||
ebl->relative_reloc_p = EBLHOOK(relative_reloc_p);
|
||||
#endif
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
/* i386 specific auxv handling.
|
||||
Copyright (C) 2007 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND i386_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
int
|
||||
EBLHOOK(auxv_info) (GElf_Xword a_type, const char **name, const char **format)
|
||||
{
|
||||
if (a_type != AT_HWCAP)
|
||||
return 0;
|
||||
|
||||
*name = "HWCAP";
|
||||
*format = "b"
|
||||
"fpu\0" "vme\0" "de\0" "pse\0" "tsc\0" "msr\0" "pae\0" "mce\0"
|
||||
"cx8\0" "apic\0" "10\0" "sep\0" "mtrr\0" "pge\0" "mca\0" "cmov\0"
|
||||
"pat\0" "pse36\0" "pn\0" "clflush\0" "20\0" "dts\0" "acpi\0" "mmx\0"
|
||||
"fxsr\0" "sse\0" "sse2\0" "ss\0" "ht\0" "tm\0" "ia64\0" "pbe\0" "\0";
|
||||
return 1;
|
||||
}
|
||||
|
||||
__typeof (i386_auxv_info) x86_64_auxv_info
|
||||
__attribute__ ((alias ("i386_auxv_info")));
|
@ -1,68 +0,0 @@
|
||||
/* i386 ABI-specified defaults for DWARF CFI.
|
||||
Copyright (C) 2009 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND i386_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
int
|
||||
i386_abi_cfi (Ebl *ebl __attribute__ ((unused)), Dwarf_CIE *abi_info)
|
||||
{
|
||||
static const uint8_t abi_cfi[] =
|
||||
{
|
||||
/* Call-saved regs. */
|
||||
DW_CFA_same_value, ULEB128_7 (3), /* %ebx */
|
||||
DW_CFA_same_value, ULEB128_7 (5), /* %ebp */
|
||||
DW_CFA_same_value, ULEB128_7 (6), /* %esi */
|
||||
DW_CFA_same_value, ULEB128_7 (7), /* %edi */
|
||||
|
||||
/* The CFA is the SP. */
|
||||
DW_CFA_val_offset, ULEB128_7 (4), ULEB128_7 (0),
|
||||
|
||||
/* Segment registers are call-saved if ever used at all. */
|
||||
DW_CFA_same_value, ULEB128_7 (40), /* %es */
|
||||
DW_CFA_same_value, ULEB128_7 (41), /* %cs */
|
||||
DW_CFA_same_value, ULEB128_7 (42), /* %ss */
|
||||
DW_CFA_same_value, ULEB128_7 (43), /* %ds */
|
||||
DW_CFA_same_value, ULEB128_7 (44), /* %fs */
|
||||
DW_CFA_same_value, ULEB128_7 (45), /* %gs */
|
||||
};
|
||||
|
||||
abi_info->initial_instructions = abi_cfi;
|
||||
abi_info->initial_instructions_end = &abi_cfi[sizeof abi_cfi];
|
||||
abi_info->data_alignment_factor = 4;
|
||||
|
||||
abi_info->return_address_register = 8; /* %eip */
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,138 +0,0 @@
|
||||
/* i386 specific core note handling.
|
||||
Copyright (C) 2007-2010 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <elf.h>
|
||||
#include <inttypes.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#define BACKEND i386_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
static const Ebl_Register_Location prstatus_regs[] =
|
||||
{
|
||||
#define GR(at, n, dwreg) \
|
||||
{ .offset = at * 4, .regno = dwreg, .count = n, .bits = 32 }
|
||||
#define SR(at, n, dwreg) \
|
||||
{ .offset = at * 4, .regno = dwreg, .count = n, .bits = 16, .pad = 2 }
|
||||
|
||||
GR (0, 1, 3), /* %ebx */
|
||||
GR (1, 2, 1), /* %ecx-%edx */
|
||||
GR (3, 2, 6), /* %esi-%edi */
|
||||
GR (5, 1, 5), /* %ebp */
|
||||
GR (6, 1, 0), /* %eax */
|
||||
SR (7, 1, 43), /* %ds */
|
||||
SR (8, 1, 40), /* %es */
|
||||
SR (9, 1, 44), /* %fs */
|
||||
SR (10, 1, 45), /* %gs */
|
||||
/* 11, 1, orig_eax */
|
||||
GR (12, 1, 8), /* %eip */
|
||||
SR (13, 1, 41), /* %cs */
|
||||
GR (14, 1, 9), /* eflags */
|
||||
GR (15, 1, 4), /* %esp */
|
||||
SR (16, 1, 42), /* %ss */
|
||||
|
||||
#undef GR
|
||||
#undef SR
|
||||
};
|
||||
#define PRSTATUS_REGS_SIZE (17 * 4)
|
||||
|
||||
#define ULONG uint32_t
|
||||
#define PID_T int32_t
|
||||
#define UID_T uint16_t
|
||||
#define GID_T uint16_t
|
||||
#define ALIGN_ULONG 4
|
||||
#define ALIGN_PID_T 4
|
||||
#define ALIGN_UID_T 2
|
||||
#define ALIGN_GID_T 2
|
||||
#define TYPE_ULONG ELF_T_WORD
|
||||
#define TYPE_PID_T ELF_T_SWORD
|
||||
#define TYPE_UID_T ELF_T_HALF
|
||||
#define TYPE_GID_T ELF_T_HALF
|
||||
|
||||
#define PRSTATUS_REGSET_ITEMS \
|
||||
{ \
|
||||
.name = "orig_eax", .type = ELF_T_SWORD, .format = 'd', \
|
||||
.offset = offsetof (struct EBLHOOK(prstatus), pr_reg) + (4 * 11), \
|
||||
.group = "register" \
|
||||
}
|
||||
|
||||
static const Ebl_Register_Location fpregset_regs[] =
|
||||
{
|
||||
{ .offset = 0, .regno = 37, .count = 2, .bits = 32 }, /* fctrl-fstat */
|
||||
{ .offset = 7 * 4, .regno = 11, .count = 8, .bits = 80 }, /* stN */
|
||||
};
|
||||
#define FPREGSET_SIZE 108
|
||||
|
||||
static const Ebl_Register_Location prxfpreg_regs[] =
|
||||
{
|
||||
{ .offset = 0, .regno = 37, .count = 2, .bits = 16 }, /* fctrl-fstat */
|
||||
{ .offset = 24, .regno = 39, .count = 1, .bits = 32 }, /* mxcsr */
|
||||
{ .offset = 32, .regno = 11, .count = 8, .bits = 80, .pad = 6 }, /* stN */
|
||||
{ .offset = 32 + 128, .regno = 21, .count = 8, .bits = 128 }, /* xmm */
|
||||
};
|
||||
|
||||
#define EXTRA_NOTES \
|
||||
EXTRA_REGSET (NT_PRXFPREG, 512, prxfpreg_regs) \
|
||||
case NT_386_TLS: \
|
||||
return tls_info (nhdr->n_descsz, regs_offset, nregloc, reglocs, \
|
||||
nitems, items); \
|
||||
EXTRA_NOTES_IOPERM
|
||||
|
||||
static const Ebl_Core_Item tls_items[] =
|
||||
{
|
||||
{ .type = ELF_T_WORD, .offset = 0x0, .format = 'd', .name = "index" },
|
||||
{ .type = ELF_T_WORD, .offset = 0x4, .format = 'x', .name = "base" },
|
||||
{ .type = ELF_T_WORD, .offset = 0x8, .format = 'x', .name = "limit" },
|
||||
{ .type = ELF_T_WORD, .offset = 0xc, .format = 'x', .name = "flags" },
|
||||
};
|
||||
|
||||
static int
|
||||
tls_info (GElf_Word descsz, GElf_Word *regs_offset,
|
||||
size_t *nregloc, const Ebl_Register_Location **reglocs,
|
||||
size_t *nitems, const Ebl_Core_Item **items)
|
||||
{
|
||||
if (descsz % 16 != 0)
|
||||
return 0;
|
||||
|
||||
*regs_offset = 0;
|
||||
*nregloc = 0;
|
||||
*reglocs = NULL;
|
||||
*nitems = sizeof tls_items / sizeof tls_items[0];
|
||||
*items = tls_items;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#include "x86_corenote.c"
|
||||
#include "linux-core-note.c"
|
@ -1,71 +0,0 @@
|
||||
/* Initialization of i386 specific backend library.
|
||||
Copyright (C) 2000-2009, 2013, 2017 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
Written by Ulrich Drepper <drepper@redhat.com>, 2000.
|
||||
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND i386_
|
||||
#define RELOC_PREFIX R_386_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
/* This defines the common reloc hooks based on i386_reloc.def. */
|
||||
#include "common-reloc.c"
|
||||
|
||||
const char *
|
||||
i386_init (Elf *elf __attribute__ ((unused)),
|
||||
GElf_Half machine __attribute__ ((unused)),
|
||||
Ebl *eh,
|
||||
size_t ehlen)
|
||||
{
|
||||
/* Check whether the Elf_BH object has a sufficent size. */
|
||||
if (ehlen < sizeof (Ebl))
|
||||
return NULL;
|
||||
|
||||
/* We handle it. */
|
||||
eh->name = "Intel 80386";
|
||||
i386_init_reloc (eh);
|
||||
HOOK (eh, reloc_simple_type);
|
||||
HOOK (eh, gotpc_reloc_check);
|
||||
HOOK (eh, core_note);
|
||||
generic_debugscn_p = eh->debugscn_p;
|
||||
HOOK (eh, debugscn_p);
|
||||
HOOK (eh, return_value_location);
|
||||
HOOK (eh, register_info);
|
||||
HOOK (eh, syscall_abi);
|
||||
HOOK (eh, auxv_info);
|
||||
HOOK (eh, disasm);
|
||||
HOOK (eh, abi_cfi);
|
||||
/* gcc/config/ #define DWARF_FRAME_REGISTERS. For i386 it is 17, why? */
|
||||
eh->frame_nregs = 9;
|
||||
HOOK (eh, set_initial_registers_tid);
|
||||
HOOK (eh, unwind);
|
||||
|
||||
return MODVERSION;
|
||||
}
|
@ -1,79 +0,0 @@
|
||||
/* Fetch live process registers from TID.
|
||||
Copyright (C) 2013 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if (defined __i386__ || defined __x86_64__) && defined(__linux__)
|
||||
# include <sys/types.h>
|
||||
# include <sys/user.h>
|
||||
# include <sys/ptrace.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND i386_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
bool
|
||||
i386_set_initial_registers_tid (pid_t tid __attribute__ ((unused)),
|
||||
ebl_tid_registers_t *setfunc __attribute__ ((unused)),
|
||||
void *arg __attribute__ ((unused)))
|
||||
{
|
||||
#if (!defined __i386__ && !defined __x86_64__) || !defined(__linux__)
|
||||
return false;
|
||||
#else /* __i386__ || __x86_64__ */
|
||||
struct user_regs_struct user_regs;
|
||||
if (ptrace (PTRACE_GETREGS, tid, NULL, &user_regs) != 0)
|
||||
return false;
|
||||
Dwarf_Word dwarf_regs[9];
|
||||
# if defined __i386__
|
||||
dwarf_regs[0] = user_regs.eax;
|
||||
dwarf_regs[1] = user_regs.ecx;
|
||||
dwarf_regs[2] = user_regs.edx;
|
||||
dwarf_regs[3] = user_regs.ebx;
|
||||
dwarf_regs[4] = user_regs.esp;
|
||||
dwarf_regs[5] = user_regs.ebp;
|
||||
dwarf_regs[6] = user_regs.esi;
|
||||
dwarf_regs[7] = user_regs.edi;
|
||||
dwarf_regs[8] = user_regs.eip;
|
||||
# elif defined __x86_64__
|
||||
dwarf_regs[0] = user_regs.rax;
|
||||
dwarf_regs[1] = user_regs.rcx;
|
||||
dwarf_regs[2] = user_regs.rdx;
|
||||
dwarf_regs[3] = user_regs.rbx;
|
||||
dwarf_regs[4] = user_regs.rsp;
|
||||
dwarf_regs[5] = user_regs.rbp;
|
||||
dwarf_regs[6] = user_regs.rsi;
|
||||
dwarf_regs[7] = user_regs.rdi;
|
||||
dwarf_regs[8] = user_regs.rip;
|
||||
# else /* (__i386__ || __x86_64__) && (!__i386__ && !__x86_64__) */
|
||||
# error "source file error, it cannot happen"
|
||||
# endif /* (__i386__ || __x86_64__) && (!__i386__ && !__x86_64__) */
|
||||
return setfunc (0, 9, dwarf_regs, arg);
|
||||
#endif /* __i386__ || __x86_64__ */
|
||||
}
|
@ -1,153 +0,0 @@
|
||||
/* Register names and numbers for i386 DWARF.
|
||||
Copyright (C) 2005, 2006, 2007 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND i386_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
ssize_t
|
||||
i386_register_info (Ebl *ebl __attribute__ ((unused)),
|
||||
int regno, char *name, size_t namelen,
|
||||
const char **prefix, const char **setname,
|
||||
int *bits, int *type)
|
||||
{
|
||||
if (name == NULL)
|
||||
return 46;
|
||||
|
||||
if (regno < 0 || regno > 45 || namelen < 6)
|
||||
return -1;
|
||||
|
||||
*prefix = "%";
|
||||
*bits = 32;
|
||||
*type = DW_ATE_unsigned;
|
||||
if (regno < 11)
|
||||
{
|
||||
*setname = "integer";
|
||||
if (regno < 9)
|
||||
*type = DW_ATE_signed;
|
||||
}
|
||||
else if (regno < 19)
|
||||
{
|
||||
*setname = "x87";
|
||||
*type = DW_ATE_float;
|
||||
*bits = 80;
|
||||
}
|
||||
else if (regno < 29)
|
||||
{
|
||||
*setname = "SSE";
|
||||
*bits = 128;
|
||||
}
|
||||
else if (regno < 37)
|
||||
{
|
||||
*setname = "MMX";
|
||||
*bits = 64;
|
||||
}
|
||||
else if (regno < 40)
|
||||
*setname = "FPU-control";
|
||||
else
|
||||
{
|
||||
*setname = "segment";
|
||||
*bits = 16;
|
||||
}
|
||||
|
||||
switch (regno)
|
||||
{
|
||||
static const char baseregs[][2] =
|
||||
{
|
||||
"ax", "cx", "dx", "bx", "sp", "bp", "si", "di", "ip"
|
||||
};
|
||||
|
||||
case 4:
|
||||
case 5:
|
||||
case 8:
|
||||
*type = DW_ATE_address;
|
||||
/* Fallthrough */
|
||||
case 0 ... 3:
|
||||
case 6 ... 7:
|
||||
name[0] = 'e';
|
||||
name[1] = baseregs[regno][0];
|
||||
name[2] = baseregs[regno][1];
|
||||
namelen = 3;
|
||||
break;
|
||||
|
||||
case 9:
|
||||
return stpcpy (name, "eflags") + 1 - name;
|
||||
case 10:
|
||||
return stpcpy (name, "trapno") + 1 - name;
|
||||
|
||||
case 11 ... 18:
|
||||
name[0] = 's';
|
||||
name[1] = 't';
|
||||
name[2] = regno - 11 + '0';
|
||||
namelen = 3;
|
||||
break;
|
||||
|
||||
case 21 ... 28:
|
||||
name[0] = 'x';
|
||||
name[1] = 'm';
|
||||
name[2] = 'm';
|
||||
name[3] = regno - 21 + '0';
|
||||
namelen = 4;
|
||||
break;
|
||||
|
||||
case 29 ... 36:
|
||||
name[0] = 'm';
|
||||
name[1] = 'm';
|
||||
name[2] = regno - 29 + '0';
|
||||
namelen = 3;
|
||||
break;
|
||||
|
||||
case 37:
|
||||
*bits = 16;
|
||||
return stpcpy (name, "fctrl") + 1 - name;
|
||||
case 38:
|
||||
*bits = 16;
|
||||
return stpcpy (name, "fstat") + 1 - name;
|
||||
case 39:
|
||||
return stpcpy (name, "mxcsr") + 1 - name;
|
||||
|
||||
case 40 ... 45:
|
||||
name[0] = "ecsdfg"[regno - 40];
|
||||
name[1] = 's';
|
||||
namelen = 2;
|
||||
break;
|
||||
|
||||
default:
|
||||
*setname = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
name[namelen++] = '\0';
|
||||
return namelen;
|
||||
}
|
@ -1,71 +0,0 @@
|
||||
/* List the relocation types for i386. -*- C -*-
|
||||
Copyright (C) 2000, 2001, 2002, 2003, 2005, 2009, 2015 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/>. */
|
||||
|
||||
/* NAME, REL|EXEC|DYN */
|
||||
|
||||
RELOC_TYPE (NONE, 0)
|
||||
RELOC_TYPE (COPY, EXEC|DYN)
|
||||
RELOC_TYPE (32, REL|EXEC|DYN)
|
||||
RELOC_TYPE (PC32, REL|EXEC|DYN)
|
||||
RELOC_TYPE (GOT32, REL)
|
||||
RELOC_TYPE (PLT32, REL)
|
||||
RELOC_TYPE (GLOB_DAT, EXEC|DYN)
|
||||
RELOC_TYPE (JMP_SLOT, EXEC|DYN)
|
||||
RELOC_TYPE (RELATIVE, EXEC|DYN)
|
||||
RELOC_TYPE (GOTOFF, REL)
|
||||
RELOC_TYPE (GOTPC, REL)
|
||||
RELOC_TYPE (32PLT, REL)
|
||||
RELOC_TYPE (TLS_TPOFF, EXEC|DYN)
|
||||
RELOC_TYPE (TLS_IE, REL)
|
||||
RELOC_TYPE (TLS_GOTIE, REL)
|
||||
RELOC_TYPE (TLS_LE, REL)
|
||||
RELOC_TYPE (TLS_GD, REL)
|
||||
RELOC_TYPE (TLS_LDM, REL)
|
||||
RELOC_TYPE (16, REL)
|
||||
RELOC_TYPE (PC16, REL)
|
||||
RELOC_TYPE (8, REL)
|
||||
RELOC_TYPE (PC8, REL)
|
||||
RELOC_TYPE (TLS_GD_32, REL)
|
||||
RELOC_TYPE (TLS_GD_PUSH, REL)
|
||||
RELOC_TYPE (TLS_GD_CALL, REL)
|
||||
RELOC_TYPE (TLS_GD_POP, REL)
|
||||
RELOC_TYPE (TLS_LDM_32, REL)
|
||||
RELOC_TYPE (TLS_LDM_PUSH, REL)
|
||||
RELOC_TYPE (TLS_LDM_CALL, REL)
|
||||
RELOC_TYPE (TLS_LDM_POP, REL)
|
||||
RELOC_TYPE (TLS_LDO_32, REL)
|
||||
RELOC_TYPE (TLS_IE_32, REL)
|
||||
RELOC_TYPE (TLS_LE_32, REL)
|
||||
RELOC_TYPE (TLS_DTPMOD32, EXEC|DYN)
|
||||
RELOC_TYPE (TLS_DTPOFF32, EXEC|DYN)
|
||||
RELOC_TYPE (TLS_TPOFF32, EXEC|DYN)
|
||||
RELOC_TYPE (TLS_GOTDESC, REL)
|
||||
RELOC_TYPE (TLS_DESC_CALL, REL)
|
||||
RELOC_TYPE (TLS_DESC, EXEC)
|
||||
RELOC_TYPE (IRELATIVE, EXEC|DYN)
|
||||
RELOC_TYPE (GOT32X, REL)
|
@ -1,140 +0,0 @@
|
||||
/* Function return value location for Linux/i386 ABI.
|
||||
Copyright (C) 2005-2010, 2014 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND i386_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
/* %eax, or pair %eax, %edx. */
|
||||
static const Dwarf_Op loc_intreg[] =
|
||||
{
|
||||
{ .atom = DW_OP_reg0 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
{ .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
};
|
||||
#define nloc_intreg 1
|
||||
#define nloc_intregpair 4
|
||||
|
||||
/* %st(0). */
|
||||
static const Dwarf_Op loc_fpreg[] =
|
||||
{
|
||||
{ .atom = DW_OP_reg11 }
|
||||
};
|
||||
#define nloc_fpreg 1
|
||||
|
||||
/* The return value is a structure and is actually stored in stack space
|
||||
passed in a hidden argument by the caller. But, the compiler
|
||||
helpfully returns the address of that space in %eax. */
|
||||
static const Dwarf_Op loc_aggregate[] =
|
||||
{
|
||||
{ .atom = DW_OP_breg0, .number = 0 }
|
||||
};
|
||||
#define nloc_aggregate 1
|
||||
|
||||
int
|
||||
i386_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_Die die_mem, *typedie = &die_mem;
|
||||
int tag = dwarf_peeled_die_type (functypedie, typedie);
|
||||
if (tag <= 0)
|
||||
return tag;
|
||||
|
||||
switch (tag)
|
||||
{
|
||||
case -1:
|
||||
return -1;
|
||||
|
||||
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_OR_RETURN (typedie);
|
||||
}
|
||||
/* Fall through. */
|
||||
|
||||
case DW_TAG_base_type:
|
||||
case DW_TAG_enumeration_type:
|
||||
case DW_TAG_pointer_type:
|
||||
case DW_TAG_ptr_to_member_type:
|
||||
{
|
||||
Dwarf_Word size;
|
||||
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 = 4;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
if (tag == DW_TAG_base_type)
|
||||
{
|
||||
Dwarf_Word encoding;
|
||||
if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
|
||||
&attr_mem),
|
||||
&encoding) != 0)
|
||||
return -1;
|
||||
if (encoding == DW_ATE_float)
|
||||
{
|
||||
if (size > 16)
|
||||
return -2;
|
||||
*locp = loc_fpreg;
|
||||
return nloc_fpreg;
|
||||
}
|
||||
}
|
||||
*locp = loc_intreg;
|
||||
if (size <= 4)
|
||||
return nloc_intreg;
|
||||
if (size <= 8)
|
||||
return nloc_intregpair;
|
||||
}
|
||||
/* Fallthrough */
|
||||
|
||||
case DW_TAG_structure_type:
|
||||
case DW_TAG_class_type:
|
||||
case DW_TAG_union_type:
|
||||
case DW_TAG_array_type:
|
||||
*locp = loc_aggregate;
|
||||
return nloc_aggregate;
|
||||
}
|
||||
|
||||
/* XXX We don't have a good way to return specific errors from ebl calls.
|
||||
This value means we do not understand the type, but it is well-formed
|
||||
DWARF and might be valid. */
|
||||
return -2;
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
/* i386 specific symbolic name handling.
|
||||
Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
Written by Ulrich Drepper <drepper@redhat.com>, 2000.
|
||||
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <elf.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#define BACKEND i386_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
/* Return true if the symbol type is that referencing the GOT. */
|
||||
bool
|
||||
i386_gotpc_reloc_check (Elf *elf __attribute__ ((unused)), int type)
|
||||
{
|
||||
return type == R_386_GOTPC;
|
||||
}
|
||||
|
||||
/* Check for the simple reloc types. */
|
||||
Elf_Type
|
||||
i386_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case R_386_32:
|
||||
return ELF_T_SWORD;
|
||||
case R_386_16:
|
||||
return ELF_T_HALF;
|
||||
case R_386_8:
|
||||
return ELF_T_BYTE;
|
||||
default:
|
||||
return ELF_T_NUM;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check section name for being that of a debug information section. */
|
||||
bool (*generic_debugscn_p) (const char *);
|
||||
bool
|
||||
i386_debugscn_p (const char *name)
|
||||
{
|
||||
return (generic_debugscn_p (name)
|
||||
|| strcmp (name, ".stab") == 0
|
||||
|| strcmp (name, ".stabstr") == 0);
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
/* Linux/i386 system call ABI in DWARF register numbers.
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND i386_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
int
|
||||
i386_syscall_abi (Ebl *ebl __attribute__ ((unused)),
|
||||
int *sp, int *pc, int *callno, int args[6])
|
||||
{
|
||||
*sp = 4; /* %esp */
|
||||
*pc = 8; /* %eip */
|
||||
*callno = 0; /* %eax */
|
||||
args[0] = 3; /* %ebx */
|
||||
args[1] = 1; /* %ecx */
|
||||
args[2] = 2; /* %edx */
|
||||
args[3] = 6; /* %esi */
|
||||
args[4] = 7; /* %edi */
|
||||
args[5] = 5; /* %ebp */
|
||||
return 0;
|
||||
}
|
@ -1,84 +0,0 @@
|
||||
/* Get previous frame state for an existing frame state using frame pointers.
|
||||
Copyright (C) 2017 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
||||
#define BACKEND i386_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
/* Register numbers for frame and stack pointers. We take advantage of
|
||||
them being next to each other when calling getfunc and setfunc. */
|
||||
#define ESP 4
|
||||
#define EBP (ESP + 1)
|
||||
|
||||
/* Most basic frame pointer chasing with EBP as frame pointer.
|
||||
PC = *(FP + 4), SP = FP + 8, FP = *FP. */
|
||||
bool
|
||||
i386_unwind (Ebl *ebl __attribute__ ((unused)),
|
||||
Dwarf_Addr pc __attribute__ ((unused)),
|
||||
ebl_tid_registers_t *setfunc, ebl_tid_registers_get_t *getfunc,
|
||||
ebl_pid_memory_read_t *readfunc, void *arg,
|
||||
bool *signal_framep __attribute__ ((unused)))
|
||||
{
|
||||
/* sp = 0, fp = 1 */
|
||||
Dwarf_Word regs[2];
|
||||
|
||||
/* Get current stack and frame pointers. */
|
||||
if (! getfunc (ESP, 2, regs, arg))
|
||||
return false;
|
||||
|
||||
Dwarf_Word sp = regs[0];
|
||||
Dwarf_Word fp = regs[1];
|
||||
|
||||
/* Sanity check. We only support traditional stack frames. */
|
||||
if (fp == 0 || sp == 0 || fp < sp)
|
||||
return false;
|
||||
|
||||
/* Get the return address from the stack, it is our new pc. */
|
||||
Dwarf_Word ret_addr;
|
||||
if (! readfunc (fp + 4, &ret_addr, arg) || ret_addr == 0)
|
||||
return false;
|
||||
|
||||
/* Get new sp and fp. Sanity check again. */
|
||||
sp = fp + 8;
|
||||
if (! readfunc (fp, &fp, arg) || fp == 0 || sp >= fp)
|
||||
return false;
|
||||
|
||||
/* Set new sp, fp and pc. */
|
||||
regs[0] = sp;
|
||||
regs[1] = fp;
|
||||
if (! setfunc (ESP, 2, regs, arg) || ! setfunc (-1, 1, &ret_addr, arg))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
@ -1,66 +0,0 @@
|
||||
/* Initialization of IA-64 specific backend library.
|
||||
Copyright (C) 2002, 2003, 2005, 2006, 2007, 2014 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND ia64_
|
||||
#define RELOC_PREFIX R_IA64_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
/* This defines the common reloc hooks based on ia64_reloc.def. */
|
||||
#include "common-reloc.c"
|
||||
|
||||
const char *
|
||||
ia64_init (Elf *elf __attribute__ ((unused)),
|
||||
GElf_Half machine __attribute__ ((unused)),
|
||||
Ebl *eh,
|
||||
size_t ehlen)
|
||||
{
|
||||
/* Check whether the Elf_BH object has a sufficent size. */
|
||||
if (ehlen < sizeof (Ebl))
|
||||
return NULL;
|
||||
|
||||
/* We handle it. */
|
||||
eh->name = "Intel IA-64";
|
||||
ia64_init_reloc (eh);
|
||||
HOOK (eh, reloc_simple_type);
|
||||
HOOK (eh, segment_type_name);
|
||||
HOOK (eh, section_type_name);
|
||||
HOOK (eh, dynamic_tag_name);
|
||||
HOOK (eh, dynamic_tag_check);
|
||||
HOOK (eh, machine_flag_check);
|
||||
HOOK (eh, machine_section_flag_check);
|
||||
HOOK (eh, register_info);
|
||||
HOOK (eh, return_value_location);
|
||||
HOOK (eh, check_reloc_target_type);
|
||||
|
||||
return MODVERSION;
|
||||
}
|
@ -1,273 +0,0 @@
|
||||
/* Register names and numbers for IA64 DWARF.
|
||||
Copyright (C) 2006 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND i386_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
ssize_t
|
||||
ia64_register_info (Ebl *ebl __attribute__ ((unused)),
|
||||
int regno, char *name, size_t namelen,
|
||||
const char **prefix, const char **setname,
|
||||
int *bits, int *type)
|
||||
{
|
||||
if (name == NULL)
|
||||
return 687 + 64;
|
||||
|
||||
if (regno < 0 || regno > 687 + 63 || namelen < 12)
|
||||
return -1;
|
||||
|
||||
*prefix = "ar.";
|
||||
*setname = "application";
|
||||
*bits = 64;
|
||||
*type = DW_ATE_signed;
|
||||
switch (regno)
|
||||
{
|
||||
case 0 ... 9:
|
||||
name[0] = 'r';
|
||||
name[1] = (regno - 0) + '0';
|
||||
namelen = 2;
|
||||
*setname = "integer";
|
||||
*prefix = "";
|
||||
break;
|
||||
|
||||
case 10 ... 99:
|
||||
name[0] = 'r';
|
||||
name[1] = (regno - 0) / 10 + '0';
|
||||
name[2] = (regno - 0) % 10 + '0';
|
||||
namelen = 3;
|
||||
*setname = "integer";
|
||||
*prefix = "";
|
||||
break;
|
||||
|
||||
case 100 ... 127:
|
||||
name[0] = 'r';
|
||||
name[1] = '1';
|
||||
name[2] = (regno - 100) / 10 + '0';
|
||||
name[3] = (regno - 0) % 10 + '0';
|
||||
namelen = 4;
|
||||
*setname = "integer";
|
||||
*prefix = "";
|
||||
break;
|
||||
|
||||
case 128 + 0 ... 128 + 9:
|
||||
name[0] = 'f';
|
||||
name[1] = (regno - 128) + '0';
|
||||
namelen = 2;
|
||||
*type = DW_ATE_float;
|
||||
*bits = 128;
|
||||
*setname = "FPU";
|
||||
*prefix = "";
|
||||
break;
|
||||
|
||||
case 128 + 10 ... 128 + 99:
|
||||
name[0] = 'f';
|
||||
name[1] = (regno - 128) / 10 + '0';
|
||||
name[2] = (regno - 128) % 10 + '0';
|
||||
namelen = 3;
|
||||
*setname = "FPU";
|
||||
*prefix = "";
|
||||
break;
|
||||
|
||||
case 128 + 100 ... 128 + 127:
|
||||
name[0] = 'f';
|
||||
name[1] = '1';
|
||||
name[2] = (regno - 128 - 100) / 10 + '0';
|
||||
name[3] = (regno - 128) % 10 + '0';
|
||||
namelen = 4;
|
||||
*type = DW_ATE_float;
|
||||
*bits = 128;
|
||||
*setname = "FPU";
|
||||
*prefix = "";
|
||||
break;
|
||||
|
||||
case 320 + 0 ... 320 + 7:
|
||||
name[0] = 'b';
|
||||
name[1] = (regno - 320) + '0';
|
||||
namelen = 2;
|
||||
*type = DW_ATE_address;
|
||||
*setname = "branch";
|
||||
*prefix = "";
|
||||
break;
|
||||
|
||||
case 328 ... 333:
|
||||
{
|
||||
static const char named_special[][5] =
|
||||
{
|
||||
"vfp", "vrap", "pr", "ip", "psr", "cfm"
|
||||
};
|
||||
*setname = "special";
|
||||
*prefix = "";
|
||||
*type = regno == 331 ? DW_ATE_address : DW_ATE_unsigned;
|
||||
return stpcpy (name, named_special[regno - 328]) + 1 - name;
|
||||
}
|
||||
|
||||
case 590:
|
||||
*setname = "special";
|
||||
*prefix = "";
|
||||
*type = DW_ATE_unsigned;
|
||||
return stpcpy (name, "bof") + 1 - name;
|
||||
|
||||
case 334 + 0 ... 334 + 7:
|
||||
name[0] = 'k';
|
||||
name[1] = 'r';
|
||||
name[2] = (regno - 334) + '0';
|
||||
namelen = 3;
|
||||
*prefix = "";
|
||||
break;
|
||||
|
||||
case 334 + 8 ... 334 + 127:
|
||||
{
|
||||
static const char named_ar[][9] =
|
||||
{
|
||||
[16 - 8] = "rsc",
|
||||
[17 - 8] = "bsp",
|
||||
[18 - 8] = "bspstore",
|
||||
[19 - 8] = "rnat",
|
||||
[21 - 8] = "fcr",
|
||||
[24 - 8] = "eflag",
|
||||
[25 - 8] = "csd",
|
||||
[26 - 8] = "ssd",
|
||||
[27 - 8] = "cflg",
|
||||
[28 - 8] = "fsr",
|
||||
[29 - 8] = "fir",
|
||||
[30 - 8] = "fdr",
|
||||
[32 - 8] = "ccv",
|
||||
[36 - 8] = "unat",
|
||||
[40 - 8] = "fpsr",
|
||||
[44 - 8] = "itc",
|
||||
[64 - 8] = "pfs",
|
||||
[65 - 8] = "lc",
|
||||
[66 - 8] = "ec",
|
||||
};
|
||||
const size_t idx = regno - (334 + 8);
|
||||
*type = DW_ATE_unsigned;
|
||||
if (idx == 1 || idx == 2)
|
||||
*type = DW_ATE_address;
|
||||
if (idx < sizeof named_ar / sizeof named_ar[0]
|
||||
&& named_ar[idx][0] != '\0')
|
||||
return stpcpy (name, named_ar[idx]) + 1 - name;
|
||||
|
||||
name[0] = 'a';
|
||||
name[1] = 'r';
|
||||
switch (regno - 334)
|
||||
{
|
||||
case 0 ... 9:
|
||||
name[2] = (regno - 334) + '0';
|
||||
namelen = 3;
|
||||
break;
|
||||
case 10 ... 99:
|
||||
name[2] = (regno - 334) / 10 + '0';
|
||||
name[3] = (regno - 334) % 10 + '0';
|
||||
namelen = 4;
|
||||
break;
|
||||
case 100 ... 127:
|
||||
name[2] = '1';
|
||||
name[3] = (regno - 334 - 100) / 10 + '0';
|
||||
name[4] = (regno - 334) % 10 + '0';
|
||||
namelen = 5;
|
||||
break;
|
||||
}
|
||||
*prefix = "";
|
||||
break;
|
||||
}
|
||||
|
||||
case 462 + 0 ... 462 + 9:
|
||||
name[0] = 'n';
|
||||
name[1] = 'a';
|
||||
name[2] = 't';
|
||||
name[3] = (regno - 462) + '0';
|
||||
namelen = 4;
|
||||
*setname = "NAT";
|
||||
*type = DW_ATE_boolean;
|
||||
*bits = 1;
|
||||
*prefix = "";
|
||||
break;
|
||||
|
||||
case 462 + 10 ... 462 + 99:
|
||||
name[0] = 'n';
|
||||
name[1] = 'a';
|
||||
name[2] = 't';
|
||||
name[3] = (regno - 462) / 10 + '0';
|
||||
name[4] = (regno - 462) % 10 + '0';
|
||||
namelen = 5;
|
||||
*setname = "NAT";
|
||||
*type = DW_ATE_boolean;
|
||||
*bits = 1;
|
||||
*prefix = "";
|
||||
break;
|
||||
|
||||
case 462 + 100 ... 462 + 127:
|
||||
name[0] = 'n';
|
||||
name[1] = 'a';
|
||||
name[2] = 't';
|
||||
name[3] = '1';
|
||||
name[4] = (regno - 462 - 100) / 10 + '0';
|
||||
name[5] = (regno - 462) % 10 + '0';
|
||||
namelen = 6;
|
||||
*setname = "NAT";
|
||||
*type = DW_ATE_boolean;
|
||||
*bits = 1;
|
||||
*prefix = "";
|
||||
break;
|
||||
|
||||
case 687 + 0 ... 687 + 9:
|
||||
name[0] = 'p';
|
||||
name[1] = (regno - 687) + '0';
|
||||
namelen = 2;
|
||||
*setname = "predicate";
|
||||
*type = DW_ATE_boolean;
|
||||
*bits = 1;
|
||||
*prefix = "";
|
||||
break;
|
||||
|
||||
case 687 + 10 ... 687 + 63:
|
||||
name[0] = 'p';
|
||||
name[1] = (regno - 687) / 10 + '0';
|
||||
name[2] = (regno - 687) % 10 + '0';
|
||||
namelen = 3;
|
||||
*setname = "predicate";
|
||||
*type = DW_ATE_boolean;
|
||||
*bits = 1;
|
||||
*prefix = "";
|
||||
break;
|
||||
|
||||
default:
|
||||
*setname = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
name[namelen++] = '\0';
|
||||
return namelen;
|
||||
}
|
@ -1,113 +0,0 @@
|
||||
/* List the relocation types for ia64. -*- C -*-
|
||||
Copyright (C) 2005, 2006, 2015 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/>. */
|
||||
|
||||
/* NAME, REL|EXEC|DYN */
|
||||
|
||||
RELOC_TYPE (NONE, 0)
|
||||
RELOC_TYPE (IMM14, REL)
|
||||
RELOC_TYPE (IMM22, REL)
|
||||
RELOC_TYPE (IMM64, REL)
|
||||
RELOC_TYPE (DIR32MSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (DIR32LSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (DIR64MSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (DIR64LSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (GPREL22, REL)
|
||||
RELOC_TYPE (GPREL64I, REL)
|
||||
RELOC_TYPE (GPREL32MSB, REL)
|
||||
RELOC_TYPE (GPREL32LSB, REL)
|
||||
RELOC_TYPE (GPREL64MSB, REL)
|
||||
RELOC_TYPE (GPREL64LSB, REL)
|
||||
RELOC_TYPE (LTOFF22, REL)
|
||||
RELOC_TYPE (LTOFF64I, REL)
|
||||
RELOC_TYPE (PLTOFF22, REL)
|
||||
RELOC_TYPE (PLTOFF64I, REL)
|
||||
RELOC_TYPE (PLTOFF64MSB, REL)
|
||||
RELOC_TYPE (PLTOFF64LSB, REL)
|
||||
RELOC_TYPE (FPTR64I, REL)
|
||||
RELOC_TYPE (FPTR32MSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (FPTR32LSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (FPTR64MSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (FPTR64LSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (PCREL60B, REL)
|
||||
RELOC_TYPE (PCREL21B, REL)
|
||||
RELOC_TYPE (PCREL21M, REL)
|
||||
RELOC_TYPE (PCREL21F, REL)
|
||||
RELOC_TYPE (PCREL32MSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (PCREL32LSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (PCREL64MSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (PCREL64LSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (LTOFF_FPTR22, REL)
|
||||
RELOC_TYPE (LTOFF_FPTR64I, REL)
|
||||
RELOC_TYPE (LTOFF_FPTR32MSB, REL)
|
||||
RELOC_TYPE (LTOFF_FPTR32LSB, REL)
|
||||
RELOC_TYPE (LTOFF_FPTR64MSB, REL)
|
||||
RELOC_TYPE (LTOFF_FPTR64LSB, REL)
|
||||
RELOC_TYPE (SEGREL32MSB, REL)
|
||||
RELOC_TYPE (SEGREL32LSB, REL)
|
||||
RELOC_TYPE (SEGREL64MSB, REL)
|
||||
RELOC_TYPE (SEGREL64LSB, REL)
|
||||
RELOC_TYPE (SECREL32MSB, REL)
|
||||
RELOC_TYPE (SECREL32LSB, REL)
|
||||
RELOC_TYPE (SECREL64MSB, REL)
|
||||
RELOC_TYPE (SECREL64LSB, REL)
|
||||
RELOC_TYPE (REL32MSB, EXEC|DYN)
|
||||
RELOC_TYPE (REL32LSB, EXEC|DYN)
|
||||
RELOC_TYPE (REL64MSB, EXEC|DYN)
|
||||
RELOC_TYPE (REL64LSB, EXEC|DYN)
|
||||
RELOC_TYPE (LTV32MSB, REL)
|
||||
RELOC_TYPE (LTV32LSB, REL)
|
||||
RELOC_TYPE (LTV64MSB, REL)
|
||||
RELOC_TYPE (LTV64LSB, REL)
|
||||
RELOC_TYPE (PCREL21BI, REL)
|
||||
RELOC_TYPE (PCREL22, REL)
|
||||
RELOC_TYPE (PCREL64I, REL)
|
||||
RELOC_TYPE (IPLTMSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (IPLTLSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (COPY, EXEC|DYN)
|
||||
RELOC_TYPE (SUB, 0)
|
||||
RELOC_TYPE (LTOFF22X, REL)
|
||||
RELOC_TYPE (LDXMOV, REL)
|
||||
RELOC_TYPE (TPREL14, REL)
|
||||
RELOC_TYPE (TPREL22, REL)
|
||||
RELOC_TYPE (TPREL64I, REL)
|
||||
RELOC_TYPE (TPREL64MSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (TPREL64LSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (LTOFF_TPREL22, REL)
|
||||
RELOC_TYPE (DTPMOD64MSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (DTPMOD64LSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (LTOFF_DTPMOD22, REL)
|
||||
RELOC_TYPE (DTPREL14, REL)
|
||||
RELOC_TYPE (DTPREL22, REL)
|
||||
RELOC_TYPE (DTPREL64I, REL)
|
||||
RELOC_TYPE (DTPREL32MSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (DTPREL32LSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (DTPREL64MSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (DTPREL64LSB, REL|EXEC|DYN)
|
||||
RELOC_TYPE (LTOFF_DTPREL22, REL)
|
||||
|
||||
#define NO_RELATIVE_RELOC 1
|
@ -1,366 +0,0 @@
|
||||
/* Function return value location for IA64 ABI.
|
||||
Copyright (C) 2006-2010, 2014 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND ia64_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
/* r8, or pair r8, r9, or aggregate up to r8-r11. */
|
||||
static const Dwarf_Op loc_intreg[] =
|
||||
{
|
||||
{ .atom = DW_OP_reg8 }, { .atom = DW_OP_piece, .number = 8 },
|
||||
{ .atom = DW_OP_reg9 }, { .atom = DW_OP_piece, .number = 8 },
|
||||
{ .atom = DW_OP_reg10 }, { .atom = DW_OP_piece, .number = 8 },
|
||||
{ .atom = DW_OP_reg11 }, { .atom = DW_OP_piece, .number = 8 },
|
||||
};
|
||||
#define nloc_intreg 1
|
||||
#define nloc_intregs(n) (2 * (n))
|
||||
|
||||
/* f8, or aggregate up to f8-f15. */
|
||||
#define DEFINE_FPREG(size) \
|
||||
static const Dwarf_Op loc_fpreg_##size[] = \
|
||||
{ \
|
||||
{ .atom = DW_OP_regx, .number = 128 + 8 }, \
|
||||
{ .atom = DW_OP_piece, .number = size }, \
|
||||
{ .atom = DW_OP_regx, .number = 128 + 9 }, \
|
||||
{ .atom = DW_OP_piece, .number = size }, \
|
||||
{ .atom = DW_OP_regx, .number = 128 + 10 }, \
|
||||
{ .atom = DW_OP_piece, .number = size }, \
|
||||
{ .atom = DW_OP_regx, .number = 128 + 11 }, \
|
||||
{ .atom = DW_OP_piece, .number = size }, \
|
||||
{ .atom = DW_OP_regx, .number = 128 + 12 }, \
|
||||
{ .atom = DW_OP_piece, .number = size }, \
|
||||
{ .atom = DW_OP_regx, .number = 128 + 13 }, \
|
||||
{ .atom = DW_OP_piece, .number = size }, \
|
||||
{ .atom = DW_OP_regx, .number = 128 + 14 }, \
|
||||
{ .atom = DW_OP_piece, .number = size }, \
|
||||
{ .atom = DW_OP_regx, .number = 128 + 15 }, \
|
||||
{ .atom = DW_OP_piece, .number = size }, \
|
||||
}
|
||||
#define nloc_fpreg 1
|
||||
#define nloc_fpregs(n) (2 * (n))
|
||||
|
||||
DEFINE_FPREG (4);
|
||||
DEFINE_FPREG (8);
|
||||
DEFINE_FPREG (10);
|
||||
|
||||
#undef DEFINE_FPREG
|
||||
|
||||
|
||||
/* The return value is a structure and is actually stored in stack space
|
||||
passed in a hidden argument by the caller. But, the compiler
|
||||
helpfully returns the address of that space in r8. */
|
||||
static const Dwarf_Op loc_aggregate[] =
|
||||
{
|
||||
{ .atom = DW_OP_breg8, .number = 0 }
|
||||
};
|
||||
#define nloc_aggregate 1
|
||||
|
||||
|
||||
static inline int
|
||||
compute_hfa (const Dwarf_Op *loc, int nregs,
|
||||
const Dwarf_Op **locp, int fpregs_used)
|
||||
{
|
||||
if (fpregs_used == 0)
|
||||
*locp = loc;
|
||||
else if (*locp != loc)
|
||||
return 9;
|
||||
return fpregs_used + nregs;
|
||||
}
|
||||
|
||||
/* If this type is an HFA small enough to be returned in FP registers,
|
||||
return the number of registers to use. Otherwise 9, or -1 for errors. */
|
||||
static int
|
||||
hfa_type (Dwarf_Die *typedie, Dwarf_Word size,
|
||||
const Dwarf_Op **locp, int fpregs_used)
|
||||
{
|
||||
/* Descend the type structure, counting elements and finding their types.
|
||||
If we find a datum that's not an FP type (and not quad FP), punt.
|
||||
If we find a datum that's not the same FP type as the first datum, punt.
|
||||
If we count more than eight total homogeneous FP data, punt. */
|
||||
|
||||
int tag = DWARF_TAG_OR_RETURN (typedie);
|
||||
switch (tag)
|
||||
{
|
||||
Dwarf_Attribute attr_mem;
|
||||
|
||||
case -1:
|
||||
return -1;
|
||||
|
||||
case DW_TAG_base_type:;
|
||||
Dwarf_Word encoding;
|
||||
if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
|
||||
&attr_mem), &encoding) != 0)
|
||||
return -1;
|
||||
|
||||
#define hfa(loc, nregs) compute_hfa(loc, nregs, locp, fpregs_used)
|
||||
switch (encoding)
|
||||
{
|
||||
case DW_ATE_float:
|
||||
switch (size)
|
||||
{
|
||||
case 4: /* float */
|
||||
return hfa (loc_fpreg_4, 1);
|
||||
case 8: /* double */
|
||||
return hfa (loc_fpreg_8, 1);
|
||||
case 10: /* x86-style long double, not really used */
|
||||
return hfa (loc_fpreg_10, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case DW_ATE_complex_float:
|
||||
switch (size)
|
||||
{
|
||||
case 4 * 2: /* complex float */
|
||||
return hfa (loc_fpreg_4, 2);
|
||||
case 8 * 2: /* complex double */
|
||||
return hfa (loc_fpreg_8, 2);
|
||||
case 10 * 2: /* complex long double (x86-style) */
|
||||
return hfa (loc_fpreg_10, 2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case DW_TAG_structure_type:
|
||||
case DW_TAG_class_type:
|
||||
case DW_TAG_union_type:;
|
||||
Dwarf_Die child_mem;
|
||||
switch (dwarf_child (typedie, &child_mem))
|
||||
{
|
||||
default:
|
||||
return -1;
|
||||
|
||||
case 1: /* No children: empty struct. */
|
||||
break;
|
||||
|
||||
case 0:; /* Look at each element. */
|
||||
int max_used = fpregs_used;
|
||||
do
|
||||
switch (dwarf_tag (&child_mem))
|
||||
{
|
||||
case -1:
|
||||
return -1;
|
||||
|
||||
case DW_TAG_member:;
|
||||
Dwarf_Die child_type_mem;
|
||||
Dwarf_Die *child_typedie
|
||||
= dwarf_formref_die (dwarf_attr_integrate (&child_mem,
|
||||
DW_AT_type,
|
||||
&attr_mem),
|
||||
&child_type_mem);
|
||||
Dwarf_Word child_size;
|
||||
if (dwarf_aggregate_size (child_typedie, &child_size) != 0)
|
||||
return -1;
|
||||
if (tag == DW_TAG_union_type)
|
||||
{
|
||||
int used = hfa_type (child_typedie, child_size,
|
||||
locp, fpregs_used);
|
||||
if (used < 0 || used > 8)
|
||||
return used;
|
||||
if (used > max_used)
|
||||
max_used = used;
|
||||
}
|
||||
else
|
||||
{
|
||||
fpregs_used = hfa_type (child_typedie, child_size,
|
||||
locp, fpregs_used);
|
||||
if (fpregs_used < 0 || fpregs_used > 8)
|
||||
return fpregs_used;
|
||||
}
|
||||
}
|
||||
while (dwarf_siblingof (&child_mem, &child_mem) == 0);
|
||||
if (tag == DW_TAG_union_type)
|
||||
fpregs_used = max_used;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case DW_TAG_array_type:
|
||||
if (size == 0)
|
||||
break;
|
||||
|
||||
Dwarf_Die base_type_mem;
|
||||
Dwarf_Die *base_typedie
|
||||
= dwarf_formref_die (dwarf_attr_integrate (typedie, DW_AT_type,
|
||||
&attr_mem),
|
||||
&base_type_mem);
|
||||
Dwarf_Word base_size;
|
||||
if (dwarf_aggregate_size (base_typedie, &base_size) != 0)
|
||||
return -1;
|
||||
|
||||
int used = hfa_type (base_typedie, base_size, locp, 0);
|
||||
if (used < 0 || used > 8)
|
||||
return used;
|
||||
if (size % (*locp)[1].number != 0)
|
||||
return 0;
|
||||
fpregs_used += used * (size / (*locp)[1].number);
|
||||
break;
|
||||
|
||||
default:
|
||||
return 9;
|
||||
}
|
||||
|
||||
return fpregs_used;
|
||||
}
|
||||
|
||||
int
|
||||
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_Die die_mem, *typedie = &die_mem;
|
||||
int tag = dwarf_peeled_die_type (functypedie, typedie);
|
||||
if (tag <= 0)
|
||||
return tag;
|
||||
|
||||
Dwarf_Word size;
|
||||
switch (tag)
|
||||
{
|
||||
case -1:
|
||||
return -1;
|
||||
|
||||
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_OR_RETURN (typedie);
|
||||
}
|
||||
/* Fall through. */
|
||||
|
||||
case DW_TAG_base_type:
|
||||
case DW_TAG_enumeration_type:
|
||||
case DW_TAG_pointer_type:
|
||||
case DW_TAG_ptr_to_member_type:
|
||||
{
|
||||
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),
|
||||
&encoding) != 0)
|
||||
return -1;
|
||||
|
||||
switch (encoding)
|
||||
{
|
||||
case DW_ATE_float:
|
||||
switch (size)
|
||||
{
|
||||
case 4: /* float */
|
||||
*locp = loc_fpreg_4;
|
||||
return nloc_fpreg;
|
||||
case 8: /* double */
|
||||
*locp = loc_fpreg_8;
|
||||
return nloc_fpreg;
|
||||
case 10: /* x86-style long double, not really used */
|
||||
*locp = loc_fpreg_10;
|
||||
return nloc_fpreg;
|
||||
case 16: /* long double, IEEE quad format */
|
||||
*locp = loc_intreg;
|
||||
return nloc_intregs (2);
|
||||
}
|
||||
return -2;
|
||||
|
||||
case DW_ATE_complex_float:
|
||||
switch (size)
|
||||
{
|
||||
case 4 * 2: /* complex float */
|
||||
*locp = loc_fpreg_4;
|
||||
return nloc_fpregs (2);
|
||||
case 8 * 2: /* complex double */
|
||||
*locp = loc_fpreg_8;
|
||||
return nloc_fpregs (2);
|
||||
case 10 * 2: /* complex long double (x86-style) */
|
||||
*locp = loc_fpreg_10;
|
||||
return nloc_fpregs (2);
|
||||
case 16 * 2: /* complex long double (IEEE quad) */
|
||||
*locp = loc_intreg;
|
||||
return nloc_intregs (4);
|
||||
}
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
|
||||
intreg:
|
||||
*locp = loc_intreg;
|
||||
if (size <= 8)
|
||||
return nloc_intreg;
|
||||
if (size <= 32)
|
||||
return nloc_intregs ((size + 7) / 8);
|
||||
|
||||
large:
|
||||
*locp = loc_aggregate;
|
||||
return nloc_aggregate;
|
||||
|
||||
case DW_TAG_structure_type:
|
||||
case DW_TAG_class_type:
|
||||
case DW_TAG_union_type:
|
||||
case DW_TAG_array_type:
|
||||
if (dwarf_aggregate_size (typedie, &size) != 0)
|
||||
return -1;
|
||||
|
||||
/* If this qualifies as an homogeneous floating-point aggregate
|
||||
(HFA), then it should be returned in FP regs. */
|
||||
int nfpreg = hfa_type (typedie, size, locp, 0);
|
||||
if (nfpreg < 0)
|
||||
return nfpreg;
|
||||
else if (nfpreg > 0 && nfpreg <= 8)
|
||||
return nfpreg == 1 ? nloc_fpreg : nloc_fpregs (nfpreg);
|
||||
|
||||
if (size > 32)
|
||||
goto large;
|
||||
|
||||
goto intreg;
|
||||
}
|
||||
|
||||
/* XXX We don't have a good way to return specific errors from ebl calls.
|
||||
This value means we do not understand the type, but it is well-formed
|
||||
DWARF and might be valid. */
|
||||
return -2;
|
||||
}
|
@ -1,157 +0,0 @@
|
||||
/* IA-64 specific symbolic name handling.
|
||||
Copyright (C) 2002-2009, 2014 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <elf.h>
|
||||
#include <stddef.h>
|
||||
#include <assert.h>
|
||||
|
||||
#define BACKEND ia64_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
const char *
|
||||
ia64_segment_type_name (int segment, char *buf __attribute__ ((unused)),
|
||||
size_t len __attribute__ ((unused)))
|
||||
{
|
||||
switch (segment)
|
||||
{
|
||||
case PT_IA_64_ARCHEXT:
|
||||
return "IA_64_ARCHEXT";
|
||||
case PT_IA_64_UNWIND:
|
||||
return "IA_64_UNWIND";
|
||||
case PT_IA_64_HP_OPT_ANOT:
|
||||
return "IA_64_HP_OPT_ANOT";
|
||||
case PT_IA_64_HP_HSL_ANOT:
|
||||
return "IA_64_HP_HSL_ANOT";
|
||||
case PT_IA_64_HP_STACK:
|
||||
return "IA_64_HP_STACK";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char *
|
||||
ia64_dynamic_tag_name (int64_t tag, char *buf __attribute__ ((unused)),
|
||||
size_t len __attribute__ ((unused)))
|
||||
{
|
||||
switch (tag)
|
||||
{
|
||||
case DT_IA_64_PLT_RESERVE:
|
||||
return "IA_64_PLT_RESERVE";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Check dynamic tag. */
|
||||
bool
|
||||
ia64_dynamic_tag_check (int64_t tag)
|
||||
{
|
||||
return tag == DT_IA_64_PLT_RESERVE;
|
||||
}
|
||||
|
||||
/* Check whether machine flags are valid. */
|
||||
bool
|
||||
ia64_machine_flag_check (GElf_Word flags)
|
||||
{
|
||||
return ((flags &~ EF_IA_64_ABI64) == 0);
|
||||
}
|
||||
|
||||
/* Check whether SHF_MASKPROC flags are valid. */
|
||||
bool
|
||||
ia64_machine_section_flag_check (GElf_Xword sh_flags)
|
||||
{
|
||||
return (sh_flags &~ (SHF_IA_64_SHORT | SHF_IA_64_NORECOV)) == 0;
|
||||
}
|
||||
|
||||
/* Return symbolic representation of section type. */
|
||||
const char *
|
||||
ia64_section_type_name (int type,
|
||||
char *buf __attribute__ ((unused)),
|
||||
size_t len __attribute__ ((unused)))
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case SHT_IA_64_EXT:
|
||||
return "IA_64_EXT";
|
||||
case SHT_IA_64_UNWIND:
|
||||
return "IA_64_UNWIND";
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Check for the simple reloc types. */
|
||||
Elf_Type
|
||||
ia64_reloc_simple_type (Ebl *ebl, int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
/* The SECREL types when used with non-allocated sections
|
||||
like .debug_* are the same as direct absolute relocs
|
||||
applied to those sections, since a 0 section address is assumed.
|
||||
So we treat them the same here. */
|
||||
|
||||
case R_IA64_SECREL32MSB:
|
||||
case R_IA64_DIR32MSB:
|
||||
if (ebl->data == ELFDATA2MSB)
|
||||
return ELF_T_WORD;
|
||||
break;
|
||||
case R_IA64_SECREL32LSB:
|
||||
case R_IA64_DIR32LSB:
|
||||
if (ebl->data == ELFDATA2LSB)
|
||||
return ELF_T_WORD;
|
||||
break;
|
||||
case R_IA64_DIR64MSB:
|
||||
case R_IA64_SECREL64MSB:
|
||||
if (ebl->data == ELFDATA2MSB)
|
||||
return ELF_T_XWORD;
|
||||
break;
|
||||
case R_IA64_SECREL64LSB:
|
||||
case R_IA64_DIR64LSB:
|
||||
if (ebl->data == ELFDATA2LSB)
|
||||
return ELF_T_XWORD;
|
||||
break;
|
||||
}
|
||||
|
||||
return ELF_T_NUM;
|
||||
}
|
||||
|
||||
/* The SHT_IA_64_UNWIND section type is a valid target for relocation. */
|
||||
bool
|
||||
ia64_check_reloc_target_type (Ebl *ebl __attribute__ ((unused)), Elf64_Word sh_type)
|
||||
{
|
||||
return sh_type == SHT_IA_64_UNWIND;
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
/* Common interface for libebl modules.
|
||||
Copyright (C) 2000, 2001, 2002, 2003, 2005, 2013, 2014 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 _LIBEBL_CPU_H
|
||||
#define _LIBEBL_CPU_H 1
|
||||
|
||||
#include <dwarf.h>
|
||||
#include <libeblP.h>
|
||||
|
||||
#define EBLHOOK(name) EBLHOOK_1(BACKEND, name)
|
||||
#define EBLHOOK_1(a, b) EBLHOOK_2(a, b)
|
||||
#define EBLHOOK_2(a, b) a##b
|
||||
|
||||
/* Constructor. */
|
||||
extern const char *EBLHOOK(init) (Elf *elf, GElf_Half machine,
|
||||
Ebl *eh, size_t ehlen);
|
||||
|
||||
#include "ebl-hooks.h"
|
||||
|
||||
#define HOOK(eh, name) eh->name = EBLHOOK(name)
|
||||
|
||||
extern bool (*generic_debugscn_p) (const char *) attribute_hidden;
|
||||
|
||||
/* Helper for retval. Return dwarf_tag (die), but calls return -1
|
||||
if there where previous errors that leave die NULL. */
|
||||
#define DWARF_TAG_OR_RETURN(die) \
|
||||
({ Dwarf_Die *_die = (die); \
|
||||
if (_die == NULL) return -1; \
|
||||
dwarf_tag (_die); })
|
||||
|
||||
/* Get a type die corresponding to DIE. Peel CV qualifiers off
|
||||
it. */
|
||||
static inline int
|
||||
dwarf_peeled_die_type (Dwarf_Die *die, Dwarf_Die *result)
|
||||
{
|
||||
Dwarf_Attribute attr_mem;
|
||||
Dwarf_Attribute *attr = dwarf_attr_integrate (die, DW_AT_type, &attr_mem);
|
||||
if (attr == NULL)
|
||||
/* The function has no return value, like a `void' function in C. */
|
||||
return 0;
|
||||
|
||||
if (dwarf_formref_die (attr, result) == NULL)
|
||||
return -1;
|
||||
|
||||
if (dwarf_peel_type (result, result) != 0)
|
||||
return -1;
|
||||
|
||||
return DWARF_TAG_OR_RETURN (result);
|
||||
}
|
||||
|
||||
#endif /* libebl_CPU.h */
|
@ -1,315 +0,0 @@
|
||||
/* Common core note type descriptions for Linux.
|
||||
Copyright (C) 2007-2010 Red Hat, Inc.
|
||||
Copyright (C) H.J. Lu <hjl.tools@gmail.com>, 2015.
|
||||
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/>. */
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* The including CPU_corenote.c file provides prstatus_regs and
|
||||
defines macros ULONG, [PUG]ID_T, and ALIGN_*, TYPE_*.
|
||||
|
||||
Here we describe the common layout used in <linux/elfcore.h>. */
|
||||
|
||||
#define CHAR int8_t
|
||||
#define ALIGN_CHAR 1
|
||||
#define TYPE_CHAR ELF_T_BYTE
|
||||
#define SHORT uint16_t
|
||||
#define ALIGN_SHORT 2
|
||||
#define TYPE_SHORT ELF_T_HALF
|
||||
#define INT int32_t
|
||||
#ifndef ALIGN_INT
|
||||
# define ALIGN_INT 4
|
||||
#endif
|
||||
#define TYPE_INT ELF_T_SWORD
|
||||
#ifndef PR_REG
|
||||
# define PR_REG ULONG
|
||||
#endif
|
||||
#ifndef ALIGN_PR_REG
|
||||
# define ALIGN_PR_REG ALIGN_ULONG
|
||||
#endif
|
||||
#ifndef PRPSINFO_UID_T
|
||||
# define PRPSINFO_UID_T UID_T
|
||||
# define ALIGN_PRPSINFO_UID_T ALIGN_UID_T
|
||||
# define TYPE_PRPSINFO_UID_T TYPE_UID_T
|
||||
#endif
|
||||
#ifndef PRPSINFO_GID_T
|
||||
# define PRPSINFO_GID_T GID_T
|
||||
# define ALIGN_PRPSINFO_GID_T ALIGN_GID_T
|
||||
# define TYPE_PRPSINFO_GID_T TYPE_GID_T
|
||||
#endif
|
||||
|
||||
#define FIELD(type, name) type name __attribute__ ((aligned (ALIGN_##type)))
|
||||
|
||||
struct EBLHOOK(siginfo)
|
||||
{
|
||||
FIELD (INT, si_signo);
|
||||
FIELD (INT, si_code);
|
||||
FIELD (INT, si_errno);
|
||||
};
|
||||
|
||||
struct EBLHOOK(timeval)
|
||||
{
|
||||
FIELD (ULONG, tv_sec);
|
||||
FIELD (ULONG, tv_usec);
|
||||
};
|
||||
|
||||
/* On sparc64, tv_usec (suseconds_t) is actually 32 bits with 32 bits padding.
|
||||
The 'T'|0x80 value for .format indicates this as a special kludge. */
|
||||
#if SUSECONDS_HALF
|
||||
# define TIMEVAL_FIELD(name) FIELD (time, ULONG, name, 'T'|0x80, .count = 2)
|
||||
#else
|
||||
# define TIMEVAL_FIELD(name) FIELD (time, ULONG, name, 'T', .count = 2)
|
||||
#endif
|
||||
|
||||
|
||||
struct EBLHOOK(prstatus)
|
||||
{
|
||||
struct EBLHOOK(siginfo) pr_info;
|
||||
FIELD (SHORT, pr_cursig);
|
||||
FIELD (ULONG, pr_sigpend);
|
||||
FIELD (ULONG, pr_sighold);
|
||||
FIELD (PID_T, pr_pid);
|
||||
FIELD (PID_T, pr_ppid);
|
||||
FIELD (PID_T, pr_pgrp);
|
||||
FIELD (PID_T, pr_sid);
|
||||
struct EBLHOOK(timeval) pr_utime;
|
||||
struct EBLHOOK(timeval) pr_stime;
|
||||
struct EBLHOOK(timeval) pr_cutime;
|
||||
struct EBLHOOK(timeval) pr_cstime;
|
||||
struct
|
||||
{
|
||||
FIELD (PR_REG, pr_reg[PRSTATUS_REGS_SIZE / sizeof (PR_REG)]);
|
||||
}
|
||||
#ifdef ALIGN_PR_REG
|
||||
__attribute__ ((aligned (ALIGN_PR_REG)))
|
||||
#endif
|
||||
;
|
||||
FIELD (INT, pr_fpvalid);
|
||||
}
|
||||
#ifdef ALIGN_PRSTATUS
|
||||
__attribute__ ((packed, aligned (ALIGN_PRSTATUS)))
|
||||
#endif
|
||||
;
|
||||
|
||||
#define FNAMESZ 16
|
||||
#define PRARGSZ 80
|
||||
|
||||
struct EBLHOOK(prpsinfo)
|
||||
{
|
||||
FIELD (CHAR, pr_state);
|
||||
FIELD (CHAR, pr_sname);
|
||||
FIELD (CHAR, pr_zomb);
|
||||
FIELD (CHAR, pr_nice);
|
||||
FIELD (ULONG, pr_flag);
|
||||
FIELD (PRPSINFO_UID_T, pr_uid);
|
||||
FIELD (PRPSINFO_GID_T, pr_gid);
|
||||
FIELD (PID_T, pr_pid);
|
||||
FIELD (PID_T, pr_ppid);
|
||||
FIELD (PID_T, pr_pgrp);
|
||||
FIELD (PID_T, pr_sid);
|
||||
FIELD (CHAR, pr_fname[FNAMESZ]);
|
||||
FIELD (CHAR, pr_psargs[PRARGSZ]);
|
||||
};
|
||||
|
||||
#undef FIELD
|
||||
|
||||
#define FIELD(igroup, itype, item, fmt, ...) \
|
||||
{ \
|
||||
.name = #item, \
|
||||
.group = #igroup, \
|
||||
.offset = offsetof (struct EBLHOOK(prstatus), pr_##item), \
|
||||
.type = TYPE_##itype, \
|
||||
.format = fmt, \
|
||||
__VA_ARGS__ \
|
||||
}
|
||||
|
||||
static const Ebl_Core_Item prstatus_items[] =
|
||||
{
|
||||
FIELD (signal, INT, info.si_signo, 'd'),
|
||||
FIELD (signal, INT, info.si_code, 'd'),
|
||||
FIELD (signal, INT, info.si_errno, 'd'),
|
||||
FIELD (signal, SHORT, cursig, 'd'),
|
||||
|
||||
/* Use different group name for a newline delimiter. */
|
||||
FIELD (signal2, ULONG, sigpend, 'B'),
|
||||
FIELD (signal3, ULONG, sighold, 'B'),
|
||||
FIELD (identity, PID_T, pid, 'd', .thread_identifier = true),
|
||||
FIELD (identity, PID_T, ppid, 'd'),
|
||||
FIELD (identity, PID_T, pgrp, 'd'),
|
||||
FIELD (identity, PID_T, sid, 'd'),
|
||||
TIMEVAL_FIELD (utime),
|
||||
TIMEVAL_FIELD (stime),
|
||||
TIMEVAL_FIELD (cutime),
|
||||
TIMEVAL_FIELD (cstime),
|
||||
#ifdef PRSTATUS_REGSET_ITEMS
|
||||
PRSTATUS_REGSET_ITEMS,
|
||||
#endif
|
||||
FIELD (register, INT, fpvalid, 'd'),
|
||||
};
|
||||
|
||||
#undef FIELD
|
||||
|
||||
#define FIELD(igroup, itype, item, fmt, ...) \
|
||||
{ \
|
||||
.name = #item, \
|
||||
.group = #igroup, \
|
||||
.offset = offsetof (struct EBLHOOK(prpsinfo), pr_##item), \
|
||||
.type = TYPE_##itype, \
|
||||
.format = fmt, \
|
||||
__VA_ARGS__ \
|
||||
}
|
||||
|
||||
static const Ebl_Core_Item prpsinfo_items[] =
|
||||
{
|
||||
FIELD (state, CHAR, state, 'd'),
|
||||
FIELD (state, CHAR, sname, 'c'),
|
||||
FIELD (state, CHAR, zomb, 'd'),
|
||||
FIELD (state, CHAR, nice, 'd'),
|
||||
FIELD (state, ULONG, flag, 'x'),
|
||||
FIELD (identity, PRPSINFO_UID_T, uid, 'd'),
|
||||
FIELD (identity, PRPSINFO_GID_T, gid, 'd'),
|
||||
FIELD (identity, PID_T, pid, 'd'),
|
||||
FIELD (identity, PID_T, ppid, 'd'),
|
||||
FIELD (identity, PID_T, pgrp, 'd'),
|
||||
FIELD (identity, PID_T, sid, 'd'),
|
||||
FIELD (command, CHAR, fname, 's', .count = FNAMESZ),
|
||||
FIELD (command, CHAR, psargs, 's', .count = PRARGSZ),
|
||||
};
|
||||
|
||||
static const Ebl_Core_Item vmcoreinfo_items[] =
|
||||
{
|
||||
{
|
||||
.type = ELF_T_BYTE, .format = '\n'
|
||||
}
|
||||
};
|
||||
|
||||
#undef FIELD
|
||||
|
||||
int
|
||||
EBLHOOK(core_note) (const GElf_Nhdr *nhdr, const char *name,
|
||||
GElf_Word *regs_offset, size_t *nregloc,
|
||||
const Ebl_Register_Location **reglocs,
|
||||
size_t *nitems, const Ebl_Core_Item **items)
|
||||
{
|
||||
switch (nhdr->n_namesz)
|
||||
{
|
||||
case sizeof "CORE" - 1: /* Buggy old Linux kernels. */
|
||||
if (memcmp (name, "CORE", nhdr->n_namesz) == 0)
|
||||
break;
|
||||
return 0;
|
||||
|
||||
case sizeof "CORE":
|
||||
if (memcmp (name, "CORE", nhdr->n_namesz) == 0)
|
||||
break;
|
||||
/* Buggy old Linux kernels didn't terminate "LINUX". */
|
||||
/* Fall through. */
|
||||
|
||||
case sizeof "LINUX":
|
||||
if (memcmp (name, "LINUX", nhdr->n_namesz) == 0)
|
||||
break;
|
||||
return 0;
|
||||
|
||||
case sizeof "VMCOREINFO":
|
||||
if (nhdr->n_type != 0
|
||||
|| memcmp (name, "VMCOREINFO", sizeof "VMCOREINFO") != 0)
|
||||
return 0;
|
||||
*regs_offset = 0;
|
||||
*nregloc = 0;
|
||||
*nitems = 1;
|
||||
*items = vmcoreinfo_items;
|
||||
return 1;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (nhdr->n_type)
|
||||
{
|
||||
case NT_PRSTATUS:
|
||||
if (nhdr->n_descsz != sizeof (struct EBLHOOK(prstatus)))
|
||||
return 0;
|
||||
*regs_offset = offsetof (struct EBLHOOK(prstatus), pr_reg);
|
||||
*nregloc = sizeof prstatus_regs / sizeof prstatus_regs[0];
|
||||
*reglocs = prstatus_regs;
|
||||
*nitems = sizeof prstatus_items / sizeof prstatus_items[0];
|
||||
*items = prstatus_items;
|
||||
return 1;
|
||||
|
||||
case NT_PRPSINFO:
|
||||
if (nhdr->n_descsz != sizeof (struct EBLHOOK(prpsinfo)))
|
||||
return 0;
|
||||
*regs_offset = 0;
|
||||
*nregloc = 0;
|
||||
*reglocs = NULL;
|
||||
*nitems = sizeof prpsinfo_items / sizeof prpsinfo_items[0];
|
||||
*items = prpsinfo_items;
|
||||
return 1;
|
||||
|
||||
#define EXTRA_REGSET(type, size, table) \
|
||||
case type: \
|
||||
if (nhdr->n_descsz != size) \
|
||||
return 0; \
|
||||
*regs_offset = 0; \
|
||||
*nregloc = sizeof table / sizeof table[0]; \
|
||||
*reglocs = table; \
|
||||
*nitems = 0; \
|
||||
*items = NULL; \
|
||||
return 1;
|
||||
|
||||
#define EXTRA_REGSET_ITEMS(type, size, table, extra_items) \
|
||||
case type: \
|
||||
if (nhdr->n_descsz != size) \
|
||||
return 0; \
|
||||
*regs_offset = 0; \
|
||||
*nregloc = sizeof table / sizeof table[0]; \
|
||||
*reglocs = table; \
|
||||
*nitems = sizeof extra_items / sizeof extra_items[0]; \
|
||||
*items = extra_items; \
|
||||
return 1;
|
||||
|
||||
#define EXTRA_ITEMS(type, size, extra_items) \
|
||||
case type: \
|
||||
if (nhdr->n_descsz != size) \
|
||||
return 0; \
|
||||
*regs_offset = 0; \
|
||||
*nregloc = 0; \
|
||||
*reglocs = NULL; \
|
||||
*nitems = sizeof extra_items / sizeof extra_items[0]; \
|
||||
*items = extra_items; \
|
||||
return 1;
|
||||
|
||||
#ifdef FPREGSET_SIZE
|
||||
EXTRA_REGSET (NT_FPREGSET, FPREGSET_SIZE, fpregset_regs)
|
||||
#endif
|
||||
|
||||
#ifdef EXTRA_NOTES
|
||||
EXTRA_NOTES
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,72 +0,0 @@
|
||||
/* M68K specific core note handling.
|
||||
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/>. */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <elf.h>
|
||||
#include <inttypes.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#define BACKEND m68k_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
static const Ebl_Register_Location prstatus_regs[] =
|
||||
{
|
||||
{ .offset = 0, .regno = 1, .count = 14, .bits = 32 }, /* d1-d7, a0-a6 */
|
||||
{ .offset = 14 * 4, .regno = 0, .count = 1, .bits = 32 }, /* d0 */
|
||||
{ .offset = 15 * 4, .regno = 15, .count = 1, .bits = 32 }, /* a7 */
|
||||
{ .offset = 18 * 4, .regno = 24, .count = 1, .bits = 32 } /* pc */
|
||||
};
|
||||
#define PRSTATUS_REGS_SIZE (20 * 4)
|
||||
|
||||
#define ULONG uint32_t
|
||||
#define PID_T int32_t
|
||||
#define UID_T uint16_t
|
||||
#define GID_T uint16_t
|
||||
#define ALIGN_INT 2
|
||||
#define ALIGN_ULONG 2
|
||||
#define ALIGN_PID_T 2
|
||||
#define ALIGN_UID_T 2
|
||||
#define ALIGN_GID_T 2
|
||||
#define ALIGN_PRSTATUS 2
|
||||
#define TYPE_ULONG ELF_T_WORD
|
||||
#define TYPE_PID_T ELF_T_SWORD
|
||||
#define TYPE_UID_T ELF_T_HALF
|
||||
#define TYPE_GID_T ELF_T_HALF
|
||||
|
||||
static const Ebl_Register_Location fpregset_regs[] =
|
||||
{
|
||||
{ .offset = 0, .regno = 16, .count = 8, .bits = 96 }, /* fp0-fp7 */
|
||||
};
|
||||
#define FPREGSET_SIZE (27 * 4)
|
||||
|
||||
#include "linux-core-note.c"
|
@ -1,60 +0,0 @@
|
||||
/* Initialization of M68K specific backend library.
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND m68k_
|
||||
#define RELOC_PREFIX R_68K_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
/* This defines the common reloc hooks based on m68k_reloc.def. */
|
||||
#include "common-reloc.c"
|
||||
|
||||
|
||||
const char *
|
||||
m68k_init (Elf *elf __attribute__ ((unused)),
|
||||
GElf_Half machine __attribute__ ((unused)),
|
||||
Ebl *eh,
|
||||
size_t ehlen)
|
||||
{
|
||||
/* Check whether the Elf_BH object has a sufficent size. */
|
||||
if (ehlen < sizeof (Ebl))
|
||||
return NULL;
|
||||
|
||||
/* We handle it. */
|
||||
eh->name = "M68K";
|
||||
m68k_init_reloc (eh);
|
||||
HOOK (eh, gotpc_reloc_check);
|
||||
HOOK (eh, reloc_simple_type);
|
||||
HOOK (eh, return_value_location);
|
||||
HOOK (eh, register_info);
|
||||
HOOK (eh, core_note);
|
||||
|
||||
return MODVERSION;
|
||||
}
|
@ -1,96 +0,0 @@
|
||||
/* Register names and numbers for M68K DWARF.
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND m68k_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
ssize_t
|
||||
m68k_register_info (Ebl *ebl __attribute__ ((unused)),
|
||||
int regno, char *name, size_t namelen,
|
||||
const char **prefix, const char **setname,
|
||||
int *bits, int *type)
|
||||
{
|
||||
if (name == NULL)
|
||||
return 25;
|
||||
|
||||
if (regno < 0 || regno > 24 || namelen < 5)
|
||||
return -1;
|
||||
|
||||
*prefix = "%";
|
||||
*setname = "integer";
|
||||
*bits = 32;
|
||||
|
||||
switch (regno)
|
||||
{
|
||||
case 0 ... 7:
|
||||
*type = DW_ATE_signed;
|
||||
name[0] = 'd';
|
||||
name[1] = regno + '0';
|
||||
namelen = 2;
|
||||
break;
|
||||
|
||||
case 8 ... 15:
|
||||
*type = DW_ATE_address;
|
||||
name[0] = 'a';
|
||||
name[1] = regno - 8 + '0';
|
||||
namelen = 2;
|
||||
break;
|
||||
|
||||
case 16 ... 23:
|
||||
*type = DW_ATE_float;
|
||||
*setname = "FPU";
|
||||
*bits = 96;
|
||||
name[0] = 'f';
|
||||
name[1] = 'p';
|
||||
name[2] = regno - 16 + '0';
|
||||
namelen = 3;
|
||||
break;
|
||||
|
||||
case 24:
|
||||
*type = DW_ATE_address;
|
||||
name[0] = 'p';
|
||||
name[1] = 'c';
|
||||
namelen = 2;
|
||||
break;
|
||||
|
||||
/* Can't happen. */
|
||||
default:
|
||||
*setname = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
name[namelen++] = '\0';
|
||||
return namelen;
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
/* List the relocation types for m68k. -*- C -*-
|
||||
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/>. */
|
||||
|
||||
/* NAME, REL|EXEC|DYN */
|
||||
|
||||
RELOC_TYPE (NONE, EXEC|DYN)
|
||||
RELOC_TYPE (32, REL|EXEC|DYN)
|
||||
RELOC_TYPE (16, REL|EXEC|DYN)
|
||||
RELOC_TYPE (8, REL|EXEC|DYN)
|
||||
RELOC_TYPE (PC32, REL|EXEC|DYN)
|
||||
RELOC_TYPE (PC16, REL|EXEC|DYN)
|
||||
RELOC_TYPE (PC8, REL|EXEC|DYN)
|
||||
RELOC_TYPE (GOT32, REL)
|
||||
RELOC_TYPE (GOT16, REL)
|
||||
RELOC_TYPE (GOT8, REL)
|
||||
RELOC_TYPE (GOT32O, REL)
|
||||
RELOC_TYPE (GOT16O, REL)
|
||||
RELOC_TYPE (GOT8O, REL)
|
||||
RELOC_TYPE (PLT32, REL)
|
||||
RELOC_TYPE (PLT16, REL)
|
||||
RELOC_TYPE (PLT8, REL)
|
||||
RELOC_TYPE (PLT32O, REL)
|
||||
RELOC_TYPE (PLT16O, REL)
|
||||
RELOC_TYPE (PLT8O, REL)
|
||||
RELOC_TYPE (COPY, EXEC|DYN)
|
||||
RELOC_TYPE (GLOB_DAT, EXEC|DYN)
|
||||
RELOC_TYPE (JMP_SLOT, EXEC|DYN)
|
||||
RELOC_TYPE (RELATIVE, EXEC|DYN)
|
||||
RELOC_TYPE (TLS_GD32, REL)
|
||||
RELOC_TYPE (TLS_GD16, REL)
|
||||
RELOC_TYPE (TLS_GD8, REL)
|
||||
RELOC_TYPE (TLS_LDM32, REL)
|
||||
RELOC_TYPE (TLS_LDM16, REL)
|
||||
RELOC_TYPE (TLS_LDM8, REL)
|
||||
RELOC_TYPE (TLS_LDO32, REL)
|
||||
RELOC_TYPE (TLS_LDO16, REL)
|
||||
RELOC_TYPE (TLS_LDO8, REL)
|
||||
RELOC_TYPE (TLS_IE32, REL)
|
||||
RELOC_TYPE (TLS_IE16, REL)
|
||||
RELOC_TYPE (TLS_IE8, REL)
|
||||
RELOC_TYPE (TLS_LE32, REL)
|
||||
RELOC_TYPE (TLS_LE16, REL)
|
||||
RELOC_TYPE (TLS_LE8, REL)
|
||||
RELOC_TYPE (TLS_DTPMOD32, EXEC|DYN)
|
||||
RELOC_TYPE (TLS_DTPREL32, EXEC|DYN)
|
||||
RELOC_TYPE (TLS_TPREL32, EXEC|DYN)
|
@ -1,151 +0,0 @@
|
||||
/* Function return value location for Linux/m68k ABI.
|
||||
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/>. */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND m68k_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
/* %d0, or pair %d0, %d1. */
|
||||
static const Dwarf_Op loc_intreg[] =
|
||||
{
|
||||
{ .atom = DW_OP_reg0 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
{ .atom = DW_OP_reg1 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
};
|
||||
#define nloc_intreg 1
|
||||
#define nloc_intregpair 4
|
||||
|
||||
/* %a0. */
|
||||
static const Dwarf_Op loc_ptrreg[] =
|
||||
{
|
||||
{ .atom = DW_OP_reg8 }
|
||||
};
|
||||
#define nloc_ptrreg 1
|
||||
|
||||
/* %fp0. */
|
||||
static const Dwarf_Op loc_fpreg[] =
|
||||
{
|
||||
{ .atom = DW_OP_reg16 }
|
||||
};
|
||||
#define nloc_fpreg 1
|
||||
|
||||
/* The return value is a structure and is actually stored in stack space
|
||||
passed in a hidden argument by the caller. But, the compiler
|
||||
helpfully returns the address of that space in %a0. */
|
||||
static const Dwarf_Op loc_aggregate[] =
|
||||
{
|
||||
{ .atom = DW_OP_reg8 }
|
||||
};
|
||||
#define nloc_aggregate 1
|
||||
|
||||
int
|
||||
m68k_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_Die die_mem, *typedie = &die_mem;
|
||||
int tag = dwarf_peeled_die_type (functypedie, typedie);
|
||||
if (tag <= 0)
|
||||
return tag;
|
||||
|
||||
switch (tag)
|
||||
{
|
||||
case -1:
|
||||
return -1;
|
||||
|
||||
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_OR_RETURN (typedie);
|
||||
}
|
||||
/* Fall through. */
|
||||
|
||||
case DW_TAG_base_type:
|
||||
case DW_TAG_enumeration_type:
|
||||
case DW_TAG_pointer_type:
|
||||
case DW_TAG_ptr_to_member_type:
|
||||
{
|
||||
Dwarf_Word size;
|
||||
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 = 4;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
if (tag == DW_TAG_base_type)
|
||||
{
|
||||
Dwarf_Word encoding;
|
||||
if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
|
||||
&attr_mem),
|
||||
&encoding) != 0)
|
||||
return -1;
|
||||
if (encoding == DW_ATE_float)
|
||||
{
|
||||
if (size > 12)
|
||||
return -2;
|
||||
*locp = loc_fpreg;
|
||||
return nloc_fpreg;
|
||||
}
|
||||
}
|
||||
if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
|
||||
{
|
||||
*locp = loc_ptrreg;
|
||||
return nloc_ptrreg;
|
||||
}
|
||||
*locp = loc_intreg;
|
||||
if (size <= 4)
|
||||
return nloc_intreg;
|
||||
if (size <= 8)
|
||||
return nloc_intregpair;
|
||||
}
|
||||
/* Fallthrough */
|
||||
case DW_TAG_structure_type:
|
||||
case DW_TAG_class_type:
|
||||
case DW_TAG_union_type:
|
||||
case DW_TAG_array_type:
|
||||
*locp = loc_aggregate;
|
||||
return nloc_aggregate;
|
||||
}
|
||||
|
||||
/* XXX We don't have a good way to return specific errors from ebl calls.
|
||||
This value means we do not understand the type, but it is well-formed
|
||||
DWARF and might be valid. */
|
||||
return -2;
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
/* m68k specific symbolic name handling.
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <elf.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#define BACKEND m68k_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
/* Return true if the symbol type is that referencing the GOT. */
|
||||
bool
|
||||
m68k_gotpc_reloc_check (Elf *elf __attribute__ ((unused)), int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case R_68K_GOT32:
|
||||
case R_68K_GOT16:
|
||||
case R_68K_GOT8:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Check for the simple reloc types. */
|
||||
Elf_Type
|
||||
m68k_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case R_68K_32:
|
||||
return ELF_T_SWORD;
|
||||
case R_68K_16:
|
||||
return ELF_T_HALF;
|
||||
case R_68K_8:
|
||||
return ELF_T_BYTE;
|
||||
default:
|
||||
return ELF_T_NUM;
|
||||
}
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
#define BITS 64
|
||||
#include "ppc_corenote.c"
|
@ -1,110 +0,0 @@
|
||||
/* Initialization of PPC64 specific backend library.
|
||||
Copyright (C) 2004, 2005, 2006, 2007, 2008, 2013, 2014 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
Written by Ulrich Drepper <drepper@redhat.com>, 2004.
|
||||
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define BACKEND ppc64_
|
||||
#define RELOC_PREFIX R_PPC64_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
/* This defines the common reloc hooks based on ppc64_reloc.def. */
|
||||
#include "common-reloc.c"
|
||||
|
||||
|
||||
const char *
|
||||
ppc64_init (Elf *elf __attribute__ ((unused)),
|
||||
GElf_Half machine __attribute__ ((unused)),
|
||||
Ebl *eh,
|
||||
size_t ehlen)
|
||||
{
|
||||
/* Check whether the Elf_BH object has a sufficent size. */
|
||||
if (ehlen < sizeof (Ebl))
|
||||
return NULL;
|
||||
|
||||
/* We handle it. */
|
||||
eh->name = "PowerPC 64-bit";
|
||||
ppc64_init_reloc (eh);
|
||||
HOOK (eh, reloc_simple_type);
|
||||
HOOK (eh, dynamic_tag_name);
|
||||
HOOK (eh, dynamic_tag_check);
|
||||
HOOK (eh, machine_flag_check);
|
||||
HOOK (eh, copy_reloc_p);
|
||||
HOOK (eh, check_special_symbol);
|
||||
HOOK (eh, check_st_other_bits);
|
||||
HOOK (eh, bss_plt_p);
|
||||
HOOK (eh, return_value_location);
|
||||
HOOK (eh, register_info);
|
||||
HOOK (eh, syscall_abi);
|
||||
HOOK (eh, core_note);
|
||||
HOOK (eh, auxv_info);
|
||||
HOOK (eh, check_object_attribute);
|
||||
HOOK (eh, abi_cfi);
|
||||
/* gcc/config/ #define DWARF_FRAME_REGISTERS. */
|
||||
eh->frame_nregs = (114 - 1) + 32;
|
||||
HOOK (eh, set_initial_registers_tid);
|
||||
HOOK (eh, dwarf_to_regno);
|
||||
HOOK (eh, unwind);
|
||||
HOOK (eh, resolve_sym_value);
|
||||
|
||||
/* Find the function descriptor .opd table for resolve_sym_value. */
|
||||
if (elf != NULL)
|
||||
{
|
||||
GElf_Ehdr ehdr_mem, *ehdr = gelf_getehdr (elf, &ehdr_mem);
|
||||
if (ehdr != NULL && ehdr->e_type != ET_REL)
|
||||
{
|
||||
/* We could also try through DT_PPC64_OPD and DT_PPC64_OPDSZ. */
|
||||
GElf_Shdr opd_shdr_mem, *opd_shdr;
|
||||
Elf_Scn *scn = NULL;
|
||||
while ((scn = elf_nextscn (elf, scn)) != NULL)
|
||||
{
|
||||
opd_shdr = gelf_getshdr (scn, &opd_shdr_mem);
|
||||
if (opd_shdr != NULL
|
||||
&& (opd_shdr->sh_flags & SHF_ALLOC) != 0
|
||||
&& opd_shdr->sh_type == SHT_PROGBITS
|
||||
&& opd_shdr->sh_size > 0)
|
||||
{
|
||||
const char *name = elf_strptr (elf, ehdr->e_shstrndx,
|
||||
opd_shdr->sh_name);
|
||||
if (name != NULL && strcmp (name, ".opd") == 0)
|
||||
{
|
||||
eh->fd_addr = opd_shdr->sh_addr;
|
||||
eh->fd_data = elf_getdata (scn, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return MODVERSION;
|
||||
}
|
@ -1,161 +0,0 @@
|
||||
/* List the relocation types for ppc64. -*- C -*-
|
||||
Copyright (C) 2005, 2015 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/>. */
|
||||
|
||||
/* NAME, REL|EXEC|DYN */
|
||||
|
||||
RELOC_TYPE (NONE, 0)
|
||||
RELOC_TYPE (ADDR32, REL|EXEC|DYN)
|
||||
RELOC_TYPE (ADDR24, REL)
|
||||
RELOC_TYPE (ADDR16, REL) /* note 1 */
|
||||
RELOC_TYPE (ADDR16_LO, REL) /* note 1 */
|
||||
RELOC_TYPE (ADDR16_HI, REL) /* note 1 */
|
||||
RELOC_TYPE (ADDR16_HA, REL) /* note 1 */
|
||||
RELOC_TYPE (ADDR14, REL) /* note 1 */
|
||||
RELOC_TYPE (ADDR14_BRTAKEN, REL) /* note 1 */
|
||||
RELOC_TYPE (ADDR14_BRNTAKEN, REL) /* note 1 */
|
||||
RELOC_TYPE (REL24, REL)
|
||||
RELOC_TYPE (REL14, REL)
|
||||
RELOC_TYPE (REL14_BRTAKEN, REL)
|
||||
RELOC_TYPE (REL14_BRNTAKEN, REL)
|
||||
RELOC_TYPE (GOT16, REL)
|
||||
RELOC_TYPE (GOT16_LO, REL)
|
||||
RELOC_TYPE (GOT16_HI, REL)
|
||||
RELOC_TYPE (GOT16_HA, REL)
|
||||
RELOC_TYPE (COPY, EXEC|DYN)
|
||||
RELOC_TYPE (GLOB_DAT, EXEC|DYN)
|
||||
RELOC_TYPE (JMP_SLOT, EXEC|DYN)
|
||||
RELOC_TYPE (RELATIVE, EXEC|DYN)
|
||||
RELOC_TYPE (UADDR32, REL|EXEC|DYN)
|
||||
RELOC_TYPE (UADDR16, REL)
|
||||
RELOC_TYPE (REL32, REL|EXEC|DYN)
|
||||
RELOC_TYPE (PLT32, REL)
|
||||
RELOC_TYPE (PLTREL32, REL)
|
||||
RELOC_TYPE (PLT16_LO, REL)
|
||||
RELOC_TYPE (PLT16_HI, REL)
|
||||
RELOC_TYPE (PLT16_HA, REL)
|
||||
RELOC_TYPE (SECTOFF, REL)
|
||||
RELOC_TYPE (SECTOFF_LO, REL)
|
||||
RELOC_TYPE (SECTOFF_HI, REL)
|
||||
RELOC_TYPE (SECTOFF_HA, REL)
|
||||
RELOC_TYPE (ADDR30, REL) /* note 1 */
|
||||
RELOC_TYPE (ADDR64, REL|EXEC|DYN)
|
||||
RELOC_TYPE (ADDR16_HIGHER, REL) /* note 1 */
|
||||
RELOC_TYPE (ADDR16_HIGHERA, REL) /* note 1 */
|
||||
RELOC_TYPE (ADDR16_HIGHEST, REL) /* note 1 */
|
||||
RELOC_TYPE (ADDR16_HIGHESTA, REL) /* note 1 */
|
||||
RELOC_TYPE (UADDR64, REL|EXEC|DYN)
|
||||
RELOC_TYPE (REL64, REL|EXEC|DYN)
|
||||
RELOC_TYPE (PLT64, REL)
|
||||
RELOC_TYPE (PLTREL64, REL)
|
||||
RELOC_TYPE (TOC16, REL)
|
||||
RELOC_TYPE (TOC16_LO, REL)
|
||||
RELOC_TYPE (TOC16_HI, REL)
|
||||
RELOC_TYPE (TOC16_HA, REL)
|
||||
RELOC_TYPE (TOC, REL)
|
||||
RELOC_TYPE (PLTGOT16, REL)
|
||||
RELOC_TYPE (PLTGOT16_LO, REL)
|
||||
RELOC_TYPE (PLTGOT16_HI, REL)
|
||||
RELOC_TYPE (PLTGOT16_HA, REL)
|
||||
RELOC_TYPE (ADDR16_DS, REL) /* note 1 */
|
||||
RELOC_TYPE (ADDR16_LO_DS, REL) /* note 1 */
|
||||
RELOC_TYPE (GOT16_DS, REL)
|
||||
RELOC_TYPE (GOT16_LO_DS, REL)
|
||||
RELOC_TYPE (PLT16_LO_DS, REL)
|
||||
RELOC_TYPE (SECTOFF_DS, REL)
|
||||
RELOC_TYPE (SECTOFF_LO_DS, REL)
|
||||
RELOC_TYPE (TOC16_DS, REL)
|
||||
RELOC_TYPE (TOC16_LO_DS, REL)
|
||||
RELOC_TYPE (PLTGOT16_DS, REL)
|
||||
RELOC_TYPE (PLTGOT16_LO_DS, REL)
|
||||
RELOC_TYPE (TLS, REL)
|
||||
RELOC_TYPE (DTPMOD64, REL|EXEC|DYN) /* note 3 */
|
||||
RELOC_TYPE (TPREL16, REL) /* note 2 */
|
||||
RELOC_TYPE (TPREL16_LO, REL) /* note 2 */
|
||||
RELOC_TYPE (TPREL16_HI, REL) /* note 2 */
|
||||
RELOC_TYPE (TPREL16_HA, REL) /* note 2 */
|
||||
RELOC_TYPE (TPREL64, REL|EXEC|DYN) /* note 3 */
|
||||
RELOC_TYPE (DTPREL16, REL)
|
||||
RELOC_TYPE (DTPREL16_LO, REL)
|
||||
RELOC_TYPE (DTPREL16_HI, REL)
|
||||
RELOC_TYPE (DTPREL16_HA, REL)
|
||||
RELOC_TYPE (DTPREL64, REL|EXEC|DYN) /* note 3 */
|
||||
RELOC_TYPE (GOT_TLSGD16, REL)
|
||||
RELOC_TYPE (GOT_TLSGD16_LO, REL)
|
||||
RELOC_TYPE (GOT_TLSGD16_HI, REL)
|
||||
RELOC_TYPE (GOT_TLSGD16_HA, REL)
|
||||
RELOC_TYPE (GOT_TLSLD16, REL)
|
||||
RELOC_TYPE (GOT_TLSLD16_LO, REL)
|
||||
RELOC_TYPE (GOT_TLSLD16_HI, REL)
|
||||
RELOC_TYPE (GOT_TLSLD16_HA, REL)
|
||||
RELOC_TYPE (GOT_TPREL16_DS, REL)
|
||||
RELOC_TYPE (GOT_TPREL16_LO_DS, REL)
|
||||
RELOC_TYPE (GOT_TPREL16_HI, REL)
|
||||
RELOC_TYPE (GOT_TPREL16_HA, REL)
|
||||
RELOC_TYPE (GOT_DTPREL16_DS, REL)
|
||||
RELOC_TYPE (GOT_DTPREL16_LO_DS, REL)
|
||||
RELOC_TYPE (GOT_DTPREL16_HI, REL)
|
||||
RELOC_TYPE (GOT_DTPREL16_HA, REL)
|
||||
RELOC_TYPE (TPREL16_DS, REL) /* note 2 */
|
||||
RELOC_TYPE (TPREL16_LO_DS, REL) /* note 2 */
|
||||
RELOC_TYPE (TPREL16_HIGHER, REL) /* note 2 */
|
||||
RELOC_TYPE (TPREL16_HIGHERA, REL) /* note 2 */
|
||||
RELOC_TYPE (TPREL16_HIGHEST, REL) /* note 2 */
|
||||
RELOC_TYPE (TPREL16_HIGHESTA, REL) /* note 2 */
|
||||
RELOC_TYPE (DTPREL16_DS, REL)
|
||||
RELOC_TYPE (DTPREL16_LO_DS, REL)
|
||||
RELOC_TYPE (DTPREL16_HIGHER, REL)
|
||||
RELOC_TYPE (DTPREL16_HIGHERA, REL)
|
||||
RELOC_TYPE (DTPREL16_HIGHEST, REL)
|
||||
RELOC_TYPE (DTPREL16_HIGHESTA, REL)
|
||||
RELOC_TYPE (TLSGD, REL)
|
||||
RELOC_TYPE (TLSLD, REL)
|
||||
RELOC_TYPE (TOCSAVE, REL)
|
||||
RELOC_TYPE (ADDR16_HIGH, REL)
|
||||
RELOC_TYPE (ADDR16_HIGHA, REL)
|
||||
RELOC_TYPE (TPREL16_HIGH, REL)
|
||||
RELOC_TYPE (TPREL16_HIGHA, REL)
|
||||
RELOC_TYPE (DTPREL16_HIGH, REL)
|
||||
RELOC_TYPE (DTPREL16_HIGHA, REL)
|
||||
RELOC_TYPE (JMP_IREL, REL)
|
||||
RELOC_TYPE (IRELATIVE, REL)
|
||||
RELOC_TYPE (REL16, REL)
|
||||
RELOC_TYPE (REL16_LO, REL)
|
||||
RELOC_TYPE (REL16_HI, REL)
|
||||
RELOC_TYPE (REL16_HA, REL)
|
||||
|
||||
/* Notes from Alan Modra:
|
||||
|
||||
1) These can appear in DYN and EXEC with improper assembly, but they
|
||||
aren't really kosher.
|
||||
|
||||
2) These can appear in DYN with improper assembly (or silly gcc
|
||||
attributes, I think). Again, not kosher.
|
||||
|
||||
3) These are legal in REL for PowerOpen compatible assembler syntax,
|
||||
ie. TOC managed by compiler.
|
||||
*/
|
@ -1,63 +0,0 @@
|
||||
/* Resolve symbol values through .opd function descriptors.
|
||||
Copyright (C) 2013 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND ppc64_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
/* Resolve a function descriptor if addr points into the .opd section.
|
||||
The .opd section contains function descriptors consisting of 3 addresses.
|
||||
function, toc and chain. We are just interested in the first.
|
||||
http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html#FUNC-DES
|
||||
|
||||
Returns true if the given address could be resolved, false otherwise.
|
||||
*/
|
||||
bool
|
||||
ppc64_resolve_sym_value (Ebl *ebl, GElf_Addr *addr)
|
||||
{
|
||||
if (ebl->fd_data != NULL && *addr >= ebl->fd_addr
|
||||
&& *addr + sizeof (Elf64_Addr) <= ebl->fd_addr + ebl->fd_data->d_size)
|
||||
{
|
||||
GElf_Ehdr ehdr_mem, *ehdr = gelf_getehdr (ebl->elf, &ehdr_mem);
|
||||
if (ehdr != NULL)
|
||||
{
|
||||
Elf_Data opd_in, opd_out;
|
||||
opd_in.d_buf = ebl->fd_data->d_buf + (*addr - ebl->fd_addr);
|
||||
opd_out.d_buf = addr;
|
||||
opd_out.d_size = opd_in.d_size = sizeof (Elf64_Addr);
|
||||
opd_out.d_type = opd_in.d_type = ELF_T_ADDR;
|
||||
if (elf64_xlatetom (&opd_out, &opd_in,
|
||||
ehdr->e_ident[EI_DATA]) != NULL)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
@ -1,195 +0,0 @@
|
||||
/* Function return value location for Linux/PPC64 ABI.
|
||||
Copyright (C) 2005-2010, 2014 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND ppc64_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
/* r3. */
|
||||
static const Dwarf_Op loc_intreg[] =
|
||||
{
|
||||
{ .atom = DW_OP_reg3 }
|
||||
};
|
||||
#define nloc_intreg 1
|
||||
|
||||
/* f1, or f1:f2, or f1:f4. */
|
||||
static const Dwarf_Op loc_fpreg[] =
|
||||
{
|
||||
{ .atom = DW_OP_regx, .number = 33 }, { .atom = DW_OP_piece, .number = 8 },
|
||||
{ .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 8 },
|
||||
{ .atom = DW_OP_regx, .number = 35 }, { .atom = DW_OP_piece, .number = 8 },
|
||||
{ .atom = DW_OP_regx, .number = 36 }, { .atom = DW_OP_piece, .number = 8 },
|
||||
};
|
||||
#define nloc_fpreg 1
|
||||
#define nloc_fp2regs 4
|
||||
#define nloc_fp4regs 8
|
||||
|
||||
/* vr2. */
|
||||
static const Dwarf_Op loc_vmxreg[] =
|
||||
{
|
||||
{ .atom = DW_OP_regx, .number = 1124 + 2 }
|
||||
};
|
||||
#define nloc_vmxreg 1
|
||||
|
||||
/* The return value is a structure and is actually stored in stack space
|
||||
passed in a hidden argument by the caller. But, the compiler
|
||||
helpfully returns the address of that space in r3. */
|
||||
static const Dwarf_Op loc_aggregate[] =
|
||||
{
|
||||
{ .atom = DW_OP_breg3, .number = 0 }
|
||||
};
|
||||
#define nloc_aggregate 1
|
||||
|
||||
int
|
||||
ppc64_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_Die die_mem, *typedie = &die_mem;
|
||||
int tag = dwarf_peeled_die_type (functypedie, typedie);
|
||||
if (tag <= 0)
|
||||
return tag;
|
||||
|
||||
Dwarf_Word size;
|
||||
switch (tag)
|
||||
{
|
||||
case -1:
|
||||
return -1;
|
||||
|
||||
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_OR_RETURN (typedie);
|
||||
}
|
||||
/* Fall through. */
|
||||
|
||||
case DW_TAG_base_type:
|
||||
case DW_TAG_enumeration_type:
|
||||
case DW_TAG_pointer_type:
|
||||
case DW_TAG_ptr_to_member_type:
|
||||
{
|
||||
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),
|
||||
&encoding) != 0)
|
||||
return -1;
|
||||
|
||||
if (encoding == DW_ATE_float || encoding == DW_ATE_complex_float)
|
||||
{
|
||||
*locp = loc_fpreg;
|
||||
if (size <= 8)
|
||||
return nloc_fpreg;
|
||||
if (size <= 16)
|
||||
return nloc_fp2regs;
|
||||
if (size <= 32)
|
||||
return nloc_fp4regs;
|
||||
}
|
||||
}
|
||||
if (size <= 8)
|
||||
{
|
||||
intreg:
|
||||
*locp = loc_intreg;
|
||||
return nloc_intreg;
|
||||
}
|
||||
|
||||
/* Else fall through. */
|
||||
case DW_TAG_structure_type:
|
||||
case DW_TAG_class_type:
|
||||
case DW_TAG_union_type:
|
||||
aggregate:
|
||||
*locp = loc_aggregate;
|
||||
return nloc_aggregate;
|
||||
|
||||
case DW_TAG_array_type:
|
||||
{
|
||||
Dwarf_Attribute attr_mem;
|
||||
bool is_vector;
|
||||
if (dwarf_formflag (dwarf_attr_integrate (typedie, DW_AT_GNU_vector,
|
||||
&attr_mem), &is_vector) == 0
|
||||
&& is_vector)
|
||||
{
|
||||
*locp = loc_vmxreg;
|
||||
return nloc_vmxreg;
|
||||
}
|
||||
}
|
||||
/* Fall through. */
|
||||
|
||||
case DW_TAG_string_type:
|
||||
if (dwarf_aggregate_size (typedie, &size) == 0 && size <= 8)
|
||||
{
|
||||
if (tag == DW_TAG_array_type)
|
||||
{
|
||||
/* Check if it's a character array. */
|
||||
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_OR_RETURN (typedie);
|
||||
if (tag != DW_TAG_base_type)
|
||||
goto aggregate;
|
||||
if (dwarf_formudata (dwarf_attr_integrate (typedie,
|
||||
DW_AT_byte_size,
|
||||
&attr_mem),
|
||||
&size) != 0)
|
||||
return -1;
|
||||
if (size != 1)
|
||||
goto aggregate;
|
||||
}
|
||||
goto intreg;
|
||||
}
|
||||
goto aggregate;
|
||||
}
|
||||
|
||||
/* XXX We don't have a good way to return specific errors from ebl calls.
|
||||
This value means we do not understand the type, but it is well-formed
|
||||
DWARF and might be valid. */
|
||||
return -2;
|
||||
}
|
@ -1,130 +0,0 @@
|
||||
/* PPC64 specific symbolic name handling.
|
||||
Copyright (C) 2004, 2005, 2014 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
Written by Ulrich Drepper <drepper@redhat.com>, 2004.
|
||||
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <elf.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#define BACKEND ppc64_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
/* Check for the simple reloc types. */
|
||||
Elf_Type
|
||||
ppc64_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case R_PPC64_ADDR64:
|
||||
case R_PPC64_UADDR64:
|
||||
return ELF_T_XWORD;
|
||||
case R_PPC64_ADDR32:
|
||||
case R_PPC64_UADDR32:
|
||||
return ELF_T_WORD;
|
||||
case R_PPC64_UADDR16:
|
||||
return ELF_T_HALF;
|
||||
default:
|
||||
return ELF_T_NUM;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
ppc64_dynamic_tag_name (int64_t tag, char *buf __attribute__ ((unused)),
|
||||
size_t len __attribute__ ((unused)))
|
||||
{
|
||||
switch (tag)
|
||||
{
|
||||
case DT_PPC64_GLINK:
|
||||
return "PPC64_GLINK";
|
||||
case DT_PPC64_OPD:
|
||||
return "PPC64_OPD";
|
||||
case DT_PPC64_OPDSZ:
|
||||
return "PPC64_OPDSZ";
|
||||
case DT_PPC64_OPT:
|
||||
return "PPC64_OPT";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
ppc64_dynamic_tag_check (int64_t tag)
|
||||
{
|
||||
return (tag == DT_PPC64_GLINK
|
||||
|| tag == DT_PPC64_OPD
|
||||
|| tag == DT_PPC64_OPDSZ
|
||||
|| tag == DT_PPC64_OPT);
|
||||
}
|
||||
|
||||
|
||||
/* Check whether given symbol's st_value and st_size are OK despite failing
|
||||
normal checks. */
|
||||
bool
|
||||
ppc64_check_special_symbol (Elf *elf, GElf_Ehdr *ehdr,
|
||||
const GElf_Sym *sym __attribute__ ((unused)),
|
||||
const char *name __attribute__ ((unused)),
|
||||
const GElf_Shdr *destshdr)
|
||||
{
|
||||
const char *sname = elf_strptr (elf, ehdr->e_shstrndx, destshdr->sh_name);
|
||||
if (sname == NULL)
|
||||
return false;
|
||||
return strcmp (sname, ".opd") == 0;
|
||||
}
|
||||
|
||||
|
||||
/* Check if backend uses a bss PLT in this file. */
|
||||
bool
|
||||
ppc64_bss_plt_p (Elf *elf __attribute__ ((unused)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Check whether machine flags are valid. PPC64 has three possible values:
|
||||
0 - for unspecified ABI, or not using any specific ABI features.
|
||||
1 - for the original ELF PPC64 ABI using function descriptors.
|
||||
2 - for the revised ELFv2 PPC64 ABI without function descriptors. */
|
||||
bool
|
||||
ppc64_machine_flag_check (GElf_Word flags)
|
||||
{
|
||||
return flags == 0 || flags == 1 || flags == 2;
|
||||
}
|
||||
|
||||
bool
|
||||
ppc64_check_st_other_bits (unsigned char st_other)
|
||||
{
|
||||
return (PPC64_LOCAL_ENTRY_OFFSET (st_other) != 0);
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
/* Get previous frame state for an existing frame state.
|
||||
Copyright (C) 2017 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND ppc64_
|
||||
|
||||
#define LR_REG 65 /* Not 108, see ppc_dwarf_to_regno. */
|
||||
#define SP_REG 1
|
||||
|
||||
#define LR_OFFSET 16
|
||||
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
/* Simplistic fallback frame unwinder. SP points to the backchain (contains
|
||||
address of previous stack pointer). At SP offset 16 is the LR save area
|
||||
(contains the value of the previous LR). */
|
||||
|
||||
bool
|
||||
EBLHOOK(unwind) (Ebl *ebl __attribute__ ((unused)),
|
||||
Dwarf_Addr pc __attribute__ ((unused)),
|
||||
ebl_tid_registers_t *setfunc, ebl_tid_registers_get_t *getfunc,
|
||||
ebl_pid_memory_read_t *readfunc, void *arg,
|
||||
bool *signal_framep __attribute__ ((unused)))
|
||||
{
|
||||
Dwarf_Word sp, newSp, lr, newLr;
|
||||
|
||||
/* Stack pointer points to the backchain which contains the previous sp. */
|
||||
if (! getfunc (SP_REG, 1, &sp, arg))
|
||||
sp = 0;
|
||||
|
||||
/* Link register contains previous program counter. */
|
||||
if (! getfunc (LR_REG, 1, &lr, arg)
|
||||
|| lr == 0
|
||||
|| ! setfunc (-1, 1, &lr, arg))
|
||||
return false;
|
||||
|
||||
if (! readfunc(sp, &newSp, arg))
|
||||
newSp = 0;
|
||||
|
||||
if (! readfunc(newSp + LR_OFFSET, &newLr, arg))
|
||||
newLr = 0;
|
||||
|
||||
setfunc(SP_REG, 1, &newSp, arg);
|
||||
setfunc(LR_REG, 1, &newLr, arg);
|
||||
|
||||
/* Sanity check the stack grows down. */
|
||||
return newSp > sp;
|
||||
}
|
@ -1,86 +0,0 @@
|
||||
/* Object attribute tags for PowerPC.
|
||||
Copyright (C) 2008, 2009 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND ppc_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
bool
|
||||
ppc_check_object_attribute (Ebl *ebl __attribute__ ((unused)),
|
||||
const char *vendor, int tag, uint64_t value,
|
||||
const char **tag_name, const char **value_name)
|
||||
{
|
||||
if (!strcmp (vendor, "gnu"))
|
||||
switch (tag)
|
||||
{
|
||||
case 4:
|
||||
*tag_name = "GNU_Power_ABI_FP";
|
||||
static const char *fp_kinds[] =
|
||||
{
|
||||
"Hard or soft float",
|
||||
"Hard float",
|
||||
"Soft float",
|
||||
"Single-precision hard float",
|
||||
};
|
||||
if (value < sizeof fp_kinds / sizeof fp_kinds[0])
|
||||
*value_name = fp_kinds[value];
|
||||
return true;
|
||||
|
||||
case 8:
|
||||
*tag_name = "GNU_Power_ABI_Vector";
|
||||
static const char *vector_kinds[] =
|
||||
{
|
||||
"Any", "Generic", "AltiVec", "SPE"
|
||||
};
|
||||
if (value < sizeof vector_kinds / sizeof vector_kinds[0])
|
||||
*value_name = vector_kinds[value];
|
||||
return true;
|
||||
|
||||
case 12:
|
||||
*tag_name = "GNU_Power_ABI_Struct_Return";
|
||||
static const char *struct_return_kinds[] =
|
||||
{
|
||||
"Any", "r3/r4", "Memory"
|
||||
};
|
||||
if (value < sizeof struct_return_kinds / sizeof struct_return_kinds[0])
|
||||
*value_name = struct_return_kinds[value];
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
__typeof (ppc_check_object_attribute)
|
||||
ppc64_check_object_attribute
|
||||
__attribute__ ((alias ("ppc_check_object_attribute")));
|
@ -1,55 +0,0 @@
|
||||
/* i386 specific auxv handling.
|
||||
Copyright (C) 2007 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND ppc_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
int
|
||||
EBLHOOK(auxv_info) (GElf_Xword a_type, const char **name, const char **format)
|
||||
{
|
||||
if (a_type != AT_HWCAP)
|
||||
return 0;
|
||||
|
||||
*name = "HWCAP";
|
||||
*format = "b"
|
||||
"ppcle\0" "truele\0" "3\0" "4\0" "5\0" "6\0" "7\0" "8\0" "9\0"
|
||||
"power6x\0" "dfp\0" "pa6t\0" "arch_2_05\0"
|
||||
"ic_snoop\0" "smt\0" "booke\0" "cellbe\0"
|
||||
"power5+\0" "power5\0" "power4\0" "notb\0"
|
||||
"efpdouble\0" "efpsingle\0" "spe\0" "ucache\0"
|
||||
"4xxmac\0" "mmu\0" "fpu\0" "altivec\0"
|
||||
"ppc601\0" "ppc64\0" "ppc32\0" "\0";
|
||||
return 1;
|
||||
}
|
||||
|
||||
__typeof (ppc_auxv_info) ppc64_auxv_info
|
||||
__attribute__ ((alias ("ppc_auxv_info")));
|
@ -1,77 +0,0 @@
|
||||
/* ppc ABI-specified defaults for DWARF CFI.
|
||||
Copyright (C) 2012, 2013 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND ppc_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
int
|
||||
ppc_abi_cfi (Ebl *ebl __attribute__ ((unused)), Dwarf_CIE *abi_info)
|
||||
{
|
||||
static const uint8_t abi_cfi[] =
|
||||
{
|
||||
/* This instruction is provided in every CIE. It is not repeated here:
|
||||
DW_CFA_def_cfa, ULEB128_7 (1), ULEB128_7 (0) */
|
||||
/* r1 is assumed to be restored from cfa adress,
|
||||
r1 acts as a stack frame pointer. */
|
||||
DW_CFA_val_offset, ULEB128_7 (1), ULEB128_7 (0),
|
||||
/* lr is not callee-saved but it needs to be preserved as it is pre-set
|
||||
by the caller. */
|
||||
DW_CFA_same_value, ULEB128_7 (65), /* lr */
|
||||
|
||||
/* Callee-saved regs. */
|
||||
#define SV(n) DW_CFA_same_value, ULEB128_7 (n)
|
||||
SV (2), /* r2 is TOC pointer. */
|
||||
SV (13), /* Reserved as system thread id (is it for CFI?). */
|
||||
/* r14-r31 are non-volatile registers. */
|
||||
SV (14), SV (15), SV (16), SV (17), SV (18), SV (19), SV (20), SV (21),
|
||||
SV (22), SV (23), SV (24), SV (25), SV (26), SV (27), SV (28), SV (29),
|
||||
SV (30), SV (31)
|
||||
/* VMX registers v20-v31 and vrsave are non-volatile but they are
|
||||
assigned DWARF registers 1144-1156 (v20-v31) which is outside of the
|
||||
CFI supported range. */
|
||||
#undef SV
|
||||
};
|
||||
|
||||
abi_info->initial_instructions = abi_cfi;
|
||||
abi_info->initial_instructions_end = &abi_cfi[sizeof abi_cfi];
|
||||
abi_info->data_alignment_factor = ebl->class == ELFCLASS64 ? 8 : 4;
|
||||
|
||||
abi_info->return_address_register = 65;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__typeof (ppc_abi_cfi)
|
||||
ppc64_abi_cfi
|
||||
__attribute__ ((alias ("ppc_abi_cfi")));
|
@ -1,145 +0,0 @@
|
||||
/* PowerPC specific core note handling.
|
||||
Copyright (C) 2007, 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <elf.h>
|
||||
#include <inttypes.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#ifndef BITS
|
||||
# define BITS 32
|
||||
# define BACKEND ppc_
|
||||
#else
|
||||
# define BITS 64
|
||||
# define BACKEND ppc64_
|
||||
#endif
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
static const Ebl_Register_Location prstatus_regs[] =
|
||||
{
|
||||
#define GR(at, n, dwreg) \
|
||||
{ .offset = at * BITS/8, .regno = dwreg, .count = n, .bits = BITS }
|
||||
|
||||
GR (0, 32, 0), /* r0-r31 */
|
||||
/* 32, 1, nip */
|
||||
GR (33, 1, 66), /* msr */
|
||||
/* 34, 1, orig_gpr3 */
|
||||
GR (35, 1, 109), /* ctr */
|
||||
GR (36, 1, 108), /* lr */
|
||||
GR (37, 1, 101), /* xer */
|
||||
GR (38, 1, 64), /* cr */
|
||||
GR (39, 1, 100), /* mq */
|
||||
/* 40, 1, trap */
|
||||
GR (41, 1, 119), /* dar */
|
||||
GR (42, 1, 118), /* dsisr */
|
||||
|
||||
#undef GR
|
||||
};
|
||||
#define PRSTATUS_REGS_SIZE (BITS / 8 * 48)
|
||||
|
||||
static const Ebl_Register_Location fpregset_regs[] =
|
||||
{
|
||||
{ .offset = 0, .regno = 32, .count = 32, .bits = 64 }, /* f0-f31 */
|
||||
{ .offset = 32 * 8 + 4, .regno = 65, .count = 1, .bits = 32 } /* fpscr */
|
||||
};
|
||||
#define FPREGSET_SIZE (33 * 8)
|
||||
|
||||
static const Ebl_Register_Location altivec_regs[] =
|
||||
{
|
||||
/* vr0-vr31 */
|
||||
{ .offset = 0, .regno = 1124, .count = 32, .bits = 128 },
|
||||
/* vscr XXX 67 is an unofficial assignment */
|
||||
{ .offset = 32 * 16, .regno = 67, .count = 1, .bits = 32, .pad = 12 },
|
||||
/* vrsave */
|
||||
{ .offset = 33 * 16, .regno = 356, .count = 1, .bits = 32, .pad = 12 }
|
||||
};
|
||||
|
||||
static const Ebl_Register_Location spe_regs[] =
|
||||
{
|
||||
/* evr0-evr31
|
||||
{ .offset = 0, .regno = ???, .count = 32, .bits = 32 },
|
||||
* acc *
|
||||
{ .offset = 32 * 4, .regno = ???, .count = 1, .bits = 64 }, */
|
||||
/* spefscr */
|
||||
{ .offset = 34 * 4, .regno = 612, .count = 1, .bits = 32 }
|
||||
};
|
||||
|
||||
static const Ebl_Register_Location tm_spr_regs[] =
|
||||
{
|
||||
/* tfhar */
|
||||
{ .offset = 0, .regno = 114, .count = 1, .bits = 64 },
|
||||
/* texasr */
|
||||
{ .offset = 8, .regno = 116, .count = 1, .bits = 64 },
|
||||
/* tfiar */
|
||||
{ .offset = 16, .regno = 115, .count = 1, .bits = 64 }
|
||||
};
|
||||
|
||||
#define EXTRA_NOTES \
|
||||
EXTRA_REGSET (NT_PPC_VMX, 34 * 16, altivec_regs) \
|
||||
EXTRA_REGSET (NT_PPC_SPE, 35 * 4, spe_regs) \
|
||||
EXTRA_REGSET (NT_PPC_TM_SPR, 3 * 8, tm_spr_regs)
|
||||
|
||||
#if BITS == 32
|
||||
# define ULONG uint32_t
|
||||
# define ALIGN_ULONG 4
|
||||
# define TYPE_ULONG ELF_T_WORD
|
||||
# define TYPE_LONG ELF_T_SWORD
|
||||
#else
|
||||
# define ULONG uint64_t
|
||||
# define ALIGN_ULONG 8
|
||||
# define TYPE_ULONG ELF_T_XWORD
|
||||
# define TYPE_LONG ELF_T_SXWORD
|
||||
#endif
|
||||
#define PID_T int32_t
|
||||
#define UID_T uint32_t
|
||||
#define GID_T uint32_t
|
||||
#define ALIGN_PID_T 4
|
||||
#define ALIGN_UID_T 4
|
||||
#define ALIGN_GID_T 4
|
||||
#define TYPE_PID_T ELF_T_SWORD
|
||||
#define TYPE_UID_T ELF_T_WORD
|
||||
#define TYPE_GID_T ELF_T_WORD
|
||||
|
||||
#define PRSTATUS_REGSET_ITEMS \
|
||||
{ \
|
||||
.name = "nip", .type = ELF_T_ADDR, .format = 'x', \
|
||||
.offset = offsetof (struct EBLHOOK(prstatus), pr_reg[32]), \
|
||||
.group = "register", .pc_register = true \
|
||||
}, \
|
||||
{ \
|
||||
.name = "orig_gpr3", .type = TYPE_LONG, .format = 'd', \
|
||||
.offset = offsetof (struct EBLHOOK(prstatus), pr_reg[34]), \
|
||||
.group = "register" \
|
||||
}
|
||||
|
||||
#include "linux-core-note.c"
|
@ -1,74 +0,0 @@
|
||||
/* Initialization of PPC specific backend library.
|
||||
Copyright (C) 2004, 2005, 2006, 2007, 2008, 2013 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
Written by Ulrich Drepper <drepper@redhat.com>, 2004.
|
||||
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND ppc_
|
||||
#define RELOC_PREFIX R_PPC_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
/* This defines the common reloc hooks based on ppc_reloc.def. */
|
||||
#include "common-reloc.c"
|
||||
|
||||
|
||||
const char *
|
||||
ppc_init (Elf *elf __attribute__ ((unused)),
|
||||
GElf_Half machine __attribute__ ((unused)),
|
||||
Ebl *eh,
|
||||
size_t ehlen)
|
||||
{
|
||||
/* Check whether the Elf_BH object has a sufficent size. */
|
||||
if (ehlen < sizeof (Ebl))
|
||||
return NULL;
|
||||
|
||||
/* We handle it. */
|
||||
eh->name = "PowerPC";
|
||||
ppc_init_reloc (eh);
|
||||
HOOK (eh, reloc_simple_type);
|
||||
HOOK (eh, machine_flag_check);
|
||||
HOOK (eh, dynamic_tag_name);
|
||||
HOOK (eh, dynamic_tag_check);
|
||||
HOOK (eh, check_special_symbol);
|
||||
HOOK (eh, bss_plt_p);
|
||||
HOOK (eh, return_value_location);
|
||||
HOOK (eh, register_info);
|
||||
HOOK (eh, syscall_abi);
|
||||
HOOK (eh, core_note);
|
||||
HOOK (eh, auxv_info);
|
||||
HOOK (eh, check_object_attribute);
|
||||
HOOK (eh, abi_cfi);
|
||||
/* gcc/config/ #define DWARF_FRAME_REGISTERS. */
|
||||
eh->frame_nregs = (114 - 1) + 32;
|
||||
HOOK (eh, set_initial_registers_tid);
|
||||
HOOK (eh, dwarf_to_regno);
|
||||
|
||||
return MODVERSION;
|
||||
}
|
@ -1,114 +0,0 @@
|
||||
/* Fetch live process registers from TID.
|
||||
Copyright (C) 2013 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "system.h"
|
||||
#include <stdlib.h>
|
||||
#if defined(__powerpc__) && defined(__linux__)
|
||||
# include <sys/user.h>
|
||||
# include <sys/ptrace.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND ppc_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
bool
|
||||
ppc_dwarf_to_regno (Ebl *ebl __attribute__ ((unused)), unsigned *regno)
|
||||
{
|
||||
switch (*regno)
|
||||
{
|
||||
case 108:
|
||||
// LR uses both 65 and 108 numbers, there is no consistency for it.
|
||||
*regno = 65;
|
||||
return true;
|
||||
case 0 ... 107:
|
||||
case 109 ... (114 - 1) -1:
|
||||
return true;
|
||||
case 1200 ... 1231:
|
||||
*regno = *regno - 1200 + (114 - 1);
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
abort ();
|
||||
}
|
||||
|
||||
__typeof (ppc_dwarf_to_regno)
|
||||
ppc64_dwarf_to_regno
|
||||
__attribute__ ((alias ("ppc_dwarf_to_regno")));
|
||||
|
||||
bool
|
||||
ppc_set_initial_registers_tid (pid_t tid __attribute__ ((unused)),
|
||||
ebl_tid_registers_t *setfunc __attribute__ ((unused)),
|
||||
void *arg __attribute__ ((unused)))
|
||||
{
|
||||
#if !defined(__powerpc__) || !defined(__linux__)
|
||||
return false;
|
||||
#else /* __powerpc__ */
|
||||
union
|
||||
{
|
||||
struct pt_regs r;
|
||||
long l[sizeof (struct pt_regs) / sizeof (long)];
|
||||
}
|
||||
user_regs;
|
||||
eu_static_assert (sizeof (struct pt_regs) % sizeof (long) == 0);
|
||||
/* PTRACE_GETREGS is EIO on kernel-2.6.18-308.el5.ppc64. */
|
||||
errno = 0;
|
||||
for (unsigned regno = 0; regno < sizeof (user_regs) / sizeof (long);
|
||||
regno++)
|
||||
{
|
||||
user_regs.l[regno] = ptrace (PTRACE_PEEKUSER, tid,
|
||||
(void *) (uintptr_t) (regno
|
||||
* sizeof (long)),
|
||||
NULL);
|
||||
if (errno != 0)
|
||||
return false;
|
||||
}
|
||||
const size_t gprs = sizeof (user_regs.r.gpr) / sizeof (*user_regs.r.gpr);
|
||||
Dwarf_Word dwarf_regs[gprs];
|
||||
for (unsigned gpr = 0; gpr < gprs; gpr++)
|
||||
dwarf_regs[gpr] = user_regs.r.gpr[gpr];
|
||||
if (! setfunc (0, gprs, dwarf_regs, arg))
|
||||
return false;
|
||||
dwarf_regs[0] = user_regs.r.link;
|
||||
// LR uses both 65 and 108 numbers, there is no consistency for it.
|
||||
if (! setfunc (65, 1, dwarf_regs, arg))
|
||||
return false;
|
||||
/* Registers like msr, ctr, xer, dar, dsisr etc. are probably irrelevant
|
||||
for CFI. */
|
||||
dwarf_regs[0] = user_regs.r.nip;
|
||||
return setfunc (-1, 1, dwarf_regs, arg);
|
||||
#endif /* __powerpc__ */
|
||||
}
|
||||
|
||||
__typeof (ppc_set_initial_registers_tid)
|
||||
ppc64_set_initial_registers_tid
|
||||
__attribute__ ((alias ("ppc_set_initial_registers_tid")));
|
@ -1,208 +0,0 @@
|
||||
/* Register names and numbers for PowerPC DWARF.
|
||||
Copyright (C) 2005, 2006, 2007 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND ppc_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
ssize_t
|
||||
ppc_register_info (Ebl *ebl __attribute__ ((unused)),
|
||||
int regno, char *name, size_t namelen,
|
||||
const char **prefix, const char **setname,
|
||||
int *bits, int *type)
|
||||
{
|
||||
if (name == NULL)
|
||||
return 1156;
|
||||
|
||||
if (regno < 0 || regno > 1155 || namelen < 8)
|
||||
return -1;
|
||||
|
||||
*prefix = "";
|
||||
*bits = ebl->machine == EM_PPC64 ? 64 : 32;
|
||||
*type = (regno < 32 ? DW_ATE_signed
|
||||
: regno < 64 ? DW_ATE_float : DW_ATE_unsigned);
|
||||
|
||||
if (regno < 32 || regno == 64 || regno == 66)
|
||||
*setname = "integer";
|
||||
else if (regno < 64 || regno == 65)
|
||||
{
|
||||
*setname = "FPU";
|
||||
if (ebl->machine != EM_PPC64 && regno < 64)
|
||||
*bits = 64;
|
||||
}
|
||||
else if (regno == 67 || regno == 356 || regno == 612 || regno >= 1124)
|
||||
{
|
||||
*setname = "vector";
|
||||
*bits = regno >= 1124 ? 128 : 32;
|
||||
}
|
||||
else
|
||||
*setname = "privileged";
|
||||
|
||||
switch (regno)
|
||||
{
|
||||
case 0 ... 9:
|
||||
name[0] = 'r';
|
||||
name[1] = regno + '0';
|
||||
namelen = 2;
|
||||
break;
|
||||
|
||||
case 10 ... 31:
|
||||
name[0] = 'r';
|
||||
name[1] = regno / 10 + '0';
|
||||
name[2] = regno % 10 + '0';
|
||||
namelen = 3;
|
||||
break;
|
||||
|
||||
case 32 + 0 ... 32 + 9:
|
||||
name[0] = 'f';
|
||||
name[1] = (regno - 32) + '0';
|
||||
namelen = 2;
|
||||
break;
|
||||
|
||||
case 32 + 10 ... 32 + 31:
|
||||
name[0] = 'f';
|
||||
name[1] = (regno - 32) / 10 + '0';
|
||||
name[2] = (regno - 32) % 10 + '0';
|
||||
namelen = 3;
|
||||
break;
|
||||
|
||||
case 64:
|
||||
return stpcpy (name, "cr") + 1 - name;
|
||||
case 65:
|
||||
return stpcpy (name, "fpscr") + 1 - name;
|
||||
case 66:
|
||||
return stpcpy (name, "msr") + 1 - name;
|
||||
case 67: /* XXX unofficial assignment */
|
||||
return stpcpy (name, "vscr") + 1 - name;
|
||||
|
||||
case 70 + 0 ... 70 + 9:
|
||||
name[0] = 's';
|
||||
name[1] = 'r';
|
||||
name[2] = (regno - 70) + '0';
|
||||
namelen = 3;
|
||||
break;
|
||||
|
||||
case 70 + 10 ... 70 + 15:
|
||||
name[0] = 's';
|
||||
name[1] = 'r';
|
||||
name[2] = (regno - 70) / 10 + '0';
|
||||
name[3] = (regno - 70) % 10 + '0';
|
||||
namelen = 4;
|
||||
break;
|
||||
|
||||
case 101:
|
||||
return stpcpy (name, "xer") + 1 - name;
|
||||
case 108:
|
||||
return stpcpy (name, "lr") + 1 - name;
|
||||
case 109:
|
||||
return stpcpy (name, "ctr") + 1 - name;
|
||||
case 118:
|
||||
return stpcpy (name, "dsisr") + 1 - name;
|
||||
case 119:
|
||||
return stpcpy (name, "dar") + 1 - name;
|
||||
case 122:
|
||||
return stpcpy (name, "dec") + 1 - name;
|
||||
case 356:
|
||||
return stpcpy (name, "vrsave") + 1 - name;
|
||||
case 612:
|
||||
return stpcpy (name, "spefscr") + 1 - name;
|
||||
case 100:
|
||||
if (*bits == 32)
|
||||
return stpcpy (name, "mq") + 1 - name;
|
||||
/* Fallthrough */
|
||||
case 102 ... 107:
|
||||
name[0] = 's';
|
||||
name[1] = 'p';
|
||||
name[2] = 'r';
|
||||
name[3] = (regno - 100) + '0';
|
||||
namelen = 4;
|
||||
break;
|
||||
|
||||
case 114:
|
||||
return stpcpy (name, "tfhar") + 1 - name;
|
||||
case 115:
|
||||
return stpcpy (name, "tfiar") + 1 - name;
|
||||
case 116:
|
||||
return stpcpy (name, "texasr") + 1 - name;
|
||||
|
||||
case 110 ... 113:
|
||||
case 117:
|
||||
case 120 ... 121:
|
||||
case 123 ... 199:
|
||||
name[0] = 's';
|
||||
name[1] = 'p';
|
||||
name[2] = 'r';
|
||||
name[3] = (regno - 100) / 10 + '0';
|
||||
name[4] = (regno - 100) % 10 + '0';
|
||||
namelen = 5;
|
||||
break;
|
||||
|
||||
case 200 ... 355:
|
||||
case 357 ... 611:
|
||||
case 613 ... 999:
|
||||
name[0] = 's';
|
||||
name[1] = 'p';
|
||||
name[2] = 'r';
|
||||
name[3] = (regno - 100) / 100 + '0';
|
||||
name[4] = ((regno - 100) % 100 / 10) + '0';
|
||||
name[5] = (regno - 100) % 10 + '0';
|
||||
namelen = 6;
|
||||
break;
|
||||
|
||||
case 1124 + 0 ... 1124 + 9:
|
||||
name[0] = 'v';
|
||||
name[1] = 'r';
|
||||
name[2] = (regno - 1124) + '0';
|
||||
namelen = 3;
|
||||
break;
|
||||
|
||||
case 1124 + 10 ... 1124 + 31:
|
||||
name[0] = 'v';
|
||||
name[1] = 'r';
|
||||
name[2] = (regno - 1124) / 10 + '0';
|
||||
name[3] = (regno - 1124) % 10 + '0';
|
||||
namelen = 4;
|
||||
break;
|
||||
|
||||
default:
|
||||
*setname = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
name[namelen++] = '\0';
|
||||
return namelen;
|
||||
}
|
||||
|
||||
__typeof (ppc_register_info)
|
||||
ppc64_register_info __attribute__ ((alias ("ppc_register_info")));
|
@ -1,137 +0,0 @@
|
||||
/* List the relocation types for ppc. -*- C -*-
|
||||
Copyright (C) 2005, 2015 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/>. */
|
||||
|
||||
/* NAME, REL|EXEC|DYN */
|
||||
|
||||
RELOC_TYPE (NONE, 0)
|
||||
RELOC_TYPE (ADDR32, REL|EXEC|DYN)
|
||||
RELOC_TYPE (ADDR24, REL)
|
||||
RELOC_TYPE (ADDR16, REL|EXEC|DYN) /* note 1 */
|
||||
RELOC_TYPE (ADDR16_LO, REL|EXEC|DYN) /* note 1 */
|
||||
RELOC_TYPE (ADDR16_HI, REL|EXEC|DYN) /* note 1 */
|
||||
RELOC_TYPE (ADDR16_HA, REL|EXEC|DYN) /* note 1 */
|
||||
RELOC_TYPE (ADDR14, REL|EXEC|DYN) /* note 1 */
|
||||
RELOC_TYPE (ADDR14_BRTAKEN, REL|EXEC|DYN) /* note 1 */
|
||||
RELOC_TYPE (ADDR14_BRNTAKEN, REL|EXEC|DYN) /* note 1 */
|
||||
RELOC_TYPE (REL24, REL|EXEC|DYN) /* note 1 */
|
||||
RELOC_TYPE (REL14, REL|EXEC|DYN) /* note 1 */
|
||||
RELOC_TYPE (REL14_BRTAKEN, REL|EXEC|DYN) /* note 1 */
|
||||
RELOC_TYPE (REL14_BRNTAKEN, REL|EXEC|DYN) /* note 1 */
|
||||
RELOC_TYPE (GOT16, REL)
|
||||
RELOC_TYPE (GOT16_LO, REL)
|
||||
RELOC_TYPE (GOT16_HI, REL)
|
||||
RELOC_TYPE (GOT16_HA, REL)
|
||||
RELOC_TYPE (PLTREL24, REL)
|
||||
RELOC_TYPE (COPY, EXEC|DYN)
|
||||
RELOC_TYPE (GLOB_DAT, EXEC|DYN)
|
||||
RELOC_TYPE (JMP_SLOT, EXEC|DYN)
|
||||
RELOC_TYPE (RELATIVE, EXEC|DYN)
|
||||
RELOC_TYPE (LOCAL24PC, REL)
|
||||
RELOC_TYPE (UADDR32, REL|EXEC|DYN)
|
||||
RELOC_TYPE (UADDR16, REL) /* note 2 */
|
||||
RELOC_TYPE (REL32, REL|EXEC|DYN)
|
||||
RELOC_TYPE (PLT32, REL)
|
||||
RELOC_TYPE (PLTREL32, REL)
|
||||
RELOC_TYPE (PLT16_LO, REL)
|
||||
RELOC_TYPE (PLT16_HI, REL)
|
||||
RELOC_TYPE (PLT16_HA, REL)
|
||||
RELOC_TYPE (SDAREL16, REL)
|
||||
RELOC_TYPE (SECTOFF, REL)
|
||||
RELOC_TYPE (SECTOFF_LO, REL)
|
||||
RELOC_TYPE (SECTOFF_HI, REL)
|
||||
RELOC_TYPE (SECTOFF_HA, REL)
|
||||
RELOC_TYPE (TLS, REL)
|
||||
RELOC_TYPE (DTPMOD32, EXEC|DYN) /* note 2 */
|
||||
RELOC_TYPE (TPREL16, REL) /* note 2 */
|
||||
RELOC_TYPE (TPREL16_LO, REL) /* note 2 */
|
||||
RELOC_TYPE (TPREL16_HI, REL) /* note 2 */
|
||||
RELOC_TYPE (TPREL16_HA, REL) /* note 2 */
|
||||
RELOC_TYPE (TPREL32, EXEC|DYN) /* note 2 */
|
||||
RELOC_TYPE (DTPREL16, REL)
|
||||
RELOC_TYPE (DTPREL16_LO, REL)
|
||||
RELOC_TYPE (DTPREL16_HI, REL)
|
||||
RELOC_TYPE (DTPREL16_HA, REL)
|
||||
RELOC_TYPE (DTPREL32, EXEC|DYN) /* note 2 */
|
||||
RELOC_TYPE (GOT_TLSGD16, REL)
|
||||
RELOC_TYPE (GOT_TLSGD16_LO, REL)
|
||||
RELOC_TYPE (GOT_TLSGD16_HI, REL)
|
||||
RELOC_TYPE (GOT_TLSGD16_HA, REL)
|
||||
RELOC_TYPE (GOT_TLSLD16, REL)
|
||||
RELOC_TYPE (GOT_TLSLD16_LO, REL)
|
||||
RELOC_TYPE (GOT_TLSLD16_HI, REL)
|
||||
RELOC_TYPE (GOT_TLSLD16_HA, REL)
|
||||
RELOC_TYPE (GOT_TPREL16, REL)
|
||||
RELOC_TYPE (GOT_TPREL16_LO, REL)
|
||||
RELOC_TYPE (GOT_TPREL16_HI, REL)
|
||||
RELOC_TYPE (GOT_TPREL16_HA, REL)
|
||||
RELOC_TYPE (GOT_DTPREL16, REL)
|
||||
RELOC_TYPE (GOT_DTPREL16_LO, REL)
|
||||
RELOC_TYPE (GOT_DTPREL16_HI, REL)
|
||||
RELOC_TYPE (GOT_DTPREL16_HA, REL)
|
||||
RELOC_TYPE (EMB_NADDR32, REL) /* note 3 */
|
||||
RELOC_TYPE (EMB_NADDR16, REL) /* note 3 */
|
||||
RELOC_TYPE (EMB_NADDR16_LO, REL) /* note 3 */
|
||||
RELOC_TYPE (EMB_NADDR16_HI, REL) /* note 3 */
|
||||
RELOC_TYPE (EMB_NADDR16_HA, REL) /* note 3 */
|
||||
RELOC_TYPE (EMB_SDAI16, REL) /* note 3 */
|
||||
RELOC_TYPE (EMB_SDA2I16, REL) /* note 3 */
|
||||
RELOC_TYPE (EMB_SDA2REL, REL) /* note 3 */
|
||||
RELOC_TYPE (EMB_SDA21, REL) /* note 3 */
|
||||
RELOC_TYPE (EMB_MRKREF, REL) /* note 3 */
|
||||
RELOC_TYPE (EMB_RELSEC16, REL) /* note 3 */
|
||||
RELOC_TYPE (EMB_RELST_LO, REL) /* note 3 */
|
||||
RELOC_TYPE (EMB_RELST_HI, REL) /* note 3 */
|
||||
RELOC_TYPE (EMB_RELST_HA, REL) /* note 3 */
|
||||
RELOC_TYPE (EMB_BIT_FLD, REL) /* note 3 */
|
||||
RELOC_TYPE (EMB_RELSDA, REL) /* note 3 */
|
||||
RELOC_TYPE (DIAB_SDA21_LO, REL) /* note 3 */
|
||||
RELOC_TYPE (DIAB_SDA21_HI, REL) /* note 3 */
|
||||
RELOC_TYPE (DIAB_SDA21_HA, REL) /* note 3 */
|
||||
RELOC_TYPE (DIAB_RELSDA_LO, REL) /* note 3 */
|
||||
RELOC_TYPE (DIAB_RELSDA_HI, REL) /* note 3 */
|
||||
RELOC_TYPE (DIAB_RELSDA_HA, REL) /* note 3 */
|
||||
RELOC_TYPE (REL16, REL) /* note 2 */
|
||||
RELOC_TYPE (REL16_LO, REL) /* note 2 */
|
||||
RELOC_TYPE (REL16_HI, REL) /* note 2 */
|
||||
RELOC_TYPE (REL16_HA, REL) /* note 2 */
|
||||
RELOC_TYPE (TOC16, REL) /* note 2 */
|
||||
|
||||
/* Notes from Alan Modra:
|
||||
|
||||
1) These relocs should not really appear in EXEC or DYN, but they do,
|
||||
primarily due to improper assembly or non-pic shared objects. They
|
||||
will cause TEXTREL to be set. I marked them in the table, because
|
||||
numerous people seem to think non-pic shared libs are a good idea.
|
||||
|
||||
2) As for (1), these relocs can appear anywhere with improper
|
||||
assembler. I should probably make ld reject anything other than the
|
||||
cases allowed in this table. Not seen in the wild, so I haven't
|
||||
added the other cases.
|
||||
|
||||
3) Not used in SYSV4
|
||||
*/
|
@ -1,191 +0,0 @@
|
||||
/* Function return value location for Linux/PPC ABI.
|
||||
Copyright (C) 2005, 2006, 2007, 2010, 2014 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND ppc_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
/* This is the SVR4 ELF ABI convention, but AIX and Linux do not use it. */
|
||||
#define SVR4_STRUCT_RETURN 0
|
||||
|
||||
|
||||
/* r3, or pair r3, r4, or quad r3-r6. */
|
||||
static const Dwarf_Op loc_intreg[] =
|
||||
{
|
||||
{ .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
{ .atom = DW_OP_reg4 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
{ .atom = DW_OP_reg5 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
{ .atom = DW_OP_reg6 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
};
|
||||
#define nloc_intreg 1
|
||||
#define nloc_intregpair 4
|
||||
#define nloc_intregquad 8
|
||||
|
||||
/* f1. */
|
||||
static const Dwarf_Op loc_fpreg[] =
|
||||
{
|
||||
{ .atom = DW_OP_regx, .number = 33 }
|
||||
};
|
||||
#define nloc_fpreg 1
|
||||
|
||||
/* vr2. */
|
||||
static const Dwarf_Op loc_vmxreg[] =
|
||||
{
|
||||
{ .atom = DW_OP_regx, .number = 1124 + 2 }
|
||||
};
|
||||
#define nloc_vmxreg 1
|
||||
|
||||
/* The return value is a structure and is actually stored in stack space
|
||||
passed in a hidden argument by the caller. But, the compiler
|
||||
helpfully returns the address of that space in r3. */
|
||||
static const Dwarf_Op loc_aggregate[] =
|
||||
{
|
||||
{ .atom = DW_OP_breg3, .number = 0 }
|
||||
};
|
||||
#define nloc_aggregate 1
|
||||
|
||||
|
||||
/* XXX We should check the SHT_GNU_ATTRIBUTES bits here (or in ppc_init). */
|
||||
static bool
|
||||
ppc_altivec_abi (void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
ppc_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_Die die_mem, *typedie = &die_mem;
|
||||
int tag = dwarf_peeled_die_type (functypedie, typedie);
|
||||
if (tag <= 0)
|
||||
return tag;
|
||||
|
||||
Dwarf_Word size;
|
||||
switch (tag)
|
||||
{
|
||||
case -1:
|
||||
return -1;
|
||||
|
||||
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_OR_RETURN (typedie);
|
||||
}
|
||||
/* Fall through. */
|
||||
|
||||
case DW_TAG_base_type:
|
||||
case DW_TAG_enumeration_type:
|
||||
case DW_TAG_pointer_type:
|
||||
case DW_TAG_ptr_to_member_type:
|
||||
{
|
||||
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 = 4;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (size <= 8)
|
||||
{
|
||||
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),
|
||||
&encoding) != 0)
|
||||
return -1;
|
||||
if (encoding == DW_ATE_float)
|
||||
{
|
||||
*locp = loc_fpreg;
|
||||
return nloc_fpreg;
|
||||
}
|
||||
}
|
||||
intreg:
|
||||
*locp = loc_intreg;
|
||||
return size <= 4 ? nloc_intreg : nloc_intregpair;
|
||||
}
|
||||
|
||||
aggregate:
|
||||
*locp = loc_aggregate;
|
||||
return nloc_aggregate;
|
||||
|
||||
case DW_TAG_array_type:
|
||||
{
|
||||
Dwarf_Attribute attr_mem;
|
||||
bool is_vector;
|
||||
if (dwarf_formflag (dwarf_attr_integrate (typedie, DW_AT_GNU_vector,
|
||||
&attr_mem), &is_vector) == 0
|
||||
&& is_vector
|
||||
&& dwarf_aggregate_size (typedie, &size) == 0)
|
||||
switch (size)
|
||||
{
|
||||
case 16:
|
||||
if (ppc_altivec_abi ())
|
||||
{
|
||||
*locp = loc_vmxreg;
|
||||
return nloc_vmxreg;
|
||||
}
|
||||
*locp = loc_intreg;
|
||||
return nloc_intregquad;
|
||||
}
|
||||
}
|
||||
/* Fall through. */
|
||||
|
||||
case DW_TAG_structure_type:
|
||||
case DW_TAG_class_type:
|
||||
case DW_TAG_union_type:
|
||||
if (SVR4_STRUCT_RETURN
|
||||
&& dwarf_aggregate_size (typedie, &size) == 0
|
||||
&& size > 0 && size <= 8)
|
||||
goto intreg;
|
||||
goto aggregate;
|
||||
}
|
||||
|
||||
/* XXX We don't have a good way to return specific errors from ebl calls.
|
||||
This value means we do not understand the type, but it is well-formed
|
||||
DWARF and might be valid. */
|
||||
return -2;
|
||||
}
|
@ -1,184 +0,0 @@
|
||||
/* PPC specific symbolic name handling.
|
||||
Copyright (C) 2004, 2005, 2007, 2014, 2015 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
Written by Ulrich Drepper <drepper@redhat.com>, 2004.
|
||||
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <elf.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#define BACKEND ppc_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
/* Check for the simple reloc types. */
|
||||
Elf_Type
|
||||
ppc_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case R_PPC_ADDR32:
|
||||
case R_PPC_UADDR32:
|
||||
return ELF_T_WORD;
|
||||
case R_PPC_UADDR16:
|
||||
return ELF_T_HALF;
|
||||
default:
|
||||
return ELF_T_NUM;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Check whether machine flags are valid. */
|
||||
bool
|
||||
ppc_machine_flag_check (GElf_Word flags)
|
||||
{
|
||||
return ((flags &~ (EF_PPC_EMB
|
||||
| EF_PPC_RELOCATABLE
|
||||
| EF_PPC_RELOCATABLE_LIB)) == 0);
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
ppc_dynamic_tag_name (int64_t tag, char *buf __attribute__ ((unused)),
|
||||
size_t len __attribute__ ((unused)))
|
||||
{
|
||||
switch (tag)
|
||||
{
|
||||
case DT_PPC_GOT:
|
||||
return "PPC_GOT";
|
||||
case DT_PPC_OPT:
|
||||
return "PPC_OPT";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
ppc_dynamic_tag_check (int64_t tag)
|
||||
{
|
||||
return (tag == DT_PPC_GOT
|
||||
|| tag == DT_PPC_OPT);
|
||||
}
|
||||
|
||||
|
||||
/* Look for DT_PPC_GOT. */
|
||||
static bool
|
||||
find_dyn_got (Elf *elf, GElf_Addr *addr)
|
||||
{
|
||||
size_t phnum;
|
||||
if (elf_getphdrnum (elf, &phnum) != 0)
|
||||
return false;
|
||||
|
||||
for (size_t i = 0; i < phnum; ++i)
|
||||
{
|
||||
GElf_Phdr phdr_mem;
|
||||
GElf_Phdr *phdr = gelf_getphdr (elf, i, &phdr_mem);
|
||||
if (phdr == NULL || phdr->p_type != PT_DYNAMIC)
|
||||
continue;
|
||||
|
||||
Elf_Scn *scn = gelf_offscn (elf, phdr->p_offset);
|
||||
GElf_Shdr shdr_mem;
|
||||
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
|
||||
Elf_Data *data = elf_getdata (scn, NULL);
|
||||
if (shdr != NULL && shdr->sh_type == SHT_DYNAMIC && data != NULL
|
||||
&& shdr->sh_entsize != 0)
|
||||
for (unsigned int j = 0; j < shdr->sh_size / shdr->sh_entsize; ++j)
|
||||
{
|
||||
GElf_Dyn dyn_mem;
|
||||
GElf_Dyn *dyn = gelf_getdyn (data, j, &dyn_mem);
|
||||
if (dyn != NULL && dyn->d_tag == DT_PPC_GOT)
|
||||
{
|
||||
*addr = dyn->d_un.d_ptr;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* There is only one PT_DYNAMIC entry. */
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/* Check whether given symbol's st_value and st_size are OK despite failing
|
||||
normal checks. */
|
||||
bool
|
||||
ppc_check_special_symbol (Elf *elf, GElf_Ehdr *ehdr, const GElf_Sym *sym,
|
||||
const char *name, const GElf_Shdr *destshdr)
|
||||
{
|
||||
if (name == NULL)
|
||||
return false;
|
||||
|
||||
if (strcmp (name, "_GLOBAL_OFFSET_TABLE_") == 0)
|
||||
{
|
||||
/* In -msecure-plt mode, DT_PPC_GOT is present and must match. */
|
||||
GElf_Addr gotaddr;
|
||||
if (find_dyn_got (elf, &gotaddr))
|
||||
return sym->st_value == gotaddr;
|
||||
|
||||
/* In -mbss-plt mode, any place in the section is valid. */
|
||||
return true;
|
||||
}
|
||||
|
||||
const char *sname = elf_strptr (elf, ehdr->e_shstrndx, destshdr->sh_name);
|
||||
if (sname == NULL)
|
||||
return false;
|
||||
|
||||
/* Small data area. Normally points to .sdata, in which case we
|
||||
check it is at an offset of 0x8000. It might however fall in the
|
||||
.data section, in which case we cannot check the offset. The
|
||||
size always should be zero. */
|
||||
if (strcmp (name, "_SDA_BASE_") == 0)
|
||||
return (((strcmp (sname, ".sdata") == 0
|
||||
&& sym->st_value == destshdr->sh_addr + 0x8000)
|
||||
|| strcmp (sname, ".data") == 0)
|
||||
&& sym->st_size == 0);
|
||||
|
||||
if (strcmp (name, "_SDA2_BASE_") == 0)
|
||||
return (strcmp (sname, ".sdata2") == 0
|
||||
&& sym->st_value == destshdr->sh_addr + 0x8000
|
||||
&& sym->st_size == 0);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/* Check if backend uses a bss PLT in this file. */
|
||||
bool
|
||||
ppc_bss_plt_p (Elf *elf)
|
||||
{
|
||||
GElf_Addr addr;
|
||||
return ! find_dyn_got (elf, &addr);
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
/* Linux/PPC system call ABI in DWARF register numbers.
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND ppc_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
int
|
||||
ppc_syscall_abi (Ebl *ebl __attribute__ ((unused)),
|
||||
int *sp, int *pc, int *callno, int args[6])
|
||||
{
|
||||
*sp = 1;
|
||||
*pc = -1;
|
||||
*callno = 0;
|
||||
args[0] = 3;
|
||||
args[1] = 4;
|
||||
args[2] = 5;
|
||||
args[3] = 6;
|
||||
args[4] = 7;
|
||||
args[5] = 8;
|
||||
return 0;
|
||||
}
|
||||
|
||||
__typeof (ppc_syscall_abi)
|
||||
ppc64_syscall_abi __attribute__ ((alias ("ppc_syscall_abi")));
|
@ -1,65 +0,0 @@
|
||||
/* s390 ABI-specified defaults for DWARF CFI.
|
||||
Copyright (C) 2012, 2013 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND s390_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
int
|
||||
s390_abi_cfi (Ebl *ebl, Dwarf_CIE *abi_info)
|
||||
{
|
||||
static const uint8_t abi_cfi[] =
|
||||
{
|
||||
/* This instruction is provided in every CIE. It is not repeated here:
|
||||
DW_CFA_def_cfa, ULEB128_7 (15), ULEB128_7 (96) */
|
||||
/* r14 is not callee-saved but it needs to be preserved as it is pre-set
|
||||
by the caller. */
|
||||
DW_CFA_same_value, ULEB128_7 (14), /* r14 */
|
||||
|
||||
/* Callee-saved regs. */
|
||||
#define SV(n) DW_CFA_same_value, ULEB128_7 (n)
|
||||
SV (6), SV (7), SV (8), SV (9), SV (10), /* r6-r13, r15 */
|
||||
SV (11), SV (12), SV (13), SV (15),
|
||||
SV (16 + 8), SV (16 + 9), SV (16 + 10), SV (16 + 11), /* f8-f15 */
|
||||
SV (16 + 12), SV (16 + 13), SV (16 + 14), SV (16 + 15)
|
||||
#undef SV
|
||||
};
|
||||
|
||||
abi_info->initial_instructions = abi_cfi;
|
||||
abi_info->initial_instructions_end = &abi_cfi[sizeof abi_cfi];
|
||||
abi_info->data_alignment_factor = ebl->class == ELFCLASS64 ? 8 : 4;
|
||||
|
||||
abi_info->return_address_register = 14;
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,189 +0,0 @@
|
||||
/* S390-specific core note handling.
|
||||
Copyright (C) 2012 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <elf.h>
|
||||
#include <inttypes.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#ifndef BITS
|
||||
# define BITS 32
|
||||
# define BACKEND s390_
|
||||
#else
|
||||
# define BITS 64
|
||||
# define BACKEND s390x_
|
||||
#endif
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
static const Ebl_Register_Location prstatus_regs[] =
|
||||
{
|
||||
#define GR(at, n, dwreg, b...) \
|
||||
{ .offset = at * BITS/8, .regno = dwreg, .count = n, .bits = b }
|
||||
|
||||
GR ( 0, 1, 64, BITS), /* pswm */
|
||||
GR ( 1, 1, 65, BITS, .pc_register = true ), /* pswa */
|
||||
GR ( 2, 16, 0, BITS), /* r0-r15 */
|
||||
GR (18, 16, 48, 32), /* ar0-ar15 */
|
||||
|
||||
#undef GR
|
||||
};
|
||||
|
||||
/* orig_r2 is at offset (BITS == 32 ? 34 * 4 : 26 * 8). */
|
||||
#define PRSTATUS_REGS_SIZE (BITS / 8 * (BITS == 32 ? 35 : 27))
|
||||
|
||||
static const Ebl_Register_Location fpregset_regs[] =
|
||||
{
|
||||
#define FPR(at, n, dwreg) \
|
||||
{ .offset = at * 64/8, .regno = dwreg, .count = n, .bits = 64 }
|
||||
|
||||
/* fpc is at offset 0, see fpregset_items, it has no assigned DWARF regno.
|
||||
Bytes at offsets 4 to 7 are unused. */
|
||||
FPR (1 + 0, 1, 16), /* f0 */
|
||||
FPR (1 + 1, 1, 20), /* f1 */
|
||||
FPR (1 + 2, 1, 17), /* f2 */
|
||||
FPR (1 + 3, 1, 21), /* f3 */
|
||||
FPR (1 + 4, 1, 18), /* f4 */
|
||||
FPR (1 + 5, 1, 22), /* f5 */
|
||||
FPR (1 + 6, 1, 19), /* f6 */
|
||||
FPR (1 + 7, 1, 23), /* f7 */
|
||||
FPR (1 + 8, 1, 24), /* f8 */
|
||||
FPR (1 + 9, 1, 28), /* f9 */
|
||||
FPR (1 + 10, 1, 25), /* f10 */
|
||||
FPR (1 + 11, 1, 29), /* f11 */
|
||||
FPR (1 + 12, 1, 26), /* f12 */
|
||||
FPR (1 + 13, 1, 30), /* f13 */
|
||||
FPR (1 + 14, 1, 27), /* f14 */
|
||||
FPR (1 + 15, 1, 31), /* f15 */
|
||||
|
||||
#undef FPR
|
||||
};
|
||||
|
||||
static const Ebl_Core_Item fpregset_items[] =
|
||||
{
|
||||
{
|
||||
.name = "fpc", .group = "register", .offset = 0, .type = ELF_T_WORD,
|
||||
.format = 'x',
|
||||
},
|
||||
};
|
||||
|
||||
/* Do not set FPREGSET_SIZE so that we can supply fpregset_items. */
|
||||
#define EXTRA_NOTES_FPREGSET \
|
||||
EXTRA_REGSET_ITEMS (NT_FPREGSET, 17 * 8, fpregset_regs, fpregset_items)
|
||||
|
||||
#if BITS == 32
|
||||
# define ULONG uint32_t
|
||||
# define ALIGN_ULONG 4
|
||||
# define TYPE_ULONG ELF_T_WORD
|
||||
# define TYPE_LONG ELF_T_SWORD
|
||||
# define UID_T uint16_t
|
||||
# define GID_T uint16_t
|
||||
# define ALIGN_UID_T 2
|
||||
# define ALIGN_GID_T 2
|
||||
# define TYPE_UID_T ELF_T_HALF
|
||||
# define TYPE_GID_T ELF_T_HALF
|
||||
#else
|
||||
# define ULONG uint64_t
|
||||
# define ALIGN_ULONG 8
|
||||
# define TYPE_ULONG ELF_T_XWORD
|
||||
# define TYPE_LONG ELF_T_SXWORD
|
||||
# define UID_T uint32_t
|
||||
# define GID_T uint32_t
|
||||
# define ALIGN_UID_T 4
|
||||
# define ALIGN_GID_T 4
|
||||
# define TYPE_UID_T ELF_T_WORD
|
||||
# define TYPE_GID_T ELF_T_WORD
|
||||
#endif
|
||||
#define PID_T int32_t
|
||||
#define ALIGN_PID_T 4
|
||||
#define TYPE_PID_T ELF_T_SWORD
|
||||
/* s390 psw_compat_t has alignment 8 bytes where it is inherited from. */
|
||||
#define ALIGN_PR_REG 8
|
||||
|
||||
#define PRSTATUS_REGSET_ITEMS \
|
||||
{ \
|
||||
.name = "orig_r2", .type = TYPE_LONG, .format = 'd', \
|
||||
.offset = offsetof (struct EBLHOOK(prstatus), \
|
||||
pr_reg[BITS == 32 ? 34 : 26]), \
|
||||
.group = "register" \
|
||||
}
|
||||
|
||||
#if BITS == 32
|
||||
|
||||
static const Ebl_Core_Item high_regs_items[] =
|
||||
{
|
||||
#define HR(n) \
|
||||
{ \
|
||||
.name = "high_r" #n , .group = "register", .offset = (n) * 4, \
|
||||
.type = ELF_T_WORD, .format = 'x', \
|
||||
}
|
||||
|
||||
/* Upper halves of r0-r15 are stored here.
|
||||
FIXME: They are currently not combined with the r0-r15 lower halves. */
|
||||
HR (0), HR (1), HR (2), HR (3), HR (4), HR (5), HR (6), HR (7),
|
||||
HR (8), HR (9), HR (10), HR (11), HR (12), HR (13), HR (14), HR (15)
|
||||
|
||||
#undef HR
|
||||
};
|
||||
|
||||
#define EXTRA_NOTES_HIGH_GPRS \
|
||||
EXTRA_ITEMS (NT_S390_HIGH_GPRS, 16 * 4, high_regs_items)
|
||||
|
||||
#else /* BITS == 64 */
|
||||
|
||||
#define EXTRA_NOTES_HIGH_GPRS
|
||||
|
||||
#endif /* BITS == 64 */
|
||||
|
||||
static const Ebl_Core_Item last_break_items[] =
|
||||
{
|
||||
{
|
||||
.name = "last_break", .group = "system", .offset = BITS == 32 ? 4 : 0,
|
||||
.type = BITS == 32 ? ELF_T_WORD : ELF_T_XWORD, .format = 'x',
|
||||
},
|
||||
};
|
||||
|
||||
static const Ebl_Core_Item system_call_items[] =
|
||||
{
|
||||
{
|
||||
.name = "system_call", .group = "system", .offset = 0, .type = ELF_T_WORD,
|
||||
.format = 'd',
|
||||
},
|
||||
};
|
||||
|
||||
#define EXTRA_NOTES \
|
||||
EXTRA_NOTES_FPREGSET \
|
||||
EXTRA_NOTES_HIGH_GPRS \
|
||||
EXTRA_ITEMS (NT_S390_LAST_BREAK, 8, last_break_items) \
|
||||
EXTRA_ITEMS (NT_S390_SYSTEM_CALL, 4, system_call_items)
|
||||
|
||||
#include "linux-core-note.c"
|
@ -1,79 +0,0 @@
|
||||
/* Initialization of S/390 specific backend library.
|
||||
Copyright (C) 2005, 2006, 2013 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND s390_
|
||||
#define RELOC_PREFIX R_390_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
/* This defines the common reloc hooks based on arm_reloc.def. */
|
||||
#include "common-reloc.c"
|
||||
|
||||
extern __typeof (s390_core_note) s390x_core_note;
|
||||
|
||||
|
||||
const char *
|
||||
s390_init (Elf *elf __attribute__ ((unused)),
|
||||
GElf_Half machine __attribute__ ((unused)),
|
||||
Ebl *eh,
|
||||
size_t ehlen)
|
||||
{
|
||||
/* Check whether the Elf_BH object has a sufficent size. */
|
||||
if (ehlen < sizeof (Ebl))
|
||||
return NULL;
|
||||
|
||||
/* We handle it. */
|
||||
eh->name = "IBM S/390";
|
||||
s390_init_reloc (eh);
|
||||
HOOK (eh, reloc_simple_type);
|
||||
HOOK (eh, register_info);
|
||||
HOOK (eh, return_value_location);
|
||||
if (eh->class == ELFCLASS64)
|
||||
eh->core_note = s390x_core_note;
|
||||
else
|
||||
HOOK (eh, core_note);
|
||||
HOOK (eh, abi_cfi);
|
||||
/* gcc/config/ #define DWARF_FRAME_REGISTERS 34.
|
||||
But from the gcc/config/s390/s390.h "Register usage." comment it looks as
|
||||
if #32 (Argument pointer) and #33 (Condition code) are not used for
|
||||
unwinding. */
|
||||
eh->frame_nregs = 32;
|
||||
HOOK (eh, set_initial_registers_tid);
|
||||
if (eh->class == ELFCLASS32)
|
||||
HOOK (eh, normalize_pc);
|
||||
HOOK (eh, unwind);
|
||||
|
||||
/* Only the 64-bit format uses the incorrect hash table entry size. */
|
||||
if (eh->class == ELFCLASS64)
|
||||
eh->sysvhash_entrysize = sizeof (Elf64_Xword);
|
||||
|
||||
return MODVERSION;
|
||||
}
|
@ -1,95 +0,0 @@
|
||||
/* Fetch live process registers from TID.
|
||||
Copyright (C) 2013 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "system.h"
|
||||
#include <assert.h>
|
||||
#if defined(__s390__) && defined(__linux__)
|
||||
# include <sys/user.h>
|
||||
# include <sys/ptrace.h>
|
||||
# include <asm/ptrace.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND s390_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
bool
|
||||
s390_set_initial_registers_tid (pid_t tid __attribute__ ((unused)),
|
||||
ebl_tid_registers_t *setfunc __attribute__ ((unused)),
|
||||
void *arg __attribute__ ((unused)))
|
||||
{
|
||||
#if !defined(__s390__) || !defined(__linux__)
|
||||
return false;
|
||||
#else /* __s390__ */
|
||||
struct user user_regs;
|
||||
ptrace_area parea;
|
||||
parea.process_addr = (uintptr_t) &user_regs;
|
||||
parea.kernel_addr = 0;
|
||||
parea.len = sizeof (user_regs);
|
||||
if (ptrace (PTRACE_PEEKUSR_AREA, tid, &parea, NULL) != 0)
|
||||
return false;
|
||||
/* If we run as s390x we get the 64-bit registers of tid.
|
||||
But -m31 executable seems to use only the 32-bit parts of its
|
||||
registers so we ignore the upper half. */
|
||||
Dwarf_Word dwarf_regs[16];
|
||||
for (unsigned u = 0; u < 16; u++)
|
||||
dwarf_regs[u] = user_regs.regs.gprs[u];
|
||||
if (! setfunc (0, 16, dwarf_regs, arg))
|
||||
return false;
|
||||
/* Avoid conversion double -> integer. */
|
||||
eu_static_assert (sizeof user_regs.regs.fp_regs.fprs[0]
|
||||
== sizeof dwarf_regs[0]);
|
||||
for (unsigned u = 0; u < 16; u++)
|
||||
{
|
||||
// Store the double bits as is in the Dwarf_Word without conversion.
|
||||
union
|
||||
{
|
||||
double d;
|
||||
Dwarf_Word w;
|
||||
} fpr = { .d = user_regs.regs.fp_regs.fprs[u] };
|
||||
dwarf_regs[u] = fpr.w;
|
||||
}
|
||||
|
||||
if (! setfunc (16, 16, dwarf_regs, arg))
|
||||
return false;
|
||||
dwarf_regs[0] = user_regs.regs.psw.addr;
|
||||
return setfunc (-1, 1, dwarf_regs, arg);
|
||||
#endif /* __s390__ */
|
||||
}
|
||||
|
||||
void
|
||||
s390_normalize_pc (Ebl *ebl __attribute__ ((unused)), Dwarf_Addr *pc)
|
||||
{
|
||||
assert (ebl->class == ELFCLASS32);
|
||||
|
||||
/* Clear S390 bit 31. */
|
||||
*pc &= (1U << 31) - 1;
|
||||
}
|
@ -1,146 +0,0 @@
|
||||
/* Register names and numbers for S/390 DWARF.
|
||||
Copyright (C) 2006 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND s390_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
/*
|
||||
zseries (64)
|
||||
|
||||
0-15 gpr0-gpr15 x
|
||||
16-19 fpr[0246]
|
||||
20-24 fpr[13578]
|
||||
25-27 fpr1[024]
|
||||
28 fpr9
|
||||
29-31 fpr1[135]
|
||||
32-47 cr0-cr15 x
|
||||
48-63 ar0-ar15 x
|
||||
64 psw_mask
|
||||
65 psw_address
|
||||
*/
|
||||
|
||||
|
||||
ssize_t
|
||||
s390_register_info (Ebl *ebl __attribute__ ((unused)),
|
||||
int regno, char *name, size_t namelen,
|
||||
const char **prefix, const char **setname,
|
||||
int *bits, int *type)
|
||||
{
|
||||
if (name == NULL)
|
||||
return 66;
|
||||
|
||||
if (regno < 0 || regno > 65 || namelen < 7)
|
||||
return -1;
|
||||
|
||||
*prefix = "%";
|
||||
|
||||
*bits = ebl->class == ELFCLASS64 ? 64 : 32;
|
||||
*type = DW_ATE_unsigned;
|
||||
if (regno < 16)
|
||||
{
|
||||
*setname = "integer";
|
||||
*type = DW_ATE_signed;
|
||||
}
|
||||
else if (regno < 32)
|
||||
{
|
||||
*setname = "FPU";
|
||||
*type = DW_ATE_float;
|
||||
*bits = 64;
|
||||
}
|
||||
else if (regno < 48 || regno > 63)
|
||||
*setname = "control";
|
||||
else
|
||||
{
|
||||
*setname = "access";
|
||||
*bits = 32;
|
||||
}
|
||||
|
||||
switch (regno)
|
||||
{
|
||||
case 0 ... 9:
|
||||
name[0] = 'r';
|
||||
name[1] = regno + '0';
|
||||
namelen = 2;
|
||||
break;
|
||||
|
||||
case 10 ... 15:
|
||||
name[0] = 'r';
|
||||
name[1] = '1';
|
||||
name[2] = regno - 10 + '0';
|
||||
namelen = 3;
|
||||
break;
|
||||
|
||||
case 16 ... 31:
|
||||
name[0] = 'f';
|
||||
regno = (regno & 8) | ((regno & 4) >> 2) | ((regno & 3) << 1);
|
||||
namelen = 1;
|
||||
if (regno >= 10)
|
||||
{
|
||||
regno -= 10;
|
||||
name[namelen++] = '1';
|
||||
}
|
||||
name[namelen++] = regno + '0';
|
||||
break;
|
||||
|
||||
case 32 + 0 ... 32 + 9:
|
||||
case 48 + 0 ... 48 + 9:
|
||||
name[0] = regno < 48 ? 'c' : 'a';
|
||||
name[1] = (regno & 15) + '0';
|
||||
namelen = 2;
|
||||
break;
|
||||
|
||||
case 32 + 10 ... 32 + 15:
|
||||
case 48 + 10 ... 48 + 15:
|
||||
name[0] = regno < 48 ? 'c' : 'a';
|
||||
name[1] = '1';
|
||||
name[2] = (regno & 15) - 10 + '0';
|
||||
namelen = 3;
|
||||
break;
|
||||
|
||||
case 64:
|
||||
return stpcpy (name, "pswm") + 1 - name;
|
||||
case 65:
|
||||
*type = DW_ATE_address;
|
||||
return stpcpy (name, "pswa") + 1 - name;
|
||||
|
||||
default:
|
||||
*setname = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
name[namelen++] = '\0';
|
||||
return namelen;
|
||||
}
|
@ -1,91 +0,0 @@
|
||||
/* List the relocation types for s390. -*- C -*-
|
||||
Copyright (C) 2005, 2006, 2015 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/>. */
|
||||
|
||||
/* NAME, REL|EXEC|DYN */
|
||||
|
||||
RELOC_TYPE (NONE, 0)
|
||||
RELOC_TYPE (8, REL|EXEC|DYN)
|
||||
RELOC_TYPE (12, REL|EXEC|DYN)
|
||||
RELOC_TYPE (16, REL|EXEC|DYN)
|
||||
RELOC_TYPE (32, REL|EXEC|DYN)
|
||||
RELOC_TYPE (PC32, REL|EXEC|DYN)
|
||||
RELOC_TYPE (GOT12, REL)
|
||||
RELOC_TYPE (GOT32, REL)
|
||||
RELOC_TYPE (PLT32, REL)
|
||||
RELOC_TYPE (COPY, EXEC|DYN)
|
||||
RELOC_TYPE (GLOB_DAT, EXEC|DYN)
|
||||
RELOC_TYPE (JMP_SLOT, EXEC|DYN)
|
||||
RELOC_TYPE (RELATIVE, EXEC|DYN)
|
||||
RELOC_TYPE (GOTOFF32, REL)
|
||||
RELOC_TYPE (GOTPC, REL)
|
||||
RELOC_TYPE (GOT16, REL)
|
||||
RELOC_TYPE (PC16, REL|EXEC|DYN)
|
||||
RELOC_TYPE (PC16DBL, REL|EXEC|DYN)
|
||||
RELOC_TYPE (PLT16DBL, REL)
|
||||
RELOC_TYPE (PC32DBL, REL|EXEC|DYN)
|
||||
RELOC_TYPE (PLT32DBL, REL)
|
||||
RELOC_TYPE (GOTPCDBL, REL)
|
||||
RELOC_TYPE (64, REL|EXEC|DYN)
|
||||
RELOC_TYPE (PC64, REL|EXEC|DYN)
|
||||
RELOC_TYPE (GOT64, REL)
|
||||
RELOC_TYPE (PLT64, REL)
|
||||
RELOC_TYPE (GOTENT, REL)
|
||||
RELOC_TYPE (GOTOFF16, REL)
|
||||
RELOC_TYPE (GOTOFF64, REL)
|
||||
RELOC_TYPE (GOTPLT12, REL)
|
||||
RELOC_TYPE (GOTPLT16, REL)
|
||||
RELOC_TYPE (GOTPLT32, REL)
|
||||
RELOC_TYPE (GOTPLT64, REL)
|
||||
RELOC_TYPE (GOTPLTENT, REL)
|
||||
RELOC_TYPE (PLTOFF16, REL)
|
||||
RELOC_TYPE (PLTOFF32, REL)
|
||||
RELOC_TYPE (PLTOFF64, REL)
|
||||
RELOC_TYPE (TLS_LOAD, REL)
|
||||
RELOC_TYPE (TLS_GDCALL, REL)
|
||||
RELOC_TYPE (TLS_LDCALL, REL)
|
||||
RELOC_TYPE (TLS_GD32, REL)
|
||||
RELOC_TYPE (TLS_GD64, REL)
|
||||
RELOC_TYPE (TLS_GOTIE12, REL)
|
||||
RELOC_TYPE (TLS_GOTIE32, REL)
|
||||
RELOC_TYPE (TLS_GOTIE64, REL)
|
||||
RELOC_TYPE (TLS_LDM32, REL)
|
||||
RELOC_TYPE (TLS_LDM64, REL)
|
||||
RELOC_TYPE (TLS_IE32, REL)
|
||||
RELOC_TYPE (TLS_IE64, REL)
|
||||
RELOC_TYPE (TLS_IEENT, REL)
|
||||
RELOC_TYPE (TLS_LE32, REL)
|
||||
RELOC_TYPE (TLS_LE64, REL)
|
||||
RELOC_TYPE (TLS_LDO32, REL)
|
||||
RELOC_TYPE (TLS_LDO64, REL)
|
||||
RELOC_TYPE (TLS_DTPMOD, DYN)
|
||||
RELOC_TYPE (TLS_DTPOFF, DYN)
|
||||
RELOC_TYPE (TLS_TPOFF, DYN)
|
||||
RELOC_TYPE (20, REL|EXEC|DYN)
|
||||
RELOC_TYPE (GOT20, REL)
|
||||
RELOC_TYPE (GOTPLT20, REL)
|
||||
RELOC_TYPE (TLS_GOTIE20, REL)
|
@ -1,144 +0,0 @@
|
||||
/* Function return value location for S/390 ABI.
|
||||
Copyright (C) 2006, 2007, 2014 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <dwarf.h>
|
||||
|
||||
#define BACKEND s390_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
|
||||
/* %r2, or pair %r2, %r3. */
|
||||
static const Dwarf_Op loc_intreg[] =
|
||||
{
|
||||
{ .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
{ .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 4 },
|
||||
};
|
||||
#define nloc_intreg 1
|
||||
#define nloc_intregpair 4
|
||||
|
||||
/* %f0. */
|
||||
static const Dwarf_Op loc_fpreg[] =
|
||||
{
|
||||
{ .atom = DW_OP_reg16 },
|
||||
};
|
||||
#define nloc_fpreg 1
|
||||
|
||||
/* The return value is a structure and is actually stored in stack space
|
||||
passed in a hidden argument by the caller. But, the compiler
|
||||
helpfully returns the address of that space in %r2. */
|
||||
static const Dwarf_Op loc_aggregate[] =
|
||||
{
|
||||
{ .atom = DW_OP_breg2, .number = 0 }
|
||||
};
|
||||
#define nloc_aggregate 1
|
||||
|
||||
|
||||
int
|
||||
s390_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_Die die_mem, *typedie = &die_mem;
|
||||
int tag = dwarf_peeled_die_type (functypedie, typedie);
|
||||
if (tag <= 0)
|
||||
return tag;
|
||||
|
||||
Dwarf_Word size;
|
||||
switch (tag)
|
||||
{
|
||||
case -1:
|
||||
return -1;
|
||||
|
||||
case DW_TAG_subrange_type:
|
||||
if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
|
||||
{
|
||||
Dwarf_Attribute attr_mem, *attr;
|
||||
attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
|
||||
typedie = dwarf_formref_die (attr, &die_mem);
|
||||
tag = DWARF_TAG_OR_RETURN (typedie);
|
||||
}
|
||||
/* Fall through. */
|
||||
|
||||
case DW_TAG_base_type:
|
||||
case DW_TAG_enumeration_type:
|
||||
case DW_TAG_pointer_type:
|
||||
case DW_TAG_ptr_to_member_type:
|
||||
{
|
||||
Dwarf_Die cudie;
|
||||
uint8_t asize;
|
||||
if (dwarf_diecu (typedie, &cudie, &asize, NULL) == NULL)
|
||||
return -1;
|
||||
|
||||
Dwarf_Attribute attr_mem;
|
||||
if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
|
||||
&attr_mem), &size) != 0)
|
||||
{
|
||||
if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
|
||||
size = asize;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
if (tag == DW_TAG_base_type)
|
||||
{
|
||||
Dwarf_Word encoding;
|
||||
if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
|
||||
&attr_mem),
|
||||
&encoding) != 0)
|
||||
return -1;
|
||||
if (encoding == DW_ATE_float && size <= 8)
|
||||
{
|
||||
*locp = loc_fpreg;
|
||||
return nloc_fpreg;
|
||||
}
|
||||
}
|
||||
if (size <= 8)
|
||||
{
|
||||
*locp = loc_intreg;
|
||||
return size <= asize ? nloc_intreg : nloc_intregpair;
|
||||
}
|
||||
}
|
||||
/* Fall through. */
|
||||
|
||||
case DW_TAG_structure_type:
|
||||
case DW_TAG_class_type:
|
||||
case DW_TAG_union_type:
|
||||
case DW_TAG_array_type:
|
||||
*locp = loc_aggregate;
|
||||
return nloc_aggregate;
|
||||
}
|
||||
|
||||
/* XXX We don't have a good way to return specific errors from ebl calls.
|
||||
This value means we do not understand the type, but it is well-formed
|
||||
DWARF and might be valid. */
|
||||
return -2;
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
/* S/390-specific symbolic name handling.
|
||||
Copyright (C) 2005 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <elf.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#define BACKEND s390_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
/* Check for the simple reloc types. */
|
||||
Elf_Type
|
||||
s390_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case R_390_64:
|
||||
return ELF_T_SXWORD;
|
||||
case R_390_32:
|
||||
return ELF_T_SWORD;
|
||||
case R_390_16:
|
||||
return ELF_T_HALF;
|
||||
case R_390_8:
|
||||
return ELF_T_BYTE;
|
||||
default:
|
||||
return ELF_T_NUM;
|
||||
}
|
||||
}
|
@ -1,139 +0,0 @@
|
||||
/* Get previous frame state for an existing frame state.
|
||||
Copyright (C) 2013 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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
||||
#define BACKEND s390_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
/* s390/s390x do not annotate signal handler frame by CFI. It would be also
|
||||
difficult as PC points into a stub built on stack. Function below is called
|
||||
only if unwinder could not find CFI. Function then verifies the register
|
||||
state for this frame really belongs to a signal frame. In such case it
|
||||
fetches original registers saved by the signal frame. */
|
||||
|
||||
bool
|
||||
s390_unwind (Ebl *ebl, Dwarf_Addr pc, ebl_tid_registers_t *setfunc,
|
||||
ebl_tid_registers_get_t *getfunc, ebl_pid_memory_read_t *readfunc,
|
||||
void *arg, bool *signal_framep)
|
||||
{
|
||||
/* Caller already assumed caller adjustment but S390 instructions are 4 bytes
|
||||
long. Undo it. */
|
||||
if ((pc & 0x3) != 0x3)
|
||||
return false;
|
||||
pc++;
|
||||
/* We can assume big-endian read here. */
|
||||
Dwarf_Word instr;
|
||||
if (! readfunc (pc, &instr, arg))
|
||||
return false;
|
||||
/* Fetch only the very first two bytes. */
|
||||
instr = (instr >> (ebl->class == ELFCLASS64 ? 48 : 16)) & 0xffff;
|
||||
/* See GDB s390_sigtramp_frame_sniffer. */
|
||||
/* Check for 'svc' as the first instruction. */
|
||||
if (((instr >> 8) & 0xff) != 0x0a)
|
||||
return false;
|
||||
/* Check for 'sigreturn' or 'rt_sigreturn' as the second instruction. */
|
||||
if ((instr & 0xff) != 119 && (instr & 0xff) != 173)
|
||||
return false;
|
||||
/* See GDB s390_sigtramp_frame_unwind_cache. */
|
||||
Dwarf_Word this_sp;
|
||||
if (! getfunc (0 + 15, 1, &this_sp, arg))
|
||||
return false;
|
||||
unsigned word_size = ebl->class == ELFCLASS64 ? 8 : 4;
|
||||
Dwarf_Addr next_cfa = this_sp + 16 * word_size + 32;
|
||||
/* "New-style RT frame" is not supported,
|
||||
assuming "Old-style RT frame and all non-RT frames".
|
||||
Pointer to the array of saved registers is at NEXT_CFA + 8. */
|
||||
Dwarf_Word sigreg_ptr;
|
||||
if (! readfunc (next_cfa + 8, &sigreg_ptr, arg))
|
||||
return false;
|
||||
/* Skip PSW mask. */
|
||||
sigreg_ptr += word_size;
|
||||
/* Read PSW address. */
|
||||
Dwarf_Word val;
|
||||
if (! readfunc (sigreg_ptr, &val, arg))
|
||||
return false;
|
||||
if (! setfunc (-1, 1, &val, arg))
|
||||
return false;
|
||||
sigreg_ptr += word_size;
|
||||
/* Then the GPRs. */
|
||||
Dwarf_Word gprs[16];
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
if (! readfunc (sigreg_ptr, &gprs[i], arg))
|
||||
return false;
|
||||
sigreg_ptr += word_size;
|
||||
}
|
||||
/* Then the ACRs. Skip them, they are not used in CFI. */
|
||||
for (int i = 0; i < 16; i++)
|
||||
sigreg_ptr += 4;
|
||||
/* The floating-point control word. */
|
||||
sigreg_ptr += 8;
|
||||
/* And finally the FPRs. */
|
||||
Dwarf_Word fprs[16];
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
if (! readfunc (sigreg_ptr, &val, arg))
|
||||
return false;
|
||||
if (ebl->class == ELFCLASS32)
|
||||
{
|
||||
Dwarf_Addr val_low;
|
||||
if (! readfunc (sigreg_ptr + 4, &val_low, arg))
|
||||
return false;
|
||||
val = (val << 32) | val_low;
|
||||
}
|
||||
fprs[i] = val;
|
||||
sigreg_ptr += 8;
|
||||
}
|
||||
/* If we have them, the GPR upper halves are appended at the end. */
|
||||
if (ebl->class == ELFCLASS32)
|
||||
{
|
||||
/* Skip signal number. */
|
||||
sigreg_ptr += 4;
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
if (! readfunc (sigreg_ptr, &val, arg))
|
||||
return false;
|
||||
Dwarf_Word val_low = gprs[i];
|
||||
val = (val << 32) | val_low;
|
||||
gprs[i] = val;
|
||||
sigreg_ptr += 4;
|
||||
}
|
||||
}
|
||||
if (! setfunc (0, 16, gprs, arg))
|
||||
return false;
|
||||
if (! setfunc (16, 16, fprs, arg))
|
||||
return false;
|
||||
*signal_framep = true;
|
||||
return true;
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
#define BITS 64
|
||||
#include "s390_corenote.c"
|
@ -1,88 +0,0 @@
|
||||
/* SH specific core note handling.
|
||||
Copyright (C) 2010 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
Contributed Matt Fleming <matt@console-pimps.org>.
|
||||
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <elf.h>
|
||||
#include <inttypes.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#define BACKEND sh_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
static const Ebl_Register_Location prstatus_regs[] =
|
||||
{
|
||||
#define GR(at, n, dwreg) \
|
||||
{ .offset = at * 4, .regno = dwreg, .count = n, .bits = 32 }
|
||||
GR (0, 16, 0), /* r0-r15 */
|
||||
GR (16, 1, 16), /* pc */
|
||||
GR (17, 1, 17), /* pr */
|
||||
GR (18, 1, 22), /* sr */
|
||||
GR (19, 1, 18), /* gbr */
|
||||
GR (20, 1, 20), /* mach */
|
||||
GR (21, 1, 21), /* macl */
|
||||
/* 22, 1, tra */
|
||||
#undef GR
|
||||
};
|
||||
#define PRSTATUS_REGS_SIZE (23 * 4)
|
||||
|
||||
#define ULONG uint32_t
|
||||
#define PID_T int32_t
|
||||
#define UID_T uint16_t
|
||||
#define GID_T uint16_t
|
||||
#define ALIGN_ULONG 4
|
||||
#define ALIGN_PID_T 4
|
||||
#define ALIGN_UID_T 2
|
||||
#define ALIGN_GID_T 2
|
||||
#define TYPE_ULONG ELF_T_WORD
|
||||
#define TYPE_PID_T ELF_T_SWORD
|
||||
#define TYPE_UID_T ELF_T_HALF
|
||||
#define TYPE_GID_T ELF_T_HALF
|
||||
|
||||
#define PRSTATUS_REGSET_ITEMS \
|
||||
{ \
|
||||
.name = "tra", .type = ELF_T_ADDR, .format = 'x', \
|
||||
.offset = offsetof (struct EBLHOOK(prstatus), pr_reg[22]), \
|
||||
.group = "register" \
|
||||
}
|
||||
|
||||
static const Ebl_Register_Location fpregset_regs[] =
|
||||
{
|
||||
{ .offset = 0, .regno = 25, .count = 16, .bits = 32 }, /* fr0-fr15 */
|
||||
{ .offset = 16, .regno = 87, .count = 16, .bits = 32 }, /* xf0-xf15 */
|
||||
{ .offset = 32, .regno = 24, .count = 1, .bits = 32 }, /* fpscr */
|
||||
{ .offset = 33, .regno = 23, .count = 1, .bits = 32 } /* fpul */
|
||||
};
|
||||
#define FPREGSET_SIZE (50 * 4)
|
||||
|
||||
#include "linux-core-note.c"
|
@ -1,63 +0,0 @@
|
||||
/* Initialization of SH specific backend library.
|
||||
Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
Written by Ulrich Drepper <drepper@redhat.com>, 2000.
|
||||
|
||||
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/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND sh_
|
||||
#define RELOC_PREFIX R_SH_
|
||||
#include "libebl_CPU.h"
|
||||
|
||||
/* This defines the common reloc hooks based on sh_reloc.def. */
|
||||
#include "common-reloc.c"
|
||||
|
||||
|
||||
const char *
|
||||
sh_init (Elf *elf __attribute__ ((unused)),
|
||||
GElf_Half machine __attribute__ ((unused)),
|
||||
Ebl *eh,
|
||||
size_t ehlen)
|
||||
{
|
||||
/* Check whether the Elf_BH object has a sufficent size. */
|
||||
if (ehlen < sizeof (Ebl))
|
||||
return NULL;
|
||||
|
||||
/* We handle it. */
|
||||
eh->name = "Hitachi SH";
|
||||
sh_init_reloc (eh);
|
||||
HOOK (eh, reloc_simple_type);
|
||||
HOOK (eh, gotpc_reloc_check);
|
||||
HOOK (eh, machine_flag_check);
|
||||
HOOK (eh, core_note);
|
||||
HOOK (eh, register_info);
|
||||
HOOK (eh, return_value_location);
|
||||
|
||||
return MODVERSION;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user