Merge "Merge remote-tracking branch 'aosp/upstream-master' into elfutils" am: 5e2439a0e5
am: c5f2c7e1c1
Change-Id: Id337cdf00f067dee8c8829275e65ca3f02bcee2b
diff --git a/.gitignore b/.gitignore
index 75043fe..e8201dc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -60,10 +60,6 @@
/src/elfcompress
/src/elflint
/src/findtextrel
-/src/ld
-/src/ldlex.c
-/src/ldscript.c
-/src/ldscript.h
/src/make-debug-archive
/src/nm
/src/objdump
@@ -97,6 +93,7 @@
/tests/asm-tst9
/tests/backtrace
/tests/backtrace-child
+/tests/backtrace-child-biarch
/tests/backtrace-data
/tests/backtrace-dwarf
/tests/buildid
@@ -106,18 +103,27 @@
/tests/dwarf-getmacros
/tests/dwarf-getstring
/tests/dwarf-ranges
+/tests/dwelfgnucompressed
/tests/dwfl-addr-sect
/tests/dwfl-bug-addr-overflow
/tests/dwfl-bug-fd-leak
/tests/dwfl-bug-getmodules
/tests/dwfl-bug-report
+/tests/dwfl-proc-attach
/tests/dwfl-report-elf-align
/tests/dwfllines
/tests/dwflmodtest
/tests/dwflsyms
/tests/early-offscn
/tests/ecp
+/tests/elfgetchdr
+/tests/elfgetzdata
+/tests/elfputzdata
+/tests/elfshphehdr
+/tests/elfstrmerge
/tests/elfstrtab
+/tests/emptyfile
+/tests/fillfile
/tests/find-prologues
/tests/funcretval
/tests/funcscopes
@@ -129,11 +135,11 @@
/tests/hash
/tests/line2addr
/tests/low_high_pc
-/tests/md5-sha1-test
/tests/msg_tst
/tests/newdata
/tests/newfile
/tests/newscn
+/tests/peel_type
/tests/rdwrmmap
/tests/rerequest_tag
/tests/saridx
@@ -143,6 +149,7 @@
/tests/show-die-info
/tests/showptable
/tests/strptr
+/tests/system-elf-libelf-test
/tests/test-elf_cntl_gelf_getshdr
/tests/test-flag-nobits
/tests/test-nlist
@@ -153,5 +160,7 @@
/tests/update3
/tests/update4
/tests/varlocs
+/tests/vendorelf
/tests/vdsosyms
+/tests/zstrptr
/version.h
diff --git a/CONTRIBUTING b/CONTRIBUTING
index 3f5e5aa..e3d5a0f 100644
--- a/CONTRIBUTING
+++ b/CONTRIBUTING
@@ -1,11 +1,14 @@
-The project homepage is at https://fedorahosted.org/elfutils/
+The project home is http://elfutils.org/
The current elfutils source code can be checked out with
-git clone git://git.fedorahosted.org/git/elfutils.git
+git clone git://sourceware.org/git/elfutils.git
The developer mailinglist to send patches to is
-elfutils-devel@lists.fedorahosted.org.
-https://fedorahosted.org/mailman/listinfo/elfutils-devel
+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.
@@ -46,3 +49,58 @@
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.
diff --git a/ChangeLog b/ChangeLog
index 637bc13..696f31e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,178 @@
+2018-06-11 Mark Wielaard <mark@klomp.org>
+
+ * configure.ac: Set version to 0.172.
+ * NEWS: Mention bug fixes.
+
+2018-06-01 Mark Wielaard <mark@klomp.org>
+
+ * configure.ac: Set version to 0.171.
+ * NEWS: Mention DWARF5, split-dwarf and GNU DebugFission support.
+
+2018-03-17 Mark Wielaard <mark@klomp.org>
+
+ * configure.ac (CHECK_FUNCS): Check for process_vm_readv.
+
+2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
+
+ * configure.ac (HAVE_FALLTHROUGH): New define.
+
+2017-10-16 Mark Wielaard <mark@klomp.org>
+
+ * .gitignore: Remove tests/md5-sha1-test.
+
+2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
+
+ * configure.ac: Check if the compiler supports
+ __attribute__((gcc_struct)).
+
+2017-09-19 Mark Wielaard <mark@klomp.org>
+
+ * README: Add basic build instructions.
+
+2017-05-03 Ulf Hermann <ulf.hermann@qt.io>
+
+ * configure.ac: Test if symbol versioning is supported.
+
+2017-04-27 Ulf Hermann <ulf.hermann@qt.io>
+
+ * configure.ac: Check if the compiler supports
+ __attribute__((visibility(...))).
+
+2017-04-27 Ulf Hermann <ulf.hermann@qt.io>
+
+ * configure.ac: Check if -fPIC, -fPIE, -Wl,-z,defs,
+ and -Wl,-z,relro are supported by the compiler.
+
+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.
diff --git a/NEWS b/NEWS
index 53fe364..065e995 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,115 @@
+Version 0.173
+
+More fixes for crashes and hangs found by afl-fuzz. In particular various
+functions now detect and break infinite loops caused by bad DIE tree cycles.
+
+readelf: Will now lookup the size and signedness of constant value types
+ to display them correctly (and not just how they were encoded).
+
+libdw: New function dwarf_next_lines to read CU-less .debug_line data.
+ dwarf_begin_elf now accepts ELF files containing just .debug_line
+ or .debug_frame sections (which can be read without needing a DIE
+ tree from the .debug_info section).
+ Removed dwarf_getscn_info, which was never implemented.
+
+backends: Handle BPF simple relocations.
+ The RISCV backends now handles ABI specific CFI and knows about
+ RISCV register types and names.
+
+Version 0.172
+
+No functional changes compared to 0.171.
+
+Various bug fixes in libdw and eu-readelf dealing with bad DWARF5 data.
+Thanks to running the afl fuzzer on eu-readelf and various testcases.
+
+eu-readelf -N is ~15% faster.
+
+Version 0.171
+
+DWARF5 and split dwarf, including GNU DebugFission, are supported now.
+Data can be read from the new DWARF sections .debug_addr, .debug_line_str,
+.debug_loclists, .debug_str_offsets and .debug_rnglists. Plus the new
+DWARF5 and GNU DebugFission encodings of the existing .debug sections.
+Also in split DWARF .dwo (DWARF object) files. This support is mostly
+handled by existing functions (dwarf_getlocation*, dwarf_getsrclines,
+dwarf_ranges, dwarf_form*, etc.) now returning the data from the new
+sections and data formats. But some new functions have been added
+to more easily get information about skeleton and split compile units
+(dwarf_get_units and dwarf_cu_info), handle new attribute data
+(dwarf_getabbrevattr_data) and to keep references to Dwarf_Dies
+that might come from different sections or files (dwarf_die_addr_die).
+
+Not yet supported are .dwp (Dwarf Package) and .sup (Dwarf Supplementary)
+files, the .debug_names index, the .debug_cu_index and .debug_tu_index
+sections. Only a single .debug_info (and .debug_types) section are
+currently handled.
+
+readelf: Handle all new DWARF5 sections.
+ --debug-dump=info+ will show split unit DIEs when found.
+ --dwarf-skeleton can be used when inspecting a .dwo file.
+ Recognizes GNU locviews with --debug-dump=loc.
+
+libdw: New functions dwarf_die_addr_die, dwarf_get_units,
+ dwarf_getabbrevattr_data and dwarf_cu_info.
+ libdw will now try to resolve the alt file on first use of
+ an alt attribute FORM when not set yet with dwarf_set_alt.
+ dwarf_aggregate_size() now works with multi-dimensional arrays.
+
+libdwfl: Use process_vm_readv when available instead of ptrace.
+
+backends: Add a RISC-V backend.
+
+There were various improvements to build on Windows.
+The sha1 and md5 implementations have been removed, they weren't used.
+
+Version 0.170
+
+libdw: Added new DWARF5 attribute, tag, character encoding, language code,
+ calling convention, defaulted member function and macro constants
+ to dwarf.h.
+ New functions dwarf_default_lower_bound and dwarf_line_file.
+ dwarf_peel_type now handles DWARF5 immutable, packed and shared tags.
+ dwarf_getmacros now handles DWARF5 .debug_macro sections.
+
+strip: Add -R, --remove-section=SECTION and --keep-section=SECTION.
+
+backends: The bpf disassembler is now always build on all platforms.
+
+Version 0.169
+
+backends: Add support for EM_PPC64 GNU_ATTRIBUTES.
+ Frame pointer unwinding fallback support for i386, x86_64, aarch64.
+
+translations: Update Polish translation.
+
+Version 0.168
+
+http://elfutils.org/ is now hosted at http://sourceware.org/elfutils/
+
+libelf: gelf_newehdr and gelf_newehdr now return void *.
+
+libdw: dwarf.h corrected the DW_LANG_PLI constant name (was DW_LANG_PL1).
+
+readelf: Add optional --symbols[=SECTION] argument to select section name.
+
+Version 0.167
+
+libasm: Add eBPF disassembler for EM_BPF files.
+
+backends: Add m68k and BPF backends.
+
+ld: Removed.
+
+dwelf: Add ELF/DWARF string table creation functions. dwelf_strtab_init,
+ dwelf_strtab_add, dwelf_strtab_add_len, dwelf_strtab_finalize,
+ dwelf_strent_off, dwelf_strent_str and dwelf_strtab_free.
+
+Version 0.166
+
+config: The default program prefix for the installed tools is now eu-.
+ Use configure --program-prefix="" to not use a program prefix.
+
Version 0.165
elfcompress: New utility to compress or decompress ELF sections.
diff --git a/NOTES b/NOTES
index 4f06b8d..2a5c23b 100644
--- a/NOTES
+++ b/NOTES
@@ -1,3 +1,25 @@
+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()
diff --git a/README b/README
index 3564676..0e15bae 100644
--- a/README
+++ b/README
@@ -1,19 +1,31 @@
-Fundamental design decision:
+The elfutils project provides libraries and tools for ELF files and DWARF data.
-- 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 project home is http://elfutils.org/
-- 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.
+Releases are published at ftp://sourceware.org/pub/elfutils/
+Which can also be found at https://sourceware.org/elfutils/ftp/
-- 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.
+To build a release do: ./configure && make && make check
+Please check the configure summary to make sure all recommended
+features are enabled. There should be no failures after make check.
+
+Please reports bugs at https://sourceware.org/bugzilla/
+
+The current elfutils source code can be checked out with
+git clone git://sourceware.org/git/elfutils.git
+
+To build a git checkout do:
+ autoreconf -i -f && \
+ ./configure --enable-maintainer-mode && \
+ make && make check
+
+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
+
+See the CONTRIBUTING file for how to propose patches to the code.
+
+See the NOTES files for some design decisions and notes.
diff --git a/backends/ChangeLog b/backends/ChangeLog
index 4b604fd..3fa0f19 100644
--- a/backends/ChangeLog
+++ b/backends/ChangeLog
@@ -1,3 +1,223 @@
+2018-06-16 Yonghong Song <yhs@fb.com>
+
+ * Makefile.am (bpf_SRCS): Add bpf_symbol.c.
+ * bpf_init.c (bpf_init): Add reloc_simple_type HOOK.
+ * bpf_reloc.def: Add RELOC_TYPE 64_64 and 64_32.
+ * bpf_symbol.c: New file.
+
+2018-06-21 Mark Wielaard <mark@klomp.org>
+
+ * bpf_reloc.def: Remove MAP_FD.
+
+2018-06-13 Andreas Schwab <schwab@suse.de>
+
+ * Makefile.am (riscv_SRCS): Add riscv_cfi.c and riscv_regs.c.
+ * riscv_cfi.c: New file.
+ * riscv_regs.c: Likewise.
+ * riscv_init.c (riscv_init): Hook register_info and abi_cfi.
+
+2018-05-15 Andreas Schwab <schwab@suse.de>
+
+ * riscv_init.c (riscv_init): Hook check_special_symbol.
+ * riscv_symbol.c (riscv_check_special_symbol): New function.
+
+2018-04-19 Andreas Schwab <schwab@suse.de>
+
+ * Makefile.am (modules): Add riscv.
+ * riscv_init.c: New file.
+ * riscv_reloc.def: New file.
+ * riscv_symbol.c: New file.
+
+2018-04-11 Mark Wielaard <mark@klomp.org>
+
+ * aarch64_cfi.c (aarch64_abi_cfi): Add rule for restoring SP from
+ CFA address.
+
+2018-02-15 Mark Wielaard <mark@klomp.org>
+
+ * ppc_initreg.c: Include ptrace.h before system.h and sys/user.h.
+
+2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
+
+ * aarch64_retval.c (aarch64_return_value_location): Use FALLTHROUGH
+ macro instead of comment.
+ * alpha_retval.c (alpha_return_value_location): Likewise.
+ * arm_regs.c (arm_register_info): Likewise.
+ * arm_retval.c (arm_return_value_location): Likewise.
+ * i386_regs.c (i386_register_info): Likewise.
+ * i386_retval.c (i386_return_value_location): Likewise.
+ * ia64_retval.c (ia64_return_value_location): Likewise.
+ * linux-core-note.c (core_note): Likewise.
+ * m68k_retval.c (m68k_return_value_location): Likewise.
+ * ppc64_retval.c (ppc64_return_value_location): Likewise.
+ * ppc_regs.c (ppc_register_info): Likewise.
+ * ppc_retval.c (ppc_return_value_location): Likewise.
+ * s390_retval.c (s390_return_value_location): Likewise.
+ * sh_retval.c (sh_return_value_location): Likewise.
+ * sparc_retval.c (sparc_return_value_location): Likewise.
+ * tilegx_retval.c (tilegx_return_value_location): Likewise.
+ * x86_64_regs.c (x86_64_register_info): Likewise.
+ * x86_64_retval.c (x86_64_return_value_location): Likewise.
+
+2017-10-24 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (m68k_corenote_no_Wpacked_not_aligned): New variable.
+
+2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
+
+ * linux-core-note.c: Use attribute_packed.
+
+2017-04-27 Ulf Hermann <ulf.hermann@qt.io>
+
+ * Makefile.am: Use dso_LDFLAGS.
+
+2017-07-27 Mark Wielaard <mark@klomp.org>
+
+ * sparc_reloc.def: GOTDATA_OP_HIX22, GOTDATA_OP_LOX10 and
+ GOTDATA_OP can be used in ET_REL files.
+
+2017-07-19 Gustavo Romero <gromero@linux.vnet.ibm.com>
+
+ * ppc_corenote.c: Add offsets for ppc64 HTM SPRs: thfar, tfiar,
+ and texasr.
+ * ppc_regs.c: Add names for ppc64 HTM SPRs mappings.
+
+2017-07-20 Mark Wielaard <mark@klomp.org>
+
+ * aarch64_init.c (aarch64_init): Hook data_marker_symbol.
+ * aarch64_symbol.c (aarch64_data_marker_symbol): New function.
+ * arm_init.c (arm_init): Hook data_marker_symbol.
+ * arm_symbol.c (aarch64_data_marker_symbol): New function.
+
+2017-07-18 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (cpu_bpf): Always define.
+ * bpf_init.c (disasm): Always hook.
+ * bpf_regs.c: Include bpf.h instead of linux/bpf.h. Don't define
+ MAX_BPF_REG.
+
+2017-02-17 Ulf Hermann <ulf.hermann@qt.io>
+
+ * Makefile.am: Add libeu.
+ (libebl_%so): Link with --no-undefined,-z,defs,-z,relro
+ and libeu.a.
+
+2017-06-17 Mark Wielaard <mark@klomp.org>
+
+ * s390_initreg.c: Swap sys/ptrace.h and asm/ptrace.h include order.
+
+2017-06-15 Andreas Schwab <schwab@linux-m68k.org>
+
+ * ppc_symbol.c (ppc_machine_flag_check): New function.
+ * ppc_init.c (ppc_init): Hook it.
+
+2017-05-30 Mark Wielaard <mark@klomp.org>
+
+ * ppc64_unwind.c: New file.
+ * ppc64_init.c (pcc64_init): Hook unwind.
+ * Makefile.am (ppc64_SRCS): Add ppc64_unwind.c
+
+2017-04-06 Mark Wielaard <mark@klomp.org>
+
+ * i386_unwind.c: New file.
+ * i386_init.c: Hook i386_unwind.
+ * Makefile.am (i386_SRCS): Add i386_unwind.c
+
+2017-02-09 Ulf Hermann <ulf.hermann@qt.io>
+
+ * aarch64_unwind.c: New file
+ * Makefile.am (aarch64_SRCS): Add aarch64_unwind.c
+ * aarch64_init.c (aarch64_init): Hook aarch64_unwind
+
+2017-02-09 Ulf Hermann <ulf.hermann@qt.io>
+
+ * x86_64_unwind.c: New file
+ * Makefile.am (x86_64_SRCS): Add x86_64_unwind.c
+ * x86_64_init.c (x86_64_init): Hook x86_64_unwind
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * aarch64_initreg.c: Compile register initialization only on linux.
+ * arm_initreg.c: Likewise.
+ * ppc_initreg.c: Likewise.
+ * s390_initreg.c: Likewise.
+ * x86_64_initreg.c: Likewise.
+
+2017-02-15 Mark Wielaard <mark@klomp.org>
+
+ * ppc64_init.c (ppc64_init): Add check_object_attribute HOOK.
+ * ppc_attrs.c (ppc_check_object_attribute): Add Single-precision hard
+ float.
+
+2016-11-02 Mark Wielaard <mjw@redhat.com>
+
+ * i386_regs.c (i386_register_info): Add fallthrough comment.
+ * i386_retval.c (i386_return_value_location): Move fallthrough
+ comment.
+ * linux-core-note.c (core_note): Adjust fallthrough comment.
+ * m68k_retval.c (m68k_return_value_location): Move fallthrough
+ comment.
+ * ppc_regs.c (ppc_register_info): Add fallthrough comment.
+ * x86_64_regs.c (x86_64_register_info): Likewise.
+
+2016-08-09 Jose E. Marchesi <jose.marchesi@oracle.com>
+
+ * sparc_attrs.c (sparc_check_object_attribute): Fix the
+ calculation of GNU_SParc_HWCAPS and GNU_SParc_HWCAPS2 values as
+ comma-separated list of hw capability names.
+
+2016-07-10 Andreas Schwab <schwab@linux-m68k.org>
+
+ * m68k_corenote.c (ALIGN_PRSTATUS): Define.
+ * linux-core-note.c (struct EBLHOOK(prstatus)): Set alignment to
+ ALIGN_PRSTATUS if defined.
+
+2016-06-28 Richard Henderson <rth@redhat.com>
+
+ * Makefile.am (modules): Add bpf.
+ (libebl_pic): Add libebl_bpf_pic.a.
+ (am_libebl_bpf_pic_a_OBJECTS): New.
+ * bpf_init.c, bpf_regs.c, bpf_reloc.def: New files.
+ * common-reloc.c (copy_reloc_p): Honor NO_COPY_RELOC.
+ (init_reloc): Likewise.
+
+2016-05-20 Andreas Schwab <schwab@linux-m68k.org>
+
+ * Makefile.am (modules): Add m68k.
+ (libebl_pic): Add libebl_m68k_pic.a.
+ (m68k_SRCS, libebl_m68k_pic_a_SOURCES)
+ (am_libebl_m68k_pic_a_OBJECTS): Define.
+ * m68k_init.c: New file.
+ * m68k_symbol.c: New file.
+ * m68k_regs.c: New file.
+ * m68k_retval.c: New file.
+ * m68k_corenote.c: New file.
+ * m68k_reloc.def: New file.
+ * linux-core-note.c (ALIGN_INT): Only define if not defined.
+
+2016-02-26 Jose E. Marchesi <jose.marchesi@oracle.com>
+
+ * sparc_initreg.c (EBLHOOK): Provide a dummy
+ sparc_set_initial_registers_tid for sparc32. This fixes the build
+ in sparcv9-*-* targets.
+
+2016-02-26 Andreas Schwab <schwab@suse.de>
+
+ * ppc_symbol.c (ppc_dynamic_tag_name): Add DT_PPC_OPT.
+ (ppc_dynamic_tag_check): Likewise.
+
+2015-12-28 Mark Wielaard <mjw@redhat.com>
+
+ * i386_reloc.def: Add GOT32X.
+ * x86_64_reloc.def: Add GOTPCRELX and REX_GOTPCRELX.
+
+2016-02-12 Mark Wielaard <mjw@redhat.com>
+
+ * aarch64_corenote.c (aarch64_syscall_items): New Ebl_Core_Item[].
+ (EXTRA_NOTES): Add NT_ARM_SYSTEM_CALL.
+ * eblcorenotetypename.c (ebl_core_note_type_name):
+ Add ARM_SYSTEM_CALL.
+
2015-12-08 Jose E. Marchesi <jose.marchesi@oracle.com>
* sparc_init.c (sparc_init): Hook sparc_set_initial_registers_tid.
diff --git a/backends/Makefile.am b/backends/Makefile.am
index b16f948..e42d674 100644
--- a/backends/Makefile.am
+++ b/backends/Makefile.am
@@ -33,21 +33,23 @@
modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
- tilegx
+ tilegx m68k bpf riscv
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_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
+ libebl_m68k_pic.a libebl_bpf_pic.a libebl_riscv_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_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)
@@ -58,7 +60,7 @@
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 x32_corenote.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)
@@ -79,7 +81,7 @@
aarch64_SRCS = aarch64_init.c aarch64_regs.c aarch64_symbol.c \
aarch64_corenote.c aarch64_retval.c aarch64_cfi.c \
- aarch64_initreg.c
+ aarch64_initreg.c aarch64_unwind.c
libebl_aarch64_pic_a_SOURCES = $(aarch64_SRCS)
am_libebl_aarch64_pic_a_OBJECTS = $(aarch64_SRCS:.c=.os)
@@ -97,7 +99,7 @@
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_resolve_sym.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)
@@ -112,19 +114,41 @@
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)
-libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
+# m68k prstatus core notes are described by a packed structure
+# which has not naturally aligned fields. Since we don't access
+# these fields directly, but take their offset to be used later
+# to extract the data through elfxx_xlatetom/memmove, this isn't
+# an issue.
+m68k_corenote_no_Wpacked_not_aligned = yes
+
+bpf_SRCS = bpf_init.c bpf_regs.c bpf_symbol.c
+cpu_bpf = ../libcpu/libcpu_bpf.a
+libebl_bpf_pic_a_SOURCES = $(bpf_SRCS)
+am_libebl_bpf_pic_a_OBJECTS = $(bpf_SRCS:.c=.os)
+
+riscv_SRCS = riscv_init.c riscv_symbol.c riscv_cfi.c riscv_regs.c
+libebl_riscv_pic_a_SOURCES = $(riscv_SRCS)
+am_libebl_riscv_pic_a_OBJECTS = $(riscv_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) \
+ $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $(@:.map=.so) \
-Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
- -Wl,--version-script,$(@:.so=.map) \
- -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw)
+ -Wl,--version-script,$(@:.so=.map),--no-undefined \
+ -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:
diff --git a/backends/aarch64_cfi.c b/backends/aarch64_cfi.c
index acbb9b6..a5579ab 100644
--- a/backends/aarch64_cfi.c
+++ b/backends/aarch64_cfi.c
@@ -1,5 +1,5 @@
-/* arm ABI-specified defaults for DWARF CFI.
- Copyright (C) 2013 Red Hat, Inc.
+/* arm64 ABI-specified defaults for DWARF CFI.
+ Copyright (C) 2013, 2018 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -62,6 +62,9 @@
/* The Frame Pointer (FP, r29) and Link Register (LR, r30). */
SV (29), SV (30),
+ /* The Stack Pointer (r31) is restored from CFA address by default. */
+ DW_CFA_val_offset, ULEB128_7 (31), ULEB128_7 (0),
+
/* Callee-saved fpregs v8-v15. v0 == 64. */
SV (72), SV (73), SV (74), SV (75),
SV (76), SV (77), SV (78), SV (79),
diff --git a/backends/aarch64_corenote.c b/backends/aarch64_corenote.c
index 9b42485..905a4b8 100644
--- a/backends/aarch64_corenote.c
+++ b/backends/aarch64_corenote.c
@@ -99,6 +99,14 @@
}
};
+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', \
@@ -158,6 +166,7 @@
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_HW_WATCH, 264, aarch64_hw_wp_items) \
+ EXTRA_ITEMS (NT_ARM_SYSTEM_CALL, 4, aarch64_syscall_items)
#include "linux-core-note.c"
diff --git a/backends/aarch64_init.c b/backends/aarch64_init.c
index 6395f11..fad923f 100644
--- a/backends/aarch64_init.c
+++ b/backends/aarch64_init.c
@@ -1,5 +1,5 @@
/* Initialization of AArch64 specific backend library.
- Copyright (C) 2013 Red Hat, Inc.
+ 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
@@ -56,6 +56,7 @@
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)
@@ -63,6 +64,7 @@
+ 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;
}
diff --git a/backends/aarch64_initreg.c b/backends/aarch64_initreg.c
index 9706205..daf6f37 100644
--- a/backends/aarch64_initreg.c
+++ b/backends/aarch64_initreg.c
@@ -32,7 +32,7 @@
#include "system.h"
#include <assert.h>
-#ifdef __aarch64__
+#if defined(__aarch64__) && defined(__linux__)
# include <linux/uio.h>
# include <sys/user.h>
# include <sys/ptrace.h>
@@ -51,7 +51,7 @@
ebl_tid_registers_t *setfunc __attribute__ ((unused)),
void *arg __attribute__ ((unused)))
{
-#ifndef __aarch64__
+#if !defined(__aarch64__) || !defined(__linux__)
return false;
#else /* __aarch64__ */
diff --git a/backends/aarch64_retval.c b/backends/aarch64_retval.c
index 68de307..1308340 100644
--- a/backends/aarch64_retval.c
+++ b/backends/aarch64_retval.c
@@ -292,7 +292,7 @@
assert (count > 0);
if (count <= 4)
return pass_hfa (locp, base_size, count);
- /* Fall through. */
+ FALLTHROUGH;
case 1:
/* Not a HFA. */
diff --git a/backends/aarch64_symbol.c b/backends/aarch64_symbol.c
index 76999e4..da3382e 100644
--- a/backends/aarch64_symbol.c
+++ b/backends/aarch64_symbol.c
@@ -1,5 +1,5 @@
/* AArch64 specific symbolic name handling.
- Copyright (C) 2013, 2015 Red Hat, Inc.
+ 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
@@ -90,3 +90,15 @@
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));
+}
diff --git a/backends/aarch64_unwind.c b/backends/aarch64_unwind.c
new file mode 100644
index 0000000..e0a7e96
--- /dev/null
+++ b/backends/aarch64_unwind.c
@@ -0,0 +1,83 @@
+/* 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;
+}
diff --git a/backends/alpha_retval.c b/backends/alpha_retval.c
index 53dbfa4..d9bae3b 100644
--- a/backends/alpha_retval.c
+++ b/backends/alpha_retval.c
@@ -85,7 +85,7 @@
typedie = dwarf_formref_die (attr, &die_mem);
tag = DWARF_TAG_OR_RETURN (typedie);
}
- /* Fall through. */
+ FALLTHROUGH;
case DW_TAG_base_type:
case DW_TAG_enumeration_type:
@@ -131,7 +131,7 @@
}
}
- /* Else fall through. */
+ FALLTHROUGH;
case DW_TAG_structure_type:
case DW_TAG_class_type:
diff --git a/backends/arm_init.c b/backends/arm_init.c
index caadac6..f2b1b11 100644
--- a/backends/arm_init.c
+++ b/backends/arm_init.c
@@ -1,5 +1,5 @@
/* Initialization of Arm specific backend library.
- Copyright (C) 2002, 2005, 2009, 2013, 2014, 2015 Red Hat, Inc.
+ 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.
@@ -64,6 +64,7 @@
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;
diff --git a/backends/arm_initreg.c b/backends/arm_initreg.c
index a0a9be9..efcabaf 100644
--- a/backends/arm_initreg.c
+++ b/backends/arm_initreg.c
@@ -30,6 +30,7 @@
# include <config.h>
#endif
+#ifdef __linux__
#if defined __arm__
# include <sys/types.h>
# include <sys/user.h>
@@ -45,6 +46,7 @@
# define user_regs_struct user_pt_regs
# endif
#endif
+#endif
#define BACKEND arm_
#include "libebl_CPU.h"
@@ -54,7 +56,7 @@
ebl_tid_registers_t *setfunc __attribute__ ((unused)),
void *arg __attribute__ ((unused)))
{
-#if !defined __arm__ && !defined __aarch64__
+#if !defined(__linux__) || (!defined __arm__ && !defined __aarch64__)
return false;
#else /* __arm__ || __aarch64__ */
#if defined __arm__
diff --git a/backends/arm_regs.c b/backends/arm_regs.c
index 21c5ad3..a46a4c9 100644
--- a/backends/arm_regs.c
+++ b/backends/arm_regs.c
@@ -77,7 +77,7 @@
case 16 + 0 ... 16 + 7:
regno += 96 - 16;
- /* Fall through. */
+ FALLTHROUGH;
case 96 + 0 ... 96 + 7:
*setname = "FPA";
*type = DW_ATE_float;
diff --git a/backends/arm_retval.c b/backends/arm_retval.c
index 7aced74..1c28f01 100644
--- a/backends/arm_retval.c
+++ b/backends/arm_retval.c
@@ -82,7 +82,7 @@
typedie = dwarf_formref_die (attr, &die_mem);
tag = DWARF_TAG_OR_RETURN (typedie);
}
- /* Fall through. */
+ FALLTHROUGH;
case DW_TAG_base_type:
case DW_TAG_enumeration_type:
diff --git a/backends/arm_symbol.c b/backends/arm_symbol.c
index da4a50a..3edda72 100644
--- a/backends/arm_symbol.c
+++ b/backends/arm_symbol.c
@@ -1,5 +1,5 @@
/* Arm specific symbolic name handling.
- Copyright (C) 2002-2009, 2014, 2015 Red Hat, Inc.
+ 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
@@ -32,6 +32,7 @@
#include <elf.h>
#include <stddef.h>
+#include <string.h>
#define BACKEND arm_
#include "libebl_CPU.h"
@@ -142,3 +143,15 @@
}
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));
+}
diff --git a/backends/bpf_init.c b/backends/bpf_init.c
new file mode 100644
index 0000000..a046e06
--- /dev/null
+++ b/backends/bpf_init.c
@@ -0,0 +1,59 @@
+/* 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);
+ HOOK (eh, reloc_simple_type);
+
+ return MODVERSION;
+}
diff --git a/libebl/eblshflagscombine.c b/backends/bpf_regs.c
similarity index 61%
copy from libebl/eblshflagscombine.c
copy to backends/bpf_regs.c
index 4deaaaa..1863a16 100644
--- a/libebl/eblshflagscombine.c
+++ b/backends/bpf_regs.c
@@ -1,7 +1,5 @@
-/* Return combines section header flags value.
- Copyright (C) 2001, 2002 Red Hat, Inc.
+/* Register names and numbers for BPF DWARF.
This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
This file is free software; you can redistribute it and/or modify
it under the terms of either
@@ -31,11 +29,32 @@
# include <config.h>
#endif
-#include <libeblP.h>
+#include <stdio.h>
+#include <string.h>
+#include "bpf.h"
-GElf_Word
-ebl_sh_flags_combine (Ebl *ebl, GElf_Word flags1, GElf_Word flags2)
+#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)
{
- return ebl->sh_flags_combine (flags1, flags2);
+ 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);
}
diff --git a/libebl/eblshflagscombine.c b/backends/bpf_reloc.def
similarity index 72%
copy from libebl/eblshflagscombine.c
copy to backends/bpf_reloc.def
index 4deaaaa..59f519b 100644
--- a/libebl/eblshflagscombine.c
+++ b/backends/bpf_reloc.def
@@ -1,7 +1,5 @@
-/* Return combines section header flags value.
- Copyright (C) 2001, 2002 Red Hat, Inc.
+/* List the relocation types for BPF. -*- C -*-
This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
This file is free software; you can redistribute it and/or modify
it under the terms of either
@@ -27,15 +25,8 @@
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
+/* NAME, REL|EXEC|DYN */
-#include <libeblP.h>
-
-
-GElf_Word
-ebl_sh_flags_combine (Ebl *ebl, GElf_Word flags1, GElf_Word flags2)
-{
- return ebl->sh_flags_combine (flags1, flags2);
-}
+RELOC_TYPE (NONE, EXEC|DYN)
+RELOC_TYPE (64_64, REL)
+RELOC_TYPE (64_32, REL)
diff --git a/libebl/eblshflagscombine.c b/backends/bpf_symbol.c
similarity index 69%
copy from libebl/eblshflagscombine.c
copy to backends/bpf_symbol.c
index 4deaaaa..c9856f2 100644
--- a/libebl/eblshflagscombine.c
+++ b/backends/bpf_symbol.c
@@ -1,7 +1,5 @@
-/* Return combines section header flags value.
- Copyright (C) 2001, 2002 Red Hat, Inc.
+/* BPF specific symbolic name handling.
This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
This file is free software; you can redistribute it and/or modify
it under the terms of either
@@ -31,11 +29,26 @@
# include <config.h>
#endif
-#include <libeblP.h>
+#include <assert.h>
+#include <elf.h>
+#include <stddef.h>
+#include <string.h>
+
+#define BACKEND bpf_
+#include "libebl_CPU.h"
-GElf_Word
-ebl_sh_flags_combine (Ebl *ebl, GElf_Word flags1, GElf_Word flags2)
+/* Check for the simple reloc types. */
+Elf_Type
+bpf_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
{
- return ebl->sh_flags_combine (flags1, flags2);
+ switch (type)
+ {
+ case R_BPF_64_64:
+ return ELF_T_XWORD;
+ case R_BPF_64_32:
+ return ELF_T_WORD;
+ default:
+ return ELF_T_NUM;
+ }
}
diff --git a/backends/common-reloc.c b/backends/common-reloc.c
index 3317b6c..096ed1c 100644
--- a/backends/common-reloc.c
+++ b/backends/common-reloc.c
@@ -124,12 +124,13 @@
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)
@@ -151,8 +152,10 @@
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->copy_reloc_p = EBLHOOK(copy_reloc_p);
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
diff --git a/backends/i386_init.c b/backends/i386_init.c
index 515d5ac..fc1587a 100644
--- a/backends/i386_init.c
+++ b/backends/i386_init.c
@@ -1,5 +1,5 @@
/* Initialization of i386 specific backend library.
- Copyright (C) 2000-2009, 2013 Red Hat, Inc.
+ Copyright (C) 2000-2009, 2013, 2017 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2000.
@@ -65,6 +65,7 @@
/* 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;
}
diff --git a/backends/i386_regs.c b/backends/i386_regs.c
index fb8ded3..7ec93bb 100644
--- a/backends/i386_regs.c
+++ b/backends/i386_regs.c
@@ -92,6 +92,7 @@
case 5:
case 8:
*type = DW_ATE_address;
+ FALLTHROUGH;
case 0 ... 3:
case 6 ... 7:
name[0] = 'e';
diff --git a/backends/i386_reloc.def b/backends/i386_reloc.def
index de3575d..a6a03f3 100644
--- a/backends/i386_reloc.def
+++ b/backends/i386_reloc.def
@@ -68,3 +68,4 @@
RELOC_TYPE (TLS_DESC_CALL, REL)
RELOC_TYPE (TLS_DESC, EXEC)
RELOC_TYPE (IRELATIVE, EXEC|DYN)
+RELOC_TYPE (GOT32X, REL)
diff --git a/backends/i386_retval.c b/backends/i386_retval.c
index 9da797d..32fec72 100644
--- a/backends/i386_retval.c
+++ b/backends/i386_retval.c
@@ -85,7 +85,7 @@
typedie = dwarf_formref_die (attr, &die_mem);
tag = DWARF_TAG_OR_RETURN (typedie);
}
- /* Fall through. */
+ FALLTHROUGH;
case DW_TAG_base_type:
case DW_TAG_enumeration_type:
@@ -122,9 +122,8 @@
return nloc_intreg;
if (size <= 8)
return nloc_intregpair;
-
- /* Else fall through. */
}
+ FALLTHROUGH;
case DW_TAG_structure_type:
case DW_TAG_class_type:
diff --git a/backends/i386_unwind.c b/backends/i386_unwind.c
new file mode 100644
index 0000000..5c9a5de
--- /dev/null
+++ b/backends/i386_unwind.c
@@ -0,0 +1,84 @@
+/* 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;
+}
diff --git a/backends/ia64_retval.c b/backends/ia64_retval.c
index dcd5f28..03ea4d8 100644
--- a/backends/ia64_retval.c
+++ b/backends/ia64_retval.c
@@ -260,7 +260,7 @@
typedie = dwarf_formref_die (attr, &die_mem);
tag = DWARF_TAG_OR_RETURN (typedie);
}
- /* Fall through. */
+ FALLTHROUGH;
case DW_TAG_base_type:
case DW_TAG_enumeration_type:
diff --git a/backends/linux-core-note.c b/backends/linux-core-note.c
index ff2b226..9faae4c 100644
--- a/backends/linux-core-note.c
+++ b/backends/linux-core-note.c
@@ -41,7 +41,9 @@
#define ALIGN_SHORT 2
#define TYPE_SHORT ELF_T_HALF
#define INT int32_t
-#define ALIGN_INT 4
+#ifndef ALIGN_INT
+# define ALIGN_INT 4
+#endif
#define TYPE_INT ELF_T_SWORD
#ifndef PR_REG
# define PR_REG ULONG
@@ -107,7 +109,11 @@
#endif
;
FIELD (INT, pr_fpvalid);
-};
+}
+#ifdef ALIGN_PRSTATUS
+ attribute_packed __attribute__ ((aligned (ALIGN_PRSTATUS)))
+#endif
+;
#define FNAMESZ 16
#define PRARGSZ 80
@@ -219,8 +225,8 @@
case sizeof "CORE":
if (memcmp (name, "CORE", nhdr->n_namesz) == 0)
break;
- /* Buggy old Linux kernels didn't terminate "LINUX".
- Fall through. */
+ /* Buggy old Linux kernels didn't terminate "LINUX". */
+ FALLTHROUGH;
case sizeof "LINUX":
if (memcmp (name, "LINUX", nhdr->n_namesz) == 0)
diff --git a/backends/m68k_corenote.c b/backends/m68k_corenote.c
new file mode 100644
index 0000000..3c1d019
--- /dev/null
+++ b/backends/m68k_corenote.c
@@ -0,0 +1,72 @@
+/* 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"
diff --git a/backends/m68k_init.c b/backends/m68k_init.c
new file mode 100644
index 0000000..943478f
--- /dev/null
+++ b/backends/m68k_init.c
@@ -0,0 +1,60 @@
+/* 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;
+}
diff --git a/backends/m68k_regs.c b/backends/m68k_regs.c
new file mode 100644
index 0000000..cb99f55
--- /dev/null
+++ b/backends/m68k_regs.c
@@ -0,0 +1,96 @@
+/* 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;
+}
diff --git a/backends/m68k_reloc.def b/backends/m68k_reloc.def
new file mode 100644
index 0000000..b7cc4df
--- /dev/null
+++ b/backends/m68k_reloc.def
@@ -0,0 +1,70 @@
+/* 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)
diff --git a/backends/m68k_retval.c b/backends/m68k_retval.c
new file mode 100644
index 0000000..a653ba3
--- /dev/null
+++ b/backends/m68k_retval.c
@@ -0,0 +1,151 @@
+/* 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);
+ }
+ FALLTHROUGH;
+
+ 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;
+}
diff --git a/backends/m68k_symbol.c b/backends/m68k_symbol.c
new file mode 100644
index 0000000..269d12e
--- /dev/null
+++ b/backends/m68k_symbol.c
@@ -0,0 +1,70 @@
+/* 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;
+ }
+}
diff --git a/backends/ppc64_init.c b/backends/ppc64_init.c
index 2ba8232..e567033 100644
--- a/backends/ppc64_init.c
+++ b/backends/ppc64_init.c
@@ -67,11 +67,13 @@
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. */
diff --git a/backends/ppc64_retval.c b/backends/ppc64_retval.c
index a251983..eb1c11e 100644
--- a/backends/ppc64_retval.c
+++ b/backends/ppc64_retval.c
@@ -96,7 +96,7 @@
typedie = dwarf_formref_die (attr, &die_mem);
tag = DWARF_TAG_OR_RETURN (typedie);
}
- /* Fall through. */
+ FALLTHROUGH;
case DW_TAG_base_type:
case DW_TAG_enumeration_type:
@@ -141,7 +141,7 @@
return nloc_intreg;
}
- /* Else fall through. */
+ FALLTHROUGH;
case DW_TAG_structure_type:
case DW_TAG_class_type:
case DW_TAG_union_type:
@@ -161,7 +161,7 @@
return nloc_vmxreg;
}
}
- /* Fall through. */
+ FALLTHROUGH;
case DW_TAG_string_type:
if (dwarf_aggregate_size (typedie, &size) == 0 && size <= 8)
diff --git a/backends/ppc64_unwind.c b/backends/ppc64_unwind.c
new file mode 100644
index 0000000..4fa0b5a
--- /dev/null
+++ b/backends/ppc64_unwind.c
@@ -0,0 +1,76 @@
+/* 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;
+}
diff --git a/backends/ppc_attrs.c b/backends/ppc_attrs.c
index 612c576..48d7129 100644
--- a/backends/ppc_attrs.c
+++ b/backends/ppc_attrs.c
@@ -51,6 +51,7 @@
"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];
diff --git a/backends/ppc_corenote.c b/backends/ppc_corenote.c
index 9ac8871..2b4ada7 100644
--- a/backends/ppc_corenote.c
+++ b/backends/ppc_corenote.c
@@ -94,9 +94,20 @@
{ .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_SPE, 35 * 4, spe_regs) \
+ EXTRA_REGSET (NT_PPC_TM_SPR, 3 * 8, tm_spr_regs)
#if BITS == 32
# define ULONG uint32_t
diff --git a/backends/ppc_init.c b/backends/ppc_init.c
index c3e3ca3..aea9f2d 100644
--- a/backends/ppc_init.c
+++ b/backends/ppc_init.c
@@ -53,6 +53,7 @@
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);
diff --git a/backends/ppc_initreg.c b/backends/ppc_initreg.c
index 64f5379..3e4432f 100644
--- a/backends/ppc_initreg.c
+++ b/backends/ppc_initreg.c
@@ -30,13 +30,14 @@
# include <config.h>
#endif
-#include "system.h"
#include <stdlib.h>
-#ifdef __powerpc__
-# include <sys/user.h>
+#if defined(__powerpc__) && defined(__linux__)
# include <sys/ptrace.h>
+# include <sys/user.h>
#endif
+#include "system.h"
+
#define BACKEND ppc_
#include "libebl_CPU.h"
@@ -70,7 +71,7 @@
ebl_tid_registers_t *setfunc __attribute__ ((unused)),
void *arg __attribute__ ((unused)))
{
-#ifndef __powerpc__
+#if !defined(__powerpc__) || !defined(__linux__)
return false;
#else /* __powerpc__ */
union
diff --git a/backends/ppc_regs.c b/backends/ppc_regs.c
index 4b92a9a..43d2534 100644
--- a/backends/ppc_regs.c
+++ b/backends/ppc_regs.c
@@ -140,7 +140,7 @@
case 100:
if (*bits == 32)
return stpcpy (name, "mq") + 1 - name;
-
+ FALLTHROUGH;
case 102 ... 107:
name[0] = 's';
name[1] = 'p';
@@ -149,7 +149,15 @@
namelen = 4;
break;
- case 110 ... 117:
+ 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';
diff --git a/backends/ppc_retval.c b/backends/ppc_retval.c
index b14a99f..39b42da 100644
--- a/backends/ppc_retval.c
+++ b/backends/ppc_retval.c
@@ -108,7 +108,7 @@
typedie = dwarf_formref_die (attr, &die_mem);
tag = DWARF_TAG_OR_RETURN (typedie);
}
- /* Fall through. */
+ FALLTHROUGH;
case DW_TAG_base_type:
case DW_TAG_enumeration_type:
@@ -172,7 +172,7 @@
return nloc_intregquad;
}
}
- /* Fall through. */
+ FALLTHROUGH;
case DW_TAG_structure_type:
case DW_TAG_class_type:
diff --git a/backends/ppc_symbol.c b/backends/ppc_symbol.c
index 37d4918..4b32003 100644
--- a/backends/ppc_symbol.c
+++ b/backends/ppc_symbol.c
@@ -57,6 +57,16 @@
}
+/* 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)))
@@ -65,6 +75,8 @@
{
case DT_PPC_GOT:
return "PPC_GOT";
+ case DT_PPC_OPT:
+ return "PPC_OPT";
default:
break;
}
@@ -75,7 +87,8 @@
bool
ppc_dynamic_tag_check (int64_t tag)
{
- return tag == DT_PPC_GOT;
+ return (tag == DT_PPC_GOT
+ || tag == DT_PPC_OPT);
}
diff --git a/backends/riscv_cfi.c b/backends/riscv_cfi.c
new file mode 100644
index 0000000..1a84a38
--- /dev/null
+++ b/backends/riscv_cfi.c
@@ -0,0 +1,75 @@
+/* RISC-V ABI-specified defaults for DWARF CFI.
+ 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"
+
+
+int
+riscv_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 (r2) as setup in the previous frame. */
+ DW_CFA_def_cfa, ULEB128_7 (2), ULEB128_7 (0),
+
+ /* The Stack Pointer (r2) is restored from CFA address by default. */
+ DW_CFA_val_offset, ULEB128_7 (2), ULEB128_7 (0),
+
+#define SV(n) DW_CFA_same_value, ULEB128_7 (n)
+ /* The return address register contains the return address setup by
+ caller. */
+ SV (1),
+
+ /* Callee-saved registers s0-s11, fs0-fs11. */
+ SV(8), SV (9), SV (18), SV (19), SV (20), SV (21),
+ SV (22), SV (23), SV (24), SV (25), SV (26), SV (27),
+
+ SV (40), SV (41), SV (50), SV (51), SV (52), SV (53),
+ SV (54), SV (55), SV (56), SV (57), SV (58), SV (59),
+#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 = 1; /* ra. */
+
+ return 0;
+}
diff --git a/backends/riscv_init.c b/backends/riscv_init.c
new file mode 100644
index 0000000..5588a6b
--- /dev/null
+++ b/backends/riscv_init.c
@@ -0,0 +1,62 @@
+/* Initialization of RISC-V 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 riscv_
+#define RELOC_PREFIX R_RISCV_
+#include "libebl_CPU.h"
+
+/* This defines the common reloc hooks based on riscv_reloc.def. */
+#include "common-reloc.c"
+
+
+const char *
+riscv_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 = "RISC-V";
+ riscv_init_reloc (eh);
+ HOOK (eh, reloc_simple_type);
+ HOOK (eh, register_info);
+ HOOK (eh, abi_cfi);
+ /* gcc/config/ #define DWARF_FRAME_REGISTERS. */
+ eh->frame_nregs = 66;
+ HOOK (eh, check_special_symbol);
+ HOOK (eh, machine_flag_check);
+
+ return MODVERSION;
+}
diff --git a/backends/riscv_regs.c b/backends/riscv_regs.c
new file mode 100644
index 0000000..7b577ca
--- /dev/null
+++ b/backends/riscv_regs.c
@@ -0,0 +1,177 @@
+/* Register names and numbers for RISC-V 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 <string.h>
+#include <dwarf.h>
+
+#define BACKEND riscv_
+#include "libebl_CPU.h"
+
+ssize_t
+riscv_register_info (Ebl *ebl, int regno, char *name, size_t namelen,
+ const char **prefix, const char **setname,
+ int *bits, int *type)
+{
+ if (name == NULL)
+ return 64;
+
+ *prefix = "";
+
+ if (regno < 32)
+ {
+ *setname = "integer";
+ *type = DW_ATE_signed;
+ *bits = ebl->class == ELFCLASS64 ? 64 : 32;
+ }
+ else
+ {
+ *setname = "FPU";
+ *type = DW_ATE_float;
+ *bits = 64;
+ }
+
+ switch (regno)
+ {
+ case 0:
+ return stpcpy (name, "zero") + 1 - name;
+
+ case 1:
+ *type = DW_ATE_address;
+ return stpcpy (name, "ra") + 1 - name;
+
+ case 2:
+ *type = DW_ATE_address;
+ return stpcpy (name, "sp") + 1 - name;
+
+ case 3:
+ *type = DW_ATE_address;
+ return stpcpy (name, "gp") + 1 - name;
+
+ case 4:
+ *type = DW_ATE_address;
+ return stpcpy (name, "tp") + 1 - name;
+
+ case 5 ... 7:
+ name[0] = 't';
+ name[1] = regno - 5 + '0';
+ namelen = 2;
+ break;
+
+ case 8 ... 9:
+ name[0] = 's';
+ name[1] = regno - 8 + '0';
+ namelen = 2;
+ break;
+
+ case 10 ... 17:
+ name[0] = 'a';
+ name[1] = regno - 10 + '0';
+ namelen = 2;
+ break;
+
+ case 18 ... 25:
+ name[0] = 's';
+ name[1] = regno - 18 + '2';
+ namelen = 2;
+ break;
+
+ case 26 ... 27:
+ name[0] = 's';
+ name[1] = '1';
+ name[1] = regno - 26 + '0';
+ namelen = 3;
+ break;
+
+ case 28 ... 31:
+ name[0] = 't';
+ name[1] = regno - 28 + '3';
+ namelen = 2;
+ break;
+
+ case 32 ... 39:
+ name[0] = 'f';
+ name[1] = 't';
+ name[2] = regno - 32 + '0';
+ namelen = 3;
+ break;
+
+ case 40 ... 41:
+ name[0] = 'f';
+ name[1] = 's';
+ name[2] = regno - 40 + '0';
+ namelen = 3;
+ break;
+
+ case 42 ... 49:
+ name[0] = 'f';
+ name[1] = 'a';
+ name[2] = regno - 42 + '0';
+ namelen = 3;
+ break;
+
+ case 50 ... 57:
+ name[0] = 'f';
+ name[1] = 's';
+ name[2] = regno - 50 + '2';
+ namelen = 3;
+ break;
+
+ case 58 ... 59:
+ name[0] = 'f';
+ name[1] = 's';
+ name[2] = '1';
+ name[3] = regno - 58 + '0';
+ namelen = 4;
+ break;
+
+ case 60 ... 61:
+ name[0] = 'f';
+ name[1] = 't';
+ name[2] = regno - 60 + '8';
+ namelen = 3;
+ break;
+
+ case 62 ... 63:
+ name[0] = 'f';
+ name[1] = 't';
+ name[2] = '1';
+ name[3] = regno - 62 + '0';
+ namelen = 4;
+ break;
+
+ default:
+ *setname = NULL;
+ return 0;
+ }
+
+ name[namelen++] = '\0';
+ return namelen;
+}
diff --git a/backends/riscv_reloc.def b/backends/riscv_reloc.def
new file mode 100644
index 0000000..2bd3513
--- /dev/null
+++ b/backends/riscv_reloc.def
@@ -0,0 +1,83 @@
+/* List the relocation types for RISC-V. -*- 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 (64, REL|EXEC|DYN)
+RELOC_TYPE (RELATIVE, EXEC|DYN)
+RELOC_TYPE (COPY, EXEC|DYN)
+RELOC_TYPE (JUMP_SLOT, EXEC|DYN)
+RELOC_TYPE (TLS_DTPMOD32, EXEC|DYN)
+RELOC_TYPE (TLS_DTPMOD64, EXEC|DYN)
+RELOC_TYPE (TLS_DTPREL32, EXEC|DYN)
+RELOC_TYPE (TLS_DTPREL64, EXEC|DYN)
+RELOC_TYPE (TLS_TPREL32, EXEC|DYN)
+RELOC_TYPE (TLS_TPREL64, EXEC|DYN)
+RELOC_TYPE (BRANCH, REL)
+RELOC_TYPE (JAL, REL)
+RELOC_TYPE (CALL, REL)
+RELOC_TYPE (CALL_PLT, REL)
+RELOC_TYPE (GOT_HI20, REL)
+RELOC_TYPE (TLS_GOT_HI20, REL)
+RELOC_TYPE (TLS_GD_HI20, REL)
+RELOC_TYPE (PCREL_HI20, REL)
+RELOC_TYPE (PCREL_LO12_I, REL)
+RELOC_TYPE (PCREL_LO12_S, REL)
+RELOC_TYPE (HI20, REL)
+RELOC_TYPE (LO12_I, REL)
+RELOC_TYPE (LO12_S, REL)
+RELOC_TYPE (TPREL_HI20, REL)
+RELOC_TYPE (TPREL_LO12_I, REL)
+RELOC_TYPE (TPREL_LO12_S, REL)
+RELOC_TYPE (TPREL_ADD, REL)
+RELOC_TYPE (ADD8, REL)
+RELOC_TYPE (ADD16, REL)
+RELOC_TYPE (ADD32, REL)
+RELOC_TYPE (ADD64, REL)
+RELOC_TYPE (SUB8, REL)
+RELOC_TYPE (SUB16, REL)
+RELOC_TYPE (SUB32, REL)
+RELOC_TYPE (SUB64, REL)
+RELOC_TYPE (GNU_VTINHERIT, REL)
+RELOC_TYPE (GNU_VTENTRY, REL)
+RELOC_TYPE (ALIGN, REL)
+RELOC_TYPE (RVC_BRANCH, REL)
+RELOC_TYPE (RVC_JUMP, REL)
+RELOC_TYPE (RVC_LUI, REL)
+RELOC_TYPE (GPREL_I, REL)
+RELOC_TYPE (GPREL_S, REL)
+RELOC_TYPE (TPREL_I, REL)
+RELOC_TYPE (TPREL_S, REL)
+RELOC_TYPE (RELAX, REL)
+RELOC_TYPE (SUB6, REL)
+RELOC_TYPE (SET6, REL)
+RELOC_TYPE (SET8, REL)
+RELOC_TYPE (SET16, REL)
+RELOC_TYPE (SET32, REL)
+RELOC_TYPE (32_PCREL, REL)
diff --git a/backends/riscv_symbol.c b/backends/riscv_symbol.c
new file mode 100644
index 0000000..dce8e35
--- /dev/null
+++ b/backends/riscv_symbol.c
@@ -0,0 +1,94 @@
+/* RISC-V 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 riscv_
+#include "libebl_CPU.h"
+
+
+/* Check for the simple reloc types. */
+Elf_Type
+riscv_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
+{
+ switch (type)
+ {
+ case R_RISCV_32:
+ return ELF_T_WORD;
+ case R_RISCV_64:
+ return ELF_T_XWORD;
+ default:
+ return ELF_T_NUM;
+ }
+}
+
+/* Check whether machine flags are valid. */
+bool
+riscv_machine_flag_check (GElf_Word flags)
+{
+ return ((flags &~ (EF_RISCV_RVC
+ | EF_RISCV_FLOAT_ABI)) == 0);
+}
+
+/* Check whether given symbol's st_value and st_size are OK despite failing
+ normal checks. */
+bool
+riscv_check_special_symbol (Elf *elf, GElf_Ehdr *ehdr, const GElf_Sym *sym,
+ const char *name, const GElf_Shdr *destshdr)
+{
+ if (name == NULL)
+ return false;
+
+ const char *sname = elf_strptr (elf, ehdr->e_shstrndx, destshdr->sh_name);
+ if (sname == NULL)
+ return false;
+
+ /* _GLOBAL_OFFSET_TABLE_ points to the start of the .got section, but it
+ is preceded by the .got.plt section in the output .got section. */
+ if (strcmp (name, "_GLOBAL_OFFSET_TABLE_") == 0)
+ return (strcmp (sname, ".got") == 0
+ && sym->st_value >= destshdr->sh_addr
+ && sym->st_value < destshdr->sh_addr + destshdr->sh_size);
+
+ /* __global_pointer$ points to the .sdata section with an offset of
+ 0x800. It might however fall in the .got section, in which case we
+ cannot check the offset. The size always should be zero. */
+ if (strcmp (name, "__global_pointer$") == 0)
+ return (((strcmp (sname, ".sdata") == 0
+ && sym->st_value == destshdr->sh_addr + 0x800)
+ || strcmp (sname, ".got") == 0)
+ && sym->st_size == 0);
+
+ return false;
+}
diff --git a/backends/s390_initreg.c b/backends/s390_initreg.c
index b4c4b67..23bf8ed 100644
--- a/backends/s390_initreg.c
+++ b/backends/s390_initreg.c
@@ -32,10 +32,10 @@
#include "system.h"
#include <assert.h>
-#ifdef __s390__
+#if defined(__s390__) && defined(__linux__)
# include <sys/user.h>
-# include <asm/ptrace.h>
# include <sys/ptrace.h>
+# include <asm/ptrace.h>
#endif
#define BACKEND s390_
@@ -46,7 +46,7 @@
ebl_tid_registers_t *setfunc __attribute__ ((unused)),
void *arg __attribute__ ((unused)))
{
-#ifndef __s390__
+#if !defined(__s390__) || !defined(__linux__)
return false;
#else /* __s390__ */
struct user user_regs;
diff --git a/backends/s390_retval.c b/backends/s390_retval.c
index a927d46..2043f98 100644
--- a/backends/s390_retval.c
+++ b/backends/s390_retval.c
@@ -87,7 +87,7 @@
typedie = dwarf_formref_die (attr, &die_mem);
tag = DWARF_TAG_OR_RETURN (typedie);
}
- /* Fall through. */
+ FALLTHROUGH;
case DW_TAG_base_type:
case DW_TAG_enumeration_type:
@@ -127,7 +127,7 @@
return size <= asize ? nloc_intreg : nloc_intregpair;
}
}
- /* Fall through. */
+ FALLTHROUGH;
case DW_TAG_structure_type:
case DW_TAG_class_type:
diff --git a/backends/sh_retval.c b/backends/sh_retval.c
index d44f260..33d7d96 100644
--- a/backends/sh_retval.c
+++ b/backends/sh_retval.c
@@ -84,7 +84,7 @@
typedie = dwarf_formref_die (attr, &die_mem);
tag = DWARF_TAG_OR_RETURN (typedie);
}
- /* Fall through. */
+ FALLTHROUGH;
case DW_TAG_base_type:
case DW_TAG_enumeration_type:
diff --git a/backends/sparc_attrs.c b/backends/sparc_attrs.c
index e95b577..974e8fb 100644
--- a/backends/sparc_attrs.c
+++ b/backends/sparc_attrs.c
@@ -41,33 +41,63 @@
const char *vendor, int tag, uint64_t value,
const char **tag_name, const char **value_name)
{
+ static const char *hwcaps[32] =
+ {
+ "mul32", "div32", "fsmuld", "v8plus", "popc", "vis", "vis2",
+ "asi_blk_init", "fmaf", "vis3", "hpc", "random", "trans",
+ "fjfmau", "ima", "asi_cache_sparing", "aes", "des", "kasumi",
+ "camellia", "md5", "sha1", "sha256", "sha512", "mpmul", "mont",
+ "pause", "cbcond", "crc32c", "resv30", "resv31"
+ };
+
+
+ static const char *hwcaps2[32] =
+ {
+ "fjathplus", "vis3b", "adp", "sparc5", "mwait", "xmpmul", "xmont",
+ "nsec", "resv8", "resv9" , "resv10", "resv11", "fjathhpc", "fjdes",
+ "fjaes", "resv15", "resv16", "resv17", "resv18", "resv19", "resv20",
+ "resv21", "resv22", "resv23", "resv24", "resv25", "resv26", "resv27",
+ "resv28", "resv29", "resv30", "resv31",
+ };
+
+ /* NAME should be big enough to hold any possible comma-separated
+ list (no repetitions allowed) of attribute names from one of the
+ arrays above. */
+ static char name[32*17+32+1];
+ name[0] = '\0';
+
if (!strcmp (vendor, "gnu"))
switch (tag)
{
case 4:
- *tag_name = "GNU_Sparc_HWCAPS";
- static const char *hwcaps[30] =
- {
- "mul32", "div32", "fsmuld", "v8plus", "popc", "vis", "vis2",
- "asi_blk_init", "fmaf", NULL, "vis3", "hpc", "random", "trans", "fjfmau",
- "ima", "asi_cache_sparing", "aes", "des", "kasumi", "camellia",
- "md5", "sha1", "sha256", "sha512", "mpmul", "mont", "pause",
- "cbcond", "crc32c"
- };
- if (value < 30 && hwcaps[value] != NULL)
- *value_name = hwcaps[value];
- return true;
-
case 8:
- *tag_name = "GNU_Sparc_HWCAPS2";
- static const char *hwcaps2[11] =
- {
- "fjathplus", "vis3b", "adp", "sparc5", "mwait", "xmpmul",
- "xmont", "nsec", "fjathhpc", "fjdes", "fjaes"
- };
- if (value < 11)
- *value_name = hwcaps2[value];
- return true;
+ {
+ const char **caps;
+ int cap;
+
+ if (tag == 4)
+ {
+ *tag_name = "GNU_Sparc_HWCAPS";
+ caps = hwcaps;
+ }
+ else
+ {
+ *tag_name = "GNU_Sparc_HWCAPS2";
+ caps = hwcaps2;
+ }
+
+ char *s = name;
+ for (cap = 0; cap < 32; cap++)
+ if (value & (1U << cap))
+ {
+ if (*s != '\0')
+ s = strcat (s, ",");
+ s = strcat (s, caps[cap]);
+ }
+
+ *value_name = s;
+ return true;
+ }
}
return false;
diff --git a/backends/sparc_initreg.c b/backends/sparc_initreg.c
index c2a9b32..c4b321c 100644
--- a/backends/sparc_initreg.c
+++ b/backends/sparc_initreg.c
@@ -45,7 +45,7 @@
ebl_tid_registers_t *setfunc __attribute__ ((unused)),
void *arg __attribute__ ((unused)))
{
-#ifndef __sparc__
+#if !defined(__sparc__) || !defined( __arch64__)
return false;
#else /* __sparc__ */
diff --git a/backends/sparc_reloc.def b/backends/sparc_reloc.def
index ce0b555..7cd5ce9 100644
--- a/backends/sparc_reloc.def
+++ b/backends/sparc_reloc.def
@@ -110,9 +110,9 @@
RELOC_TYPE (TLS_TPOFF64, DYN)
RELOC_TYPE (GOTDATA_HIX22, REL)
RELOC_TYPE (GOTDATA_LOX10, REL)
-RELOC_TYPE (GOTDATA_OP_HIX22, DYN)
-RELOC_TYPE (GOTDATA_OP_LOX10, DYN)
-RELOC_TYPE (GOTDATA_OP, DYN)
+RELOC_TYPE (GOTDATA_OP_HIX22, REL|DYN)
+RELOC_TYPE (GOTDATA_OP_LOX10, REL|DYN)
+RELOC_TYPE (GOTDATA_OP, REL|DYN)
RELOC_TYPE (H34, REL)
RELOC_TYPE (SIZE32, REL)
RELOC_TYPE (SIZE64, REL)
diff --git a/backends/sparc_retval.c b/backends/sparc_retval.c
index e1b1775..fb81cdc 100644
--- a/backends/sparc_retval.c
+++ b/backends/sparc_retval.c
@@ -91,7 +91,7 @@
typedie = dwarf_formref_die (attr, &die_mem);
tag = DWARF_TAG_OR_RETURN (typedie);
}
- /* Fall through. */
+ FALLTHROUGH;
case DW_TAG_base_type:
case DW_TAG_enumeration_type:
diff --git a/backends/tilegx_retval.c b/backends/tilegx_retval.c
index db81a20..7f7d24b 100644
--- a/backends/tilegx_retval.c
+++ b/backends/tilegx_retval.c
@@ -79,7 +79,7 @@
typedie = dwarf_formref_die (attr, &die_mem);
tag = DWARF_TAG_OR_RETURN (typedie);
}
- /* Fall through. */
+ FALLTHROUGH;
case DW_TAG_base_type:
case DW_TAG_enumeration_type:
@@ -113,7 +113,7 @@
return nloc_intreg;
}
- /* Else fall through. */
+ FALLTHROUGH;
case DW_TAG_structure_type:
case DW_TAG_class_type:
case DW_TAG_union_type:
diff --git a/backends/x86_64_init.c b/backends/x86_64_init.c
index cfd0158..adfa479 100644
--- a/backends/x86_64_init.c
+++ b/backends/x86_64_init.c
@@ -68,6 +68,7 @@
/* gcc/config/ #define DWARF_FRAME_REGISTERS. */
eh->frame_nregs = 17;
HOOK (eh, set_initial_registers_tid);
+ HOOK (eh, unwind);
return MODVERSION;
}
diff --git a/backends/x86_64_initreg.c b/backends/x86_64_initreg.c
index db9216e..50e9002 100644
--- a/backends/x86_64_initreg.c
+++ b/backends/x86_64_initreg.c
@@ -31,7 +31,7 @@
#endif
#include <stdlib.h>
-#ifdef __x86_64__
+#if defined(__x86_64__) && defined(__linux__)
# include <sys/user.h>
# include <sys/ptrace.h>
#endif
diff --git a/backends/x86_64_regs.c b/backends/x86_64_regs.c
index 2172d9f..ef987da 100644
--- a/backends/x86_64_regs.c
+++ b/backends/x86_64_regs.c
@@ -87,6 +87,7 @@
case 6 ... 7:
*type = DW_ATE_address;
+ FALLTHROUGH;
case 0 ... 5:
name[0] = 'r';
name[1] = baseregs[regno][0];
diff --git a/backends/x86_64_reloc.def b/backends/x86_64_reloc.def
index ad84efa..07a7c3d 100644
--- a/backends/x86_64_reloc.def
+++ b/backends/x86_64_reloc.def
@@ -61,3 +61,5 @@
RELOC_TYPE (TLSDESC_CALL, REL)
RELOC_TYPE (TLSDESC, REL|EXEC|DYN)
RELOC_TYPE (IRELATIVE, EXEC|DYN)
+RELOC_TYPE (GOTPCRELX, REL)
+RELOC_TYPE (REX_GOTPCRELX, REL)
diff --git a/backends/x86_64_retval.c b/backends/x86_64_retval.c
index b3799ae..f9114cb 100644
--- a/backends/x86_64_retval.c
+++ b/backends/x86_64_retval.c
@@ -100,7 +100,7 @@
typedie = dwarf_formref_die (attr, &die_mem);
tag = DWARF_TAG_OR_RETURN (typedie);
}
- /* Fall through. */
+ FALLTHROUGH;
case DW_TAG_base_type:
case DW_TAG_enumeration_type:
diff --git a/backends/x86_64_unwind.c b/backends/x86_64_unwind.c
new file mode 100644
index 0000000..ade64c0
--- /dev/null
+++ b/backends/x86_64_unwind.c
@@ -0,0 +1,86 @@
+/* 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
+
+#include <stdlib.h>
+#include <assert.h>
+
+#define BACKEND x86_64_
+#include "libebl_CPU.h"
+
+/* There was no CFI. Maybe we happen to have a frame pointer and can unwind from that? */
+
+bool
+x86_64_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)))
+{
+ // Register 6 is supposed to be rbp, thus the conventional frame pointer
+ const int fpReg = 6;
+ const int spReg = 7;
+
+ Dwarf_Word fp;
+ if (!getfunc(fpReg, 1, &fp, arg) || fp == 0)
+ return false;
+
+ // Try to read old sp, so that we can avoid infinite loops below
+ Dwarf_Word sp;
+ if (!getfunc(spReg, 1, &sp, arg))
+ sp = 0;
+
+ Dwarf_Word prev_fp;
+ if (!readfunc(fp, &prev_fp, arg))
+ prev_fp = 0;
+
+ Dwarf_Word ret;
+ if (!readfunc(fp + 8, &ret, arg))
+ return false;
+
+ if (!setfunc(fpReg, 1, &prev_fp, arg))
+ return false;
+
+ fp += 16; // Pop fp and return address and write result to sp
+ if (!setfunc(spReg, 1, &fp, arg))
+ return false;
+
+ if (!setfunc(-1, 1, &ret, arg))
+ return false;
+
+ // If the sp didn't move up we don't actually have a new stack
+ // frame but rather some random data that doesn't include frame
+ // pointers. Break the unwinding then.
+ if (sp >= fp)
+ return false;
+
+ return true;
+}
diff --git a/config.h b/config.h
index f5a11b3..4bfca0b 100644
--- a/config.h
+++ b/config.h
@@ -7,12 +7,37 @@
/* Should ar and ranlib use -D behavior by default? */
#define DEFAULT_AR_DETERMINISTIC false
+/* Define to 1 if you have the declaration of `mempcpy', and to 0 if you
+ don't. */
+#define HAVE_DECL_MEMPCPY 1
+
+/* Define to 1 if you have the declaration of `memrchr', and to 0 if you
+ don't. */
+#define HAVE_DECL_MEMRCHR 1
+
+/* Define to 1 if you have the declaration of `powerof2', and to 0 if you
+ don't. */
+#define HAVE_DECL_POWEROF2 1
+
+/* Define to 1 if you have the declaration of `rawmemchr', and to 0 if you
+ don't. */
+#define HAVE_DECL_RAWMEMCHR 1
+
+/* Defined if __attribute__((fallthrough)) is supported */
+/* #undef HAVE_FALLTHROUGH */
+
+/* Defined if __attribute__((gcc_struct)) is supported */
+/* #undef HAVE_GCC_STRUCT */
+
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
+/* Define to 1 if you have the `process_vm_readv' function. */
+#define HAVE_PROCESS_VM_READV 1
+
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
@@ -37,35 +62,35 @@
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
+/* Defined if __attribute__((visibility())) is supported */
+#define HAVE_VISIBILITY 1
+
/* $libdir subdirectory containing libebl modules. */
#define LIBEBL_SUBDIR "elfutils"
/* Identifier for modules in the build. */
-#define MODVERSION "Build for elfutils 165 x86_64-unknown-linux-gnu"
-
-/* Define to 32 or 64 if a specific implementation is wanted. */
-/* #undef NATIVE_ELF */
+#define MODVERSION "Build for elfutils 173 x86_64-pc-linux-gnu"
/* Name of package */
#define PACKAGE "elfutils"
/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "https://bugzilla.redhat.com/"
+#define PACKAGE_BUGREPORT "https://sourceware.org/bugzilla"
/* Define to the full name of this package. */
#define PACKAGE_NAME "elfutils"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "elfutils 0.165"
+#define PACKAGE_STRING "elfutils 0.173"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "elfutils"
/* Define to the home page for this package. */
-#define PACKAGE_URL ""
+#define PACKAGE_URL "http://elfutils.org/"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "0.165"
+#define PACKAGE_VERSION "0.173"
/* The size of `long', as computed by sizeof. */
#if __LP64__
@@ -93,7 +118,7 @@
#define USE_ZLIB 1
/* Version number of package */
-#define VERSION "0.165"
+#define VERSION "0.173"
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */
diff --git a/config/ChangeLog b/config/ChangeLog
index 8e20f1e..0e9cc28 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,73 @@
+2018-06-11 Mark Wielaard <mark@klomp.org>
+
+ * elfutils.spec.in: Update for 0.172.
+
+2018-06-01 Mark Wielaard <mark@klomp.org>
+
+ * elfutils.spec.in: Update for 0.171.
+
+2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
+
+ * eu.am (IMPLICIT_FALLTHROUGH_WARNING): Set to 5.
+
+2017-11-02 Mark Wielaard <mark@klomp.org>
+
+ * elfutils.spec.in: Config files under /usr/lib/sysctl.d (_sysctldir)
+ aren't %config.
+
+2017-10-24 Mark Wielaard <mark@klomp.org>
+
+ * eu.am (AM_CFLAGS): Handle -Wno-packed-not-aligned.
+
+2017-04-27 Ulf Hermann <ulf.hermann@qt.io>
+
+ * eu.am: Use fpic_CFLAGS.
+
+2016-08-02 Mark Wielaard <mark@klomp.org>
+
+ * elfutils.spec.in: Update for 0.170.
+
+2017-05-05 Mark Wielaard <mark@klomp.org>
+
+ * elfutils.spec.in: Update for 0.169.
+
+2016-12-27 Mark Wielaard <mjw@redhat.com>
+
+ * elfutils.spec.in: Update for 0.168 and new project location.
+
+2016-12-24 Mark Wielaard <mark@klomp.org>
+
+ * libdw.pc.in: Set URL to http://elfutils.org/
+ * libelf.pc.in: Likewise.
+
+2016-11-02 Mark Wielaard <mjw@redhat.com>
+
+ * eu.am: Check HAVE_IMPLICIT_FALLTHROUGH_WARNING.
+ (AM_CFLAGS): Add IMPLICIT_FALLTHROUGH_WARNING.
+
+2016-08-04 Mark Wielaard <mjw@redhat.com>
+
+ * elfutils.spec.in: Update for 0.167.
+
+2016-07-06 Mark Wielaard <mjw@redhat.com>
+
+ * elfutils.spec.in: Remove eu-ld.
+
+2016-03-31 Mark Wielaard <mjw@redhat.com>
+
+ * elfutils.spec.in: Update for 0.166.
+
+2016-02-13 Mark Wielaard <mjw@redhat.com>
+
+ * eu.am: Check HAVE_NULL_DEREFERENCE_WARNING.
+ (AM_CFLAGS): Add NULL_DEREFERENCE_WARNING.
+
+2016-02-09 Mark Wielaard <mjw@redhat.com>
+
+ * eu.am: Check SANE_LOGICAL_OP_WARNING and
+ HAVE_DUPLICATED_COND_WARNING.
+ (AM_CFLAGS): Add LOGICAL_OP_WARNING and DUPLICATED_COND_WARNING.
+
2016-01-08 Mark Wielaard <mjw@redhat.com>
* elfutils.spec.in: Add elfcompress. Update for 0.165.
diff --git a/config/elfutils.spec.in b/config/elfutils.spec.in
index 693c262..b64cc28 100644
--- a/config/elfutils.spec.in
+++ b/config/elfutils.spec.in
@@ -1,11 +1,12 @@
# -*- rpm-spec-*-
-Summary: A collection of utilities and DSOs to handle compiled objects
+Summary: A collection of utilities and DSOs to handle ELF files and DWARF data
Name: elfutils
Version: @PACKAGE_VERSION@
Release: 1
+URL: http://elfutils.org/
License: GPLv3+ and (GPLv2+ or LGPLv3+)
Group: Development/Tools
-Source: elfutils-%{version}.tar.bz2
+Source: ftp://sourceware.org/pub/elfutils/%{version}/elfutils-%{version}.tar.bz2
Obsoletes: libelf libelf-devel
Requires: elfutils-libelf = %{version}-%{release}
Requires: glibc >= 2.7
@@ -134,7 +135,6 @@
# XXX Nuke unpackaged files
{ cd ${RPM_BUILD_ROOT}
- rm -f .%{_bindir}/eu-ld
rm -f .%{_includedir}/elfutils/libasm.h
rm -f .%{_libdir}/libasm.so
rm -f .%{_libdir}/libasm.a
@@ -176,7 +176,6 @@
%{_bindir}/eu-ar
%{_bindir}/eu-unstrip
%{_bindir}/eu-make-debug-archive
-#%{_bindir}/eu-ld
%{_bindir}/eu-elfcompress
%{_libdir}/libasm-%{version}.so
%{_libdir}/libdw-%{version}.so
@@ -225,9 +224,79 @@
%{_libdir}/libelf.a
%files default-yama-scope
-%config(noreplace) %{_sysctldir}/10-default-yama-scope.conf
+%{_sysctldir}/10-default-yama-scope.conf
%changelog
+* Fri Jun 29 2018 Mark Wielaard,,, <mark@klomp.org> 0.173-1
+- More fixes for crashes and hangs found by afl-fuzz. In particular
+ various functions now detect and break infinite loops caused by bad
+ DIE tree cycles.
+- readelf: Will now lookup the size and signedness of constant value
+ types to display them correctly (and not just how they were encoded).
+- libdw: New function dwarf_next_lines to read CU-less .debug_line data.
+ dwarf_begin_elf now accepts ELF files containing just .debug_line
+ or .debug_frame sections (which can be read without needing a DIE
+ tree from the .debug_info section).
+ Removed dwarf_getscn_info, which was never implemented.
+- backends: Handle BPF simple relocations.
+ The RISCV backends now handles ABI specific CFI and knows about
+ RISCV register types and names.
+
+* Mon Jun 11 2018 Mark Wielaard <mark@klomp.org> 0.172-1
+- No functional changes compared to 0.171.
+- Various bug fixes in libdw and eu-readelf dealing with bad DWARF5
+ data. Thanks to running the afl fuzzer on eu-readelf and various
+ testcases.
+- eu-readelf -N is ~15% faster.
+
+* Fri Jun 01 2018 Mark Wielaard <mark@klomp.org> 0.171-1
+- DWARF5 and split dwarf, including GNU DebugFission, support.
+- readelf: Handle all new DWARF5 sections.
+ --debug-dump=info+ will show split unit DIEs when found.
+ --dwarf-skeleton can be used when inspecting a .dwo file.
+ Recognizes GNU locviews with --debug-dump=loc.
+- libdw: New functions dwarf_die_addr_die, dwarf_get_units,
+ dwarf_getabbrevattr_data and dwarf_cu_info.
+ libdw will now try to resolve the alt file on first use
+ when not set yet with dwarf_set_alt.
+ dwarf_aggregate_size() now works with multi-dimensional arrays.
+- libdwfl: Use process_vm_readv when available instead of ptrace.
+- backends: Add a RISC-V backend.
+
+* Wed Aug 2 2017 Mark Wielaard <mark@klomp.org> 0.170-1
+- libdw: Added new DWARF5 attribute, tag, character encoding,
+ language code, calling convention, defaulted member function
+ and macro constants to dwarf.h.
+ New functions dwarf_default_lower_bound and dwarf_line_file.
+ dwarf_peel_type now handles DWARF5 immutable, packed and shared tags.
+ dwarf_getmacros now handles DWARF5 .debug_macro sections.
+- strip: Add -R, --remove-section=SECTION and --keep-section=SECTION.
+- backends: The bpf disassembler is now always build on all platforms.
+
+* Fri May 5 2017 Mark Wielaard <mark@klomp.org> 0.169-1
+- backends: Add support for EM_PPC64 GNU_ATTRIBUTES.
+ Frame pointer unwinding fallback support for i386, x86_64, aarch64.
+- translations: Update Polish translation.
+
+* Tue Dec 27 2016 Mark Wielaard <mark@klomp.org> 0.168-1
+- http://elfutils.org/ is now hosted at http://sourceware.org/elfutils/
+- libelf: gelf_newehdr and gelf_newehdr now return void *.
+- libdw: dwarf.h corrected the DW_LANG_PLI constant name (was DW_LANG_PL1).
+- readelf: Add optional --symbols[=SECTION] argument to select section name.
+
+* Thu Aug 4 2016 Mark Wielaard <mjw@redhat.com> 0.167-1
+- libasm: Add eBPF disassembler for EM_BPF files.
+- backends: Add m68k and BPF backends.
+- ld: Removed.
+- dwelf: Add ELF/DWARF string table creation functions.
+ dwelf_strtab_init, dwelf_strtab_add, dwelf_strtab_add_len,
+ dwelf_strtab_finalize, dwelf_strent_off, dwelf_strent_str and
+ dwelf_strtab_free.
+
+* Thu Mar 31 2016 Mark Wielaard <mjw@redhat.com> 0.166-1
+- config: The default program prefix for the installed tools is now
+ eu-. Use configure --program-prefix="" to not use a program prefix.
+
* Fri Jan 8 2016 Mark Wielaard <mjw@redhat.com> 0.165-1
- elfcompress: New utility to compress or decompress ELF sections.
- readelf: Add -z,--decompress option.
diff --git a/config/eu.am b/config/eu.am
index 0095da5..c2cc349 100644
--- a/config/eu.am
+++ b/config/eu.am
@@ -1,6 +1,6 @@
## Common automake fragments for elfutils subdirectory makefiles.
##
-## Copyright (C) 2010, 2014 Red Hat, Inc.
+## Copyright (C) 2010, 2014, 2016 Red Hat, Inc.
##
## This file is part of elfutils.
##
@@ -42,11 +42,41 @@
else
STACK_USAGE_WARNING=
endif
+
+if SANE_LOGICAL_OP_WARNING
+LOGICAL_OP_WARNING=-Wlogical-op
+else
+LOGICAL_OP_WARNING=
+endif
+
+if HAVE_DUPLICATED_COND_WARNING
+DUPLICATED_COND_WARNING=-Wduplicated-cond
+else
+DUPLICATED_COND_WARNING=
+endif
+
+if HAVE_NULL_DEREFERENCE_WARNING
+NULL_DEREFERENCE_WARNING=-Wnull-dereference
+else
+NULL_DEREFERENCE_WARNING=
+endif
+
+if HAVE_IMPLICIT_FALLTHROUGH_WARNING
+# Use strict fallthrough. Only __attribute__((fallthrough)) will prevent the
+# warning
+IMPLICIT_FALLTHROUGH_WARNING=-Wimplicit-fallthrough=5
+else
+IMPLICIT_FALLTHROUGH_WARNING=
+endif
+
AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
-Wold-style-definition -Wstrict-prototypes \
+ $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
+ $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \
$(if $($(*F)_no_Werror),,-Werror) \
$(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
$(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
+ $(if $($(*F)_no_Wpacked_not_aligned),-Wno-packed-not-aligned,) \
$($(*F)_CFLAGS)
COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
@@ -59,14 +89,14 @@
%.os: %.c %.o
if AMDEP
- $(AM_V_CC)if $(COMPILE.os) -c -o $@ -fPIC $(DEFS.os) -MT $@ -MD -MP \
+ $(AM_V_CC)if $(COMPILE.os) -c -o $@ $(fpic_CFLAGS) $(DEFS.os) -MT $@ -MD -MP \
-MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \
then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \
rm -f "$(DEPDIR)/$*.Tpo"; \
else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
fi
else
- $(AM_V_CC)$(COMPILE.os) -c -o $@ -fPIC $(DEFS.os) $<
+ $(AM_V_CC)$(COMPILE.os) -c -o $@ $(fpic_CFLAGS) $(DEFS.os) $<
endif
CLEANFILES = *.gcno *.gcda
diff --git a/config/libdw.pc.in b/config/libdw.pc.in
index b7dc002..3fc283d 100644
--- a/config/libdw.pc.in
+++ b/config/libdw.pc.in
@@ -6,7 +6,7 @@
Name: libdw
Description: elfutils library for DWARF data and ELF file or process inspection
Version: @VERSION@
-URL: https://fedorahosted.org/elfutils/
+URL: http://elfutils.org/
Libs: -L${libdir} -ldw
Cflags: -I${includedir}
diff --git a/config/libelf.pc.in b/config/libelf.pc.in
index 1fc7e4c..48f3f02 100644
--- a/config/libelf.pc.in
+++ b/config/libelf.pc.in
@@ -6,7 +6,7 @@
Name: libelf
Description: elfutils libelf library to read and write ELF files
Version: @VERSION@
-URL: https://fedorahosted.org/elfutils/
+URL: http://elfutils.org/
Libs: -L${libdir} -lelf
Cflags: -I${includedir}
diff --git a/configure.ac b/configure.ac
index 9a3301f..1cf6245 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
dnl Configure input file for elfutils. -*-autoconf-*-
dnl
-dnl Copyright (C) 1996-2016 Red Hat, Inc.
+dnl Copyright (C) 1996-2018 Red Hat, Inc.
dnl
dnl This file is part of elfutils.
dnl
@@ -17,12 +17,31 @@
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
-AC_INIT([elfutils],[0.165],[https://bugzilla.redhat.com/],[elfutils])
+AC_INIT([elfutils],[0.173],[https://sourceware.org/bugzilla],[elfutils],[http://elfutils.org/])
+
+dnl Workaround for older autoconf < 2.64
+m4_ifndef([AC_PACKAGE_URL],
+ [AC_DEFINE([PACKAGE_URL], ["http://elfutils.org/"],
+ [Define to home page for this package])
+ AC_SUBST([PACKAGE_URL], ["http://elfutils.org/"])])
+
+# We want eu- as default program prefix if none was given by the user.
+# But if the user explicitly provided --program-prefix="" then pretend
+# it wasn't set at all (NONE). We want to test this really early before
+# configure has a chance to use the value.
+
+if test "x$program_prefix" = "xNONE"; then
+ AC_MSG_NOTICE([No --program-prefix given, using "eu-"])
+ program_prefix="eu-"
+elif test "x$program_prefix" = "x"; then
+ AC_MSG_NOTICE([Using no program-prefix])
+ program_prefix=NONE
+fi
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_FILES([config/Makefile])
-AC_COPYRIGHT([Copyright (C) 1996-2016 Red Hat, Inc.])
+AC_COPYRIGHT([Copyright (C) 1996-2018 The elfutils developers.])
AC_PREREQ(2.63) dnl Minimum Autoconf version required.
dnl We use GNU make extensions; automake 1.10 defaults to -Wportability.
@@ -108,13 +127,94 @@
AS_IF([test "x$ac_cv_c99" != xyes],
AC_MSG_ERROR([gcc with GNU99 support required]))
+AC_CACHE_CHECK([whether gcc supports __attribute__((visibility()))],
+ ac_cv_visibility, [dnl
+save_CFLAGS="$CFLAGS"
+CFLAGS="$save_CFLAGS -Werror"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([dnl
+int __attribute__((visibility("hidden")))
+foo (int a)
+{
+ return a;
+}])], ac_cv_visibility=yes, ac_cv_visibility=no)
+CFLAGS="$save_CFLAGS"])
+if test "$ac_cv_visibility" = "yes"; then
+ AC_DEFINE([HAVE_VISIBILITY], [1],
+ [Defined if __attribute__((visibility())) is supported])
+fi
+
+AC_CACHE_CHECK([whether gcc supports __attribute__((gcc_struct))],
+ ac_cv_gcc_struct, [dnl
+save_CFLAGS="$CFLAGS"
+CFLAGS="$save_CFLAGS -Werror"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([dnl
+struct test { int x; } __attribute__((gcc_struct));
+])], ac_cv_gcc_struct=yes, ac_cv_gcc_struct=no)
+CFLAGS="$save_CFLAGS"])
+if test "$ac_cv_gcc_struct" = "yes"; then
+ AC_DEFINE([HAVE_GCC_STRUCT], [1],
+ [Defined if __attribute__((gcc_struct)) is supported])
+fi
+
+AC_CACHE_CHECK([whether gcc supports -fPIC], ac_cv_fpic, [dnl
+save_CFLAGS="$CFLAGS"
+CFLAGS="$save_CFLAGS -fPIC -Werror"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE()], ac_cv_fpic=yes, ac_cv_fpic=no)
+CFLAGS="$save_CFLAGS"
+])
+if test "$ac_cv_fpic" = "yes"; then
+ fpic_CFLAGS="-fPIC"
+else
+ fpic_CFLAGS=""
+fi
+AC_SUBST([fpic_CFLAGS])
+
+AC_CACHE_CHECK([whether gcc supports -fPIE], ac_cv_fpie, [dnl
+save_CFLAGS="$CFLAGS"
+CFLAGS="$save_CFLAGS -fPIE -Werror"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE()], ac_cv_fpie=yes, ac_cv_fpie=no)
+CFLAGS="$save_CFLAGS"
+])
+if test "$ac_cv_fpie" = "yes"; then
+ fpie_CFLAGS="-fPIE"
+else
+ fpie_CFLAGS=""
+fi
+AC_SUBST([fpie_CFLAGS])
+
+dso_LDFLAGS="-shared"
+
+ZDEFS_LDFLAGS="-Wl,-z,defs"
+AC_CACHE_CHECK([whether gcc supports $ZDEFS_LDFLAGS], ac_cv_zdefs, [dnl
+save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$ZDEFS_LDFLAGS $save_LDFLAGS"
+AC_LINK_IFELSE([AC_LANG_PROGRAM()], ac_cv_zdefs=yes, ac_cv_zdefs=no)
+LDFLAGS="$save_LDFLAGS"
+])
+if test "$ac_cv_zdefs" = "yes"; then
+ dso_LDFLAGS="$dso_LDFLAGS $ZDEFS_LDFLAGS"
+fi
+
+ZRELRO_LDFLAGS="-Wl,-z,relro"
+AC_CACHE_CHECK([whether gcc supports $ZRELRO_LDFLAGS], ac_cv_zrelro, [dnl
+save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$ZRELRO_LDFLAGS $save_LDFLAGS"
+AC_LINK_IFELSE([AC_LANG_PROGRAM()], ac_cv_zrelro=yes, ac_cv_zrelro=no)
+LDFLAGS="$save_LDFLAGS"
+])
+if test "$ac_cv_zrelro" = "yes"; then
+ dso_LDFLAGS="$dso_LDFLAGS $ZRELRO_LDFLAGS"
+fi
+
+AC_SUBST([dso_LDFLAGS])
+
AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl
# Use the same flags that we use for our DSOs, so the test is representative.
# Some old compiler/linker/libc combinations fail some ways and not others.
save_CFLAGS="$CFLAGS"
save_LDFLAGS="$LDFLAGS"
-CFLAGS="-fPIC $CFLAGS"
-LDFLAGS="-shared -Wl,-z,defs,-z,relro $LDFLAGS"
+CFLAGS="$fpic_CFLAGS $CFLAGS"
+LDFLAGS="$dso_LDFLAGS $LDFLAGS"
AC_LINK_IFELSE([dnl
AC_LANG_PROGRAM([[#include <stdlib.h>
#undef __thread
@@ -131,35 +231,35 @@
dnl whether functions and headers are available, whether they work, etc.
AC_SYS_LARGEFILE
-dnl Enable the linker to be build as a native-only linker. By default it
-dnl can handle all architectures but this comes at a cost. A native
-dnl will be slightly faster, small, and has fewer dependencies.
-native_ld=no
-AC_ARG_ENABLE([generic],
-AS_HELP_STRING([--disable-generic], [do not build generic linker]), [dnl
-if test "$enable_generic" = no; then
- case "$host_cpu" in
- i?86)
- AC_DEFINE(NATIVE_ELF, 32)
- native_ld=yes
- base_cpu=i386
+dnl Older glibc had a broken fts that didn't work with Large File Systems.
+dnl We want the version that can handler LFS, but include workaround if we
+dnl get a bad one. Add define to CFLAGS (not AC_DEFINE it) since we need to
+dnl check it before including config.h (which might define _FILE_OFFSET_BITS).
+AC_CACHE_CHECK([whether fts.h is bad when included (with LFS)], ac_cv_bad_fts,
+ [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <fts.h>]])],
+ ac_cv_bad_fts=no, ac_cv_bad_fts=yes)])
+AS_IF([test "x$ac_cv_bad_fts" = "xyes"], [CFLAGS="$CFLAGS -DBAD_FTS=1"])
+
+# See if we can add -D_FORTIFY_SOURCE=2. Don't do it if it is already
+# (differently) defined or if it generates warnings/errors because we
+# don't use the right optimisation level (string.h will warn about that).
+AC_MSG_CHECKING([whether to add -D_FORTIFY_SOURCE=2 to CFLAGS])
+case "$CFLAGS" in
+ *-D_FORTIFY_SOURCE=2*)
+ AC_MSG_RESULT([no, already there])
;;
- *)
- AC_MSG_ERROR([no machine-specific linker for this configuration available])
- ;;
- esac
-fi])
-AH_TEMPLATE([NATIVE_ELF],
-[Define to 32 or 64 if a specific implementation is wanted.])
-AM_CONDITIONAL(NATIVE_LD, test "$native_ld" = yes)
-dnl The automake generated Makefile cannot deal with macros in the name
-dnl of files if at any time there is no such file, even if the filename
-dnl would not be used.
-AS_IF([test -z "$base_cpu"], [base_cpu=none])
-AC_SUBST(base_cpu)
-dnl Support to work around automake's inflexible dependency generation.
-dnl See src/Makefile.am for more information.
-AM_CONDITIONAL(NEVER, false)
+ *)
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="-D_FORTIFY_SOURCE=2 -Werror $CFLAGS"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+ #include <string.h>
+ int main() { return 0; }
+ ]])], [ AC_MSG_RESULT([yes])
+ CFLAGS="-D_FORTIFY_SOURCE=2 $save_CFLAGS" ],
+ [ AC_MSG_RESULT([no])
+ CFLAGS="$save_CFLAGS"])
+ ;;
+esac
dnl enable debugging of branch prediction.
AC_ARG_ENABLE([debugpred],
@@ -262,6 +362,16 @@
LIBS="$save_LIBS"
AC_SUBST([zip_LIBS])
+AC_CHECK_DECLS([memrchr, rawmemchr],[],[],
+ [#define _GNU_SOURCE
+ #include <string.h>])
+AC_CHECK_DECLS([powerof2],[],[],[#include <sys/param.h>])
+AC_CHECK_DECLS([mempcpy],[],[],
+ [#define _GNU_SOURCE
+ #include <string.h>])
+
+AC_CHECK_FUNCS([process_vm_readv])
+
AC_CHECK_LIB([stdc++], [__cxa_demangle], [dnl
AC_DEFINE([USE_DEMANGLE], [1], [Defined if demangling is enabled])])
AM_CONDITIONAL(DEMANGLE, test "x$ac_cv_lib_stdcpp___cxa_demangle" = "xyes")
@@ -278,6 +388,21 @@
AC_ARG_ENABLE([symbol-versioning],
AS_HELP_STRING([--disable-symbol-versioning],
[Disable symbol versioning in shared objects]))
+
+AC_CACHE_CHECK([whether symbol versioning is supported], ac_cv_symbol_versioning, [dnl
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([dnl
+#define NEW_VERSION(name, version) \
+ asm (".symver " #name "," #name "@@@" #version);
+int foo(int x) { return x + 1; }
+NEW_VERSION (foo, ELFUTILS_12.12)
+])], ac_cv_symbol_versioning=yes, ac_cv_symbol_versioning=no)])
+if test "$ac_cv_symbol_versioning" = "no"; then
+ if test "x$enable_symbol_versioning" != "xno"; then
+ AC_MSG_ERROR([Symbol versioning is not supported.
+ Use --disable-symbol-versioning to build without.])
+ fi
+fi
+
AM_CONDITIONAL(SYMBOL_VERSIONING, [test "x$enable_symbol_versioning" != "xno"])
AS_IF([test "x$enable_symbol_versioning" = "xno"],
[AC_MSG_WARN([Disabling symbol versioning breaks ABI compatibility.])
@@ -285,17 +410,65 @@
AC_CACHE_CHECK([whether gcc accepts -Wstack-usage], ac_cv_stack_usage, [dnl
old_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -Wstack-usage=262144"
+CFLAGS="$CFLAGS -Wstack-usage=262144 -Werror"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],
ac_cv_stack_usage=yes, ac_cv_stack_usage=no)
CFLAGS="$old_CFLAGS"])
AM_CONDITIONAL(ADD_STACK_USAGE_WARNING, [test "x$ac_cv_stack_usage" != "xno"])
+# -Wlogical-op was too fragile in the past, make sure we get a sane one.
+AC_CACHE_CHECK([whether gcc has a sane -Wlogical-op], ac_cv_logical_op, [dnl
+old_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wlogical-op -Werror"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE(
+ [#define FLAG 1
+ int f (int r, int f) { return (r && (FLAG || (FLAG & f))); }])],
+ ac_cv_logical_op=yes, ac_cv_logical_op=no)
+CFLAGS="$old_CFLAGS"])
+AM_CONDITIONAL(SANE_LOGICAL_OP_WARNING,
+ [test "x$ac_cv_logical_op" != "xno"])
+
+# -Wduplicated-cond was added by GCC6
+AC_CACHE_CHECK([whether gcc accepts -Wduplicated-cond], ac_cv_duplicated_cond, [dnl
+old_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wduplicated-cond -Werror"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],
+ ac_cv_duplicated_cond=yes, ac_cv_duplicated_cond=no)
+CFLAGS="$old_CFLAGS"])
+AM_CONDITIONAL(HAVE_DUPLICATED_COND_WARNING,
+ [test "x$ac_cv_duplicated_cond" != "xno"])
+
+# -Wnull-dereference was added by GCC6
+AC_CACHE_CHECK([whether gcc accepts -Wnull-dereference], ac_cv_null_dereference, [dnl
+old_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wnull-dereference -Werror"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],
+ ac_cv_null_dereference=yes, ac_cv_null_dereference=no)
+CFLAGS="$old_CFLAGS"])
+AM_CONDITIONAL(HAVE_NULL_DEREFERENCE_WARNING,
+ [test "x$ac_cv_null_dereference" != "xno"])
+
+# -Wimplicit-fallthrough was added by GCC7
+AC_CACHE_CHECK([whether gcc accepts -Wimplicit-fallthrough], ac_cv_implicit_fallthrough, [dnl
+old_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wimplicit-fallthrough -Werror"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],
+ ac_cv_implicit_fallthrough=yes, ac_cv_implicit_fallthrough=no)
+CFLAGS="$old_CFLAGS"])
+AM_CONDITIONAL(HAVE_IMPLICIT_FALLTHROUGH_WARNING,
+ [test "x$ac_cv_implicit_fallthrough" != "xno"])
+
+# Assume the fallthrough attribute is supported if -Wimplict-fallthrough is supported
+if test "$ac_cv_implicit_fallthrough" = "yes"; then
+ AC_DEFINE([HAVE_FALLTHROUGH], [1],
+ [Defined if __attribute__((fallthrough)) is supported])
+fi
+
dnl Check if we have argp available from our libc
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[#include <argp.h>],
- [int argc=1; char *argv[]={"test"}; argp_parse(0,argc,argv,0,0,0); return 0;]
+ [int argc=1; char *argv[]={"test"}; argp_parse(0,argc,&argv,0,0,0); return 0;]
)],
[libc_has_argp="true"],
[libc_has_argp="false"]
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 76b5753..fbe34a8 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,107 @@
+2018-06-01 Mark Wielaard <mark@klomp.org>
+
+ * printversion.c (print_version): Update copyright year.
+
+2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
+
+ * eu-config.h (FALLTHROUGH): New macro.
+
+2017-10-16 Mark Wielaard <mark@klomp.org>
+
+ * md5.{c,h}: Removed.
+ * sha1.{c,h}: Likewise.
+ * Makefile.am (libeu_a_SOURCES): Remove md5.c and sha1.c.
+ (noinst_HEADERS): Remove md5.h and sha1.h.
+
+2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
+
+ * eu-config.h: Define attribute_packed to either
+ __attribute__((packed)) or __attribute__((packed, gcc_struct)).
+
+2017-04-27 Ulf Hermann <ulf.hermann@qt.io>
+
+ * eu-config.h: Define attribute_hidden to be empty if the compiler
+ doesn't support it.
+
+2017-04-27 Ulf Hermann <ulf.hermann@qt.io>
+
+ * Makefile.am: Use fpic_CFLAGS.
+
+2017-07-18 Mark Wielaard <mark@klomp.org>
+
+ * bpf.h: New file.
+ * Makefile.am (noinst_HEADERS): Add bpf.h
+
+2017-05-05 Mark Wielaard <mark@klomp.org>
+
+ * printversion.c (print_version): Update copyright year.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * crc32.c: include config.h.
+ * system.h: Don't include config.h.
+
+2017-02-16 Ulf Hermann <ulf.hermann@qt.io>
+
+ * Makefile.am (libeu_a_SOURCES): Remove version.c, add printversion.c
+ (noinst_HEADERS): Add printversion.h
+ * version.c: Moved to printversion.c.
+ * printversion.c: New file, moved from version.c,
+ remove stdio.h, argp.h, system.h includes,
+ add printversion.h include.
+ * printversion.h: New file.
+ * system.h: Remove argp.h include,
+ (ARGP_PROGRAM_VERSION_HOOK_DEF, ARGP_PROGRAM_BUG_ADDRESS_DEF): Remove.
+ (print_version): Remove.
+
+2017-02-15 Ulf Hermann <ulf.hermann@qt.io>
+
+ * system.h: Provide mempcpy if it doesn't exist.
+ * xstrndup.c: Include system.h.
+
+2017-02-15 Ulf Hermann <ulf.hermann@qt.io>
+
+ * crc32_file.c: Use _SC_PAGESIZE rather than _SC_PAGE_SIZE.
+
+2017-02-14 Ulf Hermann <ulf.hermann@qt.io>
+
+ * color.h: New file.
+ * color.c: Include color.h.
+ * libeu.h: Remove color handling.
+ * Makefile.am (noinst_HEADERS): Add color.h.
+
+2016-12-29 Luiz Angelo Daros de Luca <luizluca@gmail.com>
+
+ * crc32_file.c: Include system.h.
+ * system.h: Remove semi-colon after TEMP_FAILURE_RETRY definition.
+
+2016-12-24 Mark Wielaard <mark@klomp.org>
+
+ * version.c: New source file.
+ * Makefile.am (libeu_a_SOURCES): Add version.c
+ * system.h (print_version): New function definition.
+
+2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+
+ * fixedsizehash.h (CONCAT): Use __CONCAT when available.
+ * system.h: Include config.h and errno.h.
+ (powerof2): Define if not already defined.
+ (TEMP_FAILURE_RETRY): Define when not yet defined.
+
+2015-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+
+ * Makefile.am (noinst_HEADERS): Add libeu.h.
+ * color.c: Remove system.h include, add libeu.h include.
+ * crc32_file.c: Likewise.
+ * fixedsizehash.h: Remove sys/param.h include.
+ * libeu.h: New file.
+ * system.h: Include sys/param.h.
+ (xmalloc, xcalloc, xrealloc, xstrdup, xstrndup, crc32, crc32_file,
+ color_argp, color_enum, color_*): Move definitions to libeu.h.
+ * xstrdup.c: Remove system.h include, add libeu.h include.
+ * xstrndup.c: Remove system.h include, add libeu.h and stdint.h
+ includes.
+
2015-09-24 Jose E. Marchesi <jose.marchesi@oracle.com>
* Makefile.am (AM_CFLAGS): Use -fPIC instead of -fpic to avoid relocation
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 2219eaa..36d21a0 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -28,17 +28,17 @@
## not, see <http://www.gnu.org/licenses/>.
##
include $(top_srcdir)/config/eu.am
-AM_CFLAGS += -fPIC
+AM_CFLAGS += $(fpic_CFLAGS)
AM_CPPFLAGS += -I$(srcdir)/../libelf
noinst_LIBRARIES = libeu.a
libeu_a_SOURCES = xstrdup.c xstrndup.c xmalloc.c next_prime.c \
- crc32.c crc32_file.c md5.c sha1.c \
- color.c
+ crc32.c crc32_file.c \
+ color.c printversion.c
-noinst_HEADERS = fixedsizehash.h system.h dynamicsizehash.h list.h md5.h \
- sha1.h eu-config.h
+noinst_HEADERS = fixedsizehash.h libeu.h system.h dynamicsizehash.h list.h \
+ eu-config.h color.h printversion.h bpf.h
EXTRA_DIST = dynamicsizehash.c
if !GPROF
diff --git a/lib/bpf.h b/lib/bpf.h
new file mode 100644
index 0000000..db80a51
--- /dev/null
+++ b/lib/bpf.h
@@ -0,0 +1,82 @@
+/* Minimal extended BPF constants as alternative for linux/bpf.h. */
+
+#ifndef _ELFUTILS_BPF_H
+#define _ELFUTILS_BPF_H 1
+
+#include <stdint.h>
+
+#define BPF_CLASS(code) ((code) & 0x07)
+
+#define BPF_LD 0x00
+#define BPF_LDX 0x01
+#define BPF_ST 0x02
+#define BPF_STX 0x03
+#define BPF_ALU 0x04
+#define BPF_JMP 0x05
+#define BPF_RET 0x06
+#define BPF_MISC 0x07
+
+#define BPF_ALU64 0x07
+
+#define BPF_JNE 0x50
+#define BPF_JSGT 0x60
+#define BPF_JSGE 0x70
+#define BPF_CALL 0x80
+#define BPF_EXIT 0x90
+
+#define BPF_W 0x00
+#define BPF_H 0x08
+#define BPF_B 0x10
+
+#define BPF_IMM 0x00
+#define BPF_ABS 0x20
+#define BPF_IND 0x40
+#define BPF_MEM 0x60
+#define BPF_LEN 0x80
+#define BPF_MSH 0xa0
+
+#define BPF_DW 0x18
+#define BPF_XADD 0xc0
+
+#define BPF_ADD 0x00
+#define BPF_SUB 0x10
+#define BPF_MUL 0x20
+#define BPF_DIV 0x30
+#define BPF_OR 0x40
+#define BPF_AND 0x50
+#define BPF_LSH 0x60
+#define BPF_RSH 0x70
+#define BPF_NEG 0x80
+#define BPF_MOD 0x90
+#define BPF_XOR 0xa0
+
+#define BPF_MOV 0xb0
+#define BPF_ARSH 0xc0
+
+#define BPF_JA 0x00
+#define BPF_JEQ 0x10
+#define BPF_JGT 0x20
+#define BPF_JGE 0x30
+#define BPF_JSET 0x40
+
+#define BPF_K 0x00
+#define BPF_X 0x08
+
+#define BPF_END 0xd0
+#define BPF_TO_LE 0x00
+#define BPF_TO_BE 0x08
+
+#define BPF_PSEUDO_MAP_FD 1
+
+#define MAX_BPF_REG 10
+
+struct bpf_insn
+{
+ uint8_t code;
+ uint8_t dst_reg:4;
+ uint8_t src_reg:4;
+ int16_t off;
+ int32_t imm;
+};
+
+#endif
diff --git a/lib/color.c b/lib/color.c
index d1309ed..f62389d 100644
--- a/lib/color.c
+++ b/lib/color.c
@@ -37,8 +37,8 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include "system.h"
-
+#include "libeu.h"
+#include "color.h"
/* Prototype for option handler. */
static error_t parse_opt (int key, char *arg, struct argp_state *state);
diff --git a/lib/color.h b/lib/color.h
new file mode 100644
index 0000000..3872eb0
--- /dev/null
+++ b/lib/color.h
@@ -0,0 +1,63 @@
+/* Handling of color output.
+ Copyright (C) 2017 The Qt Company
+ This file is part of elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 2011.
+
+ 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 COLOR_H
+#define COLOR_H 1
+
+/* Command line parser. */
+extern const struct argp color_argp;
+
+/* Coloring mode. */
+enum color_enum
+ {
+ color_never = 0,
+ color_always,
+ color_auto
+ } __attribute__ ((packed));
+extern enum color_enum color_mode;
+
+/* Colors to use for the various components. */
+extern char *color_address;
+extern char *color_bytes;
+extern char *color_mnemonic;
+extern char *color_operand1;
+extern char *color_operand2;
+extern char *color_operand3;
+extern char *color_label;
+extern char *color_undef;
+extern char *color_undef_tls;
+extern char *color_undef_weak;
+extern char *color_symbol;
+extern char *color_tls;
+extern char *color_weak;
+
+extern const char color_off[];
+
+#endif /* color.h */
diff --git a/lib/crc32.c b/lib/crc32.c
index 1a76b1b..758602e 100644
--- a/lib/crc32.c
+++ b/lib/crc32.c
@@ -25,6 +25,10 @@
the GNU Lesser General Public License along with this program. If
not, see <http://www.gnu.org/licenses/>. */
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdint.h>
#include "system.h"
diff --git a/lib/crc32_file.c b/lib/crc32_file.c
index c0b18e9..f7607d0 100644
--- a/lib/crc32_file.c
+++ b/lib/crc32_file.c
@@ -30,11 +30,12 @@
# include <config.h>
#endif
-#include "system.h"
+#include "libeu.h"
#include <errno.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/mman.h>
+#include "system.h"
int
crc32_file (int fd, uint32_t *resp)
@@ -52,7 +53,7 @@
void *mapped = mmap (NULL, mapsize, PROT_READ, MAP_PRIVATE, fd, 0);
if (mapped == MAP_FAILED && errno == ENOMEM)
{
- const size_t pagesize = sysconf (_SC_PAGE_SIZE);
+ const size_t pagesize = sysconf (_SC_PAGESIZE);
mapsize = ((mapsize / 2) + pagesize - 1) & -pagesize;
while (mapsize >= pagesize
&& (mapped = mmap (NULL, mapsize, PROT_READ, MAP_PRIVATE,
diff --git a/lib/eu-config.h b/lib/eu-config.h
index 400cdc6..84b22d7 100644
--- a/lib/eu-config.h
+++ b/lib/eu-config.h
@@ -68,8 +68,20 @@
#define internal_strong_alias(name, aliasname) \
extern __typeof (name) aliasname __attribute__ ((alias (#name))) internal_function;
+#ifdef HAVE_VISIBILITY
#define attribute_hidden \
__attribute__ ((visibility ("hidden")))
+#else
+#define attribute_hidden /* empty */
+#endif
+
+#ifdef HAVE_GCC_STRUCT
+#define attribute_packed \
+ __attribute__ ((packed, gcc_struct))
+#else
+#define attribute_packed \
+ __attribute__ ((packed))
+#endif
/* Define ALLOW_UNALIGNED if the architecture allows operations on
unaligned memory locations. */
@@ -186,5 +198,12 @@
# define COMPAT_VERSION(name, version, prefix) error "should use #ifdef SYMBOL_VERSIONING"
#endif
+#ifndef FALLTHROUGH
+# ifdef HAVE_FALLTHROUGH
+# define FALLTHROUGH __attribute__ ((fallthrough))
+# else
+# define FALLTHROUGH ((void) 0)
+# endif
+#endif
#endif /* eu-config.h */
diff --git a/lib/fixedsizehash.h b/lib/fixedsizehash.h
index 06ce6a2..dac2a5f 100644
--- a/lib/fixedsizehash.h
+++ b/lib/fixedsizehash.h
@@ -31,11 +31,16 @@
#include <stdlib.h>
#include <string.h>
#include <sys/cdefs.h>
-#include <sys/param.h>
#include <system.h>
+#ifdef __CONCAT
#define CONCAT(t1,t2) __CONCAT (t1,t2)
+#else
+#define STROF(t2) t2
+#define CONCAT_EXPANDED(t1,t2) t1 ## t2
+#define CONCAT(t1,t2) CONCAT_EXPANDED(t1,t2)
+#endif
/* Before including this file the following macros must be defined:
diff --git a/libebl/eblshflagscombine.c b/lib/libeu.h
similarity index 60%
copy from libebl/eblshflagscombine.c
copy to lib/libeu.h
index 4deaaaa..ecb4d01 100644
--- a/libebl/eblshflagscombine.c
+++ b/lib/libeu.h
@@ -1,7 +1,6 @@
-/* Return combines section header flags value.
- Copyright (C) 2001, 2002 Red Hat, Inc.
+/* Declarations for the common library.
+ Copyright (C) 2006-2011 Red Hat, Inc.
This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
This file is free software; you can redistribute it and/or modify
it under the terms of either
@@ -27,15 +26,21 @@
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>
+#ifndef LIBEU_H
+#define LIBEU_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+extern void *xmalloc (size_t) __attribute__ ((__malloc__));
+extern void *xcalloc (size_t, size_t) __attribute__ ((__malloc__));
+extern void *xrealloc (void *, size_t) __attribute__ ((__malloc__));
+
+extern char *xstrdup (const char *) __attribute__ ((__malloc__));
+extern char *xstrndup (const char *, size_t) __attribute__ ((__malloc__));
+
+
+extern uint32_t crc32 (uint32_t crc, unsigned char *buf, size_t len);
+extern int crc32_file (int fd, uint32_t *resp);
+
#endif
-
-#include <libeblP.h>
-
-
-GElf_Word
-ebl_sh_flags_combine (Ebl *ebl, GElf_Word flags1, GElf_Word flags2)
-{
- return ebl->sh_flags_combine (flags1, flags2);
-}
diff --git a/lib/md5.c b/lib/md5.c
deleted file mode 100644
index 40f3044..0000000
--- a/lib/md5.c
+++ /dev/null
@@ -1,438 +0,0 @@
-/* Functions to compute MD5 message digest of files or memory blocks.
- according to the definition of MD5 in RFC 1321 from April 1992.
- Copyright (C) 1995-2011, 2015 Red Hat, Inc.
- This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 1995.
-
- 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 <string.h>
-#include <sys/types.h>
-
-#include "md5.h"
-#include "system.h"
-
-#define SWAP(n) LE32 (n)
-
-/* This array contains the bytes used to pad the buffer to the next
- 64-byte boundary. (RFC 1321, 3.1: Step 1) */
-static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ };
-
-
-/* Initialize structure containing state of computation.
- (RFC 1321, 3.3: Step 3) */
-void
-md5_init_ctx (struct md5_ctx *ctx)
-{
- ctx->A = 0x67452301;
- ctx->B = 0xefcdab89;
- ctx->C = 0x98badcfe;
- ctx->D = 0x10325476;
-
- ctx->total[0] = ctx->total[1] = 0;
- ctx->buflen = 0;
-}
-
-/* Put result from CTX in first 16 bytes following RESBUF. The result
- must be in little endian byte order.
-
- IMPORTANT: On some systems it is required that RESBUF is correctly
- aligned for a 32 bits value. */
-void *
-md5_read_ctx (const struct md5_ctx *ctx, void *resbuf)
-{
- ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A);
- ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B);
- ((md5_uint32 *) resbuf)[2] = SWAP (ctx->C);
- ((md5_uint32 *) resbuf)[3] = SWAP (ctx->D);
-
- return resbuf;
-}
-
-static void
-le64_copy (char *dest, uint64_t x)
-{
- for (size_t i = 0; i < 8; ++i)
- {
- dest[i] = (uint8_t) x;
- x >>= 8;
- }
-}
-
-/* Process the remaining bytes in the internal buffer and the usual
- prolog according to the standard and write the result to RESBUF.
-
- IMPORTANT: On some systems it is required that RESBUF is correctly
- aligned for a 32 bits value. */
-void *
-md5_finish_ctx (struct md5_ctx *ctx, void *resbuf)
-{
- /* Take yet unprocessed bytes into account. */
- md5_uint32 bytes = ctx->buflen;
- size_t pad;
-
- /* Now count remaining bytes. */
- ctx->total[0] += bytes;
- if (ctx->total[0] < bytes)
- ++ctx->total[1];
-
- pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes;
- memcpy (&ctx->buffer[bytes], fillbuf, pad);
-
- /* Put the 64-bit file length in *bits* at the end of the buffer. */
- const uint64_t bit_length = ((ctx->total[0] << 3)
- + ((uint64_t) ((ctx->total[1] << 3) |
- (ctx->total[0] >> 29)) << 32));
- le64_copy (&ctx->buffer[bytes + pad], bit_length);
-
- /* Process last bytes. */
- md5_process_block (ctx->buffer, bytes + pad + 8, ctx);
-
- return md5_read_ctx (ctx, resbuf);
-}
-
-
-#ifdef NEED_MD5_STREAM
-/* Compute MD5 message digest for bytes read from STREAM. The
- resulting message digest number will be written into the 16 bytes
- beginning at RESBLOCK. */
-int
-md5_stream (FILE *stream, void *resblock)
-{
- /* Important: BLOCKSIZE must be a multiple of 64. */
-#define BLOCKSIZE 4096
- struct md5_ctx ctx;
- char buffer[BLOCKSIZE + 72];
- size_t sum;
-
- /* Initialize the computation context. */
- md5_init_ctx (&ctx);
-
- /* Iterate over full file contents. */
- while (1)
- {
- /* We read the file in blocks of BLOCKSIZE bytes. One call of the
- computation function processes the whole buffer so that with the
- next round of the loop another block can be read. */
- size_t n;
- sum = 0;
-
- /* Read block. Take care for partial reads. */
- do
- {
- n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
-
- sum += n;
- }
- while (sum < BLOCKSIZE && n != 0);
- if (n == 0 && ferror (stream))
- return 1;
-
- /* If end of file is reached, end the loop. */
- if (n == 0)
- break;
-
- /* Process buffer with BLOCKSIZE bytes. Note that
- BLOCKSIZE % 64 == 0
- */
- md5_process_block (buffer, BLOCKSIZE, &ctx);
- }
-
- /* Add the last bytes if necessary. */
- if (sum > 0)
- md5_process_bytes (buffer, sum, &ctx);
-
- /* Construct result in desired memory. */
- md5_finish_ctx (&ctx, resblock);
- return 0;
-}
-#endif
-
-
-#ifdef NEED_MD5_BUFFER
-/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
- result is always in little endian byte order, so that a byte-wise
- output yields to the wanted ASCII representation of the message
- digest. */
-void *
-md5_buffer (const char *buffer, size_t len, void *resblock)
-{
- struct md5_ctx ctx;
-
- /* Initialize the computation context. */
- md5_init_ctx (&ctx);
-
- /* Process whole buffer but last len % 64 bytes. */
- md5_process_bytes (buffer, len, &ctx);
-
- /* Put result in desired memory area. */
- return md5_finish_ctx (&ctx, resblock);
-}
-#endif
-
-
-void
-md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx)
-{
- /* When we already have some bits in our internal buffer concatenate
- both inputs first. */
- if (ctx->buflen != 0)
- {
- size_t left_over = ctx->buflen;
- size_t add = 128 - left_over > len ? len : 128 - left_over;
-
- memcpy (&ctx->buffer[left_over], buffer, add);
- ctx->buflen += add;
-
- if (ctx->buflen > 64)
- {
- md5_process_block (ctx->buffer, ctx->buflen & ~63, ctx);
-
- ctx->buflen &= 63;
- /* The regions in the following copy operation cannot overlap. */
- memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63],
- ctx->buflen);
- }
-
- buffer = (const char *) buffer + add;
- len -= add;
- }
-
- /* Process available complete blocks. */
- if (len >= 64)
- {
-#if !_STRING_ARCH_unaligned
-/* To check alignment gcc has an appropriate operator. Other
- compilers don't. */
-# if __GNUC__ >= 2
-# define UNALIGNED_P(p) (((md5_uintptr) p) % __alignof__ (md5_uint32) != 0)
-# else
-# define UNALIGNED_P(p) (((md5_uintptr) p) % sizeof (md5_uint32) != 0)
-# endif
- if (UNALIGNED_P (buffer))
- while (len > 64)
- {
- md5_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx);
- buffer = (const char *) buffer + 64;
- len -= 64;
- }
- else
-#endif
- {
- md5_process_block (buffer, len & ~63, ctx);
- buffer = (const char *) buffer + (len & ~63);
- len &= 63;
- }
- }
-
- /* Move remaining bytes in internal buffer. */
- if (len > 0)
- {
- size_t left_over = ctx->buflen;
-
- memcpy (&ctx->buffer[left_over], buffer, len);
- left_over += len;
- if (left_over >= 64)
- {
- md5_process_block (ctx->buffer, 64, ctx);
- left_over -= 64;
- memcpy (ctx->buffer, &ctx->buffer[64], left_over);
- }
- ctx->buflen = left_over;
- }
-}
-
-
-/* These are the four functions used in the four steps of the MD5 algorithm
- and defined in the RFC 1321. The first function is a little bit optimized
- (as found in Colin Plumbs public domain implementation). */
-/* #define FF(b, c, d) ((b & c) | (~b & d)) */
-#define FF(b, c, d) (d ^ (b & (c ^ d)))
-#define FG(b, c, d) FF (d, b, c)
-#define FH(b, c, d) (b ^ c ^ d)
-#define FI(b, c, d) (c ^ (b | ~d))
-
-/* Process LEN bytes of BUFFER, accumulating context into CTX.
- It is assumed that LEN % 64 == 0. */
-
-void
-md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx)
-{
- md5_uint32 correct_words[16];
- const md5_uint32 *words = buffer;
- size_t nwords = len / sizeof (md5_uint32);
- const md5_uint32 *endp = words + nwords;
- md5_uint32 A = ctx->A;
- md5_uint32 B = ctx->B;
- md5_uint32 C = ctx->C;
- md5_uint32 D = ctx->D;
-
- /* First increment the byte count. RFC 1321 specifies the possible
- length of the file up to 2^64 bits. Here we only compute the
- number of bytes. Do a double word increment. */
- ctx->total[0] += len;
- if (ctx->total[0] < len)
- ++ctx->total[1];
-
- /* Process all bytes in the buffer with 64 bytes in each round of
- the loop. */
- while (words < endp)
- {
- md5_uint32 *cwp = correct_words;
- md5_uint32 A_save = A;
- md5_uint32 B_save = B;
- md5_uint32 C_save = C;
- md5_uint32 D_save = D;
-
- /* First round: using the given function, the context and a constant
- the next context is computed. Because the algorithms processing
- unit is a 32-bit word and it is determined to work on words in
- little endian byte order we perhaps have to change the byte order
- before the computation. To reduce the work for the next steps
- we store the swapped words in the array CORRECT_WORDS. */
-
-#define OP(a, b, c, d, s, T) \
- do \
- { \
- a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \
- ++words; \
- CYCLIC (a, s); \
- a += b; \
- } \
- while (0)
-
- /* It is unfortunate that C does not provide an operator for
- cyclic rotation. Hope the C compiler is smart enough. */
-#define CYCLIC(w, s) (w = (w << s) | (w >> (32 - s)))
-
- /* Before we start, one word to the strange constants.
- They are defined in RFC 1321 as
-
- T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64
- */
-
- /* Round 1. */
- OP (A, B, C, D, 7, 0xd76aa478);
- OP (D, A, B, C, 12, 0xe8c7b756);
- OP (C, D, A, B, 17, 0x242070db);
- OP (B, C, D, A, 22, 0xc1bdceee);
- OP (A, B, C, D, 7, 0xf57c0faf);
- OP (D, A, B, C, 12, 0x4787c62a);
- OP (C, D, A, B, 17, 0xa8304613);
- OP (B, C, D, A, 22, 0xfd469501);
- OP (A, B, C, D, 7, 0x698098d8);
- OP (D, A, B, C, 12, 0x8b44f7af);
- OP (C, D, A, B, 17, 0xffff5bb1);
- OP (B, C, D, A, 22, 0x895cd7be);
- OP (A, B, C, D, 7, 0x6b901122);
- OP (D, A, B, C, 12, 0xfd987193);
- OP (C, D, A, B, 17, 0xa679438e);
- OP (B, C, D, A, 22, 0x49b40821);
-
- /* For the second to fourth round we have the possibly swapped words
- in CORRECT_WORDS. Redefine the macro to take an additional first
- argument specifying the function to use. */
-#undef OP
-#define OP(f, a, b, c, d, k, s, T) \
- do \
- { \
- a += f (b, c, d) + correct_words[k] + T; \
- CYCLIC (a, s); \
- a += b; \
- } \
- while (0)
-
- /* Round 2. */
- OP (FG, A, B, C, D, 1, 5, 0xf61e2562);
- OP (FG, D, A, B, C, 6, 9, 0xc040b340);
- OP (FG, C, D, A, B, 11, 14, 0x265e5a51);
- OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa);
- OP (FG, A, B, C, D, 5, 5, 0xd62f105d);
- OP (FG, D, A, B, C, 10, 9, 0x02441453);
- OP (FG, C, D, A, B, 15, 14, 0xd8a1e681);
- OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8);
- OP (FG, A, B, C, D, 9, 5, 0x21e1cde6);
- OP (FG, D, A, B, C, 14, 9, 0xc33707d6);
- OP (FG, C, D, A, B, 3, 14, 0xf4d50d87);
- OP (FG, B, C, D, A, 8, 20, 0x455a14ed);
- OP (FG, A, B, C, D, 13, 5, 0xa9e3e905);
- OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8);
- OP (FG, C, D, A, B, 7, 14, 0x676f02d9);
- OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a);
-
- /* Round 3. */
- OP (FH, A, B, C, D, 5, 4, 0xfffa3942);
- OP (FH, D, A, B, C, 8, 11, 0x8771f681);
- OP (FH, C, D, A, B, 11, 16, 0x6d9d6122);
- OP (FH, B, C, D, A, 14, 23, 0xfde5380c);
- OP (FH, A, B, C, D, 1, 4, 0xa4beea44);
- OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9);
- OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60);
- OP (FH, B, C, D, A, 10, 23, 0xbebfbc70);
- OP (FH, A, B, C, D, 13, 4, 0x289b7ec6);
- OP (FH, D, A, B, C, 0, 11, 0xeaa127fa);
- OP (FH, C, D, A, B, 3, 16, 0xd4ef3085);
- OP (FH, B, C, D, A, 6, 23, 0x04881d05);
- OP (FH, A, B, C, D, 9, 4, 0xd9d4d039);
- OP (FH, D, A, B, C, 12, 11, 0xe6db99e5);
- OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8);
- OP (FH, B, C, D, A, 2, 23, 0xc4ac5665);
-
- /* Round 4. */
- OP (FI, A, B, C, D, 0, 6, 0xf4292244);
- OP (FI, D, A, B, C, 7, 10, 0x432aff97);
- OP (FI, C, D, A, B, 14, 15, 0xab9423a7);
- OP (FI, B, C, D, A, 5, 21, 0xfc93a039);
- OP (FI, A, B, C, D, 12, 6, 0x655b59c3);
- OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92);
- OP (FI, C, D, A, B, 10, 15, 0xffeff47d);
- OP (FI, B, C, D, A, 1, 21, 0x85845dd1);
- OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f);
- OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0);
- OP (FI, C, D, A, B, 6, 15, 0xa3014314);
- OP (FI, B, C, D, A, 13, 21, 0x4e0811a1);
- OP (FI, A, B, C, D, 4, 6, 0xf7537e82);
- OP (FI, D, A, B, C, 11, 10, 0xbd3af235);
- OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb);
- OP (FI, B, C, D, A, 9, 21, 0xeb86d391);
-
- /* Add the starting values of the context. */
- A += A_save;
- B += B_save;
- C += C_save;
- D += D_save;
- }
-
- /* Put checksum in context given as argument. */
- ctx->A = A;
- ctx->B = B;
- ctx->C = C;
- ctx->D = D;
-}
diff --git a/lib/md5.h b/lib/md5.h
deleted file mode 100644
index f2d0f30..0000000
--- a/lib/md5.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* Declaration of functions and data types used for MD5 sum computing
- library functions.
- Copyright (C) 1995,1996,1997,1999-2001,2004,2005,2008 Red Hat, Inc.
- This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 1995.
-
- 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 _MD5_H
-#define _MD5_H 1
-
-#include <limits.h>
-#include <stdint.h>
-#include <stdio.h>
-
-#define MD5_DIGEST_SIZE 16
-#define MD5_BLOCK_SIZE 64
-
-typedef uint32_t md5_uint32;
-typedef uintptr_t md5_uintptr;
-
-/* Structure to save state of computation between the single steps. */
-struct md5_ctx
-{
- md5_uint32 A;
- md5_uint32 B;
- md5_uint32 C;
- md5_uint32 D;
-
- md5_uint32 total[2];
- md5_uint32 buflen;
- char buffer[128] __attribute__ ((__aligned__ (__alignof__ (md5_uint32))));
-};
-
-/*
- * The following three functions are build up the low level used in
- * the functions `md5_stream' and `md5_buffer'.
- */
-
-/* Initialize structure containing state of computation.
- (RFC 1321, 3.3: Step 3) */
-extern void md5_init_ctx (struct md5_ctx *ctx);
-
-/* Starting with the result of former calls of this function (or the
- initialization function update the context for the next LEN bytes
- starting at BUFFER.
- It is necessary that LEN is a multiple of 64!!! */
-extern void md5_process_block (const void *buffer, size_t len,
- struct md5_ctx *ctx);
-
-/* Starting with the result of former calls of this function (or the
- initialization function update the context for the next LEN bytes
- starting at BUFFER.
- It is NOT required that LEN is a multiple of 64. */
-extern void md5_process_bytes (const void *buffer, size_t len,
- struct md5_ctx *ctx);
-
-/* Process the remaining bytes in the buffer and put result from CTX
- in first 16 bytes following RESBUF. The result is always in little
- endian byte order, so that a byte-wise output yields to the wanted
- ASCII representation of the message digest.
-
- IMPORTANT: On some systems it is required that RESBUF is correctly
- aligned for a 32 bits value. */
-extern void *md5_finish_ctx (struct md5_ctx *ctx, void *resbuf);
-
-
-/* Put result from CTX in first 16 bytes following RESBUF. The result is
- always in little endian byte order, so that a byte-wise output yields
- to the wanted ASCII representation of the message digest.
-
- IMPORTANT: On some systems it is required that RESBUF is correctly
- aligned for a 32 bits value. */
-extern void *md5_read_ctx (const struct md5_ctx *ctx, void *resbuf);
-
-
-/* Compute MD5 message digest for bytes read from STREAM. The
- resulting message digest number will be written into the 16 bytes
- beginning at RESBLOCK. */
-extern int md5_stream (FILE *stream, void *resblock);
-
-/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
- result is always in little endian byte order, so that a byte-wise
- output yields to the wanted ASCII representation of the message
- digest. */
-extern void *md5_buffer (const char *buffer, size_t len, void *resblock);
-
-#endif /* md5.h */
diff --git a/libebl/eblshflagscombine.c b/lib/printversion.c
similarity index 64%
copy from libebl/eblshflagscombine.c
copy to lib/printversion.c
index 4deaaaa..17832f4 100644
--- a/libebl/eblshflagscombine.c
+++ b/lib/printversion.c
@@ -1,7 +1,6 @@
-/* Return combines section header flags value.
- Copyright (C) 2001, 2002 Red Hat, Inc.
+/* Common argp_print_version_hook for all tools.
+ Copyright (C) 2016, 2017, 2018 Red Hat, Inc.
This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
This file is free software; you can redistribute it and/or modify
it under the terms of either
@@ -31,11 +30,16 @@
# include <config.h>
#endif
-#include <libeblP.h>
+#include <libintl.h>
+#include "printversion.h"
-
-GElf_Word
-ebl_sh_flags_combine (Ebl *ebl, GElf_Word flags1, GElf_Word flags2)
+void
+print_version (FILE *stream, struct argp_state *state)
{
- return ebl->sh_flags_combine (flags1, flags2);
+ fprintf (stream, "%s (%s) %s\n", state->name, PACKAGE_NAME, PACKAGE_VERSION);
+ fprintf (stream, gettext ("\
+Copyright (C) %s The elfutils developers <%s>.\n\
+This is free software; see the source for copying conditions. There is NO\n\
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
+"), "2018", PACKAGE_URL);
}
diff --git a/lib/printversion.h b/lib/printversion.h
new file mode 100644
index 0000000..a9e059f
--- /dev/null
+++ b/lib/printversion.h
@@ -0,0 +1,49 @@
+/* Common argp_print_version_hook for all tools.
+ Copyright (C) 2017 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/>. */
+
+#ifndef PRINTVERSION_H
+#define PRINTVERSION_H 1
+
+#include <argp.h>
+#include <stdio.h>
+
+/* Defined in version.c. Common ARGP_PROGRAM_VERSION_HOOK_DEF. */
+void print_version (FILE *stream, struct argp_state *state);
+
+/* We need define two variables, argp_program_version_hook and
+ argp_program_bug_address, in all programs. argp.h declares these
+ variables as non-const (which is correct in general). But we can
+ do better, it is not going to change. So we want to move them into
+ the .rodata section. Define macros to do the trick. */
+#define ARGP_PROGRAM_VERSION_HOOK_DEF \
+ void (*const apvh) (FILE *, struct argp_state *) \
+ __asm ("argp_program_version_hook")
+#define ARGP_PROGRAM_BUG_ADDRESS_DEF \
+ const char *const apba__ __asm ("argp_program_bug_address")
+
+#endif // PRINTVERSION_H
diff --git a/lib/sha1.c b/lib/sha1.c
deleted file mode 100644
index 6a9b61f..0000000
--- a/lib/sha1.c
+++ /dev/null
@@ -1,380 +0,0 @@
-/* Functions to compute SHA1 message digest of files or memory blocks.
- according to the definition of SHA1 in FIPS 180-1 from April 1997.
- Copyright (C) 2008-2011, 2015 Red Hat, Inc.
- This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2008.
-
- 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 <string.h>
-#include <sys/types.h>
-
-#include "sha1.h"
-#include "system.h"
-
-#define SWAP(n) BE32 (n)
-
-/* This array contains the bytes used to pad the buffer to the next
- 64-byte boundary. */
-static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ };
-
-
-/* Initialize structure containing state of computation. */
-void
-sha1_init_ctx (struct sha1_ctx *ctx)
-{
- ctx->A = 0x67452301;
- ctx->B = 0xefcdab89;
- ctx->C = 0x98badcfe;
- ctx->D = 0x10325476;
- ctx->E = 0xc3d2e1f0;
-
- ctx->total[0] = ctx->total[1] = 0;
- ctx->buflen = 0;
-}
-
-/* Put result from CTX in first 20 bytes following RESBUF. The result
- must be in little endian byte order.
-
- IMPORTANT: On some systems it is required that RESBUF is correctly
- aligned for a 32 bits value. */
-void *
-sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf)
-{
- ((sha1_uint32 *) resbuf)[0] = SWAP (ctx->A);
- ((sha1_uint32 *) resbuf)[1] = SWAP (ctx->B);
- ((sha1_uint32 *) resbuf)[2] = SWAP (ctx->C);
- ((sha1_uint32 *) resbuf)[3] = SWAP (ctx->D);
- ((sha1_uint32 *) resbuf)[4] = SWAP (ctx->E);
-
- return resbuf;
-}
-
-static void
-be64_copy (char *dest, uint64_t x)
-{
- for (size_t i = 8; i-- > 0; x >>= 8)
- dest[i] = (uint8_t) x;
-}
-
-/* Process the remaining bytes in the internal buffer and the usual
- prolog according to the standard and write the result to RESBUF.
-
- IMPORTANT: On some systems it is required that RESBUF is correctly
- aligned for a 32 bits value. */
-void *
-sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf)
-{
- /* Take yet unprocessed bytes into account. */
- sha1_uint32 bytes = ctx->buflen;
- size_t pad;
-
- /* Now count remaining bytes. */
- ctx->total[0] += bytes;
- if (ctx->total[0] < bytes)
- ++ctx->total[1];
-
- pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes;
- memcpy (&ctx->buffer[bytes], fillbuf, pad);
-
- /* Put the 64-bit file length in *bits* at the end of the buffer. */
- const uint64_t bit_length = ((ctx->total[0] << 3)
- + ((uint64_t) ((ctx->total[1] << 3) |
- (ctx->total[0] >> 29)) << 32));
- be64_copy (&ctx->buffer[bytes + pad], bit_length);
-
- /* Process last bytes. */
- sha1_process_block (ctx->buffer, bytes + pad + 8, ctx);
-
- return sha1_read_ctx (ctx, resbuf);
-}
-
-
-void
-sha1_process_bytes (const void *buffer, size_t len, struct sha1_ctx *ctx)
-{
- /* When we already have some bits in our internal buffer concatenate
- both inputs first. */
- if (ctx->buflen != 0)
- {
- size_t left_over = ctx->buflen;
- size_t add = 128 - left_over > len ? len : 128 - left_over;
-
- memcpy (&ctx->buffer[left_over], buffer, add);
- ctx->buflen += add;
-
- if (ctx->buflen > 64)
- {
- sha1_process_block (ctx->buffer, ctx->buflen & ~63, ctx);
-
- ctx->buflen &= 63;
- /* The regions in the following copy operation cannot overlap. */
- memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63],
- ctx->buflen);
- }
-
- buffer = (const char *) buffer + add;
- len -= add;
- }
-
- /* Process available complete blocks. */
- if (len >= 64)
- {
-#if !_STRING_ARCH_unaligned
-/* To check alignment gcc has an appropriate operator. Other
- compilers don't. */
-# if __GNUC__ >= 2
-# define UNALIGNED_P(p) (((sha1_uintptr) p) % __alignof__ (sha1_uint32) != 0)
-# else
-# define UNALIGNED_P(p) (((sha1_uintptr) p) % sizeof (sha1_uint32) != 0)
-# endif
- if (UNALIGNED_P (buffer))
- while (len > 64)
- {
- sha1_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx);
- buffer = (const char *) buffer + 64;
- len -= 64;
- }
- else
-#endif
- {
- sha1_process_block (buffer, len & ~63, ctx);
- buffer = (const char *) buffer + (len & ~63);
- len &= 63;
- }
- }
-
- /* Move remaining bytes in internal buffer. */
- if (len > 0)
- {
- size_t left_over = ctx->buflen;
-
- memcpy (&ctx->buffer[left_over], buffer, len);
- left_over += len;
- if (left_over >= 64)
- {
- sha1_process_block (ctx->buffer, 64, ctx);
- left_over -= 64;
- memcpy (ctx->buffer, &ctx->buffer[64], left_over);
- }
- ctx->buflen = left_over;
- }
-}
-
-
-/* These are the four functions used in the four steps of the SHA1 algorithm
- and defined in the FIPS 180-1. */
-/* #define FF(b, c, d) ((b & c) | (~b & d)) */
-#define FF(b, c, d) (d ^ (b & (c ^ d)))
-#define FG(b, c, d) (b ^ c ^ d)
-/* define FH(b, c, d) ((b & c) | (b & d) | (c & d)) */
-#define FH(b, c, d) (((b | c) & d) | (b & c))
-
-/* It is unfortunate that C does not provide an operator for cyclic
- rotation. Hope the C compiler is smart enough. */
-#define CYCLIC(w, s) (((w) << s) | ((w) >> (32 - s)))
-
-/* Magic constants. */
-#define K0 0x5a827999
-#define K1 0x6ed9eba1
-#define K2 0x8f1bbcdc
-#define K3 0xca62c1d6
-
-
-/* Process LEN bytes of BUFFER, accumulating context into CTX.
- It is assumed that LEN % 64 == 0. */
-
-void
-sha1_process_block (const void *buffer, size_t len, struct sha1_ctx *ctx)
-{
- sha1_uint32 computed_words[16];
-#define W(i) computed_words[(i) % 16]
- const sha1_uint32 *words = buffer;
- size_t nwords = len / sizeof (sha1_uint32);
- const sha1_uint32 *endp = words + nwords;
- sha1_uint32 A = ctx->A;
- sha1_uint32 B = ctx->B;
- sha1_uint32 C = ctx->C;
- sha1_uint32 D = ctx->D;
- sha1_uint32 E = ctx->E;
-
- /* First increment the byte count. FIPS 180-1 specifies the possible
- length of the file up to 2^64 bits. Here we only compute the
- number of bytes. Do a double word increment. */
- ctx->total[0] += len;
- if (ctx->total[0] < len)
- ++ctx->total[1];
-
- /* Process all bytes in the buffer with 64 bytes in each round of
- the loop. */
- while (words < endp)
- {
- sha1_uint32 A_save = A;
- sha1_uint32 B_save = B;
- sha1_uint32 C_save = C;
- sha1_uint32 D_save = D;
- sha1_uint32 E_save = E;
-
- /* First round: using the given function, the context and a constant
- the next context is computed. Because the algorithms processing
- unit is a 32-bit word and it is determined to work on words in
- little endian byte order we perhaps have to change the byte order
- before the computation. */
-
-#define OP(i, a, b, c, d, e) \
- do \
- { \
- W (i) = SWAP (*words); \
- e = CYCLIC (a, 5) + FF (b, c, d) + e + W (i) + K0; \
- ++words; \
- b = CYCLIC (b, 30); \
- } \
- while (0)
-
- /* Steps 0 to 15. */
- OP (0, A, B, C, D, E);
- OP (1, E, A, B, C, D);
- OP (2, D, E, A, B, C);
- OP (3, C, D, E, A, B);
- OP (4, B, C, D, E, A);
- OP (5, A, B, C, D, E);
- OP (6, E, A, B, C, D);
- OP (7, D, E, A, B, C);
- OP (8, C, D, E, A, B);
- OP (9, B, C, D, E, A);
- OP (10, A, B, C, D, E);
- OP (11, E, A, B, C, D);
- OP (12, D, E, A, B, C);
- OP (13, C, D, E, A, B);
- OP (14, B, C, D, E, A);
- OP (15, A, B, C, D, E);
-
- /* For the remaining 64 steps we have a more complicated
- computation of the input data-derived values. Redefine the
- macro to take an additional second argument specifying the
- function to use and a new last parameter for the magic
- constant. */
-#undef OP
-#define OP(i, f, a, b, c, d, e, K) \
- do \
- { \
- W (i) = CYCLIC (W (i - 3) ^ W (i - 8) ^ W (i - 14) ^ W (i - 16), 1);\
- e = CYCLIC (a, 5) + f (b, c, d) + e + W (i) + K; \
- b = CYCLIC (b, 30); \
- } \
- while (0)
-
- /* Steps 16 to 19. */
- OP (16, FF, E, A, B, C, D, K0);
- OP (17, FF, D, E, A, B, C, K0);
- OP (18, FF, C, D, E, A, B, K0);
- OP (19, FF, B, C, D, E, A, K0);
-
- /* Steps 20 to 39. */
- OP (20, FG, A, B, C, D, E, K1);
- OP (21, FG, E, A, B, C, D, K1);
- OP (22, FG, D, E, A, B, C, K1);
- OP (23, FG, C, D, E, A, B, K1);
- OP (24, FG, B, C, D, E, A, K1);
- OP (25, FG, A, B, C, D, E, K1);
- OP (26, FG, E, A, B, C, D, K1);
- OP (27, FG, D, E, A, B, C, K1);
- OP (28, FG, C, D, E, A, B, K1);
- OP (29, FG, B, C, D, E, A, K1);
- OP (30, FG, A, B, C, D, E, K1);
- OP (31, FG, E, A, B, C, D, K1);
- OP (32, FG, D, E, A, B, C, K1);
- OP (33, FG, C, D, E, A, B, K1);
- OP (34, FG, B, C, D, E, A, K1);
- OP (35, FG, A, B, C, D, E, K1);
- OP (36, FG, E, A, B, C, D, K1);
- OP (37, FG, D, E, A, B, C, K1);
- OP (38, FG, C, D, E, A, B, K1);
- OP (39, FG, B, C, D, E, A, K1);
-
- /* Steps 40 to 59. */
- OP (40, FH, A, B, C, D, E, K2);
- OP (41, FH, E, A, B, C, D, K2);
- OP (42, FH, D, E, A, B, C, K2);
- OP (43, FH, C, D, E, A, B, K2);
- OP (44, FH, B, C, D, E, A, K2);
- OP (45, FH, A, B, C, D, E, K2);
- OP (46, FH, E, A, B, C, D, K2);
- OP (47, FH, D, E, A, B, C, K2);
- OP (48, FH, C, D, E, A, B, K2);
- OP (49, FH, B, C, D, E, A, K2);
- OP (50, FH, A, B, C, D, E, K2);
- OP (51, FH, E, A, B, C, D, K2);
- OP (52, FH, D, E, A, B, C, K2);
- OP (53, FH, C, D, E, A, B, K2);
- OP (54, FH, B, C, D, E, A, K2);
- OP (55, FH, A, B, C, D, E, K2);
- OP (56, FH, E, A, B, C, D, K2);
- OP (57, FH, D, E, A, B, C, K2);
- OP (58, FH, C, D, E, A, B, K2);
- OP (59, FH, B, C, D, E, A, K2);
-
- /* Steps 60 to 79. */
- OP (60, FG, A, B, C, D, E, K3);
- OP (61, FG, E, A, B, C, D, K3);
- OP (62, FG, D, E, A, B, C, K3);
- OP (63, FG, C, D, E, A, B, K3);
- OP (64, FG, B, C, D, E, A, K3);
- OP (65, FG, A, B, C, D, E, K3);
- OP (66, FG, E, A, B, C, D, K3);
- OP (67, FG, D, E, A, B, C, K3);
- OP (68, FG, C, D, E, A, B, K3);
- OP (69, FG, B, C, D, E, A, K3);
- OP (70, FG, A, B, C, D, E, K3);
- OP (71, FG, E, A, B, C, D, K3);
- OP (72, FG, D, E, A, B, C, K3);
- OP (73, FG, C, D, E, A, B, K3);
- OP (74, FG, B, C, D, E, A, K3);
- OP (75, FG, A, B, C, D, E, K3);
- OP (76, FG, E, A, B, C, D, K3);
- OP (77, FG, D, E, A, B, C, K3);
- OP (78, FG, C, D, E, A, B, K3);
- OP (79, FG, B, C, D, E, A, K3);
-
- /* Add the starting values of the context. */
- A += A_save;
- B += B_save;
- C += C_save;
- D += D_save;
- E += E_save;
- }
-
- /* Put checksum in context given as argument. */
- ctx->A = A;
- ctx->B = B;
- ctx->C = C;
- ctx->D = D;
- ctx->E = E;
-}
diff --git a/lib/sha1.h b/lib/sha1.h
deleted file mode 100644
index 05301c8..0000000
--- a/lib/sha1.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Declaration of functions and data types used for SHA1 sum computing
- library functions.
- Copyright (C) 2008 Red Hat, Inc.
- This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2008.
-
- 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 _SHA1_H
-#define _SHA1_H 1
-
-#include <limits.h>
-#include <stdint.h>
-#include <stdio.h>
-
-#define SHA1_DIGEST_SIZE 20
-#define SHA1_BLOCK_SIZE 64
-
-typedef uint32_t sha1_uint32;
-typedef uintptr_t sha1_uintptr;
-
-/* Structure to save state of computation between the single steps. */
-struct sha1_ctx
-{
- sha1_uint32 A;
- sha1_uint32 B;
- sha1_uint32 C;
- sha1_uint32 D;
- sha1_uint32 E;
-
- sha1_uint32 total[2];
- sha1_uint32 buflen;
- char buffer[128] __attribute__ ((__aligned__ (__alignof__ (sha1_uint32))));
-};
-
-/* Initialize structure containing state of computation. */
-extern void sha1_init_ctx (struct sha1_ctx *ctx);
-
-/* Starting with the result of former calls of this function (or the
- initialization function update the context for the next LEN bytes
- starting at BUFFER.
- It is necessary that LEN is a multiple of 64!!! */
-extern void sha1_process_block (const void *buffer, size_t len,
- struct sha1_ctx *ctx);
-
-/* Starting with the result of former calls of this function (or the
- initialization function update the context for the next LEN bytes
- starting at BUFFER.
- It is NOT required that LEN is a multiple of 64. */
-extern void sha1_process_bytes (const void *buffer, size_t len,
- struct sha1_ctx *ctx);
-
-/* Process the remaining bytes in the buffer and put result from CTX
- in first 20 bytes following RESBUF. The result is always in little
- endian byte order, so that a byte-wise output yields to the wanted
- ASCII representation of the message digest.
-
- IMPORTANT: On some systems it is required that RESBUF is correctly
- aligned for a 32 bits value. */
-extern void *sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf);
-
-
-/* Put result from CTX in first 20 bytes following RESBUF. The result is
- always in little endian byte order, so that a byte-wise output yields
- to the wanted ASCII representation of the message digest.
-
- IMPORTANT: On some systems it is required that RESBUF is correctly
- aligned for a 32 bits value. */
-extern void *sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf);
-
-#endif /* sha1.h */
diff --git a/lib/system.h b/lib/system.h
index f31cfd0..9203335 100644
--- a/lib/system.h
+++ b/lib/system.h
@@ -29,9 +29,10 @@
#ifndef LIB_SYSTEM_H
#define LIB_SYSTEM_H 1
-#include <argp.h>
+#include <errno.h>
#include <stddef.h>
#include <stdint.h>
+#include <sys/param.h>
#include <endian.h>
#include <byteswap.h>
#include <unistd.h>
@@ -50,16 +51,22 @@
# error "Unknown byte order"
#endif
-extern void *xmalloc (size_t) __attribute__ ((__malloc__));
-extern void *xcalloc (size_t, size_t) __attribute__ ((__malloc__));
-extern void *xrealloc (void *, size_t) __attribute__ ((__malloc__));
+#ifndef MAX
+#define MAX(m, n) ((m) < (n) ? (n) : (m))
+#endif
-extern char *xstrdup (const char *) __attribute__ ((__malloc__));
-extern char *xstrndup (const char *, size_t) __attribute__ ((__malloc__));
+#ifndef MIN
+#define MIN(m, n) ((m) < (n) ? (m) : (n))
+#endif
+#if !HAVE_DECL_POWEROF2
+#define powerof2(x) (((x) & ((x) - 1)) == 0)
+#endif
-extern uint32_t crc32 (uint32_t crc, unsigned char *buf, size_t len);
-extern int crc32_file (int fd, uint32_t *resp);
+#if !HAVE_DECL_MEMPCPY
+#define mempcpy(dest, src, n) \
+ ((void *) ((char *) memcpy (dest, src, n) + (size_t) n))
+#endif
/* A special gettext function we use if the strings are too short. */
#define sgettext(Str) \
@@ -68,6 +75,14 @@
#define gettext_noop(Str) Str
+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(expression) \
+ ({ ssize_t __res; \
+ do \
+ __res = expression; \
+ while (__res == -1 && errno == EINTR); \
+ __res; })
+#endif
static inline ssize_t __attribute__ ((unused))
pwrite_retry (int fd, const void *buf, size_t len, off_t off)
@@ -125,56 +140,10 @@
return recvd;
}
-
-/* We need define two variables, argp_program_version_hook and
- argp_program_bug_address, in all programs. argp.h declares these
- variables as non-const (which is correct in general). But we can
- do better, it is not going to change. So we want to move them into
- the .rodata section. Define macros to do the trick. */
-#define ARGP_PROGRAM_VERSION_HOOK_DEF \
- void (*const apvh) (FILE *, struct argp_state *) \
- __asm ("argp_program_version_hook")
-#define ARGP_PROGRAM_BUG_ADDRESS_DEF \
- const char *const apba__ __asm ("argp_program_bug_address")
-
-
/* The demangler from libstdc++. */
extern char *__cxa_demangle (const char *mangled_name, char *output_buffer,
size_t *length, int *status);
-
-
-/* Color handling. */
-
-/* Command line parser. */
-extern const struct argp color_argp;
-
-/* Coloring mode. */
-enum color_enum
- {
- color_never = 0,
- color_always,
- color_auto
- } __attribute__ ((packed));
-extern enum color_enum color_mode;
-
-/* Colors to use for the various components. */
-extern char *color_address;
-extern char *color_bytes;
-extern char *color_mnemonic;
-extern char *color_operand1;
-extern char *color_operand2;
-extern char *color_operand3;
-extern char *color_label;
-extern char *color_undef;
-extern char *color_undef_tls;
-extern char *color_undef_weak;
-extern char *color_symbol;
-extern char *color_tls;
-extern char *color_weak;
-
-extern const char color_off[];
-
/* A static assertion. This will cause a compile-time error if EXPR,
which must be a compile-time constant, is false. */
diff --git a/lib/xstrdup.c b/lib/xstrdup.c
index aa10352..ff1e3d4 100644
--- a/lib/xstrdup.c
+++ b/lib/xstrdup.c
@@ -31,7 +31,7 @@
#endif
#include <string.h>
-#include "system.h"
+#include "libeu.h"
/* Return a newly allocated copy of STRING. */
diff --git a/lib/xstrndup.c b/lib/xstrndup.c
index 92b79c1..a257aa9 100644
--- a/lib/xstrndup.c
+++ b/lib/xstrndup.c
@@ -30,10 +30,11 @@
# include <config.h>
#endif
+#include <stdint.h>
#include <string.h>
+#include "libeu.h"
#include "system.h"
-
/* Return a newly allocated copy of STRING. */
char *
xstrndup (const char *string, size_t n)
diff --git a/libasm/ChangeLog b/libasm/ChangeLog
index beb6211..fffcced 100644
--- a/libasm/ChangeLog
+++ b/libasm/ChangeLog
@@ -1,3 +1,60 @@
+2017-02-27 Ulf Hermann <ulf.hermann@qt.io>
+
+ * Makefile.am: Use dso_LDFLAGS.
+
+2017-02-17 Ulf Hermann <ulf.hermann@qt.io>
+
+ * Makefile.am: Add libasm_so_DEPS to specify external libraries
+ that have to be linked in, and libasm_so_LIBS to specify the
+ archives libasm consists of. The dependencies include libeu.a.
+ (libasm_so_LDLIBS): Add $(libasm_so_DEPS).
+ (libasm_so$(EXEEXT): Use $(libasm_so_LIBS),
+ add --no-undefined,-z,defs,-z,relro,
+ drop the manual enumeration of dependencies,
+ specify the correct path for libasm.map.
+
+2017-04-27 Ulf Hermann <ulf.hermann@qt.io>
+
+ * asm_end.c (binary_end): Fix nesting of braces.
+
+2017-02-12 Mark Wielaard <mjw@redhat.com>
+
+ * asm_newsym.c (asm_newsym): Increase TEMPSYMLEN to 13.
+
+2017-02-15 Ulf Hermann <ulf.hermann@qt.io>
+
+ * disasm_str.c: Include system.h.
+
+2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+
+ * asm_align.c: Remove sys/param.h include.
+
+2016-07-08 Mark Wielaard <mjw@redhat.com>
+
+ * Makefile.am (AM_CPPFLAGS): Add libdwelf.
+ (libasm.so): Add libdw.
+ * asm_begin.c (prepare_binary_output): Use dwelf_strtab instead of
+ ebl_strtab.
+ * asm_end.c (binary_end): Likewise.
+ (__libasm_finictx): Likewise.
+ * asm_newabssym.c (asm_newabssym): Likewise.
+ * asm_newcomsym.c (asm_newcomsym): Likewise.
+ * asm_newscn.c (binary_newscn): Likewise.
+ * asm_newscngrp.c (asm_newscngrp): Likewise.
+ * asm_newsym.c (asm_newsym): Likewise.
+ * libasmP.h: Likewise.
+ * symbolhash.c (COMPARE): Likewise.
+ * symbolhash.h (COMPARE): Likewise.
+
+2016-06-28 Richard Henderson <rth@redhat.com>
+
+ * disasm_cb.c (disasm_cb): Pass ebl to disasm hook.
+
+2016-02-12 Mark Wielaard <mjw@redhat.com>
+
+ * asm_begin.c (prepare_text_output): Only call __fsetlocking when
+ result isn't NULL.
+
2015-10-05 Josh Stone <jistone@redhat.com>
* Makefile.am (libasm.so): Add AM_V_CCLD and AM_V_at silencers.
diff --git a/libasm/Makefile.am b/libasm/Makefile.am
index a4bf293..19fef50 100644
--- a/libasm/Makefile.am
+++ b/libasm/Makefile.am
@@ -28,7 +28,7 @@
## not, see <http://www.gnu.org/licenses/>.
##
include $(top_srcdir)/config/eu.am
-AM_CPPFLAGS += -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl -I$(top_srcdir)/libdw
+AM_CPPFLAGS += -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl -I$(top_srcdir)/libdw -I$(top_srcdir)/libdwelf
GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
VERSION = 1
@@ -55,17 +55,20 @@
libasm_pic_a_SOURCES =
am_libasm_pic_a_OBJECTS = $(libasm_a_SOURCES:.c=.os)
-libasm_so_LDLIBS =
+libasm_so_DEPS = ../lib/libeu.a ../libebl/libebl.a ../libelf/libelf.so ../libdw/libdw.so
+libasm_so_LDLIBS = $(libasm_so_DEPS)
if USE_LOCKS
libasm_so_LDLIBS += -lpthread
endif
+libasm_so_LIBS = libasm_pic.a
libasm_so_SOURCES =
-libasm.so$(EXEEXT): libasm_pic.a libasm.map
- $(AM_V_CCLD)$(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
- -Wl,--version-script,$(srcdir)/libasm.map,--no-undefined \
+libasm.so$(EXEEXT): $(srcdir)/libasm.map $(libasm_so_LIBS) $(libasm_so_DEPS)
+ $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
-Wl,--soname,$@.$(VERSION) \
- ../libebl/libebl.a ../libelf/libelf.so $(libasm_so_LDLIBS)
+ -Wl,--version-script,$<,--no-undefined \
+ -Wl,--whole-archive $(libasm_so_LIBS) -Wl,--no-whole-archive \
+ $(libasm_so_LDLIBS)
@$(textrel_check)
$(AM_V_at)ln -fs $@ $@.$(VERSION)
diff --git a/libasm/asm_align.c b/libasm/asm_align.c
index 6631c4d..e59a070 100644
--- a/libasm/asm_align.c
+++ b/libasm/asm_align.c
@@ -33,7 +33,6 @@
#include <inttypes.h>
#include <stdlib.h>
-#include <sys/param.h>
#include <libasmP.h>
#include <system.h>
diff --git a/libasm/asm_begin.c b/libasm/asm_begin.c
index ff4d94c..6248786 100644
--- a/libasm/asm_begin.c
+++ b/libasm/asm_begin.c
@@ -1,5 +1,5 @@
/* Create descriptor for assembling.
- Copyright (C) 2002 Red Hat, Inc.
+ Copyright (C) 2002, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -58,8 +58,8 @@
free (result);
result = NULL;
}
-
- __fsetlocking (result->out.file, FSETLOCKING_BYCALLER);
+ else
+ __fsetlocking (result->out.file, FSETLOCKING_BYCALLER);
}
return result;
@@ -115,8 +115,8 @@
asm_symbol_tab_init (&result->symbol_tab, 67);
result->nsymbol_tab = 0;
/* And the string tables. */
- result->section_strtab = ebl_strtabinit (true);
- result->symbol_strtab = ebl_strtabinit (true);
+ result->section_strtab = dwelf_strtab_init (true);
+ result->symbol_strtab = dwelf_strtab_init (true);
/* We have no section groups so far. */
result->groups = NULL;
diff --git a/libasm/asm_end.c b/libasm/asm_end.c
index d21a70a..ced24f5 100644
--- a/libasm/asm_end.c
+++ b/libasm/asm_end.c
@@ -1,5 +1,5 @@
/* Finalize operations on the assembler context, free all resources.
- Copyright (C) 2002, 2003, 2005 Red Hat, Inc.
+ Copyright (C) 2002, 2003, 2005, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -62,11 +62,11 @@
binary_end (AsmCtx_t *ctx)
{
void *symtab = NULL;
- struct Ebl_Strent *symscn_strent = NULL;
- struct Ebl_Strent *strscn_strent = NULL;
- struct Ebl_Strent *xndxscn_strent = NULL;
+ Dwelf_Strent *symscn_strent = NULL;
+ Dwelf_Strent *strscn_strent = NULL;
+ Dwelf_Strent *xndxscn_strent = NULL;
Elf_Scn *shstrscn;
- struct Ebl_Strent *shstrscn_strent;
+ Dwelf_Strent *shstrscn_strent;
size_t shstrscnndx;
size_t symscnndx = 0;
size_t strscnndx = 0;
@@ -136,8 +136,8 @@
if (ctx->nsymbol_tab > 0)
{
/* Create the symbol table and string table section names. */
- symscn_strent = ebl_strtabadd (ctx->section_strtab, ".symtab", 8);
- strscn_strent = ebl_strtabadd (ctx->section_strtab, ".strtab", 8);
+ symscn_strent = dwelf_strtab_add_len (ctx->section_strtab, ".symtab", 8);
+ strscn_strent = dwelf_strtab_add_len (ctx->section_strtab, ".strtab", 8);
/* Create the symbol string table section. */
Elf_Scn *strscn = elf_newscn (ctx->out.elf);
@@ -150,7 +150,7 @@
}
strscnndx = elf_ndxscn (strscn);
- ebl_strtabfinalize (ctx->symbol_strtab, strtabdata);
+ dwelf_strtab_finalize (ctx->symbol_strtab, strtabdata);
shdr->sh_type = SHT_STRTAB;
assert (shdr->sh_entsize == 0);
@@ -190,11 +190,11 @@
uint32_t *xshndx = NULL;
AsmSym_t *sym;
while ((sym = asm_symbol_tab_iterate (&ctx->symbol_tab, &runp)) != NULL)
- if (asm_emit_symbol_p (ebl_string (sym->strent)))
+ if (asm_emit_symbol_p (dwelf_strent_str (sym->strent)))
{
assert (ptr_local <= ptr_nonlocal);
- syment.st_name = ebl_strtaboffset (sym->strent);
+ syment.st_name = dwelf_strent_off (sym->strent);
syment.st_info = GELF_ST_INFO (sym->binding, sym->type);
syment.st_other = 0;
syment.st_value = sym->scn->offset + sym->offset;
@@ -240,8 +240,9 @@
(void) gelf_update_shdr (xndxscn, shdr);
- xndxscn_strent = ebl_strtabadd (ctx->section_strtab,
- ".symtab_shndx", 14);
+ xndxscn_strent = dwelf_strtab_add_len (ctx->section_strtab,
+ ".symtab_shndx",
+ 14);
/* Note that using 'elf32_fsize' instead of
'gelf_fsize' here is correct. */
@@ -299,13 +300,14 @@
/* Add the name of the section header string table. */
- shstrscn_strent = ebl_strtabadd (ctx->section_strtab, ".shstrtab", 10);
+ shstrscn_strent = dwelf_strtab_add_len (ctx->section_strtab,
+ ".shstrtab", 10);
- ebl_strtabfinalize (ctx->section_strtab, shstrtabdata);
+ dwelf_strtab_finalize (ctx->section_strtab, shstrtabdata);
shdr->sh_type = SHT_STRTAB;
assert (shdr->sh_entsize == 0);
- shdr->sh_name = ebl_strtaboffset (shstrscn_strent);
+ shdr->sh_name = dwelf_strent_off (shstrscn_strent);
(void) gelf_update_shdr (shstrscn, shdr);
@@ -364,7 +366,7 @@
}
/* Construct the section header. */
- shdr->sh_name = ebl_strtaboffset (runp->strent);
+ shdr->sh_name = dwelf_strent_off (runp->strent);
shdr->sh_type = SHT_GROUP;
shdr->sh_flags = 0;
shdr->sh_link = symscnndx;
@@ -386,7 +388,7 @@
shdr = gelf_getshdr (scn, &shdr_mem);
- shdr->sh_name = ebl_strtaboffset (symscn_strent);
+ shdr->sh_name = dwelf_strent_off (symscn_strent);
(void) gelf_update_shdr (scn, shdr);
@@ -397,7 +399,7 @@
shdr = gelf_getshdr (scn, &shdr_mem);
- shdr->sh_name = ebl_strtaboffset (strscn_strent);
+ shdr->sh_name = dwelf_strent_off (strscn_strent);
(void) gelf_update_shdr (scn, shdr);
@@ -409,7 +411,7 @@
shdr = gelf_getshdr (scn, &shdr_mem);
- shdr->sh_name = ebl_strtaboffset (xndxscn_strent);
+ shdr->sh_name = dwelf_strent_off (xndxscn_strent);
(void) gelf_update_shdr (scn, shdr);
}
@@ -423,7 +425,7 @@
/* This better should not fail. */
assert (shdr != NULL);
- shdr->sh_name = ebl_strtaboffset (asmscn->data.main.strent);
+ shdr->sh_name = dwelf_strent_off (asmscn->data.main.strent);
/* We now know the maximum alignment. */
shdr->sh_addralign = asmscn->max_align;
@@ -462,7 +464,7 @@
gelf_update_ehdr (ctx->out.elf, ehdr);
/* Write out the ELF file. */
- if (unlikely (elf_update (ctx->out.elf, ELF_C_WRITE_MMAP)) < 0)
+ if (unlikely (elf_update (ctx->out.elf, ELF_C_WRITE_MMAP) < 0))
{
__libasm_seterrno (ASM_E_LIBELF);
result = -1;
@@ -600,8 +602,8 @@
(void) close (ctx->fd);
/* And the string tables. */
- ebl_strtabfree (ctx->section_strtab);
- ebl_strtabfree (ctx->symbol_strtab);
+ dwelf_strtab_free (ctx->section_strtab);
+ dwelf_strtab_free (ctx->symbol_strtab);
}
/* Initialize the lock. */
diff --git a/libasm/asm_newabssym.c b/libasm/asm_newabssym.c
index c5b7bea..34fef3e 100644
--- a/libasm/asm_newabssym.c
+++ b/libasm/asm_newabssym.c
@@ -1,5 +1,5 @@
/* Create new ABS symbol.
- Copyright (C) 2002 Red Hat, Inc.
+ Copyright (C) 2002, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -80,7 +80,7 @@
result->type = type;
result->binding = binding;
result->symidx = 0;
- result->strent = ebl_strtabadd (ctx->symbol_strtab, name, 0);
+ result->strent = dwelf_strtab_add (ctx->symbol_strtab, name);
/* The value of an ABS symbol must not be modified. Since there are
no subsection and the initial offset of the section is 0 we can
diff --git a/libasm/asm_newcomsym.c b/libasm/asm_newcomsym.c
index ee5c140..ee3b696 100644
--- a/libasm/asm_newcomsym.c
+++ b/libasm/asm_newcomsym.c
@@ -1,5 +1,5 @@
/* Create new COMMON symbol.
- Copyright (C) 2002 Red Hat, Inc.
+ Copyright (C) 2002, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -82,7 +82,7 @@
/* XXX Do we have to allow a different binding? */
result->binding = STB_GLOBAL;
result->symidx = 0;
- result->strent = ebl_strtabadd (ctx->symbol_strtab, name, 0);
+ result->strent = dwelf_strtab_add (ctx->symbol_strtab, name);
/* The value of a COM symbol is the alignment. Since there are no
subsection and the initial offset of the section is 0 we can get
diff --git a/libasm/asm_newscn.c b/libasm/asm_newscn.c
index e236769..ddbb25d 100644
--- a/libasm/asm_newscn.c
+++ b/libasm/asm_newscn.c
@@ -1,5 +1,5 @@
/* Create new section in output file.
- Copyright (C) 2002-2011 Red Hat, Inc.
+ Copyright (C) 2002-2011, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -129,8 +129,8 @@
result->subnext = NULL;
/* Add the name to the section header string table. */
- result->data.main.strent = ebl_strtabadd (result->ctx->section_strtab,
- result->name, scnname_len);
+ result->data.main.strent = dwelf_strtab_add_len (result->ctx->section_strtab,
+ result->name, scnname_len);
assert (result->data.main.strent != NULL);
/* Create the new ELF section. */
diff --git a/libasm/asm_newscngrp.c b/libasm/asm_newscngrp.c
index c5968c1..80757a9 100644
--- a/libasm/asm_newscngrp.c
+++ b/libasm/asm_newscngrp.c
@@ -1,5 +1,5 @@
/* Create new section group.
- Copyright (C) 2002 Red Hat, Inc.
+ Copyright (C) 2002, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -67,8 +67,8 @@
result->flags = flags;
memcpy (result->name, grpname, grpname_len);
- result->strent = ebl_strtabadd (ctx->section_strtab, result->name,
- grpname_len);
+ result->strent = dwelf_strtab_add_len (ctx->section_strtab, result->name,
+ grpname_len);
if (unlikely (ctx->textp))
// XXX TBI. What is the format?
diff --git a/libasm/asm_newsym.c b/libasm/asm_newsym.c
index 7f52291..5389166 100644
--- a/libasm/asm_newsym.c
+++ b/libasm/asm_newsym.c
@@ -1,5 +1,5 @@
/* Define new symbol for current position in given section.
- Copyright (C) 2002, 2005 Red Hat, Inc.
+ Copyright (C) 2002, 2005, 2016, 2017 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -44,7 +44,9 @@
asm_newsym (AsmScn_t *asmscn, const char *name, GElf_Xword size,
int type, int binding)
{
-#define TEMPSYMLEN 10
+/* We don't really expect labels with many digits, but in theory it could
+ be 10 digits (plus ".L" and a zero terminator). */
+#define TEMPSYMLEN 13
char tempsym[TEMPSYMLEN];
AsmSym_t *result;
@@ -83,8 +85,8 @@
result->type = type;
result->binding = binding;
result->symidx = 0;
- result->strent = ebl_strtabadd (asmscn->ctx->symbol_strtab,
- memcpy (result + 1, name, name_len), 0);
+ result->strent = dwelf_strtab_add (asmscn->ctx->symbol_strtab,
+ memcpy (result + 1, name, name_len));
if (unlikely (asmscn->ctx->textp))
{
@@ -118,7 +120,7 @@
reference in the string table to the string. We can only
fail to insert the symbol into the symbol table if there
is already a symbol with this name. In this case the
- ebl_strtabadd function would use the previously provided
+ dwelf_strtab_add function would use the previously provided
name. */
free (result);
result = NULL;
diff --git a/libasm/disasm_cb.c b/libasm/disasm_cb.c
index eb3689c..cf278c7 100644
--- a/libasm/disasm_cb.c
+++ b/libasm/disasm_cb.c
@@ -173,7 +173,7 @@
getsym = default_elf_getsym;
}
- return ctx->ebl->disasm (startp, end, addr, fmt, outcb, getsym, outcbarg,
- symcbarg);
+ return ctx->ebl->disasm (ctx->ebl, startp, end, addr, fmt, outcb,
+ getsym, outcbarg, symcbarg);
}
INTDEF (disasm_cb)
diff --git a/libasm/disasm_str.c b/libasm/disasm_str.c
index 5b0bb29..c14e6d5 100644
--- a/libasm/disasm_str.c
+++ b/libasm/disasm_str.c
@@ -31,7 +31,7 @@
#endif
#include <string.h>
-
+#include <system.h>
#include "libasmP.h"
diff --git a/libasm/libasmP.h b/libasm/libasmP.h
index 49b6484..54460cf 100644
--- a/libasm/libasmP.h
+++ b/libasm/libasmP.h
@@ -1,5 +1,5 @@
/* Internal definitions for libasm.
- Copyright (C) 2002, 2004, 2005 Red Hat, Inc.
+ Copyright (C) 2002, 2004, 2005, 2016 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -33,6 +33,8 @@
#include <libasm.h>
+#include "libdwelf.h"
+
/* gettext helper macros. */
#define _(Str) dgettext ("elfutils", Str)
@@ -85,7 +87,7 @@
Elf_Scn *scn;
/* Entry in the section header string table. */
- struct Ebl_Strent *strent;
+ Dwelf_Strent *strent;
/* Next member of group. */
struct AsmScn *next_in_group;
@@ -156,14 +158,14 @@
/* List with defined sections. */
AsmScn_t *section_list;
/* Section header string table. */
- struct Ebl_Strtab *section_strtab;
+ Dwelf_Strtab *section_strtab;
/* Table with defined symbols. */
asm_symbol_tab symbol_tab;
/* Number of symbols in the table. */
unsigned int nsymbol_tab;
/* Symbol string table. */
- struct Ebl_Strtab *symbol_strtab;
+ Dwelf_Strtab *symbol_strtab;
/* List of section groups. */
struct AsmScnGrp *groups;
@@ -207,7 +209,7 @@
size_t symidx;
/* Reference to name of the symbol. */
- struct Ebl_Strent *strent;
+ Dwelf_Strent *strent;
};
@@ -215,7 +217,7 @@
struct AsmScnGrp
{
/* Entry in the section header string table. */
- struct Ebl_Strent *strent;
+ Dwelf_Strent *strent;
/* The ELF section. */
Elf_Scn *scn;
diff --git a/libasm/symbolhash.c b/libasm/symbolhash.c
index 1c95418..57c9e76 100644
--- a/libasm/symbolhash.c
+++ b/libasm/symbolhash.c
@@ -1,5 +1,5 @@
/* Symbol hash table implementation.
- Copyright (C) 2001, 2002 Red Hat, Inc.
+ Copyright (C) 2001, 2002, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2001.
@@ -42,7 +42,7 @@
#define ITERATE 1
#define REVERSE 1
#define COMPARE(a, b) \
- strcmp (ebl_string ((a)->strent), ebl_string ((b)->strent))
+ strcmp (dwelf_strent_str ((a)->strent), dwelf_strent_str ((b)->strent))
#define next_prime __libasm_next_prime
extern size_t next_prime (size_t) attribute_hidden;
diff --git a/libasm/symbolhash.h b/libasm/symbolhash.h
index a5bceff..d05a40a 100644
--- a/libasm/symbolhash.h
+++ b/libasm/symbolhash.h
@@ -34,7 +34,7 @@
#define NAME asm_symbol_tab
#define ITERATE 1
#define COMPARE(a, b) \
- strcmp (ebl_string ((a)->strent), ebl_string ((b)->strent))
+ strcmp (dwelf_strent_str ((a)->strent), dwelf_strent_str ((b)->strent))
#include <dynamicsizehash.h>
#endif /* symbolhash.h */
diff --git a/libcpu/ChangeLog b/libcpu/ChangeLog
index c953c7b..86d2947 100644
--- a/libcpu/ChangeLog
+++ b/libcpu/ChangeLog
@@ -1,3 +1,56 @@
+2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
+
+ * i386_disasm.c (i386_disasm): Use FALLTHOUGH macro instead of
+ comment.
+
+2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
+
+ * memory-access.h: Use attribute_packed.
+
+2017-02-27 Ulf Hermann <ulf.hermann@qt.io>
+
+ * Makefile.am: Use fpic_CFLAGS.
+
+2017-07-18 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am: Don't check HAVE_LINUX_BPF_H, just define libcpu_bpf.
+ * bpf_disasm.c: Include bpf.h instead of linux/bpf.h. Don't define
+ BPF_PSEUDO_MAP_FD.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * Makefile.am: Add EXEEXT to gendis.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * i386_parse.y: Eliminate comparison_fn_t.
+
+2016-11-02 Mark Wielaard <mjw@redhat.com>
+
+ * i386_disasm.c (i386_disasm): Add fallthrough comment.
+
+2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+
+ * i386_lex.l: Remove system.h include, add libeu.h include.
+ * i386_parse.y: Remove sys/param.h include, add libeu.h include.
+ * i386_disasm.c: Remove sys/param.h.
+
+2016-09-05 Mark Wielaard <mjw@redhat.com>
+
+ * bpf_disasm.c: Define BPF_PSEUDO_MAP_FD if undefined.
+
+2016-08-10 Richard Henderson <rth@redhat.com>
+
+ * bpf_disasm.c (bpf_disasm): Rearrange the printing of instructions
+ to use exactly the operands required.
+
+2016-06-28 Richard Henderson <rth@redhat.com>
+
+ * Makefile.am (noinst_LIBRARIES): Add libcpu_bpf.a.
+ (libcpu_bpf_a_SOURCES, libcpu_bpf_a_CFLAGS): New.
+ * bpf_disasm.c: New file.
+ * i386_disasm.c (i386_disasm): Add ebl parameter.
+
2015-10-05 Josh Stone <jistone@redhat.com>
* Makefile.am (%_defs): Add AM_V_GEN and AM_V_at silencers.
diff --git a/libcpu/Makefile.am b/libcpu/Makefile.am
index f0caaea..4c8778d 100644
--- a/libcpu/Makefile.am
+++ b/libcpu/Makefile.am
@@ -30,7 +30,7 @@
include $(top_srcdir)/config/eu.am
AM_CPPFLAGS += -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
-I$(srcdir)/../libdw -I$(srcdir)/../libasm
-AM_CFLAGS += -fPIC -fdollars-in-identifiers
+AM_CFLAGS += $(fpic_CFLAGS) -fdollars-in-identifiers
LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) -P$(<F:lex.l=)
LEX_OUTPUT_ROOT = lex.$(<F:lex.l=)
AM_YFLAGS = -p$(<F:parse.y=)
@@ -45,6 +45,10 @@
i386_disasm.o: i386.mnemonics $(srcdir)/i386_dis.h
x86_64_disasm.o: x86_64.mnemonics $(srcdir)/x86_64_dis.h
+noinst_LIBRARIES += libcpu_bpf.a
+libcpu_bpf_a_SOURCES = bpf_disasm.c
+libcpu_bpf_a_CFLAGS = $(AM_CFLAGS) -Wno-format-nonliteral
+
%_defs: $(srcdir)/defs/i386
$(AM_V_GEN)m4 -D$* -DDISASSEMBLER $< > $@T
$(AM_V_at)mv -f $@T $@
@@ -52,10 +56,10 @@
if MAINTAINER_MODE
noinst_HEADERS = memory-access.h i386_parse.h i386_data.h
-noinst_PROGRAMS = i386_gendis
+noinst_PROGRAMS = i386_gendis$(EXEEXT)
-$(srcdir)/%_dis.h: %_defs i386_gendis
- $(AM_V_GEN)./i386_gendis $< > $@T
+$(srcdir)/%_dis.h: %_defs i386_gendis$(EXEEXT)
+ $(AM_V_GEN)./i386_gendis$(EXEEXT) $< > $@T
$(AM_V_at)mv -f $@T $@
else
diff --git a/libcpu/bpf_disasm.c b/libcpu/bpf_disasm.c
new file mode 100644
index 0000000..054aba2
--- /dev/null
+++ b/libcpu/bpf_disasm.c
@@ -0,0 +1,480 @@
+/* Disassembler for BPF.
+ Copyright (C) 2016 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 <string.h>
+#include <stdio.h>
+#include <gelf.h>
+#include <inttypes.h>
+#include "bpf.h"
+
+#include "../libelf/common.h"
+#include "../libebl/libeblP.h"
+
+static const char class_string[8][8] = {
+ [BPF_LD] = "ld",
+ [BPF_LDX] = "ldx",
+ [BPF_ST] = "st",
+ [BPF_STX] = "stx",
+ [BPF_ALU] = "alu",
+ [BPF_JMP] = "jmp",
+ [BPF_RET] = "6", /* completely unused in ebpf */
+ [BPF_ALU64] = "alu64",
+};
+
+
+#define REG(N) "r%" #N "$d"
+#define REGU(N) "(u32)" REG(N)
+#define REGS(N) "(s64)" REG(N)
+
+#define IMMS(N) "%" #N "$d"
+#define IMMX(N) "%" #N "$#x"
+
+#define OFF(N) "%" #N "$+d"
+#define JMP(N) "%" #N "$#x"
+
+#define A32(O, S) REG(1) " = " REGU(1) " " #O " " S
+#define A64(O, S) REG(1) " " #O "= " S
+#define J64(D, O, S) "if " D " " #O " " S " goto " JMP(3)
+#define LOAD(T) REG(1) " = *(" #T " *)(" REG(2) OFF(3) ")"
+#define STORE(T, S) "*(" #T " *)(" REG(1) OFF(3) ") = " S
+#define XADD(T, S) "lock *(" #T " *)(" REG(1) OFF(3) ") += " S
+#define LDSKB(T, S) "r0 = *(" #T " *)skb[" S "]"
+
+static void
+bswap_bpf_insn (struct bpf_insn *p)
+{
+ /* Note that the dst_reg and src_reg fields are 4-bit bitfields.
+ That means these two nibbles are (typically) layed out in the
+ opposite order between big- and little-endian hosts. This is
+ not required by any standard, but does happen to be true for
+ at least ppc, s390, arm and mips as big-endian hosts. */
+ int t = p->dst_reg;
+ p->dst_reg = p->src_reg;
+ p->src_reg = t;
+
+ /* The other 2 and 4 byte fields are trivially converted. */
+ CONVERT (p->off);
+ CONVERT (p->imm);
+}
+
+int
+bpf_disasm (Ebl *ebl, const uint8_t **startp, const uint8_t *end,
+ GElf_Addr addr, const char *fmt __attribute__((unused)),
+ DisasmOutputCB_t outcb,
+ DisasmGetSymCB_t symcb __attribute__((unused)),
+ void *outcbarg,
+ void *symcbarg __attribute__((unused)))
+{
+ const bool need_bswap = MY_ELFDATA != ebl->data;
+ const uint8_t *start = *startp;
+ char buf[128];
+ int len, retval = 0;
+
+ while (start + sizeof(struct bpf_insn) <= end)
+ {
+ struct bpf_insn i;
+ unsigned code, class, jmp;
+ const char *code_fmt;
+
+ memcpy(&i, start, sizeof(struct bpf_insn));
+ if (need_bswap)
+ bswap_bpf_insn (&i);
+
+ start += sizeof(struct bpf_insn);
+ addr += sizeof(struct bpf_insn);
+ jmp = addr + i.off * sizeof(struct bpf_insn);
+
+ code = i.code;
+ switch (code)
+ {
+ case BPF_LD | BPF_IMM | BPF_DW:
+ {
+ struct bpf_insn i2;
+ uint64_t imm64;
+
+ if (start + sizeof(struct bpf_insn) > end)
+ {
+ start -= sizeof(struct bpf_insn);
+ *startp = start;
+ goto done;
+ }
+ memcpy(&i2, start, sizeof(struct bpf_insn));
+ if (need_bswap)
+ bswap_bpf_insn (&i2);
+ start += sizeof(struct bpf_insn);
+ addr += sizeof(struct bpf_insn);
+
+ imm64 = (uint32_t)i.imm | ((uint64_t)i2.imm << 32);
+ switch (i.src_reg)
+ {
+ case 0:
+ code_fmt = REG(1) " = %2$#" PRIx64;
+ break;
+ case BPF_PSEUDO_MAP_FD:
+ code_fmt = REG(1) " = map_fd(%2$#" PRIx64 ")";
+ break;
+ default:
+ code_fmt = REG(1) " = ld_pseudo(%3$d, %2$#" PRIx64 ")";
+ break;
+ }
+ len = snprintf(buf, sizeof(buf), code_fmt,
+ i.dst_reg, imm64, i.src_reg);
+ }
+ break;
+
+ case BPF_JMP | BPF_EXIT:
+ len = snprintf(buf, sizeof(buf), "exit");
+ break;
+ case BPF_JMP | BPF_JA:
+ len = snprintf(buf, sizeof(buf), "goto " JMP(1), jmp);
+ break;
+ case BPF_JMP | BPF_CALL:
+ code_fmt = "call " IMMS(1);
+ goto do_imm;
+
+ case BPF_ALU | BPF_END | BPF_TO_LE:
+ /* The imm field contains {16,32,64}. */
+ code_fmt = REG(1) " = le" IMMS(2) "(" REG(1) ")";
+ goto do_dst_imm;
+ case BPF_ALU | BPF_END | BPF_TO_BE:
+ code_fmt = REG(1) " = be" IMMS(2) "(" REG(1) ")";
+ goto do_dst_imm;
+
+ case BPF_ALU | BPF_ADD | BPF_K:
+ code_fmt = A32(+, IMMS(2));
+ goto do_dst_imm;
+ case BPF_ALU | BPF_SUB | BPF_K:
+ code_fmt = A32(-, IMMS(2));
+ goto do_dst_imm;
+ case BPF_ALU | BPF_MUL | BPF_K:
+ code_fmt = A32(*, IMMS(2));
+ goto do_dst_imm;
+ case BPF_ALU | BPF_DIV | BPF_K:
+ code_fmt = A32(/, IMMS(2));
+ goto do_dst_imm;
+ case BPF_ALU | BPF_OR | BPF_K:
+ code_fmt = A32(|, IMMX(2));
+ goto do_dst_imm;
+ case BPF_ALU | BPF_AND | BPF_K:
+ code_fmt = A32(&, IMMX(2));
+ goto do_dst_imm;
+ case BPF_ALU | BPF_LSH | BPF_K:
+ code_fmt = A32(<<, IMMS(2));
+ goto do_dst_imm;
+ case BPF_ALU | BPF_RSH | BPF_K:
+ code_fmt = A32(>>, IMMS(2));
+ goto do_dst_imm;
+ case BPF_ALU | BPF_MOD | BPF_K:
+ code_fmt = A32(%%, IMMS(2));
+ goto do_dst_imm;
+ case BPF_ALU | BPF_XOR | BPF_K:
+ code_fmt = A32(^, IMMX(2));
+ goto do_dst_imm;
+ case BPF_ALU | BPF_MOV | BPF_K:
+ code_fmt = REG(1) " = " IMMX(2);
+ goto do_dst_imm;
+ case BPF_ALU | BPF_ARSH | BPF_K:
+ code_fmt = REG(1) " = (u32)((s32)" REG(1) " >> " IMMS(2) ")";
+ goto do_dst_imm;
+
+ case BPF_ALU | BPF_ADD | BPF_X:
+ code_fmt = A32(+, REGU(2));
+ goto do_dst_src;
+ case BPF_ALU | BPF_SUB | BPF_X:
+ code_fmt = A32(-, REGU(2));
+ goto do_dst_src;
+ case BPF_ALU | BPF_MUL | BPF_X:
+ code_fmt = A32(*, REGU(2));
+ goto do_dst_src;
+ case BPF_ALU | BPF_DIV | BPF_X:
+ code_fmt = A32(/, REGU(2));
+ goto do_dst_src;
+ case BPF_ALU | BPF_OR | BPF_X:
+ code_fmt = A32(|, REGU(2));
+ goto do_dst_src;
+ case BPF_ALU | BPF_AND | BPF_X:
+ code_fmt = A32(&, REGU(2));
+ goto do_dst_src;
+ case BPF_ALU | BPF_LSH | BPF_X:
+ code_fmt = A32(<<, REGU(2));
+ goto do_dst_src;
+ case BPF_ALU | BPF_RSH | BPF_X:
+ code_fmt = A32(>>, REGU(2));
+ goto do_dst_src;
+ case BPF_ALU | BPF_MOD | BPF_X:
+ code_fmt = A32(%%, REGU(2));
+ goto do_dst_src;
+ case BPF_ALU | BPF_XOR | BPF_X:
+ code_fmt = A32(^, REGU(2));
+ goto do_dst_src;
+ case BPF_ALU | BPF_MOV | BPF_X:
+ code_fmt = REG(1) " = " REGU(2);
+ goto do_dst_src;
+ case BPF_ALU | BPF_ARSH | BPF_X:
+ code_fmt = REG(1) " = (u32)((s32)" REG(1) " >> " REG(2) ")";
+ goto do_dst_src;
+
+ case BPF_ALU64 | BPF_ADD | BPF_K:
+ code_fmt = A64(+, IMMS(2));
+ goto do_dst_imm;
+ case BPF_ALU64 | BPF_SUB | BPF_K:
+ code_fmt = A64(-, IMMS(2));
+ goto do_dst_imm;
+ case BPF_ALU64 | BPF_MUL | BPF_K:
+ code_fmt = A64(*, IMMS(2));
+ goto do_dst_imm;
+ case BPF_ALU64 | BPF_DIV | BPF_K:
+ code_fmt = A64(/, IMMS(2));
+ goto do_dst_imm;
+ case BPF_ALU64 | BPF_OR | BPF_K:
+ code_fmt = A64(|, IMMS(2));
+ goto do_dst_imm;
+ case BPF_ALU64 | BPF_AND | BPF_K:
+ code_fmt = A64(&, IMMS(2));
+ goto do_dst_imm;
+ case BPF_ALU64 | BPF_LSH | BPF_K:
+ code_fmt = A64(<<, IMMS(2));
+ goto do_dst_imm;
+ case BPF_ALU64 | BPF_RSH | BPF_K:
+ code_fmt = A64(>>, IMMS(2));
+ goto do_dst_imm;
+ case BPF_ALU64 | BPF_MOD | BPF_K:
+ code_fmt = A64(%%, IMMS(2));
+ goto do_dst_imm;
+ case BPF_ALU64 | BPF_XOR | BPF_K:
+ code_fmt = A64(^, IMMS(2));
+ goto do_dst_imm;
+ case BPF_ALU64 | BPF_MOV | BPF_K:
+ code_fmt = REG(1) " = " IMMS(2);
+ goto do_dst_imm;
+ case BPF_ALU64 | BPF_ARSH | BPF_K:
+ code_fmt = REG(1) " = (s64)" REG(1) " >> " IMMS(2);
+ goto do_dst_imm;
+
+ case BPF_ALU64 | BPF_ADD | BPF_X:
+ code_fmt = A64(+, REG(2));
+ goto do_dst_src;
+ case BPF_ALU64 | BPF_SUB | BPF_X:
+ code_fmt = A64(-, REG(2));
+ goto do_dst_src;
+ case BPF_ALU64 | BPF_MUL | BPF_X:
+ code_fmt = A64(*, REG(2));
+ goto do_dst_src;
+ case BPF_ALU64 | BPF_DIV | BPF_X:
+ code_fmt = A64(/, REG(2));
+ goto do_dst_src;
+ case BPF_ALU64 | BPF_OR | BPF_X:
+ code_fmt = A64(|, REG(2));
+ goto do_dst_src;
+ case BPF_ALU64 | BPF_AND | BPF_X:
+ code_fmt = A64(&, REG(2));
+ goto do_dst_src;
+ case BPF_ALU64 | BPF_LSH | BPF_X:
+ code_fmt = A64(<<, REG(2));
+ goto do_dst_src;
+ case BPF_ALU64 | BPF_RSH | BPF_X:
+ code_fmt = A64(>>, REG(2));
+ goto do_dst_src;
+ case BPF_ALU64 | BPF_MOD | BPF_X:
+ code_fmt = A64(%%, REG(2));
+ goto do_dst_src;
+ case BPF_ALU64 | BPF_XOR | BPF_X:
+ code_fmt = A64(^, REG(2));
+ goto do_dst_src;
+ case BPF_ALU64 | BPF_MOV | BPF_X:
+ code_fmt = REG(1) " = " REG(2);
+ goto do_dst_src;
+ case BPF_ALU64 | BPF_ARSH | BPF_X:
+ code_fmt = REG(1) " = (s64)" REG(1) " >> " REG(2);
+ goto do_dst_src;
+
+ case BPF_ALU | BPF_NEG:
+ code_fmt = REG(1) " = (u32)-" REG(1);
+ goto do_dst_src;
+ case BPF_ALU64 | BPF_NEG:
+ code_fmt = REG(1) " = -" REG(1);
+ goto do_dst_src;
+
+ case BPF_JMP | BPF_JEQ | BPF_K:
+ code_fmt = J64(REG(1), ==, IMMS(2));
+ goto do_dst_imm_jmp;
+ case BPF_JMP | BPF_JGT | BPF_K:
+ code_fmt = J64(REG(1), >, IMMS(2));
+ goto do_dst_imm_jmp;
+ case BPF_JMP | BPF_JGE | BPF_K:
+ code_fmt = J64(REG(1), >=, IMMS(2));
+ goto do_dst_imm_jmp;
+ case BPF_JMP | BPF_JSET | BPF_K:
+ code_fmt = J64(REG(1), &, IMMS(2));
+ goto do_dst_imm_jmp;
+ case BPF_JMP | BPF_JNE | BPF_K:
+ code_fmt = J64(REG(1), !=, IMMS(2));
+ goto do_dst_imm_jmp;
+ case BPF_JMP | BPF_JSGT | BPF_K:
+ code_fmt = J64(REGS(1), >, IMMS(2));
+ goto do_dst_imm_jmp;
+ case BPF_JMP | BPF_JSGE | BPF_K:
+ code_fmt = J64(REGS(1), >=, IMMS(2));
+ goto do_dst_imm_jmp;
+
+ case BPF_JMP | BPF_JEQ | BPF_X:
+ code_fmt = J64(REG(1), ==, REG(2));
+ goto do_dst_src_jmp;
+ case BPF_JMP | BPF_JGT | BPF_X:
+ code_fmt = J64(REG(1), >, REG(2));
+ goto do_dst_src_jmp;
+ case BPF_JMP | BPF_JGE | BPF_X:
+ code_fmt = J64(REG(1), >=, REG(2));
+ goto do_dst_src_jmp;
+ case BPF_JMP | BPF_JSET | BPF_X:
+ code_fmt = J64(REG(1), &, REG(2));
+ goto do_dst_src_jmp;
+ case BPF_JMP | BPF_JNE | BPF_X:
+ code_fmt = J64(REG(1), !=, REG(2));
+ goto do_dst_src_jmp;
+ case BPF_JMP | BPF_JSGT | BPF_X:
+ code_fmt = J64(REGS(1), >, REGS(2));
+ goto do_dst_src_jmp;
+ case BPF_JMP | BPF_JSGE | BPF_X:
+ code_fmt = J64(REGS(1), >=, REGS(2));
+ goto do_dst_src_jmp;
+
+ case BPF_LDX | BPF_MEM | BPF_B:
+ code_fmt = LOAD(u8);
+ goto do_dst_src_off;
+ case BPF_LDX | BPF_MEM | BPF_H:
+ code_fmt = LOAD(u16);
+ goto do_dst_src_off;
+ case BPF_LDX | BPF_MEM | BPF_W:
+ code_fmt = LOAD(u32);
+ goto do_dst_src_off;
+ case BPF_LDX | BPF_MEM | BPF_DW:
+ code_fmt = LOAD(u64);
+ goto do_dst_src_off;
+
+ case BPF_STX | BPF_MEM | BPF_B:
+ code_fmt = STORE(u8, REG(2));
+ goto do_dst_src_off;
+ case BPF_STX | BPF_MEM | BPF_H:
+ code_fmt = STORE(u16, REG(2));
+ goto do_dst_src_off;
+ case BPF_STX | BPF_MEM | BPF_W:
+ code_fmt = STORE(u32, REG(2));
+ goto do_dst_src_off;
+ case BPF_STX | BPF_MEM | BPF_DW:
+ code_fmt = STORE(u64, REG(2));
+ goto do_dst_src_off;
+
+ case BPF_STX | BPF_XADD | BPF_W:
+ code_fmt = XADD(u32, REG(2));
+ goto do_dst_src_off;
+ case BPF_STX | BPF_XADD | BPF_DW:
+ code_fmt = XADD(u64, REG(2));
+ goto do_dst_src_off;
+
+ case BPF_ST | BPF_MEM | BPF_B:
+ code_fmt = STORE(u8, IMMS(2));
+ goto do_dst_imm_off;
+ case BPF_ST | BPF_MEM | BPF_H:
+ code_fmt = STORE(u16, IMMS(2));
+ goto do_dst_imm_off;
+ case BPF_ST | BPF_MEM | BPF_W:
+ code_fmt = STORE(u32, IMMS(2));
+ goto do_dst_imm_off;
+ case BPF_ST | BPF_MEM | BPF_DW:
+ code_fmt = STORE(u64, IMMS(2));
+ goto do_dst_imm_off;
+
+ case BPF_LD | BPF_ABS | BPF_B:
+ code_fmt = LDSKB(u8, IMMS(1));
+ goto do_imm;
+ case BPF_LD | BPF_ABS | BPF_H:
+ code_fmt = LDSKB(u16, IMMS(1));
+ goto do_imm;
+ case BPF_LD | BPF_ABS | BPF_W:
+ code_fmt = LDSKB(u32, IMMS(1));
+ goto do_imm;
+
+ case BPF_LD | BPF_IND | BPF_B:
+ code_fmt = LDSKB(u8, REG(1) "+" IMMS(2));
+ goto do_src_imm;
+ case BPF_LD | BPF_IND | BPF_H:
+ code_fmt = LDSKB(u16, REG(1) "+" IMMS(2));
+ goto do_src_imm;
+ case BPF_LD | BPF_IND | BPF_W:
+ code_fmt = LDSKB(u32, REG(1) "+" IMMS(2));
+ goto do_src_imm;
+
+ do_imm:
+ len = snprintf(buf, sizeof(buf), code_fmt, i.imm);
+ break;
+ do_dst_imm:
+ len = snprintf(buf, sizeof(buf), code_fmt, i.dst_reg, i.imm);
+ break;
+ do_src_imm:
+ len = snprintf(buf, sizeof(buf), code_fmt, i.src_reg, i.imm);
+ break;
+ do_dst_src:
+ len = snprintf(buf, sizeof(buf), code_fmt, i.dst_reg, i.src_reg);
+ break;
+ do_dst_imm_jmp:
+ len = snprintf(buf, sizeof(buf), code_fmt, i.dst_reg, i.imm, jmp);
+ break;
+ do_dst_src_jmp:
+ len = snprintf(buf, sizeof(buf), code_fmt,
+ i.dst_reg, i.src_reg, jmp);
+ break;
+ do_dst_imm_off:
+ len = snprintf(buf, sizeof(buf), code_fmt, i.dst_reg, i.imm, i.off);
+ break;
+ do_dst_src_off:
+ len = snprintf(buf, sizeof(buf), code_fmt,
+ i.dst_reg, i.src_reg, i.off);
+ break;
+
+ default:
+ class = BPF_CLASS(code);
+ len = snprintf(buf, sizeof(buf), "invalid class %s",
+ class_string[class]);
+ break;
+ }
+
+ *startp = start;
+ retval = outcb (buf, len, outcbarg);
+ if (retval != 0)
+ goto done;
+ }
+
+ done:
+ return retval;
+}
diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c
index 832241f..a7e03f9 100644
--- a/libcpu/i386_disasm.c
+++ b/libcpu/i386_disasm.c
@@ -41,7 +41,6 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/param.h>
#include "../libebl/libeblP.h"
@@ -313,7 +312,8 @@
int
-i386_disasm (const uint8_t **startp, const uint8_t *end, GElf_Addr addr,
+i386_disasm (Ebl *ebl __attribute__((unused)),
+ const uint8_t **startp, const uint8_t *end, GElf_Addr addr,
const char *fmt, DisasmOutputCB_t outcb, DisasmGetSymCB_t symcb,
void *outcbarg, void *symcbarg)
{
@@ -819,7 +819,7 @@
++param_start;
break;
}
-
+ FALLTHROUGH;
default:
assert (! "INVALID not handled");
}
diff --git a/libcpu/i386_lex.l b/libcpu/i386_lex.l
index 1e10dd7..ef1b53b 100644
--- a/libcpu/i386_lex.l
+++ b/libcpu/i386_lex.l
@@ -34,7 +34,7 @@
#include <error.h>
#include <libintl.h>
-#include <system.h>
+#include <libeu.h>
#include "i386_parse.h"
diff --git a/libcpu/i386_parse.y b/libcpu/i386_parse.y
index 689ba22..5fc0682 100644
--- a/libcpu/i386_parse.y
+++ b/libcpu/i386_parse.y
@@ -44,8 +44,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/param.h>
+#include <libeu.h>
#include <system.h>
#define obstack_chunk_alloc xmalloc
@@ -309,10 +309,10 @@
newp->mnemonic = $4;
if (newp->mnemonic != (void *) -1l
&& tfind ($4, &mnemonics,
- (comparison_fn_t) strcmp) == NULL)
+ (int (*)(const void *, const void *)) strcmp) == NULL)
{
if (tsearch ($4, &mnemonics,
- (comparison_fn_t) strcmp) == NULL)
+ (int (*)(const void *, const void *)) strcmp) == NULL)
error (EXIT_FAILURE, errno, "tsearch");
++nmnemonics;
}
diff --git a/libcpu/memory-access.h b/libcpu/memory-access.h
index 44210e2..779825f 100644
--- a/libcpu/memory-access.h
+++ b/libcpu/memory-access.h
@@ -90,7 +90,7 @@
int16_t s2;
int32_t s4;
int64_t s8;
- } __attribute__ ((packed));
+ } attribute_packed;
static inline uint16_t
read_2ubyte_unaligned (const void *p)
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index fc80e8d..da7ed9d 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,848 @@
+2018-06-28 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_next_cfi.c (dwarf_next_cfi): Check whether length is zero.
+
+2018-06-27 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_begin_elf.c (check_section): Allow a single .debug_frame
+ section.
+
+2018-06-26 Mark Wielaard <mark@klomp.org>
+
+ * libdw.h (dwarf_getscn_info): Remove.
+ * libdw.map (ELFUTILS_0.122): Remove dwarf_getscn_info.
+
+2018-06-25 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (libdw_a_SOURCES): Add dwarf_next_lines.c.
+ * libdw.h (dwarf_next_lines): New function declaration.
+ * libdw.map (ELFUTILS_0.173): New section.
+ * dwarf_next_lines.c: New files.
+ * dwarf_begin_elf.c (check_section): Don't error out when elf
+ decompression fails.
+ (valid_p): Allow just a single .debug_line section.
+ * dwarf_getsrclines.c (read_srclines): Keep files relative if comp_dir
+ is missing.
+
+2018-06-22 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_nextcu.c (__libdw_next_unit): Set next_off to -1 when it would
+ wrap around.
+
+2018-06-18 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_aggregate_size.c (array_size): New depth argument. Use
+ aggregate_size instead of dwarf_aggregate_size and pass depth.
+ (aggregate_size): New depth argument. Check depth isn't bigger
+ than MAX_DEPTH (256). Pass depth to recursive calls.
+ (dwarf_aggregate_size): ass zero as depth to aggregate_size.
+
+2018-06-18 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_peel_type.c (dwarf_peel_type): Limit modifier chain to 64.
+
+2018-06-18 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_aggregate_size.c (aggregate_size): Check die is not NULL.
+
+2018-06-17 Luiz Angelo Daros de Luca <luizluca@gmail.com>
+
+ * dwarf_getsrclines.c (read_srclines): Intialize filelist early.
+
+2018-06-15 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_getlocation.c (check_constant_offset): Clarify DW_FORM_data16
+ isn't really a constant.
+ (dwarf_getlocation): Don't handle DW_FORM_data16 as block.
+ (dwarf_getlocation_addr): Likewise.
+ (dwarf_getlocations): Likewise.
+
+2018-06-12 Mark Wielaard <mark@klomp.org>
+
+ * memory-access.h (read_3ubyte_unaligned_inc): New define.
+
+2018-06-12 Mark Wielaard <mark@klomp.org>
+
+ * libdw.h (__libdw_dieabbrev): Set die->abbrev to DWARF_END_ABBREV
+ on failure.
+
+2018-06-10 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_attr_integrate.c (dwarf_attr_integrate): Stop after 16 DIE
+ ref chains.
+ * dwarf_hasattr_integrate.c (dwarf_hasattr_integrate): Likewise.
+
+2018-06-08 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_getabbrev.c (dwarf_getabbrev): Check die and offset.
+
+2018-06-08 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_get_units.c (dwarf_get_units): Handle existing error, no
+ dwarf.
+
+2018-06-08 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_getlocation.c (store_implicit_value): Return error when
+ seeing bad DWARF or when tsearch runs out of memory.
+ (__libdw_intern_expression): Report error when store_implicit_value
+ reported an error.
+
+2018-06-08 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_getsrclines.c (read_srclines): Sanity check ndirs and nfiles.
+
+2018-06-08 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_getlocation_attr.c (addr_valp): Set error and return NULL
+ when there is no .debug_addr section.
+ (dwarf_getlocation_attr): If addr_valp returns NULL, then return -1.
+
+2018-06-07 Mark Wielaard <mark@klomp.org>
+
+ * libdw_findcu.c (__libdw_intern_next_unit): Report DWARF_E_VERSION,
+ not DWARF_E_INVALID_DWARF on unknown version. Set address_size and
+ offset_size to 8 when unknown.
+
+2018-06-06 Mark Wielaard <mark@klomp.org>
+
+ * libdwP.h (__libdw_dieabbrev): Check DIE addr falls in cu.
+
+2018-06-06 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_getlocation_die.c (dwarf_getlocation_die): Check offset
+ falls inside cu data.
+
+2018-06-05 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_getsrclines.c (read_srclines): Explicitly set diridx to -1
+ in case dwarf_formudata fails.
+
+2018-06-05 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_getaranges (dwarf_getaranges): Free new_arange if
+ __libdw_findcu fails.
+
+2018-06-05 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_getsrclines.c (read_srclines): Define dirarray early and
+ check whether or not it is equal to dirstack on exit/out before
+ cleanup.
+
+2018-06-05 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_getalt.c (find_debug_altlink): id_path array should be 2
+ larger to contain MAX_BUILD_ID_BYTES.
+
+2018-05-31 Mark Wielaard <mark@klomp.org>
+
+ * libdw_find_split_unit.c (try_split_file): New function extracted
+ from...
+ (__libdw_find_split_unit): ... here. Try both the relative and
+ absolute paths to find a .dwo file.
+
+2018-05-30 Mark Wielaard <mark@klomp.org>
+
+ * libdw/dwarf_getsrclines.c (read_srclines): Change ndir and
+ ndirlist to size_t. Add check to see ndirlist doesn't overflow.
+
+2018-05-31 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_dieoffset.c: Check die->cu != NULL. Return -1, not ~0ul
+ on failure.
+
+2018-05-29 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_cuoffset.c (dwarf_cuoffset): Check die->cu is not NULL.
+ * dwarf_die_addr_die.c (dwarf_die_addr_die): Also search split
+ Dwarfs.
+ * libdwP.h (struct Dwarf): Add split_tree field.
+ (__libdw_find_split_dbg_addr): New internal function definition.
+ (__libdw_finddbg_cb): Likewise.
+ * libdw_find_split_unit.c (__libdw_find_split_unit): Insert split
+ Dwarf into skeleton dbg split_tree.
+ * libdw_findcu.c (__libdw_finddbg_cb): New function.
+ (__libdw_find_split_dbg_addr): Likewise.
+ * dwarf_end (dwarf_end): Destroy split_tree.
+
+2018-05-29 Mark Wielaard <mark@klomp.org>
+
+ * dwarf.h: Add GNU DebugFission list entry encodings
+ DW_LLE_GNU_end_of_list_entry,
+ DW_LLE_GNU_base_address_selection_entry,
+ DW_LLE_GNU_start_end_entry and DW_LLE_GNU_start_length_entry.
+ * dwarf_ranges.c (__libdw_read_begin_end_pair_inc): Handle
+ GNU DebugFission list entries.
+
+2018-05-28 Mark Wielaard <mark@klomp.org>
+
+ * libdw_find_split_unit.c (__libdw_find_split_unit): End split_dwarf
+ only after we tried every unit id in it.
+
+2018-04-07 Mark Wielaard <mark@klomp.org>
+
+ * libdwP.h (struct Dwarf_CU): Add locs_base.
+ (__libdw_cu_locs_base): New static inline function.
+ * libdw_findcu.c (__libdw_intern_next_unit): Initialize locs_base.
+ * dwarf_begin_elf.c (valid_p): Create fake_loclists_cu if necessary.
+ * dwarf_end.c (dwarf_end): Clean up fake_loclists_cu.
+ * dwarf_getlocation.c (initial_offset): Handle .debug_loclists.
+ (getlocations_addr): Likewise.
+ (dwarf_getlocation_addr): Likewise.
+ * dwarf_getlocation_attr.c (attr_form_cu): Use fake_loclists_cu for
+ DWARF5.
+ (initial_offset): Handle DW_FORM_loclistx.
+ * dwarf_ranges.c (__libdw_read_begin_end_pair_inc): Handle
+ .debug_loclists.
+ * libdwP.h (struct Dwarf): Add fake_loclists_cu.
+
+2018-04-12 Mark Wielaard <mark@klomp.org>
+
+ * dwarf.h: Add DWARF5 location list entry DW_LLE encodings.
+ * begin_elf.c (dwarf_scnnames): Add IDX_debug_loclists.
+ * dwarf_error.c (errmsgs): Remove DWARF_E_NO_LOCLIST. And replace
+ with DWARF_E_NO_DEBUG_LOC, DWARF_E_NO_DEBUG_LOCLISTS and
+ DWARF_E_NO_LOC_VALUE.
+ * dwarf_formudata.c (dwarf_formudata): Handle DW_AT_loclists_base
+ and DW_FORM_loclistx.
+ * dwarf_getlocation.c (attr_ok): Use DWARF_E_NO_LOC_VALUE.
+ (initial_offset): Use DWARF_E_NO_DEBUG_LOC.
+ * libdwP.h: Add IDX_debug_rnglists. Remove DWARF_E_NO_LOCLIST.
+ Add DWARF_E_NO_DEBUG_LOC, DWARF_E_NO_DEBUG_LOCLISTS and
+ DWARF_E_NO_LOC_VALUE.
+
+2018-05-25 Mark Wielaard <mark@klomp.org>
+
+ * libdw_find_split_unit.c (__libdw_find_split_unit): Extract linking
+ skeleton and split compile units code into...
+ * libdwP (__libdw_link_skel_split): ...this new function.
+
+2018-04-06 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_formaddr.c (__libdw_addrx): New function, extracted from...
+ (dwarf_formaddr): here. Use __libdw_addrx.
+ * dwarf_getlocation.c (getlocations_addr): Pass cu to
+ __libdw_read_begin_end_pair_inc.
+ * dwarf_ranges.c (__libdw_read_begin_end_pair_inc): Take cu as
+ argument. Handle .debug_rnglists.
+ (initial_offset): Handle .debug_rnglists and DW_FORM_rnglistx.
+ (dwarf_ranges): Likewise. Check cu isn't NULL before use. Pass cu to
+ __libdw_read_begin_end_pair_inc.
+ * libdwP.h (__libdw_read_begin_end_pair_inc): Take cu as argument.
+ (__libdw_cu_ranges_base): Handle DW_AT_rnglists_base.
+ (__libdw_addrx): New function definition.
+
+2018-04-11 Mark Wielaard <mark@klomp.org>
+
+ * dwarf.h: Add DWARF5 range list entry DW_RLE encodings.
+ * begin_elf.c (dwarf_scnnames): Add IDX_debug_rnglists.
+ * dwarf_error.c (errmsgs): Add DWARF_E_NO_DEBUG_RNGLISTS.
+ * dwarf_formudata.c (dwarf_formudata): Handle DW_AT_rnglists_base
+ and DW_FORM_rnglistx.
+ * dwarf_getscopes.c (pc_match): Also check for
+ DWARF_E_NO_DEBUG_RNGLISTS.
+ * libdwP.h: Add IDX_debug_rnglists.
+
+2018-05-25 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_getlocation_attr.c (__libdw_cu_addr_base): Cast offset to
+ uintptr_t before returning as pointer.
+
+2018-05-22 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_getlocation.c (__libdw_cu_base_address): Treat errors of
+ getting lowpc or entrypc the same as missing base address (zero).
+ * dwarf_highpc (dwarf_highpc): Handle any address form. Always set
+ error when attribute could not be found.
+
+2018-05-21 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_begin_elf.c (valid_p): Add a fake_addr_cu to the result.
+ * dwarf_end.c (cu_free): Disconnect the fake_addr_cu from the split
+ dwarf if shared with skeleton.
+ (dwarf_end): release fake_addr_cu.
+ * dwarf_formaddr.c (__libdw_cu_addr_base): Move to...
+ * libdwP.h (__libdw_cu_addr_base): ... here.
+ (struct Dwarf): Add fake_addr_cu field.
+ * dwarf_formudata.c (dwarf_formudata): Handle
+ DW_FORM_GNU_addr_index and DW_FORM_addrx[1234].
+ * dwarf_getlocation_attr.c (addr_valp): New static function.
+ (dwarf_getlocation_attr): Create attribute for values of
+ DW_OP_GNU_const_index, DW_OP_constx and DW_OP_GNU_addr_index and
+ DW_OP_addrx.
+ * libdw_find_split_unit.c (__libdw_find_split_unit): Connect
+ IDX_debug_addr sectiondata and fake_addr_cu between split and
+ skeleton.
+
+2018-05-20 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_cu_info.c: New file.
+ * Makefile.am (libdw_a_SOURCES): Add dwarf_cu_info.c.
+ * libdw.h (dwarf_cu_info): New function declaration.
+ * libdw.map (ELFUTILS_0.171): Add dwarf_cu_info.
+
+2018-05-24 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_ranges.c (dwarf_ranges): Check for NULL cu.
+ * libdw_findcu.c (__libdw_intern_next_unit): Initialize ranges_base.
+
+2018-05-18 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_formudata.c (__libdw_formptr): Handle the special case
+ of IDX_debug_ranges for DW_UT_split_compile with version < 5.
+ * dwarf_highpc.c (dwarf_highpc): Use dwarf_lowpc, check for
+ split compile cudie.
+ * dwarf_lowpc.c (dwarf_lowpc): Check for split compile cudie.
+ * dwarf_ranges.c (dwarf_ranges): Switch cu and sectiondata for
+ split compile units.
+ * libdwP.h (struct Dwarf_CU): Add ranges_base field.
+ (__libdw_cu_ranges_base): New static inline function.
+
+2018-05-18 Mark Wielaard <mark@klomp.org>
+
+ * libdw_findcu.c (__libdw_intern_next_unit): Init files to NULL.
+ * dwarf_getsrclines.c (dwarf_getsrclines): Handle split units by
+ taking the line table from the skeleton.
+ * dwarf_getsrcfiles.c (dwarf_getsrcfiles): Handle split units by
+ only taking the files from .debug_line offset zero (if it exists),
+ otherwise fall back to the skeleton.
+
+2018-05-17 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_begin_elf.c (__libdw_debugdir): New function.
+ (valid_p): Call __libdw_debugdir.
+ * dwarf_end.c (dwarf_end.c): Free debugdir.
+ * dwarf_getalt.c (__libdw_filepath): Extract __libdw_debugdir logic.
+ take debugdir as argument instead of fd.
+ (find_debug_altlink): Call __libdw_filepath with debugdir.
+ * libdwP.h (struct Dwarf): Add debugdir field.
+ (__libdw_debugdir): New function prototype.
+ (__libdw_filepath): Adjust prototype to take a const char * instead of
+ an int.
+ * libdw_find_split_unit.c (__libdw_find_split_unit): Call
+ __libdw_filepath with debugdir.
+
+2018-05-17 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_attr_integrate.c (dwarf_attr_integrate): Handle split_compile
+ unit DIE, search skeleton_compile unit DIE.
+ * dwarf_hasattr_integrate.c (dwarf_hasattr_integrate): Likewise.
+ * libdwP.h (is_cudie): Check cu is not NULL.
+
+2018-05-19 Mark Wielaard <mark@klomp.org>
+
+ * libdwP.h (__libdw_find_split_unit): Mark as internal_function.
+
+2018-05-15 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (libdw_a_SOURCES): Add libdw_find_split_unit.c.
+ * dwarf_end.c (cu_free): Free split Dwarf.
+ * dwarf_get_units.c (dwarf_get_units): Handle DW_UT_skeleton by
+ calling __libdw_find_split_unit.
+ * libdwP.h (struct Dwarf_CU): Add split Dwarf_CU field.
+ (__libdw_find_split_unit): New function prototype.
+ (str_offsets_base_off): Use cu Dwarf if dbg is NULL.
+ (filepath): Rename to ...
+ (__libdw_filepath): This. Which is the actual function name in
+ dwarf_getalt.c.
+ (libdw_find_split_unit.c): New file.
+ * libdw_findcu.c (__libdw_intern_next_unit): Initialize split to -1.
+
+2018-05-15 Mark Wielaard <mark@klomp.org>
+
+ * libdwP.h (__libdw_first_die_from_cu_start): Adjust commented out
+ asserts.
+ * libdw_findcu.c (__libdw_intern_next_unit): For version 4 DWARF if
+ the cudie has a DW_AT_GNU_dwi_id set the unit_id8 and unit_type to
+ DW_UT_skeleton or DW_UT_split_compile based on whether the cudie has
+ child DIEs and a DW_AT_GNU_dwo_name attribute.
+
+2018-05-14 Mark Wielaard <mark@klomp.org>
+
+ * dwarf.h: Add GNU Debug Fission extensions. DW_AT_GNU_dwo_name,
+ DW_AT_GNU_dwo_id, DW_AT_GNU_ranges_base, DW_AT_GNU_addr_base,
+ DW_AT_GNU_pubnames, DW_AT_GNU_pubtypes. DW_FORM_GNU_addr_index,
+ DW_FORM_GNU_str_index. DW_OP_GNU_addr_index, DW_OP_GNU_const_index.
+ * dwarf_formaddr.c (dwarf_formaddr): Handle DW_FORM_GNU_addr_index
+ as DW_FORM_addrx.
+ (__libdw_cu_addr_base): Check for both DW_AT_GNU_addr_base and
+ DW_AT_addr_base.
+ * dwarf_formstring.c (dwarf_formstring): Handle DW_FORM_GNU_str_index
+ as DW_FORM_strx.
+ * dwarf_formudata.c (dwarf_formudata): Recognize DW_AT_GNU_addr_base
+ as addrptr. Recognize DW_AT_GNU_ranges_base as rangelistptr.
+ * dwarf_getlocation.c (__libdw_intern_expression): Handle
+ DW_OP_GNU_addr_index as DW_OP_addrx and DW_OP_GNU_const_index as
+ DW_OP_constx.
+ * libdw_form.c (__libdw_form_val_compute_len): Handle
+ DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index taking an uleb128.
+
+2018-05-12 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_begin_elf.c (check_section): Also recognize .dwo section
+ name variants.
+
+2018-05-11 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_formudata.c (dwarf_formudata): Handle DW_AT_macros as macptr.
+ * dwarf_getmacros.c (get_table_for_offset): Add DW_MACRO_define_sup,
+ DW_MACRO_undef_sup, DW_MACRO_import_sup, DW_MACRO_define_strx and
+ DW_MACRO_undef_strx. Add str_offsets_base_off to fake CU. Deal with
+ DW_AT_macros. Use libdw_valid_user_form.
+
+2018-05-09 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_formstring.c (__libdw_cu_str_off_base): Moved to...
+ * libdwP.h (__libdw_cu_str_off_base): ...here. Make static inline.
+ (str_offsets_base_off): New internal function that also parses
+ .debug_str_offsets header if necessary.
+
+2018-05-11 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_siblingof.c (dwarf_siblingof): Don't reference cu till it is
+ known the Dwarf_Die is came from is valid.
+ * libdwP.h (__libdw_dieabbrev): Check cu is not NULL.
+
+2018-05-08 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_formref.c (__libdw_formref): Explicitly don't handle
+ DW_FORM_ref_sup4 and DW_FORM_ref_sup8.
+ * dwarf_formref_die.c (dwarf_formref_die): Handle DW_FORM_ref_sup4
+ and DW_FORM_ref_sup8.
+ * dwarf_formstring.c (dwarf_formstring): Handle DW_FORM_strp_sup
+ as DW_FORM_GNU_strp_alt.
+
+2018-05-05 Mark Wielaard <mark@klomp.org>
+
+ * dwarf.h: Add DWARF line content descriptions.
+ * libdwP.h (libdw_valid_user_form): New static function.
+ * dwarf_getsrclines.c (read_srclines): Check and parse version 5
+ DWARF header, dir and file tables separately from older versions
+ where different.
+
+2018-04-24 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_begin_elf.c (dwarf_scnnames): Add ".debug_line_str".
+ * dwarf_error.c (errmsgs): Add DWARF_E_NO_DEBUG_STR and
+ DWARF_E_NO_DEBUG_LINE_STR.
+ * dwarf_formstring.c (dwarf_formstring): Handle DW_FORM_line_strp.
+ Get data from either .debug_str or .debug_line_str.
+ * libdwP.h: Add IDX_debug_line_str, DWARF_E_NO_DEBUG_STR and
+ DWARF_E_NO_DEBUG_LINE_STR.
+
+2018-04-03 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_formudata.c (__libdw_formptr): Take and return const
+ unsigned char pointers.
+ * dwarf_getlocation.c (attr_base_address): Rename to...
+ (__libdw_cu_base_address): this. Take Dwarf_CU, check and set
+ base_address.
+ (initial_offset_base): Renamed to...
+ (initial_offset): this. Only provide offset.
+ (getlocations_addr): Move data size check and
+ address base addition into __libdw_read_begin_end_pair_inc. Use
+ __libdw_cu_base_address and initial_offset. Drop Elf_Data NULL
+ check (already done by initial_offset, through __libdw_formptr).
+ (dwarf_getlocations): Use __libdw_cu_base_address and initial_offset.
+ Drop Elf_Data NULL check.
+ * dwarf_ranges.c (__libdw_read_begin_end_pair_inc): Change argument
+ type of readp to Add readend argument. Check data size. Include base
+ in begin and end result.
+ (initial_offset): New static function.
+ (dwarf_ranges): Don't check Elf_Data being NULL (already done by
+ initial_offset, through __libdw_formptr). Use __libdw_cu_base_address
+ and initial_offset. Remove base check and addition (already done by
+ __libdw_read_begin_end_pair_inc.
+ * libdwP.h (Dwarf_CU): Add base_address field.
+ (__libdw_read_begin_end_pair_inc): Change argument type of readp to
+ const. Add readend argument.
+ (__libdw_formptr): Take and return const unsigned char pointers.
+ * libdw_findcu.c (__libdw_intern_next_unit): Initialize Dwarf_CU
+ base_address.
+
+2018-04-04 Mark Wielaard <mark@klomp.org>
+
+ * libdw_findcu.c (__libdw_intern_next_unit): Initialize Dwarf_CU
+ addr_base and str_off_base.
+
+2018-03-23 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_begin_elf.c (dwarf_scnnames): Add IDX_debug_str_offsets,
+ increase size.
+ * dwarf_error.c (errmsgs): Add DWARF_E_NO_STR_OFFSETS.
+ * dwarf_formstring.c (dwarf_formstring): Handle DW_FORM_strx[1234].
+ (__libdw_cu_str_off_base): New function.
+ * dwarf_formudata.c (dwarf_formudata): Handle IDX_debug_str_offsets
+ as stroffsetsptr.
+ * libdwP.h: Add IDX_debug_str_offsets and DWARF_E_NO_STR_OFFSETS.
+ (struct Dwarf_CU): Add str_off_base field.
+ (__libdw_cu_str_off_base): New function declaration.
+
+2018-03-22 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_begin_elf.c (dwarf_scnnames): Add IDX_debug_addr.
+ * dwarf_error.c (errmsgs): Add DWARF_E_NO_DEBUG_ADDR.
+ * dwarf_formaddr.c (dwarf_formaddr): Handle DW_FORM_addrx[1234].
+ (__libdw_cu_addr_base): New function.
+ * dwarf_formudata.c (dwarf_formudata): Handle DW_AT_addr_base as
+ addrptr.
+ * libdwP.h: Add IDX_debug_addr and DWARF_E_NO_DEBUG_ADDR.
+ (struct Dwarf_CU): Add addr_base field.
+ (__libdw_cu_addr_base): New function definition.
+ * memory-access.h (file_byte_order): New static function.
+ (read_3ubyte_unaligned): New inline function.
+
+2018-03-29 Mark Wielaard <mark@klomp.org>
+
+ * libdw.h (dwarf_decl_file): Extend documentation.
+ (dwarf_linesrc): Likewise.
+ (dwarf_filesrc): Likewise.
+
+2018-03-06 Mark Wielaard <mark@klomp.org>
+
+ * dwarf.h: Add DW_OP_implicit_pointer, DW_OP_addrx, DW_OP_constx,
+ DW_OP_entry_value, DW_OP_const_type, DW_OP_regval_type,
+ DW_OP_deref_type, DW_OP_xderef_type, DW_OP_convert and
+ DW_OP_reinterpret.
+ * dwarf_getlocation.c (__libdw_intern_expression): Handle
+ DW_OP_convert, DW_OP_reinterpret, DW_OP_addrx, DW_OP_constx,
+ DW_OP_regval_type, DW_OP_entry_value, DW_OP_implicit_pointer,
+ DW_OP_deref_type, DW_OP_xderef_type and DW_OP_const_type.
+ * dwarf_getlocation_attr.c (dwarf_getlocation_attr): Handle
+ DW_OP_entry_value, DW_OP_const_type and DW_OP_implicit_pointer.
+ * dwarf_getlocation_die.c (dwarf_getlocation_die): Handle
+ DW_OP_implicit_pointer, DW_OP_convert, DW_OP_reinterpret,
+ DW_OP_const_type, DW_OP_regval_type, DW_OP_deref_type and
+ DW_OP_xderef_type.
+ * dwarf_getlocation_implicit_pointer.c
+ (dwarf_getlocation_implicit_pointer): Handle DW_OP_implicit_pointer.
+
+2018-03-01 Mark Wielaard <mark@klomp.org>
+
+ * dwarf.h: Add DW_AT_GNU_locviews and DW_AT_GNU_entry_view.
+ * dwarf_formudata.c (dwarf_formudata): Handle DW_AT_GNU_locviews
+ as a loclistptr.
+
+2018-02-09 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_formblock.c (dwarf_formblock): Handle DW_FORM_data16 as a
+ 16 byte block.
+
+2018-02-09 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_child.c (__libdw_find_attr): Handle DW_FORM_implicit_const.
+ * dwarf_formsdata.c (dwarf_formsdata): Likewise.
+ * dwarf_formudata.c (dwarf_formudata): Likewise.
+ * dwarf_getabbrev.c (__libdw_getabbrev): Likewise.
+ * dwarf_getattrs.c (dwarf_getattrs): Likewise.
+ * dwarf_hasattr.c (dwarf_hasattr): Likewise.
+ * dwarf_getabbrevattr.c (dwarf_getabbrevattr_data): New function
+ that will also return any data associated with the abbrev. Which
+ currently is only for DW_FORM_implicit_const. Based on...
+ (dwarf_getabbrevattr): ... this function. Which now just calls
+ dwarf_getabbrevattr_data.
+ * libdw.h (dwarf_getabbrevattr_data): Declare new function.
+ * libdw.map (ELFUTILS_0.170): Add dwarf_getabbrevattr_data.
+ * libdwP.h (dwarf_getabbrevattr_data): INTDECL.
+ * memory-access.h (__libdw_get_sleb128_unchecked): New inlined
+ function based on __libdw_get_uleb128_unchecked.
+
+2018-02-08 Mark Wielaard <mark@klomp.org>
+
+ * dwarf.h: Add DWARF5 DW_FORMs.
+ * libdwP.h (__libdw_form_val_compute_len): Handle fix length
+ DW_FORM_implicit_const, DW_FORM_addrx[1234], DW_FORM_strx[1234],
+ DW_FORM_ref_sup[48] and DW_FORM_data16.
+ * libdw_form.c (__libdw_form_val_compute_len): DW_FORM_strp_sup
+ and DW_FORM_line_strp are offset_size. DW_FORM_addrx, DW_FORM_strx,
+ DW_FORM_loclistx and DW_FORM_rnglistx are uleb128.
+
+2018-01-30 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (libdw_a_SOURCES): Add dwarf_get_units.c.
+ * dwarf_get_units.c: New file.
+ * libdw.h (dwarf_get_units): New function declaration.
+ * libdw.map (ELFUTILS_0.170): Add dwarf_get_units.
+
+2018-01-29 Mark Wielaard <mark@klomp.org>
+
+ * dwarf.h (DW_UT_*): Add DWARF Unit Header Types.
+ * dwarf_cu_die.c (dwarf_cu_die): Rename arguments. type_signaturep
+ is now called unit_idp. type_offsetp is now called subdie_offsetp.
+ * dwarf_formref_die.c (dwarf_formref_die): Scan both .debug_info
+ and .debug_types sections for type units when type signature ref
+ not found.
+ * dwarf_getaranges.c (dwarf_getaranges): Use __libdw_findcu and
+ __libdw_first_die_off_from_cu instead of trying by hand.
+ * dwarf_getlocation_die.c (dwarf_getlocation_die): Use ISV4TU
+ instead of checking type_offset by hand.
+ * dwarf_getlocation_implicit_pointer.c
+ (dwarf_getlocation_implicit_pointer): Likewise.
+ * dwarf_nextcu.c (dwarf_next_unit): Call __libdw_next_unit.
+ (__libdw_next_unit): New function based on dwarf_next_unit with
+ DWARF5 header support.
+ * libdwP.h (struct Dwarf_CU): Renamed type_offset to subdie_offset
+ and type_sig8 to unit_id8.
+ (ISV4TU): New macro to determine whether a CU is a version 4 type
+ unit (which comes from the .debug_types section).
+ (DIE_OFFSET_FROM_CU_OFFSET): Replaced macro by real function...
+ (__libdw_first_die_from_cu_start): ... that also handles DWARF5
+ unit headers.
+ (__libdw_first_die_off_from_cu): New function that calls the above
+ using the CU fields.
+ (CUDIE): Use __libdw_first_die_off_from_cu.
+ (SUBDIE): New macro that provides the DIE for a CU using the
+ subdie_offset.
+ (__libdw_next_unit): New internal function declaration.
+ * libdw_findcu.c (__libdw_intern_next_unit): Use __libdw_next_unit.
+ Accept DWARF version 5 headers. Setup unit_type.
+ (__libdw_findcu): Rename debug_types argument to v4_debug_types
+ argument (to indicate that we are looking in the .debug_types
+ section). Support finding the exact offset (unit header start).
+
+2018-01-25 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (libdw_a_SOURCES): Add dwarf_die_addr_die.c.
+ * dwarf_die_addr_die.c: New file.
+ * libdw.h (dwarf_die_addr_die): New function declaration.
+ * libdw.map (ELFUTILS_0.171): New section with dwarf_die_addr_die.
+ * libdwP.h (__libdw_findcu_addr): New internal function declaration.
+ * libdw_findcu.c (__libdw_findcu_addr): New internal function.
+
+2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
+
+ * cfi.c (execute_cfi): Use FALLTHROUGH macro instead of comment.
+ * dwarf_frame_register.c (dwarf_frame_register): Likewise.
+
+2018-01-22 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (AM_CPPFLAGS): Add -I libdwelf.
+ * dwarf_begin_elf.c (dwarf_begin_elf): Initialize Dwarf alt_fd to -1.
+ * dwarf_end.c (dwarf_end): Call dwarf_end and close on the alt_dwarf
+ and alt_fd if we allocated them.
+ * dwarf_fromref_die.c (dwarf_formref_die): Call dwarf_getalt.
+ * dwarf_formstring.c (dwarf_formstring): Likewise.
+ * dwarf_getalt.c (__libdw_filepath): New internal function.
+ (find_debug_altlink): New static function.
+ (dwarf_getalt): Check Dwarf alt_dwarf and call find_debug_altlink.
+ Cache result.
+ * dwarf_setalt.c (dwarf_setalt): Clean up Dwarf alt_dwarf and alt_fd
+ if we allocated.
+ * libdw.h (dwarf_getalt): Extend documentation.
+ (dwarf_setalt): Likewise.
+ * libdwP.h (struct Dwarf): Add alt_fd field.
+ (filepath): Declare new internal function.
+
+2018-01-14 Petr Machata <pmachata@gmail.com>
+
+ * dwarf_formsdata.c (dwarf_formsdata):
+ <DW_FORM_data1>: Cast to signed char.
+ <DW_FORM_data2,4,8>: Use read_*sbyte_unaligned instead of
+ read_*ubyte_unaligned.
+
+2017-12-26 Mark Wielaard <mark@klomp.org>
+
+ * libdwP.h (struct Dwarf_Abbrev): Pack struct. Remove attrcnt,
+ use bitfields for has_children and code.
+ * dwarf_getabbrev.c (__libdw_getabbrev): Don't count attrs.
+ * dwarf_getattrcnt.c (dwarf_getattrcnt): Count attrs.
+
+2017-12-26 Mark Wielaard <mark@klomp.org>
+
+ * memory-access.h (__libdw_get_uleb128_unchecked): New function.
+ (get_uleb128_unchecked): New define.
+ * dwarf_child.c (__libdw_find_attr): Use get_uleb128_unchecked to
+ read attr name and form.
+ * dwarf_getabbrevattr.c (dwarf_getabbrevattr): Likewise.
+ * dwarf_getattrs.c (dwarf_getattrs): Likewise.
+ * dwarf_hasattr.c (dwarf_hasattr): Likewise.
+
+2017-12-28 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_offdie.c (__libdw_offdie): Check sectiondata exists.
+
+2017-05-09 Ulf Hermann <ulf.hermann@qt.io>
+ Mark Wielaard <mark@klomp.org>
+
+ * libdwP.h (__libdw_in_section): Fix check for the upper border of
+ the range.
+ (__libdw_offset_in_section): Likewise.
+
+2017-12-20 Mark Wielaard <mark@klomp.org>
+
+ * libdwP.h (struct Dwarf_CU): Add sec_idx field.
+ (cu_sec_idx): Return cu->sec_idx.
+ * libdw_findcu.c (__libdw_intern_next_unit): Set cu sec_idx to
+ IDX_debug_info or IDX_debug_types.
+ * dwarf_begin_elf.c (valid_p): Set fake_loc_cu->sec_idx to
+ IDX_debug_loc.
+ * dwarf_getmacros.c (read_macros): Set fake_cu->sec_idx to
+ IDX_debug_macro or IDX_debug_macinfo.
+
+2017-12-12 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_aggregate_size.c (dwarf_aggregate_size): Don't peel the
+ given DIE. Reserve memory for a new DIE first.
+
+2017-12-11 Dima Kogan <dima@secretsauce.net>
+
+ * dwarf_aggregate_size.c (array_size): Handle multi-dimensional
+ arrays properly.
+
+2017-11-03 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_getlocation.c (__libdw_intern_expression): Handle
+ DW_OP_GNU_variable_value.
+ * dwarf_getlocation_attr.c (dwarf_getlocation_attr): Likewise.
+ * dwarf_getlocation_die.c (dwarf_getlocation_die): Likewise.
+
+2017-11-03 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_getlocation.c (attr_ok): Always accept DW_FORM_exprloc.
+ Update list of acceptable attribute codes based on DWARF5.
+
+2017-11-03 Mark Wielaard <mark@klomp.org>
+
+ * dwarf.h: Add DW_OP_GNU_variable_value.
+
+2017-10-03 Mark Wielaard <mark@klomp.org>
+
+ * libdw.h: Define LIBDW_CIE_ID and use it in dwarf_cfi_cie_p.
+
+2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
+
+ * memory-access.h: Use attribute_packed.
+
+2017-02-27 Ulf Hermann <ulf.hermann@qt.io>
+
+ * libdwP.h: Use attribute_hidden.
+ * libdw_alloc.c: Likewise.
+
+2017-02-27 Ulf Hermann <ulf.hermann@qt.io>
+
+ * Makefile.am: Use fpic_CFLAGS and dso_LDFLAGS.
+
+2017-07-26 Mark Wielaard <mark@klomp.org>
+
+ * dwarf.h: Add DW_MACRO_* and compat defines for DW_MACRO_GNU_*.
+ * dwarf_getmacros.c (get_table_for_offset): Accept either version
+ 4 or 5. Use DW_MACRO names instead of DW_MACRO_GNU names.
+ (read_macros): Use table version for fake_cu.
+
+2017-07-26 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_peel_type.c (dwarf_peel_type): Handle DW_TAG_immutable_type,
+ DW_TAG_packed_type and DW_TAG_shared_type.
+ * libdw.h (dwarf_peel_type): Extend documentation.
+
+2017-07-26 Mark Wielaard <mark@klomp.org>
+
+ * dwarf.h: Add DW_DEFAULTED_no, DW_DEFAULTED_in_class and
+ DW_DEFAULTED_out_of_class.
+
+2017-07-26 Mark Wielaard <mark@klomp.org>
+
+ * dwarf.h: Add DW_CC_pass_by_reference and DW_CC_pass_by_reference.
+
+2017-07-26 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_default_lower_bound.c: New file.
+ * Makefile.am (libdw_a_SOURCES): Add dwarf_default_lower_bound.c.
+ * dwarf_aggregate_size.c (array_size): Use dwarf_default_lower_bound.
+ * dwarf_error.c (errmsgs): Add DWARF_E_UNKNOWN_LANGUAGE.
+ * libdw.h: Add dwarf_default_lower_bound.
+ * libdw.map (ELFUTILS_0.170): Add dwarf_default_lower_bound.
+ * libdwP.h: Add DWARF_E_UNKNOWN_LANGUAGE and
+ dwarf_default_lower_bound INTDECL.
+
+2017-07-26 Mark Wielaard <mark@klomp.org>
+
+ * dwarf.h: Add DW_LANG_OpenCL, DW_LANG_Modula3,
+ DW_LANG_C_plus_plus_03, DW_LANG_OCaml, DW_LANG_Rust, DW_LANG_Swift,
+ DW_LANG_Julia, DW_LANG_Dylan, DW_LANG_RenderScript, DW_LANG_BLISS.
+ * dwarf_aggregate_size.c (array_size): Add lower bound for
+ DW_LANG_C_plus_plus_03, DW_LANG_Python, DW_LANG_OpenCL,
+ DW_LANG_Haskell, DW_LANG_OCaml, DW_LANG_Rust, DW_LANG_Swift,
+ DW_LANG_Dylan, DW_LANG_RenderScript, DW_LANG_Modula3,
+ DW_LANG_Julia and DW_LANG_BLISS.
+
+2017-07-26 Mark Wielaard <mark@klomp.org>
+
+ * dwarf.h: Add DW_ATE_UCS and DW_ATE_ASCII.
+
+2017-07-25 Mark Wielaard <mark@klomp.org>
+
+ * dwarf.h: Add DW_TAG_coarray_type, DW_TAG_generic_subrange,
+ DW_TAG_dynamic_type, DW_TAG_call_site, DW_TAG_call_site_parameter,
+ DW_TAG_skeleton_unit, DW_TAG_immutable_type. Add reserved comments
+ for currently unused numbers.
+
+2017-07-25 Mark Wielaard <mark@klomp.org>
+
+ * dwarf.h (DWARF attributes enum): Remove DW_AT_subscr_data,
+ DW_AT_element_list and DW_AT_member. Add DWARF5 attribute constants.
+ (DW_AT_subscr_data, DW_AT_element_list, DW_AT_member): New defines.
+
+2017-07-21 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_line_file.c: New file.
+ * Makefile.am (libdw_a_SOURCES): Add dwarf_line_file.c.
+ * libdw.h (dwarf_line_file): New function declaration.
+ * libdw.map (ELFUTILS_0.170): New. Add dwarf_line_file.
+
+2017-02-17 Ulf Hermann <ulf.hermann@qt.io>
+
+ * Makefile.am: Add libdw_so_LIBS to specify the archives libdw is is
+ made of, libdw_so_DEPS for libraries it depends on (including
+ libeu.a), libdw_so_LDLIBS to specify libraries libdw links against.
+ (libdw.so$(EXEEXT)): Add $(libdw_so_LDLIBS), remove enumeration of
+ library dependencies, use libdw_so_LIBS rather than relying on the
+ order of dependencies specified, add -z,relro.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * libdw.h: Remove attribute macro declarations and use
+ __noreturn_attribute__ as defined in libelf.h.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * dwarf_begin_elf.c: Include endian.h.
+
+2017-03-30 Mark Wielaard <mjw@redhat.com>
+
+ * dwarf_peel_type.c (dwarf_peel_type): Call dwarf_attr_integrate on
+ result.
+
+2016-10-22 Mark Wielaard <mjw@redhat.com>
+
+ * dwarf.h: Correct spelling of DW_LANG_PLI. Add compatibility define.
+ * dwarf_aggregate_size.c (array_size): Use correct spelling of
+ DW_LANG_PLI.
+
+2016-11-02 Mark Wielaard <mjw@redhat.com>
+
+ * cfi.c (execute_cfi): Add fallthrough comments.
+ * encoded-value.h (encoded_value_size): Add explicit return instead
+ of relying on fallthrough.
+ * dwfl_report_elf.c (__libdwfl_elf_address_range): Add fallthrough
+ comment.
+
+2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+
+ * dwarf_getpubnames.c: Remove sys/param.h include, add system.h.
+ * libdw_alloc.c: Likewise.
+
+2016-07-08 Mark Wielaard <mjw@redhat.com>
+
+ * libdw.map (ELFUTILS_0.167): New. Add dwelf_strtab_init,
+ dwelf_strtab_add, dwelf_strtab_add_len, dwelf_strtab_finalize,
+ dwelf_strent_off, dwelf_strent_str and dwelf_strtab_free.
+
+2016-02-13 Mark Wielaard <mjw@redhat.com>
+
+ * dwarf_getsrclines.c (read_srclines): Calculate ndirs first, then
+ assign to ndirlist.
+
2015-12-18 Mark Wielaard <mjw@redhat.com>
* libdwP.h (struct Dwarf): Remove sectiondata_gzip_mask.
diff --git a/libdw/Makefile.am b/libdw/Makefile.am
index 082d96c..7a3d532 100644
--- a/libdw/Makefile.am
+++ b/libdw/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to create Makefile.in
##
-## Copyright (C) 2002-2010, 2012, 2014 Red Hat, Inc.
+## Copyright (C) 2002-2010, 2012, 2014, 2016, 2018 Red Hat, Inc.
## This file is part of elfutils.
##
## This file is free software; you can redistribute it and/or modify
@@ -29,9 +29,9 @@
##
include $(top_srcdir)/config/eu.am
if BUILD_STATIC
-AM_CFLAGS += -fPIC
+AM_CFLAGS += $(fpic_CFLAGS)
endif
-AM_CPPFLAGS += -I$(srcdir)/../libelf
+AM_CPPFLAGS += -I$(srcdir)/../libelf -I$(srcdir)/../libdwelf
VERSION = 1
lib_LIBRARIES = libdw.a
@@ -65,7 +65,7 @@
dwarf_lineendsequence.c dwarf_lineblock.c \
dwarf_lineprologueend.c dwarf_lineepiloguebegin.c \
dwarf_lineisa.c dwarf_linediscriminator.c \
- dwarf_lineop_index.c \
+ dwarf_lineop_index.c dwarf_line_file.c \
dwarf_onesrcline.c dwarf_formblock.c \
dwarf_getsrcfiles.c dwarf_filesrc.c dwarf_getsrcdirs.c \
dwarf_getlocation.c dwarf_getstring.c dwarf_offabbrev.c \
@@ -89,7 +89,10 @@
dwarf_aggregate_size.c dwarf_getlocation_implicit_pointer.c \
dwarf_getlocation_die.c dwarf_getlocation_attr.c \
dwarf_getalt.c dwarf_setalt.c dwarf_cu_getdwarf.c \
- dwarf_cu_die.c dwarf_peel_type.c
+ dwarf_cu_die.c dwarf_peel_type.c dwarf_default_lower_bound.c \
+ dwarf_die_addr_die.c dwarf_get_units.c \
+ libdw_find_split_unit.c dwarf_cu_info.c \
+ dwarf_next_lines.c
if MAINTAINER_MODE
BUILT_SOURCES = $(srcdir)/known-dwarf.h
@@ -102,17 +105,20 @@
libdw_pic_a_SOURCES =
am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
+libdw_so_LIBS = libdw_pic.a ../libdwelf/libdwelf_pic.a \
+ ../libdwfl/libdwfl_pic.a ../libebl/libebl.a
+libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so
+libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS)
libdw_so_SOURCES =
-libdw.so$(EXEEXT): $(srcdir)/libdw.map libdw_pic.a ../libdwelf/libdwelf_pic.a \
- ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \
- ../libelf/libelf.so
+libdw.so$(EXEEXT): $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS)
# The rpath is necessary for libebl because its $ORIGIN use will
# not fly in a setuid executable that links in libdw.
- $(AM_V_CCLD)$(LINK) -shared -o $@ -Wl,--soname,$@.$(VERSION),-z,defs \
+ $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
+ -Wl,--soname,$@.$(VERSION) \
-Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
-Wl,--version-script,$<,--no-undefined \
- -Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
- -ldl -lz $(argp_LDADD) $(zip_LIBS)
+ -Wl,--whole-archive $(libdw_so_LIBS) -Wl,--no-whole-archive \
+ $(libdw_so_LDLIBS)
@$(textrel_check)
$(AM_V_at)ln -fs $@ $@.$(VERSION)
diff --git a/libdw/cfi.c b/libdw/cfi.c
index 1fd668d..341e055 100644
--- a/libdw/cfi.c
+++ b/libdw/cfi.c
@@ -138,6 +138,7 @@
case DW_CFA_advance_loc1:
operand = *program++;
+ FALLTHROUGH;
case DW_CFA_advance_loc + 0 ... DW_CFA_advance_loc + CFI_PRIMARY_MAX:
advance_loc:
loc += operand * cie->code_alignment_factor;
@@ -300,6 +301,7 @@
case DW_CFA_restore_extended:
get_uleb128 (operand, program, end);
+ FALLTHROUGH;
case DW_CFA_restore + 0 ... DW_CFA_restore + CFI_PRIMARY_MAX:
if (unlikely (abi_cfi) && likely (opcode == DW_CFA_restore))
diff --git a/libdw/dwarf.h b/libdw/dwarf.h
index b5c58d7..dc59733 100644
--- a/libdw/dwarf.h
+++ b/libdw/dwarf.h
@@ -1,5 +1,5 @@
/* This file defines standard DWARF types, structures, and macros.
- Copyright (C) 2000-2011, 2014 Red Hat, Inc.
+ Copyright (C) 2000-2011, 2014, 2016, 2017, 2018 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -29,6 +29,20 @@
#ifndef _DWARF_H
#define _DWARF_H 1
+/* DWARF Unit Header Types. */
+enum
+ {
+ DW_UT_compile = 0x01,
+ DW_UT_type = 0x02,
+ DW_UT_partial = 0x03,
+ DW_UT_skeleton = 0x04,
+ DW_UT_split_compile = 0x05,
+ DW_UT_split_type = 0x06,
+
+ DW_UT_lo_user = 0x80,
+ DW_UT_hi_user = 0xff
+ };
+
/* DWARF tags. */
enum
{
@@ -37,15 +51,21 @@
DW_TAG_entry_point = 0x03,
DW_TAG_enumeration_type = 0x04,
DW_TAG_formal_parameter = 0x05,
+ /* 0x06 reserved. */
+ /* 0x07 reserved. */
DW_TAG_imported_declaration = 0x08,
+ /* 0x09 reserved. */
DW_TAG_label = 0x0a,
DW_TAG_lexical_block = 0x0b,
+ /* 0x0c reserved. */
DW_TAG_member = 0x0d,
+ /* 0x0e reserved. */
DW_TAG_pointer_type = 0x0f,
DW_TAG_reference_type = 0x10,
DW_TAG_compile_unit = 0x11,
DW_TAG_string_type = 0x12,
DW_TAG_structure_type = 0x13,
+ /* 0x14 reserved. */
DW_TAG_subroutine_type = 0x15,
DW_TAG_typedef = 0x16,
DW_TAG_union_type = 0x17,
@@ -87,15 +107,20 @@
DW_TAG_unspecified_type = 0x3b,
DW_TAG_partial_unit = 0x3c,
DW_TAG_imported_unit = 0x3d,
- /* 0x3e reserved. */
+ /* 0x3e reserved. Was DW_TAG_mutable_type. */
DW_TAG_condition = 0x3f,
DW_TAG_shared_type = 0x40,
DW_TAG_type_unit = 0x41,
DW_TAG_rvalue_reference_type = 0x42,
DW_TAG_template_alias = 0x43,
-
- /* DWARF 5. */
+ DW_TAG_coarray_type = 0x44,
+ DW_TAG_generic_subrange = 0x45,
+ DW_TAG_dynamic_type = 0x46,
DW_TAG_atomic_type = 0x47,
+ DW_TAG_call_site = 0x48,
+ DW_TAG_call_site_parameter = 0x49,
+ DW_TAG_skeleton_unit = 0x4a,
+ DW_TAG_immutable_type = 0x4b,
DW_TAG_lo_user = 0x4080,
@@ -131,17 +156,23 @@
DW_AT_sibling = 0x01,
DW_AT_location = 0x02,
DW_AT_name = 0x03,
+ /* 0x04 reserved. */
+ /* 0x05 reserved. */
+ /* 0x06 reserved. */
+ /* 0x07 reserved. */
+ /* 0x08 reserved. */
DW_AT_ordering = 0x09,
- DW_AT_subscr_data = 0x0a,
+ /* 0x0a reserved. */
DW_AT_byte_size = 0x0b,
- DW_AT_bit_offset = 0x0c,
+ DW_AT_bit_offset = 0x0c, /* Deprecated in DWARF4. */
DW_AT_bit_size = 0x0d,
- DW_AT_element_list = 0x0f,
+ /* 0x0e reserved. */
+ /* 0x0f reserved. */
DW_AT_stmt_list = 0x10,
DW_AT_low_pc = 0x11,
DW_AT_high_pc = 0x12,
DW_AT_language = 0x13,
- DW_AT_member = 0x14,
+ /* 0x14 reserved. */
DW_AT_discr = 0x15,
DW_AT_discr_value = 0x16,
DW_AT_visibility = 0x17,
@@ -152,15 +183,24 @@
DW_AT_const_value = 0x1c,
DW_AT_containing_type = 0x1d,
DW_AT_default_value = 0x1e,
+ /* 0x1f reserved. */
DW_AT_inline = 0x20,
DW_AT_is_optional = 0x21,
DW_AT_lower_bound = 0x22,
+ /* 0x23 reserved. */
+ /* 0x24 reserved. */
DW_AT_producer = 0x25,
+ /* 0x26 reserved. */
DW_AT_prototyped = 0x27,
+ /* 0x28 reserved. */
+ /* 0x29 reserved. */
DW_AT_return_addr = 0x2a,
+ /* 0x2b reserved. */
DW_AT_start_scope = 0x2c,
+ /* 0x2d reserved. */
DW_AT_bit_stride = 0x2e,
DW_AT_upper_bound = 0x2f,
+ /* 0x30 reserved. */
DW_AT_abstract_origin = 0x31,
DW_AT_accessibility = 0x32,
DW_AT_address_class = 0x33,
@@ -179,7 +219,7 @@
DW_AT_frame_base = 0x40,
DW_AT_friend = 0x41,
DW_AT_identifier_case = 0x42,
- DW_AT_macro_info = 0x43,
+ DW_AT_macro_info = 0x43, /* Deprecated in DWARF5. */
DW_AT_namelist_item = 0x44,
DW_AT_priority = 0x45,
DW_AT_segment = 0x46,
@@ -223,9 +263,36 @@
DW_AT_const_expr = 0x6c,
DW_AT_enum_class = 0x6d,
DW_AT_linkage_name = 0x6e,
-
- /* DWARF5 attribute values. */
+ DW_AT_string_length_bit_size = 0x6f,
+ DW_AT_string_length_byte_size = 0x70,
+ DW_AT_rank = 0x71,
+ DW_AT_str_offsets_base = 0x72,
+ DW_AT_addr_base = 0x73,
+ DW_AT_rnglists_base = 0x74,
+ /* 0x75 reserved. */
+ DW_AT_dwo_name = 0x76,
+ DW_AT_reference = 0x77,
+ DW_AT_rvalue_reference = 0x78,
+ DW_AT_macros = 0x79,
+ DW_AT_call_all_calls = 0x7a,
+ DW_AT_call_all_source_calls = 0x7b,
+ DW_AT_call_all_tail_calls = 0x7c,
+ DW_AT_call_return_pc = 0x7d,
+ DW_AT_call_value = 0x7e,
+ DW_AT_call_origin = 0x7f,
+ DW_AT_call_parameter = 0x80,
+ DW_AT_call_pc = 0x81,
+ DW_AT_call_tail_call = 0x82,
+ DW_AT_call_target = 0x83,
+ DW_AT_call_target_clobbered = 0x84,
+ DW_AT_call_data_location = 0x85,
+ DW_AT_call_data_value = 0x86,
DW_AT_noreturn = 0x87,
+ DW_AT_alignment = 0x88,
+ DW_AT_export_symbols = 0x89,
+ DW_AT_deleted = 0x8a,
+ DW_AT_defaulted = 0x8b,
+ DW_AT_loclists_base = 0x8c,
DW_AT_lo_user = 0x2000,
@@ -272,12 +339,30 @@
DW_AT_GNU_all_tail_call_sites = 0x2116,
DW_AT_GNU_all_call_sites = 0x2117,
DW_AT_GNU_all_source_call_sites = 0x2118,
+ DW_AT_GNU_locviews = 0x2137,
+ DW_AT_GNU_entry_view = 0x2138,
DW_AT_GNU_macros = 0x2119,
DW_AT_GNU_deleted = 0x211a,
+ /* GNU Debug Fission extensions. */
+ DW_AT_GNU_dwo_name = 0x2130,
+ DW_AT_GNU_dwo_id = 0x2131,
+ DW_AT_GNU_ranges_base = 0x2132,
+ DW_AT_GNU_addr_base = 0x2133,
+ DW_AT_GNU_pubnames = 0x2134,
+ DW_AT_GNU_pubtypes = 0x2135,
DW_AT_hi_user = 0x3fff
};
+/* Old unofficially attribute names. Should not be used.
+ Will not appear in known-dwarf.h */
+
+/* DWARF1 array subscripts and element data types. */
+#define DW_AT_subscr_data 0x0a
+/* DWARF1 enumeration literals. */
+#define DW_AT_element_list 0x0f
+/* DWARF1 reference for variable to member structure, class or union. */
+#define DW_AT_member 0x14
/* DWARF form encodings. */
enum
@@ -306,7 +391,29 @@
DW_FORM_sec_offset = 0x17,
DW_FORM_exprloc = 0x18,
DW_FORM_flag_present = 0x19,
+ DW_FORM_strx = 0x1a,
+ DW_FORM_addrx = 0x1b,
+ DW_FORM_ref_sup4 = 0x1c,
+ DW_FORM_strp_sup = 0x1d,
+ DW_FORM_data16 = 0x1e,
+ DW_FORM_line_strp = 0x1f,
DW_FORM_ref_sig8 = 0x20,
+ DW_FORM_implicit_const = 0x21,
+ DW_FORM_loclistx = 0x22,
+ DW_FORM_rnglistx = 0x23,
+ DW_FORM_ref_sup8 = 0x24,
+ DW_FORM_strx1 = 0x25,
+ DW_FORM_strx2 = 0x26,
+ DW_FORM_strx3 = 0x27,
+ DW_FORM_strx4 = 0x28,
+ DW_FORM_addrx1 = 0x29,
+ DW_FORM_addrx2 = 0x2a,
+ DW_FORM_addrx3 = 0x2b,
+ DW_FORM_addrx4 = 0x2c,
+
+ /* GNU Debug Fission extensions. */
+ DW_FORM_GNU_addr_index = 0x1f01,
+ DW_FORM_GNU_str_index = 0x1f02,
DW_FORM_GNU_ref_alt = 0x1f20, /* offset in alternate .debuginfo. */
DW_FORM_GNU_strp_alt = 0x1f21 /* offset in alternate .debug_str. */
@@ -471,6 +578,17 @@
DW_OP_implicit_value = 0x9e, /* DW_FORM_block follows opcode. */
DW_OP_stack_value = 0x9f, /* No operands, special like DW_OP_piece. */
+ DW_OP_implicit_pointer = 0xa0,
+ DW_OP_addrx = 0xa1,
+ DW_OP_constx = 0xa2,
+ DW_OP_entry_value = 0xa3,
+ DW_OP_const_type = 0xa4,
+ DW_OP_regval_type = 0xa5,
+ DW_OP_deref_type = 0xa6,
+ DW_OP_xderef_type = 0xa7,
+ DW_OP_convert = 0xa8,
+ DW_OP_reinterpret = 0xa9,
+
/* GNU extensions. */
DW_OP_GNU_push_tls_address = 0xe0,
DW_OP_GNU_uninit = 0xf0,
@@ -484,6 +602,12 @@
DW_OP_GNU_reinterpret = 0xf9,
DW_OP_GNU_parameter_ref = 0xfa,
+ /* GNU Debug Fission extensions. */
+ DW_OP_GNU_addr_index = 0xfb,
+ DW_OP_GNU_const_index = 0xfc,
+
+ DW_OP_GNU_variable_value = 0xfd,
+
DW_OP_lo_user = 0xe0, /* Implementation-defined range start. */
DW_OP_hi_user = 0xff /* Implementation-defined range end. */
};
@@ -509,6 +633,8 @@
DW_ATE_unsigned_fixed = 0xe,
DW_ATE_decimal_float = 0xf,
DW_ATE_UTF = 0x10,
+ DW_ATE_UCS = 0x11,
+ DW_ATE_ASCII = 0x12,
DW_ATE_lo_user = 0x80,
DW_ATE_hi_user = 0xff
@@ -582,26 +708,37 @@
DW_LANG_C99 = 0x000c, /* ISO C:1999 */
DW_LANG_Ada95 = 0x000d, /* ISO Ada:1995 */
DW_LANG_Fortran95 = 0x000e, /* ISO Fortran 95 */
- DW_LANG_PL1 = 0x000f, /* ISO PL/1:1976 */
+ DW_LANG_PLI = 0x000f, /* ISO PL/1:1976 */
DW_LANG_ObjC = 0x0010, /* Objective-C */
DW_LANG_ObjC_plus_plus = 0x0011, /* Objective-C++ */
DW_LANG_UPC = 0x0012, /* Unified Parallel C */
DW_LANG_D = 0x0013, /* D */
DW_LANG_Python = 0x0014, /* Python */
+ DW_LANG_OpenCL = 0x0015, /* OpenCL */
DW_LANG_Go = 0x0016, /* Go */
+ DW_LANG_Modula3 = 0x0017, /* Modula-3 */
DW_LANG_Haskell = 0x0018, /* Haskell */
+ DW_LANG_C_plus_plus_03 = 0x0019, /* ISO C++:2003 */
DW_LANG_C_plus_plus_11 = 0x001a, /* ISO C++:2011 */
+ DW_LANG_OCaml = 0x001b, /* OCaml */
+ DW_LANG_Rust = 0x001c, /* Rust */
DW_LANG_C11 = 0x001d, /* ISO C:2011 */
+ DW_LANG_Swift = 0x001e, /* Swift */
+ DW_LANG_Julia = 0x001f, /* Julia */
+ DW_LANG_Dylan = 0x0020, /* Dylan */
DW_LANG_C_plus_plus_14 = 0x0021, /* ISO C++:2014 */
DW_LANG_Fortran03 = 0x0022, /* ISO/IEC 1539-1:2004 */
DW_LANG_Fortran08 = 0x0023, /* ISO/IEC 1539-1:2010 */
-
+ DW_LANG_RenderScript = 0x0024, /* RenderScript Kernal Language */
+ DW_LANG_BLISS = 0x0025, /* BLISS */
DW_LANG_lo_user = 0x8000,
DW_LANG_Mips_Assembler = 0x8001, /* Assembler */
DW_LANG_hi_user = 0xffff
};
+/* Old (typo) '1' != 'I'. */
+#define DW_LANG_PL1 DW_LANG_PLI
/* DWARF identifier case encodings. */
enum
@@ -613,12 +750,17 @@
};
-/* DWARF calling conventions encodings. */
+/* DWARF calling conventions encodings.
+ Used as values of DW_AT_calling_convention for subroutines
+ (normal, program or nocall) or structures, unions and class types
+ (normal, reference or value). */
enum
{
DW_CC_normal = 0x1,
DW_CC_program = 0x2,
DW_CC_nocall = 0x3,
+ DW_CC_pass_by_reference = 0x4,
+ DW_CC_pass_by_value = 0x5,
DW_CC_lo_user = 0x40,
DW_CC_hi_user = 0xff
};
@@ -649,6 +791,25 @@
DW_DSC_range = 1
};
+/* DWARF defaulted member function encodings. */
+enum
+ {
+ DW_DEFAULTED_no = 0,
+ DW_DEFAULTED_in_class = 1,
+ DW_DEFAULTED_out_of_class = 2
+ };
+
+/* DWARF line content descriptions. */
+enum
+ {
+ DW_LNCT_path = 0x1,
+ DW_LNCT_directory_index = 0x2,
+ DW_LNCT_timestamp = 0x3,
+ DW_LNCT_size = 0x4,
+ DW_LNCT_MD5 = 0x5,
+ DW_LNCT_lo_user = 0x2000,
+ DW_LNCT_hi_user = 0x3fff
+ };
/* DWARF standard opcode encodings. */
enum
@@ -692,18 +853,75 @@
};
-/* DWARF debug_macro type encodings. GNU/DWARF5 extension. */
+/* DWARF debug_macro type encodings. */
enum
{
- DW_MACRO_GNU_define = 0x01,
- DW_MACRO_GNU_undef = 0x02,
- DW_MACRO_GNU_start_file = 0x03,
- DW_MACRO_GNU_end_file = 0x04,
- DW_MACRO_GNU_define_indirect = 0x05,
- DW_MACRO_GNU_undef_indirect = 0x06,
- DW_MACRO_GNU_transparent_include = 0x07,
- DW_MACRO_GNU_lo_user = 0xe0,
- DW_MACRO_GNU_hi_user = 0xff
+ DW_MACRO_define = 0x01,
+ DW_MACRO_undef = 0x02,
+ DW_MACRO_start_file = 0x03,
+ DW_MACRO_end_file = 0x04,
+ DW_MACRO_define_strp = 0x05,
+ DW_MACRO_undef_strp = 0x06,
+ DW_MACRO_import = 0x07,
+ DW_MACRO_define_sup = 0x08,
+ DW_MACRO_undef_sup = 0x09,
+ DW_MACRO_import_sup = 0x0a,
+ DW_MACRO_define_strx = 0x0b,
+ DW_MACRO_undef_strx = 0x0c,
+ DW_MACRO_lo_user = 0xe0,
+ DW_MACRO_hi_user = 0xff
+ };
+
+/* Old GNU extension names for DWARF5 debug_macro type encodings.
+ There are no equivalents for the supplementary object file (sup)
+ and indirect string references (strx). */
+#define DW_MACRO_GNU_define DW_MACRO_define
+#define DW_MACRO_GNU_undef DW_MACRO_undef
+#define DW_MACRO_GNU_start_file DW_MACRO_start_file
+#define DW_MACRO_GNU_end_file DW_MACRO_end_file
+#define DW_MACRO_GNU_define_indirect DW_MACRO_define_strp
+#define DW_MACRO_GNU_undef_indirect DW_MACRO_undef_strp
+#define DW_MACRO_GNU_transparent_include DW_MACRO_import
+#define DW_MACRO_GNU_lo_user DW_MACRO_lo_user
+#define DW_MACRO_GNU_hi_user DW_MACRO_hi_user
+
+
+/* Range list entry encoding. */
+enum
+ {
+ DW_RLE_end_of_list = 0x0,
+ DW_RLE_base_addressx = 0x1,
+ DW_RLE_startx_endx = 0x2,
+ DW_RLE_startx_length = 0x3,
+ DW_RLE_offset_pair = 0x4,
+ DW_RLE_base_address = 0x5,
+ DW_RLE_start_end = 0x6,
+ DW_RLE_start_length = 0x7
+ };
+
+
+/* Location list entry encoding. */
+enum
+ {
+ DW_LLE_end_of_list = 0x0,
+ DW_LLE_base_addressx = 0x1,
+ DW_LLE_startx_endx = 0x2,
+ DW_LLE_startx_length = 0x3,
+ DW_LLE_offset_pair = 0x4,
+ DW_LLE_default_location = 0x5,
+ DW_LLE_base_address = 0x6,
+ DW_LLE_start_end = 0x7,
+ DW_LLE_start_length = 0x8
+ };
+
+
+/* GNU DebugFission list entry encodings (.debug_loc.dwo). */
+enum
+ {
+ DW_LLE_GNU_end_of_list_entry = 0x0,
+ DW_LLE_GNU_base_address_selection_entry = 0x1,
+ DW_LLE_GNU_start_end_entry = 0x2,
+ DW_LLE_GNU_start_length_entry = 0x3
};
diff --git a/libdw/dwarf_aggregate_size.c b/libdw/dwarf_aggregate_size.c
index aaeb7ed..75105e4 100644
--- a/libdw/dwarf_aggregate_size.c
+++ b/libdw/dwarf_aggregate_size.c
@@ -1,5 +1,5 @@
/* Compute size of an aggregate type from DWARF.
- Copyright (C) 2010, 2014 Red Hat, Inc.
+ Copyright (C) 2010, 2014, 2016 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -46,13 +46,17 @@
return type;
}
+static int aggregate_size (Dwarf_Die *die, Dwarf_Word *size,
+ Dwarf_Die *type_mem, int depth);
+
static int
array_size (Dwarf_Die *die, Dwarf_Word *size,
- Dwarf_Attribute *attr_mem, Dwarf_Die *type_mem)
+ Dwarf_Attribute *attr_mem, int depth)
{
Dwarf_Word eltsize;
- if (INTUSE(dwarf_aggregate_size) (get_type (die, attr_mem, type_mem),
- &eltsize) != 0)
+ Dwarf_Die type_mem, aggregate_type_mem;
+ if (aggregate_size (get_type (die, attr_mem, &type_mem), &eltsize,
+ &aggregate_type_mem, depth) != 0)
return -1;
/* An array can have DW_TAG_subrange_type or DW_TAG_enumeration_type
@@ -63,7 +67,7 @@
return -1;
bool any = false;
- Dwarf_Word total = 0;
+ Dwarf_Word count_total = 1;
do
{
Dwarf_Word count;
@@ -95,45 +99,11 @@
}
else
{
- /* Determine default lower bound from language,
- as per "4.12 Subrange Type Entries". */
Dwarf_Die cu = CUDIE (die->cu);
- switch (INTUSE(dwarf_srclang) (&cu))
- {
- case DW_LANG_C:
- case DW_LANG_C89:
- case DW_LANG_C99:
- case DW_LANG_C11:
- case DW_LANG_C_plus_plus:
- case DW_LANG_C_plus_plus_11:
- case DW_LANG_C_plus_plus_14:
- case DW_LANG_ObjC:
- case DW_LANG_ObjC_plus_plus:
- case DW_LANG_Java:
- case DW_LANG_D:
- case DW_LANG_UPC:
- case DW_LANG_Go:
- lower = 0;
- break;
-
- case DW_LANG_Ada83:
- case DW_LANG_Ada95:
- case DW_LANG_Cobol74:
- case DW_LANG_Cobol85:
- case DW_LANG_Fortran77:
- case DW_LANG_Fortran90:
- case DW_LANG_Fortran95:
- case DW_LANG_Fortran03:
- case DW_LANG_Fortran08:
- case DW_LANG_Pascal83:
- case DW_LANG_Modula2:
- case DW_LANG_PL1:
- lower = 1;
- break;
-
- default:
- return -1;
- }
+ int lang = INTUSE(dwarf_srclang) (&cu);
+ if (lang == -1
+ || INTUSE(dwarf_default_lower_bound) (lang, &lower) != 0)
+ return -1;
}
if (unlikely (lower > upper))
return -1;
@@ -168,53 +138,63 @@
continue;
}
- /* This is a subrange_type or enumeration_type and we've set COUNT.
- Now determine the stride for this array dimension. */
- Dwarf_Word stride = eltsize;
- if (INTUSE(dwarf_attr_integrate) (&child, DW_AT_byte_stride,
- attr_mem) != NULL)
- {
- if (INTUSE(dwarf_formudata) (attr_mem, &stride) != 0)
- return -1;
- }
- else if (INTUSE(dwarf_attr_integrate) (&child, DW_AT_bit_stride,
- attr_mem) != NULL)
- {
- if (INTUSE(dwarf_formudata) (attr_mem, &stride) != 0)
- return -1;
- if (stride % 8) /* XXX maybe compute in bits? */
- return -1;
- stride /= 8;
- }
+ count_total *= count;
any = true;
- total += stride * count;
}
while (INTUSE(dwarf_siblingof) (&child, &child) == 0);
if (!any)
return -1;
- *size = total;
+ /* This is a subrange_type or enumeration_type and we've set COUNT.
+ Now determine the stride for this array. */
+ Dwarf_Word stride = eltsize;
+ if (INTUSE(dwarf_attr_integrate) (die, DW_AT_byte_stride,
+ attr_mem) != NULL)
+ {
+ if (INTUSE(dwarf_formudata) (attr_mem, &stride) != 0)
+ return -1;
+ }
+ else if (INTUSE(dwarf_attr_integrate) (die, DW_AT_bit_stride,
+ attr_mem) != NULL)
+ {
+ if (INTUSE(dwarf_formudata) (attr_mem, &stride) != 0)
+ return -1;
+ if (stride % 8) /* XXX maybe compute in bits? */
+ return -1;
+ stride /= 8;
+ }
+
+ *size = count_total * stride;
return 0;
}
static int
-aggregate_size (Dwarf_Die *die, Dwarf_Word *size, Dwarf_Die *type_mem)
+aggregate_size (Dwarf_Die *die, Dwarf_Word *size,
+ Dwarf_Die *type_mem, int depth)
{
Dwarf_Attribute attr_mem;
+/* Arrays of arrays of subrange types of arrays... Don't recurse too deep. */
+#define MAX_DEPTH 256
+ if (die == NULL || depth++ >= MAX_DEPTH)
+ return -1;
+
if (INTUSE(dwarf_attr_integrate) (die, DW_AT_byte_size, &attr_mem) != NULL)
return INTUSE(dwarf_formudata) (&attr_mem, size);
switch (INTUSE(dwarf_tag) (die))
{
case DW_TAG_subrange_type:
- return aggregate_size (get_type (die, &attr_mem, type_mem),
- size, type_mem); /* Tail call. */
+ {
+ Dwarf_Die aggregate_type_mem;
+ return aggregate_size (get_type (die, &attr_mem, type_mem),
+ size, &aggregate_type_mem, depth);
+ }
case DW_TAG_array_type:
- return array_size (die, size, &attr_mem, type_mem);
+ return array_size (die, size, &attr_mem, depth);
/* Assume references and pointers have pointer size if not given an
explicit DW_AT_byte_size. */
@@ -232,12 +212,12 @@
int
dwarf_aggregate_size (Dwarf_Die *die, Dwarf_Word *size)
{
- Dwarf_Die type_mem;
+ Dwarf_Die die_mem, type_mem;
- if (INTUSE (dwarf_peel_type) (die, die) != 0)
+ if (INTUSE (dwarf_peel_type) (die, &die_mem) != 0)
return -1;
- return aggregate_size (die, size, &type_mem);
+ return aggregate_size (&die_mem, size, &type_mem, 0);
}
INTDEF (dwarf_aggregate_size)
OLD_VERSION (dwarf_aggregate_size, ELFUTILS_0.144)
diff --git a/libdw/dwarf_attr_integrate.c b/libdw/dwarf_attr_integrate.c
index 812d74b..fc06863 100644
--- a/libdw/dwarf_attr_integrate.c
+++ b/libdw/dwarf_attr_integrate.c
@@ -1,5 +1,5 @@
/* Return specific DWARF attribute of a DIE, integrating indirections.
- Copyright (C) 2005 Red Hat, Inc.
+ Copyright (C) 2005, 2018 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -38,7 +38,7 @@
Dwarf_Attribute *result)
{
Dwarf_Die die_mem;
-
+ int chain = 16; /* Largest DIE ref chain we will follow. */
do
{
Dwarf_Attribute *attr = INTUSE(dwarf_attr) (die, search_name, result);
@@ -53,8 +53,21 @@
die = INTUSE(dwarf_formref_die) (attr, &die_mem);
}
- while (die != NULL);
+ while (die != NULL && chain-- != 0);
+ /* Not NULL if it didn't have abstract_origin and specification
+ attributes. If it is a split CU then see if the skeleton
+ has it. */
+ if (die != NULL && is_cudie (die)
+ && die->cu->unit_type == DW_UT_split_compile)
+ {
+ Dwarf_CU *skel_cu = __libdw_find_split_unit (die->cu);
+ if (skel_cu != NULL)
+ {
+ Dwarf_Die skel_die = CUDIE (skel_cu);
+ return INTUSE(dwarf_attr) (&skel_die, search_name, result);
+ }
+ }
return NULL;
}
INTDEF (dwarf_attr_integrate)
diff --git a/libdw/dwarf_begin_elf.c b/libdw/dwarf_begin_elf.c
index 6f25e42..184a6dc 100644
--- a/libdw/dwarf_begin_elf.c
+++ b/libdw/dwarf_begin_elf.c
@@ -1,7 +1,6 @@
/* Create descriptor from ELF descriptor for processing file.
- Copyright (C) 2002-2011, 2014, 2015 Red Hat, Inc.
+ Copyright (C) 2002-2011, 2014, 2015, 2017, 2018 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
@@ -41,25 +40,32 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <endian.h>
+#include "libelfP.h"
#include "libdwP.h"
-/* Section names. */
-static const char dwarf_scnnames[IDX_last][18] =
+/* Section names. (Note .debug_str_offsets is the largest 19 chars.) */
+static const char dwarf_scnnames[IDX_last][19] =
{
[IDX_debug_info] = ".debug_info",
[IDX_debug_types] = ".debug_types",
[IDX_debug_abbrev] = ".debug_abbrev",
+ [IDX_debug_addr] = ".debug_addr",
[IDX_debug_aranges] = ".debug_aranges",
[IDX_debug_line] = ".debug_line",
+ [IDX_debug_line_str] = ".debug_line_str",
[IDX_debug_frame] = ".debug_frame",
[IDX_debug_loc] = ".debug_loc",
+ [IDX_debug_loclists] = ".debug_loclists",
[IDX_debug_pubnames] = ".debug_pubnames",
[IDX_debug_str] = ".debug_str",
+ [IDX_debug_str_offsets] = ".debug_str_offsets",
[IDX_debug_macinfo] = ".debug_macinfo",
[IDX_debug_macro] = ".debug_macro",
[IDX_debug_ranges] = ".debug_ranges",
+ [IDX_debug_rnglists] = ".debug_rnglists",
[IDX_gnu_debugaltlink] = ".gnu_debugaltlink"
};
#define ndwarf_scnnames (sizeof (dwarf_scnnames) / sizeof (dwarf_scnnames[0]))
@@ -112,14 +118,26 @@
size_t cnt;
bool gnu_compressed = false;
for (cnt = 0; cnt < ndwarf_scnnames; ++cnt)
- if (strcmp (scnname, dwarf_scnnames[cnt]) == 0)
- break;
- else if (scnname[0] == '.' && scnname[1] == 'z'
- && strcmp (&scnname[2], &dwarf_scnnames[cnt][1]) == 0)
- {
- gnu_compressed = true;
- break;
- }
+ {
+ size_t dbglen = strlen (dwarf_scnnames[cnt]);
+ size_t scnlen = strlen (scnname);
+ if (strncmp (scnname, dwarf_scnnames[cnt], dbglen) == 0
+ && (dbglen == scnlen
+ || (scnlen == dbglen + 4
+ && strstr (scnname, ".dwo") == scnname + dbglen)))
+ break;
+ else if (scnname[0] == '.' && scnname[1] == 'z'
+ && (strncmp (&scnname[2], &dwarf_scnnames[cnt][1],
+ dbglen - 1) == 0
+ && (scnlen == dbglen + 1
+ || (scnlen == dbglen + 5
+ && strstr (scnname,
+ ".dwo") == scnname + dbglen + 1))))
+ {
+ gnu_compressed = true;
+ break;
+ }
+ }
if (cnt >= ndwarf_scnnames)
/* Not a debug section; ignore it. */
@@ -138,17 +156,9 @@
{
if (elf_compress (scn, 0, 0) < 0)
{
- /* If we failed to decompress the section and it's the
- debug_info section, then fail with specific error rather
- than the generic NO_DWARF. Without debug_info we can't do
- anything (see also valid_p()). */
- if (cnt == IDX_debug_info)
- {
- Dwarf_Sig8_Hash_free (&result->sig8_hash);
- __libdw_seterrno (DWARF_E_COMPRESSED_ERROR);
- free (result);
- return NULL;
- }
+ /* It would be nice if we could fail with a specific error.
+ But we don't know if this was an essential section or not.
+ So just continue for now. See also valid_p(). */
return result;
}
}
@@ -169,6 +179,26 @@
}
+/* Helper function to set debugdir field. We want to cache the dir
+ where we found this Dwarf ELF file to locate alt and dwo files. */
+char *
+__libdw_debugdir (int fd)
+{
+ /* strlen ("/proc/self/fd/") = 14 + strlen (<MAXINT>) = 10 + 1 = 25. */
+ char devfdpath[25];
+ sprintf (devfdpath, "/proc/self/fd/%u", fd);
+ char *fdpath = realpath (devfdpath, NULL);
+ char *fddir;
+ if (fdpath != NULL && fdpath[0] == '/'
+ && (fddir = strrchr (fdpath, '/')) != NULL)
+ {
+ *++fddir = '\0';
+ return fdpath;
+ }
+ return NULL;
+}
+
+
/* Check whether all the necessary DWARF information is available. */
static Dwarf *
valid_p (Dwarf *result)
@@ -176,11 +206,11 @@
/* We looked at all the sections. Now determine whether all the
sections with debugging information we need are there.
- XXX Which sections are absolutely necessary? Add tests if
- necessary. For now we require only .debug_info. Hopefully this
- is correct. */
+ Require at least one section that can be read "standalone". */
if (likely (result != NULL)
- && unlikely (result->sectiondata[IDX_debug_info] == NULL))
+ && unlikely (result->sectiondata[IDX_debug_info] == NULL
+ && result->sectiondata[IDX_debug_line] == NULL
+ && result->sectiondata[IDX_debug_frame] == NULL))
{
Dwarf_Sig8_Hash_free (&result->sig8_hash);
__libdw_seterrno (DWARF_E_NO_DWARF);
@@ -188,6 +218,9 @@
result = NULL;
}
+ /* For dwarf_location_attr () we need a "fake" CU to indicate
+ where the "fake" attribute data comes from. This is a block
+ inside the .debug_loc or .debug_loclists section. */
if (result != NULL && result->sectiondata[IDX_debug_loc] != NULL)
{
result->fake_loc_cu = (Dwarf_CU *) calloc (1, sizeof (Dwarf_CU));
@@ -200,6 +233,7 @@
}
else
{
+ result->fake_loc_cu->sec_idx = IDX_debug_loc;
result->fake_loc_cu->dbg = result;
result->fake_loc_cu->startp
= result->sectiondata[IDX_debug_loc]->d_buf;
@@ -209,6 +243,60 @@
}
}
+ if (result != NULL && result->sectiondata[IDX_debug_loclists] != NULL)
+ {
+ result->fake_loclists_cu = (Dwarf_CU *) calloc (1, sizeof (Dwarf_CU));
+ if (unlikely (result->fake_loclists_cu == NULL))
+ {
+ Dwarf_Sig8_Hash_free (&result->sig8_hash);
+ __libdw_seterrno (DWARF_E_NOMEM);
+ free (result->fake_loc_cu);
+ free (result);
+ result = NULL;
+ }
+ else
+ {
+ result->fake_loclists_cu->sec_idx = IDX_debug_loclists;
+ result->fake_loclists_cu->dbg = result;
+ result->fake_loclists_cu->startp
+ = result->sectiondata[IDX_debug_loclists]->d_buf;
+ result->fake_loclists_cu->endp
+ = (result->sectiondata[IDX_debug_loclists]->d_buf
+ + result->sectiondata[IDX_debug_loclists]->d_size);
+ }
+ }
+
+ /* For DW_OP_constx/GNU_const_index and DW_OP_addrx/GNU_addr_index
+ the dwarf_location_attr () will need a "fake" address CU to
+ indicate where the attribute data comes from. This is a just
+ inside the .debug_addr section, if it exists. */
+ if (result != NULL && result->sectiondata[IDX_debug_addr] != NULL)
+ {
+ result->fake_addr_cu = (Dwarf_CU *) calloc (1, sizeof (Dwarf_CU));
+ if (unlikely (result->fake_addr_cu == NULL))
+ {
+ Dwarf_Sig8_Hash_free (&result->sig8_hash);
+ __libdw_seterrno (DWARF_E_NOMEM);
+ free (result->fake_loc_cu);
+ free (result->fake_loclists_cu);
+ free (result);
+ result = NULL;
+ }
+ else
+ {
+ result->fake_addr_cu->sec_idx = IDX_debug_addr;
+ result->fake_addr_cu->dbg = result;
+ result->fake_addr_cu->startp
+ = result->sectiondata[IDX_debug_addr]->d_buf;
+ result->fake_addr_cu->endp
+ = (result->sectiondata[IDX_debug_addr]->d_buf
+ + result->sectiondata[IDX_debug_addr]->d_size);
+ }
+ }
+
+ if (result != NULL)
+ result->debugdir = __libdw_debugdir (result->elf->fildes);
+
return result;
}
@@ -324,6 +412,7 @@
result->other_byte_order = true;
result->elf = elf;
+ result->alt_fd = -1;
/* Initialize the memory handling. */
result->mem_default_size = mem_default_size;
diff --git a/libdw/dwarf_child.c b/libdw/dwarf_child.c
index cc95fb3..9446b88 100644
--- a/libdw/dwarf_child.c
+++ b/libdw/dwarf_child.c
@@ -1,5 +1,5 @@
/* Return child of current DIE.
- Copyright (C) 2003-2011, 2014 Red Hat, Inc.
+ Copyright (C) 2003-2011, 2014, 2017 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -43,36 +43,27 @@
__libdw_find_attr (Dwarf_Die *die, unsigned int search_name,
unsigned int *codep, unsigned int *formp)
{
- Dwarf *dbg = die->cu->dbg;
const unsigned char *readp;
/* Find the abbreviation entry. */
Dwarf_Abbrev *abbrevp = __libdw_dieabbrev (die, &readp);
if (unlikely (abbrevp == DWARF_END_ABBREV))
{
- invalid_dwarf:
__libdw_seterrno (DWARF_E_INVALID_DWARF);
return NULL;
}
- /* Search the name attribute. */
- unsigned char *const endp
- = ((unsigned char *) dbg->sectiondata[IDX_debug_abbrev]->d_buf
- + dbg->sectiondata[IDX_debug_abbrev]->d_size);
-
+ /* Search the name attribute. Attribute has been checked when
+ Dwarf_Abbrev was created, we can read unchecked. */
const unsigned char *attrp = abbrevp->attrp;
while (1)
{
/* Get attribute name and form. */
- if (unlikely (attrp >= endp))
- goto invalid_dwarf;
unsigned int attr_name;
- get_uleb128 (attr_name, attrp, endp);
+ get_uleb128_unchecked (attr_name, attrp);
- if (unlikely (attrp >= endp))
- goto invalid_dwarf;
unsigned int attr_form;
- get_uleb128 (attr_form, attrp, endp);
+ get_uleb128_unchecked (attr_form, attrp);
/* We can stop if we found the attribute with value zero. */
if (attr_name == 0 && attr_form == 0)
@@ -86,7 +77,12 @@
if (formp != NULL)
*formp = attr_form;
- return (unsigned char *) readp;
+ /* Normally the attribute data comes from the DIE/info,
+ except for implicit_form, where it comes from the abbrev. */
+ if (attr_form == DW_FORM_implicit_const)
+ return (unsigned char *) attrp;
+ else
+ return (unsigned char *) readp;
}
/* Skip over the rest of this attribute (if there is any). */
@@ -101,6 +97,13 @@
// __libdw_form_val_len will have done a bounds check.
readp += len;
+
+ // If the value is in the abbrev data, skip it.
+ if (attr_form == DW_FORM_implicit_const)
+ {
+ int64_t attr_value __attribute__((__unused__));
+ get_sleb128_unchecked (attr_value, attrp);
+ }
}
}
diff --git a/libdw/dwarf_cu_die.c b/libdw/dwarf_cu_die.c
index 194da58..7594e7d 100644
--- a/libdw/dwarf_cu_die.c
+++ b/libdw/dwarf_cu_die.c
@@ -37,8 +37,8 @@
Dwarf_Die *
dwarf_cu_die (Dwarf_CU *cu, Dwarf_Die *result, Dwarf_Half *versionp,
Dwarf_Off *abbrev_offsetp, uint8_t *address_sizep,
- uint8_t *offset_sizep, uint64_t *type_signaturep,
- Dwarf_Off *type_offsetp)
+ uint8_t *offset_sizep, uint64_t *unit_idp,
+ Dwarf_Off *subdie_offsetp)
{
if (cu == NULL)
return NULL;
@@ -53,10 +53,10 @@
*address_sizep = cu->address_size;
if (offset_sizep != NULL)
*offset_sizep = cu->offset_size;
- if (type_signaturep != NULL)
- *type_signaturep = cu->type_sig8;
- if (type_offsetp != NULL)
- *type_offsetp = cu->type_offset;
+ if (unit_idp != NULL)
+ *unit_idp = cu->unit_id8;
+ if (subdie_offsetp != NULL)
+ *subdie_offsetp = cu->subdie_offset;
return result;
}
diff --git a/libdw/dwarf_cu_info.c b/libdw/dwarf_cu_info.c
new file mode 100644
index 0000000..30aee6c
--- /dev/null
+++ b/libdw/dwarf_cu_info.c
@@ -0,0 +1,103 @@
+/* Provides information and DIEs associated with the Dwarf_CU unit.
+ Copyright (C) 2018 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 "libdwP.h"
+
+
+int
+dwarf_cu_info (Dwarf_CU *cu,
+ Dwarf_Half *version, uint8_t *unit_type,
+ Dwarf_Die *cudie, Dwarf_Die *subdie,
+ uint64_t *unit_id,
+ uint8_t *address_size, uint8_t *offset_size)
+{
+ if (cu == NULL)
+ return -1;
+
+ if (version != NULL)
+ *version = cu->version;
+
+ if (unit_type != NULL)
+ *unit_type = cu->unit_type;
+
+ if (cudie != NULL)
+ {
+ if (cu->version >= 2 && cu->version <= 5
+ && cu->unit_type >= DW_UT_compile
+ && cu->unit_type <= DW_UT_split_type)
+ *cudie = CUDIE (cu);
+ else
+ {
+ invalid:
+ __libdw_seterrno (DWARF_E_INVALID_DWARF);
+ return -1;
+ }
+ }
+
+ if (subdie != NULL)
+ {
+ if (cu->version >= 2 && cu->version <= 5)
+ {
+ /* For types, return the actual type DIE. For skeletons,
+ find the associated split compile unit and return its
+ DIE. */
+ if (cu->unit_type == DW_UT_type
+ || cu->unit_type == DW_UT_split_type)
+ *subdie = SUBDIE(cu);
+ else if (cu->unit_type == DW_UT_skeleton)
+ {
+ Dwarf_CU *split_cu = __libdw_find_split_unit (cu);
+ if (split_cu != NULL)
+ *subdie = CUDIE(split_cu);
+ else
+ memset (subdie, '\0', sizeof (Dwarf_Die));
+ }
+ else
+ memset (subdie, '\0', sizeof (Dwarf_Die));
+ }
+ else
+ goto invalid;
+ }
+
+ if (unit_id != NULL)
+ *unit_id = cu->unit_id8;
+
+ if (address_size != NULL)
+ *address_size = cu->address_size;
+
+ if (offset_size != NULL)
+ *offset_size = cu->offset_size;
+
+ return 0;
+}
diff --git a/libdw/dwarf_cuoffset.c b/libdw/dwarf_cuoffset.c
index ba37648..f13b02f 100644
--- a/libdw/dwarf_cuoffset.c
+++ b/libdw/dwarf_cuoffset.c
@@ -38,7 +38,7 @@
Dwarf_Off
dwarf_cuoffset (Dwarf_Die *die)
{
- return (die == NULL
+ return ((die == NULL || die->cu == NULL)
? (Dwarf_Off) -1l
: (Dwarf_Off) (die->addr - die->cu->startp));
}
diff --git a/libdw/dwarf_default_lower_bound.c b/libdw/dwarf_default_lower_bound.c
new file mode 100644
index 0000000..a33a343
--- /dev/null
+++ b/libdw/dwarf_default_lower_bound.c
@@ -0,0 +1,91 @@
+/* Get the default subrange lower bound for a given language.
+ Copyright (C) 2016 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>
+#include "libdwP.h"
+
+/* Determine default lower bound from language, as per the DWARF5
+ "Subrange Type Entries" table. */
+int
+dwarf_default_lower_bound (int lang, Dwarf_Sword *result)
+{
+ switch (lang)
+ {
+ case DW_LANG_C:
+ case DW_LANG_C89:
+ case DW_LANG_C99:
+ case DW_LANG_C11:
+ case DW_LANG_C_plus_plus:
+ case DW_LANG_C_plus_plus_03:
+ case DW_LANG_C_plus_plus_11:
+ case DW_LANG_C_plus_plus_14:
+ case DW_LANG_ObjC:
+ case DW_LANG_ObjC_plus_plus:
+ case DW_LANG_Java:
+ case DW_LANG_D:
+ case DW_LANG_Python:
+ case DW_LANG_UPC:
+ case DW_LANG_OpenCL:
+ case DW_LANG_Go:
+ case DW_LANG_Haskell:
+ case DW_LANG_OCaml:
+ case DW_LANG_Rust:
+ case DW_LANG_Swift:
+ case DW_LANG_Dylan:
+ case DW_LANG_RenderScript:
+ case DW_LANG_BLISS:
+ *result = 0;
+ return 0;
+
+ case DW_LANG_Ada83:
+ case DW_LANG_Ada95:
+ case DW_LANG_Cobol74:
+ case DW_LANG_Cobol85:
+ case DW_LANG_Fortran77:
+ case DW_LANG_Fortran90:
+ case DW_LANG_Fortran95:
+ case DW_LANG_Fortran03:
+ case DW_LANG_Fortran08:
+ case DW_LANG_Pascal83:
+ case DW_LANG_Modula2:
+ case DW_LANG_Modula3:
+ case DW_LANG_PLI:
+ case DW_LANG_Julia:
+ *result = 1;
+ return 0;
+
+ default:
+ __libdw_seterrno (DWARF_E_UNKNOWN_LANGUAGE);
+ return -1;
+ }
+}
+INTDEF (dwarf_default_lower_bound)
diff --git a/libdw/dwarf_die_addr_die.c b/libdw/dwarf_die_addr_die.c
new file mode 100644
index 0000000..6572916
--- /dev/null
+++ b/libdw/dwarf_die_addr_die.c
@@ -0,0 +1,70 @@
+/* Return offset of DIE.
+ Copyright (C) 2018 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>
+#include "libdwP.h"
+
+
+Dwarf_Die *
+dwarf_die_addr_die (Dwarf *dbg, void *addr, Dwarf_Die *result)
+{
+ if (dbg == NULL)
+ return NULL;
+
+ Dwarf_CU *cu = __libdw_findcu_addr (dbg, addr);
+
+ if (cu == NULL)
+ {
+ Dwarf *alt = INTUSE (dwarf_getalt) (dbg);
+ if (alt != NULL)
+ cu = __libdw_findcu_addr (alt, addr);
+ }
+
+ if (cu == NULL)
+ {
+ Dwarf *split = __libdw_find_split_dbg_addr (dbg, addr);
+ if (split != NULL)
+ cu = __libdw_findcu_addr (split, addr);
+ }
+
+ if (cu == NULL)
+ {
+ memset (result, '\0', sizeof (Dwarf_Die));
+ return NULL;
+ }
+
+ *result = (Dwarf_Die) { .addr = addr, .cu = cu };
+
+ return result;
+}
diff --git a/libdw/dwarf_dieoffset.c b/libdw/dwarf_dieoffset.c
index 8028f6d..3a8e2cb 100644
--- a/libdw/dwarf_dieoffset.c
+++ b/libdw/dwarf_dieoffset.c
@@ -38,8 +38,8 @@
Dwarf_Off
dwarf_dieoffset (Dwarf_Die *die)
{
- return (die == NULL
- ? ~0ul
+ return ((die == NULL || die->cu == NULL)
+ ? (Dwarf_Off) -1
: (Dwarf_Off) (die->addr - die->cu->startp + die->cu->start));
}
INTDEF(dwarf_dieoffset)
diff --git a/libdw/dwarf_end.c b/libdw/dwarf_end.c
index 6c6d985..29795c1 100644
--- a/libdw/dwarf_end.c
+++ b/libdw/dwarf_end.c
@@ -1,5 +1,5 @@
/* Release debugging handling context.
- Copyright (C) 2002-2011, 2014 Red Hat, Inc.
+ Copyright (C) 2002-2011, 2014, 2018 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -35,6 +35,7 @@
#include <stdlib.h>
#include <assert.h>
#include <string.h>
+#include <unistd.h>
#include "libdwP.h"
#include "cfi.h"
@@ -54,6 +55,16 @@
Dwarf_Abbrev_Hash_free (&p->abbrev_hash);
tdestroy (p->locs, noop_free);
+
+ /* Free split dwarf one way (from skeleton to split). */
+ if (p->unit_type == DW_UT_skeleton
+ && p->split != NULL && p->split != (void *)-1)
+ {
+ /* The fake_addr_cu might be shared, only release one. */
+ if (p->dbg->fake_addr_cu == p->split->dbg->fake_addr_cu)
+ p->split->dbg->fake_addr_cu = NULL;
+ INTUSE(dwarf_end) (p->split->dbg);
+ }
}
@@ -80,6 +91,9 @@
/* Search tree for decoded .debug_lines units. */
tdestroy (dwarf->files_lines, noop_free);
+ /* And the split Dwarf. */
+ tdestroy (dwarf->split_tree, noop_free);
+
struct libdw_memblock *memp = dwarf->mem_tail;
/* The first block is allocated together with the Dwarf object. */
while (memp->prev != NULL)
@@ -102,6 +116,26 @@
cu_free (dwarf->fake_loc_cu);
free (dwarf->fake_loc_cu);
}
+ if (dwarf->fake_loclists_cu != NULL)
+ {
+ cu_free (dwarf->fake_loclists_cu);
+ free (dwarf->fake_loclists_cu);
+ }
+ if (dwarf->fake_addr_cu != NULL)
+ {
+ cu_free (dwarf->fake_addr_cu);
+ free (dwarf->fake_addr_cu);
+ }
+
+ /* Did we find and allocate the alt Dwarf ourselves? */
+ if (dwarf->alt_fd != -1)
+ {
+ INTUSE(dwarf_end) (dwarf->alt_dwarf);
+ close (dwarf->alt_fd);
+ }
+
+ /* The cached dir we found the Dwarf ELF file in. */
+ free (dwarf->debugdir);
/* Free the context descriptor. */
free (dwarf);
diff --git a/libdw/dwarf_error.c b/libdw/dwarf_error.c
index 66fdc81..46ea16b 100644
--- a/libdw/dwarf_error.c
+++ b/libdw/dwarf_error.c
@@ -1,7 +1,6 @@
/* Retrieve ELF descriptor used for DWARF access.
- Copyright (C) 2002, 2003, 2004, 2005, 2009, 2014, 2015 Red Hat, Inc.
+ Copyright (C) 2002-2005, 2009, 2014, 2015, 2017, 2018 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
@@ -73,6 +72,9 @@
[DWARF_E_NO_ENTRY] = N_("no entries found"),
[DWARF_E_INVALID_DWARF] = N_("invalid DWARF"),
[DWARF_E_NO_STRING] = N_("no string data"),
+ [DWARF_E_NO_DEBUG_STR] = N_(".debug_str section missing"),
+ [DWARF_E_NO_DEBUG_LINE_STR] = N_(".debug_line_str section missing"),
+ [DWARF_E_NO_STR_OFFSETS] = N_(".debug_str_offsets section missing"),
[DWARF_E_NO_ADDR] = N_("no address value"),
[DWARF_E_NO_CONSTANT] = N_("no constant value"),
[DWARF_E_NO_REFERENCE] = N_("no reference value"),
@@ -83,7 +85,9 @@
[DWARF_E_VERSION] = N_("invalid DWARF version"),
[DWARF_E_INVALID_DIR_IDX] = N_("invalid directory index"),
[DWARF_E_ADDR_OUTOFRANGE] = N_("address out of range"),
- [DWARF_E_NO_LOCLIST] = N_("no location list value"),
+ [DWARF_E_NO_DEBUG_LOC] = N_(".debug_loc section missing"),
+ [DWARF_E_NO_DEBUG_LOCLISTS] = N_(".debug_loclists section missing"),
+ [DWARF_E_NO_LOC_VALUE] = N_("not a location list value"),
[DWARF_E_NO_BLOCK] = N_("no block data"),
[DWARF_E_INVALID_LINE_IDX] = N_("invalid line index"),
[DWARF_E_INVALID_ARANGE_IDX] = N_("invalid address range index"),
@@ -91,10 +95,13 @@
[DWARF_E_NO_FLAG] = N_("no flag value"),
[DWARF_E_INVALID_OFFSET] = N_("invalid offset"),
[DWARF_E_NO_DEBUG_RANGES] = N_(".debug_ranges section missing"),
+ [DWARF_E_NO_DEBUG_RNGLISTS] = N_(".debug_rnglists section missing"),
[DWARF_E_INVALID_CFI] = N_("invalid CFI section"),
[DWARF_E_NO_ALT_DEBUGLINK] = N_("no alternative debug link found"),
[DWARF_E_INVALID_OPCODE] = N_("invalid opcode"),
[DWARF_E_NOT_CUDIE] = N_("not a CU (unit) DIE"),
+ [DWARF_E_UNKNOWN_LANGUAGE] = N_("unknown language code"),
+ [DWARF_E_NO_DEBUG_ADDR] = N_(".debug_addr section missing"),
};
#define nerrmsgs (sizeof (errmsgs) / sizeof (errmsgs[0]))
diff --git a/libdw/dwarf_formaddr.c b/libdw/dwarf_formaddr.c
index ddc4838..9cd3d20 100644
--- a/libdw/dwarf_formaddr.c
+++ b/libdw/dwarf_formaddr.c
@@ -1,7 +1,6 @@
/* Return address represented by attribute.
- Copyright (C) 2003-2010 Red Hat, Inc.
+ Copyright (C) 2003-2010, 2018 Red Hat, Inc.
This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2003.
This file is free software; you can redistribute it and/or modify
it under the terms of either
@@ -36,20 +35,112 @@
int
+__libdw_addrx (Dwarf_CU *cu, Dwarf_Word idx, Dwarf_Addr *addr)
+{
+ Dwarf_Off addr_off = __libdw_cu_addr_base (cu);
+ if (addr_off == (Dwarf_Off) -1)
+ return -1;
+
+ Dwarf *dbg = cu->dbg;
+ if (dbg->sectiondata[IDX_debug_addr] == NULL)
+ {
+ __libdw_seterrno (DWARF_E_NO_DEBUG_ADDR);
+ return -1;
+ }
+
+ /* The section should at least contain room for one address. */
+ int address_size = cu->address_size;
+ if (cu->address_size > dbg->sectiondata[IDX_debug_addr]->d_size)
+ {
+ invalid_offset:
+ __libdw_seterrno (DWARF_E_INVALID_OFFSET);
+ return -1;
+ }
+
+ if (addr_off > (dbg->sectiondata[IDX_debug_addr]->d_size
+ - address_size))
+ goto invalid_offset;
+
+ idx *= address_size;
+ if (idx > (dbg->sectiondata[IDX_debug_addr]->d_size
+ - address_size - addr_off))
+ goto invalid_offset;
+
+ const unsigned char *datap;
+ datap = dbg->sectiondata[IDX_debug_addr]->d_buf + addr_off + idx;
+ if (address_size == 4)
+ *addr = read_4ubyte_unaligned (dbg, datap);
+ else
+ *addr = read_8ubyte_unaligned (dbg, datap);
+
+ return 0;
+}
+
+int
dwarf_formaddr (Dwarf_Attribute *attr, Dwarf_Addr *return_addr)
{
if (attr == NULL)
return -1;
- if (unlikely (attr->form != DW_FORM_addr))
+ Dwarf_Word idx;
+ Dwarf_CU *cu = attr->cu;
+ Dwarf *dbg = cu->dbg;
+ const unsigned char *datap = attr->valp;
+ const unsigned char *endp = attr->cu->endp;
+ switch (attr->form)
{
- __libdw_seterrno (DWARF_E_NO_ADDR);
- return -1;
+ /* There is one form that just encodes the whole address. */
+ case DW_FORM_addr:
+ if (__libdw_read_address (dbg, cu_sec_idx (cu), datap,
+ cu->address_size, return_addr))
+ return -1;
+ return 0;
+
+ /* All others encode an index into the .debug_addr section where
+ the address can be found. */
+ case DW_FORM_GNU_addr_index:
+ case DW_FORM_addrx:
+ if (datap >= endp)
+ {
+ invalid:
+ __libdw_seterrno (DWARF_E_INVALID_DWARF);
+ return -1;
+ }
+ get_uleb128 (idx, datap, endp);
+ break;
+
+ case DW_FORM_addrx1:
+ if (datap >= endp - 1)
+ goto invalid;
+ idx = *datap;
+ break;
+
+ case DW_FORM_addrx2:
+ if (datap >= endp - 2)
+ goto invalid;
+ idx = read_2ubyte_unaligned (dbg, datap);
+ break;
+
+ case DW_FORM_addrx3:
+ if (datap >= endp - 3)
+ goto invalid;
+ idx = read_3ubyte_unaligned (dbg, datap);
+ break;
+
+ case DW_FORM_addrx4:
+ if (datap >= endp - 4)
+ goto invalid;
+ idx = read_4ubyte_unaligned (dbg, datap);
+ break;
+
+ default:
+ __libdw_seterrno (DWARF_E_NO_ADDR);
+ return -1;
}
- if (__libdw_read_address (attr->cu->dbg,
- cu_sec_idx (attr->cu), attr->valp,
- attr->cu->address_size, return_addr))
+ /* So we got an index. Lets see if it is valid and we can get the actual
+ address. */
+ if (__libdw_addrx (cu, idx, return_addr) != 0)
return -1;
return 0;
diff --git a/libdw/dwarf_formblock.c b/libdw/dwarf_formblock.c
index 13f9e72..924baf4 100644
--- a/libdw/dwarf_formblock.c
+++ b/libdw/dwarf_formblock.c
@@ -1,5 +1,5 @@
/* Return block represented by attribute.
- Copyright (C) 2004-2010, 2014 Red Hat, Inc.
+ Copyright (C) 2004-2010, 2014, 2018 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2004.
@@ -75,6 +75,16 @@
return_block->data = (unsigned char *) datap;
break;
+ case DW_FORM_data16:
+ /* The DWARFv5 spec calls this constant class, but we interpret
+ it as a block that the user will need to interpret when
+ converting to a value. */
+ if (unlikely (endp - datap < 16))
+ goto invalid;
+ return_block->length = 16;
+ return_block->data = (unsigned char *) datap;
+ break;
+
default:
__libdw_seterrno (DWARF_E_NO_BLOCK);
return -1;
diff --git a/libdw/dwarf_formref.c b/libdw/dwarf_formref.c
index 2240a25..2bae2a4 100644
--- a/libdw/dwarf_formref.c
+++ b/libdw/dwarf_formref.c
@@ -86,6 +86,8 @@
case DW_FORM_ref_addr:
case DW_FORM_ref_sig8:
case DW_FORM_GNU_ref_alt:
+ case DW_FORM_ref_sup4:
+ case DW_FORM_ref_sup8:
/* These aren't handled by dwarf_formref, only by dwarf_formref_die. */
__libdw_seterrno (DWARF_E_INVALID_REFERENCE);
return -1;
diff --git a/libdw/dwarf_formref_die.c b/libdw/dwarf_formref_die.c
index 7e2b11a..f196331 100644
--- a/libdw/dwarf_formref_die.c
+++ b/libdw/dwarf_formref_die.c
@@ -1,5 +1,5 @@
/* Look up the DIE in a reference-form attribute.
- Copyright (C) 2005-2010 Red Hat, Inc.
+ Copyright (C) 2005-2010, 2018 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -44,16 +44,23 @@
struct Dwarf_CU *cu = attr->cu;
Dwarf_Off offset;
- if (attr->form == DW_FORM_ref_addr || attr->form == DW_FORM_GNU_ref_alt)
+ if (attr->form == DW_FORM_ref_addr || attr->form == DW_FORM_GNU_ref_alt
+ || attr->form == DW_FORM_ref_sup4 || attr->form == DW_FORM_ref_sup8)
{
/* This has an absolute offset. */
- uint8_t ref_size = (cu->version == 2 && attr->form == DW_FORM_ref_addr
- ? cu->address_size
- : cu->offset_size);
+ uint8_t ref_size;
+ if (cu->version == 2 && attr->form == DW_FORM_ref_addr)
+ ref_size = cu->address_size;
+ else if (attr->form == DW_FORM_ref_sup4)
+ ref_size = 4;
+ else if (attr->form == DW_FORM_ref_sup8)
+ ref_size = 8;
+ else
+ ref_size = cu->offset_size;
Dwarf *dbg_ret = (attr->form == DW_FORM_GNU_ref_alt
- ? cu->dbg->alt_dwarf : cu->dbg);
+ ? INTUSE(dwarf_getalt) (cu->dbg) : cu->dbg);
if (dbg_ret == NULL)
{
@@ -73,27 +80,38 @@
if (attr->form == DW_FORM_ref_sig8)
{
/* This doesn't have an offset, but instead a value we
- have to match in the .debug_types type unit headers. */
+ have to match in the type unit headers. */
uint64_t sig = read_8ubyte_unaligned (cu->dbg, attr->valp);
cu = Dwarf_Sig8_Hash_find (&cu->dbg->sig8_hash, sig, NULL);
if (cu == NULL)
- /* Not seen before. We have to scan through the type units. */
- do
- {
- cu = __libdw_intern_next_unit (attr->cu->dbg, true);
- if (cu == NULL)
- {
- __libdw_seterrno (INTUSE(dwarf_errno) ()
- ?: DWARF_E_INVALID_REFERENCE);
- return NULL;
- }
- }
- while (cu->type_sig8 != sig);
+ {
+ /* Not seen before. We have to scan through the type units.
+ Since DWARFv5 these can (also) be found in .debug_info,
+ so scan that first. */
+ bool scan_debug_types = false;
+ do
+ {
+ cu = __libdw_intern_next_unit (attr->cu->dbg, scan_debug_types);
+ if (cu == NULL)
+ {
+ if (scan_debug_types == false)
+ scan_debug_types = true;
+ else
+ {
+ __libdw_seterrno (INTUSE(dwarf_errno) ()
+ ?: DWARF_E_INVALID_REFERENCE);
+ return NULL;
+ }
+ }
+ }
+ while (cu == NULL || cu->unit_id8 != sig);
+ }
- datap = cu->dbg->sectiondata[IDX_debug_types]->d_buf;
- size = cu->dbg->sectiondata[IDX_debug_types]->d_size;
- offset = cu->start + cu->type_offset;
+ int secid = cu_sec_idx (cu);
+ datap = cu->dbg->sectiondata[secid]->d_buf;
+ size = cu->dbg->sectiondata[secid]->d_size;
+ offset = cu->start + cu->subdie_offset;
}
else
{
diff --git a/libdw/dwarf_formsdata.c b/libdw/dwarf_formsdata.c
index e7deaee..def32c9 100644
--- a/libdw/dwarf_formsdata.c
+++ b/libdw/dwarf_formsdata.c
@@ -1,5 +1,5 @@
/* Return signed constant represented by attribute.
- Copyright (C) 2003, 2005, 2014 Red Hat, Inc.
+ Copyright (C) 2003, 2005, 2014, 2017 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -53,25 +53,25 @@
__libdw_seterrno (DWARF_E_INVALID_DWARF);
return -1;
}
- *return_sval = *attr->valp;
+ *return_sval = (signed char) *attr->valp;
break;
case DW_FORM_data2:
if (datap + 2 > endp)
goto invalid;
- *return_sval = read_2ubyte_unaligned (attr->cu->dbg, attr->valp);
+ *return_sval = read_2sbyte_unaligned (attr->cu->dbg, attr->valp);
break;
case DW_FORM_data4:
if (datap + 4 > endp)
goto invalid;
- *return_sval = read_4ubyte_unaligned (attr->cu->dbg, attr->valp);
+ *return_sval = read_4sbyte_unaligned (attr->cu->dbg, attr->valp);
break;
case DW_FORM_data8:
if (datap + 8 > endp)
goto invalid;
- *return_sval = read_8ubyte_unaligned (attr->cu->dbg, attr->valp);
+ *return_sval = read_8sbyte_unaligned (attr->cu->dbg, attr->valp);
break;
case DW_FORM_sdata:
@@ -86,6 +86,11 @@
get_uleb128 (*return_sval, datap, endp);
break;
+ case DW_FORM_implicit_const:
+ // The data comes from the abbrev, which has been bounds checked.
+ get_sleb128_unchecked (*return_sval, datap);
+ break;
+
default:
__libdw_seterrno (DWARF_E_NO_CONSTANT);
return -1;
diff --git a/libdw/dwarf_formstring.c b/libdw/dwarf_formstring.c
index 83abd53..c3e892a 100644
--- a/libdw/dwarf_formstring.c
+++ b/libdw/dwarf_formstring.c
@@ -1,7 +1,6 @@
/* Return string associated with given attribute.
- Copyright (C) 2003-2010, 2013 Red Hat, Inc.
+ Copyright (C) 2003-2010, 2013, 2017, 2018 Red Hat, Inc.
This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2003.
This file is free software; you can redistribute it and/or modify
it under the terms of either
@@ -47,8 +46,11 @@
/* A simple inlined string. */
return (const char *) attrp->valp;
- Dwarf *dbg = attrp->cu->dbg;
- Dwarf *dbg_ret = attrp->form == DW_FORM_GNU_strp_alt ? dbg->alt_dwarf : dbg;
+ Dwarf_CU *cu = attrp->cu;
+ Dwarf *dbg = cu->dbg;
+ Dwarf *dbg_ret = ((attrp->form == DW_FORM_GNU_strp_alt
+ || attrp->form == DW_FORM_strp_sup)
+ ? INTUSE(dwarf_getalt) (dbg) : dbg);
if (unlikely (dbg_ret == NULL))
{
@@ -56,20 +58,123 @@
return NULL;
}
-
- if (unlikely (attrp->form != DW_FORM_strp
- && attrp->form != DW_FORM_GNU_strp_alt)
- || dbg_ret->sectiondata[IDX_debug_str] == NULL)
+ Elf_Data *data = ((attrp->form == DW_FORM_line_strp)
+ ? dbg_ret->sectiondata[IDX_debug_line_str]
+ : dbg_ret->sectiondata[IDX_debug_str]);
+ if (data == NULL)
{
- __libdw_seterrno (DWARF_E_NO_STRING);
+ __libdw_seterrno ((attrp->form == DW_FORM_line_strp)
+ ? DWARF_E_NO_DEBUG_LINE_STR
+ : DWARF_E_NO_DEBUG_STR);
return NULL;
}
uint64_t off;
- if (__libdw_read_offset (dbg, dbg_ret, cu_sec_idx (attrp->cu), attrp->valp,
- attrp->cu->offset_size, &off, IDX_debug_str, 1))
- return NULL;
+ if (attrp->form == DW_FORM_strp
+ || attrp->form == DW_FORM_GNU_strp_alt
+ || attrp->form == DW_FORM_strp_sup)
+ {
+ if (__libdw_read_offset (dbg, dbg_ret, cu_sec_idx (cu),
+ attrp->valp, cu->offset_size, &off,
+ IDX_debug_str, 1))
+ return NULL;
+ }
+ else if (attrp->form == DW_FORM_line_strp)
+ {
+ if (__libdw_read_offset (dbg, dbg_ret, cu_sec_idx (cu),
+ attrp->valp, cu->offset_size, &off,
+ IDX_debug_line_str, 1))
+ return NULL;
+ }
+ else
+ {
+ Dwarf_Word idx;
+ const unsigned char *datap = attrp->valp;
+ const unsigned char *endp = cu->endp;
+ switch (attrp->form)
+ {
+ case DW_FORM_strx:
+ case DW_FORM_GNU_str_index:
+ if (datap >= endp)
+ {
+ invalid:
+ __libdw_seterrno (DWARF_E_INVALID_DWARF);
+ return NULL;
+ }
+ get_uleb128 (idx, datap, endp);
+ break;
- return (const char *) dbg_ret->sectiondata[IDX_debug_str]->d_buf + off;
+ case DW_FORM_strx1:
+ if (datap >= endp - 1)
+ goto invalid;
+ idx = *datap;
+ break;
+
+ case DW_FORM_strx2:
+ if (datap >= endp - 2)
+ goto invalid;
+ idx = read_2ubyte_unaligned (dbg, datap);
+ break;
+
+ case DW_FORM_strx3:
+ if (datap >= endp - 3)
+ goto invalid;
+ idx = read_3ubyte_unaligned (dbg, datap);
+ break;
+
+ case DW_FORM_strx4:
+ if (datap >= endp - 4)
+ goto invalid;
+ idx = read_4ubyte_unaligned (dbg, datap);
+ break;
+
+ default:
+ __libdw_seterrno (DWARF_E_NO_STRING);
+ return NULL;
+ }
+
+ /* So we got an index in the .debug_str_offsets. Lets see if it
+ is valid and we can get the actual .debug_str offset. */
+ Dwarf_Off str_off = __libdw_cu_str_off_base (cu);
+ if (str_off == (Dwarf_Off) -1)
+ return NULL;
+
+ if (dbg->sectiondata[IDX_debug_str_offsets] == NULL)
+ {
+ __libdw_seterrno (DWARF_E_NO_STR_OFFSETS);
+ return NULL;
+ }
+
+ /* The section should at least contain room for one offset. */
+ int offset_size = cu->offset_size;
+ if (cu->offset_size > dbg->sectiondata[IDX_debug_str_offsets]->d_size)
+ {
+ invalid_offset:
+ __libdw_seterrno (DWARF_E_INVALID_OFFSET);
+ return NULL;
+ }
+
+ /* And the base offset should be at least inside the section. */
+ if (str_off > (dbg->sectiondata[IDX_debug_str_offsets]->d_size
+ - offset_size))
+ goto invalid_offset;
+
+ size_t max_idx = (dbg->sectiondata[IDX_debug_str_offsets]->d_size
+ - offset_size - str_off) / offset_size;
+ if (idx > max_idx)
+ goto invalid_offset;
+
+ datap = (dbg->sectiondata[IDX_debug_str_offsets]->d_buf
+ + str_off + (idx * offset_size));
+ if (offset_size == 4)
+ off = read_4ubyte_unaligned (dbg, datap);
+ else
+ off = read_8ubyte_unaligned (dbg, datap);
+
+ if (off > dbg->sectiondata[IDX_debug_str]->d_size)
+ goto invalid_offset;
+ }
+
+ return (const char *) data->d_buf + off;
}
INTDEF(dwarf_formstring)
diff --git a/libdw/dwarf_formudata.c b/libdw/dwarf_formudata.c
index e41981a..26f86f1 100644
--- a/libdw/dwarf_formudata.c
+++ b/libdw/dwarf_formudata.c
@@ -1,5 +1,5 @@
/* Return unsigned constant represented by attribute.
- Copyright (C) 2003-2012, 2014 Red Hat, Inc.
+ Copyright (C) 2003-2012, 2014, 2017 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -34,15 +34,26 @@
#include <dwarf.h>
#include "libdwP.h"
-internal_function unsigned char *
+internal_function const unsigned char *
__libdw_formptr (Dwarf_Attribute *attr, int sec_index,
- int err_nodata, unsigned char **endpp,
+ int err_nodata, const unsigned char **endpp,
Dwarf_Off *offsetp)
{
if (attr == NULL)
return NULL;
const Elf_Data *d = attr->cu->dbg->sectiondata[sec_index];
+ Dwarf_CU *skel = NULL; /* See below, needed for GNU DebugFission. */
+ if (unlikely (d == NULL
+ && sec_index == IDX_debug_ranges
+ && attr->cu->version < 5
+ && attr->cu->unit_type == DW_UT_split_compile))
+ {
+ skel = __libdw_find_split_unit (attr->cu);
+ if (skel != NULL)
+ d = skel->dbg->sectiondata[IDX_debug_ranges];
+ }
+
if (unlikely (d == NULL))
{
__libdw_seterrno (err_nodata);
@@ -52,10 +63,41 @@
Dwarf_Word offset;
if (attr->form == DW_FORM_sec_offset)
{
- if (__libdw_read_offset (attr->cu->dbg, attr->cu->dbg,
- cu_sec_idx (attr->cu), attr->valp,
- attr->cu->offset_size, &offset, sec_index, 0))
- return NULL;
+ /* GNU DebugFission is slightly odd. It uses DW_FORM_sec_offset
+ in split units, but they are really (unrelocated) offsets
+ from the skeleton DW_AT_GNU_ranges_base (which is only used
+ for the split unit, not the skeleton ranges itself, see also
+ DW_AT_rnglists_base, which is used in DWARF5 for both, but
+ points to the offsets index). So it isn't really a formptr,
+ but an offset + base calculation. */
+ if (unlikely (skel != NULL))
+ {
+ Elf_Data *data = attr->cu->dbg->sectiondata[cu_sec_idx (attr->cu)];
+ const unsigned char *datap = attr->valp;
+ size_t size = attr->cu->offset_size;
+ if (unlikely (data == NULL
+ || datap < (const unsigned char *) data->d_buf
+ || data->d_size < size
+ || ((size_t) (datap
+ - (const unsigned char *) data->d_buf)
+ > data->d_size - size)))
+ goto invalid;
+
+ if (size == 4)
+ offset = read_4ubyte_unaligned (attr->cu->dbg, datap);
+ else
+ offset = read_8ubyte_unaligned (attr->cu->dbg, datap);
+
+ offset += __libdw_cu_ranges_base (skel);
+ }
+ else
+ {
+ if (__libdw_read_offset (attr->cu->dbg, attr->cu->dbg,
+ cu_sec_idx (attr->cu), attr->valp,
+ attr->cu->offset_size, &offset,
+ sec_index, 0))
+ return NULL;
+ }
}
else if (attr->cu->version > 3)
goto invalid;
@@ -141,11 +183,24 @@
case DW_AT_string_length:
case DW_AT_use_location:
case DW_AT_vtable_elem_location:
- /* loclistptr */
- if (__libdw_formptr (attr, IDX_debug_loc,
- DWARF_E_NO_LOCLIST, NULL,
- return_uval) == NULL)
- return -1;
+ case DW_AT_GNU_locviews:
+ case DW_AT_loclists_base:
+ if (attr->cu->version < 5)
+ {
+ /* loclistptr */
+ if (__libdw_formptr (attr, IDX_debug_loc,
+ DWARF_E_NO_DEBUG_LOC, NULL,
+ return_uval) == NULL)
+ return -1;
+ }
+ else
+ {
+ /* loclist, loclistsptr */
+ if (__libdw_formptr (attr, IDX_debug_loclists,
+ DWARF_E_NO_DEBUG_LOCLISTS, NULL,
+ return_uval) == NULL)
+ return -1;
+ }
break;
case DW_AT_macro_info:
@@ -157,6 +212,7 @@
break;
case DW_AT_GNU_macros:
+ case DW_AT_macros:
/* macptr into .debug_macro */
if (__libdw_formptr (attr, IDX_debug_macro,
DWARF_E_NO_ENTRY, NULL,
@@ -166,11 +222,24 @@
case DW_AT_ranges:
case DW_AT_start_scope:
- /* rangelistptr */
- if (__libdw_formptr (attr, IDX_debug_ranges,
- DWARF_E_NO_DEBUG_RANGES, NULL,
- return_uval) == NULL)
- return -1;
+ case DW_AT_GNU_ranges_base:
+ case DW_AT_rnglists_base:
+ if (attr->cu->version < 5)
+ {
+ /* rangelistptr */
+ if (__libdw_formptr (attr, IDX_debug_ranges,
+ DWARF_E_NO_DEBUG_RANGES, NULL,
+ return_uval) == NULL)
+ return -1;
+ }
+ else
+ {
+ /* rnglistsptr */
+ if (__libdw_formptr (attr, IDX_debug_rnglists,
+ DWARF_E_NO_DEBUG_RNGLISTS, NULL,
+ return_uval) == NULL)
+ return -1;
+ }
break;
case DW_AT_stmt_list:
@@ -181,6 +250,23 @@
return -1;
break;
+ case DW_AT_addr_base:
+ case DW_AT_GNU_addr_base:
+ /* addrptr */
+ if (__libdw_formptr (attr, IDX_debug_addr,
+ DWARF_E_NO_DEBUG_ADDR, NULL,
+ return_uval) == NULL)
+ return -1;
+ break;
+
+ case DW_AT_str_offsets_base:
+ /* stroffsetsptr */
+ if (__libdw_formptr (attr, IDX_debug_str_offsets,
+ DWARF_E_NO_STR_OFFSETS, NULL,
+ return_uval) == NULL)
+ return -1;
+ break;
+
default:
/* sec_offset can only be used by one of the above attrs. */
if (attr->form == DW_FORM_sec_offset)
@@ -216,11 +302,51 @@
break;
case DW_FORM_udata:
+ case DW_FORM_rnglistx:
+ case DW_FORM_loclistx:
if (datap + 1 > endp)
goto invalid;
get_uleb128 (*return_uval, datap, endp);
break;
+ case DW_FORM_implicit_const:
+ // The data comes from the abbrev, which has been bounds checked.
+ get_sleb128_unchecked (*return_uval, datap);
+ break;
+
+ /* These are indexes into the .debug_addr section, normally resolved
+ with dwarf_formaddr. Here treat as constants. */
+ case DW_FORM_GNU_addr_index:
+ case DW_FORM_addrx:
+ if (datap >= endp)
+ goto invalid;
+ get_uleb128 (*return_uval, datap, endp);
+ break;
+
+ case DW_FORM_addrx1:
+ if (datap >= endp - 1)
+ goto invalid;
+ *return_uval = *datap;
+ break;
+
+ case DW_FORM_addrx2:
+ if (datap >= endp - 2)
+ goto invalid;
+ *return_uval = read_2ubyte_unaligned (attr->cu->dbg, datap);
+ break;
+
+ case DW_FORM_addrx3:
+ if (datap >= endp - 3)
+ goto invalid;
+ *return_uval = read_3ubyte_unaligned (attr->cu->dbg, datap);
+ break;
+
+ case DW_FORM_addrx4:
+ if (datap >= endp - 4)
+ goto invalid;
+ *return_uval = read_4ubyte_unaligned (attr->cu->dbg, datap);
+ break;
+
default:
__libdw_seterrno (DWARF_E_NO_CONSTANT);
return -1;
diff --git a/libdw/dwarf_frame_register.c b/libdw/dwarf_frame_register.c
index 37e8e91..d0159fb 100644
--- a/libdw/dwarf_frame_register.c
+++ b/libdw/dwarf_frame_register.c
@@ -62,7 +62,7 @@
/* Use the default rule for registers not yet mentioned in CFI. */
if (fs->cache->default_same_value)
goto same_value;
- /*FALLTHROUGH*/
+ FALLTHROUGH;
case reg_undefined:
/* The value is known to be unavailable. */
break;
diff --git a/libdw/dwarf_get_units.c b/libdw/dwarf_get_units.c
new file mode 100644
index 0000000..6215bf4
--- /dev/null
+++ b/libdw/dwarf_get_units.c
@@ -0,0 +1,131 @@
+/* Iterate through the CU units for a given Dwarf.
+ Copyright (C) 2016, 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 <string.h>
+
+#include "libdwP.h"
+
+int
+dwarf_get_units (Dwarf *dwarf, Dwarf_CU *cu, Dwarf_CU **next_cu,
+ Dwarf_Half *version, uint8_t *unit_type,
+ Dwarf_Die *cudie, Dwarf_Die *subdie)
+{
+ /* Handle existing error. */
+ if (dwarf == NULL)
+ return -1;
+
+ Dwarf_Off off;
+ bool v4type;
+ if (cu == NULL)
+ {
+ off = 0;
+ v4type = false;
+ }
+ else
+ {
+ off = cu->end;
+ v4type = cu->sec_idx != IDX_debug_info;
+
+ /* Make sure we got a real (not fake) CU. */
+ if (cu->sec_idx != IDX_debug_info && cu->sec_idx != IDX_debug_types)
+ {
+ __libdw_seterrno (DWARF_E_INVALID_OFFSET);
+ return -1;
+ }
+
+ /* Do we have to switch to the other section, or are we at the end? */
+ if (! v4type)
+ {
+ if (off >= cu->dbg->sectiondata[IDX_debug_info]->d_size)
+ {
+ if (cu->dbg->sectiondata[IDX_debug_types] == NULL)
+ return 1;
+
+ off = 0;
+ v4type = true;
+ }
+ }
+ else
+ if (off >= cu->dbg->sectiondata[IDX_debug_types]->d_size)
+ return 1;
+ }
+
+ *next_cu = __libdw_findcu (dwarf, off, v4type);
+ if (*next_cu == NULL)
+ return -1;
+
+ Dwarf_CU *next = (*next_cu);
+
+ if (version != NULL)
+ *version = next->version;
+
+ if (unit_type != NULL)
+ *unit_type = next->unit_type;
+
+ if (cudie != NULL)
+ {
+ if (next->version >= 2 && next->version <= 5
+ && next->unit_type >= DW_UT_compile
+ && next->unit_type <= DW_UT_split_type)
+ *cudie = CUDIE (next);
+ else
+ memset (cudie, '\0', sizeof (Dwarf_Die));
+ }
+
+ if (subdie != NULL)
+ {
+ if (next->version >= 2 && next->version <= 5)
+ {
+ /* For types, return the actual type DIE. For skeletons,
+ find the associated split compile unit and return its
+ DIE. */
+ if (next->unit_type == DW_UT_type
+ || next->unit_type == DW_UT_split_type)
+ *subdie = SUBDIE(next);
+ else if (next->unit_type == DW_UT_skeleton)
+ {
+ Dwarf_CU *split_cu = __libdw_find_split_unit (next);
+ if (split_cu != NULL)
+ *subdie = CUDIE(split_cu);
+ else
+ memset (subdie, '\0', sizeof (Dwarf_Die));
+ }
+ else
+ memset (subdie, '\0', sizeof (Dwarf_Die));
+ }
+ else
+ memset (subdie, '\0', sizeof (Dwarf_Die));
+ }
+
+ return 0;
+}
diff --git a/libdw/dwarf_getabbrev.c b/libdw/dwarf_getabbrev.c
index ef51b84..988d12c 100644
--- a/libdw/dwarf_getabbrev.c
+++ b/libdw/dwarf_getabbrev.c
@@ -1,5 +1,5 @@
/* Get abbreviation at given offset.
- Copyright (C) 2003, 2004, 2005, 2006, 2014 Red Hat, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006, 2014, 2017 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -121,8 +121,7 @@
abb->attrp = (unsigned char *) abbrevp;
abb->offset = offset;
- /* Skip over all the attributes and count them while doing so. */
- abb->attrcnt = 0;
+ /* Skip over all the attributes and check rest of the abbrev is valid. */
unsigned int attrname;
unsigned int attrform;
do
@@ -133,8 +132,15 @@
if (abbrevp >= end)
goto invalid;
get_uleb128 (attrform, abbrevp, end);
+ if (attrform == DW_FORM_implicit_const)
+ {
+ int64_t formval __attribute__((__unused__));
+ if (abbrevp >= end)
+ goto invalid;
+ get_sleb128 (formval, abbrevp, end);
+ }
}
- while (attrname != 0 && attrform != 0 && ++abb->attrcnt);
+ while (attrname != 0 && attrform != 0);
/* Return the length to the caller if she asked for it. */
if (lengthp != NULL)
@@ -152,7 +158,21 @@
Dwarf_Abbrev *
dwarf_getabbrev (Dwarf_Die *die, Dwarf_Off offset, size_t *lengthp)
{
- return __libdw_getabbrev (die->cu->dbg, die->cu,
- die->cu->orig_abbrev_offset + offset, lengthp,
- NULL);
+ if (die == NULL || die->cu == NULL)
+ return NULL;
+
+ Dwarf_CU *cu = die->cu;
+ Dwarf *dbg = cu->dbg;
+ Dwarf_Off abbrev_offset = cu->orig_abbrev_offset;
+ Elf_Data *data = dbg->sectiondata[IDX_debug_abbrev];
+ if (data == NULL)
+ return NULL;
+
+ if (offset >= data->d_size - abbrev_offset)
+ {
+ __libdw_seterrno (DWARF_E_INVALID_OFFSET);
+ return NULL;
+ }
+
+ return __libdw_getabbrev (dbg, cu, abbrev_offset + offset, lengthp, NULL);
}
diff --git a/libdw/dwarf_getabbrevattr.c b/libdw/dwarf_getabbrevattr.c
index 3b4da99..54ff604 100644
--- a/libdw/dwarf_getabbrevattr.c
+++ b/libdw/dwarf_getabbrevattr.c
@@ -1,5 +1,5 @@
/* Get specific attribute of abbreviation.
- Copyright (C) 2003, 2004, 2005, 2014 Red Hat, Inc.
+ Copyright (C) 2003, 2004, 2005, 2014, 2017 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -37,8 +37,9 @@
int
-dwarf_getabbrevattr (Dwarf_Abbrev *abbrev, size_t idx, unsigned int *namep,
- unsigned int *formp, Dwarf_Off *offsetp)
+dwarf_getabbrevattr_data (Dwarf_Abbrev *abbrev, size_t idx,
+ unsigned int *namep, unsigned int *formp,
+ Dwarf_Sword *datap, Dwarf_Off *offsetp)
{
if (abbrev == NULL)
return -1;
@@ -48,15 +49,21 @@
const unsigned char *start_attrp;
unsigned int name;
unsigned int form;
+ Dwarf_Word data;
do
{
start_attrp = attrp;
- /* Attribute code and form are encoded as ULEB128 values.i
- XXX We have no way to bounds check. */
- get_uleb128 (name, attrp, attrp + len_leb128 (name));
- get_uleb128 (form, attrp, attrp + len_leb128 (form));
+ /* Attribute code and form are encoded as ULEB128 values.
+ Already checked when Dwarf_Abbrev was created, read unchecked. */
+ get_uleb128_unchecked (name, attrp);
+ get_uleb128_unchecked (form, attrp);
+
+ if (form == DW_FORM_implicit_const)
+ get_sleb128_unchecked (data, attrp);
+ else
+ data = 0;
/* If both values are zero the index is out of range. */
if (name == 0 && form == 0)
@@ -69,8 +76,19 @@
*namep = name;
if (formp != NULL)
*formp = form;
+ if (datap != NULL)
+ *datap = data;
if (offsetp != NULL)
*offsetp = (start_attrp - abbrev->attrp) + abbrev->offset;
return 0;
}
+INTDEF(dwarf_getabbrevattr_data)
+
+int
+dwarf_getabbrevattr (Dwarf_Abbrev *abbrev, size_t idx, unsigned int *namep,
+ unsigned int *formp, Dwarf_Off *offsetp)
+{
+ return INTUSE(dwarf_getabbrevattr_data) (abbrev, idx, namep, formp,
+ NULL, offsetp);
+}
diff --git a/libdw/dwarf_getalt.c b/libdw/dwarf_getalt.c
index cc434f0..0a12dfa 100644
--- a/libdw/dwarf_getalt.c
+++ b/libdw/dwarf_getalt.c
@@ -1,5 +1,5 @@
/* Retrieves the DWARF descriptor for debugaltlink data.
- Copyright (C) 2014 Red Hat, Inc.
+ Copyright (C) 2014, 2018 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -31,12 +31,154 @@
#endif
#include "libdwP.h"
+#include "libelfP.h"
+#include "libdwelfP.h"
+#include "system.h"
+
+#include <inttypes.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+
+char *
+internal_function
+__libdw_filepath (const char *debugdir, const char *dir, const char *file)
+{
+ if (file == NULL)
+ return NULL;
+
+ if (file[0] == '/')
+ return strdup (file);
+
+ if (dir != NULL && dir[0] == '/')
+ {
+ size_t dirlen = strlen (dir);
+ size_t filelen = strlen (file);
+ size_t len = dirlen + 1 + filelen + 1;
+ char *path = malloc (len);
+ if (path != NULL)
+ {
+ char *c = mempcpy (path, dir, dirlen);
+ if (dir[dirlen - 1] != '/')
+ *c++ = '/';
+ mempcpy (c, file, filelen + 1);
+ }
+ return path;
+ }
+
+ if (debugdir != NULL)
+ {
+ size_t debugdirlen = strlen (debugdir);
+ size_t dirlen = dir != NULL ? strlen (dir) : 0;
+ size_t filelen = strlen (file);
+ size_t len = debugdirlen + 1 + dirlen + 1 + filelen + 1;
+ char *path = malloc (len);
+ if (path != NULL)
+ {
+ char *c = mempcpy (path, debugdir, debugdirlen);
+ if (dirlen > 0)
+ {
+ c = mempcpy (c, dir, dirlen);
+ if (dir[dirlen - 1] != '/')
+ *c++ = '/';
+ }
+ mempcpy (c, file, filelen + 1);
+ return path;
+ }
+ }
+
+ return NULL;
+}
+
+static void
+find_debug_altlink (Dwarf *dbg)
+{
+ const char *altname;
+ const void *build_id;
+ ssize_t build_id_len = INTUSE(dwelf_dwarf_gnu_debugaltlink) (dbg,
+ &altname,
+ &build_id);
+
+ /* Couldn't even get the debugaltlink. It probably doesn't exist. */
+ if (build_id_len <= 0)
+ return;
+
+ const uint8_t *id = (const uint8_t *) build_id;
+ size_t id_len = build_id_len;
+ int fd = -1;
+
+ /* We only look in the standard path. And relative to the dbg file. */
+#define DEBUGINFO_PATH "/usr/lib/debug"
+
+ /* We don't handle very short or really large build-ids. We need at
+ at least 3 and allow for up to 64 (normally ids are 20 long). */
+#define MIN_BUILD_ID_BYTES 3
+#define MAX_BUILD_ID_BYTES 64
+ if (id_len >= MIN_BUILD_ID_BYTES && id_len <= MAX_BUILD_ID_BYTES)
+ {
+ /* Note sizeof a string literal includes the trailing zero. */
+ char id_path[sizeof DEBUGINFO_PATH - 1 + sizeof "/.build-id/" - 1
+ + 2 + 1 + (MAX_BUILD_ID_BYTES - 1) * 2 + sizeof ".debug"];
+ sprintf (&id_path[0], "%s%s", DEBUGINFO_PATH, "/.build-id/");
+ sprintf (&id_path[sizeof DEBUGINFO_PATH - 1 + sizeof "/.build-id/" - 1],
+ "%02" PRIx8 "/", (uint8_t) id[0]);
+ for (size_t i = 1; i < id_len; ++i)
+ sprintf (&id_path[sizeof DEBUGINFO_PATH - 1 + sizeof "/.build-id/" - 1
+ + 3 + (i - 1) * 2], "%02" PRIx8, (uint8_t) id[i]);
+ strcpy (&id_path[sizeof DEBUGINFO_PATH - 1 + sizeof "/.build-id/" - 1
+ + 3 + (id_len - 1) * 2], ".debug");
+
+ fd = TEMP_FAILURE_RETRY (open (id_path, O_RDONLY));
+ }
+
+ /* Fall back on (possible relative) alt file path. */
+ if (fd < 0)
+ {
+ char *altpath = __libdw_filepath (dbg->debugdir, NULL, altname);
+ if (altpath != NULL)
+ {
+ fd = TEMP_FAILURE_RETRY (open (altpath, O_RDONLY));
+ free (altpath);
+ }
+ }
+
+ if (fd >= 0)
+ {
+ Dwarf *alt = dwarf_begin (fd, O_RDONLY);
+ if (alt != NULL)
+ {
+ dbg->alt_dwarf = alt;
+ dbg->alt_fd = fd;
+ }
+ else
+ close (fd);
+ }
+}
Dwarf *
dwarf_getalt (Dwarf *main)
{
- if (main == NULL)
+ /* Only try once. */
+ if (main == NULL || main->alt_dwarf == (void *) -1)
return NULL;
+
+ if (main->alt_dwarf != NULL)
+ return main->alt_dwarf;
+
+ find_debug_altlink (main);
+
+ /* If we found nothing, make sure we don't try again. */
+ if (main->alt_dwarf == NULL)
+ {
+ main->alt_dwarf = (void *) -1;
+ return NULL;
+ }
+
return main->alt_dwarf;
}
INTDEF (dwarf_getalt)
diff --git a/libdw/dwarf_getaranges.c b/libdw/dwarf_getaranges.c
index 4252746..bff9c86 100644
--- a/libdw/dwarf_getaranges.c
+++ b/libdw/dwarf_getaranges.c
@@ -1,5 +1,5 @@
/* Return list address ranges.
- Copyright (C) 2000-2010 Red Hat, Inc.
+ Copyright (C) 2000-2010, 2016, 2017 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2000.
@@ -195,16 +195,15 @@
new_arange->arange.length = range_length;
/* We store the actual CU DIE offset, not the CU header offset. */
- const char *cu_header = (dbg->sectiondata[IDX_debug_info]->d_buf
- + offset);
- unsigned int offset_size;
- if (read_4ubyte_unaligned_noncvt (cu_header) == DWARF3_LENGTH_64_BIT)
- offset_size = 8;
- else
- offset_size = 4;
- new_arange->arange.offset = DIE_OFFSET_FROM_CU_OFFSET (offset,
- offset_size,
- false);
+ Dwarf_CU *cu = __libdw_findcu (dbg, offset, false);
+ if (unlikely (cu == NULL))
+ {
+ /* We haven't gotten a chance to link in the new_arange
+ into the arangelist, don't leak it. */
+ free (new_arange);
+ goto fail;
+ }
+ new_arange->arange.offset = __libdw_first_die_off_from_cu (cu);
new_arange->next = arangelist;
arangelist = new_arange;
diff --git a/libdw/dwarf_getattrcnt.c b/libdw/dwarf_getattrcnt.c
index 2bfb4ac..a05976d 100644
--- a/libdw/dwarf_getattrcnt.c
+++ b/libdw/dwarf_getattrcnt.c
@@ -1,5 +1,5 @@
/* Get number of attributes of abbreviation.
- Copyright (C) 2003, 2004 Red Hat, Inc.
+ Copyright (C) 2003, 2004, 2017 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -40,7 +40,22 @@
if (abbrev == NULL)
return -1;
- *attrcntp = abbrev->attrcnt;
+ const unsigned char *abbrevp = abbrev->attrp;
+
+ /* Skip over all the attributes and count them while doing so. */
+ int attrcnt = 0;
+ unsigned int attrname;
+ unsigned int attrform;
+ do
+ {
+ /* We can use unchecked since they were checked when the Dwrf_Abbrev
+ was created. */
+ get_uleb128_unchecked (attrname, abbrevp);
+ get_uleb128_unchecked (attrform, abbrevp);
+ }
+ while (attrname != 0 && attrform != 0 && ++attrcnt);
+
+ *attrcntp = attrcnt;
return 0;
}
diff --git a/libdw/dwarf_getattrs.c b/libdw/dwarf_getattrs.c
index 0da8b5b..50faf98 100644
--- a/libdw/dwarf_getattrs.c
+++ b/libdw/dwarf_getattrs.c
@@ -1,5 +1,5 @@
/* Get attributes of the DIE.
- Copyright (C) 2004, 2005, 2008, 2009, 2014 Red Hat, Inc.
+ Copyright (C) 2004, 2005, 2008, 2009, 2014, 2017 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2004.
@@ -51,7 +51,6 @@
if (unlikely (abbrevp == DWARF_END_ABBREV))
{
- invalid_dwarf:
__libdw_seterrno (DWARF_E_INVALID_DWARF);
return -1l;
}
@@ -61,24 +60,15 @@
const unsigned char *const offset_attrp = abbrevp->attrp + offset;
/* Go over the list of attributes. */
- Dwarf *dbg = die->cu->dbg;
- const unsigned char *endp;
- endp = ((const unsigned char *) dbg->sectiondata[IDX_debug_abbrev]->d_buf
- + dbg->sectiondata[IDX_debug_abbrev]->d_size);
while (1)
{
- /* Are we still in bounds? */
- if (unlikely (attrp >= endp))
- goto invalid_dwarf;
-
- /* Get attribute name and form. */
+ /* Get attribute name and form. Dwarf_Abbrev was checked when
+ created, so we can read unchecked. */
Dwarf_Attribute attr;
const unsigned char *remembered_attrp = attrp;
- get_uleb128 (attr.code, attrp, endp);
- if (unlikely (attrp >= endp))
- goto invalid_dwarf;
- get_uleb128 (attr.form, attrp, endp);
+ get_uleb128_unchecked (attr.code, attrp);
+ get_uleb128_unchecked (attr.form, attrp);
/* We can stop if we found the attribute with value zero. */
if (attr.code == 0 && attr.form == 0)
@@ -93,7 +83,10 @@
if (remembered_attrp >= offset_attrp)
{
/* Fill in the rest. */
- attr.valp = (unsigned char *) die_addr;
+ if (attr.form == DW_FORM_implicit_const)
+ attr.valp = (unsigned char *) attrp;
+ else
+ attr.valp = (unsigned char *) die_addr;
attr.cu = die->cu;
/* Now call the callback function. */
@@ -114,6 +107,12 @@
// __libdw_form_val_len will have done a bounds check.
die_addr += len;
+
+ if (attr.form == DW_FORM_implicit_const)
+ {
+ int64_t attr_value __attribute__((__unused__));
+ get_sleb128_unchecked (attr_value, attrp);
+ }
}
}
/* NOTREACHED */
diff --git a/libdw/dwarf_getlocation.c b/libdw/dwarf_getlocation.c
index a4a2761..fc59a2a 100644
--- a/libdw/dwarf_getlocation.c
+++ b/libdw/dwarf_getlocation.c
@@ -1,7 +1,6 @@
/* Return location expression list.
- Copyright (C) 2000-2010, 2013-2015 Red Hat, Inc.
+ Copyright (C) 2000-2010, 2013-2015, 2017, 2018 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
@@ -45,10 +44,34 @@
if (attr == NULL)
return false;
- /* Must be one of the attributes listed below. */
+ /* If it is an exprloc, it is obviously OK. */
+ if (dwarf_whatform (attr) == DW_FORM_exprloc)
+ return true;
+
+ /* Otherwise must be one of the attributes listed below. Older
+ DWARF versions might have encoded the exprloc as block, and we
+ cannot easily distinquish attributes in the loclist class because
+ the same forms are used for different classes. */
switch (attr->code)
{
case DW_AT_location:
+ case DW_AT_byte_size:
+ case DW_AT_bit_offset:
+ case DW_AT_bit_size:
+ case DW_AT_lower_bound:
+ case DW_AT_bit_stride:
+ case DW_AT_upper_bound:
+ case DW_AT_count:
+ case DW_AT_allocated:
+ case DW_AT_associated:
+ case DW_AT_data_location:
+ case DW_AT_byte_stride:
+ case DW_AT_rank:
+ case DW_AT_call_value:
+ case DW_AT_call_target:
+ case DW_AT_call_target_clobbered:
+ case DW_AT_call_data_location:
+ case DW_AT_call_data_value:
case DW_AT_data_member_location:
case DW_AT_vtable_elem_location:
case DW_AT_string_length:
@@ -64,7 +87,7 @@
break;
default:
- __libdw_seterrno (DWARF_E_NO_LOCLIST);
+ __libdw_seterrno (DWARF_E_NO_LOC_VALUE);
return false;
}
@@ -97,19 +120,23 @@
}
/* For each DW_OP_implicit_value, we store a special entry in the cache.
- This points us directly to the block data for later fetching. */
-static void
+ This points us directly to the block data for later fetching.
+ Returns zero on success, -1 on bad DWARF or 1 if tsearch failed. */
+static int
store_implicit_value (Dwarf *dbg, void **cache, Dwarf_Op *op)
{
struct loc_block_s *block = libdw_alloc (dbg, struct loc_block_s,
sizeof (struct loc_block_s), 1);
const unsigned char *data = (const unsigned char *) (uintptr_t) op->number2;
- // Ignored, equal to op->number. And data length already checked.
- (void) __libdw_get_uleb128 (&data, data + len_leb128 (Dwarf_Word));
+ uint64_t len = __libdw_get_uleb128 (&data, data + len_leb128 (Dwarf_Word));
+ if (unlikely (len != op->number))
+ return -1;
block->addr = op;
block->data = (unsigned char *) data;
block->length = op->number;
- (void) tsearch (block, cache, loc_compare);
+ if (unlikely (tsearch (block, cache, loc_compare) == NULL))
+ return 1;
+ return 0;
}
int
@@ -147,6 +174,8 @@
default:
return 1;
+ /* Note, we don't regard DW_FORM_data16 as a constant form,
+ even though technically it is according to the standard. */
case DW_FORM_data1:
case DW_FORM_data2:
case DW_FORM_data4:
@@ -299,6 +328,7 @@
break;
case DW_OP_call_ref:
+ case DW_OP_GNU_variable_value:
/* DW_FORM_ref_addr, depends on offset size of CU. */
if (dbg == NULL || __libdw_read_offset_inc (dbg, sec_index, &data,
ref_size,
@@ -427,8 +457,14 @@
case DW_OP_plus_uconst:
case DW_OP_regx:
case DW_OP_piece:
+ case DW_OP_convert:
case DW_OP_GNU_convert:
+ case DW_OP_reinterpret:
case DW_OP_GNU_reinterpret:
+ case DW_OP_addrx:
+ case DW_OP_GNU_addr_index:
+ case DW_OP_constx:
+ case DW_OP_GNU_const_index:
get_uleb128 (newloc->number, data, end_data);
break;
@@ -446,6 +482,7 @@
break;
case DW_OP_bit_piece:
+ case DW_OP_regval_type:
case DW_OP_GNU_regval_type:
get_uleb128 (newloc->number, data, end_data);
if (unlikely (data >= end_data))
@@ -454,6 +491,7 @@
break;
case DW_OP_implicit_value:
+ case DW_OP_entry_value:
case DW_OP_GNU_entry_value:
/* This cannot be used in a CFI expression. */
if (unlikely (dbg == NULL))
@@ -467,6 +505,7 @@
data += newloc->number; /* Skip the block. */
break;
+ case DW_OP_implicit_pointer:
case DW_OP_GNU_implicit_pointer:
/* DW_FORM_ref_addr, depends on offset size of CU. */
if (dbg == NULL || __libdw_read_offset_inc (dbg, sec_index, &data,
@@ -479,13 +518,16 @@
get_uleb128 (newloc->number2, data, end_data); /* Byte offset. */
break;
+ case DW_OP_deref_type:
case DW_OP_GNU_deref_type:
+ case DW_OP_xderef_type:
if (unlikely (data + 1 >= end_data))
goto invalid;
newloc->number = *data++;
get_uleb128 (newloc->number2, data, end_data);
break;
+ case DW_OP_const_type:
case DW_OP_GNU_const_type:
{
size_t size;
@@ -553,7 +595,16 @@
result[n].offset = loclist->offset;
if (result[n].atom == DW_OP_implicit_value)
- store_implicit_value (dbg, cache, &result[n]);
+ {
+ int store = store_implicit_value (dbg, cache, &result[n]);
+ if (unlikely (store != 0))
+ {
+ if (store < 0)
+ goto invalid;
+ else
+ goto nomem;
+ }
+ }
struct loclist *loc = loclist;
loclist = loclist->next;
@@ -616,7 +667,13 @@
if (result != 1)
return result;
- /* If it has a block form, it's a single location expression. */
+ /* If it has a block form, it's a single location expression.
+ Except for DW_FORM_data16, which is a 128bit constant. */
+ if (attr->form == DW_FORM_data16)
+ {
+ __libdw_seterrno (DWARF_E_NO_BLOCK);
+ return -1;
+ }
Dwarf_Block block;
if (INTUSE(dwarf_formblock) (attr, &block) != 0)
return -1;
@@ -624,47 +681,113 @@
return getlocation (attr->cu, &block, llbuf, listlen, cu_sec_idx (attr->cu));
}
-static int
-attr_base_address (Dwarf_Attribute *attr, Dwarf_Addr *basep)
+Dwarf_Addr
+__libdw_cu_base_address (Dwarf_CU *cu)
{
- /* Fetch the CU's base address. */
- Dwarf_Die cudie = CUDIE (attr->cu);
-
- /* Find the base address of the compilation unit. It will
- normally be specified by DW_AT_low_pc. In DWARF-3 draft 4,
- the base address could be overridden by DW_AT_entry_pc. It's
- been removed, but GCC emits DW_AT_entry_pc and not DW_AT_lowpc
- for compilation units with discontinuous ranges. */
- Dwarf_Attribute attr_mem;
- if (unlikely (INTUSE(dwarf_lowpc) (&cudie, basep) != 0)
- && INTUSE(dwarf_formaddr) (INTUSE(dwarf_attr) (&cudie,
- DW_AT_entry_pc,
- &attr_mem),
- basep) != 0)
+ if (cu->base_address == (Dwarf_Addr) -1)
{
- if (INTUSE(dwarf_errno) () != 0)
- return -1;
+ Dwarf_Addr base;
- /* The compiler provided no base address when it should
- have. Buggy GCC does this when it used absolute
- addresses in the location list and no DW_AT_ranges. */
- *basep = 0;
+ /* Fetch the CU's base address. */
+ Dwarf_Die cudie = CUDIE (cu);
+
+ /* Find the base address of the compilation unit. It will
+ normally be specified by DW_AT_low_pc. In DWARF-3 draft 4,
+ the base address could be overridden by DW_AT_entry_pc. It's
+ been removed, but GCC emits DW_AT_entry_pc and not DW_AT_lowpc
+ for compilation units with discontinuous ranges. */
+ Dwarf_Attribute attr_mem;
+ if (INTUSE(dwarf_lowpc) (&cudie, &base) != 0
+ && INTUSE(dwarf_formaddr) (INTUSE(dwarf_attr) (&cudie,
+ DW_AT_entry_pc,
+ &attr_mem),
+ &base) != 0)
+ {
+ /* The compiler provided no base address when it should
+ have. Buggy GCC does this when it used absolute
+ addresses in the location list and no DW_AT_ranges. */
+ base = 0;
+ }
+ cu->base_address = base;
}
- return 0;
+
+ return cu->base_address;
}
static int
-initial_offset_base (Dwarf_Attribute *attr, ptrdiff_t *offset,
- Dwarf_Addr *basep)
+initial_offset (Dwarf_Attribute *attr, ptrdiff_t *offset)
{
- if (attr_base_address (attr, basep) != 0)
- return -1;
+ size_t secidx = (attr->cu->version < 5
+ ? IDX_debug_loc : IDX_debug_loclists);
Dwarf_Word start_offset;
- if (__libdw_formptr (attr, IDX_debug_loc,
- DWARF_E_NO_LOCLIST,
- NULL, &start_offset) == NULL)
- return -1;
+ if (attr->form == DW_FORM_loclistx)
+ {
+ Dwarf_Word idx;
+ Dwarf_CU *cu = attr->cu;
+ const unsigned char *datap = attr->valp;
+ const unsigned char *endp = cu->endp;
+ if (datap >= endp)
+ {
+ __libdw_seterrno (DWARF_E_INVALID_DWARF);
+ return -1;
+ }
+ get_uleb128 (idx, datap, endp);
+
+ Elf_Data *data = cu->dbg->sectiondata[secidx];
+ if (data == NULL && cu->unit_type == DW_UT_split_compile)
+ {
+ cu = __libdw_find_split_unit (cu);
+ if (cu != NULL)
+ data = cu->dbg->sectiondata[secidx];
+ }
+
+ if (data == NULL)
+ {
+ __libdw_seterrno (secidx == IDX_debug_loc
+ ? DWARF_E_NO_DEBUG_LOC
+ : DWARF_E_NO_DEBUG_LOCLISTS);
+ return -1;
+ }
+
+ Dwarf_Off loc_base_off = __libdw_cu_locs_base (cu);
+
+ /* The section should at least contain room for one offset. */
+ size_t sec_size = cu->dbg->sectiondata[secidx]->d_size;
+ size_t offset_size = cu->offset_size;
+ if (offset_size > sec_size)
+ {
+ invalid_offset:
+ __libdw_seterrno (DWARF_E_INVALID_OFFSET);
+ return -1;
+ }
+
+ /* And the base offset should be at least inside the section. */
+ if (loc_base_off > (sec_size - offset_size))
+ goto invalid_offset;
+
+ size_t max_idx = (sec_size - offset_size - loc_base_off) / offset_size;
+ if (idx > max_idx)
+ goto invalid_offset;
+
+ datap = (cu->dbg->sectiondata[secidx]->d_buf
+ + loc_base_off + (idx * offset_size));
+ if (offset_size == 4)
+ start_offset = read_4ubyte_unaligned (cu->dbg, datap);
+ else
+ start_offset = read_8ubyte_unaligned (cu->dbg, datap);
+
+ start_offset += loc_base_off;
+ }
+ else
+ {
+ if (__libdw_formptr (attr, secidx,
+ (secidx == IDX_debug_loc
+ ? DWARF_E_NO_DEBUG_LOC
+ : DWARF_E_NO_DEBUG_LOCLISTS),
+ NULL, &start_offset) == NULL)
+ return -1;
+ }
*offset = start_offset;
return 0;
@@ -676,22 +799,19 @@
Dwarf_Addr address, const Elf_Data *locs, Dwarf_Op **expr,
size_t *exprlen)
{
- unsigned char *readp = locs->d_buf + offset;
- unsigned char *readendp = locs->d_buf + locs->d_size;
-
- next:
- if (readendp - readp < attr->cu->address_size * 2)
- {
- invalid:
- __libdw_seterrno (DWARF_E_INVALID_DWARF);
- return -1;
- }
+ Dwarf_CU *cu = attr->cu;
+ Dwarf *dbg = cu->dbg;
+ size_t secidx = cu->version < 5 ? IDX_debug_loc : IDX_debug_loclists;
+ const unsigned char *readp = locs->d_buf + offset;
+ const unsigned char *readendp = locs->d_buf + locs->d_size;
Dwarf_Addr begin;
Dwarf_Addr end;
- switch (__libdw_read_begin_end_pair_inc (attr->cu->dbg, IDX_debug_loc,
- &readp, attr->cu->address_size,
+ next:
+ switch (__libdw_read_begin_end_pair_inc (cu, secidx,
+ &readp, readendp,
+ cu->address_size,
&begin, &end, basep))
{
case 0: /* got location range. */
@@ -704,25 +824,38 @@
return -1;
}
- if (readendp - readp < 2)
- goto invalid;
-
/* We have a location expression. */
Dwarf_Block block;
- block.length = read_2ubyte_unaligned_inc (attr->cu->dbg, readp);
- block.data = readp;
+ if (secidx == IDX_debug_loc)
+ {
+ if (readendp - readp < 2)
+ {
+ invalid:
+ __libdw_seterrno (DWARF_E_INVALID_DWARF);
+ return -1;
+ }
+ block.length = read_2ubyte_unaligned_inc (dbg, readp);
+ }
+ else
+ {
+ if (readendp - readp < 1)
+ goto invalid;
+ get_uleb128 (block.length, readp, readendp);
+ }
+ block.data = (unsigned char *) readp;
if (readendp - readp < (ptrdiff_t) block.length)
goto invalid;
readp += block.length;
- *startp = *basep + begin;
- *endp = *basep + end;
+ /* Note these addresses include any base (if necessary) already. */
+ *startp = begin;
+ *endp = end;
/* If address is minus one we want them all, otherwise only matching. */
if (address != (Dwarf_Word) -1 && (address < *startp || address >= *endp))
goto next;
- if (getlocation (attr->cu, &block, expr, exprlen, IDX_debug_loc) != 0)
+ if (getlocation (cu, &block, expr, exprlen, secidx) != 0)
return -1;
return readp - (unsigned char *) locs->d_buf;
@@ -738,9 +871,11 @@
if (llbufs == NULL)
maxlocs = SIZE_MAX;
- /* If it has a block form, it's a single location expression. */
+ /* If it has a block form, it's a single location expression.
+ Except for DW_FORM_data16, which is a 128bit constant. */
Dwarf_Block block;
- if (INTUSE(dwarf_formblock) (attr, &block) == 0)
+ if (attr->form != DW_FORM_data16
+ && INTUSE(dwarf_formblock) (attr, &block) == 0)
{
if (maxlocs == 0)
return 0;
@@ -751,11 +886,14 @@
return listlens[0] == 0 ? 0 : 1;
}
- int error = INTUSE(dwarf_errno) ();
- if (unlikely (error != DWARF_E_NO_BLOCK))
+ if (attr->form != DW_FORM_data16)
{
- __libdw_seterrno (error);
- return -1;
+ int error = INTUSE(dwarf_errno) ();
+ if (unlikely (error != DWARF_E_NO_BLOCK))
+ {
+ __libdw_seterrno (error);
+ return -1;
+ }
}
int result = check_constant_offset (attr, &llbufs[0], &listlens[0]);
@@ -769,19 +907,19 @@
size_t got = 0;
/* This is a true loclistptr, fetch the initial base address and offset. */
- if (initial_offset_base (attr, &off, &base) != 0)
+ base = __libdw_cu_base_address (attr->cu);
+ if (base == (Dwarf_Addr) -1)
return -1;
- const Elf_Data *d = attr->cu->dbg->sectiondata[IDX_debug_loc];
- if (d == NULL)
- {
- __libdw_seterrno (DWARF_E_NO_LOCLIST);
- return -1;
- }
+ if (initial_offset (attr, &off) != 0)
+ return -1;
+
+ size_t secidx = attr->cu->version < 5 ? IDX_debug_loc : IDX_debug_loclists;
+ const Elf_Data *d = attr->cu->dbg->sectiondata[secidx];
while (got < maxlocs
&& (off = getlocations_addr (attr, off, &base, &start, &end,
- address, d, &expr, &expr_len)) > 0)
+ address, d, &expr, &expr_len)) > 0)
{
/* This one matches the address. */
if (llbufs != NULL)
@@ -813,9 +951,11 @@
if (offset == 0)
{
- /* If it has a block form, it's a single location expression. */
+ /* If it has a block form, it's a single location expression.
+ Except for DW_FORM_data16, which is a 128bit constant. */
Dwarf_Block block;
- if (INTUSE(dwarf_formblock) (attr, &block) == 0)
+ if (attr->form != DW_FORM_data16
+ && INTUSE(dwarf_formblock) (attr, &block) == 0)
{
if (getlocation (attr->cu, &block, expr, exprlen,
cu_sec_idx (attr->cu)) != 0)
@@ -827,11 +967,14 @@
return 1;
}
- int error = INTUSE(dwarf_errno) ();
- if (unlikely (error != DWARF_E_NO_BLOCK))
+ if (attr->form != DW_FORM_data16)
{
- __libdw_seterrno (error);
- return -1;
+ int error = INTUSE(dwarf_errno) ();
+ if (unlikely (error != DWARF_E_NO_BLOCK))
+ {
+ __libdw_seterrno (error);
+ return -1;
+ }
}
int result = check_constant_offset (attr, expr, exprlen);
@@ -849,16 +992,16 @@
/* We must be looking at a true loclistptr, fetch the initial
base address and offset. */
- if (initial_offset_base (attr, &offset, basep) != 0)
+ *basep = __libdw_cu_base_address (attr->cu);
+ if (*basep == (Dwarf_Addr) -1)
+ return -1;
+
+ if (initial_offset (attr, &offset) != 0)
return -1;
}
- const Elf_Data *d = attr->cu->dbg->sectiondata[IDX_debug_loc];
- if (d == NULL)
- {
- __libdw_seterrno (DWARF_E_NO_LOCLIST);
- return -1;
- }
+ size_t secidx = attr->cu->version < 5 ? IDX_debug_loc : IDX_debug_loclists;
+ const Elf_Data *d = attr->cu->dbg->sectiondata[secidx];
return getlocations_addr (attr, offset, basep, startp, endp,
(Dwarf_Word) -1, d, expr, exprlen);
diff --git a/libdw/dwarf_getlocation_attr.c b/libdw/dwarf_getlocation_attr.c
index 8b6a4af..99bcc82 100644
--- a/libdw/dwarf_getlocation_attr.c
+++ b/libdw/dwarf_getlocation_attr.c
@@ -1,5 +1,5 @@
/* Return DWARF attribute associated with a location expression op.
- Copyright (C) 2013, 2014 Red Hat, Inc.
+ Copyright (C) 2013, 2014, 2017, 2018 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -38,7 +38,7 @@
{
/* If the attribute has block/expr form the data comes from the
.debug_info from the same cu as the attr. Otherwise it comes from
- the .debug_loc data section. */
+ the .debug_loc or .debug_loclists data section. */
switch (attr->form)
{
case DW_FORM_block1:
@@ -48,10 +48,26 @@
case DW_FORM_exprloc:
return attr->cu;
default:
- return attr->cu->dbg->fake_loc_cu;
+ return (attr->cu->version < 5
+ ? attr->cu->dbg->fake_loc_cu
+ : attr->cu->dbg->fake_loclists_cu);
}
}
+static unsigned char *
+addr_valp (Dwarf_CU *cu, Dwarf_Word index)
+{
+ Elf_Data *debug_addr = cu->dbg->sectiondata[IDX_debug_addr];
+ if (debug_addr == NULL)
+ {
+ __libdw_seterrno (DWARF_E_NO_DEBUG_ADDR);
+ return NULL;
+ }
+
+ Dwarf_Word offset = __libdw_cu_addr_base (cu) + (index * cu->address_size);
+ return (unsigned char *) debug_addr->d_buf + offset;
+}
+
int
dwarf_getlocation_attr (Dwarf_Attribute *attr, const Dwarf_Op *op, Dwarf_Attribute *result)
{
@@ -67,6 +83,7 @@
result->cu = attr_form_cu (attr);
break;
+ case DW_OP_entry_value:
case DW_OP_GNU_entry_value:
result->code = DW_AT_location;
result->form = DW_FORM_exprloc;
@@ -74,6 +91,7 @@
result->cu = attr_form_cu (attr);
break;
+ case DW_OP_const_type:
case DW_OP_GNU_const_type:
result->code = DW_AT_const_value;
result->form = DW_FORM_block1;
@@ -81,6 +99,29 @@
result->cu = attr_form_cu (attr);
break;
+ case DW_OP_GNU_const_index:
+ case DW_OP_constx:
+ result->code = DW_AT_const_value;
+ if (attr->cu->address_size == 4)
+ result->form = DW_FORM_data4;
+ else
+ result->form = DW_FORM_data8;
+ result->valp = addr_valp (attr->cu, op->number);
+ if (result->valp == NULL)
+ return -1;
+ result->cu = attr->cu->dbg->fake_addr_cu;
+ break;
+
+ case DW_OP_GNU_addr_index:
+ case DW_OP_addrx:
+ result->code = DW_AT_low_pc;
+ result->form = DW_FORM_addr;
+ result->valp = addr_valp (attr->cu, op->number);
+ if (result->valp == NULL)
+ return -1;
+ result->cu = attr->cu->dbg->fake_addr_cu;
+ break;
+
case DW_OP_call2:
case DW_OP_call4:
case DW_OP_call_ref:
@@ -96,7 +137,9 @@
}
break;
+ case DW_OP_implicit_pointer:
case DW_OP_GNU_implicit_pointer:
+ case DW_OP_GNU_variable_value:
{
Dwarf_Die die;
if (INTUSE(dwarf_getlocation_die) (attr, op, &die) != 0)
diff --git a/libdw/dwarf_getlocation_die.c b/libdw/dwarf_getlocation_die.c
index b4908d2..673c61c 100644
--- a/libdw/dwarf_getlocation_die.c
+++ b/libdw/dwarf_getlocation_die.c
@@ -1,5 +1,5 @@
/* Return DIE associated with a location expression op.
- Copyright (C) 2013 Red Hat, Inc.
+ 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
@@ -43,32 +43,51 @@
Dwarf_Off dieoff;
switch (op->atom)
{
+ case DW_OP_implicit_pointer:
case DW_OP_GNU_implicit_pointer:
case DW_OP_call_ref:
+ case DW_OP_GNU_variable_value:
dieoff = op->number;
break;
case DW_OP_GNU_parameter_ref:
+ case DW_OP_convert:
case DW_OP_GNU_convert:
+ case DW_OP_reinterpret:
case DW_OP_GNU_reinterpret:
+ case DW_OP_const_type:
case DW_OP_GNU_const_type:
case DW_OP_call2:
case DW_OP_call4:
+ if (op->number > (attr->cu->end - attr->cu->start))
+ {
+ invalid_offset:
+ __libdw_seterrno (DWARF_E_INVALID_OFFSET);
+ return -1;
+ }
dieoff = attr->cu->start + op->number;
break;
+ case DW_OP_regval_type:
case DW_OP_GNU_regval_type:
+ case DW_OP_deref_type:
case DW_OP_GNU_deref_type:
+ if (op->number2 > (attr->cu->end - attr->cu->start))
+ goto invalid_offset;
dieoff = attr->cu->start + op->number2;
break;
+ case DW_OP_xderef_type:
+ dieoff = op->number2;
+ break;
+
default:
__libdw_seterrno (DWARF_E_INVALID_ACCESS);
return -1;
}
if (__libdw_offdie (attr->cu->dbg, dieoff, result,
- attr->cu->type_offset != 0) == NULL)
+ ISV4TU(attr->cu)) == NULL)
return -1;
return 0;
diff --git a/libdw/dwarf_getlocation_implicit_pointer.c b/libdw/dwarf_getlocation_implicit_pointer.c
index 9505382..0c1cd00 100644
--- a/libdw/dwarf_getlocation_implicit_pointer.c
+++ b/libdw/dwarf_getlocation_implicit_pointer.c
@@ -1,5 +1,5 @@
/* Return associated attribute for DW_OP_GNU_implicit_pointer.
- Copyright (C) 2010 Red Hat, Inc.
+ Copyright (C) 2010, 2017 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -55,7 +55,8 @@
if (attr == NULL)
return -1;
- if (unlikely (op->atom != DW_OP_GNU_implicit_pointer))
+ if (unlikely (op->atom != DW_OP_implicit_pointer
+ && op->atom != DW_OP_GNU_implicit_pointer))
{
__libdw_seterrno (DWARF_E_INVALID_ACCESS);
return -1;
@@ -63,7 +64,7 @@
Dwarf_Die die;
if (__libdw_offdie (attr->cu->dbg, op->number, &die,
- attr->cu->type_offset != 0) == NULL)
+ ISV4TU(attr->cu)) == NULL)
return -1;
if (INTUSE(dwarf_attr) (&die, DW_AT_location, result) == NULL
diff --git a/libdw/dwarf_getmacros.c b/libdw/dwarf_getmacros.c
index eb50508..fd92966 100644
--- a/libdw/dwarf_getmacros.c
+++ b/libdw/dwarf_getmacros.c
@@ -1,7 +1,6 @@
/* Get macro information.
- Copyright (C) 2002-2009, 2014 Red Hat, Inc.
+ Copyright (C) 2002-2009, 2014, 2017, 2018 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
@@ -158,7 +157,7 @@
}
uint16_t version = read_2ubyte_unaligned_inc (dbg, readp);
- if (version != 4)
+ if (version != 4 && version != 5)
{
__libdw_seterrno (DWARF_E_INVALID_VERSION);
return NULL;
@@ -192,21 +191,26 @@
MACRO_PROTO (p_udata_str, DW_FORM_udata, DW_FORM_string);
MACRO_PROTO (p_udata_strp, DW_FORM_udata, DW_FORM_strp);
+ MACRO_PROTO (p_udata_strsup, DW_FORM_udata, DW_FORM_strp_sup);
+ MACRO_PROTO (p_udata_strx, DW_FORM_udata, DW_FORM_strx);
MACRO_PROTO (p_udata_udata, DW_FORM_udata, DW_FORM_udata);
MACRO_PROTO (p_secoffset, DW_FORM_sec_offset);
MACRO_PROTO (p_none);
Dwarf_Macro_Op_Proto op_protos[255] =
{
- [DW_MACRO_GNU_define - 1] = p_udata_str,
- [DW_MACRO_GNU_undef - 1] = p_udata_str,
- [DW_MACRO_GNU_define_indirect - 1] = p_udata_strp,
- [DW_MACRO_GNU_undef_indirect - 1] = p_udata_strp,
- [DW_MACRO_GNU_start_file - 1] = p_udata_udata,
- [DW_MACRO_GNU_end_file - 1] = p_none,
- [DW_MACRO_GNU_transparent_include - 1] = p_secoffset,
- /* N.B. DW_MACRO_undef_indirectx, DW_MACRO_define_indirectx
- should be added when 130313.1 is supported. */
+ [DW_MACRO_define - 1] = p_udata_str,
+ [DW_MACRO_undef - 1] = p_udata_str,
+ [DW_MACRO_define_strp - 1] = p_udata_strp,
+ [DW_MACRO_undef_strp - 1] = p_udata_strp,
+ [DW_MACRO_start_file - 1] = p_udata_udata,
+ [DW_MACRO_end_file - 1] = p_none,
+ [DW_MACRO_import - 1] = p_secoffset,
+ [DW_MACRO_define_sup - 1] = p_udata_strsup,
+ [DW_MACRO_undef_sup - 1] = p_udata_strsup,
+ [DW_MACRO_import_sup - 1] = p_secoffset, /* XXX - but in sup!. */
+ [DW_MACRO_define_strx - 1] = p_udata_strx,
+ [DW_MACRO_undef_strx - 1] = p_udata_strx,
};
if ((flags & 0x4) != 0)
@@ -354,11 +358,19 @@
/* A fake CU with bare minimum data to fool dwarf_formX into
doing the right thing with the attributes that we put out.
- We arbitrarily pretend it's version 4. */
+ We pretend it is the same version as the actual table.
+ Version 4 for the old GNU extension, version 5 for DWARF5.
+ To handle DW_FORM_strx[1234] we set the .str_offsets_base
+ from the given CU.
+ XXX We will need to deal with DW_MACRO_import_sup and change
+ out the dbg somehow for the DW_FORM_sec_offset to make sense. */
Dwarf_CU fake_cu = {
.dbg = dbg,
- .version = 4,
+ .sec_idx = sec_index,
+ .version = table->version,
.offset_size = table->is_64bit ? 8 : 4,
+ .str_off_base = str_offsets_base_off (dbg, (cudie != NULL
+ ? cudie->cu: NULL)),
.startp = (void *) startp + offset,
.endp = (void *) endp,
};
@@ -381,14 +393,25 @@
for (Dwarf_Word i = 0; i < proto->nforms; ++i)
{
- /* We pretend this is a DW_AT_GNU_macros attribute so that
+ /* We pretend this is a DW_AT[_GNU]_macros attribute so that
DW_FORM_sec_offset forms get correctly interpreted as
- offset into .debug_macro. */
- attributes[i].code = DW_AT_GNU_macros;
+ offset into .debug_macro. XXX Deal with DW_MACRO_import_sup
+ (swap .dbg) for DW_FORM_sec_offset? */
+ attributes[i].code = (fake_cu.version == 4 ? DW_AT_GNU_macros
+ : DW_AT_macros);
attributes[i].form = proto->forms[i];
attributes[i].valp = (void *) readp;
attributes[i].cu = &fake_cu;
+ /* We don't want forms that aren't allowed because they could
+ read from the "abbrev" like DW_FORM_implicit_const. */
+ if (! libdw_valid_user_form (attributes[i].form))
+ {
+ __libdw_seterrno (DWARF_E_INVALID_DWARF);
+ free (attributesp);
+ return -1;
+ }
+
size_t len = __libdw_form_val_len (&fake_cu, proto->forms[i], readp);
if (unlikely (len == (size_t) -1))
{
@@ -558,7 +581,8 @@
{
/* DW_AT_GNU_macros, DW_AT_macros */
Dwarf_Word macoff;
- if (get_offset_from (cudie, DW_AT_GNU_macros, &macoff) != 0)
+ if (get_offset_from (cudie, DW_AT_GNU_macros, &macoff) != 0
+ && get_offset_from (cudie, DW_AT_macros, &macoff) != 0)
return -1;
offset = gnu_macros_getmacros_off (cudie->cu->dbg, macoff,
callback, arg, offset, accept_0xff,
diff --git a/libdw/dwarf_getpubnames.c b/libdw/dwarf_getpubnames.c
index 462b6ff..25600f3 100644
--- a/libdw/dwarf_getpubnames.c
+++ b/libdw/dwarf_getpubnames.c
@@ -34,10 +34,10 @@
#include <assert.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/param.h>
#include <libdwP.h>
#include <dwarf.h>
+#include <system.h>
static int
diff --git a/libdw/dwarf_getscopes.c b/libdw/dwarf_getscopes.c
index df480d3..5662eec 100644
--- a/libdw/dwarf_getscopes.c
+++ b/libdw/dwarf_getscopes.c
@@ -62,7 +62,9 @@
if (result < 0)
{
int error = INTUSE(dwarf_errno) ();
- if (error != DWARF_E_NOERROR && error != DWARF_E_NO_DEBUG_RANGES)
+ if (error != DWARF_E_NOERROR
+ && error != DWARF_E_NO_DEBUG_RANGES
+ && error != DWARF_E_NO_DEBUG_RNGLISTS)
{
__libdw_seterrno (error);
return -1;
diff --git a/libdw/dwarf_getsrcfiles.c b/libdw/dwarf_getsrcfiles.c
index 5af6f68..12fdabf 100644
--- a/libdw/dwarf_getsrcfiles.c
+++ b/libdw/dwarf_getsrcfiles.c
@@ -1,7 +1,6 @@
/* Return source file information of CU.
- Copyright (C) 2004, 2005, 2013, 2015 Red Hat, Inc.
+ Copyright (C) 2004, 2005, 2013, 2015, 2018 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
@@ -51,14 +50,47 @@
/* Get the information if it is not already known. */
struct Dwarf_CU *const cu = cudie->cu;
- if (cu->lines == NULL)
+ if (cu->files == NULL)
{
- Dwarf_Lines *lines;
- size_t nlines;
+ /* For split units there might be a simple file table (without lines).
+ If not, use the one from the skeleton. */
+ if (cu->unit_type == DW_UT_split_compile
+ || cu->unit_type == DW_UT_split_type)
+ {
+ /* We tried, assume we fail... */
+ cu->files = (void *) -1;
- /* Let the more generic function do the work. It'll create more
- data but that will be needed in an real program anyway. */
- res = INTUSE(dwarf_getsrclines) (cudie, &lines, &nlines);
+ /* See if there is a .debug_line section, for split CUs
+ the table is at offset zero. */
+ if (cu->dbg->sectiondata[IDX_debug_line] != NULL)
+ {
+ /* We are only interested in the files, the lines will
+ always come from the skeleton. */
+ res = __libdw_getsrclines (cu->dbg, 0,
+ __libdw_getcompdir (cudie),
+ cu->address_size, NULL,
+ &cu->files);
+ }
+ else
+ {
+ Dwarf_CU *skel = __libdw_find_split_unit (cu);
+ if (skel != NULL)
+ {
+ Dwarf_Die skeldie = CUDIE (skel);
+ res = INTUSE(dwarf_getsrcfiles) (&skeldie, files, nfiles);
+ cu->files = skel->files;
+ }
+ }
+ }
+ else
+ {
+ Dwarf_Lines *lines;
+ size_t nlines;
+
+ /* Let the more generic function do the work. It'll create more
+ data but that will be needed in an real program anyway. */
+ res = INTUSE(dwarf_getsrclines) (cudie, &lines, &nlines);
+ }
}
else if (cu->files != (void *) -1l)
/* We already have the information. */
diff --git a/libdw/dwarf_getsrclines.c b/libdw/dwarf_getsrclines.c
index dd1b3c1..1432b1d 100644
--- a/libdw/dwarf_getsrclines.c
+++ b/libdw/dwarf_getsrclines.c
@@ -1,7 +1,6 @@
/* Return line number information of CU.
- Copyright (C) 2004-2010, 2013, 2014, 2015 Red Hat, Inc.
+ Copyright (C) 2004-2010, 2013, 2014, 2015, 2016, 2018 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
@@ -154,20 +153,9 @@
{
int res = -1;
+ struct filelist *filelist = NULL;
size_t nfilelist = 0;
- unsigned int ndirlist = 0;
-
- struct filelist null_file =
- {
- .info =
- {
- .name = "???",
- .mtime = 0,
- .length = 0
- },
- .next = NULL
- };
- struct filelist *filelist = &null_file;
+ size_t ndirlist = 0;
/* If there are a large number of lines, files or dirs don't blow up
the stack. Stack allocate some entries, only dynamically malloc
@@ -177,16 +165,7 @@
#define MAX_STACK_FILES (MAX_STACK_ALLOC / 4)
#define MAX_STACK_DIRS (MAX_STACK_ALLOC / 16)
- struct dirlist
- {
- const char *dir;
- size_t len;
- };
- struct dirlist dirstack[MAX_STACK_DIRS];
- struct dirlist *dirarray = dirstack;
-
- /* We are about to process the statement program. Initialize the
- state machine registers (see 6.2.2 in the v2.1 specification). */
+ /* Initial statement program state (except for stmt_list, see below). */
struct line_state state =
{
.linelist = NULL,
@@ -204,6 +183,17 @@
.discriminator = 0
};
+ /* The dirs normally go on the stack, but if there are too many
+ we alloc them all. Set up stack storage early, so we can check on
+ error if we need to free them or not. */
+ struct dirlist
+ {
+ const char *dir;
+ size_t len;
+ };
+ struct dirlist dirstack[MAX_STACK_DIRS];
+ struct dirlist *dirarray = dirstack;
+
if (unlikely (linep + 4 > lineendp))
{
invalid_data:
@@ -222,25 +212,45 @@
}
/* Check whether we have enough room in the section. */
- if (unlikely (unit_length > (size_t) (lineendp - linep)
- || unit_length < 2 + length + 5 * 1))
+ if (unlikely (unit_length > (size_t) (lineendp - linep)))
goto invalid_data;
lineendp = linep + unit_length;
/* The next element of the header is the version identifier. */
+ if ((size_t) (lineendp - linep) < 2)
+ goto invalid_data;
uint_fast16_t version = read_2ubyte_unaligned_inc (dbg, linep);
- if (unlikely (version < 2) || unlikely (version > 4))
+ if (unlikely (version < 2) || unlikely (version > 5))
{
__libdw_seterrno (DWARF_E_VERSION);
goto out;
}
+ /* DWARF5 explicitly lists address and segment_selector sizes. */
+ if (version >= 5)
+ {
+ if ((size_t) (lineendp - linep) < 2)
+ goto invalid_data;
+ size_t line_address_size = *linep++;
+ size_t segment_selector_size = *linep++;
+ if (line_address_size != address_size || segment_selector_size != 0)
+ goto invalid_data;
+ }
+
/* Next comes the header length. */
Dwarf_Word header_length;
if (length == 4)
- header_length = read_4ubyte_unaligned_inc (dbg, linep);
+ {
+ if ((size_t) (lineendp - linep) < 4)
+ goto invalid_data;
+ header_length = read_4ubyte_unaligned_inc (dbg, linep);
+ }
else
- header_length = read_8ubyte_unaligned_inc (dbg, linep);
+ {
+ if ((size_t) (lineendp - linep) < 8)
+ goto invalid_data;
+ header_length = read_8ubyte_unaligned_inc (dbg, linep);
+ }
const unsigned char *header_start = linep;
/* Next the minimum instruction length. */
@@ -250,13 +260,17 @@
uint_fast8_t max_ops_per_instr = 1;
if (version >= 4)
{
- if (unlikely (lineendp - linep < 5))
+ if (unlikely ((size_t) (lineendp - linep) < 1))
goto invalid_data;
max_ops_per_instr = *linep++;
if (unlikely (max_ops_per_instr == 0))
goto invalid_data;
}
+ /* 4 more bytes, is_stmt, line_base, line_range and opcode_base. */
+ if ((size_t) (lineendp - linep) < 4)
+ goto invalid_data;
+
/* Then the flag determining the default value of the is_stmt
register. */
uint_fast8_t default_is_stmt = *linep++;
@@ -277,29 +291,85 @@
goto invalid_data;
linep += opcode_base - 1;
- /* First comes the list of directories. Add the compilation
- directory first since the index zero is used for it. */
- struct dirlist comp_dir_elem =
- {
- .dir = comp_dir,
- .len = comp_dir ? strlen (comp_dir) : 0,
- };
- ndirlist = 1;
+ /* To read DWARF5 dir and file lists we need to know the forms. For
+ now we skip everything, except the DW_LNCT_path and
+ DW_LNCT_directory_index. */
+ uint16_t forms[256];
+ unsigned char nforms = 0;
+ unsigned char form_path = -1; /* Which forms is DW_LNCT_path. */
+ unsigned char form_idx = -1; /* And which is DW_LNCT_directory_index. */
+
+ /* To read/skip form data. */
+ Dwarf_CU fake_cu = {
+ .dbg = dbg,
+ .sec_idx = IDX_debug_line,
+ .version = 5,
+ .offset_size = length,
+ .address_size = address_size,
+ .startp = (void *) linep,
+ .endp = (void *) lineendp,
+ };
/* First count the entries. */
- const unsigned char *dirp = linep;
- while (*dirp != 0)
+ size_t ndirs = 0;
+ if (version < 5)
{
- uint8_t *endp = memchr (dirp, '\0', lineendp - dirp);
- if (endp == NULL)
+ const unsigned char *dirp = linep;
+ while (*dirp != 0)
+ {
+ uint8_t *endp = memchr (dirp, '\0', lineendp - dirp);
+ if (endp == NULL)
+ goto invalid_data;
+ ++ndirs;
+ dirp = endp + 1;
+ }
+ ndirs = ndirs + 1; /* There is always the "unknown" dir. */
+ }
+ else
+ {
+ if ((size_t) (lineendp - linep) < 1)
goto invalid_data;
- ++ndirlist;
- dirp = endp + 1;
+ nforms = *linep++;
+ for (int i = 0; i < nforms; i++)
+ {
+ uint16_t desc, form;
+ if ((size_t) (lineendp - linep) < 1)
+ goto invalid_data;
+ get_uleb128 (desc, linep, lineendp);
+ if ((size_t) (lineendp - linep) < 1)
+ goto invalid_data;
+ get_uleb128 (form, linep, lineendp);
+
+ if (! libdw_valid_user_form (form))
+ goto invalid_data;
+
+ forms[i] = form;
+ if (desc == DW_LNCT_path)
+ form_path = i;
+ }
+
+ if (nforms > 0 && form_path == (unsigned char) -1)
+ goto invalid_data;
+
+ if ((size_t) (lineendp - linep) < 1)
+ goto invalid_data;
+ get_uleb128 (ndirs, linep, lineendp);
+
+ if (nforms == 0 && ndirs != 0)
+ goto invalid_data;
+
+ /* Assume there is at least 1 byte needed per form to describe
+ the directory. Filters out insanely large ndirs. */
+ if (nforms != 0 && ndirs > (size_t) (lineendp - linep) / nforms)
+ goto invalid_data;
}
/* Arrange the list in array form. */
+ ndirlist = ndirs;
if (ndirlist >= MAX_STACK_DIRS)
{
+ if (ndirlist > SIZE_MAX / sizeof (*dirarray))
+ goto no_mem;
dirarray = (struct dirlist *) malloc (ndirlist * sizeof (*dirarray));
if (unlikely (dirarray == NULL))
{
@@ -308,20 +378,82 @@
goto out;
}
}
- dirarray[0] = comp_dir_elem;
- for (unsigned int n = 1; n < ndirlist; n++)
+
+ /* Entry zero is implicit for older versions, but explicit for 5+. */
+ struct dirlist comp_dir_elem;
+ if (version < 5)
{
- dirarray[n].dir = (char *) linep;
- uint8_t *endp = memchr (linep, '\0', lineendp - linep);
- assert (endp != NULL);
- dirarray[n].len = endp - linep;
- linep = endp + 1;
+ /* First comes the list of directories. Add the compilation
+ directory first since the index zero is used for it. */
+ comp_dir_elem.dir = comp_dir;
+ comp_dir_elem.len = comp_dir ? strlen (comp_dir) : 0,
+ dirarray[0] = comp_dir_elem;
+ for (unsigned int n = 1; n < ndirlist; n++)
+ {
+ dirarray[n].dir = (char *) linep;
+ uint8_t *endp = memchr (linep, '\0', lineendp - linep);
+ assert (endp != NULL);
+ dirarray[n].len = endp - linep;
+ linep = endp + 1;
+ }
+ /* Skip the final NUL byte. */
+ ++linep;
}
- /* Skip the final NUL byte. */
- ++linep;
+ else
+ {
+ Dwarf_Attribute attr;
+ attr.code = DW_AT_name;
+ attr.cu = &fake_cu;
+ for (unsigned int n = 0; n < ndirlist; n++)
+ {
+ const char *dir = NULL;
+ for (unsigned char m = 0; m < nforms; m++)
+ {
+ if (m == form_path)
+ {
+ attr.form = forms[m];
+ attr.valp = (void *) linep;
+ dir = dwarf_formstring (&attr);
+ }
+
+ size_t len = __libdw_form_val_len (&fake_cu, forms[m], linep);
+ if ((size_t) (lineendp - linep) < len)
+ goto invalid_data;
+
+ linep += len;
+ }
+
+ if (dir == NULL)
+ goto invalid_data;
+
+ dirarray[n].dir = dir;
+ dirarray[n].len = strlen (dir);
+ }
+ }
+
+ /* File index zero doesn't exist for DWARF < 5. Files are indexed
+ starting from 1. But for DWARF5 they are indexed starting from
+ zero, but the default index is still 1. In both cases the
+ "first" file is special and refers to the main compile unit file,
+ equal to the DW_AT_name of the DW_TAG_compile_unit. */
+ struct filelist null_file =
+ {
+ .info =
+ {
+ .name = "???",
+ .mtime = 0,
+ .length = 0
+ },
+ .next = NULL
+ };
+ filelist = &null_file;
+ nfilelist = 1;
/* Allocate memory for a new file. For the first MAX_STACK_FILES
- entries just return a slot in the preallocated stack array. */
+ entries just return a slot in the preallocated stack array.
+ This is slightly complicated because in DWARF < 5 new files could
+ be defined with DW_LNE_define_file after the normal file list was
+ read. */
struct filelist flstack[MAX_STACK_FILES];
#define NEW_FILE() ({ \
struct filelist *fl = (nfilelist < MAX_STACK_FILES \
@@ -335,69 +467,181 @@
fl; })
/* Now read the files. */
- nfilelist = 1;
-
- if (unlikely (linep >= lineendp))
- goto invalid_data;
- while (*linep != 0)
+ if (version < 5)
{
- struct filelist *new_file = NEW_FILE ();
-
- /* First comes the file name. */
- char *fname = (char *) linep;
- uint8_t *endp = memchr (fname, '\0', lineendp - linep);
- if (endp == NULL)
- goto invalid_data;
- size_t fnamelen = endp - (uint8_t *) fname;
- linep = endp + 1;
-
- /* Then the index. */
- Dwarf_Word diridx;
if (unlikely (linep >= lineendp))
goto invalid_data;
- get_uleb128 (diridx, linep, lineendp);
- if (unlikely (diridx >= ndirlist))
+ while (*linep != 0)
{
- __libdw_seterrno (DWARF_E_INVALID_DIR_IDX);
- goto out;
- }
+ struct filelist *new_file = NEW_FILE ();
- if (*fname == '/')
- /* It's an absolute path. */
- new_file->info.name = fname;
- else
- {
- new_file->info.name = libdw_alloc (dbg, char, 1,
- dirarray[diridx].len + 1
- + fnamelen + 1);
- char *cp = new_file->info.name;
+ /* First comes the file name. */
+ char *fname = (char *) linep;
+ uint8_t *endp = memchr (fname, '\0', lineendp - linep);
+ if (endp == NULL)
+ goto invalid_data;
+ size_t fnamelen = endp - (uint8_t *) fname;
+ linep = endp + 1;
- if (dirarray[diridx].dir != NULL)
+ /* Then the index. */
+ Dwarf_Word diridx;
+ if (unlikely (linep >= lineendp))
+ goto invalid_data;
+ get_uleb128 (diridx, linep, lineendp);
+ if (unlikely (diridx >= ndirlist))
{
- /* This value could be NULL in case the DW_AT_comp_dir
- was not present. We cannot do much in this case.
- The easiest thing is to convert the path in an
- absolute path. */
- cp = stpcpy (cp, dirarray[diridx].dir);
+ __libdw_seterrno (DWARF_E_INVALID_DIR_IDX);
+ goto out;
}
- *cp++ = '/';
- strcpy (cp, fname);
- assert (strlen (new_file->info.name)
- < dirarray[diridx].len + 1 + fnamelen + 1);
+
+ if (*fname == '/')
+ /* It's an absolute path. */
+ new_file->info.name = fname;
+ else
+ {
+ new_file->info.name = libdw_alloc (dbg, char, 1,
+ dirarray[diridx].len + 1
+ + fnamelen + 1);
+ char *cp = new_file->info.name;
+
+ if (dirarray[diridx].dir != NULL)
+ {
+ /* This value could be NULL in case the DW_AT_comp_dir
+ was not present. We cannot do much in this case.
+ Just keep the file relative. */
+ cp = stpcpy (cp, dirarray[diridx].dir);
+ *cp++ = '/';
+ }
+ strcpy (cp, fname);
+ assert (strlen (new_file->info.name)
+ < dirarray[diridx].len + 1 + fnamelen + 1);
+ }
+
+ /* Next comes the modification time. */
+ if (unlikely (linep >= lineendp))
+ goto invalid_data;
+ get_uleb128 (new_file->info.mtime, linep, lineendp);
+
+ /* Finally the length of the file. */
+ if (unlikely (linep >= lineendp))
+ goto invalid_data;
+ get_uleb128 (new_file->info.length, linep, lineendp);
+ }
+ /* Skip the final NUL byte. */
+ ++linep;
+ }
+ else
+ {
+ if ((size_t) (lineendp - linep) < 1)
+ goto invalid_data;
+ nforms = *linep++;
+ form_path = form_idx = -1;
+ for (int i = 0; i < nforms; i++)
+ {
+ uint16_t desc, form;
+ if ((size_t) (lineendp - linep) < 1)
+ goto invalid_data;
+ get_uleb128 (desc, linep, lineendp);
+ if ((size_t) (lineendp - linep) < 1)
+ goto invalid_data;
+ get_uleb128 (form, linep, lineendp);
+
+ if (! libdw_valid_user_form (form))
+ goto invalid_data;
+
+ forms[i] = form;
+ if (desc == DW_LNCT_path)
+ form_path = i;
+ else if (desc == DW_LNCT_directory_index)
+ form_idx = i;
}
- /* Next comes the modification time. */
- if (unlikely (linep >= lineendp))
+ if (nforms > 0 && (form_path == (unsigned char) -1
+ || form_idx == (unsigned char) -1))
goto invalid_data;
- get_uleb128 (new_file->info.mtime, linep, lineendp);
- /* Finally the length of the file. */
- if (unlikely (linep >= lineendp))
+ size_t nfiles;
+ get_uleb128 (nfiles, linep, lineendp);
+
+ if (nforms == 0 && nfiles != 0)
goto invalid_data;
- get_uleb128 (new_file->info.length, linep, lineendp);
+
+ /* Assume there is at least 1 byte needed per form to describe
+ the file. Filters out insanely large nfiles. */
+ if (nforms != 0 && nfiles > (size_t) (lineendp - linep) / nforms)
+ goto invalid_data;
+
+ Dwarf_Attribute attr;
+ attr.cu = &fake_cu;
+ for (unsigned int n = 0; n < nfiles; n++)
+ {
+ const char *fname = NULL;
+ Dwarf_Word diridx = (Dwarf_Word) -1;
+ for (unsigned char m = 0; m < nforms; m++)
+ {
+ if (m == form_path)
+ {
+ attr.code = DW_AT_name;
+ attr.form = forms[m];
+ attr.valp = (void *) linep;
+ fname = dwarf_formstring (&attr);
+ }
+ else if (m == form_idx)
+ {
+ attr.code = DW_AT_decl_file; /* Close enough. */
+ attr.form = forms[m];
+ attr.valp = (void *) linep;
+ if (dwarf_formudata (&attr, &diridx) != 0)
+ diridx = (Dwarf_Word) -1;
+ }
+
+ size_t len = __libdw_form_val_len (&fake_cu, forms[m], linep);
+ if ((size_t) (lineendp - linep) < len)
+ goto invalid_data;
+
+ linep += len;
+ }
+
+ if (fname == NULL || diridx == (Dwarf_Word) -1)
+ goto invalid_data;
+
+ size_t fnamelen = strlen (fname);
+
+ if (unlikely (diridx >= ndirlist))
+ {
+ __libdw_seterrno (DWARF_E_INVALID_DIR_IDX);
+ goto out;
+ }
+
+ /* Yes, weird. Looks like an off-by-one in the spec. */
+ struct filelist *new_file = n == 0 ? &null_file : NEW_FILE ();
+
+ /* We follow the same rules as above for DWARF < 5, even
+ though the standard doesn't explicitly mention absolute
+ paths and ignoring the dir index. */
+ if (*fname == '/')
+ /* It's an absolute path. */
+ new_file->info.name = (char *) fname;
+ else
+ {
+ new_file->info.name = libdw_alloc (dbg, char, 1,
+ dirarray[diridx].len + 1
+ + fnamelen + 1);
+ char *cp = new_file->info.name;
+
+ /* In the DWARF >= 5 case, dir can never be NULL. */
+ cp = stpcpy (cp, dirarray[diridx].dir);
+ *cp++ = '/';
+ strcpy (cp, fname);
+ assert (strlen (new_file->info.name)
+ < dirarray[diridx].len + 1 + fnamelen + 1);
+ }
+
+ /* For now we just ignore the modification time and file length. */
+ new_file->info.mtime = 0;
+ new_file->info.length = 0;
+ }
}
- /* Skip the final NUL byte. */
- ++linep;
/* Consistency check. */
if (unlikely (linep != header_start + header_length))
@@ -406,6 +650,9 @@
goto out;
}
+ /* We are about to process the statement program. Most state machine
+ registers have already been initialize above. Just add the is_stmt
+ default. See 6.2.2 in the v2.1 specification. */
state.is_stmt = default_is_stmt;
/* Apply the "operation advance" from a special opcode or
@@ -555,11 +802,12 @@
if (dirarray[diridx].dir != NULL)
/* This value could be NULL in case the
DW_AT_comp_dir was not present. We
- cannot do much in this case. The easiest
- thing is to convert the path in an
- absolute path. */
- cp = stpcpy (cp, dirarray[diridx].dir);
- *cp++ = '/';
+ cannot do much in this case. Just
+ keep the file relative. */
+ {
+ cp = stpcpy (cp, dirarray[diridx].dir);
+ *cp++ = '/';
+ }
strcpy (cp, fname);
}
@@ -818,7 +1066,7 @@
free (state.linelist);
state.linelist = ll;
}
- if (ndirlist >= MAX_STACK_DIRS)
+ if (dirarray != dirstack)
free (dirarray);
for (size_t i = MAX_STACK_FILES; i < nfilelist; i++)
{
@@ -916,6 +1164,31 @@
struct Dwarf_CU *const cu = cudie->cu;
if (cu->lines == NULL)
{
+ /* For split units always pick the lines from the skeleton. */
+ if (cu->unit_type == DW_UT_split_compile
+ || cu->unit_type == DW_UT_split_type)
+ {
+ /* We tries, assume we fail... */
+ cu->lines = (void *) -1l;
+
+ Dwarf_CU *skel = __libdw_find_split_unit (cu);
+ if (skel != NULL)
+ {
+ Dwarf_Die skeldie = CUDIE (skel);
+ int res = INTUSE(dwarf_getsrclines) (&skeldie, lines, nlines);
+ if (res == 0)
+ {
+ cu->lines = skel->lines;
+ *lines = cu->lines;
+ *nlines = cu->lines->nlines;
+ }
+ return res;
+ }
+
+ __libdw_seterrno (DWARF_E_NO_DEBUG_LINE);
+ return -1;
+ }
+
/* Failsafe mode: no data found. */
cu->lines = (void *) -1l;
cu->files = (void *) -1l;
diff --git a/libdw/dwarf_hasattr.c b/libdw/dwarf_hasattr.c
index 2bb8dc8..90053b1 100644
--- a/libdw/dwarf_hasattr.c
+++ b/libdw/dwarf_hasattr.c
@@ -1,5 +1,5 @@
/* Check whether given DIE has specific attribute.
- Copyright (C) 2003, 2005, 2014 Red Hat, Inc.
+ Copyright (C) 2003, 2005, 2014, 2017 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -45,32 +45,20 @@
Dwarf_Abbrev *abbrevp = __libdw_dieabbrev (die, NULL);
if (unlikely (abbrevp == DWARF_END_ABBREV))
{
- invalid_dwarf:
__libdw_seterrno (DWARF_E_INVALID_DWARF);
return 0;
}
- Dwarf *dbg = die->cu->dbg;
-
- /* Search the name attribute. */
- unsigned char *const endp
- = ((unsigned char *) dbg->sectiondata[IDX_debug_abbrev]->d_buf
- + dbg->sectiondata[IDX_debug_abbrev]->d_size);
-
+ /* Search the name attribute. Dwarf_Abbrev was checked when created,
+ so we can read unchecked here. */
const unsigned char *attrp = abbrevp->attrp;
while (1)
{
- /* Are we still in bounds? This test needs to be refined. */
- if (unlikely (attrp >= endp))
- goto invalid_dwarf;
-
/* Get attribute name and form. */
unsigned int attr_name;
- get_uleb128 (attr_name, attrp, endp);
+ get_uleb128_unchecked (attr_name, attrp);
unsigned int attr_form;
- if (unlikely (attrp >= endp))
- goto invalid_dwarf;
- get_uleb128 (attr_form, attrp, endp);
+ get_uleb128_unchecked (attr_form, attrp);
/* We can stop if we found the attribute with value zero. */
if (attr_name == 0 || attr_form == 0)
@@ -78,6 +66,12 @@
if (attr_name == search_name)
return 1;
+
+ if (attr_form == DW_FORM_implicit_const)
+ {
+ int64_t attr_value __attribute__ ((unused));
+ get_sleb128_unchecked (attr_value, attrp);
+ }
}
}
INTDEF (dwarf_hasattr)
diff --git a/libdw/dwarf_hasattr_integrate.c b/libdw/dwarf_hasattr_integrate.c
index 2d5348c..1d94628 100644
--- a/libdw/dwarf_hasattr_integrate.c
+++ b/libdw/dwarf_hasattr_integrate.c
@@ -1,5 +1,5 @@
/* Check whether DIE has specific attribute, integrating DW_AT_abstract_origin.
- Copyright (C) 2005 Red Hat, Inc.
+ Copyright (C) 2005, 2018 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -37,7 +37,7 @@
dwarf_hasattr_integrate (Dwarf_Die *die, unsigned int search_name)
{
Dwarf_Die die_mem;
-
+ int chain = 16; /* Largest DIE ref chain we will follow. */
do
{
if (INTUSE(dwarf_hasattr) (die, search_name))
@@ -53,7 +53,21 @@
die = INTUSE(dwarf_formref_die) (attr, &die_mem);
}
- while (die != NULL);
+ while (die != NULL && chain-- != 0);
+
+ /* Not NULL if it didn't have abstract_origin and specification
+ attributes. If it is a split CU then see if the skeleton
+ has it. */
+ if (die != NULL && is_cudie (die)
+ && die->cu->unit_type == DW_UT_split_compile)
+ {
+ Dwarf_CU *skel_cu = __libdw_find_split_unit (die->cu);
+ if (skel_cu != NULL)
+ {
+ Dwarf_Die skel_die = CUDIE (skel_cu);
+ return INTUSE(dwarf_hasattr) (&skel_die, search_name);
+ }
+ }
return 0;
}
diff --git a/libdw/dwarf_highpc.c b/libdw/dwarf_highpc.c
index 2070254..5b2f0fd 100644
--- a/libdw/dwarf_highpc.c
+++ b/libdw/dwarf_highpc.c
@@ -1,7 +1,6 @@
/* Return high PC attribute of DIE.
- Copyright (C) 2003, 2005, 2012 Red Hat, Inc.
+ Copyright (C) 2003, 2005, 2012, 2018 Red Hat, Inc.
This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2003.
This file is free software; you can redistribute it and/or modify
it under the terms of either
@@ -39,19 +38,22 @@
dwarf_highpc (Dwarf_Die *die, Dwarf_Addr *return_addr)
{
Dwarf_Attribute attr_high_mem;
- Dwarf_Attribute *attr_high = INTUSE(dwarf_attr) (die, DW_AT_high_pc,
- &attr_high_mem);
- if (attr_high == NULL)
- return -1;
+ Dwarf_Attribute *attr_high;
+ /* Split compile DIEs inherit high_pc from their skeleton DIE. */
+ if (is_cudie (die) && die->cu->unit_type == DW_UT_split_compile)
+ attr_high = INTUSE(dwarf_attr_integrate) (die, DW_AT_high_pc,
+ &attr_high_mem);
+ else
+ attr_high = INTUSE(dwarf_attr) (die, DW_AT_high_pc, &attr_high_mem);
- if (attr_high->form == DW_FORM_addr)
- return INTUSE(dwarf_formaddr) (attr_high, return_addr);
+ if (attr_high == NULL)
+ goto no_addr;
+
+ if (INTUSE(dwarf_formaddr) (attr_high, return_addr) == 0)
+ return 0;
/* DWARF 4 allows high_pc to be a constant offset from low_pc. */
- Dwarf_Attribute attr_low_mem;
- if (INTUSE(dwarf_formaddr) (INTUSE(dwarf_attr) (die, DW_AT_low_pc,
- &attr_low_mem),
- return_addr) == 0)
+ if (INTUSE(dwarf_lowpc) (die, return_addr) == 0)
{
Dwarf_Word uval;
if (INTUSE(dwarf_formudata) (attr_high, &uval) == 0)
@@ -59,8 +61,10 @@
*return_addr += uval;
return 0;
}
- __libdw_seterrno (DWARF_E_NO_ADDR);
}
+
+no_addr:
+ __libdw_seterrno (DWARF_E_NO_ADDR);
return -1;
}
INTDEF(dwarf_highpc)
diff --git a/libebl/eblshflagscombine.c b/libdw/dwarf_line_file.c
similarity index 72%
copy from libebl/eblshflagscombine.c
copy to libdw/dwarf_line_file.c
index 4deaaaa..e2df642 100644
--- a/libebl/eblshflagscombine.c
+++ b/libdw/dwarf_line_file.c
@@ -1,7 +1,6 @@
-/* Return combines section header flags value.
- Copyright (C) 2001, 2002 Red Hat, Inc.
+/* Find line information for address.
+ Copyright (C) 2017 Red Hat, Inc.
This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
This file is free software; you can redistribute it and/or modify
it under the terms of either
@@ -31,11 +30,23 @@
# include <config.h>
#endif
-#include <libeblP.h>
+#include "libdwP.h"
-GElf_Word
-ebl_sh_flags_combine (Ebl *ebl, GElf_Word flags1, GElf_Word flags2)
+int
+dwarf_line_file (Dwarf_Line *line, Dwarf_Files **files, size_t *idx)
{
- return ebl->sh_flags_combine (flags1, flags2);
+ if (line == NULL)
+ return -1;
+
+ if (line->file >= line->files->nfiles)
+ {
+ __libdw_seterrno (DWARF_E_INVALID_DWARF);
+ return -1;
+ }
+
+ *files = line->files;
+ *idx = line->file;
+
+ return 0;
}
diff --git a/libdw/dwarf_lowpc.c b/libdw/dwarf_lowpc.c
index b3be2b0..4d743a7 100644
--- a/libdw/dwarf_lowpc.c
+++ b/libdw/dwarf_lowpc.c
@@ -1,7 +1,6 @@
/* Return low PC attribute of DIE.
- Copyright (C) 2003, 2005 Red Hat, Inc.
+ Copyright (C) 2003, 2005, 2018 Red Hat, Inc.
This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2003.
This file is free software; you can redistribute it and/or modify
it under the terms of either
@@ -38,10 +37,12 @@
int
dwarf_lowpc (Dwarf_Die *die, Dwarf_Addr *return_addr)
{
- Dwarf_Attribute attr_mem;
-
- return INTUSE(dwarf_formaddr) (INTUSE(dwarf_attr) (die, DW_AT_low_pc,
- &attr_mem),
- return_addr);
+ Dwarf_Attribute attr_mem, *attr;
+ /* Split compile DIEs inherit low_pc from their skeleton DIE. */
+ if (is_cudie (die) && die->cu->unit_type == DW_UT_split_compile)
+ attr = INTUSE(dwarf_attr_integrate) (die, DW_AT_low_pc, &attr_mem);
+ else
+ attr = INTUSE(dwarf_attr) (die, DW_AT_low_pc, &attr_mem);
+ return INTUSE(dwarf_formaddr) (attr, return_addr);
}
INTDEF(dwarf_lowpc)
diff --git a/libdw/dwarf_next_cfi.c b/libdw/dwarf_next_cfi.c
index 53fc369..fa28d99 100644
--- a/libdw/dwarf_next_cfi.c
+++ b/libdw/dwarf_next_cfi.c
@@ -54,6 +54,7 @@
we don't know yet whether this is a 64-bit object or not. */
|| unlikely (off + 4 >= data->d_size))
{
+ done:
*next_off = (Dwarf_Off) -1l;
return 1;
}
@@ -79,6 +80,13 @@
}
length = read_8ubyte_unaligned_inc (&dw, bytes);
}
+
+ /* Not explicitly in the DWARF spec, but mentioned in the LSB exception
+ frames (.eh_frame) spec. If Length contains the value 0, then this
+ CIE shall be considered a terminator and processing shall end. */
+ if (length == 0)
+ goto done;
+
if (unlikely ((uint64_t) (limit - bytes) < length)
|| unlikely (length < offset_size + 1))
goto invalid;
diff --git a/libdw/dwarf_next_lines.c b/libdw/dwarf_next_lines.c
new file mode 100644
index 0000000..9b76b47
--- /dev/null
+++ b/libdw/dwarf_next_lines.c
@@ -0,0 +1,197 @@
+/* Iterate through the debug line table.
+ Copyright (C) 2018 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 <libdwP.h>
+
+
+int
+dwarf_next_lines (Dwarf *dbg, Dwarf_Off off,
+ Dwarf_Off *next_off, Dwarf_CU **cu,
+ Dwarf_Files **srcfiles, size_t *nfiles,
+ Dwarf_Lines **srclines, size_t *nlines)
+{
+ /* Ignore existing errors. */
+ if (dbg == NULL)
+ return -1;
+
+ Elf_Data *lines = dbg->sectiondata[IDX_debug_line];
+ if (lines == NULL)
+ {
+ __libdw_seterrno (DWARF_E_NO_DEBUG_LINE);
+ return -1;
+ }
+
+ if (off == (Dwarf_Off) -1
+ || lines->d_size < 4
+ || off >= lines->d_size)
+ {
+ *next_off = (Dwarf_Off) -1;
+ return 1;
+ }
+
+ /* Read enough of the header to know where the next table is and
+ whether we need to lookup the CU (version < 5). */
+ const unsigned char *linep = lines->d_buf + off;
+ const unsigned char *lineendp = lines->d_buf + lines->d_size;
+
+ if ((size_t) (lineendp - linep) < 4)
+ {
+ invalid_data:
+ __libdw_seterrno (DWARF_E_INVALID_DEBUG_LINE);
+ return -1;
+ }
+
+ *next_off = off + 4;
+ Dwarf_Word unit_length = read_4ubyte_unaligned_inc (dbg, linep);
+ if (unit_length == DWARF3_LENGTH_64_BIT)
+ {
+ if ((size_t) (lineendp - linep) < 8)
+ goto invalid_data;
+ unit_length = read_8ubyte_unaligned_inc (dbg, linep);
+ *next_off += 8;
+ }
+
+ if (unit_length > (size_t) (lineendp - linep))
+ goto invalid_data;
+
+ *next_off += unit_length;
+ lineendp = linep + unit_length;
+
+ if ((size_t) (lineendp - linep) < 2)
+ goto invalid_data;
+ uint_fast16_t version = read_2ubyte_unaligned_inc (dbg, linep);
+
+ Dwarf_Die cudie;
+ if (version < 5)
+ {
+ /* We need to find the matching CU to get the comp_dir. Use the
+ given CU as hint where to start searching. Normally it will
+ be the next CU that has a statement list. */
+ Dwarf_CU *given_cu = *cu;
+ Dwarf_CU *next_cu = given_cu;
+ bool found = false;
+ while (dwarf_get_units (dbg, next_cu, &next_cu, NULL, NULL,
+ &cudie, NULL) == 0)
+ {
+ if (dwarf_hasattr (&cudie, DW_AT_stmt_list))
+ {
+ Dwarf_Attribute attr;
+ Dwarf_Word stmt_off;
+ if (dwarf_formudata (dwarf_attr (&cudie, DW_AT_stmt_list, &attr),
+ &stmt_off) == 0
+ && stmt_off == off)
+ {
+ found = true;
+ break;
+ }
+ }
+ else if (off == 0
+ && (next_cu->unit_type == DW_UT_split_compile
+ || next_cu->unit_type == DW_UT_split_type))
+ {
+ /* For split units (in .dwo files) there is only one table
+ at offset zero (containing just the files, no lines). */
+ found = true;
+ break;
+ }
+ }
+
+ if (!found && given_cu != NULL)
+ {
+ /* The CUs might be in a different order from the line
+ tables. Need to do a linear search (but stop at the given
+ CU, since we already searched those. */
+ next_cu = NULL;
+ while (dwarf_get_units (dbg, next_cu, &next_cu, NULL, NULL,
+ &cudie, NULL) == 0
+ && next_cu != given_cu)
+ {
+ Dwarf_Attribute attr;
+ Dwarf_Word stmt_off;
+ if (dwarf_formudata (dwarf_attr (&cudie, DW_AT_stmt_list, &attr),
+ &stmt_off) == 0
+ && stmt_off == off)
+ {
+ found = true;
+ break;
+ }
+ }
+ }
+
+ if (found)
+ *cu = next_cu;
+ else
+ *cu = NULL;
+ }
+ else
+ *cu = NULL;
+
+ const char *comp_dir;
+ unsigned address_size;
+ if (*cu != NULL)
+ {
+ comp_dir = __libdw_getcompdir (&cudie);
+ address_size = (*cu)->address_size;
+ }
+ else
+ {
+ comp_dir = NULL;
+
+ size_t esize;
+ char *ident = elf_getident (dbg->elf, &esize);
+ if (ident == NULL || esize < EI_NIDENT)
+ goto invalid_data;
+ address_size = ident[EI_CLASS] == ELFCLASS32 ? 4 : 8;
+ }
+
+ if (__libdw_getsrclines (dbg, off, comp_dir, address_size,
+ srclines, srcfiles) != 0)
+ return -1;
+
+ if (nlines != NULL)
+ {
+ if (srclines != NULL && *srclines != NULL)
+ *nlines = (*srclines)->nlines;
+ else
+ *nlines = 0;
+ }
+
+ if (nfiles != NULL)
+ {
+ if (srcfiles != NULL && *srcfiles != NULL)
+ *nfiles = (*srcfiles)->nfiles;
+ else
+ *nfiles = 0;
+ }
+
+ return 0;
+}
diff --git a/libdw/dwarf_nextcu.c b/libdw/dwarf_nextcu.c
index fa9b0af..be11327 100644
--- a/libdw/dwarf_nextcu.c
+++ b/libdw/dwarf_nextcu.c
@@ -1,5 +1,5 @@
/* Advance to next CU header.
- Copyright (C) 2002-2010 Red Hat, Inc.
+ Copyright (C) 2002-2010, 2016, 2017 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -39,11 +39,31 @@
dwarf_next_unit (Dwarf *dwarf, Dwarf_Off off, Dwarf_Off *next_off,
size_t *header_sizep, Dwarf_Half *versionp,
Dwarf_Off *abbrev_offsetp, uint8_t *address_sizep,
- uint8_t *offset_sizep, uint64_t *type_signaturep,
- Dwarf_Off *type_offsetp)
+ uint8_t *offset_sizep, uint64_t *v4_type_signaturep,
+ Dwarf_Off *v4_type_offsetp)
{
- const bool debug_types = type_signaturep != NULL;
- const size_t sec_idx = debug_types ? IDX_debug_types : IDX_debug_info;
+ const bool v4_debug_types = v4_type_signaturep != NULL;
+ return __libdw_next_unit (dwarf, v4_debug_types, off, next_off,
+ header_sizep, versionp, NULL,
+ abbrev_offsetp, address_sizep, offset_sizep,
+ v4_type_signaturep, v4_type_offsetp);
+}
+INTDEF(dwarf_next_unit)
+
+int
+internal_function
+__libdw_next_unit (Dwarf *dwarf, bool v4_debug_types, Dwarf_Off off,
+ Dwarf_Off *next_off, size_t *header_sizep,
+ Dwarf_Half *versionp, uint8_t *unit_typep,
+ Dwarf_Off *abbrev_offsetp, uint8_t *address_sizep,
+ uint8_t *offset_sizep, uint64_t *unit_id8p,
+ Dwarf_Off *subdie_offsetp)
+{
+ /* Note that debug_type units come from .debug_types in DWARF < 5 and
+ from .debug_info in DWARF >= 5. If the user requested the
+ v4_type_signature we return from .debug_types always. If no signature
+ is requested we return units (any type) from .debug_info. */
+ const size_t sec_idx = v4_debug_types ? IDX_debug_types : IDX_debug_info;
/* Maybe there has been an error before. */
if (dwarf == NULL)
@@ -61,12 +81,14 @@
return 1;
}
- /* This points into the .debug_info section to the beginning of the
- CU entry. */
+ /* This points into the .debug_info or .debug_types section to the
+ beginning of the CU entry. */
const unsigned char *data = dwarf->sectiondata[sec_idx]->d_buf;
const unsigned char *bytes = data + off;
- /* The format of the CU header is described in dwarf2p1 7.5.1:
+ /* The format of the CU header is described in dwarf2p1 7.5.1 and
+ changed in DWARFv5 (to include unit type, switch location of some
+ fields and add some optional fields).
1. A 4-byte or 12-byte unsigned integer representing the length
of the .debug_info contribution for that compilation unit, not
@@ -74,23 +96,58 @@
this is a 4-byte unsigned integer (which must be less than
0xfffffff0); in the 64-bit DWARF format, this consists of the
4-byte value 0xffffffff followed by an 8-byte unsigned integer
- that gives the actual length (see Section 7.2.2).
+ that gives the actual length (see Section 7.2.2). This field
+ indicates whether this unit is 32-bit of 64-bit DWARF, which
+ affects all other offset fields in this header.
2. A 2-byte unsigned integer representing the version of the
DWARF information for that compilation unit. For DWARF Version
- 2.1, the value in this field is 2.
+ 2.1, the value in this field is 2 (3 for v3, 4 for v4, 5 for v5).
+ This fields determines the order of the next fields and whether
+ there are any optional fields in this header.
- 3. A 4-byte or 8-byte unsigned offset into the .debug_abbrev
+ 3. For DWARF 2, 3 and 4 (including v4 type units):
+ A 4-byte or 8-byte unsigned offset into the .debug_abbrev
section. This offset associates the compilation unit with a
particular set of debugging information entry abbreviations. In
the 32-bit DWARF format, this is a 4-byte unsigned length; in
the 64-bit DWARF format, this is an 8-byte unsigned length (see
Section 7.4).
- 4. A 1-byte unsigned integer representing the size in bytes of
+ For DWARF 5:
+ A 1-byte unsigned integer representing the unit (header) type.
+ This field determines what the optional fields in the header
+ represent. If this is an unknown unit type then we cannot
+ assume anything about the rest of the unit (header).
+
+ 4. For all DWARF versions (including v4 type units):
+ A 1-byte unsigned integer representing the size in bytes of
an address on the target architecture. If the system uses
segmented addressing, this value represents the size of the
- offset portion of an address. */
+ offset portion of an address. This is the last field in the header
+ for DWARF versions 2, 3 and 4 (except for v4 type units).
+
+ 5. For DWARF 5 only (this is field 3 for DWARF 2, 3, 4 and v4 types):
+ A 4-byte or 8-byte unsigned offset into the .debug_abbrev
+ section. This offset associates the compilation unit with a
+ particular set of debugging information entry abbreviations. In
+ the 32-bit DWARF format, this is a 4-byte unsigned length; in
+ the 64-bit DWARF format, this is an 8-byte unsigned length.
+
+ 6. For v4 type units (this is really field 5 for v4 types) and
+ DWARF 5 optional (skeleton, split_compile, type and
+ split_type): An 8 byte (opaque) integer constant value. For
+ v4 and v5 type units this is the type signature. For skeleton
+ and split compile units this is the compilation ID.
+
+ 7. For v4 type units (this is really field 6 for v4 types) and
+ DWARF 5 optional (type and split_type) and v4 type units:
+ A 4-byte or 8-byte unsigned offset. In the 32-bit DWARF format,
+ this is a 4-byte unsigned length; in the 64-bit DWARF format,
+ this is an 8-byte unsigned length. This is the type DIE offset
+ (which is not necessarily the first DIE in the unit).
+ */
+
uint64_t length = read_4ubyte_unaligned_inc (dwarf, bytes);
size_t offset_size = 4;
/* Lengths of 0xfffffff0 - 0xffffffff are escape codes. Oxffffffff is
@@ -106,14 +163,6 @@
return -1;
}
- /* Now we know how large the header is. */
- if (unlikely (DIE_OFFSET_FROM_CU_OFFSET (off, offset_size, debug_types)
- >= dwarf->sectiondata[sec_idx]->d_size))
- {
- *next_off = -1;
- return 1;
- }
-
if (length == DWARF3_LENGTH_64_BIT)
/* This is a 64-bit DWARF format. */
length = read_8ubyte_unaligned_inc (dwarf, bytes);
@@ -121,41 +170,99 @@
/* Read the version stamp. Always a 16-bit value. */
uint_fast16_t version = read_2ubyte_unaligned_inc (dwarf, bytes);
+ /* We keep unit_type at zero for older DWARF since we cannot
+ easily guess whether it is a compile or partial unit. */
+ uint8_t unit_type = 0;
+ if (version >= 5)
+ unit_type = *bytes++;
+
+ /* All these are optional. */
+ Dwarf_Off subdie_off = 0;
+ uint64_t sig_id = 0;
+ Dwarf_Off abbrev_offset = 0;
+ uint8_t address_size = 0;
+
+ if (version < 2 || version > 5
+ || (version == 5 && ! (unit_type == DW_UT_compile
+ || unit_type == DW_UT_partial
+ || unit_type == DW_UT_skeleton
+ || unit_type == DW_UT_split_compile
+ || unit_type == DW_UT_type
+ || unit_type == DW_UT_split_type)))
+ {
+ /* We cannot really know more about the header. Just report
+ the length of the unit, version and unit type. */
+ goto done;
+ }
+
+ /* We have to guess the unit_type. But we don't have a real CUDIE. */
+ if (version < 5)
+ unit_type = v4_debug_types ? DW_UT_type : DW_UT_compile;
+
+ /* Now we know how large the header is (should be). */
+ if (unlikely (__libdw_first_die_from_cu_start (off, offset_size, version,
+ unit_type)
+ >= dwarf->sectiondata[sec_idx]->d_size))
+ {
+ *next_off = -1;
+ return 1;
+ }
+
+ /* The address size. Always an 8-bit value.
+ Comes after abbrev_offset for version < 5, otherwise unit type
+ and address size (if a known unit type) comes before abbrev_offset. */
+ if (version >= 5)
+ address_size = *bytes++;
+
/* Get offset in .debug_abbrev. Note that the size of the entry
depends on whether this is a 32-bit or 64-bit DWARF definition. */
- uint64_t abbrev_offset;
if (__libdw_read_offset_inc (dwarf, sec_idx, &bytes, offset_size,
&abbrev_offset, IDX_debug_abbrev, 0))
return -1;
- /* The address size. Always an 8-bit value. */
- uint8_t address_size = *bytes++;
+ if (version < 5)
+ address_size = *bytes++;
- if (debug_types)
+ /* Extra fields, signature/id and type offset/padding. */
+ if (v4_debug_types
+ || (version >= 5
+ && (unit_type == DW_UT_skeleton || unit_type == DW_UT_split_compile
+ || unit_type == DW_UT_type || unit_type == DW_UT_split_type)))
{
- uint64_t type_sig8 = read_8ubyte_unaligned_inc (dwarf, bytes);
+ sig_id = read_8ubyte_unaligned_inc (dwarf, bytes);
- Dwarf_Off type_offset;
- if (__libdw_read_offset_inc (dwarf, sec_idx, &bytes, offset_size,
- &type_offset, sec_idx, 0))
- return -1;
+ if ((v4_debug_types
+ || unit_type == DW_UT_type || unit_type == DW_UT_split_type))
+ {
+ if (__libdw_read_offset_inc (dwarf, sec_idx, &bytes, offset_size,
+ &subdie_off, sec_idx, 0))
+ return -1;
- /* Validate that the TYPE_OFFSET points past the header. */
- if (unlikely (type_offset < (size_t) (bytes - (data + off))))
- goto invalid;
-
- *type_signaturep = type_sig8;
- if (type_offsetp != NULL)
- *type_offsetp = type_offset;
+ /* Validate that the TYPE_OFFSET points past the header. */
+ if (unlikely (subdie_off < (size_t) (bytes - (data + off))))
+ goto invalid;
+ }
}
- /* Store the header length. */
+ done:
+ if (unit_id8p != NULL)
+ *unit_id8p = sig_id;
+
+ if (subdie_offsetp != NULL)
+ *subdie_offsetp = subdie_off;
+
+ /* Store the header length. This is really how much we have read
+ from the header. If we didn't recognize the unit type the
+ header might actually be bigger. */
if (header_sizep != NULL)
*header_sizep = bytes - (data + off);
if (versionp != NULL)
*versionp = version;
+ if (unit_typep != NULL)
+ *unit_typep = unit_type;
+
if (abbrev_offsetp != NULL)
*abbrev_offsetp = abbrev_offset;
@@ -166,13 +273,18 @@
if (offset_sizep != NULL)
*offset_sizep = offset_size;
- /* See definition of DIE_OFFSET_FROM_CU_OFFSET macro
- for an explanation of the trick in this expression. */
+ /* The length of the unit doesn't include the length field itself.
+ The length field is either, with offset == 4: 2 * 4 - 4 == 4,
+ or with offset == 8: 2 * 8 - 4 == 12. */
*next_off = off + 2 * offset_size - 4 + length;
+ /* This means that the length field is bogus, but return the CU anyway.
+ We just won't return anything after this. */
+ if (*next_off <= off)
+ *next_off = (Dwarf_Off) -1;
+
return 0;
}
-INTDEF(dwarf_next_unit)
int
dwarf_nextcu (Dwarf *dwarf, Dwarf_Off off, Dwarf_Off *next_off,
diff --git a/libdw/dwarf_offdie.c b/libdw/dwarf_offdie.c
index 15f55c2..883720d 100644
--- a/libdw/dwarf_offdie.c
+++ b/libdw/dwarf_offdie.c
@@ -1,5 +1,5 @@
/* Return DIE at given offset.
- Copyright (C) 2002-2010 Red Hat, Inc.
+ Copyright (C) 2002-2010, 2017 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -45,7 +45,7 @@
Elf_Data *const data = dbg->sectiondata[debug_types ? IDX_debug_types
: IDX_debug_info];
- if (offset >= data->d_size)
+ if (data == NULL || offset >= data->d_size)
{
__libdw_seterrno (DWARF_E_INVALID_DWARF);
return NULL;
diff --git a/libdw/dwarf_peel_type.c b/libdw/dwarf_peel_type.c
index 5dca8f8..59fc6f1 100644
--- a/libdw/dwarf_peel_type.c
+++ b/libdw/dwarf_peel_type.c
@@ -1,5 +1,5 @@
/* Peel type aliases and qualifier tags from a type DIE.
- Copyright (C) 2014, 2015 Red Hat, Inc.
+ Copyright (C) 2014, 2015, 2016 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -46,14 +46,22 @@
*result = *die;
tag = INTUSE (dwarf_tag) (result);
- while (tag == DW_TAG_typedef
- || tag == DW_TAG_const_type
- || tag == DW_TAG_volatile_type
- || tag == DW_TAG_restrict_type
- || tag == DW_TAG_atomic_type)
+
+/* Stack 8 of all these modifiers, after that it gets silly. */
+#define MAX_DEPTH (8 * 8)
+ int max_depth = MAX_DEPTH;
+ while ((tag == DW_TAG_typedef
+ || tag == DW_TAG_const_type
+ || tag == DW_TAG_volatile_type
+ || tag == DW_TAG_restrict_type
+ || tag == DW_TAG_atomic_type
+ || tag == DW_TAG_immutable_type
+ || tag == DW_TAG_packed_type
+ || tag == DW_TAG_shared_type)
+ && max_depth-- > 0)
{
Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = INTUSE (dwarf_attr_integrate) (die, DW_AT_type,
+ Dwarf_Attribute *attr = INTUSE (dwarf_attr_integrate) (result, DW_AT_type,
&attr_mem);
if (attr == NULL)
return 1;
@@ -64,7 +72,7 @@
tag = INTUSE (dwarf_tag) (result);
}
- if (tag == DW_TAG_invalid)
+ if (tag == DW_TAG_invalid || max_depth <= 0)
return -1;
return 0;
diff --git a/libdw/dwarf_ranges.c b/libdw/dwarf_ranges.c
index 4b6853d..f67d8a5 100644
--- a/libdw/dwarf_ranges.c
+++ b/libdw/dwarf_ranges.c
@@ -1,5 +1,5 @@
/* Enumerate the PC ranges covered by a DIE.
- Copyright (C) 2005, 2007, 2009 Red Hat, Inc.
+ Copyright (C) 2005, 2007, 2009, 2018 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -36,48 +36,427 @@
/* Read up begin/end pair and increment read pointer.
- If it's normal range record, set up `*beginp' and `*endp' and return 0.
+ - If it's a default location, set `*beginp' (0), `*endp' (-1) and return 0.
- If it's base address selection record, set up `*basep' and return 1.
- If it's end of rangelist, don't set anything and return 2
- If an error occurs, don't set anything and return -1. */
internal_function int
-__libdw_read_begin_end_pair_inc (Dwarf *dbg, int sec_index,
- unsigned char **addrp, int width,
+__libdw_read_begin_end_pair_inc (Dwarf_CU *cu, int sec_index,
+ const unsigned char **addrp,
+ const unsigned char *addrend,
+ int width,
Dwarf_Addr *beginp, Dwarf_Addr *endp,
Dwarf_Addr *basep)
{
- Dwarf_Addr escape = (width == 8 ? (Elf64_Addr) -1
- : (Elf64_Addr) (Elf32_Addr) -1);
- Dwarf_Addr begin;
- Dwarf_Addr end;
-
- unsigned char *addr = *addrp;
- bool begin_relocated = READ_AND_RELOCATE (__libdw_relocate_address, begin);
- bool end_relocated = READ_AND_RELOCATE (__libdw_relocate_address, end);
- *addrp = addr;
-
- /* Unrelocated escape for begin means base address selection. */
- if (begin == escape && !begin_relocated)
+ Dwarf *dbg = cu->dbg;
+ if (sec_index == IDX_debug_loc
+ && cu->version < 5
+ && cu->unit_type == DW_UT_split_compile)
{
- if (unlikely (end == escape))
+ /* GNU DebugFission. */
+ const unsigned char *addr = *addrp;
+ if (addrend - addr < 1)
+ goto invalid;
+
+ const char code = *addr++;
+ uint64_t begin = 0, end = 0, base = *basep, addr_idx;
+ switch (code)
{
+ case DW_LLE_GNU_end_of_list_entry:
+ *addrp = addr;
+ return 2;
+
+ case DW_LLE_GNU_base_address_selection_entry:
+ if (addrend - addr < 1)
+ goto invalid;
+ get_uleb128 (addr_idx, addr, addrend);
+ if (__libdw_addrx (cu, addr_idx, &base) != 0)
+ return -1;
+ *basep = base;
+ *addrp = addr;
+ return 1;
+
+ case DW_LLE_GNU_start_end_entry:
+ if (addrend - addr < 1)
+ goto invalid;
+ get_uleb128 (addr_idx, addr, addrend);
+ if (__libdw_addrx (cu, addr_idx, &begin) != 0)
+ return -1;
+ if (addrend - addr < 1)
+ goto invalid;
+ get_uleb128 (addr_idx, addr, addrend);
+ if (__libdw_addrx (cu, addr_idx, &end) != 0)
+ return -1;
+
+ *beginp = begin;
+ *endp = end;
+ *addrp = addr;
+ return 0;
+
+ case DW_LLE_GNU_start_length_entry:
+ if (addrend - addr < 1)
+ goto invalid;
+ get_uleb128 (addr_idx, addr, addrend);
+ if (__libdw_addrx (cu, addr_idx, &begin) != 0)
+ return -1;
+ if (addrend - addr < 4)
+ goto invalid;
+ end = read_4ubyte_unaligned_inc (dbg, addr);
+
+ *beginp = begin;
+ *endp = begin + end;
+ *addrp = addr;
+ return 0;
+
+ default:
+ goto invalid;
+ }
+ }
+ else if (sec_index == IDX_debug_ranges || sec_index == IDX_debug_loc)
+ {
+ Dwarf_Addr escape = (width == 8 ? (Elf64_Addr) -1
+ : (Elf64_Addr) (Elf32_Addr) -1);
+ Dwarf_Addr begin;
+ Dwarf_Addr end;
+
+ const unsigned char *addr = *addrp;
+ if (addrend - addr < width * 2)
+ {
+ invalid:
__libdw_seterrno (DWARF_E_INVALID_DWARF);
return -1;
}
- if (basep != NULL)
- *basep = end;
- return 1;
+ bool begin_relocated = READ_AND_RELOCATE (__libdw_relocate_address,
+ begin);
+ bool end_relocated = READ_AND_RELOCATE (__libdw_relocate_address,
+ end);
+ *addrp = addr;
+
+ /* Unrelocated escape for begin means base address selection. */
+ if (begin == escape && !begin_relocated)
+ {
+ if (unlikely (end == escape))
+ goto invalid;
+
+ *basep = end;
+ return 1;
+ }
+
+ /* Unrelocated pair of zeroes means end of range list. */
+ if (begin == 0 && end == 0 && !begin_relocated && !end_relocated)
+ return 2;
+
+ /* Don't check for begin_relocated == end_relocated. Serve the data
+ to the client even though it may be buggy. */
+ *beginp = begin + *basep;
+ *endp = end + *basep;
+
+ return 0;
+ }
+ else if (sec_index == IDX_debug_rnglists)
+ {
+ const unsigned char *addr = *addrp;
+ if (addrend - addr < 1)
+ goto invalid;
+
+ const char code = *addr++;
+ uint64_t begin = 0, end = 0, base = *basep, addr_idx;
+ switch (code)
+ {
+ case DW_RLE_end_of_list:
+ *addrp = addr;
+ return 2;
+
+ case DW_RLE_base_addressx:
+ if (addrend - addr < 1)
+ goto invalid;
+ get_uleb128 (addr_idx, addr, addrend);
+ if (__libdw_addrx (cu, addr_idx, &base) != 0)
+ return -1;
+
+ *basep = base;
+ *addrp = addr;
+ return 1;
+
+ case DW_RLE_startx_endx:
+ if (addrend - addr < 1)
+ goto invalid;
+ get_uleb128 (addr_idx, addr, addrend);
+ if (__libdw_addrx (cu, addr_idx, &begin) != 0)
+ return -1;
+ if (addrend - addr < 1)
+ goto invalid;
+ get_uleb128 (addr_idx, addr, addrend);
+ if (__libdw_addrx (cu, addr_idx, &end) != 0)
+ return -1;
+
+ *beginp = begin;
+ *endp = end;
+ *addrp = addr;
+ return 0;
+
+ case DW_RLE_startx_length:
+ if (addrend - addr < 1)
+ goto invalid;
+ get_uleb128 (addr_idx, addr, addrend);
+ if (__libdw_addrx (cu, addr_idx, &begin) != 0)
+ return -1;
+ if (addrend - addr < 1)
+ goto invalid;
+ get_uleb128 (end, addr, addrend);
+
+ *beginp = begin;
+ *endp = begin + end;
+ *addrp = addr;
+ return 0;
+
+ case DW_RLE_offset_pair:
+ if (addrend - addr < 1)
+ goto invalid;
+ get_uleb128 (begin, addr, addrend);
+ if (addrend - addr < 1)
+ goto invalid;
+ get_uleb128 (end, addr, addrend);
+
+ *beginp = begin + base;
+ *endp = end + base;
+ *addrp = addr;
+ return 0;
+
+ case DW_RLE_base_address:
+ if (addrend - addr < width)
+ goto invalid;
+ __libdw_read_address_inc (dbg, sec_index, &addr, width, &base);
+
+ *basep = base;
+ *addrp = addr;
+ return 1;
+
+ case DW_RLE_start_end:
+ if (addrend - addr < 2 * width)
+ goto invalid;
+ __libdw_read_address_inc (dbg, sec_index, &addr, width, &begin);
+ __libdw_read_address_inc (dbg, sec_index, &addr, width, &end);
+
+ *beginp = begin;
+ *endp = end;
+ *addrp = addr;
+ return 0;
+
+ case DW_RLE_start_length:
+ if (addrend - addr < width)
+ goto invalid;
+ __libdw_read_address_inc (dbg, sec_index, &addr, width, &begin);
+ if (addrend - addr < 1)
+ goto invalid;
+ get_uleb128 (end, addr, addrend);
+
+ *beginp = begin;
+ *endp = begin + end;
+ *addrp = addr;
+ return 0;
+
+ default:
+ goto invalid;
+ }
+ }
+ else if (sec_index == IDX_debug_loclists)
+ {
+ const unsigned char *addr = *addrp;
+ if (addrend - addr < 1)
+ goto invalid;
+
+ const char code = *addr++;
+ uint64_t begin = 0, end = 0, base = *basep, addr_idx;
+ switch (code)
+ {
+ case DW_LLE_end_of_list:
+ *addrp = addr;
+ return 2;
+
+ case DW_LLE_base_addressx:
+ if (addrend - addr < 1)
+ goto invalid;
+ get_uleb128 (addr_idx, addr, addrend);
+ if (__libdw_addrx (cu, addr_idx, &base) != 0)
+ return -1;
+
+ *basep = base;
+ *addrp = addr;
+ return 1;
+
+ case DW_LLE_startx_endx:
+ if (addrend - addr < 1)
+ goto invalid;
+ get_uleb128 (addr_idx, addr, addrend);
+ if (__libdw_addrx (cu, addr_idx, &begin) != 0)
+ return -1;
+ if (addrend - addr < 1)
+ goto invalid;
+ get_uleb128 (addr_idx, addr, addrend);
+ if (__libdw_addrx (cu, addr_idx, &end) != 0)
+ return -1;
+
+ *beginp = begin;
+ *endp = end;
+ *addrp = addr;
+ return 0;
+
+ case DW_LLE_startx_length:
+ if (addrend - addr < 1)
+ goto invalid;
+ get_uleb128 (addr_idx, addr, addrend);
+ if (__libdw_addrx (cu, addr_idx, &begin) != 0)
+ return -1;
+ if (addrend - addr < 1)
+ goto invalid;
+ get_uleb128 (end, addr, addrend);
+
+ *beginp = begin;
+ *endp = begin + end;
+ *addrp = addr;
+ return 0;
+
+ case DW_LLE_offset_pair:
+ if (addrend - addr < 1)
+ goto invalid;
+ get_uleb128 (begin, addr, addrend);
+ if (addrend - addr < 1)
+ goto invalid;
+ get_uleb128 (end, addr, addrend);
+
+ *beginp = begin + base;
+ *endp = end + base;
+ *addrp = addr;
+ return 0;
+
+ case DW_LLE_default_location:
+ *beginp = 0;
+ *endp = (Dwarf_Addr) -1;
+ *addrp = addr;
+ return 0;
+
+ case DW_LLE_base_address:
+ if (addrend - addr < width)
+ goto invalid;
+ __libdw_read_address_inc (dbg, sec_index, &addr, width, &base);
+
+ *basep = base;
+ *addrp = addr;
+ return 1;
+
+ case DW_LLE_start_end:
+ if (addrend - addr < 2 * width)
+ goto invalid;
+ __libdw_read_address_inc (dbg, sec_index, &addr, width, &begin);
+ __libdw_read_address_inc (dbg, sec_index, &addr, width, &end);
+
+ *beginp = begin;
+ *endp = end;
+ *addrp = addr;
+ return 0;
+
+ case DW_LLE_start_length:
+ if (addrend - addr < width)
+ goto invalid;
+ __libdw_read_address_inc (dbg, sec_index, &addr, width, &begin);
+ if (addrend - addr < 1)
+ goto invalid;
+ get_uleb128 (end, addr, addrend);
+
+ *beginp = begin;
+ *endp = begin + end;
+ *addrp = addr;
+ return 0;
+
+ default:
+ goto invalid;
+ }
+ }
+ else
+ {
+ __libdw_seterrno (DWARF_E_INVALID_DWARF);
+ return -1;
+ }
+}
+
+static int
+initial_offset (Dwarf_Attribute *attr, ptrdiff_t *offset)
+{
+ size_t secidx = (attr->cu->version < 5
+ ? IDX_debug_ranges : IDX_debug_rnglists);
+
+ Dwarf_Word start_offset;
+ if (attr->form == DW_FORM_rnglistx)
+ {
+ Dwarf_Word idx;
+ Dwarf_CU *cu = attr->cu;
+ const unsigned char *datap = attr->valp;
+ const unsigned char *endp = cu->endp;
+ if (datap >= endp)
+ {
+ __libdw_seterrno (DWARF_E_INVALID_DWARF);
+ return -1;
+ }
+ get_uleb128 (idx, datap, endp);
+
+ Elf_Data *data = cu->dbg->sectiondata[secidx];
+ if (data == NULL && cu->unit_type == DW_UT_split_compile)
+ {
+ cu = __libdw_find_split_unit (cu);
+ if (cu != NULL)
+ data = cu->dbg->sectiondata[secidx];
+ }
+
+ if (data == NULL)
+ {
+ __libdw_seterrno (secidx == IDX_debug_ranges
+ ? DWARF_E_NO_DEBUG_RANGES
+ : DWARF_E_NO_DEBUG_RNGLISTS);
+ return -1;
+ }
+
+ Dwarf_Off range_base_off = __libdw_cu_ranges_base (cu);
+
+ /* The section should at least contain room for one offset. */
+ size_t sec_size = cu->dbg->sectiondata[secidx]->d_size;
+ size_t offset_size = cu->offset_size;
+ if (offset_size > sec_size)
+ {
+ invalid_offset:
+ __libdw_seterrno (DWARF_E_INVALID_OFFSET);
+ return -1;
+ }
+
+ /* And the base offset should be at least inside the section. */
+ if (range_base_off > (sec_size - offset_size))
+ goto invalid_offset;
+
+ size_t max_idx = (sec_size - offset_size - range_base_off) / offset_size;
+ if (idx > max_idx)
+ goto invalid_offset;
+
+ datap = (cu->dbg->sectiondata[secidx]->d_buf
+ + range_base_off + (idx * offset_size));
+ if (offset_size == 4)
+ start_offset = read_4ubyte_unaligned (cu->dbg, datap);
+ else
+ start_offset = read_8ubyte_unaligned (cu->dbg, datap);
+
+ start_offset += range_base_off;
+ }
+ else
+ {
+ if (__libdw_formptr (attr, secidx,
+ (secidx == IDX_debug_ranges
+ ? DWARF_E_NO_DEBUG_RANGES
+ : DWARF_E_NO_DEBUG_RNGLISTS),
+ NULL, &start_offset) == NULL)
+ return -1;
}
- /* Unrelocated pair of zeroes means end of range list. */
- if (begin == 0 && end == 0 && !begin_relocated && !end_relocated)
- return 2;
-
- /* Don't check for begin_relocated == end_relocated. Serve the data
- to the client even though it may be buggy. */
- *beginp = begin;
- *endp = end;
-
+ *offset = start_offset;
return 0;
}
@@ -101,68 +480,64 @@
return 0;
/* We have to look for a noncontiguous range. */
-
- const Elf_Data *d = die->cu->dbg->sectiondata[IDX_debug_ranges];
- if (d == NULL && offset != 0)
+ Dwarf_CU *cu = die->cu;
+ if (cu == NULL)
{
- __libdw_seterrno (DWARF_E_NO_DEBUG_RANGES);
+ __libdw_seterrno (DWARF_E_INVALID_DWARF);
return -1;
}
- unsigned char *readp;
- unsigned char *readendp;
+ size_t secidx = (cu->version < 5 ? IDX_debug_ranges : IDX_debug_rnglists);
+ const Elf_Data *d = cu->dbg->sectiondata[secidx];
+ if (d == NULL && cu->unit_type == DW_UT_split_compile)
+ {
+ Dwarf_CU *skel = __libdw_find_split_unit (cu);
+ if (skel != NULL)
+ {
+ cu = skel;
+ d = cu->dbg->sectiondata[secidx];
+ }
+ }
+
+ const unsigned char *readp;
+ const unsigned char *readendp;
if (offset == 0)
{
Dwarf_Attribute attr_mem;
Dwarf_Attribute *attr = INTUSE(dwarf_attr) (die, DW_AT_ranges,
&attr_mem);
+ if (attr == NULL
+ && is_cudie (die)
+ && die->cu->unit_type == DW_UT_split_compile)
+ attr = INTUSE(dwarf_attr_integrate) (die, DW_AT_ranges, &attr_mem);
if (attr == NULL)
/* No PC attributes in this DIE at all, so an empty range list. */
return 0;
- Dwarf_Word start_offset;
- if ((readp = __libdw_formptr (attr, IDX_debug_ranges,
- DWARF_E_NO_DEBUG_RANGES,
- &readendp, &start_offset)) == NULL)
+ *basep = __libdw_cu_base_address (attr->cu);
+ if (*basep == (Dwarf_Addr) -1)
return -1;
- offset = start_offset;
- assert ((Dwarf_Word) offset == start_offset);
-
- /* Fetch the CU's base address. */
- Dwarf_Die cudie = CUDIE (attr->cu);
-
- /* Find the base address of the compilation unit. It will
- normally be specified by DW_AT_low_pc. In DWARF-3 draft 4,
- the base address could be overridden by DW_AT_entry_pc. It's
- been removed, but GCC emits DW_AT_entry_pc and not DW_AT_lowpc
- for compilation units with discontinuous ranges. */
- if (unlikely (INTUSE(dwarf_lowpc) (&cudie, basep) != 0)
- && INTUSE(dwarf_formaddr) (INTUSE(dwarf_attr) (&cudie,
- DW_AT_entry_pc,
- &attr_mem),
- basep) != 0)
- *basep = (Dwarf_Addr) -1;
+ if (initial_offset (attr, &offset) != 0)
+ return -1;
}
else
{
- if (__libdw_offset_in_section (die->cu->dbg,
- IDX_debug_ranges, offset, 1))
- return -1l;
-
- readp = d->d_buf + offset;
- readendp = d->d_buf + d->d_size;
+ if (__libdw_offset_in_section (cu->dbg,
+ secidx, offset, 1))
+ return -1;
}
- next:
- if (readendp - readp < die->cu->address_size * 2)
- goto invalid;
+ readp = d->d_buf + offset;
+ readendp = d->d_buf + d->d_size;
Dwarf_Addr begin;
Dwarf_Addr end;
- switch (__libdw_read_begin_end_pair_inc (die->cu->dbg, IDX_debug_ranges,
- &readp, die->cu->address_size,
+ next:
+ switch (__libdw_read_begin_end_pair_inc (cu, secidx,
+ &readp, readendp,
+ cu->address_size,
&begin, &end, basep))
{
case 0:
@@ -172,22 +547,11 @@
case 2:
return 0;
default:
- return -1l;
- }
-
- /* We have an address range entry. Check that we have a base. */
- if (*basep == (Dwarf_Addr) -1)
- {
- if (INTUSE(dwarf_errno) () == 0)
- {
- invalid:
- __libdw_seterrno (DWARF_E_INVALID_DWARF);
- }
return -1;
}
- *startp = *basep + begin;
- *endp = *basep + end;
+ *startp = begin;
+ *endp = end;
return readp - (unsigned char *) d->d_buf;
}
INTDEF (dwarf_ranges)
diff --git a/libdw/dwarf_setalt.c b/libdw/dwarf_setalt.c
index 9bd566f..9051b8e 100644
--- a/libdw/dwarf_setalt.c
+++ b/libdw/dwarf_setalt.c
@@ -1,5 +1,5 @@
/* Provides the data referenced by the .gnu_debugaltlink section.
- Copyright (C) 2014 Red Hat, Inc.
+ Copyright (C) 2014, 2018 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -32,9 +32,18 @@
#include "libdwP.h"
+#include <unistd.h>
+
void
dwarf_setalt (Dwarf *main, Dwarf *alt)
{
+ if (main->alt_fd != -1)
+ {
+ INTUSE(dwarf_end) (main->alt_dwarf);
+ close (main->alt_fd);
+ main->alt_fd = -1;
+ }
+
main->alt_dwarf = alt;
}
INTDEF (dwarf_setalt)
diff --git a/libdw/dwarf_siblingof.c b/libdw/dwarf_siblingof.c
index df39c1c..613d209 100644
--- a/libdw/dwarf_siblingof.c
+++ b/libdw/dwarf_siblingof.c
@@ -58,8 +58,6 @@
sibattr.cu = this_die.cu;
/* That's the address we start looking. */
unsigned char *addr = this_die.addr;
- /* End of the buffer. */
- unsigned char *endp = sibattr.cu->endp;
/* Search for the beginning of the next die on this level. We
must not return the dies for children of the given die. */
@@ -96,6 +94,8 @@
/* This abbreviation has children. */
++level;
+ /* End of the buffer. */
+ unsigned char *endp = sibattr.cu->endp;
while (1)
{
@@ -125,6 +125,7 @@
while (level > 0);
/* Maybe we reached the end of the CU. */
+ unsigned char *endp = sibattr.cu->endp;
if (addr >= endp)
return 1;
diff --git a/libdw/encoded-value.h b/libdw/encoded-value.h
index 48d868f..f0df4ce 100644
--- a/libdw/encoded-value.h
+++ b/libdw/encoded-value.h
@@ -64,6 +64,7 @@
if (*end++ & 0x80u)
return end - p;
}
+ return 0;
default:
return 0;
diff --git a/libdw/libdw.h b/libdw/libdw.h
index 473e1a2..e20961b 100644
--- a/libdw/libdw.h
+++ b/libdw/libdw.h
@@ -1,5 +1,5 @@
/* Interfaces for libdw.
- Copyright (C) 2002-2010, 2013, 2014 Red Hat, Inc.
+ Copyright (C) 2002-2010, 2013, 2014, 2016, 2018 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -34,23 +34,6 @@
#include <stddef.h>
#include <stdint.h>
-
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
-# define __nonnull_attribute__(...) __attribute__ ((__nonnull__ (__VA_ARGS__)))
-# define __deprecated_attribute__ __attribute__ ((__deprecated__))
-#else
-# define __nonnull_attribute__(args...)
-# define __deprecated_attribute__
-#endif
-
-
-#ifdef __GNUC_STDC_INLINE__
-# define __libdw_extern_inline extern __inline __attribute__ ((__gnu_inline__))
-#else
-# define __libdw_extern_inline extern __inline
-#endif
-
-
/* Mode for the session. */
typedef enum
{
@@ -228,7 +211,9 @@
Dwarf_FDE fde;
} Dwarf_CFI_Entry;
-#define dwarf_cfi_cie_p(entry) ((entry)->cie.CIE_id == DW_CIE_ID_64)
+/* Same as DW_CIE_ID_64 from dwarf.h to keep libdw.h independent. */
+#define LIBDW_CIE_ID 0xffffffffffffffffULL
+#define dwarf_cfi_cie_p(entry) ((entry)->cie.CIE_id == LIBDW_CIE_ID)
/* Opaque type representing a frame state described by CFI. */
typedef struct Dwarf_Frame_s Dwarf_Frame;
@@ -242,11 +227,7 @@
/* Out-Of-Memory handler. */
-#if __GNUC__ < 4
-typedef void (*Dwarf_OOM) (void);
-#else
-typedef void (*__attribute__ ((noreturn)) Dwarf_OOM) (void);
-#endif
+typedef void (*__noreturn_attribute__ Dwarf_OOM) (void);
#ifdef __cplusplus
@@ -269,7 +250,9 @@
extern Dwarf *dwarf_cu_getdwarf (Dwarf_CU *cu);
/* Retrieves the DWARF descriptor for debugaltlink data. Returns NULL
- if no alternate debug data has been supplied. */
+ if no alternate debug data has been supplied yet. libdw will try
+ to set the alt file on first use of an alt FORM if not yet explicitly
+ provided by dwarf_setalt. */
extern Dwarf *dwarf_getalt (Dwarf *main);
/* Provides the data referenced by the .gnu_debugaltlink section. The
@@ -277,16 +260,15 @@
same build ID). It is the responsibility of the caller to ensure
that the data referenced by ALT stays valid while it is used by
MAIN, until dwarf_setalt is called on MAIN with a different
- descriptor, or dwarf_end. */
+ descriptor, or dwarf_end. Must be called before inspecting DIEs
+ that might have alt FORMs. Otherwise libdw will try to set the
+ alt file itself on first use. */
extern void dwarf_setalt (Dwarf *main, Dwarf *alt);
/* Release debugging handling context. */
extern int dwarf_end (Dwarf *dwarf);
-/* Get the data block for the .debug_info section. */
-extern Elf_Data *dwarf_getscn_info (Dwarf *dwarf);
-
/* Read the header for the DWARF CU. */
extern int dwarf_nextcu (Dwarf *dwarf, Dwarf_Off off, Dwarf_Off *next_off,
size_t *header_sizep, Dwarf_Off *abbrev_offsetp,
@@ -304,6 +286,33 @@
__nonnull_attribute__ (3);
+/* Gets the next Dwarf_CU (unit), version, unit type and if available
+ the CU DIE and sub (type) DIE of the unit. Returns 0 on success,
+ -1 on error or 1 if there are no more units. To start iterating
+ provide NULL for CU. If version < 5 the unit type is set from the
+ CU DIE if available (DW_UT_compile for DW_TAG_compile_unit,
+ DW_UT_type for DW_TAG_type_unit or DW_UT_partial for
+ DW_TAG_partial_unit), otherwise it is set to zero. If unavailable
+ (the version or unit type is unknown) the CU DIE is cleared.
+ Likewise if the sub DIE isn't isn't available (the unit type is not
+ DW_UT_type or DW_UT_split_type) the sub DIE tag is cleared. */
+extern int dwarf_get_units (Dwarf *dwarf, Dwarf_CU *cu, Dwarf_CU **next_cu,
+ Dwarf_Half *version, uint8_t *unit_type,
+ Dwarf_Die *cudie, Dwarf_Die *subdie)
+ __nonnull_attribute__ (3);
+
+/* Provides information and DIEs associated with the given Dwarf_CU
+ unit. Returns -1 on error, zero on success. Arguments not needed
+ may be NULL. If they are NULL and aren't known yet, they won't be
+ looked up. If the subdie doesn't exist for this unit_type it will
+ be cleared. If there is no unit_id for this unit type it will be
+ set to zero. */
+extern int dwarf_cu_info (Dwarf_CU *cu,
+ Dwarf_Half *version, uint8_t *unit_type,
+ Dwarf_Die *cudie, Dwarf_Die *subdie,
+ uint64_t *unit_id,
+ uint8_t *address_size, uint8_t *offset_size);
+
/* Decode one DWARF CFI entry (CIE or FDE) from the raw section data.
The E_IDENT from the originating ELF file indicates the address
size and byte order used in the CFI section contained in DATA;
@@ -365,6 +374,18 @@
uint8_t *address_sizep, uint8_t *offset_sizep)
__nonnull_attribute__ (2);
+/* Given a Dwarf_Die addr returns a (reconstructed) Dwarf_Die, or NULL
+ if the given addr didn't come from a valid Dwarf_Die. In particular
+ it will make sure that the correct Dwarf_CU pointer is set for the
+ Dwarf_Die, the Dwarf_Abbrev pointer will not be set up yet (it will
+ only be once the Dwarf_Die is used to read attributes, children or
+ siblings). This functions can be used to keep a reference to a
+ Dwarf_Die which you want to refer to later. The addr, and the result
+ of this function, is only valid while the associated Dwarf is valid. */
+extern Dwarf_Die *dwarf_die_addr_die (Dwarf *dbg, void *addr,
+ Dwarf_Die *result)
+ __nonnull_attribute__ (3);
+
/* Return the CU DIE and the header info associated with a Dwarf_Die
or Dwarf_Attribute. A Dwarf_Die or a Dwarf_Attribute is associated
with a particular Dwarf_CU handle. This function returns the CU or
@@ -399,8 +420,11 @@
extern int dwarf_siblingof (Dwarf_Die *die, Dwarf_Die *result)
__nonnull_attribute__ (2);
-/* For type aliases and qualifier type DIEs follow the DW_AT_type
- attribute (recursively) and return the underlying type Dwarf_Die.
+/* For type aliases and qualifier type DIEs, which don't modify or
+ change the structural layout of the underlying type, follow the
+ DW_AT_type attribute (recursively) and return the underlying type
+ Dwarf_Die.
+
Returns 0 when RESULT contains a Dwarf_Die (possibly equal to the
given DIE) that isn't a type alias or qualifier type. Returns 1
when RESULT contains a type alias or qualifier Dwarf_Die that
@@ -408,13 +432,18 @@
attribute). Returns -1 when an error occured.
The current DWARF specification defines one type alias tag
- (DW_TAG_typedef) and three qualifier type tags (DW_TAG_const_type,
- DW_TAG_volatile_type, DW_TAG_restrict_type). DWARF5 defines one
- other qualifier type tag (DW_TAG_atomic_type). A future version of
- this function might peel other alias or qualifier type tags if a
- future DWARF version or GNU extension defines other type aliases or
- qualifier type tags that don't modify or change the structural
- layout of the underlying type. */
+ (DW_TAG_typedef) and seven modifier/qualifier type tags
+ (DW_TAG_const_type, DW_TAG_volatile_type, DW_TAG_restrict_type,
+ DW_TAG_atomic_type, DW_TAG_immutable_type, DW_TAG_packed_type and
+ DW_TAG_shared_type). This function won't peel modifier type
+ tags that change the way the underlying type is accessed such
+ as the pointer or reference type tags (DW_TAG_pointer_type,
+ DW_TAG_reference_type or DW_TAG_rvalue_reference_type).
+
+ A future version of this function might peel other alias or
+ qualifier type tags if a future DWARF version or GNU extension
+ defines other type aliases or qualifier type tags that don't modify,
+ change the structural layout or the way to access the underlying type. */
extern int dwarf_peel_type (Dwarf_Die *die, Dwarf_Die *result)
__nonnull_attribute__ (2);
@@ -574,6 +603,12 @@
unsigned int *namep, unsigned int *formp,
Dwarf_Off *offset);
+/* Get specific attribute of abbreviation and any data encoded with it.
+ Specifically for DW_FORM_implicit_const data will be set to the
+ constant value associated. */
+extern int dwarf_getabbrevattr_data (Dwarf_Abbrev *abbrev, size_t idx,
+ unsigned int *namep, unsigned int *formp,
+ Dwarf_Sword *datap, Dwarf_Off *offset);
/* Get string from-debug_str section. */
extern const char *dwarf_getstring (Dwarf *dbg, Dwarf_Off offset,
@@ -653,14 +688,23 @@
__nonnull_attribute__ (2);
-/* Find line information for address. */
+/* Find line information for address. The returned string is NULL when
+ an error occured, or the file path. The file path is either absolute
+ or relative to the compilation directory. See dwarf_decl_file. */
extern const char *dwarf_linesrc (Dwarf_Line *line,
Dwarf_Word *mtime, Dwarf_Word *length);
-/* Return file information. */
+/* Return file information. The returned string is NULL when
+ an error occured, or the file path. The file path is either absolute
+ or relative to the compilation directory. See dwarf_decl_file. */
extern const char *dwarf_filesrc (Dwarf_Files *file, size_t idx,
Dwarf_Word *mtime, Dwarf_Word *length);
+/* Return the Dwarf_Files and index associated with the given Dwarf_Line. */
+extern int dwarf_line_file (Dwarf_Line *line,
+ Dwarf_Files **files, size_t *idx)
+ __nonnull_attribute__ (2, 3);
+
/* Return the directory list used in the file information extracted.
(*RESULT)[0] is the CU's DW_AT_comp_dir value, and may be null.
(*RESULT)[0..*NDIRS-1] are the compile-time include directory path
@@ -669,6 +713,24 @@
const char *const **result, size_t *ndirs)
__nonnull_attribute__ (2, 3);
+/* Iterates through the debug line units. Returns 0 on success, -1 on
+ error or 1 if there are no more units. To start iterating use zero
+ for OFF and set *CU to NULL. On success NEXT_OFF will be set to
+ the next offset to use. The *CU will be set if this line table
+ needed a specific CU and needs to be given when calling
+ dwarf_next_lines again (to help dwarf_next_lines quickly find the
+ next CU). *CU might be set to NULL when it couldn't be found (the
+ compilation directory entry will be the empty string in that case)
+ or for DWARF 5 or later tables, which are self contained. SRCFILES
+ and SRCLINES may be NULL if the caller is not interested in the
+ actual line or file table. On success and when not NULL, NFILES
+ and NLINES will be set to the number of files in the file table and
+ number of lines in the line table. */
+extern int dwarf_next_lines (Dwarf *dwarf, Dwarf_Off off,
+ Dwarf_Off *next_off, Dwarf_CU **cu,
+ Dwarf_Files **srcfiles, size_t *nfiles,
+ Dwarf_Lines **srclines, size_t *nlines)
+ __nonnull_attribute__ (3,4);
/* Return location expression, decoded as a list of operations. */
extern int dwarf_getlocation (Dwarf_Attribute *attr, Dwarf_Op **expr,
@@ -749,6 +811,12 @@
For DW_TAG_array_type it can apply much more complex rules. */
extern int dwarf_aggregate_size (Dwarf_Die *die, Dwarf_Word *size);
+/* Given a language code, as returned by dwarf_srclan, get the default
+ lower bound for a subrange type without a lower bound attribute.
+ Returns zero on success or -1 on failure when the given language
+ wasn't recognized. */
+extern int dwarf_default_lower_bound (int lang, Dwarf_Sword *result)
+ __nonnull_attribute__ (2);
/* Return scope DIEs containing PC address.
Sets *SCOPES to a malloc'd array of Dwarf_Die structures,
@@ -818,7 +886,14 @@
void *arg, ptrdiff_t offset);
-/* Return file name containing definition of the given declaration. */
+/* Return file name containing definition of the given declaration.
+ Of the DECL has an (indirect, see dwarf_attr_integrate) decl_file
+ attribute. The returned file path is either absolute, or relative
+ to the compilation directory. Given the decl DIE, the compilation
+ directory can be retrieved through:
+ dwarf_formstring (dwarf_attr (dwarf_diecu (decl, &cudie, NULL, NULL),
+ DW_AT_comp_dir, &attr));
+ Returns NULL if no decl_file could be found or an error occured. */
extern const char *dwarf_decl_file (Dwarf_Die *decl);
/* Get line number of beginning of given declaration. */
diff --git a/libdw/libdw.map b/libdw/libdw.map
index 1681b6b..3fef2ed 100644
--- a/libdw/libdw.map
+++ b/libdw/libdw.map
@@ -49,7 +49,6 @@
dwarf_getlocation_addr;
dwarf_getmacros;
dwarf_getpubnames;
- dwarf_getscn_info;
dwarf_getscopes;
dwarf_getscopes_die;
dwarf_getscopevar;
@@ -327,3 +326,33 @@
global:
dwelf_scn_gnu_compressed_size;
} ELFUTILS_0.161;
+
+ELFUTILS_0.167 {
+ global:
+ dwelf_strtab_init;
+ dwelf_strtab_add;
+ dwelf_strtab_add_len;
+ dwelf_strtab_finalize;
+ dwelf_strent_off;
+ dwelf_strent_str;
+ dwelf_strtab_free;
+} ELFUTILS_0.165;
+
+ELFUTILS_0.170 {
+ global:
+ dwarf_default_lower_bound;
+ dwarf_line_file;
+} ELFUTILS_0.167;
+
+ELFUTILS_0.171 {
+ global:
+ dwarf_die_addr_die;
+ dwarf_get_units;
+ dwarf_getabbrevattr_data;
+ dwarf_cu_info;
+} ELFUTILS_0.170;
+
+ELFUTILS_0.173 {
+ global:
+ dwarf_next_lines;
+} ELFUTILS_0.171;
diff --git a/libdw/libdwP.h b/libdw/libdwP.h
index 5d095a7..eebb7d1 100644
--- a/libdw/libdwP.h
+++ b/libdw/libdwP.h
@@ -1,7 +1,6 @@
-/* Internal definitions for libdwarf.
- Copyright (C) 2002-2011, 2013-2015 Red Hat, Inc.
+/* Internal definitions for libdw.
+ Copyright (C) 2002-2011, 2013-2018 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
@@ -74,14 +73,19 @@
IDX_debug_types,
IDX_debug_abbrev,
IDX_debug_aranges,
+ IDX_debug_addr,
IDX_debug_line,
+ IDX_debug_line_str,
IDX_debug_frame,
IDX_debug_loc,
+ IDX_debug_loclists,
IDX_debug_pubnames,
IDX_debug_str,
+ IDX_debug_str_offsets,
IDX_debug_macinfo,
IDX_debug_macro,
IDX_debug_ranges,
+ IDX_debug_rnglists,
IDX_gnu_debugaltlink,
IDX_last
};
@@ -108,6 +112,9 @@
DWARF_E_NO_ENTRY,
DWARF_E_INVALID_DWARF,
DWARF_E_NO_STRING,
+ DWARF_E_NO_DEBUG_STR,
+ DWARF_E_NO_DEBUG_LINE_STR,
+ DWARF_E_NO_STR_OFFSETS,
DWARF_E_NO_ADDR,
DWARF_E_NO_CONSTANT,
DWARF_E_NO_REFERENCE,
@@ -118,7 +125,9 @@
DWARF_E_VERSION,
DWARF_E_INVALID_DIR_IDX,
DWARF_E_ADDR_OUTOFRANGE,
- DWARF_E_NO_LOCLIST,
+ DWARF_E_NO_DEBUG_LOC,
+ DWARF_E_NO_DEBUG_LOCLISTS,
+ DWARF_E_NO_LOC_VALUE,
DWARF_E_NO_BLOCK,
DWARF_E_INVALID_LINE_IDX,
DWARF_E_INVALID_ARANGE_IDX,
@@ -126,10 +135,13 @@
DWARF_E_NO_FLAG,
DWARF_E_INVALID_OFFSET,
DWARF_E_NO_DEBUG_RANGES,
+ DWARF_E_NO_DEBUG_RNGLISTS,
DWARF_E_INVALID_CFI,
DWARF_E_NO_ALT_DEBUGLINK,
DWARF_E_INVALID_OPCODE,
DWARF_E_NOT_CUDIE,
+ DWARF_E_UNKNOWN_LANGUAGE,
+ DWARF_E_NO_DEBUG_ADDR,
};
@@ -141,6 +153,10 @@
/* The underlying ELF file. */
Elf *elf;
+ /* The (absolute) path to the ELF dir, if known. To help locating
+ alt and dwo files. */
+ char *debugdir;
+
/* dwz alternate DWARF file. */
Dwarf *alt_dwarf;
@@ -153,6 +169,10 @@
/* If true, we allocated the ELF descriptor ourselves. */
bool free_elf;
+ /* If >= 0, we allocated the alt_dwarf ourselves and must end it and
+ close this file descriptor. */
+ int alt_fd;
+
/* Information for traversing the .debug_pubnames section. This is
an array and separately allocated with malloc. */
struct pubnames_s
@@ -173,6 +193,9 @@
Dwarf_Off next_tu_offset;
Dwarf_Sig8_Hash sig8_hash;
+ /* Search tree for split Dwarf associated with CUs in this debug. */
+ void *split_tree;
+
/* Search tree for .debug_macro operator tables. */
void *macro_ops;
@@ -186,8 +209,14 @@
struct Dwarf_CFI_s *cfi;
/* Fake loc CU. Used when synthesizing attributes for Dwarf_Ops that
- came from a location list entry in dwarf_getlocation_attr. */
+ came from a location list entry in dwarf_getlocation_attr.
+ Depending on version this is the .debug_loc or .debug_loclists
+ section (could be both if mixing CUs with different DWARF versions). */
struct Dwarf_CU *fake_loc_cu;
+ struct Dwarf_CU *fake_loclists_cu;
+
+ /* Similar for addrx/constx, which will come from .debug_addr section. */
+ struct Dwarf_CU *fake_addr_cu;
/* Internal memory handling. This is basically a simplified
reimplementation of obstacks. Unfortunately the standard obstack
@@ -211,13 +240,12 @@
/* Abbreviation representation. */
struct Dwarf_Abbrev
{
- Dwarf_Off offset;
- unsigned char *attrp;
- unsigned int attrcnt;
- unsigned int code;
- unsigned int tag;
- bool has_children;
-};
+ Dwarf_Off offset; /* Offset to start of abbrev into .debug_abbrev. */
+ unsigned char *attrp; /* Pointer to start of attribute name/form pairs. */
+ bool has_children : 1; /* Whether or not the DIE has children. */
+ unsigned int code : 31; /* The (unique) abbrev code. */
+ unsigned int tag; /* The tag of the DIE. */
+} attribute_packed;
#include "dwarf_abbrev_hash.h"
@@ -292,9 +320,23 @@
uint8_t offset_size;
uint16_t version;
- /* Zero if this is a normal CU. Nonzero if it is a type unit. */
- size_t type_offset;
- uint64_t type_sig8;
+ size_t sec_idx; /* Normally .debug_info, could be .debug_type or "fake". */
+
+ /* The unit type if version >= 5. Otherwise 0 for normal CUs (from
+ .debug_info) or 1 for v4 type units (from .debug_types). */
+ uint8_t unit_type;
+
+ /* Zero if the unit type doesn't support a die/type offset and/or id/sig.
+ Nonzero if it is a v4 type unit or for DWARFv5 units depending on
+ unit_type. */
+ size_t subdie_offset;
+ uint64_t unit_id8;
+
+ /* If this is a skeleton unit this points to the split compile unit.
+ Or the other way around if this is a split compile unit. Set to -1
+ if not yet searched. Always use __libdw_find_split_unit to access
+ this field. */
+ struct Dwarf_CU *split;
/* Hash table for the abbreviations. */
Dwarf_Abbrev_Hash abbrev_hash;
@@ -312,13 +354,57 @@
/* Known location lists. */
void *locs;
+ /* Base address for use with ranges and locs.
+ Don't access directly, call __libdw_cu_base_address. */
+ Dwarf_Addr base_address;
+
+ /* The offset into the .debug_addr section where index zero begins.
+ Don't access directly, call __libdw_cu_addr_base. */
+ Dwarf_Off addr_base;
+
+ /* The offset into the .debug_str_offsets section where index zero begins.
+ Don't access directly, call __libdw_cu_str_off_base. */
+ Dwarf_Off str_off_base;
+
+ /* The offset into the .debug_ranges section to use for GNU
+ DebugFission split units. Don't access directly, call
+ __libdw_cu_ranges_base. */
+ Dwarf_Off ranges_base;
+
+ /* The start of the offset table in .debug_loclists.
+ Don't access directly, call __libdw_cu_locs_base. */
+ Dwarf_Off locs_base;
+
/* Memory boundaries of this CU. */
void *startp;
void *endp;
};
-/* Compute the offset of a CU's first DIE from its offset. This
- is either:
+#define ISV4TU(cu) ((cu)->version == 4 && (cu)->sec_idx == IDX_debug_types)
+
+/* Compute the offset of a CU's first DIE from the CU offset.
+ CU must be a valid/known version/unit_type. */
+static inline Dwarf_Off
+__libdw_first_die_from_cu_start (Dwarf_Off cu_start,
+ uint8_t offset_size,
+ uint16_t version,
+ uint8_t unit_type)
+{
+/*
+ assert (offset_size == 4 || offset_size == 8);
+ assert (version >= 2 && version <= 5);
+ assert (unit_type == DW_UT_compile
+ || unit_type == DW_UT_partial
+ || unit_type == DW_UT_skeleton
+ || unit_type == DW_UT_split_compile
+ || unit_type == DW_UT_type
+ || unit_type == DW_UT_split_type);
+*/
+
+ Dwarf_Off off = cu_start;
+ if (version < 5)
+ {
+ /*
LEN VER OFFSET ADDR
4-bytes + 2-bytes + 4-bytes + 1-byte for 32-bit dwarf
12-bytes + 2-bytes + 8-bytes + 1-byte for 64-bit dwarf
@@ -327,22 +413,61 @@
12-bytes + 2-bytes + 8-bytes + 1-byte + 8-bytes + 8-bytes for 64-bit
Note the trick in the computation. If the offset_size is 4
- the '- 4' term changes the '3 *' into a '2 *'. If the
- offset_size is 8 it accounts for the 4-byte escape value
+ the '- 4' term changes the '3 *' (or '4 *') into a '2 *' (or '3 *).
+ If the offset_size is 8 it accounts for the 4-byte escape value
used at the start of the length. */
-#define DIE_OFFSET_FROM_CU_OFFSET(cu_offset, offset_size, type_unit) \
- ((type_unit) ? ((cu_offset) + 4 * (offset_size) - 4 + 3 + 8) \
- : ((cu_offset) + 3 * (offset_size) - 4 + 3))
+ if (unit_type != DW_UT_type)
+ off += 3 * offset_size - 4 + 3;
+ else
+ off += 4 * offset_size - 4 + 3 + 8;
+ }
+ else
+ {
+ /*
+ LEN VER TYPE ADDR OFFSET SIGNATURE TYPE-OFFSET
+ 4-bytes + 2-bytes + 1-byte + 1-byte + 4-bytes + 8-bytes + 4-bytes 32-bit
+ 12-bytes + 2-bytes + 1-byte + 1-byte + 8-bytes + 8-bytes + 8-bytes 64-bit
+ Both signature and type offset are optional.
+
+ Note same 4/8 offset size trick as above.
+ We explicitly ignore unknow unit types (see asserts above). */
+ off += 3 * offset_size - 4 + 4;
+ if (unit_type == DW_UT_skeleton || unit_type == DW_UT_split_compile
+ || unit_type == DW_UT_type || unit_type == DW_UT_split_type)
+ {
+ off += 8;
+ if (unit_type == DW_UT_type || unit_type == DW_UT_split_type)
+ off += offset_size;
+ }
+ }
+
+ return off;
+}
+
+static inline Dwarf_Off
+__libdw_first_die_off_from_cu (struct Dwarf_CU *cu)
+{
+ return __libdw_first_die_from_cu_start (cu->start,
+ cu->offset_size,
+ cu->version,
+ cu->unit_type);
+}
#define CUDIE(fromcu) \
((Dwarf_Die) \
{ \
.cu = (fromcu), \
- .addr = ((char *) fromcu->dbg->sectiondata[cu_sec_idx (fromcu)]->d_buf \
- + DIE_OFFSET_FROM_CU_OFFSET ((fromcu)->start, \
- (fromcu)->offset_size, \
- (fromcu)->type_offset != 0)) \
- }) \
+ .addr = ((char *) (fromcu)->dbg->sectiondata[cu_sec_idx (fromcu)]->d_buf \
+ + __libdw_first_die_off_from_cu (fromcu)) \
+ })
+
+#define SUBDIE(fromcu) \
+ ((Dwarf_Die) \
+ { \
+ .cu = (fromcu), \
+ .addr = ((char *) (fromcu)->dbg->sectiondata[cu_sec_idx (fromcu)]->d_buf \
+ + (fromcu)->start + (fromcu)->subdie_offset) \
+ })
/* Prototype of a single .debug_macro operator. */
@@ -398,6 +523,44 @@
return macro->table->table[macro->table->opcodes[macro->opcode - 1]].nforms;
}
+/* Returns true for any allowed FORM in the opcode_operands_table as
+ mentioned in the DWARF5 spec (6.3.1 Macro Information Header).
+ Or those mentioned in DWARF5 spec (6.2.4.2 Vendor-defined Content
+ Descriptions) for the directory/file table (plus DW_FORM_strp_sup). */
+static inline bool
+libdw_valid_user_form (int form)
+{
+ switch (form)
+ {
+ case DW_FORM_block:
+ case DW_FORM_block1:
+ case DW_FORM_block2:
+ case DW_FORM_block4:
+ case DW_FORM_data1:
+ case DW_FORM_data2:
+ case DW_FORM_data4:
+ case DW_FORM_data8:
+ case DW_FORM_data16:
+ case DW_FORM_flag:
+ case DW_FORM_line_strp:
+ case DW_FORM_sdata:
+ case DW_FORM_sec_offset:
+ case DW_FORM_string:
+ case DW_FORM_strp:
+ case DW_FORM_strp_sup:
+ case DW_FORM_strx:
+ case DW_FORM_strx1:
+ case DW_FORM_strx2:
+ case DW_FORM_strx3:
+ case DW_FORM_strx4:
+ case DW_FORM_udata:
+ return true;
+ default:
+ return false;
+ }
+}
+
+
/* We have to include the file at this point because the inline
functions access internals of the Dwarf structure. */
#include "memory-access.h"
@@ -433,7 +596,19 @@
__attribute__ ((__malloc__)) __nonnull_attribute__ (1);
/* Default OOM handler. */
-extern void __libdw_oom (void) __attribute ((noreturn, visibility ("hidden")));
+extern void __libdw_oom (void) __attribute ((noreturn)) attribute_hidden;
+
+/* Read next unit (or v4 debug type) and return next offset. Doesn't
+ create an actual Dwarf_CU just provides necessary header fields. */
+extern int
+internal_function
+__libdw_next_unit (Dwarf *dbg, bool v4_debug_types, Dwarf_Off off,
+ Dwarf_Off *next_off, size_t *header_sizep,
+ Dwarf_Half *versionp, uint8_t *unit_typep,
+ Dwarf_Off *abbrev_offsetp, uint8_t *address_sizep,
+ uint8_t *offset_sizep, uint64_t *unit_id8p,
+ Dwarf_Off *subdie_offsetp)
+ __nonnull_attribute__ (4) internal_function;
/* Allocate the internal data for a unit not seen before. */
extern struct Dwarf_CU *__libdw_intern_next_unit (Dwarf *dbg, bool debug_types)
@@ -443,6 +618,18 @@
extern struct Dwarf_CU *__libdw_findcu (Dwarf *dbg, Dwarf_Off offset, bool tu)
__nonnull_attribute__ (1) internal_function;
+/* Find CU for given DIE address. */
+extern struct Dwarf_CU *__libdw_findcu_addr (Dwarf *dbg, void *addr)
+ __nonnull_attribute__ (1) internal_function;
+
+/* Find split Dwarf for given DIE address. */
+extern struct Dwarf *__libdw_find_split_dbg_addr (Dwarf *dbg, void *addr)
+ __nonnull_attribute__ (1) internal_function;
+
+/* Find the split (or skeleton) unit. */
+extern struct Dwarf_CU *__libdw_find_split_unit (Dwarf_CU *cu)
+ internal_function;
+
/* Get abbreviation with given code. */
extern Dwarf_Abbrev *__libdw_findabbrev (struct Dwarf_CU *cu,
unsigned int code)
@@ -466,6 +653,9 @@
/* Get the abbreviation code. */
unsigned int code;
const unsigned char *addr = die->addr;
+ if (unlikely (die->cu == NULL
+ || addr >= (const unsigned char *) die->cu->endp))
+ return die->abbrev = DWARF_END_ABBREV;
get_uleb128 (code, addr, die->cu->endp);
if (readp != NULL)
*readp = addr;
@@ -483,7 +673,7 @@
const unsigned char *valp)
__nonnull_attribute__ (1, 3) internal_function;
-/* Find the length of a form attribute. */
+/* Find the length of a form attribute in DIE/info data. */
static inline size_t
__nonnull_attribute__ (1, 3)
__libdw_form_val_len (struct Dwarf_CU *cu, unsigned int form,
@@ -494,10 +684,24 @@
static const uint8_t form_lengths[] =
{
[DW_FORM_flag_present] = 0x80,
- [DW_FORM_data1] = 1, [DW_FORM_ref1] = 1, [DW_FORM_flag] = 1,
+ [DW_FORM_implicit_const] = 0x80, /* Value is in abbrev, not in info. */
+
+ [DW_FORM_flag] = 1,
+ [DW_FORM_data1] = 1, [DW_FORM_ref1] = 1,
+ [DW_FORM_addrx1] = 1, [DW_FORM_strx1] = 1,
+
[DW_FORM_data2] = 2, [DW_FORM_ref2] = 2,
- [DW_FORM_data4] = 4, [DW_FORM_ref4] = 4,
- [DW_FORM_data8] = 8, [DW_FORM_ref8] = 8, [DW_FORM_ref_sig8] = 8,
+ [DW_FORM_addrx2] = 2, [DW_FORM_strx2] = 2,
+
+ [DW_FORM_addrx3] = 3, [DW_FORM_strx3] = 3,
+
+ [DW_FORM_data4] = 4, [DW_FORM_ref4] = 4, [DW_FORM_ref_sup4] = 4,
+ [DW_FORM_addrx4] = 4, [DW_FORM_strx4] = 4,
+
+ [DW_FORM_ref_sig8] = 8,
+ [DW_FORM_data8] = 8, [DW_FORM_ref8] = 8, [DW_FORM_ref_sup8] = 8,
+
+ [DW_FORM_data16] = 16,
};
/* Return immediately for forms with fixed lengths. */
@@ -625,7 +829,8 @@
if (data == NULL)
return -1;
if (unlikely (offset > data->d_size)
- || unlikely (data->d_size - offset < size))
+ || unlikely (data->d_size < size)
+ || unlikely (offset > data->d_size - size))
{
__libdw_seterrno (DWARF_E_INVALID_OFFSET);
return -1;
@@ -642,7 +847,8 @@
if (data == NULL)
return false;
if (unlikely (addr < data->d_buf)
- || unlikely (data->d_size - (addr - data->d_buf) < size))
+ || unlikely (data->d_size < size)
+ || unlikely ((size_t)(addr - data->d_buf) > data->d_size - size))
{
__libdw_seterrno (DWARF_E_INVALID_OFFSET);
return false;
@@ -713,13 +919,13 @@
static inline size_t
cu_sec_idx (struct Dwarf_CU *cu)
{
- return cu->type_offset == 0 ? IDX_debug_info : IDX_debug_types;
+ return cu->sec_idx;
}
static inline bool
is_cudie (Dwarf_Die *cudie)
{
- return CUDIE (cudie->cu).addr == cudie->addr;
+ return cudie->cu != NULL && CUDIE (cudie->cu).addr == cudie->addr;
}
/* Read up begin/end pair and increment read pointer.
@@ -727,15 +933,18 @@
- If it's base address selection record, set up *BASEP and return 1.
- If it's end of rangelist, don't set anything and return 2
- If an error occurs, don't set anything and return <0. */
-int __libdw_read_begin_end_pair_inc (Dwarf *dbg, int sec_index,
- unsigned char **addr, int width,
+int __libdw_read_begin_end_pair_inc (Dwarf_CU *cu, int sec_index,
+ const unsigned char **readp,
+ const unsigned char *readend,
+ int width,
Dwarf_Addr *beginp, Dwarf_Addr *endp,
Dwarf_Addr *basep)
internal_function;
-unsigned char * __libdw_formptr (Dwarf_Attribute *attr, int sec_index,
- int err_nodata, unsigned char **endpp,
- Dwarf_Off *offsetp)
+const unsigned char * __libdw_formptr (Dwarf_Attribute *attr, int sec_index,
+ int err_nodata,
+ const unsigned char **endpp,
+ Dwarf_Off *offsetp)
internal_function;
/* Fills in the given attribute to point at an empty location expression. */
@@ -756,6 +965,363 @@
/* Load and return value of DW_AT_comp_dir from CUDIE. */
const char *__libdw_getcompdir (Dwarf_Die *cudie);
+/* Get the base address for the CU, fetches it when not yet set.
+ This is used as initial base address for ranges and loclists. */
+Dwarf_Addr __libdw_cu_base_address (Dwarf_CU *cu);
+
+/* Get the address base for the CU, fetches it when not yet set. */
+static inline Dwarf_Off
+__libdw_cu_addr_base (Dwarf_CU *cu)
+{
+ if (cu->addr_base == (Dwarf_Off) -1)
+ {
+ Dwarf_Die cu_die = CUDIE(cu);
+ Dwarf_Attribute attr;
+ Dwarf_Off offset = 0;
+ if (dwarf_attr (&cu_die, DW_AT_GNU_addr_base, &attr) != NULL
+ || dwarf_attr (&cu_die, DW_AT_addr_base, &attr) != NULL)
+ {
+ Dwarf_Word off;
+ if (dwarf_formudata (&attr, &off) == 0)
+ offset = off;
+ }
+ cu->addr_base = offset;
+ }
+
+ return cu->addr_base;
+}
+
+/* Gets the .debug_str_offsets base offset to use. static inline to
+ be shared between libdw and eu-readelf. */
+static inline Dwarf_Off
+str_offsets_base_off (Dwarf *dbg, Dwarf_CU *cu)
+{
+ /* If we don't have a CU, then find and use the first one in the
+ debug file (when we support .dwp files, we must actually find the
+ one matching our "caller" - aka macro or line). If we (now) have
+ a cu and str_offsets_base attribute, just use that. Otherwise
+ use the first offset. But we might have to parse the header
+ first, but only if this is version 5. Assume if all else fails,
+ this is version 4, without header. */
+
+ if (cu == NULL && dbg != NULL)
+ {
+ Dwarf_CU *first_cu;
+ if (dwarf_get_units (dbg, NULL, &first_cu,
+ NULL, NULL, NULL, NULL) == 0)
+ cu = first_cu;
+ }
+
+ if (cu != NULL)
+ {
+ if (cu->str_off_base == (Dwarf_Off) -1)
+ {
+ Dwarf_Die cu_die = CUDIE(cu);
+ Dwarf_Attribute attr;
+ if (dwarf_attr (&cu_die, DW_AT_str_offsets_base, &attr) != NULL)
+ {
+ Dwarf_Word off;
+ if (dwarf_formudata (&attr, &off) == 0)
+ {
+ cu->str_off_base = off;
+ return cu->str_off_base;
+ }
+ }
+ /* For older DWARF simply assume zero (no header). */
+ if (cu->version < 5)
+ {
+ cu->str_off_base = 0;
+ return cu->str_off_base;
+ }
+
+ if (dbg == NULL)
+ dbg = cu->dbg;
+ }
+ else
+ return cu->str_off_base;
+ }
+
+ /* No str_offsets_base attribute, we have to assume "zero".
+ But there could be a header first. */
+ Dwarf_Off off = 0;
+ if (dbg == NULL)
+ goto no_header;
+
+ Elf_Data *data = dbg->sectiondata[IDX_debug_str_offsets];
+ if (data == NULL)
+ goto no_header;
+
+ const unsigned char *start;
+ const unsigned char *readp;
+ const unsigned char *readendp;
+ start = readp = (const unsigned char *) data->d_buf;
+ readendp = (const unsigned char *) data->d_buf + data->d_size;
+
+ uint64_t unit_length;
+ uint16_t version;
+
+ unit_length = read_4ubyte_unaligned_inc (dbg, readp);
+ if (unlikely (unit_length == 0xffffffff))
+ {
+ if (unlikely (readendp - readp < 8))
+ goto no_header;
+ unit_length = read_8ubyte_unaligned_inc (dbg, readp);
+ /* In theory the offset size could be different
+ between CU and str_offsets unit. But we just
+ ignore that here. */
+ }
+
+ /* We need at least 2-bytes (version) + 2-bytes (padding) =
+ 4 bytes to complete the header. And this unit cannot go
+ beyond the section data. */
+ if (readendp - readp < 4
+ || unit_length < 4
+ || (uint64_t) (readendp - readp) < unit_length)
+ goto no_header;
+
+ version = read_2ubyte_unaligned_inc (dbg, readp);
+ if (version != 5)
+ goto no_header;
+ /* padding */
+ read_2ubyte_unaligned_inc (dbg, readp);
+
+ off = (Dwarf_Off) (readp - start);
+
+ no_header:
+ if (cu != NULL)
+ cu->str_off_base = off;
+
+ return off;
+}
+
+
+/* Get the string offsets base for the CU, fetches it when not yet set. */
+static inline Dwarf_Off __libdw_cu_str_off_base (Dwarf_CU *cu)
+{
+ return str_offsets_base_off (NULL, cu);
+}
+
+
+/* Either a direct offset into .debug_ranges for version < 5, or the
+ start of the offset table in .debug_rnglists for version > 5. */
+static inline Dwarf_Off
+__libdw_cu_ranges_base (Dwarf_CU *cu)
+{
+ if (cu->ranges_base == (Dwarf_Off) -1)
+ {
+ Dwarf_Off offset = 0;
+ Dwarf_Die cu_die = CUDIE(cu);
+ Dwarf_Attribute attr;
+ if (cu->version < 5)
+ {
+ if (dwarf_attr (&cu_die, DW_AT_GNU_ranges_base, &attr) != NULL)
+ {
+ Dwarf_Word off;
+ if (dwarf_formudata (&attr, &off) == 0)
+ offset = off;
+ }
+ }
+ else
+ {
+ if (dwarf_attr (&cu_die, DW_AT_rnglists_base, &attr) != NULL)
+ {
+ Dwarf_Word off;
+ if (dwarf_formudata (&attr, &off) == 0)
+ offset = off;
+ }
+
+ /* There wasn't an rnglists_base, if the Dwarf does have a
+ .debug_rnglists section, then it might be we need the
+ base after the first header. */
+ Elf_Data *data = cu->dbg->sectiondata[IDX_debug_rnglists];
+ if (offset == 0 && data != NULL)
+ {
+ Dwarf *dbg = cu->dbg;
+ const unsigned char *readp = data->d_buf;
+ const unsigned char *const dataend
+ = (unsigned char *) data->d_buf + data->d_size;
+
+ uint64_t unit_length = read_4ubyte_unaligned_inc (dbg, readp);
+ unsigned int offset_size = 4;
+ if (unlikely (unit_length == 0xffffffff))
+ {
+ if (unlikely (readp > dataend - 8))
+ goto no_header;
+
+ unit_length = read_8ubyte_unaligned_inc (dbg, readp);
+ offset_size = 8;
+ }
+
+ if (readp > dataend - 8
+ || unit_length < 8
+ || unit_length > (uint64_t) (dataend - readp))
+ goto no_header;
+
+ uint16_t version = read_2ubyte_unaligned_inc (dbg, readp);
+ if (version != 5)
+ goto no_header;
+
+ uint8_t address_size = *readp++;
+ if (address_size != 4 && address_size != 8)
+ goto no_header;
+
+ uint8_t segment_size = *readp++;
+ if (segment_size != 0)
+ goto no_header;
+
+ uint32_t offset_entry_count;
+ offset_entry_count = read_4ubyte_unaligned_inc (dbg, readp);
+
+ const unsigned char *offset_array_start = readp;
+ if (offset_entry_count <= 0)
+ goto no_header;
+
+ uint64_t needed = offset_entry_count * offset_size;
+ if (unit_length - 8 < needed)
+ goto no_header;
+
+ offset = (Dwarf_Off) (offset_array_start
+ - (unsigned char *) data->d_buf);
+ }
+ }
+ no_header:
+ cu->ranges_base = offset;
+ }
+
+ return cu->ranges_base;
+}
+
+
+/* The start of the offset table in .debug_loclists for DWARF5. */
+static inline Dwarf_Off
+__libdw_cu_locs_base (Dwarf_CU *cu)
+{
+ if (cu->locs_base == (Dwarf_Off) -1)
+ {
+ Dwarf_Off offset = 0;
+ Dwarf_Die cu_die = CUDIE(cu);
+ Dwarf_Attribute attr;
+ if (dwarf_attr (&cu_die, DW_AT_loclists_base, &attr) != NULL)
+ {
+ Dwarf_Word off;
+ if (dwarf_formudata (&attr, &off) == 0)
+ offset = off;
+ }
+
+ /* There wasn't an loclists_base, if the Dwarf does have a
+ .debug_loclists section, then it might be we need the
+ base after the first header. */
+ Elf_Data *data = cu->dbg->sectiondata[IDX_debug_loclists];
+ if (offset == 0 && data != NULL)
+ {
+ Dwarf *dbg = cu->dbg;
+ const unsigned char *readp = data->d_buf;
+ const unsigned char *const dataend
+ = (unsigned char *) data->d_buf + data->d_size;
+
+ uint64_t unit_length = read_4ubyte_unaligned_inc (dbg, readp);
+ unsigned int offset_size = 4;
+ if (unlikely (unit_length == 0xffffffff))
+ {
+ if (unlikely (readp > dataend - 8))
+ goto no_header;
+
+ unit_length = read_8ubyte_unaligned_inc (dbg, readp);
+ offset_size = 8;
+ }
+
+ if (readp > dataend - 8
+ || unit_length < 8
+ || unit_length > (uint64_t) (dataend - readp))
+ goto no_header;
+
+ uint16_t version = read_2ubyte_unaligned_inc (dbg, readp);
+ if (version != 5)
+ goto no_header;
+
+ uint8_t address_size = *readp++;
+ if (address_size != 4 && address_size != 8)
+ goto no_header;
+
+ uint8_t segment_size = *readp++;
+ if (segment_size != 0)
+ goto no_header;
+
+ uint32_t offset_entry_count;
+ offset_entry_count = read_4ubyte_unaligned_inc (dbg, readp);
+
+ const unsigned char *offset_array_start = readp;
+ if (offset_entry_count <= 0)
+ goto no_header;
+
+ uint64_t needed = offset_entry_count * offset_size;
+ if (unit_length - 8 < needed)
+ goto no_header;
+
+ offset = (Dwarf_Off) (offset_array_start
+ - (unsigned char *) data->d_buf);
+ }
+
+ no_header:
+ cu->locs_base = offset;
+ }
+
+ return cu->locs_base;
+}
+
+/* Helper function for tsearch/tfind split_tree Dwarf. */
+int __libdw_finddbg_cb (const void *arg1, const void *arg2);
+
+/* Link skeleton and split compile units. */
+static inline void
+__libdw_link_skel_split (Dwarf_CU *skel, Dwarf_CU *split)
+{
+ skel->split = split;
+ split->split = skel;
+
+ /* Get .debug_addr and addr_base greedy.
+ We also need it for the fake addr cu.
+ There is only one per split debug. */
+ Dwarf *dbg = skel->dbg;
+ Dwarf *sdbg = split->dbg;
+ if (sdbg->sectiondata[IDX_debug_addr] == NULL
+ && dbg->sectiondata[IDX_debug_addr] != NULL)
+ {
+ sdbg->sectiondata[IDX_debug_addr]
+ = dbg->sectiondata[IDX_debug_addr];
+ split->addr_base = __libdw_cu_addr_base (skel);
+ sdbg->fake_addr_cu = dbg->fake_addr_cu;
+ }
+}
+
+
+/* Given an address index for a CU return the address.
+ Returns -1 and sets libdw_errno if an error occurs. */
+int __libdw_addrx (Dwarf_CU *cu, Dwarf_Word idx, Dwarf_Addr *addr);
+
+
+/* Helper function to set debugdir field in Dwarf, used from dwarf_begin_elf
+ and libdwfl process_file. */
+char * __libdw_debugdir (int fd);
+
+
+/* Given the directory of a debug file, an absolute or relative dir
+ to look in, and file returns a full path.
+
+ If the file is absolute (starts with a /) a copy of file is returned.
+ the file isn't absolute, but dir is absolute, then a path that is
+ the concatenation of dir and file is returned. If neither file,
+ nor dir is absolute, the path will be constructed using dir (if not
+ NULL) and file relative to the debugdir (if valid).
+
+ The debugdir and the dir may be NULL (in which case they aren't used).
+ If file is NULL, or no full path can be constructed NULL is returned.
+
+ The caller is responsible for freeing the result if not NULL. */
+char * __libdw_filepath (const char *debugdir, const char *dir,
+ const char *file)
+ internal_function;
+
/* Aliases to avoid PLTs. */
INTDECL (dwarf_aggregate_size)
@@ -764,6 +1330,7 @@
INTDECL (dwarf_begin)
INTDECL (dwarf_begin_elf)
INTDECL (dwarf_child)
+INTDECL (dwarf_default_lower_bound)
INTDECL (dwarf_dieoffset)
INTDECL (dwarf_diename)
INTDECL (dwarf_end)
@@ -775,6 +1342,7 @@
INTDECL (dwarf_formsdata)
INTDECL (dwarf_formstring)
INTDECL (dwarf_formudata)
+INTDECL (dwarf_getabbrevattr_data)
INTDECL (dwarf_getalt)
INTDECL (dwarf_getarange_addr)
INTDECL (dwarf_getarangeinfo)
diff --git a/libdw/libdw_alloc.c b/libdw/libdw_alloc.c
index a3b7958..d6af23a 100644
--- a/libdw/libdw_alloc.c
+++ b/libdw/libdw_alloc.c
@@ -34,8 +34,8 @@
#include <error.h>
#include <errno.h>
#include <stdlib.h>
-#include <sys/param.h>
#include "libdwP.h"
+#include "system.h"
void *
@@ -70,7 +70,7 @@
void
-__attribute ((noreturn, visibility ("hidden")))
+__attribute ((noreturn)) attribute_hidden
__libdw_oom (void)
{
while (1)
diff --git a/libdw/libdw_find_split_unit.c b/libdw/libdw_find_split_unit.c
new file mode 100644
index 0000000..da039e5
--- /dev/null
+++ b/libdw/libdw_find_split_unit.c
@@ -0,0 +1,147 @@
+/* Find the split (or skeleton) unit for a given unit.
+ Copyright (C) 2018 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 "libdwP.h"
+#include "libelfP.h"
+
+#include <limits.h>
+#include <search.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+void
+try_split_file (Dwarf_CU *cu, const char *dwo_path)
+{
+ int split_fd = open (dwo_path, O_RDONLY);
+ if (split_fd != -1)
+ {
+ Dwarf *split_dwarf = dwarf_begin (split_fd, DWARF_C_READ);
+ if (split_dwarf != NULL)
+ {
+ Dwarf_CU *split = NULL;
+ while (dwarf_get_units (split_dwarf, split, &split,
+ NULL, NULL, NULL, NULL) == 0)
+ {
+ if (split->unit_type == DW_UT_split_compile
+ && cu->unit_id8 == split->unit_id8)
+ {
+ if (tsearch (split->dbg, &cu->dbg->split_tree,
+ __libdw_finddbg_cb) == NULL)
+ {
+ /* Something went wrong. Don't link. */
+ __libdw_seterrno (DWARF_E_NOMEM);
+ break;
+ }
+
+ /* Link skeleton and split compile units. */
+ __libdw_link_skel_split (cu, split);
+
+ /* We have everything we need from this ELF
+ file. And we are going to close the fd to
+ not run out of file descriptors. */
+ elf_cntl (split_dwarf->elf, ELF_C_FDDONE);
+ break;
+ }
+ }
+ if (cu->split == (Dwarf_CU *) -1)
+ dwarf_end (split_dwarf);
+ }
+ /* Always close, because we don't want to run out of file
+ descriptors. See also the elf_fcntl ELF_C_FDDONE call
+ above. */
+ close (split_fd);
+ }
+}
+
+Dwarf_CU *
+internal_function
+__libdw_find_split_unit (Dwarf_CU *cu)
+{
+ /* Only try once. */
+ if (cu->split != (Dwarf_CU *) -1)
+ return cu->split;
+
+ /* We need a skeleton unit with a comp_dir and [GNU_]dwo_name attributes.
+ The split unit will be the first in the dwo file and should have the
+ same id as the skeleton. */
+ if (cu->unit_type == DW_UT_skeleton)
+ {
+ Dwarf_Die cudie = CUDIE (cu);
+ Dwarf_Attribute dwo_name;
+ /* It is fine if dwo_dir doesn't exists, but then dwo_name needs
+ to be an absolute path. */
+ if (dwarf_attr (&cudie, DW_AT_dwo_name, &dwo_name) != NULL
+ || dwarf_attr (&cudie, DW_AT_GNU_dwo_name, &dwo_name) != NULL)
+ {
+ /* First try the dwo file name in the same directory
+ as we found the skeleton file. */
+ const char *dwo_file = dwarf_formstring (&dwo_name);
+ const char *debugdir = cu->dbg->debugdir;
+ char *dwo_path = __libdw_filepath (debugdir, NULL, dwo_file);
+ if (dwo_path != NULL)
+ {
+ try_split_file (cu, dwo_path);
+ free (dwo_path);
+ }
+
+ if (cu->split == (Dwarf_CU *) -1)
+ {
+ /* Try compdir plus dwo_name. */
+ Dwarf_Attribute compdir;
+ dwarf_attr (&cudie, DW_AT_comp_dir, &compdir);
+ const char *dwo_dir = dwarf_formstring (&compdir);
+ if (dwo_dir != NULL)
+ {
+ dwo_path = __libdw_filepath (debugdir, dwo_dir, dwo_file);
+ if (dwo_path != NULL)
+ {
+ try_split_file (cu, dwo_path);
+ free (dwo_path);
+ }
+ }
+ }
+ /* XXX If still not found we could try stripping dirs from the
+ comp_dir and adding them from the comp_dir, assuming
+ someone moved a whole build tree around. */
+ }
+ }
+
+ /* If we found nothing, make sure we don't try again. */
+ if (cu->split == (Dwarf_CU *) -1)
+ cu->split = NULL;
+
+ return cu->split;
+}
diff --git a/libdw/libdw_findcu.c b/libdw/libdw_findcu.c
index 082307b..ed74423 100644
--- a/libdw/libdw_findcu.c
+++ b/libdw/libdw_findcu.c
@@ -1,5 +1,5 @@
/* Find CU for given offset.
- Copyright (C) 2003-2010, 2014 Red Hat, Inc.
+ Copyright (C) 2003-2010, 2014, 2016, 2017, 2018 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -61,6 +61,40 @@
return 0;
}
+int
+__libdw_finddbg_cb (const void *arg1, const void *arg2)
+{
+ Dwarf *dbg1 = (Dwarf *) arg1;
+ Dwarf *dbg2 = (Dwarf *) arg2;
+
+ Elf_Data *dbg1_data = dbg1->sectiondata[IDX_debug_info];
+ unsigned char *dbg1_start = dbg1_data->d_buf;
+ size_t dbg1_size = dbg1_data->d_size;
+
+ Elf_Data *dbg2_data = dbg2->sectiondata[IDX_debug_info];
+ unsigned char *dbg2_start = dbg2_data->d_buf;
+ size_t dbg2_size = dbg2_data->d_size;
+
+ /* Find out which of the two arguments is the search value. It has
+ a size of 0. */
+ if (dbg1_size == 0)
+ {
+ if (dbg1_start < dbg2_start)
+ return -1;
+ if (dbg1_start >= dbg2_start + dbg2_size)
+ return 1;
+ }
+ else
+ {
+ if (dbg2_start < dbg1_start)
+ return 1;
+ if (dbg2_start >= dbg1_start + dbg1_size)
+ return -1;
+ }
+
+ return 0;
+}
+
struct Dwarf_CU *
internal_function
__libdw_intern_next_unit (Dwarf *dbg, bool debug_types)
@@ -71,30 +105,41 @@
Dwarf_Off oldoff = *offsetp;
uint16_t version;
+ uint8_t unit_type;
uint8_t address_size;
uint8_t offset_size;
Dwarf_Off abbrev_offset;
- uint64_t type_sig8 = 0;
- Dwarf_Off type_offset = 0;
+ uint64_t unit_id8;
+ Dwarf_Off subdie_offset;
- if (INTUSE(dwarf_next_unit) (dbg, oldoff, offsetp, NULL,
- &version, &abbrev_offset,
- &address_size, &offset_size,
- debug_types ? &type_sig8 : NULL,
- debug_types ? &type_offset : NULL) != 0)
+ if (__libdw_next_unit (dbg, debug_types, oldoff, offsetp, NULL,
+ &version, &unit_type, &abbrev_offset,
+ &address_size, &offset_size,
+ &unit_id8, &subdie_offset) != 0)
/* No more entries. */
return NULL;
- /* We only know how to handle the DWARF version 2 through 4 formats. */
- if (unlikely (version < 2) || unlikely (version > 4))
+ /* We only know how to handle the DWARF version 2 through 5 formats.
+ For v4 debug types we only handle version 4. */
+ if (unlikely (version < 2) || unlikely (version > 5)
+ || (debug_types && unlikely (version != 4)))
{
- __libdw_seterrno (DWARF_E_INVALID_DWARF);
+ __libdw_seterrno (DWARF_E_VERSION);
return NULL;
}
+ /* We only handle 32 or 64 bit (4 or 8 byte) addresses and offsets.
+ Just assume we are dealing with 64bit in case the size is "unknown".
+ Too much code assumes if it isn't 4 then it is 8 (or the other way
+ around). */
+ if (unlikely (address_size != 4 && address_size != 8))
+ address_size = 8;
+ if (unlikely (offset_size != 4 && offset_size != 8))
+ offset_size = 8;
+
/* Invalid or truncated debug section data? */
- Elf_Data *data = dbg->sectiondata[debug_types
- ? IDX_debug_types : IDX_debug_info];
+ size_t sec_idx = debug_types ? IDX_debug_types : IDX_debug_info;
+ Elf_Data *data = dbg->sectiondata[sec_idx];
if (unlikely (*offsetp > data->d_size))
*offsetp = data->d_size;
@@ -102,24 +147,71 @@
struct Dwarf_CU *newp = libdw_typed_alloc (dbg, struct Dwarf_CU);
newp->dbg = dbg;
+ newp->sec_idx = sec_idx;
newp->start = oldoff;
newp->end = *offsetp;
newp->address_size = address_size;
newp->offset_size = offset_size;
newp->version = version;
- newp->type_sig8 = type_sig8;
- newp->type_offset = type_offset;
+ newp->unit_id8 = unit_id8;
+ newp->subdie_offset = subdie_offset;
Dwarf_Abbrev_Hash_init (&newp->abbrev_hash, 41);
newp->orig_abbrev_offset = newp->last_abbrev_offset = abbrev_offset;
+ newp->files = NULL;
newp->lines = NULL;
newp->locs = NULL;
-
- if (debug_types)
- Dwarf_Sig8_Hash_insert (&dbg->sig8_hash, type_sig8, newp);
+ newp->split = (Dwarf_CU *) -1;
+ newp->base_address = (Dwarf_Addr) -1;
+ newp->addr_base = (Dwarf_Off) -1;
+ newp->str_off_base = (Dwarf_Off) -1;
+ newp->ranges_base = (Dwarf_Off) -1;
+ newp->locs_base = (Dwarf_Off) -1;
newp->startp = data->d_buf + newp->start;
newp->endp = data->d_buf + newp->end;
+ /* v4 debug type units have version == 4 and unit_type == DW_UT_type. */
+ if (debug_types)
+ newp->unit_type = DW_UT_type;
+ else if (version < 5)
+ {
+ /* This is a reasonable guess (and needed to get the CUDIE). */
+ newp->unit_type = DW_UT_compile;
+
+ /* But set it correctly from the actual CUDIE tag. */
+ Dwarf_Die cudie = CUDIE (newp);
+ int tag = INTUSE(dwarf_tag) (&cudie);
+ if (tag == DW_TAG_compile_unit)
+ {
+ Dwarf_Attribute dwo_id;
+ if (INTUSE(dwarf_attr) (&cudie, DW_AT_GNU_dwo_id, &dwo_id) != NULL)
+ {
+ Dwarf_Word id8;
+ if (INTUSE(dwarf_formudata) (&dwo_id, &id8) == 0)
+ {
+ if (INTUSE(dwarf_haschildren) (&cudie) == 0
+ && INTUSE(dwarf_hasattr) (&cudie,
+ DW_AT_GNU_dwo_name) == 1)
+ newp->unit_type = DW_UT_skeleton;
+ else
+ newp->unit_type = DW_UT_split_compile;
+
+ newp->unit_id8 = id8;
+ }
+ }
+ }
+ else if (tag == DW_TAG_partial_unit)
+ newp->unit_type = DW_UT_partial;
+ else if (tag == DW_TAG_type_unit)
+ newp->unit_type = DW_UT_type;
+ }
+ else
+ newp->unit_type = unit_type;
+
+ /* Store a reference to any type unit ids in the hash for quick lookup. */
+ if (unit_type == DW_UT_type || unit_type == DW_UT_split_type)
+ Dwarf_Sig8_Hash_insert (&dbg->sig8_hash, unit_id8, newp);
+
/* Add the new entry to the search tree. */
if (tsearch (newp, tree, findcu_cb) == NULL)
{
@@ -134,11 +226,11 @@
struct Dwarf_CU *
internal_function
-__libdw_findcu (Dwarf *dbg, Dwarf_Off start, bool debug_types)
+__libdw_findcu (Dwarf *dbg, Dwarf_Off start, bool v4_debug_types)
{
- void **tree = debug_types ? &dbg->tu_tree : &dbg->cu_tree;
+ void **tree = v4_debug_types ? &dbg->tu_tree : &dbg->cu_tree;
Dwarf_Off *next_offset
- = debug_types ? &dbg->next_tu_offset : &dbg->next_cu_offset;
+ = v4_debug_types ? &dbg->next_tu_offset : &dbg->next_cu_offset;
/* Maybe we already know that CU. */
struct Dwarf_CU fake = { .start = start, .end = 0 };
@@ -155,14 +247,61 @@
/* No. Then read more CUs. */
while (1)
{
- struct Dwarf_CU *newp = __libdw_intern_next_unit (dbg, debug_types);
+ struct Dwarf_CU *newp = __libdw_intern_next_unit (dbg, v4_debug_types);
if (newp == NULL)
return NULL;
/* Is this the one we are looking for? */
- if (start < *next_offset)
- // XXX Match exact offset.
+ if (start < *next_offset || start == newp->start)
return newp;
}
/* NOTREACHED */
}
+
+struct Dwarf_CU *
+internal_function
+__libdw_findcu_addr (Dwarf *dbg, void *addr)
+{
+ void **tree;
+ Dwarf_Off start;
+ if (addr >= dbg->sectiondata[IDX_debug_info]->d_buf
+ && addr < (dbg->sectiondata[IDX_debug_info]->d_buf
+ + dbg->sectiondata[IDX_debug_info]->d_size))
+ {
+ tree = &dbg->cu_tree;
+ start = addr - dbg->sectiondata[IDX_debug_info]->d_buf;
+ }
+ else if (dbg->sectiondata[IDX_debug_types] != NULL
+ && addr >= dbg->sectiondata[IDX_debug_types]->d_buf
+ && addr < (dbg->sectiondata[IDX_debug_types]->d_buf
+ + dbg->sectiondata[IDX_debug_types]->d_size))
+ {
+ tree = &dbg->tu_tree;
+ start = addr - dbg->sectiondata[IDX_debug_types]->d_buf;
+ }
+ else
+ return NULL;
+
+ struct Dwarf_CU fake = { .start = start, .end = 0 };
+ struct Dwarf_CU **found = tfind (&fake, tree, findcu_cb);
+
+ if (found != NULL)
+ return *found;
+
+ return NULL;
+}
+
+Dwarf *
+internal_function
+__libdw_find_split_dbg_addr (Dwarf *dbg, void *addr)
+{
+ /* XXX Assumes split DWARF only has CUs in main IDX_debug_info. */
+ Elf_Data fake_data = { .d_buf = addr, .d_size = 0 };
+ Dwarf fake = { .sectiondata[IDX_debug_info] = &fake_data };
+ Dwarf **found = tfind (&fake, &dbg->split_tree, __libdw_finddbg_cb);
+
+ if (found != NULL)
+ return *found;
+
+ return NULL;
+}
diff --git a/libdw/libdw_form.c b/libdw/libdw_form.c
index 72e2390..584c846 100644
--- a/libdw/libdw_form.c
+++ b/libdw/libdw_form.c
@@ -60,6 +60,8 @@
break;
case DW_FORM_strp:
+ case DW_FORM_strp_sup:
+ case DW_FORM_line_strp:
case DW_FORM_sec_offset:
case DW_FORM_GNU_ref_alt:
case DW_FORM_GNU_strp_alt:
@@ -103,6 +105,12 @@
case DW_FORM_sdata:
case DW_FORM_udata:
case DW_FORM_ref_udata:
+ case DW_FORM_addrx:
+ case DW_FORM_loclistx:
+ case DW_FORM_rnglistx:
+ case DW_FORM_strx:
+ case DW_FORM_GNU_addr_index:
+ case DW_FORM_GNU_str_index:
get_uleb128 (u128, valp, endp);
result = valp - startp;
break;
diff --git a/libdw/memory-access.h b/libdw/memory-access.h
index a749b5a..a39ad6d 100644
--- a/libdw/memory-access.h
+++ b/libdw/memory-access.h
@@ -1,7 +1,6 @@
/* Unaligned memory access functionality.
- Copyright (C) 2000-2014 Red Hat, Inc.
+ Copyright (C) 2000-2014, 2018 Red Hat, Inc.
This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
This file is free software; you can redistribute it and/or modify
it under the terms of either
@@ -31,6 +30,7 @@
#define _MEMORY_ACCESS_H 1
#include <byteswap.h>
+#include <endian.h>
#include <limits.h>
#include <stdint.h>
@@ -87,8 +87,26 @@
return UINT64_MAX;
}
+static inline uint64_t
+__libdw_get_uleb128_unchecked (const unsigned char **addrp)
+{
+ uint64_t acc = 0;
+
+ /* Unroll the first step to help the compiler optimize
+ for the common single-byte case. */
+ get_uleb128_step (acc, *addrp, 0);
+
+ const size_t max = len_leb128 (uint64_t);
+ for (size_t i = 1; i < max; ++i)
+ get_uleb128_step (acc, *addrp, i);
+ /* Other implementations set VALUE to UINT_MAX in this
+ case. So we better do this as well. */
+ return UINT64_MAX;
+}
+
/* Note, addr needs to me smaller than end. */
#define get_uleb128(var, addr, end) ((var) = __libdw_get_uleb128 (&(addr), end))
+#define get_uleb128_unchecked(var, addr) ((var) = __libdw_get_uleb128_unchecked (&(addr)))
/* The signed case is similar, but we sign-extend the result. */
@@ -121,7 +139,26 @@
return INT64_MAX;
}
+static inline int64_t
+__libdw_get_sleb128_unchecked (const unsigned char **addrp)
+{
+ int64_t acc = 0;
+
+ /* Unroll the first step to help the compiler optimize
+ for the common single-byte case. */
+ get_sleb128_step (acc, *addrp, 0);
+
+ /* Subtract one step, so we don't shift into sign bit. */
+ const size_t max = len_leb128 (int64_t) - 1;
+ for (size_t i = 1; i < max; ++i)
+ get_sleb128_step (acc, *addrp, i);
+ /* Other implementations set VALUE to INT_MAX in this
+ case. So we better do this as well. */
+ return INT64_MAX;
+}
+
#define get_sleb128(var, addr, end) ((var) = __libdw_get_sleb128 (&(addr), end))
+#define get_sleb128_unchecked(var, addr) ((var) = __libdw_get_sleb128_unchecked (&(addr)))
/* We use simple memory access functions in case the hardware allows it.
@@ -170,7 +207,7 @@
int16_t s2;
int32_t s4;
int64_t s8;
- } __attribute__ ((packed));
+ } attribute_packed;
# define read_2ubyte_unaligned(Dbg, Addr) \
read_2ubyte_unaligned_1 ((Dbg)->other_byte_order, (Addr))
@@ -278,6 +315,57 @@
Addr = (__typeof (Addr)) (((uintptr_t) (Addr)) + 8); \
t_; })
+/* 3ubyte reads are only used for DW_FORM_addrx3 and DW_FORM_strx3.
+ And are probably very rare. They are not optimized. They are
+ handled as if reading a 4byte value with the first (for big endian)
+ or last (for little endian) byte zero. */
+
+static inline int
+file_byte_order (bool other_byte_order)
+{
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ return other_byte_order ? __BIG_ENDIAN : __LITTLE_ENDIAN;
+#else
+ return other_byte_order ? __LITTLE_ENDIAN : __BIG_ENDIAN;
+#endif
+}
+
+static inline uint32_t
+read_3ubyte_unaligned (Dwarf *dbg, const unsigned char *p)
+{
+ union
+ {
+ uint32_t u4;
+ unsigned char c[4];
+ } d;
+ bool other_byte_order = dbg->other_byte_order;
+
+ if (file_byte_order (other_byte_order) == __BIG_ENDIAN)
+ {
+ d.c[0] = 0x00;
+ d.c[1] = p[0];
+ d.c[2] = p[1];
+ d.c[3] = p[2];
+ }
+ else
+ {
+ d.c[0] = p[0];
+ d.c[1] = p[1];
+ d.c[2] = p[2];
+ d.c[3] = 0x00;
+ }
+
+ if (other_byte_order)
+ return bswap_32 (d.u4);
+ else
+ return d.u4;
+}
+
+
+#define read_3ubyte_unaligned_inc(Dbg, Addr) \
+ ({ uint32_t t_ = read_2ubyte_unaligned (Dbg, Addr); \
+ Addr = (__typeof (Addr)) (((uintptr_t) (Addr)) + 3); \
+ t_; })
#define read_addr_unaligned_inc(Nbytes, Dbg, Addr) \
(assert ((Nbytes) == 4 || (Nbytes) == 8), \
diff --git a/libdwelf/ChangeLog b/libdwelf/ChangeLog
index fe8af1b..a332655 100644
--- a/libdwelf/ChangeLog
+++ b/libdwelf/ChangeLog
@@ -1,3 +1,22 @@
+2015-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+
+ * dwelf_strtab.c: Remove sys/param.h include.
+ (MIN): Remove definition.
+
+2016-07-08 Mark Wielaard <mjw@redhat.com>
+
+ * Makefile.am (libdwelf_a_SOURCES): Add dwelf_strtab.c.
+ * dwelf_strtab.c: New file.
+ * libdwelf.h (Dwelf_Strtab): New typedef.
+ (Dwelf_Strent): Likewise.
+ (dwelf_strtab_init): New function.
+ (dwelf_strtab_add): Likewise.
+ (dwelf_strtab_add_len): Likewise.
+ (dwelf_strtab_finalize): Likewise.
+ (dwelf_strent_off): Likewise.
+ (dwelf_strent_str): Likewise.
+ (dwelf_strtab_free): Likewise.
+
2015-10-28 Mark Wielaard <mjw@redhat.com>
* Makefile.am (libdwelf_a_SOURCES): Add
diff --git a/libdwelf/Makefile.am b/libdwelf/Makefile.am
index 4de4b2e..7ca767a 100644
--- a/libdwelf/Makefile.am
+++ b/libdwelf/Makefile.am
@@ -40,7 +40,8 @@
noinst_HEADERS = libdwelfP.h
libdwelf_a_SOURCES = dwelf_elf_gnu_debuglink.c dwelf_dwarf_gnu_debugaltlink.c \
- dwelf_elf_gnu_build_id.c dwelf_scn_gnu_compressed_size.c
+ dwelf_elf_gnu_build_id.c dwelf_scn_gnu_compressed_size.c \
+ dwelf_strtab.c
libdwelf = $(libdw)
diff --git a/libebl/eblstrtab.c b/libdwelf/dwelf_strtab.c
similarity index 77%
rename from libebl/eblstrtab.c
rename to libdwelf/dwelf_strtab.c
index 798c34c..01e091c 100644
--- a/libebl/eblstrtab.c
+++ b/libdwelf/dwelf_strtab.c
@@ -1,5 +1,5 @@
-/* ELF string table handling.
- Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc.
+/* ELF/DWARF string table handling.
+ Copyright (C) 2000, 2001, 2002, 2005, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2000.
@@ -38,23 +38,18 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <sys/param.h>
-#include "libebl.h"
+#include "libdwelfP.h"
#include <system.h>
-#ifndef MIN
-# define MIN(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
-struct Ebl_Strent
+struct Dwelf_Strent
{
const char *string;
size_t len;
- struct Ebl_Strent *next;
- struct Ebl_Strent *left;
- struct Ebl_Strent *right;
+ struct Dwelf_Strent *next;
+ struct Dwelf_Strent *left;
+ struct Dwelf_Strent *right;
size_t offset;
char reverse[0];
};
@@ -67,16 +62,16 @@
};
-struct Ebl_Strtab
+struct Dwelf_Strtab
{
- struct Ebl_Strent *root;
+ struct Dwelf_Strent *root;
struct memoryblock *memory;
char *backp;
size_t left;
size_t total;
bool nullstr;
- struct Ebl_Strent null;
+ struct Dwelf_Strent null;
};
@@ -87,8 +82,8 @@
#define MALLOC_OVERHEAD (2 * sizeof (void *))
-struct Ebl_Strtab *
-ebl_strtabinit (bool nullstr)
+Dwelf_Strtab *
+dwelf_strtab_init (bool nullstr)
{
if (ps == 0)
{
@@ -96,8 +91,8 @@
assert (sizeof (struct memoryblock) < ps - MALLOC_OVERHEAD);
}
- struct Ebl_Strtab *ret
- = (struct Ebl_Strtab *) calloc (1, sizeof (struct Ebl_Strtab));
+ Dwelf_Strtab *ret
+ = (Dwelf_Strtab *) calloc (1, sizeof (struct Dwelf_Strtab));
if (ret != NULL)
{
ret->nullstr = nullstr;
@@ -114,7 +109,7 @@
static int
-morememory (struct Ebl_Strtab *st, size_t len)
+morememory (Dwelf_Strtab *st, size_t len)
{
size_t overhead = offsetof (struct memoryblock, memory);
len += overhead + MALLOC_OVERHEAD;
@@ -136,7 +131,7 @@
void
-ebl_strtabfree (struct Ebl_Strtab *st)
+dwelf_strtab_free (Dwelf_Strtab *st)
{
struct memoryblock *mb = st->memory;
@@ -151,26 +146,26 @@
}
-static struct Ebl_Strent *
-newstring (struct Ebl_Strtab *st, const char *str, size_t len)
+static Dwelf_Strent *
+newstring (Dwelf_Strtab *st, const char *str, size_t len)
{
/* Compute the amount of padding needed to make the structure aligned. */
- size_t align = ((__alignof__ (struct Ebl_Strent)
+ size_t align = ((__alignof__ (struct Dwelf_Strent)
- (((uintptr_t) st->backp)
- & (__alignof__ (struct Ebl_Strent) - 1)))
- & (__alignof__ (struct Ebl_Strent) - 1));
+ & (__alignof__ (struct Dwelf_Strent) - 1)))
+ & (__alignof__ (struct Dwelf_Strent) - 1));
/* Make sure there is enough room in the memory block. */
- if (st->left < align + sizeof (struct Ebl_Strent) + len)
+ if (st->left < align + sizeof (struct Dwelf_Strent) + len)
{
- if (morememory (st, sizeof (struct Ebl_Strent) + len))
+ if (morememory (st, sizeof (struct Dwelf_Strent) + len))
return NULL;
align = 0;
}
/* Create the reserved string. */
- struct Ebl_Strent *newstr = (struct Ebl_Strent *) (st->backp + align);
+ Dwelf_Strent *newstr = (Dwelf_Strent *) (st->backp + align);
newstr->string = str;
newstr->len = len;
newstr->next = NULL;
@@ -180,8 +175,8 @@
for (int i = len - 2; i >= 0; --i)
newstr->reverse[i] = str[len - 2 - i];
newstr->reverse[len - 1] = '\0';
- st->backp += align + sizeof (struct Ebl_Strent) + len;
- st->left -= align + sizeof (struct Ebl_Strent) + len;
+ st->backp += align + sizeof (struct Dwelf_Strent) + len;
+ st->left -= align + sizeof (struct Dwelf_Strent) + len;
return newstr;
}
@@ -190,8 +185,8 @@
/* XXX This function should definitely be rewritten to use a balancing
tree algorith (AVL, red-black trees). For now a simple, correct
implementation is enough. */
-static struct Ebl_Strent **
-searchstring (struct Ebl_Strent **sep, struct Ebl_Strent *newstr)
+static Dwelf_Strent **
+searchstring (Dwelf_Strent **sep, Dwelf_Strent *newstr)
{
/* More strings? */
if (*sep == NULL)
@@ -214,34 +209,30 @@
/* Add new string. The actual string is assumed to be permanent. */
-struct Ebl_Strent *
-ebl_strtabadd (struct Ebl_Strtab *st, const char *str, size_t len)
+static Dwelf_Strent *
+strtab_add (Dwelf_Strtab *st, const char *str, size_t len)
{
- /* Compute the string length if the caller doesn't know it. */
- if (len == 0)
- len = strlen (str) + 1;
-
/* Make sure all "" strings get offset 0 but only if the table was
created with a special null entry in mind. */
if (len == 1 && st->null.string != NULL)
return &st->null;
/* Allocate memory for the new string and its associated information. */
- struct Ebl_Strent *newstr = newstring (st, str, len);
+ Dwelf_Strent *newstr = newstring (st, str, len);
if (newstr == NULL)
return NULL;
/* Search in the array for the place to insert the string. If there
is no string with matching prefix and no string with matching
leading substring, create a new entry. */
- struct Ebl_Strent **sep = searchstring (&st->root, newstr);
+ Dwelf_Strent **sep = searchstring (&st->root, newstr);
if (*sep != newstr)
{
/* This is not the same entry. This means we have a prefix match. */
if ((*sep)->len > newstr->len)
{
/* Check whether we already know this string. */
- for (struct Ebl_Strent *subs = (*sep)->next; subs != NULL;
+ for (Dwelf_Strent *subs = (*sep)->next; subs != NULL;
subs = subs->next)
if (subs->len == newstr->len)
{
@@ -287,9 +278,20 @@
return newstr;
}
+Dwelf_Strent *
+dwelf_strtab_add (Dwelf_Strtab *st, const char *str)
+{
+ return strtab_add (st, str, strlen (str) + 1);
+}
+
+Dwelf_Strent *
+dwelf_strtab_add_len (Dwelf_Strtab *st, const char *str, size_t len)
+{
+ return strtab_add (st, str, len);
+}
static void
-copystrings (struct Ebl_Strent *nodep, char **freep, size_t *offsetp)
+copystrings (Dwelf_Strent *nodep, char **freep, size_t *offsetp)
{
if (nodep->left != NULL)
copystrings (nodep->left, freep, offsetp);
@@ -299,7 +301,7 @@
*freep = (char *) mempcpy (*freep, nodep->string, nodep->len);
*offsetp += nodep->len;
- for (struct Ebl_Strent *subs = nodep->next; subs != NULL; subs = subs->next)
+ for (Dwelf_Strent *subs = nodep->next; subs != NULL; subs = subs->next)
{
assert (subs->len < nodep->len);
subs->offset = nodep->offset + nodep->len - subs->len;
@@ -311,15 +313,15 @@
}
-void
-ebl_strtabfinalize (struct Ebl_Strtab *st, Elf_Data *data)
+Elf_Data *
+dwelf_strtab_finalize (Dwelf_Strtab *st, Elf_Data *data)
{
size_t nulllen = st->nullstr ? 1 : 0;
/* Fill in the information. */
data->d_buf = malloc (st->total + nulllen);
if (data->d_buf == NULL)
- abort ();
+ return NULL;
/* The first byte must always be zero if we created the table with a
null string. */
@@ -339,20 +341,20 @@
if (st->root)
copystrings (st->root, &endp, ©len);
assert (copylen == st->total + nulllen);
+
+ return data;
}
size_t
-ebl_strtaboffset (struct Ebl_Strent *se)
+dwelf_strent_off (Dwelf_Strent *se)
{
return se->offset;
}
const char *
-ebl_string (struct Ebl_Strent *se)
+dwelf_strent_str (Dwelf_Strent *se)
{
- assert (se->string != NULL);
-
return se->string;
}
diff --git a/libdwelf/libdwelf.h b/libdwelf/libdwelf.h
index 7f7f679..72089db 100644
--- a/libdwelf/libdwelf.h
+++ b/libdwelf/libdwelf.h
@@ -1,5 +1,5 @@
/* Interfaces for libdwelf. DWARF ELF Low-level Functions.
- Copyright (C) 2014, 2015 Red Hat, Inc.
+ Copyright (C) 2014, 2015, 2016 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -72,6 +72,59 @@
error occured -1 is returned and elf_errno is set. */
extern ssize_t dwelf_scn_gnu_compressed_size (Elf_Scn *scn);
+/* ELF/DWARF string table handling. */
+typedef struct Dwelf_Strtab Dwelf_Strtab;
+typedef struct Dwelf_Strent Dwelf_Strent;
+
+/* Create a new ELF/DWARF string table object in memory. ELF string
+ tables have a required zero length null string at offset zero.
+ DWARF string tables don't require such a null entry (unless they
+ are shared with an ELF string table). If NULLSTR is true then a
+ null entry is always created (even if the string table is empty
+ otherwise). */
+extern Dwelf_Strtab *dwelf_strtab_init (bool nullstr);
+
+/* Add string STR to string table ST. Returns NULL if no memory could
+ be allocated. The given STR is owned by the called and must be
+ valid till dwelf_strtab_free is called. dwelf_strtab_finalize
+ might copy the string into the final table and dwelf_strent_str
+ might return it, or a reference to an identical copy/substring
+ added to the string table. */
+extern Dwelf_Strent *dwelf_strtab_add (Dwelf_Strtab *st, const char *str)
+ __nonnull_attribute__ (1, 2);
+
+/* This is an optimized version of dwelf_strtab_add if the length of
+ the string is already known. LEN is the length of STR including
+ zero terminator. Calling dwelf_strtab_add (st, str) is similar to
+ calling dwelf_strtab_len (st, str, strlen (str) + 1). */
+extern Dwelf_Strent *dwelf_strtab_add_len (Dwelf_Strtab *st,
+ const char *str, size_t len)
+ __nonnull_attribute__ (1, 2);
+
+/* Finalize string table ST and store size and memory location
+ information in DATA d_size and d_buf. DATA d_type will be set to
+ ELF_T_BYTE, d_off will be zero, d_align will be 1 and d_version
+ will be set to EV_CURRENT. If no memory could be allocated NULL is
+ returned and DATA->d_buf will be set to NULL. Otherwise DATA will
+ be returned. */
+extern Elf_Data *dwelf_strtab_finalize (Dwelf_Strtab *st,
+ Elf_Data *data)
+ __nonnull_attribute__ (1, 2);
+
+/* Get offset in string table for string associated with entry. Only
+ valid after dwelf_strtab_finalize has been called. */
+extern size_t dwelf_strent_off (Dwelf_Strent *se)
+ __nonnull_attribute__ (1);
+
+/* Return the string associated with the entry. */
+extern const char *dwelf_strent_str (Dwelf_Strent *se)
+ __nonnull_attribute__ (1);
+
+/* Free resources allocated for the string table. This invalidates
+ any Dwelf_Strent references returned earlier. */
+extern void dwelf_strtab_free (Dwelf_Strtab *st)
+ __nonnull_attribute__ (1);
+
#ifdef __cplusplus
}
#endif
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index 94c58d9..acb4236 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,265 @@
+2018-06-04 Mark Wielaard <mark@klomp.org>
+
+ * libdwflP.h (__libdwfl_addrsym): Remove function declaration.
+ * dwfl_module_addrsym.c (__libdwfl_addrsym): Make a static function.
+
+2018-05-27 Mark Wielaard <mark@klomp.org>
+
+ * relocate.c (__libdwfl_relocate): Always call relocate_section with
+ partial true.
+
+2018-05-17 Mark Wielaard <mark@klomp.org>
+
+ * dwfl_module (__libdwfl_module_free): Free elfdir.
+ * dwfl_module_getdwarf.c (load_dw): Close file descriptors after
+ dwarf_begin_elf call. Set Dwarf debugdir if it is NULL, this is the
+ main module file and we recorded the elfdir.
+ * libdwflP.h (struct Dwfl_Module): Add elfdir field.
+ * offline.c (process_elf): Record the elfdir before we close the
+ main ELF file descriptor.
+
+2018-04-10 Mark Wielaard <mark@klomp.org>
+
+ * frame_unwind.c (unwind): If __libdwfl_frame_reg_get fails for
+ the return address either set an error or mark the pc undefined.
+
+2018-03-17 Mark Wielaard <mark@klomp.org>
+
+ * libdwflP.h (struct __libdwfl_remote_mem_cache): New.
+ (struct __libdwfl_pid_arg): Add mem_cache field.
+ * linux-pid-attach.c (read_cached_memory): New function.
+ (clear_cached_memory): Likewise.
+ (pid_memory_read): Call read_cached_memory.
+ (pid_detach): Free mem_cache.
+ (pid_thread_detach): Call clear_cached_memory.
+ (dwfl_linux_proc_attach): Initialize mem_cache to NULL.
+
+2018-03-05 Mark Wielaard <mark@klomp.org>
+
+ * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Use
+ realpath (name, NULL) instead of canonicalize_file_name (name).
+ * find-debuginfo.c (dwfl_standard_find_debuginfo): Likewise.
+
+2018-01-29 Mark Wielaard <mark@klomp.org>
+
+ * cu.c (cudie_offset): Use __libdw_first_die_off_from_cu instead of
+ DIE_OFFSET_FROM_CU_OFFSET.
+ (intern_cu): Simply use a copy of the given die CU as key instead of
+ trying to construct a dummy one by hand.
+
+2018-02-15 Mark Wielaard <mark@klomp.org>
+
+ * linux-pid-attach.c: Include sys/wait.h after sys/ptrace.h.
+
+2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
+
+ * dwfl_report_elf.c (__libdwfl_elf_address_range): Use FALLTHROUGH
+ macro instead of comment.
+ * frame_unwind.c (expr_eval): Likewise.
+
+2017-11-20 Mark Wielaard <mark@klomp.org>
+
+ * link_map.c (do_check64): Take a char * and calculate type and val
+ offsets before reading, possibly unaligned, values.
+ (do_check32): Likewise.
+ (check64): Remove define.
+ (check32): Likewise.
+ (auxv_format_probe): Call do_check32 and do_check64 directly with
+ a, possibly unaligned, auxv entry pointer.
+ (dwfl_link_map_report): Redefine AUXV_SCAN to not dereference a
+ possibly unaligned auxv entry pointer.
+
+2017-10-16 Mark Wielaard <mark@klomp.org>
+
+ * argp-std.c (parse_opt): For -k call argp_failure not failure to
+ keep dwfl around.
+
+2017-07-26 Yunlian Jiang <yunlian@google.com>
+
+ * argp-std.c (failure): Move to file scope.
+ (fail): Likewise.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+ Mark Wielaard <mark@klomp.org>
+
+ * derelocate.c (compare_secrefs): Compare by end address and then by
+ section number if addresses are equal.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+ Mark Wielaard <mark@klomp.org>
+
+ * linux-kernel-modules.c: Always return NULL from kernel_release() on
+ non-linux systems and set errno to ENOTSUP.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * libdwflP.h: Don't include config.h.
+ * argp-std.c: Include config.h.
+ * cu.c: Likewise.
+ * derelocate.c: Likewise.
+ * dwfl_addrdie.c: Likewise.
+ * dwfl_addrdwarf.c: Likewise.
+ * dwfl_addrmodule.c: Likewise.
+ * dwfl_begin.c: Likewise.
+ * dwfl_build_id_find_debuginfo.c: Likewise.
+ * dwfl_build_id_find_elf.c: Likewise.
+ * dwfl_cumodule.c: Likewise.
+ * dwfl_dwarf_line.c: Likewise.
+ * dwfl_end.c: Likewise.
+ * dwfl_frame.c: Likewise.
+ * dwfl_frame_regs.c: Likewise.
+ * dwfl_getdwarf.c: Likewise.
+ * dwfl_getmodules.c: Likewise.
+ * dwfl_getsrc.c: Likewise.
+ * dwfl_getsrclines.c: Likewise.
+ * dwfl_line_comp_dir.c: Likewise.
+ * dwfl_linecu.c: Likewise.
+ * dwfl_lineinfo.c: Likewise.
+ * dwfl_linemodule.c: Likewise.
+ * dwfl_module.c: Likewise.
+ * dwfl_module_addrdie.c: Likewise.
+ * dwfl_module_addrname.c: Likewise.
+ * dwfl_module_addrsym.c: Likewise.
+ * dwfl_module_build_id.c: Likewise.
+ * dwfl_module_dwarf_cfi.c: Likewise.
+ * dwfl_module_eh_cfi.c: Likewise.
+ * dwfl_module_getdarf.c: Likewise.
+ * dwfl_module_getelf.c: Likewise.
+ * dwfl_module_getsrc.c: Likewise.
+ * dwfl_module_getsrc_file.c: Likewise.
+ * dwfl_module_getsym.c: Likewise.
+ * dwfl_module_info.c: Likewise.
+ * dwfl_module_nextcu.c: Likewise.
+ * dwfl_module_register_names.c: Likewise.
+ * dwfl_module_report_build_id.c: Likewise.
+ * dwfl_module_return_value_location.c: Likewise.
+ * dwfl_nextcu.c: Likewise.
+ * dwfl_onesrcline.c: Likewise.
+ * dwfl_report_elf.c: Likewise.
+ * dwfl_validate_address.c: Likewise.
+ * dwfl_version.c: Likewise.
+ * find-debuginfo.c: Likewise.
+ * gzip.c: Likewise.
+ * image-header.c: Likewise.
+ * lines.c: Likewise.
+ * linux-core-attach.c: Likewise.
+ * linux-pid-attach.c: Likewise.
+ * offline.c: Likewise.
+ * open.c: Likewise.
+ * relocate.c: Likewise.
+ * segment.c: Likewise.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * libdwfl.h: Use __const_attribute__.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * elf-from-memory.c: Explicitly cast phnum to size_t.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * dwfl_module_getdwarf.c: Check shnum for 0 before subtracting from
+ it.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * dwfl_frame.c: Drop unused sys/ptrace.h include.
+ * frame_unwind.c: Likewise.
+ * linux-pid-attach.c: Include sys/ptrace.h and sys/syscall.h only on
+ linux.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * linux-kernel-modules.c: Include sys/types.h before fts.h
+
+2017-03-24 Mark Wielaard <mark@klomp.org>
+
+ * linux-core-attach.c (core_next_thread): If n_namesz == 0 then
+ the note name data is the empty string.
+ (dwfl_core_file_attach): Likewise.
+
+2017-02-15 Ulf Hermann <ulf.hermann@qt.io>
+
+ * linux-kernel-modules.c: Include system.h.
+
+2017-02-15 Ulf Hermann <ulf.hermann@qt.io>
+
+ * linux-kernel-modules.c: Use sysconf(_SC_PAGESIZE) to get page size.
+ * linux-proc-maps.c: Likewise.
+
+2016-12-29 Luiz Angelo Daros de Luca <luizluca@gmail.com>
+
+ * dwfl_build_id_find_elf.c: Include system.h.
+ * dwfl_module_getdwarf.c: Likewise.
+ * libdwfl_crc32_file.c: Don't define LIB_SYSTEM_H.
+
+2016-11-23 Mark Wielaard <mjw@redhat.com>
+
+ * linux-kernel-modules.c: Only include fts.h early if BAD_FTS is
+ defined.
+
+2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+
+ * core-file.c: Remove sys/param.h.
+ * dwfl_segment_report_module.c: Likewise. Add system.h include.
+ (MAX): Remove definition.
+ * frame_unwind.c: Add system.h include.
+ (MAX): Remove definition.
+ * linux-core-attach.c (MIN): Remove definition.
+ * linux-pid-attach.c (MAX): Likewise.
+
+2016-08-12 Mark Wielaard <mjw@redhat.com>
+
+ * link_map.c (dwfl_link_map_report): Fix assert, set in.d_size.
+
+2016-04-14 Mark Wielaard <mjw@redhat.com>
+
+ * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Free match
+ on invalid DWARF if we allocated it.
+
+2016-04-14 Mark Wielaard <mjw@redhat.com>
+
+ * linux-proc-maps.c (proc_maps_report): Free last_file on bad file
+ mapping.
+
+2016-03-01 Steven Chamberlain <steven@pyro.eu.org>
+
+ * linux-pid-attach.c: Removed unused pid_thread_callbacks,
+ pid_thread_detach, pid_detach, pid_set_initial_registers,
+ pid_memory_read, pid_getthread, pid_next_thread in #ifndef
+ __linux__ code.
+
+2016-02-22 Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
+ Mark Wielaard <mjw@redhat.com>
+
+ * find-debuginfo.c (find_debuginfo_in_path): Remember whether
+ debuglink_file is NULL. Try file basename (without .debug) ofr
+ absolute and relative path if debug_file was NULL.
+ * linux-kernel-modules.c (try_kernel_name): If try_debug is true call
+ dwfl_standard_find_debuginfo with NULL debuglink_file, otherwise with
+ basename of fname.
+
+2016-02-13 Mark Wielaard <mjw@redhat.com>
+
+ * linux-proc-maps.c (proc_maps_report): Free last_file when ENOEXEC.
+
+2016-02-13 Mark Wielaard <mjw@redhat.com>
+
+ * frame_unwind.c (new_unwound): Check and return unwound.
+ (handle_cfi): Check new_unwound was able to allocate new memory
+ before use. Return DWFL_E_NOMEM otherwise.
+
+2016-02-11 Mark Wielaard <mjw@redhat.com>
+
+ * relocate.c (relocate_section): Check result of all gelf_get* calls.
+ (__libdwfl_relocate): Likewise.
+ (__libdwfl_relocate_section): Likewise.
+
+2016-02-11 Mark Wielaard <mjw@redhat.com>
+
+ * relocate.c (relocate_section): Check result of gelf_update_* calls.
+
2016-01-08 Mark Wielaard <mjw@redhat.com>
* libdwfl_a_SOURCES: Unconditionally add gzip.c.
diff --git a/libdwfl/argp-std.c b/libdwfl/argp-std.c
index 501530a..8ee9158 100644
--- a/libdwfl/argp-std.c
+++ b/libdwfl/argp-std.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#include <argp.h>
#include <stdlib.h>
@@ -100,25 +104,28 @@
const char *core;
};
+static inline void
+failure (Dwfl *dwfl, int errnum, const char *msg, struct argp_state *state)
+{
+ if (dwfl != NULL)
+ dwfl_end (dwfl);
+ if (errnum == -1)
+ argp_failure (state, EXIT_FAILURE, 0, "%s: %s",
+ msg, INTUSE(dwfl_errmsg) (-1));
+ else
+ argp_failure (state, EXIT_FAILURE, errnum, "%s", msg);
+}
+
+static inline error_t
+fail (Dwfl *dwfl, int errnum, const char *msg, struct argp_state *state)
+{
+ failure (dwfl, errnum, msg, state);
+ return errnum == -1 ? EIO : errnum;
+}
+
static error_t
parse_opt (int key, char *arg, struct argp_state *state)
{
- inline void failure (Dwfl *dwfl, int errnum, const char *msg)
- {
- if (dwfl != NULL)
- dwfl_end (dwfl);
- if (errnum == -1)
- argp_failure (state, EXIT_FAILURE, 0, "%s: %s",
- msg, INTUSE(dwfl_errmsg) (-1));
- else
- argp_failure (state, EXIT_FAILURE, errnum, "%s", msg);
- }
- inline error_t fail (Dwfl *dwfl, int errnum, const char *msg)
- {
- failure (dwfl, errnum, msg);
- return errnum == -1 ? EIO : errnum;
- }
-
switch (key)
{
case ARGP_KEY_INIT:
@@ -126,7 +133,7 @@
assert (state->hook == NULL);
struct parse_opt *opt = calloc (1, sizeof (*opt));
if (opt == NULL)
- failure (NULL, DWFL_E_ERRNO, "calloc");
+ failure (NULL, DWFL_E_ERRNO, "calloc", state);
state->hook = opt;
}
break;
@@ -143,7 +150,7 @@
{
dwfl = INTUSE(dwfl_begin) (&offline_callbacks);
if (dwfl == NULL)
- return fail (dwfl, -1, arg);
+ return fail (dwfl, -1, arg, state);
opt->dwfl = dwfl;
/* Start at zero so if there is just one -e foo.so,
@@ -169,7 +176,7 @@
Dwfl *dwfl = INTUSE(dwfl_begin) (&proc_callbacks);
int result = INTUSE(dwfl_linux_proc_report) (dwfl, atoi (arg));
if (result != 0)
- return fail (dwfl, result, arg);
+ return fail (dwfl, result, arg, state);
/* Non-fatal to not be able to attach to process, ignore error. */
INTUSE(dwfl_linux_proc_attach) (dwfl, atoi (arg), false);
@@ -198,7 +205,7 @@
int result = INTUSE(dwfl_linux_proc_maps_report) (dwfl, f);
fclose (f);
if (result != 0)
- return fail (dwfl, result, arg);
+ return fail (dwfl, result, arg, state);
opt->dwfl = dwfl;
}
else
@@ -227,11 +234,11 @@
Dwfl *dwfl = INTUSE(dwfl_begin) (&kernel_callbacks);
int result = INTUSE(dwfl_linux_kernel_report_kernel) (dwfl);
if (result != 0)
- return fail (dwfl, result, _("cannot load kernel symbols"));
+ return fail (dwfl, result, _("cannot load kernel symbols"), state);
result = INTUSE(dwfl_linux_kernel_report_modules) (dwfl);
if (result != 0)
/* Non-fatal to have no modules since we do have the kernel. */
- failure (dwfl, result, _("cannot find kernel modules"));
+ argp_failure (state, 0, result, _("cannot find kernel modules"));
opt->dwfl = dwfl;
}
else
@@ -248,7 +255,7 @@
int result = INTUSE(dwfl_linux_kernel_report_offline) (dwfl, arg,
NULL);
if (result != 0)
- return fail (dwfl, result, _("cannot find kernel or modules"));
+ return fail (dwfl, result, _("cannot find kernel or modules"), state);
opt->dwfl = dwfl;
}
else
@@ -267,7 +274,7 @@
arg = "a.out";
dwfl = INTUSE(dwfl_begin) (&offline_callbacks);
if (INTUSE(dwfl_report_offline) (dwfl, "", arg, -1) == NULL)
- return fail (dwfl, -1, arg);
+ return fail (dwfl, -1, arg, state);
opt->dwfl = dwfl;
}
@@ -297,7 +304,7 @@
{
elf_end (core);
close (fd);
- return fail (dwfl, result, opt->core);
+ return fail (dwfl, result, opt->core, state);
}
/* Non-fatal to not be able to attach to core, ignore error. */
@@ -327,7 +334,7 @@
else if (opt->e)
{
if (INTUSE(dwfl_report_offline) (dwfl, "", opt->e, -1) == NULL)
- return fail (dwfl, -1, opt->e);
+ return fail (dwfl, -1, opt->e, state);
}
/* One of the three flavors has done dwfl_begin and some reporting
diff --git a/libdwfl/core-file.c b/libdwfl/core-file.c
index 67684c9..84cb89a 100644
--- a/libdwfl/core-file.c
+++ b/libdwfl/core-file.c
@@ -32,7 +32,6 @@
#include "libdwflP.h"
#include <gelf.h>
-#include <sys/param.h>
#include <unistd.h>
#include <endian.h>
#include <byteswap.h>
diff --git a/libdwfl/cu.c b/libdwfl/cu.c
index 5182054..94bfad8 100644
--- a/libdwfl/cu.c
+++ b/libdwfl/cu.c
@@ -1,5 +1,5 @@
/* Keeping track of DWARF compilation units in libdwfl.
- Copyright (C) 2005-2010, 2015 Red Hat, Inc.
+ Copyright (C) 2005-2010, 2015, 2016, 2017 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#include "../libdw/libdwP.h"
#include "../libdw/memory-access.h"
@@ -151,12 +155,7 @@
static inline Dwarf_Off
cudie_offset (const struct dwfl_cu *cu)
{
- /* These are real CUs, so there never is a type_sig8. Note
- initialization of dwkey.start and offset_size in intern_cu ()
- to see why this calculates the same value for both key and
- die.cu search items. */
- return DIE_OFFSET_FROM_CU_OFFSET (cu->die.cu->start, cu->die.cu->offset_size,
- 0);
+ return __libdw_first_die_off_from_cu (cu->die.cu);
}
static int
@@ -194,11 +193,8 @@
if (die == NULL)
return DWFL_E_LIBDW;
- struct Dwarf_CU dwkey;
struct dwfl_cu key;
- key.die.cu = &dwkey;
- dwkey.offset_size = 0;
- dwkey.start = cuoff - (3 * 0 - 4 + 3);
+ key.die.cu = die->cu;
struct dwfl_cu **found = tsearch (&key, &mod->lazy_cu_root, &compare_cukey);
if (unlikely (found == NULL))
return DWFL_E_NOMEM;
diff --git a/libdwfl/derelocate.c b/libdwfl/derelocate.c
index 439a24e..2f80b20 100644
--- a/libdwfl/derelocate.c
+++ b/libdwfl/derelocate.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
struct dwfl_relocation
@@ -63,7 +67,13 @@
if ((*p1)->start > (*p2)->start)
return 1;
- return 0;
+ if ((*p1)->end < (*p2)->end)
+ return -1;
+ if ((*p1)->end > (*p2)->end)
+ return 1;
+
+ /* Same start/end, then just compare which section came first. */
+ return elf_ndxscn ((*p1)->scn) - elf_ndxscn ((*p2)->scn);
}
static int
diff --git a/libdwfl/dwfl_addrdie.c b/libdwfl/dwfl_addrdie.c
index 1e9b3ab..c5b1d68 100644
--- a/libdwfl/dwfl_addrdie.c
+++ b/libdwfl/dwfl_addrdie.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
Dwarf_Die *
diff --git a/libdwfl/dwfl_addrdwarf.c b/libdwfl/dwfl_addrdwarf.c
index ba412ec..4f9efab 100644
--- a/libdwfl/dwfl_addrdwarf.c
+++ b/libdwfl/dwfl_addrdwarf.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
Dwarf *
diff --git a/libdwfl/dwfl_addrmodule.c b/libdwfl/dwfl_addrmodule.c
index 9234eb7..abf1ff4 100644
--- a/libdwfl/dwfl_addrmodule.c
+++ b/libdwfl/dwfl_addrmodule.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
Dwfl_Module *
diff --git a/libdwfl/dwfl_begin.c b/libdwfl/dwfl_begin.c
index 44c16a9..b03f5cf 100644
--- a/libdwfl/dwfl_begin.c
+++ b/libdwfl/dwfl_begin.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
Dwfl *
diff --git a/libdwfl/dwfl_build_id_find_debuginfo.c b/libdwfl/dwfl_build_id_find_debuginfo.c
index f1c64bc..273e5e5 100644
--- a/libdwfl/dwfl_build_id_find_debuginfo.c
+++ b/libdwfl/dwfl_build_id_find_debuginfo.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#include <unistd.h>
diff --git a/libdwfl/dwfl_build_id_find_elf.c b/libdwfl/dwfl_build_id_find_elf.c
index 903e193..cc6c3f6 100644
--- a/libdwfl/dwfl_build_id_find_elf.c
+++ b/libdwfl/dwfl_build_id_find_elf.c
@@ -26,10 +26,15 @@
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 "libdwflP.h"
#include <inttypes.h>
#include <fcntl.h>
#include <unistd.h>
+#include "system.h"
int
@@ -94,7 +99,7 @@
{
if (*file_name != NULL)
free (*file_name);
- *file_name = canonicalize_file_name (name);
+ *file_name = realpath (name, NULL);
if (*file_name == NULL)
{
*file_name = name;
diff --git a/libdwfl/dwfl_cumodule.c b/libdwfl/dwfl_cumodule.c
index c5cf004..2b593f2 100644
--- a/libdwfl/dwfl_cumodule.c
+++ b/libdwfl/dwfl_cumodule.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
Dwfl_Module *
diff --git a/libdwfl/dwfl_dwarf_line.c b/libdwfl/dwfl_dwarf_line.c
index e96f859..e22e984 100644
--- a/libdwfl/dwfl_dwarf_line.c
+++ b/libdwfl/dwfl_dwarf_line.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#include "../libdw/libdwP.h"
diff --git a/libdwfl/dwfl_end.c b/libdwfl/dwfl_end.c
index 0b35bd2..74ee9e0 100644
--- a/libdwfl/dwfl_end.c
+++ b/libdwfl/dwfl_end.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#include <unistd.h>
diff --git a/libdwfl/dwfl_frame.c b/libdwfl/dwfl_frame.c
index d639939..881f735 100644
--- a/libdwfl/dwfl_frame.c
+++ b/libdwfl/dwfl_frame.c
@@ -26,8 +26,11 @@
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 "libdwflP.h"
-#include <sys/ptrace.h>
#include <unistd.h>
/* Set STATE->pc_set from STATE->regs according to the backend. Return true on
diff --git a/libdwfl/dwfl_frame_regs.c b/libdwfl/dwfl_frame_regs.c
index 10803fe..83b1abe 100644
--- a/libdwfl/dwfl_frame_regs.c
+++ b/libdwfl/dwfl_frame_regs.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
bool
diff --git a/libdwfl/dwfl_getdwarf.c b/libdwfl/dwfl_getdwarf.c
index 8d1d9ba..edd088e 100644
--- a/libdwfl/dwfl_getdwarf.c
+++ b/libdwfl/dwfl_getdwarf.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
struct module_callback_info
diff --git a/libdwfl/dwfl_getmodules.c b/libdwfl/dwfl_getmodules.c
index eed9b4f..243cb04 100644
--- a/libdwfl/dwfl_getmodules.c
+++ b/libdwfl/dwfl_getmodules.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
ptrdiff_t
diff --git a/libdwfl/dwfl_getsrc.c b/libdwfl/dwfl_getsrc.c
index 8d4ae02..d853aed 100644
--- a/libdwfl/dwfl_getsrc.c
+++ b/libdwfl/dwfl_getsrc.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
Dwfl_Line *
diff --git a/libdwfl/dwfl_getsrclines.c b/libdwfl/dwfl_getsrclines.c
index bdfcf5c..1ce78fc 100644
--- a/libdwfl/dwfl_getsrclines.c
+++ b/libdwfl/dwfl_getsrclines.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
int
diff --git a/libdwfl/dwfl_line_comp_dir.c b/libdwfl/dwfl_line_comp_dir.c
index bda09c4..77c3fdf 100644
--- a/libdwfl/dwfl_line_comp_dir.c
+++ b/libdwfl/dwfl_line_comp_dir.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#include <dwarf.h>
diff --git a/libdwfl/dwfl_linecu.c b/libdwfl/dwfl_linecu.c
index ce78d29..2043b17 100644
--- a/libdwfl/dwfl_linecu.c
+++ b/libdwfl/dwfl_linecu.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#undef dwfl_linecu
diff --git a/libdwfl/dwfl_lineinfo.c b/libdwfl/dwfl_lineinfo.c
index 7ddbfb0..9618712 100644
--- a/libdwfl/dwfl_lineinfo.c
+++ b/libdwfl/dwfl_lineinfo.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#include "../libdw/libdwP.h"
diff --git a/libdwfl/dwfl_linemodule.c b/libdwfl/dwfl_linemodule.c
index e4a35e0..d243f0d 100644
--- a/libdwfl/dwfl_linemodule.c
+++ b/libdwfl/dwfl_linemodule.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
Dwfl_Module *
diff --git a/libdwfl/dwfl_module.c b/libdwfl/dwfl_module.c
index 515092f..e7dfdac 100644
--- a/libdwfl/dwfl_module.c
+++ b/libdwfl/dwfl_module.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#include "../libdw/cfi.h"
#include <search.h>
@@ -116,6 +120,7 @@
free (mod->reloc_info);
free (mod->name);
+ free (mod->elfdir);
free (mod);
}
diff --git a/libdwfl/dwfl_module_addrdie.c b/libdwfl/dwfl_module_addrdie.c
index 20d2842..b44ec13 100644
--- a/libdwfl/dwfl_module_addrdie.c
+++ b/libdwfl/dwfl_module_addrdie.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
Dwarf_Die *
diff --git a/libdwfl/dwfl_module_addrname.c b/libdwfl/dwfl_module_addrname.c
index 88a8139..3142b3e 100644
--- a/libdwfl/dwfl_module_addrname.c
+++ b/libdwfl/dwfl_module_addrname.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
const char *
diff --git a/libdwfl/dwfl_module_addrsym.c b/libdwfl/dwfl_module_addrsym.c
index 5a7bf71..2336b60 100644
--- a/libdwfl/dwfl_module_addrsym.c
+++ b/libdwfl/dwfl_module_addrsym.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
struct search_state
@@ -231,9 +235,12 @@
}
/* Returns the name of the symbol "closest" to ADDR.
- Never returns symbols at addresses above ADDR. */
-const char *
-internal_function
+ Never returns symbols at addresses above ADDR.
+
+ Wrapper for old dwfl_module_addrsym and new dwfl_module_addrinfo.
+ adjust_st_value set to true returns adjusted SYM st_value, set to false
+ it will not adjust SYM at all, but does match against resolved values. */
+static const char *
__libdwfl_addrsym (Dwfl_Module *_mod, GElf_Addr _addr, GElf_Off *off,
GElf_Sym *_closest_sym, GElf_Word *shndxp,
Elf **elfp, Dwarf_Addr *biasp, bool _adjust_st_value)
diff --git a/libdwfl/dwfl_module_build_id.c b/libdwfl/dwfl_module_build_id.c
index c9a42ca..6ca9376 100644
--- a/libdwfl/dwfl_module_build_id.c
+++ b/libdwfl/dwfl_module_build_id.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
static int
diff --git a/libdwfl/dwfl_module_dwarf_cfi.c b/libdwfl/dwfl_module_dwarf_cfi.c
index 1dac26d..0e5b435 100644
--- a/libdwfl/dwfl_module_dwarf_cfi.c
+++ b/libdwfl/dwfl_module_dwarf_cfi.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#include "../libdw/cfi.h"
diff --git a/libdwfl/dwfl_module_eh_cfi.c b/libdwfl/dwfl_module_eh_cfi.c
index dbe43b0..c296e39 100644
--- a/libdwfl/dwfl_module_eh_cfi.c
+++ b/libdwfl/dwfl_module_eh_cfi.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#include "../libdw/cfi.h"
diff --git a/libdwfl/dwfl_module_getdwarf.c b/libdwfl/dwfl_module_getdwarf.c
index 0e8810b..af6838a 100644
--- a/libdwfl/dwfl_module_getdwarf.c
+++ b/libdwfl/dwfl_module_getdwarf.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#include <inttypes.h>
#include <fcntl.h>
@@ -33,6 +37,7 @@
#include <unistd.h>
#include "../libdw/libdwP.h" /* DWARF_E_* values are here. */
#include "../libelf/libelfP.h"
+#include "system.h"
static inline Dwfl_Error
open_elf_file (Elf **elf, int *fd, char **name)
@@ -348,12 +353,14 @@
/* Since prelink does not store the zeroth section header in the undo
section, it cannot support SHN_XINDEX encoding. */
- if (unlikely (shnum >= SHN_LORESERVE)
+ if (unlikely (shnum >= SHN_LORESERVE) || unlikely(shnum == 0)
|| unlikely (undodata->d_size != (src.d_size
+ phnum * phentsize
+ (shnum - 1) * shentsize)))
return DWFL_E_BAD_PRELINK;
+ --shnum;
+
/* We look at the allocated SHT_PROGBITS (or SHT_NOBITS) sections. (Most
every file will have some SHT_PROGBITS sections, but it's possible to
have one with nothing but .bss, i.e. SHT_NOBITS.) The special sections
@@ -430,12 +437,12 @@
src.d_buf += src.d_size;
src.d_type = ELF_T_SHDR;
- src.d_size = gelf_fsize (mod->main.elf, ELF_T_SHDR, shnum - 1, EV_CURRENT);
+ src.d_size = gelf_fsize (mod->main.elf, ELF_T_SHDR, shnum, EV_CURRENT);
size_t shdr_size = class32 ? sizeof (Elf32_Shdr) : sizeof (Elf64_Shdr);
- if (unlikely (shnum - 1 > SIZE_MAX / shdr_size))
+ if (unlikely (shnum > SIZE_MAX / shdr_size))
return DWFL_E_NOMEM;
- const size_t shdrs_bytes = (shnum - 1) * shdr_size;
+ const size_t shdrs_bytes = shnum * shdr_size;
void *shdrs = malloc (shdrs_bytes);
if (unlikely (shdrs == NULL))
return DWFL_E_NOMEM;
@@ -487,16 +494,16 @@
highest = 0;
if (class32)
{
- Elf32_Shdr (*s32)[shnum - 1] = shdrs;
- for (size_t i = 0; i < shnum - 1; ++i)
+ Elf32_Shdr (*s32)[shnum] = shdrs;
+ for (size_t i = 0; i < shnum; ++i)
consider_shdr (undo_interp, (*s32)[i].sh_type,
(*s32)[i].sh_flags, (*s32)[i].sh_addr,
(*s32)[i].sh_size, &highest);
}
else
{
- Elf64_Shdr (*s64)[shnum - 1] = shdrs;
- for (size_t i = 0; i < shnum - 1; ++i)
+ Elf64_Shdr (*s64)[shnum] = shdrs;
+ for (size_t i = 0; i < shnum; ++i)
consider_shdr (undo_interp, (*s64)[i].sh_type,
(*s64)[i].sh_flags, (*s64)[i].sh_addr,
(*s64)[i].sh_size, &highest);
@@ -1328,7 +1335,18 @@
result = __libdwfl_relocate (mod, debugfile->elf, true);
if (result != DWFL_E_NOERROR)
return result;
+ }
+ mod->dw = INTUSE(dwarf_begin_elf) (debugfile->elf, DWARF_C_READ, NULL);
+ if (mod->dw == NULL)
+ {
+ int err = INTUSE(dwarf_errno) ();
+ return err == DWARF_E_NO_DWARF ? DWFL_E_NO_DWARF : DWFL_E (LIBDW, err);
+ }
+
+ /* Do this after dwarf_begin_elf has a chance to process the fd. */
+ if (mod->e_type == ET_REL && !debugfile->relocated)
+ {
/* Don't keep the file descriptors around. */
if (mod->main.fd != -1 && elf_cntl (mod->main.elf, ELF_C_FDREAD) == 0)
{
@@ -1342,12 +1360,12 @@
}
}
- mod->dw = INTUSE(dwarf_begin_elf) (debugfile->elf, DWARF_C_READ, NULL);
- if (mod->dw == NULL)
- {
- int err = INTUSE(dwarf_errno) ();
- return err == DWARF_E_NO_DWARF ? DWFL_E_NO_DWARF : DWFL_E (LIBDW, err);
- }
+ /* We might have already closed the fd when we asked dwarf_begin_elf to
+ create an Dwarf. Help out a little in case we need to find an alt or
+ dwo file later. */
+ if (mod->dw->debugdir == NULL && mod->elfdir != NULL
+ && debugfile == &mod->main)
+ mod->dw->debugdir = strdup (mod->elfdir);
/* Until we have iterated through all CU's, we might do lazy lookups. */
mod->lazycu = 1;
diff --git a/libdwfl/dwfl_module_getelf.c b/libdwfl/dwfl_module_getelf.c
index f20fb04..6358de4 100644
--- a/libdwfl/dwfl_module_getelf.c
+++ b/libdwfl/dwfl_module_getelf.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
Elf *
diff --git a/libdwfl/dwfl_module_getsrc.c b/libdwfl/dwfl_module_getsrc.c
index f7e340b..fc99b16 100644
--- a/libdwfl/dwfl_module_getsrc.c
+++ b/libdwfl/dwfl_module_getsrc.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#include "../libdw/libdwP.h"
diff --git a/libdwfl/dwfl_module_getsrc_file.c b/libdwfl/dwfl_module_getsrc_file.c
index 21a5915..cea2ba4 100644
--- a/libdwfl/dwfl_module_getsrc_file.c
+++ b/libdwfl/dwfl_module_getsrc_file.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#include "../libdw/libdwP.h"
@@ -87,6 +91,8 @@
if (unlikely (line->file >= line->files->nfiles))
{
+ if (*nsrcs == 0)
+ free (match);
__libdwfl_seterrno (DWFL_E (LIBDW, DWARF_E_INVALID_DWARF));
return -1;
}
diff --git a/libdwfl/dwfl_module_getsym.c b/libdwfl/dwfl_module_getsym.c
index 42d2b67..8de9a3e 100644
--- a/libdwfl/dwfl_module_getsym.c
+++ b/libdwfl/dwfl_module_getsym.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
const char *
diff --git a/libdwfl/dwfl_module_info.c b/libdwfl/dwfl_module_info.c
index df16be4..af1faab 100644
--- a/libdwfl/dwfl_module_info.c
+++ b/libdwfl/dwfl_module_info.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
const char *
diff --git a/libdwfl/dwfl_module_nextcu.c b/libdwfl/dwfl_module_nextcu.c
index 6f81f4c..32ee6bc 100644
--- a/libdwfl/dwfl_module_nextcu.c
+++ b/libdwfl/dwfl_module_nextcu.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
Dwarf_Die *
diff --git a/libdwfl/dwfl_module_register_names.c b/libdwfl/dwfl_module_register_names.c
index 18fed37..9ea0937 100644
--- a/libdwfl/dwfl_module_register_names.c
+++ b/libdwfl/dwfl_module_register_names.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
diff --git a/libdwfl/dwfl_module_report_build_id.c b/libdwfl/dwfl_module_report_build_id.c
index b41512b..31e17c8 100644
--- a/libdwfl/dwfl_module_report_build_id.c
+++ b/libdwfl/dwfl_module_report_build_id.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
// XXX vs report changed module: punting old file
diff --git a/libdwfl/dwfl_module_return_value_location.c b/libdwfl/dwfl_module_return_value_location.c
index 29da61f..ff6f56f 100644
--- a/libdwfl/dwfl_module_return_value_location.c
+++ b/libdwfl/dwfl_module_return_value_location.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
diff --git a/libdwfl/dwfl_nextcu.c b/libdwfl/dwfl_nextcu.c
index 9ea8388..64bd521 100644
--- a/libdwfl/dwfl_nextcu.c
+++ b/libdwfl/dwfl_nextcu.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
Dwarf_Die *
diff --git a/libdwfl/dwfl_onesrcline.c b/libdwfl/dwfl_onesrcline.c
index 4c20d65..b1e7055 100644
--- a/libdwfl/dwfl_onesrcline.c
+++ b/libdwfl/dwfl_onesrcline.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
Dwfl_Line *
diff --git a/libdwfl/dwfl_report_elf.c b/libdwfl/dwfl_report_elf.c
index 1c6e401..3fc9384 100644
--- a/libdwfl/dwfl_report_elf.c
+++ b/libdwfl/dwfl_report_elf.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#include <fcntl.h>
#include <unistd.h>
@@ -170,7 +174,7 @@
/* An assigned base address is meaningless for these. */
base = 0;
add_p_vaddr = true;
-
+ FALLTHROUGH;
case ET_DYN:
default:;
size_t phnum;
diff --git a/libdwfl/dwfl_segment_report_module.c b/libdwfl/dwfl_segment_report_module.c
index 40553c9..207a257 100644
--- a/libdwfl/dwfl_segment_report_module.c
+++ b/libdwfl/dwfl_segment_report_module.c
@@ -35,11 +35,12 @@
#include <elf.h>
#include <gelf.h>
#include <inttypes.h>
-#include <sys/param.h>
#include <endian.h>
#include <unistd.h>
#include <fcntl.h>
+#include <system.h>
+
/* A good size for the initial read from memory, if it's not too costly.
This more than covers the phdrs and note segment in the average 64-bit
@@ -53,10 +54,6 @@
# define MY_ELFDATA ELFDATA2MSB
#endif
-#ifndef MAX
-# define MAX(a, b) ((a) > (b) ? (a) : (b))
-#endif
-
/* Return user segment index closest to ADDR but not above it.
If NEXT, return the closest to ADDR but not below it. */
diff --git a/libdwfl/dwfl_validate_address.c b/libdwfl/dwfl_validate_address.c
index 7334c3e..15e2602 100644
--- a/libdwfl/dwfl_validate_address.c
+++ b/libdwfl/dwfl_validate_address.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
int
diff --git a/libdwfl/dwfl_version.c b/libdwfl/dwfl_version.c
index d1c5d91..c27d4f6 100644
--- a/libdwfl/dwfl_version.c
+++ b/libdwfl/dwfl_version.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
const char *
diff --git a/libdwfl/elf-from-memory.c b/libdwfl/elf-from-memory.c
index dd42e95..12a0a1b 100644
--- a/libdwfl/elf-from-memory.c
+++ b/libdwfl/elf-from-memory.c
@@ -172,7 +172,7 @@
{
/* Read in the program headers. */
- if (initial_bufsize < phnum * phentsize)
+ if (initial_bufsize < (size_t)phnum * phentsize)
{
unsigned char *newbuf = realloc (buffer, phnum * phentsize);
if (newbuf == NULL)
diff --git a/libdwfl/find-debuginfo.c b/libdwfl/find-debuginfo.c
index 72461bc..9267788 100644
--- a/libdwfl/find-debuginfo.c
+++ b/libdwfl/find-debuginfo.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#include <stdio.h>
#include <fcntl.h>
@@ -163,7 +167,11 @@
const char *file_basename = file_name == NULL ? NULL : basename (file_name);
char *localname = NULL;
- if (debuglink_file == NULL)
+
+ /* We invent a debuglink .debug name if NULL, but then want to try the
+ basename too. */
+ bool debuglink_null = debuglink_file == NULL;
+ if (debuglink_null)
{
/* For a alt debug multi file we need a name, for a separate debug
name we may be able to fall back on file_basename.debug. */
@@ -231,6 +239,10 @@
check = *p++ == '+';
check = check && cancheck;
+ /* Try the basename too, if we made up the debuglink name and this
+ is not the main directory. */
+ bool try_file_basename;
+
const char *dir, *subdir, *file;
switch (p[0])
{
@@ -239,6 +251,7 @@
dir = file_dirname;
subdir = NULL;
file = debuglink_file;
+ try_file_basename = false;
break;
case '/':
/* An absolute path says to look there for a subdirectory
@@ -268,6 +281,7 @@
subdir = NULL;
file = basename (debuglink_file);
}
+ try_file_basename = debuglink_null;
break;
default:
/* A relative path says to try a subdirectory of that name
@@ -275,11 +289,14 @@
dir = file_dirname;
subdir = p;
file = debuglink_file;
+ try_file_basename = debuglink_null;
break;
}
char *fname = NULL;
int fd = try_open (&main_stat, dir, subdir, file, &fname);
+ if (fd < 0 && try_file_basename)
+ fd = try_open (&main_stat, dir, subdir, file_basename, &fname);
if (fd < 0)
switch (errno)
{
@@ -372,7 +389,7 @@
/* If FILE_NAME is a symlink, the debug file might be associated
with the symlink target name instead. */
- char *canon = canonicalize_file_name (file_name);
+ char *canon = realpath (file_name, NULL);
if (canon != NULL && strcmp (file_name, canon))
fd = find_debuginfo_in_path (mod, canon,
debuglink_file, debuglink_crc,
diff --git a/libdwfl/frame_unwind.c b/libdwfl/frame_unwind.c
index 0e470b9..8da691e 100644
--- a/libdwfl/frame_unwind.c
+++ b/libdwfl/frame_unwind.c
@@ -1,5 +1,5 @@
/* Get previous frame state for an existing frame state.
- Copyright (C) 2013, 2014 Red Hat, Inc.
+ Copyright (C) 2013, 2014, 2016 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -34,7 +34,7 @@
#include <stdlib.h>
#include "libdwflP.h"
#include "../libdw/dwarf.h"
-#include <sys/ptrace.h>
+#include <system.h>
/* Maximum number of DWARF expression stack slots before returning an error. */
#define DWARF_EXPR_STACK_MAX 0x100
@@ -43,10 +43,6 @@
error. */
#define DWARF_EXPR_STEPS_MAX 0x1000
-#ifndef MAX
-# define MAX(a, b) ((a) > (b) ? (a) : (b))
-#endif
-
bool
internal_function
__libdwfl_frame_reg_get (Dwfl_Frame *state, unsigned regno, Dwarf_Addr *val)
@@ -446,7 +442,7 @@
}
if (val1 == 0)
break;
- /* FALLTHRU */
+ FALLTHROUGH;
case DW_OP_skip:;
Dwarf_Word offset = op->offset + 1 + 2 + (int16_t) op->number;
const Dwarf_Op *found = bsearch ((void *) (uintptr_t) offset, ops, nops,
@@ -511,7 +507,7 @@
#undef pop
}
-static void
+static Dwfl_Frame *
new_unwound (Dwfl_Frame *state)
{
assert (state->unwound == NULL);
@@ -522,6 +518,8 @@
assert (nregs > 0);
Dwfl_Frame *unwound;
unwound = malloc (sizeof (*unwound) + sizeof (*unwound->regs) * nregs);
+ if (unlikely (unwound == NULL))
+ return NULL;
state->unwound = unwound;
unwound->thread = thread;
unwound->unwound = NULL;
@@ -529,6 +527,7 @@
unwound->initial_frame = false;
unwound->pc_state = DWFL_FRAME_STATE_ERROR;
memset (unwound->regs_set, 0, sizeof (unwound->regs_set));
+ return unwound;
}
/* The logic is to call __libdwfl_seterrno for any CFI bytecode interpretation
@@ -545,8 +544,14 @@
__libdwfl_seterrno (DWFL_E_LIBDW);
return;
}
- new_unwound (state);
- Dwfl_Frame *unwound = state->unwound;
+
+ Dwfl_Frame *unwound = new_unwound (state);
+ if (unwound == NULL)
+ {
+ __libdwfl_seterrno (DWFL_E_NOMEM);
+ return;
+ }
+
unwound->signal_frame = frame->fde->cie->signal_frame;
Dwfl_Thread *thread = state->thread;
Dwfl_Process *process = thread->process;
@@ -627,24 +632,38 @@
ra_set = true;
}
}
- if (unwound->pc_state == DWFL_FRAME_STATE_ERROR
- && __libdwfl_frame_reg_get (unwound,
- frame->fde->cie->return_address_register,
- &unwound->pc))
+ if (unwound->pc_state == DWFL_FRAME_STATE_ERROR)
{
- /* PPC32 __libc_start_main properly CFI-unwinds PC as zero. Currently
- none of the archs supported for unwinding have zero as a valid PC. */
- if (unwound->pc == 0)
- unwound->pc_state = DWFL_FRAME_STATE_PC_UNDEFINED;
+ if (__libdwfl_frame_reg_get (unwound,
+ frame->fde->cie->return_address_register,
+ &unwound->pc))
+ {
+ /* PPC32 __libc_start_main properly CFI-unwinds PC as zero.
+ Currently none of the archs supported for unwinding have
+ zero as a valid PC. */
+ if (unwound->pc == 0)
+ unwound->pc_state = DWFL_FRAME_STATE_PC_UNDEFINED;
+ else
+ {
+ unwound->pc_state = DWFL_FRAME_STATE_PC_SET;
+ /* In SPARC the return address register actually contains
+ the address of the call instruction instead of the return
+ address. Therefore we add here an offset defined by the
+ backend. Most likely 0. */
+ unwound->pc += ebl_ra_offset (ebl);
+ }
+ }
else
- {
- unwound->pc_state = DWFL_FRAME_STATE_PC_SET;
- /* In SPARC the return address register actually contains
- the address of the call instruction instead of the return
- address. Therefore we add here an offset defined by the
- backend. Most likely 0. */
- unwound->pc += ebl_ra_offset (ebl);
- }
+ {
+ /* We couldn't set the return register, either it was bogus,
+ or the return pc is undefined, maybe end of call stack. */
+ unsigned pcreg = frame->fde->cie->return_address_register;
+ if (! ebl_dwarf_to_regno (ebl, &pcreg)
+ || pcreg >= ebl_frame_nregs (ebl))
+ __libdwfl_seterrno (DWFL_E_INVALID_REGISTER);
+ else
+ unwound->pc_state = DWFL_FRAME_STATE_PC_UNDEFINED;
+ }
}
free (frame);
}
@@ -730,7 +749,11 @@
Dwfl_Thread *thread = state->thread;
Dwfl_Process *process = thread->process;
Ebl *ebl = process->ebl;
- new_unwound (state);
+ if (new_unwound (state) == NULL)
+ {
+ __libdwfl_seterrno (DWFL_E_NOMEM);
+ return;
+ }
state->unwound->pc_state = DWFL_FRAME_STATE_PC_UNDEFINED;
// &Dwfl_Frame.signal_frame cannot be passed as it is a bitfield.
bool signal_frame = false;
diff --git a/libdwfl/gzip.c b/libdwfl/gzip.c
index 078e1da..c2c13ba 100644
--- a/libdwfl/gzip.c
+++ b/libdwfl/gzip.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#include "system.h"
diff --git a/libdwfl/image-header.c b/libdwfl/image-header.c
index 62ccc3e..25fbfd9 100644
--- a/libdwfl/image-header.c
+++ b/libdwfl/image-header.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#include "system.h"
diff --git a/libdwfl/libdwfl.h b/libdwfl/libdwfl.h
index aea8b99..a0c1d35 100644
--- a/libdwfl/libdwfl.h
+++ b/libdwfl/libdwfl.h
@@ -385,7 +385,7 @@
/* Standard argument parsing for using a standard callback set. */
struct argp;
-extern const struct argp *dwfl_standard_argp (void) __attribute__ ((const));
+extern const struct argp *dwfl_standard_argp (void) __const_attribute__;
/*** Relocation of addresses from Dwfl ***/
diff --git a/libdwfl/libdwflP.h b/libdwfl/libdwflP.h
index 2a83646..31e6e19 100644
--- a/libdwfl/libdwflP.h
+++ b/libdwfl/libdwflP.h
@@ -1,5 +1,5 @@
/* Internal definitions for libdwfl.
- Copyright (C) 2005-2015 Red Hat, Inc.
+ Copyright (C) 2005-2015, 2018 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -29,9 +29,6 @@
#ifndef _LIBDWFLP_H
#define _LIBDWFLP_H 1
-#ifndef PACKAGE_NAME
-# include <config.h>
-#endif
#include <libdwfl.h>
#include <libebl.h>
#include <assert.h>
@@ -193,6 +190,8 @@
Elf_Data *symxndxdata; /* Data in the extended section index table. */
Elf_Data *aux_symxndxdata; /* Data in the extended auxiliary table. */
+ char *elfdir; /* The dir where we found the main Elf. */
+
Dwarf *dw; /* libdw handle for its debugging info. */
Dwarf *alt; /* Dwarf used for dwarf_setalt, or NULL. */
int alt_fd; /* descriptor, only valid when alt != NULL. */
@@ -404,6 +403,14 @@
size_t arange; /* Index in Dwarf_Aranges. */
};
+#define __LIBDWFL_REMOTE_MEM_CACHE_SIZE 4096
+/* Structure for caching remote memory reads as used by __libdwfl_pid_arg. */
+struct __libdwfl_remote_mem_cache
+{
+ Dwarf_Addr addr; /* Remote address. */
+ Dwarf_Off len; /* Zero if cleared, otherwise likely 4K. */
+ unsigned char buf[__LIBDWFL_REMOTE_MEM_CACHE_SIZE]; /* The actual cache. */
+};
/* Structure used for keeping track of ptrace attaching a thread.
Shared by linux-pid-attach and linux-proc-maps. If it has been setup
@@ -414,6 +421,10 @@
DIR *dir;
/* Elf for /proc/PID/exe. Set to NULL if it couldn't be opened. */
Elf *elf;
+ /* Remote memory cache, NULL if there is no memory cached.
+ Should be cleared on detachment (because that makes the thread
+ runnable and the cache invalid). */
+ struct __libdwfl_remote_mem_cache *mem_cache;
/* fd for /proc/PID/exe. Set to -1 if it couldn't be opened. */
int elf_fd;
/* It is 0 if not used. */
@@ -452,15 +463,6 @@
bool *resolved, bool adjust_st_value)
internal_function;
-/* Internal wrapper for old dwfl_module_addrsym and new dwfl_module_addrinfo.
- adjust_st_value set to true returns adjusted SYM st_value, set to false
- it will not adjust SYM at all, but does match against resolved values. */
-extern const char *__libdwfl_addrsym (Dwfl_Module *mod, GElf_Addr addr,
- GElf_Off *off, GElf_Sym *sym,
- GElf_Word *shndxp, Elf **elfp,
- Dwarf_Addr *bias,
- bool adjust_st_value) internal_function;
-
extern void __libdwfl_module_free (Dwfl_Module *mod) internal_function;
/* Find the main ELF file, update MOD->elferr and/or MOD->main.elf. */
diff --git a/libdwfl/libdwfl_crc32_file.c b/libdwfl/libdwfl_crc32_file.c
index 6b6b7d3..f849128 100644
--- a/libdwfl/libdwfl_crc32_file.c
+++ b/libdwfl/libdwfl_crc32_file.c
@@ -31,6 +31,5 @@
#define crc32_file attribute_hidden __libdwfl_crc32_file
#define crc32 __libdwfl_crc32
-#define LIB_SYSTEM_H 1
#include <libdwflP.h>
#include "../lib/crc32_file.c"
diff --git a/libdwfl/lines.c b/libdwfl/lines.c
index 721e29c..128c0c9 100644
--- a/libdwfl/lines.c
+++ b/libdwfl/lines.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#include "../libdw/libdwP.h"
diff --git a/libdwfl/link_map.c b/libdwfl/link_map.c
index 28d7382..29307c7 100644
--- a/libdwfl/link_map.c
+++ b/libdwfl/link_map.c
@@ -1,5 +1,5 @@
/* Report modules by examining dynamic linker data structures.
- Copyright (C) 2008-2015 Red Hat, Inc.
+ Copyright (C) 2008-2016 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -43,13 +43,14 @@
static inline bool
-do_check64 (size_t i, const Elf64_auxv_t (*a64)[], uint_fast8_t *elfdata)
+do_check64 (const char *a64, uint_fast8_t *elfdata)
{
/* The AUXV pointer might not even be naturally aligned for 64-bit
data, because note payloads in a core file are not aligned. */
-
- uint64_t type = read_8ubyte_unaligned_noncvt (&(*a64)[i].a_type);
- uint64_t val = read_8ubyte_unaligned_noncvt (&(*a64)[i].a_un.a_val);
+ const char *typep = a64 + offsetof (Elf64_auxv_t, a_type);
+ uint64_t type = read_8ubyte_unaligned_noncvt (typep);
+ const char *valp = a64 + offsetof (Elf64_auxv_t, a_un.a_val);
+ uint64_t val = read_8ubyte_unaligned_noncvt (valp);
if (type == BE64 (PROBE_TYPE)
&& val == BE64 (PROBE_VAL64))
@@ -68,16 +69,15 @@
return false;
}
-#define check64(n) do_check64 (n, a64, elfdata)
-
static inline bool
-do_check32 (size_t i, const Elf32_auxv_t (*a32)[], uint_fast8_t *elfdata)
+do_check32 (const char *a32, uint_fast8_t *elfdata)
{
/* The AUXV pointer might not even be naturally aligned for 32-bit
data, because note payloads in a core file are not aligned. */
-
- uint32_t type = read_4ubyte_unaligned_noncvt (&(*a32)[i].a_type);
- uint32_t val = read_4ubyte_unaligned_noncvt (&(*a32)[i].a_un.a_val);
+ const char *typep = a32 + offsetof (Elf32_auxv_t, a_type);
+ uint32_t type = read_4ubyte_unaligned_noncvt (typep);
+ const char *valp = a32 + offsetof (Elf32_auxv_t, a_un.a_val);
+ uint32_t val = read_4ubyte_unaligned_noncvt (valp);
if (type == BE32 (PROBE_TYPE)
&& val == BE32 (PROBE_VAL32))
@@ -96,26 +96,22 @@
return false;
}
-#define check32(n) do_check32 (n, a32, elfdata)
-
/* Examine an auxv data block and determine its format.
Return true iff we figured it out. */
static bool
auxv_format_probe (const void *auxv, size_t size,
uint_fast8_t *elfclass, uint_fast8_t *elfdata)
{
- const Elf32_auxv_t (*a32)[size / sizeof (Elf32_auxv_t)] = (void *) auxv;
- const Elf64_auxv_t (*a64)[size / sizeof (Elf64_auxv_t)] = (void *) auxv;
-
for (size_t i = 0; i < size / sizeof (Elf64_auxv_t); ++i)
{
- if (check64 (i))
+ if (do_check64 (auxv + i * sizeof (Elf64_auxv_t), elfdata))
{
*elfclass = ELFCLASS64;
return true;
}
- if (check32 (i * 2) || check32 (i * 2 + 1))
+ if (do_check32 (auxv + (i * 2) * sizeof (Elf32_auxv_t), elfdata)
+ || do_check32 (auxv + (i * 2 + 1) * sizeof (Elf32_auxv_t), elfdata))
{
*elfclass = ELFCLASS32;
return true;
@@ -717,8 +713,12 @@
const Elf##NN##_auxv_t *av = auxv; \
for (size_t i = 0; i < auxv_size / sizeof av[0]; ++i) \
{ \
- uint##NN##_t type = READ_AUXV##NN (&av[i].a_type); \
- uint##NN##_t val = BL##NN (READ_AUXV##NN (&av[i].a_un.a_val)); \
+ const char *typep = auxv + i * sizeof (Elf##NN##_auxv_t); \
+ typep += offsetof (Elf##NN##_auxv_t, a_type); \
+ uint##NN##_t type = READ_AUXV##NN (typep); \
+ const char *valp = auxv + i * sizeof (Elf##NN##_auxv_t); \
+ valp += offsetof (Elf##NN##_auxv_t, a_un.a_val); \
+ uint##NN##_t val = BL##NN (READ_AUXV##NN (valp)); \
if (type == BL##NN (AT_ENTRY)) \
entry = val; \
else if (type == BL##NN (AT_PHDR)) \
@@ -843,7 +843,10 @@
}
off_t off = ehdr->e_phoff;
assert (in.d_buf == NULL);
- assert (in.d_size == phnum * phent);
+ /* Note this in the !in_ok path. That means memory_callback
+ failed. But the callback might still have reset the d_size
+ value (to zero). So explicitly set it here again. */
+ in.d_size = phnum * phent;
in.d_buf = malloc (in.d_size);
if (unlikely (in.d_buf == NULL))
{
diff --git a/libdwfl/linux-core-attach.c b/libdwfl/linux-core-attach.c
index 5a7b3b3..9f05f72 100644
--- a/libdwfl/linux-core-attach.c
+++ b/libdwfl/linux-core-attach.c
@@ -26,16 +26,16 @@
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 "libdwflP.h"
#include <fcntl.h>
#include "system.h"
#include "../libdw/memory-access.h"
-#ifndef MIN
-# define MIN(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
struct core_arg
{
Elf *core;
@@ -129,7 +129,8 @@
&desc_offset)) > 0)
{
/* Do not check NAME for now, help broken Linux kernels. */
- const char *name = note_data->d_buf + name_offset;
+ const char *name = (nhdr.n_namesz == 0
+ ? "" : note_data->d_buf + name_offset);
const char *desc = note_data->d_buf + desc_offset;
GElf_Word regs_offset;
size_t nregloc;
@@ -182,7 +183,8 @@
/* __libdwfl_attach_state_for_core already verified the note is there. */
assert (getnote_err != 0);
/* Do not check NAME for now, help broken Linux kernels. */
- const char *name = note_data->d_buf + name_offset;
+ const char *name = (nhdr.n_namesz == 0
+ ? "" : note_data->d_buf + name_offset);
const char *desc = note_data->d_buf + desc_offset;
GElf_Word regs_offset;
size_t nregloc;
@@ -371,7 +373,8 @@
&nhdr, &name_offset, &desc_offset)) > 0)
{
/* Do not check NAME for now, help broken Linux kernels. */
- const char *name = note_data->d_buf + name_offset;
+ const char *name = (nhdr.n_namesz == 0
+ ? "" : note_data->d_buf + name_offset);
const char *desc = note_data->d_buf + desc_offset;
GElf_Word regs_offset;
size_t nregloc;
diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c
index e27f74f..9d0fef2 100644
--- a/libdwfl/linux-kernel-modules.c
+++ b/libdwfl/linux-kernel-modules.c
@@ -26,13 +26,18 @@
the GNU Lesser General Public License along with this program. If
not, see <http://www.gnu.org/licenses/>. */
-/* We include this before config.h because it can't handle _FILE_OFFSET_BITS.
- Everything we need here is fine if its declarations just come first. */
-/* Some makefiles, e.g. HOST_linux-x86.mk, predefine _FILE_OFFSET_BITS. */
-#undef _FILE_OFFSET_BITS
-#include <fts.h>
+/* In case we have a bad fts we include this before config.h because it
+ can't handle _FILE_OFFSET_BITS.
+ Everything we need here is fine if its declarations just come first.
+ Also, include sys/types.h before fts. On some systems fts.h is not self
+ contained. */
+#ifdef BAD_FTS
+ #include <sys/types.h>
+ #include <fts.h>
+#endif
#include <config.h>
+#include <system.h>
#include "libdwflP.h"
#include <inttypes.h>
@@ -45,11 +50,16 @@
#include <fcntl.h>
#include <unistd.h>
-/* Since fts.h is included before config.h, its indirect inclusions may not
+/* If fts.h is included before config.h, its indirect inclusions may not
give us the right LFS aliases of these functions, so map them manually. */
-#ifdef _FILE_OFFSET_BITS
-#define open open64
-#define fopen fopen64
+#ifdef BAD_FTS
+ #ifdef _FILE_OFFSET_BITS
+ #define open open64
+ #define fopen fopen64
+ #endif
+#else
+ #include <sys/types.h>
+ #include <fts.h>
#endif
@@ -93,17 +103,21 @@
if (fd < 0)
{
Dwfl_Module fakemod = { .dwfl = dwfl };
- /* First try the file's unadorned basename as DEBUGLINK_FILE,
- to look for "vmlinux" files. */
- fd = INTUSE(dwfl_standard_find_debuginfo) (&fakemod, NULL, NULL, 0,
- *fname, basename (*fname), 0,
- &fakemod.debug.name);
- if (fd < 0 && try_debug)
- /* Next, let the call use the default of basename + ".debug",
- to look for "vmlinux.debug" files. */
+
+ if (try_debug)
+ /* Passing NULL for DEBUGLINK_FILE searches for both the basenamer
+ "vmlinux" and the default of basename + ".debug", to look for
+ "vmlinux.debug" files. */
fd = INTUSE(dwfl_standard_find_debuginfo) (&fakemod, NULL, NULL, 0,
*fname, NULL, 0,
&fakemod.debug.name);
+ else
+ /* Try the file's unadorned basename as DEBUGLINK_FILE,
+ to look only for "vmlinux" files. */
+ fd = INTUSE(dwfl_standard_find_debuginfo) (&fakemod, NULL, NULL, 0,
+ *fname, basename (*fname),
+ 0, &fakemod.debug.name);
+
if (fakemod.debug.name != NULL)
{
free (*fname);
@@ -142,11 +156,18 @@
static inline const char *
kernel_release (void)
{
+#ifdef __linux__
/* Cache the `uname -r` string we'll use. */
static struct utsname utsname;
if (utsname.release[0] == '\0' && uname (&utsname) != 0)
return NULL;
return utsname.release;
+#else
+ /* Used for finding the running linux kernel, which isn't supported
+ on non-linux kernel systems. */
+ errno = ENOTSUP;
+ return NULL;
+#endif
}
static int
@@ -491,7 +512,7 @@
if (*notes == 0 && !strcmp (state.p, "__start_notes\n"))
*notes = *end;
- Dwarf_Addr round_kernel = sysconf (_SC_PAGE_SIZE);
+ Dwarf_Addr round_kernel = sysconf (_SC_PAGESIZE);
*start &= -(Dwarf_Addr) round_kernel;
*end += round_kernel - 1;
*end &= -(Dwarf_Addr) round_kernel;
diff --git a/libdwfl/linux-pid-attach.c b/libdwfl/linux-pid-attach.c
index 4c0f42d..1133db6 100644
--- a/libdwfl/linux-pid-attach.c
+++ b/libdwfl/linux-pid-attach.c
@@ -1,5 +1,5 @@
/* Get Dwarf Frame state for target live PID process.
- Copyright (C) 2013, 2014, 2015 Red Hat, Inc.
+ Copyright (C) 2013, 2014, 2015, 2018 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -26,23 +26,25 @@
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 "libelfP.h"
#include "libdwflP.h"
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/uio.h>
#include <fcntl.h>
-#include <sys/ptrace.h>
-#include <sys/wait.h>
#include <dirent.h>
-#include <sys/syscall.h>
#include <unistd.h>
-#ifndef MAX
-# define MAX(a, b) ((a) > (b) ? (a) : (b))
-#endif
-
#ifdef __linux__
+#include <sys/ptrace.h>
+#include <sys/syscall.h>
+#include <sys/wait.h>
+
static bool
linux_proc_pid_is_stopped (pid_t pid)
{
@@ -114,12 +116,90 @@
return true;
}
+#ifdef HAVE_PROCESS_VM_READV
+/* Note that the result word size depends on the architecture word size.
+ That is sizeof long. */
+static bool
+read_cached_memory (struct __libdwfl_pid_arg *pid_arg,
+ Dwarf_Addr addr, Dwarf_Word *result)
+{
+ /* Let the ptrace fallback deal with the corner case of the address
+ possibly crossing a page boundery. */
+ if ((addr & ((Dwarf_Addr)__LIBDWFL_REMOTE_MEM_CACHE_SIZE - 1))
+ > (Dwarf_Addr)__LIBDWFL_REMOTE_MEM_CACHE_SIZE - sizeof (unsigned long))
+ return false;
+
+ struct __libdwfl_remote_mem_cache *mem_cache = pid_arg->mem_cache;
+ if (mem_cache == NULL)
+ {
+ size_t mem_cache_size = sizeof (struct __libdwfl_remote_mem_cache);
+ mem_cache = (struct __libdwfl_remote_mem_cache *) malloc (mem_cache_size);
+ if (mem_cache == NULL)
+ return false;
+
+ mem_cache->addr = 0;
+ mem_cache->len = 0;
+ pid_arg->mem_cache = mem_cache;
+ }
+
+ unsigned char *d;
+ if (addr >= mem_cache->addr && addr - mem_cache->addr < mem_cache->len)
+ {
+ d = &mem_cache->buf[addr - mem_cache->addr];
+ if ((((uintptr_t) d) & (sizeof (unsigned long) - 1)) == 0)
+ *result = *(unsigned long *) d;
+ else
+ memcpy (result, d, sizeof (unsigned long));
+ return true;
+ }
+
+ struct iovec local, remote;
+ mem_cache->addr = addr & ~((Dwarf_Addr)__LIBDWFL_REMOTE_MEM_CACHE_SIZE - 1);
+ local.iov_base = mem_cache->buf;
+ local.iov_len = __LIBDWFL_REMOTE_MEM_CACHE_SIZE;
+ remote.iov_base = (void *) (uintptr_t) mem_cache->addr;
+ remote.iov_len = __LIBDWFL_REMOTE_MEM_CACHE_SIZE;
+
+ ssize_t res = process_vm_readv (pid_arg->tid_attached,
+ &local, 1, &remote, 1, 0);
+ if (res != __LIBDWFL_REMOTE_MEM_CACHE_SIZE)
+ {
+ mem_cache->len = 0;
+ return false;
+ }
+
+ mem_cache->len = res;
+ d = &mem_cache->buf[addr - mem_cache->addr];
+ if ((((uintptr_t) d) & (sizeof (unsigned long) - 1)) == 0)
+ *result = *(unsigned long *) d;
+ else
+ memcpy (result, d, sizeof (unsigned long));
+ return true;
+}
+#endif /* HAVE_PROCESS_VM_READV */
+
+static void
+clear_cached_memory (struct __libdwfl_pid_arg *pid_arg)
+{
+ struct __libdwfl_remote_mem_cache *mem_cache = pid_arg->mem_cache;
+ if (mem_cache != NULL)
+ mem_cache->len = 0;
+}
+
+/* Note that the result word size depends on the architecture word size.
+ That is sizeof long. */
static bool
pid_memory_read (Dwfl *dwfl, Dwarf_Addr addr, Dwarf_Word *result, void *arg)
{
struct __libdwfl_pid_arg *pid_arg = arg;
pid_t tid = pid_arg->tid_attached;
assert (tid > 0);
+
+#ifdef HAVE_PROCESS_VM_READV
+ if (read_cached_memory (pid_arg, addr, result))
+ return true;
+#endif
+
Dwfl_Process *process = dwfl->process;
if (ebl_get_elfclass (process->ebl) == ELFCLASS64)
{
@@ -252,6 +332,7 @@
{
struct __libdwfl_pid_arg *pid_arg = dwfl_arg;
elf_end (pid_arg->elf);
+ free (pid_arg->mem_cache);
close (pid_arg->elf_fd);
closedir (pid_arg->dir);
free (pid_arg);
@@ -277,6 +358,7 @@
pid_t tid = INTUSE(dwfl_thread_tid) (thread);
assert (pid_arg->tid_attached == tid);
pid_arg->tid_attached = 0;
+ clear_cached_memory (pid_arg);
if (! pid_arg->assume_ptrace_stopped)
__libdwfl_ptrace_detach (tid, pid_arg->tid_was_stopped);
}
@@ -378,6 +460,7 @@
pid_arg->dir = dir;
pid_arg->elf = elf;
pid_arg->elf_fd = elf_fd;
+ pid_arg->mem_cache = NULL;
pid_arg->tid_attached = 0;
pid_arg->assume_ptrace_stopped = assume_ptrace_stopped;
if (! INTUSE(dwfl_attach_state) (dwfl, elf, pid, &pid_thread_callbacks,
@@ -406,27 +489,6 @@
#else /* __linux__ */
-static pid_t
-pid_next_thread (Dwfl *dwfl __attribute__ ((unused)),
- void *dwfl_arg __attribute__ ((unused)),
- void **thread_argp __attribute__ ((unused)))
-{
- errno = ENOSYS;
- __libdwfl_seterrno (DWFL_E_ERRNO);
- return -1;
-}
-
-static bool
-pid_getthread (Dwfl *dwfl __attribute__ ((unused)),
- pid_t tid __attribute__ ((unused)),
- void *dwfl_arg __attribute__ ((unused)),
- void **thread_argp __attribute__ ((unused)))
-{
- errno = ENOSYS;
- __libdwfl_seterrno (DWFL_E_ERRNO);
- return false;
-}
-
bool
internal_function
__libdwfl_ptrace_attach (pid_t tid __attribute__ ((unused)),
@@ -437,32 +499,6 @@
return false;
}
-static bool
-pid_memory_read (Dwfl *dwfl __attribute__ ((unused)),
- Dwarf_Addr addr __attribute__ ((unused)),
- Dwarf_Word *result __attribute__ ((unused)),
- void *arg __attribute__ ((unused)))
-{
- errno = ENOSYS;
- __libdwfl_seterrno (DWFL_E_ERRNO);
- return false;
-}
-
-static bool
-pid_set_initial_registers (Dwfl_Thread *thread __attribute__ ((unused)),
- void *thread_arg __attribute__ ((unused)))
-{
- errno = ENOSYS;
- __libdwfl_seterrno (DWFL_E_ERRNO);
- return false;
-}
-
-static void
-pid_detach (Dwfl *dwfl __attribute__ ((unused)),
- void *dwfl_arg __attribute__ ((unused)))
-{
-}
-
void
internal_function
__libdwfl_ptrace_detach (pid_t tid __attribute__ ((unused)),
@@ -470,22 +506,6 @@
{
}
-static void
-pid_thread_detach (Dwfl_Thread *thread __attribute__ ((unused)),
- void *thread_arg __attribute__ ((unused)))
-{
-}
-
-static const Dwfl_Thread_Callbacks pid_thread_callbacks =
-{
- pid_next_thread,
- pid_getthread,
- pid_memory_read,
- pid_set_initial_registers,
- pid_detach,
- pid_thread_detach,
-};
-
int
dwfl_linux_proc_attach (Dwfl *dwfl __attribute__ ((unused)),
pid_t pid __attribute__ ((unused)),
diff --git a/libdwfl/linux-proc-maps.c b/libdwfl/linux-proc-maps.c
index 9e7b2a2..c4438c0 100644
--- a/libdwfl/linux-proc-maps.c
+++ b/libdwfl/linux-proc-maps.c
@@ -1,5 +1,5 @@
/* Standard libdwfl callbacks for debugging a live Linux process.
- Copyright (C) 2005-2010, 2013, 2014 Red Hat, Inc.
+ Copyright (C) 2005-2010, 2013, 2014, 2016 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#include <inttypes.h>
#include <sys/types.h>
@@ -218,6 +222,7 @@
|| nread <= 0)
{
free (line);
+ free (last_file);
return ENOEXEC;
}
@@ -249,7 +254,10 @@
{
/* This is another portion of the same file's mapping. */
if (strcmp (last_file, file) != 0)
- goto bad_report;
+ {
+ free (last_file);
+ goto bad_report;
+ }
high = end;
}
else
@@ -414,7 +422,7 @@
if (fd < 0)
goto detach;
- *elfp = elf_from_remote_memory (base, getpagesize (), NULL,
+ *elfp = elf_from_remote_memory (base, sysconf (_SC_PAGESIZE), NULL,
&read_proc_memory, &fd);
close (fd);
diff --git a/libdwfl/offline.c b/libdwfl/offline.c
index c0a2599..d8697cf 100644
--- a/libdwfl/offline.c
+++ b/libdwfl/offline.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
#include <fcntl.h>
#include <unistd.h>
@@ -146,6 +150,9 @@
/* Don't keep the file descriptor around. */
if (mod->main.fd != -1 && elf_cntl (mod->main.elf, ELF_C_FDREAD) == 0)
{
+ /* Grab the dir path in case we want to report this file as
+ Dwarf later. */
+ mod->elfdir = __libdw_debugdir (mod->main.fd);
close (mod->main.fd);
mod->main.fd = -1;
}
diff --git a/libdwfl/open.c b/libdwfl/open.c
index 92f2798..4e0461b 100644
--- a/libdwfl/open.c
+++ b/libdwfl/open.c
@@ -26,6 +26,10 @@
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 "../libelf/libelfP.h"
#undef _
#include "libdwflP.h"
diff --git a/libdwfl/relocate.c b/libdwfl/relocate.c
index fc88df3..9afcdeb 100644
--- a/libdwfl/relocate.c
+++ b/libdwfl/relocate.c
@@ -1,5 +1,5 @@
/* Relocate debug information.
- Copyright (C) 2005-2011, 2014 Red Hat, Inc.
+ Copyright (C) 2005-2011, 2014, 2016 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -26,6 +26,10 @@
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 "libdwflP.h"
typedef uint8_t GElf_Byte;
@@ -605,7 +609,8 @@
case DWFL_E_NOERROR:
/* We applied the relocation. Elide it. */
memset (&rel_mem, 0, sizeof rel_mem);
- gelf_update_rel (reldata, relidx, &rel_mem);
+ if (unlikely (gelf_update_rel (reldata, relidx, &rel_mem) == 0))
+ return DWFL_E_LIBELF;
++complete;
break;
case DWFL_E_BADRELTYPE:
@@ -635,7 +640,9 @@
case DWFL_E_NOERROR:
/* We applied the relocation. Elide it. */
memset (&rela_mem, 0, sizeof rela_mem);
- gelf_update_rela (reldata, relidx, &rela_mem);
+ if (unlikely (gelf_update_rela (reldata, relidx,
+ &rela_mem) == 0))
+ return DWFL_E_LIBELF;
++complete;
break;
case DWFL_E_BADRELTYPE:
@@ -668,10 +675,13 @@
{
GElf_Rel rel_mem;
GElf_Rel *r = gelf_getrel (reldata, relidx, &rel_mem);
+ if (unlikely (r == NULL))
+ return DWFL_E_LIBELF;
if (r->r_info != 0 || r->r_offset != 0)
{
if (next != relidx)
- gelf_update_rel (reldata, next, r);
+ if (unlikely (gelf_update_rel (reldata, next, r) == 0))
+ return DWFL_E_LIBELF;
++next;
}
}
@@ -680,10 +690,13 @@
{
GElf_Rela rela_mem;
GElf_Rela *r = gelf_getrela (reldata, relidx, &rela_mem);
+ if (unlikely (r == NULL))
+ return DWFL_E_LIBELF;
if (r->r_info != 0 || r->r_offset != 0 || r->r_addend != 0)
{
if (next != relidx)
- gelf_update_rela (reldata, next, r);
+ if (unlikely (gelf_update_rela (reldata, next, r) == 0))
+ return DWFL_E_LIBELF;
++next;
}
}
@@ -691,7 +704,8 @@
}
shdr->sh_size = reldata->d_size = nrels * sh_entsize;
- gelf_update_shdr (scn, shdr);
+ if (unlikely (gelf_update_shdr (scn, shdr) == 0))
+ return DWFL_E_LIBELF;
}
return result;
@@ -723,6 +737,8 @@
{
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ if (unlikely (shdr == NULL))
+ return DWFL_E_LIBELF;
if ((shdr->sh_type == SHT_REL || shdr->sh_type == SHT_RELA)
&& shdr->sh_size != 0)
@@ -735,7 +751,7 @@
else
result = relocate_section (mod, debugfile, ehdr, d_shstrndx,
&reloc_symtab, scn, shdr, tscn,
- debug, !debug);
+ debug, true /* partial always OK. */);
}
}
@@ -756,10 +772,18 @@
if (elf_getshdrstrndx (relocated, &shstrndx) < 0)
return DWFL_E_LIBELF;
- return (__libdwfl_module_getebl (mod)
- ?: relocate_section (mod, relocated,
- gelf_getehdr (relocated, &ehdr_mem), shstrndx,
- &reloc_symtab,
- relocscn, gelf_getshdr (relocscn, &shdr_mem),
- tscn, false, partial));
+ Dwfl_Error result = __libdwfl_module_getebl (mod);
+ if (unlikely (result != DWFL_E_NOERROR))
+ return result;
+
+ GElf_Ehdr *ehdr = gelf_getehdr (relocated, &ehdr_mem);
+ if (unlikely (ehdr == NULL))
+ return DWFL_E_LIBELF;
+
+ GElf_Shdr *shdr = gelf_getshdr (relocscn, &shdr_mem);
+ if (unlikely (shdr == NULL))
+ return DWFL_E_LIBELF;
+
+ return relocate_section (mod, relocated, ehdr, shstrndx, &reloc_symtab,
+ relocscn, shdr, tscn, false, partial);
}
diff --git a/libdwfl/segment.c b/libdwfl/segment.c
index 2983cf2..d9599a7 100644
--- a/libdwfl/segment.c
+++ b/libdwfl/segment.c
@@ -26,6 +26,10 @@
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 "libdwflP.h"
GElf_Addr
diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index aa3d686..aa82e3a 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -1,3 +1,101 @@
+2018-04-25 Mark Wielaard <mark@klomp.org>
+
+ * eblopenbackend.c (default_debugscn_p): Add new DWARF5 sections
+ .debug_addr, .debug_line_str, .debug_loclists, .debug_names,
+ .debug_rnglists and .debug_str_offsets.
+
+2018-04-19 Andreas Schwab <schwab@suse.de>
+
+ * eblopenbackend.c (machines): Add entries for RISC-V.
+
+2018-03-16 Mark Wielaard <mark@klomp.org>
+
+ * ebldynamictagname.c (ebl_dynamic_tag_name): Add SYMTAB_SHNDX to
+ stdtags. Add a eu_static_assert to make sure stdtags contains all
+ DT_NUM entries.
+
+2018-02-21 Mark Wielaard <mark@klomp.org>
+
+ * eblcheckreloctargettype.c (ebl_check_reloc_target_type): Accept
+ SHT_NOTE.
+
+2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
+
+ * eblobjnote.c (ebl_object_note): Use FALLTHROUGH macro instead of
+ comment.
+
+2017-04-27 Ulf Hermann <ulf.hermann@qt.io>
+
+ * Makefile.am: Use fpic_CFLAGS.
+
+2017-07-19 Gustavo Romero <gromero@linux.vnet.ibm.com>
+
+ * eblcorenotetypename.c: Add ppc64 HTM SPRs note as known type.
+
+2017-07-20 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (gen_SOURCES): Add ebl_data_marker_symbol.c.
+ * ebl-hooks.h (data_marker_symbol): New hook.
+ * ebl_data_marker_symbol.c: New file.
+ * eblopenbackend.c (default_data_marker_symbol): New function.
+ (fill_defaults): Add default_data_marker_symbol.
+ * libebl.h (ebl_data_marker_symbol): New function.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * libebl.h: Use __pure_attribute__.
+
+2017-02-15 Ulf Hermann <ulf.hermann@qt.io>
+
+ * eblmachineflagname.c: Include system.h.
+ * eblopenbackend.c: Likewise.
+
+2016-07-08 Mark Wielaard <mjw@redhat.com>
+
+ * Makefile.am (gen_SOURCES): Remove eblstrtab.c.
+ * eblstrtab.c: Removed.
+ * libebl.h (Ebl_Strtab): Removed.
+ (Ebl_Strent): Removed.
+ (ebl_strtabinit): Removed.
+ (ebl_strtabfree): Removed.
+ (ebl_strtabadd): Removed.
+ (ebl_strtabfinalize): Removed.
+ (ebl_strtaboffset): Removed.
+ (ebl_string): Removed.
+
+2016-07-06 Mark Wielaard <mjw@redhat.com>
+
+ * Makefile.am (gen_SOURCES): Remove eblobjecttypename.c,
+ eblshflagscombine.c, eblwstrtab.c and eblgstrtab.c.
+ * ebl-hooks.h (object_type_name): Removed.
+ (sh_flags_combine): Likewise.
+ * eblgstrtab.c: Removed.
+ * eblobjecttypename.c: Removed.
+ * eblopenbackend.c (default_object_type_name): Removed.
+ (default_sh_flags_combine): Likewise.
+ (fill_defaults): Removed object_type_name and sh_flags_combine.
+ * eblshflagscombine.c: Removed.
+ * eblwstrtab.c: Removed.
+ * libebl.h (ebl_object_type_name): Removed.
+ (ebl_sh_flags_combine): Likewise.
+ (ebl_wstrtab*): Removed.
+ (ebl_gstrtab*): Likewise.
+
+2016-06-28 Richard Henderson <rth@redhat.com>
+
+ * ebl-hooks.h (EBLHOOK(disasm)): Add ebl parameter.
+ * eblopenbackend.c (machines): Add EM_BPF entry.
+
+2016-05-20 Andreas Schwab <schwab@linux-m68k.org>
+
+ * eblopenbackend.c (machines) [EM_68K]: Set class and data.
+
+2016-02-12 Mark Wielaard <mjw@redhat.com>
+
+ * eblobjnotetypename.c (ebl_object_note_type_name): Check name is
+ "Go" and use new goknowntypes then. Otherwise check name is not
+ "GNU" and return "unknown".
+
2016-01-09 Mark Wielaard <mjw@redhat.com>
* eblobjnote.c (ebl_object_note): Add brackets around if statement
diff --git a/libebl/Makefile.am b/libebl/Makefile.am
index 6b41a3e..737de6b 100644
--- a/libebl/Makefile.am
+++ b/libebl/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to create Makefile.in
##
-## Copyright (C) 2000-2010, 2013 Red Hat, Inc.
+## Copyright (C) 2000-2010, 2013, 2016, 2017 Red Hat, Inc.
## This file is part of elfutils.
##
## This file is free software; you can redistribute it and/or modify
@@ -28,7 +28,7 @@
## not, see <http://www.gnu.org/licenses/>.
##
include $(top_srcdir)/config/eu.am
-AM_CFLAGS += -fPIC
+AM_CFLAGS += $(fpic_CFLAGS)
AM_CPPFLAGS += -I$(srcdir)/../libelf -I$(srcdir)/../libdw -I$(srcdir)/../libasm
VERSION = 1
LIBEBL_SUBDIR = @LIBEBL_SUBDIR@
@@ -37,13 +37,11 @@
pkginclude_HEADERS = libebl.h
-gen_SOURCES = eblopenbackend.c eblclosebackend.c eblstrtab.c \
+gen_SOURCES = eblopenbackend.c eblclosebackend.c \
eblreloctypename.c eblsegmenttypename.c \
eblsectiontypename.c eblmachineflagname.c \
eblsymboltypename.c ebldynamictagname.c eblsectionname.c \
- eblobjecttypename.c eblsymbolbindingname.c \
- eblbackendname.c eblshflagscombine.c eblwstrtab.c \
- eblgstrtab.c eblosabiname.c \
+ eblsymbolbindingname.c eblbackendname.c eblosabiname.c \
eblmachineflagcheck.c eblmachinesectionflagcheck.c \
eblreloctypecheck.c eblrelocvaliduse.c eblrelocsimpletype.c \
ebldynamictagcheck.c eblcorenotetypename.c eblobjnotetypename.c \
@@ -55,7 +53,8 @@
eblsysvhashentrysize.c eblauxvinfo.c eblcheckobjattr.c \
ebl_check_special_section.c ebl_syscall_abi.c eblabicfi.c \
eblstother.c eblinitreg.c ebldwarftoregno.c eblnormalizepc.c \
- eblunwind.c eblresolvesym.c eblcheckreloctargettype.c
+ eblunwind.c eblresolvesym.c eblcheckreloctargettype.c \
+ ebl_data_marker_symbol.c
libebl_a_SOURCES = $(gen_SOURCES)
diff --git a/libebl/ebl-hooks.h b/libebl/ebl-hooks.h
index 2e31446..f3a0e64 100644
--- a/libebl/ebl-hooks.h
+++ b/libebl/ebl-hooks.h
@@ -1,5 +1,5 @@
/* Backend hook signatures internal interface for libebl.
- Copyright (C) 2000-2011, 2013, 2014 Red Hat, Inc.
+ Copyright (C) 2000-2011, 2013, 2014, 2016, 2017 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -26,9 +26,6 @@
the GNU Lesser General Public License along with this program. If
not, see <http://www.gnu.org/licenses/>. */
-/* Return symbol representaton of object file type. */
-const char *EBLHOOK(object_type_name) (int, char *, size_t);
-
/* Return symbolic representation of relocation type. */
const char *EBLHOOK(reloc_type_name) (int, char *, size_t);
@@ -80,9 +77,6 @@
/* Check dynamic tag. */
bool EBLHOOK(dynamic_tag_check) (int64_t);
-/* Combine section header flags values. */
-GElf_Word EBLHOOK(sh_flags_combine) (GElf_Word, GElf_Word);
-
/* Return symbolic representation of OS ABI. */
const char *EBLHOOK(osabi_name) (int, char *, size_t);
@@ -127,6 +121,9 @@
bool EBLHOOK(check_special_symbol) (Elf *, GElf_Ehdr *, const GElf_Sym *,
const char *, const GElf_Shdr *);
+/* Check if this is a data marker symbol. e.g. '$d' symbols for ARM. */
+bool EBLHOOK(data_marker_symbol) (const GElf_Sym *sym, const char *sname);
+
/* Check whether only valid bits are set on the st_other symbol flag.
Standard ST_VISIBILITY have already been masked off. */
bool EBLHOOK(check_st_other_bits) (unsigned char st_other);
@@ -150,7 +147,7 @@
int *callno, int args[6]);
/* Disassembler function. */
-int EBLHOOK(disasm) (const uint8_t **startp, const uint8_t *end,
+int EBLHOOK(disasm) (Ebl *ebl, const uint8_t **startp, const uint8_t *end,
GElf_Addr addr, const char *fmt, DisasmOutputCB_t outcb,
DisasmGetSymCB_t symcb, void *outcbarg, void *symcbarg);
diff --git a/libebl/eblshflagscombine.c b/libebl/ebl_data_marker_symbol.c
similarity index 78%
rename from libebl/eblshflagscombine.c
rename to libebl/ebl_data_marker_symbol.c
index 4deaaaa..922d720 100644
--- a/libebl/eblshflagscombine.c
+++ b/libebl/ebl_data_marker_symbol.c
@@ -1,7 +1,6 @@
-/* Return combines section header flags value.
- Copyright (C) 2001, 2002 Red Hat, Inc.
+/* Check whether a symbol is a special data marker.
+ Copyright (C) 2017 Red Hat, Inc.
This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
This file is free software; you can redistribute it and/or modify
it under the terms of either
@@ -31,11 +30,15 @@
# include <config.h>
#endif
+#include <inttypes.h>
#include <libeblP.h>
-GElf_Word
-ebl_sh_flags_combine (Ebl *ebl, GElf_Word flags1, GElf_Word flags2)
+bool
+ebl_data_marker_symbol (Ebl *ebl, const GElf_Sym *sym, const char *sname)
{
- return ebl->sh_flags_combine (flags1, flags2);
+ if (ebl == NULL)
+ return false;
+
+ return ebl->data_marker_symbol (sym, sname);
}
diff --git a/libebl/eblcheckreloctargettype.c b/libebl/eblcheckreloctargettype.c
index e0d57c1..068ad8f 100644
--- a/libebl/eblcheckreloctargettype.c
+++ b/libebl/eblcheckreloctargettype.c
@@ -46,6 +46,7 @@
case SHT_INIT_ARRAY:
case SHT_FINI_ARRAY:
case SHT_PREINIT_ARRAY:
+ case SHT_NOTE:
return true;
default:
diff --git a/libebl/eblcorenotetypename.c b/libebl/eblcorenotetypename.c
index 826f9a1..d3a56fa 100644
--- a/libebl/eblcorenotetypename.c
+++ b/libebl/eblcorenotetypename.c
@@ -75,6 +75,7 @@
KNOWNSTYPE (PPC_VMX);
KNOWNSTYPE (PPC_SPE);
KNOWNSTYPE (PPC_VSX);
+ KNOWNSTYPE (PPC_TM_SPR);
KNOWNSTYPE (386_TLS);
KNOWNSTYPE (386_IOPERM);
KNOWNSTYPE (X86_XSTATE);
@@ -90,6 +91,7 @@
KNOWNSTYPE (ARM_TLS);
KNOWNSTYPE (ARM_HW_BREAK);
KNOWNSTYPE (ARM_HW_WATCH);
+ KNOWNSTYPE (ARM_SYSTEM_CALL);
KNOWNSTYPE (SIGINFO);
KNOWNSTYPE (FILE);
#undef KNOWNSTYPE
diff --git a/libebl/ebldynamictagname.c b/libebl/ebldynamictagname.c
index 3aaccd0..5622fc3 100644
--- a/libebl/ebldynamictagname.c
+++ b/libebl/ebldynamictagname.c
@@ -34,6 +34,7 @@
#include <inttypes.h>
#include <stdio.h>
#include <libeblP.h>
+#include "system.h"
const char *
@@ -53,8 +54,9 @@
"RELENT", "PLTREL", "DEBUG", "TEXTREL", "JMPREL", "BIND_NOW",
"INIT_ARRAY", "FINI_ARRAY", "INIT_ARRAYSZ", "FINI_ARRAYSZ",
"RUNPATH", "FLAGS", "ENCODING", "PREINIT_ARRAY",
- "PREINIT_ARRAYSZ"
+ "PREINIT_ARRAYSZ", "SYMTAB_SHNDX"
};
+ eu_static_assert (sizeof (stdtags) / sizeof (const char *) == DT_NUM);
res = stdtags[tag];
}
diff --git a/libebl/eblgstrtab.c b/libebl/eblgstrtab.c
deleted file mode 100644
index 0d92c00..0000000
--- a/libebl/eblgstrtab.c
+++ /dev/null
@@ -1,365 +0,0 @@
-/* Generic string table 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 <inttypes.h>
-#include <libelf.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/param.h>
-
-#include "libebl.h"
-
-#ifndef MIN
-# define MIN(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
-
-struct Ebl_GStrent
-{
- const char *string;
- size_t len;
- struct Ebl_GStrent *next;
- struct Ebl_GStrent *left;
- struct Ebl_GStrent *right;
- size_t offset;
- unsigned int width;
- char reverse[0];
-};
-
-
-struct memoryblock
-{
- struct memoryblock *next;
- char memory[0];
-};
-
-
-struct Ebl_GStrtab
-{
- struct Ebl_GStrent *root;
- struct memoryblock *memory;
- char *backp;
- size_t left;
- size_t total;
- unsigned int width;
- bool nullstr;
-
- struct Ebl_GStrent null;
-};
-
-
-/* Cache for the pagesize. We correct this value a bit so that `malloc'
- is not allocating more than a page. */
-static size_t ps;
-
-
-struct Ebl_GStrtab *
-ebl_gstrtabinit (unsigned int width, bool nullstr)
-{
- struct Ebl_GStrtab *ret;
-
- if (ps == 0)
- {
- ps = sysconf (_SC_PAGESIZE) - 2 * sizeof (void *);
- assert (sizeof (struct memoryblock) < ps);
- }
-
- ret = (struct Ebl_GStrtab *) calloc (1, sizeof (struct Ebl_GStrtab));
- if (ret != NULL)
- {
- ret->width = width;
- ret->nullstr = nullstr;
-
- if (nullstr)
- {
- ret->null.len = 1;
- ret->null.string = (char *) calloc (1, width);
- }
- }
-
- return ret;
-}
-
-
-static void
-morememory (struct Ebl_GStrtab *st, size_t len)
-{
- struct memoryblock *newmem;
-
- if (len < ps)
- len = ps;
- newmem = (struct memoryblock *) malloc (len);
- if (newmem == NULL)
- abort ();
-
- newmem->next = st->memory;
- st->memory = newmem;
- st->backp = newmem->memory;
- st->left = len - offsetof (struct memoryblock, memory);
-}
-
-
-void
-ebl_gstrtabfree (struct Ebl_GStrtab *st)
-{
- struct memoryblock *mb = st->memory;
-
- while (mb != NULL)
- {
- void *old = mb;
- mb = mb->next;
- free (old);
- }
-
- if (st->null.string != NULL)
- free ((char *) st->null.string);
-
- free (st);
-}
-
-
-static struct Ebl_GStrent *
-newstring (struct Ebl_GStrtab *st, const char *str, size_t len)
-{
- /* Compute the amount of padding needed to make the structure aligned. */
- size_t align = ((__alignof__ (struct Ebl_GStrent)
- - (((uintptr_t) st->backp)
- & (__alignof__ (struct Ebl_GStrent) - 1)))
- & (__alignof__ (struct Ebl_GStrent) - 1));
-
- /* Make sure there is enough room in the memory block. */
- if (st->left < align + sizeof (struct Ebl_GStrent) + len * st->width)
- {
- morememory (st, sizeof (struct Ebl_GStrent) + len * st->width);
- align = 0;
- }
-
- /* Create the reserved string. */
- struct Ebl_GStrent *newstr = (struct Ebl_GStrent *) (st->backp + align);
- newstr->string = str;
- newstr->len = len;
- newstr->width = st->width;
- newstr->next = NULL;
- newstr->left = NULL;
- newstr->right = NULL;
- newstr->offset = 0;
- for (int i = len - 2; i >= 0; --i)
- for (int j = st->width - 1; j >= 0; --j)
- newstr->reverse[i * st->width + j] = str[(len - 2 - i) * st->width + j];
- for (size_t j = 0; j < st->width; ++j)
- newstr->reverse[(len - 1) * st->width + j] = '\0';
- st->backp += align + sizeof (struct Ebl_GStrent) + len * st->width;
- st->left -= align + sizeof (struct Ebl_GStrent) + len * st->width;
-
- return newstr;
-}
-
-
-/* XXX This function should definitely be rewritten to use a balancing
- tree algorith (AVL, red-black trees). For now a simple, correct
- implementation is enough. */
-static struct Ebl_GStrent **
-searchstring (struct Ebl_GStrent **sep, struct Ebl_GStrent *newstr)
-{
- int cmpres;
-
- /* More strings? */
- if (*sep == NULL)
- {
- *sep = newstr;
- return sep;
- }
-
- /* Compare the strings. */
- cmpres = memcmp ((*sep)->reverse, newstr->reverse,
- (MIN ((*sep)->len, newstr->len) - 1) * (*sep)->width);
- if (cmpres == 0)
- /* We found a matching string. */
- return sep;
- else if (cmpres > 0)
- return searchstring (&(*sep)->left, newstr);
- else
- return searchstring (&(*sep)->right, newstr);
-}
-
-
-/* Add new string. The actual string is assumed to be permanent. */
-struct Ebl_GStrent *
-ebl_gstrtabadd (struct Ebl_GStrtab *st, const char *str, size_t len)
-{
- struct Ebl_GStrent *newstr;
- struct Ebl_GStrent **sep;
-
- /* Compute the string length if the caller doesn't know it. */
- if (len == 0)
- {
- size_t j;
-
- do
- for (j = 0; j < st->width; ++j)
- if (str[len * st->width + j] != '\0')
- break;
- while (j == st->width && ++len);
- }
-
- /* Make sure all "" strings get offset 0 but only if the table was
- created with a special null entry in mind. */
- if (len == 1 && st->null.string != NULL)
- return &st->null;
-
- /* Allocate memory for the new string and its associated information. */
- newstr = newstring (st, str, len);
-
- /* Search in the array for the place to insert the string. If there
- is no string with matching prefix and no string with matching
- leading substring, create a new entry. */
- sep = searchstring (&st->root, newstr);
- if (*sep != newstr)
- {
- /* This is not the same entry. This means we have a prefix match. */
- if ((*sep)->len > newstr->len)
- {
- struct Ebl_GStrent *subs;
-
- /* Check whether we already know this string. */
- for (subs = (*sep)->next; subs != NULL; subs = subs->next)
- if (subs->len == newstr->len)
- {
- /* We have an exact match with a substring. Free the memory
- we allocated. */
- st->left += (st->backp - (char *) newstr) * st->width;
- st->backp = (char *) newstr;
-
- return subs;
- }
-
- /* We have a new substring. This means we don't need the reverse
- string of this entry anymore. */
- st->backp -= newstr->len;
- st->left += newstr->len;
-
- newstr->next = (*sep)->next;
- (*sep)->next = newstr;
- }
- else if ((*sep)->len != newstr->len)
- {
- /* When we get here it means that the string we are about to
- add has a common prefix with a string we already have but
- it is longer. In this case we have to put it first. */
- st->total += newstr->len - (*sep)->len;
- newstr->next = *sep;
- newstr->left = (*sep)->left;
- newstr->right = (*sep)->right;
- *sep = newstr;
- }
- else
- {
- /* We have an exact match. Free the memory we allocated. */
- st->left += (st->backp - (char *) newstr) * st->width;
- st->backp = (char *) newstr;
-
- newstr = *sep;
- }
- }
- else
- st->total += newstr->len;
-
- return newstr;
-}
-
-
-static void
-copystrings (struct Ebl_GStrent *nodep, char **freep, size_t *offsetp)
-{
- struct Ebl_GStrent *subs;
-
- if (nodep->left != NULL)
- copystrings (nodep->left, freep, offsetp);
-
- /* Process the current node. */
- nodep->offset = *offsetp;
- *freep = (char *) mempcpy (*freep, nodep->string, nodep->len * nodep->width);
- *offsetp += nodep->len * nodep->width;
-
- for (subs = nodep->next; subs != NULL; subs = subs->next)
- {
- assert (subs->len < nodep->len);
- subs->offset = nodep->offset + (nodep->len - subs->len) * nodep->width;
- assert (subs->offset != 0 || subs->string[0] == '\0');
- }
-
- if (nodep->right != NULL)
- copystrings (nodep->right, freep, offsetp);
-}
-
-
-void
-ebl_gstrtabfinalize (struct Ebl_GStrtab *st, Elf_Data *data)
-{
- size_t copylen;
- char *endp;
- size_t nulllen = st->nullstr ? st->width : 0;
-
- /* Fill in the information. */
- data->d_buf = malloc (st->total + nulllen);
- if (data->d_buf == NULL)
- abort ();
-
- /* The first byte must always be zero if we created the table with a
- null string. */
- if (st->nullstr)
- memset (data->d_buf, '\0', st->width);
-
- data->d_type = ELF_T_BYTE;
- data->d_size = st->total + nulllen;
- data->d_off = 0;
- data->d_align = 1;
- data->d_version = EV_CURRENT;
-
- /* Now run through the tree and add all the string while also updating
- the offset members of the elfstrent records. */
- endp = (char *) data->d_buf + nulllen;
- copylen = nulllen;
- copystrings (st->root, &endp, ©len);
- assert (copylen == st->total * st->width + nulllen);
-}
-
-
-size_t
-ebl_gstrtaboffset (struct Ebl_GStrent *se)
-{
- return se->offset;
-}
diff --git a/libebl/eblmachineflagname.c b/libebl/eblmachineflagname.c
index 6079a61..5f44077 100644
--- a/libebl/eblmachineflagname.c
+++ b/libebl/eblmachineflagname.c
@@ -33,6 +33,7 @@
#include <stdio.h>
#include <string.h>
+#include <system.h>
#include <libeblP.h>
diff --git a/libebl/eblobjecttypename.c b/libebl/eblobjecttypename.c
deleted file mode 100644
index b0fd372..0000000
--- a/libebl/eblobjecttypename.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Return object file type name.
- Copyright (C) 2001, 2002 Red Hat, Inc.
- This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
-
- 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 <libeblP.h>
-
-
-const char *
-ebl_object_type_name (Ebl *ebl, int object, char *buf, size_t len)
-{
- const char *res;
-
- res = ebl != NULL ? ebl->object_type_name (object, buf, len) : NULL;
- if (res == NULL)
- {
- /* Handle OS-specific section names. */
- if (object >= ET_LOOS && object <= ET_HIOS)
- snprintf (buf, len, "LOOS+%x", object - ET_LOOS);
- /* Handle processor-specific section names. */
- else if (object >= ET_LOPROC && object <= ET_HIPROC)
- snprintf (buf, len, "LOPROC+%x", object - ET_LOPROC);
- else
- snprintf (buf, len, "%s: %d", gettext ("<unknown>"), object);
-
- res = buf;
- }
-
- return res;
-}
diff --git a/libebl/eblobjnote.c b/libebl/eblobjnote.c
index f80a1a5..ca4f155 100644
--- a/libebl/eblobjnote.c
+++ b/libebl/eblobjnote.c
@@ -223,7 +223,7 @@
free (buf);
break;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
default:
/* Unknown type. */
diff --git a/libebl/eblobjnotetypename.c b/libebl/eblobjnotetypename.c
index 8e2e329..db040d2 100644
--- a/libebl/eblobjnotetypename.c
+++ b/libebl/eblobjnotetypename.c
@@ -1,5 +1,5 @@
/* Return note type name.
- Copyright (C) 2002, 2007, 2009, 2011 Red Hat, Inc.
+ Copyright (C) 2002, 2007, 2009, 2011, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -51,6 +51,39 @@
return buf;
}
+#define ELF_NOTE_GOPKGLIST 1
+#define ELF_NOTE_GOABIHASH 2
+#define ELF_NOTE_GODEPS 3
+#define ELF_NOTE_GOBUILDID 4
+
+ static const char *goknowntypes[] =
+ {
+#define KNOWNSTYPE(name) [ELF_NOTE_GO##name] = #name
+ KNOWNSTYPE (PKGLIST),
+ KNOWNSTYPE (ABIHASH),
+ KNOWNSTYPE (DEPS),
+ KNOWNSTYPE (BUILDID),
+#undef KNOWNSTYPE
+ };
+
+ if (strcmp (name, "Go") == 0)
+ {
+ if (type < sizeof (goknowntypes) / sizeof (goknowntypes[0])
+ && goknowntypes[type] != NULL)
+ return goknowntypes[type];
+ else
+ {
+ snprintf (buf, len, "%s: %" PRIu32, gettext ("<unknown>"), type);
+ return buf;
+ }
+ }
+
+ if (strcmp (name, "GNU") != 0)
+ {
+ snprintf (buf, len, "%s: %" PRIu32, gettext ("<unknown>"), type);
+ return buf;
+ }
+
static const char *knowntypes[] =
{
#define KNOWNSTYPE(name) [NT_##name] = #name
diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c
index 372ef2a..8b063f4 100644
--- a/libebl/eblopenbackend.c
+++ b/libebl/eblopenbackend.c
@@ -1,5 +1,5 @@
/* Generate ELF backend handle.
- Copyright (C) 2000-2015 Red Hat, Inc.
+ Copyright (C) 2000-2017 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -39,6 +39,7 @@
#include <string.h>
#include <stdio.h>
+#include <system.h>
#include <libeblP.h>
@@ -73,7 +74,7 @@
{ "s390", "ebl_s390", "s390", 4, EM_S390, 0, 0 },
{ "m32", "elf_m32", "m32", 3, EM_M32, 0, 0 },
- { "m68k", "elf_m68k", "m68k", 4, EM_68K, 0, 0 },
+ { "m68k", "elf_m68k", "m68k", 4, EM_68K, ELFCLASS32, ELFDATA2MSB },
{ "m88k", "elf_m88k", "m88k", 4, EM_88K, 0, 0 },
{ "i860", "elf_i860", "i860", 4, EM_860, 0, 0 },
{ "s370", "ebl_s370", "s370", 4, EM_S370, 0, 0 },
@@ -132,6 +133,9 @@
{ "arc", "elf_arc_a5", "arc_a5", 6, EM_ARC_A5, 0, 0 },
{ "xtensa", "elf_xtensa", "xtensa", 6, EM_XTENSA, 0, 0 },
{ "aarch64", "elf_aarch64", "aarch64", 7, EM_AARCH64, ELFCLASS64, 0 },
+ { "bpf", "elf_bpf", "bpf", 3, EM_BPF, 0, 0 },
+ { "riscv", "elf_riscv", "riscv", 5, EM_RISCV, ELFCLASS64, ELFDATA2LSB },
+ { "riscv", "elf_riscv", "riscv", 5, EM_RISCV, ELFCLASS32, ELFDATA2LSB },
};
#define nmachines (sizeof (machines) / sizeof (machines[0]))
@@ -139,8 +143,6 @@
#define MAX_PREFIX_LEN 16
/* Default callbacks. Mostly they just return the error value. */
-static const char *default_object_type_name (int ignore, char *buf,
- size_t len);
static const char *default_reloc_type_name (int ignore, char *buf, size_t len);
static bool default_reloc_type_check (int ignore);
static bool default_reloc_valid_use (Elf *elf, int ignore);
@@ -162,7 +164,6 @@
static const char *default_dynamic_tag_name (int64_t ignore, char *buf,
size_t len);
static bool default_dynamic_tag_check (int64_t ignore);
-static GElf_Word default_sh_flags_combine (GElf_Word flags1, GElf_Word flags2);
static const char *default_osabi_name (int ignore, char *buf, size_t len);
static void default_destr (struct ebl *ignore);
static const char *default_core_note_type_name (uint32_t, char *buf,
@@ -185,6 +186,7 @@
const GElf_Sym *sym,
const char *name,
const GElf_Shdr *destshdr);
+static bool default_data_marker_symbol (const GElf_Sym *sym, const char *sname);
static bool default_check_st_other_bits (unsigned char st_other);
static bool default_check_special_section (Ebl *, int,
const GElf_Shdr *, const char *);
@@ -209,7 +211,6 @@
static void
fill_defaults (Ebl *result)
{
- result->object_type_name = default_object_type_name;
result->reloc_type_name = default_reloc_type_name;
result->reloc_type_check = default_reloc_type_check;
result->reloc_valid_use = default_reloc_valid_use;
@@ -226,7 +227,6 @@
result->symbol_binding_name = default_symbol_binding_name;
result->dynamic_tag_name = default_dynamic_tag_name;
result->dynamic_tag_check = default_dynamic_tag_check;
- result->sh_flags_combine = default_sh_flags_combine;
result->osabi_name = default_osabi_name;
result->core_note_type_name = default_core_note_type_name;
result->object_note_type_name = default_object_note_type_name;
@@ -238,6 +238,7 @@
result->none_reloc_p = default_none_reloc_p;
result->relative_reloc_p = default_relative_reloc_p;
result->check_special_symbol = default_check_special_symbol;
+ result->data_marker_symbol = default_data_marker_symbol;
result->check_st_other_bits = default_check_st_other_bits;
result->bss_plt_p = default_bss_plt_p;
result->return_value_location = default_return_value_location;
@@ -430,14 +431,6 @@
/* Default callbacks. Mostly they just return the error value. */
static const char *
-default_object_type_name (int ignore __attribute__ ((unused)),
- char *buf __attribute__ ((unused)),
- size_t len __attribute__ ((unused)))
-{
- return NULL;
-}
-
-static const char *
default_reloc_type_name (int ignore __attribute__ ((unused)),
char *buf __attribute__ ((unused)),
size_t len __attribute__ ((unused)))
@@ -554,12 +547,6 @@
return false;
}
-static GElf_Word
-default_sh_flags_combine (GElf_Word flags1, GElf_Word flags2)
-{
- return SH_FLAGS_COMBINE (flags1, flags2);
-}
-
static void
default_destr (struct ebl *ignore __attribute__ ((unused)))
{
@@ -653,6 +640,13 @@
".gdb_index",
/* GNU/DWARF 5 extension/proposal */
".debug_macro",
+ /* DWARF 5 */
+ ".debug_addr",
+ ".debug_line_str",
+ ".debug_loclists",
+ ".debug_names",
+ ".debug_rnglists",
+ ".debug_str_offsets",
/* SGI/MIPS DWARF 2 extensions */
".debug_weaknames",
".debug_funcnames",
@@ -689,6 +683,13 @@
}
static bool
+default_data_marker_symbol (const GElf_Sym *sym __attribute__ ((unused)),
+ const char *sname __attribute__ ((unused)))
+{
+ return false;
+}
+
+static bool
default_check_st_other_bits (unsigned char st_other __attribute__ ((unused)))
{
return false;
diff --git a/libebl/eblwstrtab.c b/libebl/eblwstrtab.c
deleted file mode 100644
index 08e0ba7..0000000
--- a/libebl/eblwstrtab.c
+++ /dev/null
@@ -1,359 +0,0 @@
-/* ELF string table handling.
- Copyright (C) 2000, 2001, 2002 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 <inttypes.h>
-#include <libelf.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <wchar.h>
-#include <sys/param.h>
-
-#include "libebl.h"
-#include <system.h>
-
-#ifndef MIN
-# define MIN(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
-
-struct Ebl_WStrent
-{
- const wchar_t *string;
- size_t len;
- struct Ebl_WStrent *next;
- struct Ebl_WStrent *left;
- struct Ebl_WStrent *right;
- size_t offset;
- wchar_t reverse[0];
-};
-
-
-struct memoryblock
-{
- struct memoryblock *next;
- char memory[0];
-};
-
-
-struct Ebl_WStrtab
-{
- struct Ebl_WStrent *root;
- struct memoryblock *memory;
- char *backp;
- size_t left;
- size_t total;
- bool nullstr;
-
- struct Ebl_WStrent null;
-};
-
-
-/* Cache for the pagesize. We correct this value a bit so that `malloc'
- is not allocating more than a page. */
-static size_t ps;
-
-
-struct Ebl_WStrtab *
-ebl_wstrtabinit (bool nullstr)
-{
- struct Ebl_WStrtab *ret;
-
- if (ps == 0)
- {
- ps = sysconf (_SC_PAGESIZE) - 2 * sizeof (void *);
- assert (sizeof (struct memoryblock) < ps);
- }
-
- ret = (struct Ebl_WStrtab *) calloc (1, sizeof (struct Ebl_WStrtab));
- if (ret != NULL)
- {
- ret->nullstr = nullstr;
- if (nullstr)
- {
- ret->null.len = 1;
- ret->null.string = L"";
- }
- }
- return ret;
-}
-
-
-static int
-morememory (struct Ebl_WStrtab *st, size_t len)
-{
- struct memoryblock *newmem;
-
- if (len < ps)
- len = ps;
- newmem = (struct memoryblock *) malloc (len);
- if (newmem == NULL)
- return 1;
-
- newmem->next = st->memory;
- st->memory = newmem;
- st->backp = newmem->memory;
- st->left = len - offsetof (struct memoryblock, memory);
-
- return 0;
-}
-
-
-void
-ebl_wstrtabfree (struct Ebl_WStrtab *st)
-{
- struct memoryblock *mb = st->memory;
-
- while (mb != NULL)
- {
- void *old = mb;
- mb = mb->next;
- free (old);
- }
-
- free (st);
-}
-
-
-static struct Ebl_WStrent *
-newstring (struct Ebl_WStrtab *st, const wchar_t *str, size_t len)
-{
- struct Ebl_WStrent *newstr;
- size_t align;
- int i;
-
- /* Compute the amount of padding needed to make the structure aligned. */
- align = ((__alignof__ (struct Ebl_WStrent)
- - (((uintptr_t) st->backp)
- & (__alignof__ (struct Ebl_WStrent) - 1)))
- & (__alignof__ (struct Ebl_WStrent) - 1));
-
- /* Make sure there is enough room in the memory block. */
- if (st->left < align + sizeof (struct Ebl_WStrent) + len * sizeof (wchar_t))
- {
- if (morememory (st,
- sizeof (struct Ebl_WStrent) + len * sizeof (wchar_t)))
- return NULL;
-
- align = 0;
- }
-
- /* Create the reserved string. */
- newstr = (struct Ebl_WStrent *) (st->backp + align);
- newstr->string = str;
- newstr->len = len;
- newstr->next = NULL;
- newstr->left = NULL;
- newstr->right = NULL;
- newstr->offset = 0;
- for (i = len - 2; i >= 0; --i)
- newstr->reverse[i] = str[len - 2 - i];
- newstr->reverse[len - 1] = L'\0';
- st->backp += align + sizeof (struct Ebl_WStrent) + len * sizeof (wchar_t);
- st->left -= align + sizeof (struct Ebl_WStrent) + len * sizeof (wchar_t);
-
- return newstr;
-}
-
-
-/* XXX This function should definitely be rewritten to use a balancing
- tree algorith (AVL, red-black trees). For now a simple, correct
- implementation is enough. */
-static struct Ebl_WStrent **
-searchstring (struct Ebl_WStrent **sep, struct Ebl_WStrent *newstr)
-{
- int cmpres;
-
- /* More strings? */
- if (*sep == NULL)
- {
- *sep = newstr;
- return sep;
- }
-
- /* Compare the strings. */
- cmpres = wmemcmp ((*sep)->reverse, newstr->reverse,
- MIN ((*sep)->len, newstr->len) - 1);
- if (cmpres == 0)
- /* We found a matching string. */
- return sep;
- else if (cmpres > 0)
- return searchstring (&(*sep)->left, newstr);
- else
- return searchstring (&(*sep)->right, newstr);
-}
-
-
-/* Add new string. The actual string is assumed to be permanent. */
-struct Ebl_WStrent *
-ebl_wstrtabadd (struct Ebl_WStrtab *st, const wchar_t *str, size_t len)
-{
- struct Ebl_WStrent *newstr;
- struct Ebl_WStrent **sep;
-
- /* Compute the string length if the caller doesn't know it. */
- if (len == 0)
- len = wcslen (str) + 1;
-
- /* Make sure all "" strings get offset 0 but only if the table was
- created with a special null entry in mind. */
- if (len == 1 && st->null.string != NULL)
- return &st->null;
-
- /* Allocate memory for the new string and its associated information. */
- newstr = newstring (st, str, len);
- if (newstr == NULL)
- return NULL;
-
- /* Search in the array for the place to insert the string. If there
- is no string with matching prefix and no string with matching
- leading substring, create a new entry. */
- sep = searchstring (&st->root, newstr);
- if (*sep != newstr)
- {
- /* This is not the same entry. This means we have a prefix match. */
- if ((*sep)->len > newstr->len)
- {
- struct Ebl_WStrent *subs;
-
- /* Check whether we already know this string. */
- for (subs = (*sep)->next; subs != NULL; subs = subs->next)
- if (subs->len == newstr->len)
- {
- /* We have an exact match with a substring. Free the memory
- we allocated. */
- st->left += st->backp - (char *) newstr;
- st->backp = (char *) newstr;
-
- return subs;
- }
-
- /* We have a new substring. This means we don't need the reverse
- string of this entry anymore. */
- st->backp -= newstr->len;
- st->left += newstr->len;
-
- newstr->next = (*sep)->next;
- (*sep)->next = newstr;
- }
- else if ((*sep)->len != newstr->len)
- {
- /* When we get here it means that the string we are about to
- add has a common prefix with a string we already have but
- it is longer. In this case we have to put it first. */
- st->total += newstr->len - (*sep)->len;
- newstr->next = *sep;
- newstr->left = (*sep)->left;
- newstr->right = (*sep)->right;
- *sep = newstr;
- }
- else
- {
- /* We have an exact match. Free the memory we allocated. */
- st->left += st->backp - (char *) newstr;
- st->backp = (char *) newstr;
-
- newstr = *sep;
- }
- }
- else
- st->total += newstr->len;
-
- return newstr;
-}
-
-
-static void
-copystrings (struct Ebl_WStrent *nodep, wchar_t **freep, size_t *offsetp)
-{
- struct Ebl_WStrent *subs;
-
- if (nodep->left != NULL)
- copystrings (nodep->left, freep, offsetp);
-
- /* Process the current node. */
- nodep->offset = *offsetp;
- *freep = wmempcpy (*freep, nodep->string, nodep->len);
- *offsetp += nodep->len * sizeof (wchar_t);
-
- for (subs = nodep->next; subs != NULL; subs = subs->next)
- {
- assert (subs->len < nodep->len);
- subs->offset = nodep->offset + nodep->len - subs->len;
- assert (subs->offset != 0 || subs->string[0] == '\0');
- }
-
- if (nodep->right != NULL)
- copystrings (nodep->right, freep, offsetp);
-}
-
-
-void
-ebl_wstrtabfinalize (struct Ebl_WStrtab *st, Elf_Data *data)
-{
- size_t copylen;
- wchar_t *endp;
- size_t nulllen = st->nullstr ? 1 : 0;
-
- /* Fill in the information. */
- data->d_buf = malloc ((st->total + nulllen) * sizeof (wchar_t));
- if (data->d_buf == NULL)
- abort ();
-
- /* The first byte must always be zero if we created the table with a
- null string. */
- if (st->nullstr)
- *((wchar_t *) data->d_buf) = L'\0';
-
- data->d_type = ELF_T_BYTE;
- data->d_size = st->total + nulllen;
- data->d_off = 0;
- data->d_align = 1;
- data->d_version = EV_CURRENT;
-
- /* Now run through the tree and add all the string while also updating
- the offset members of the elfstrent records. */
- endp = (wchar_t *) data->d_buf + nulllen;
- copylen = sizeof (wchar_t) * nulllen;
- copystrings (st->root, &endp, ©len);
- assert (copylen == (st->total + nulllen) * sizeof (wchar_t));
-}
-
-
-size_t
-ebl_wstrtaboffset (struct Ebl_WStrent *se)
-{
- return se->offset;
-}
diff --git a/libebl/libebl.h b/libebl/libebl.h
index efcb6d6..882bdb9 100644
--- a/libebl/libebl.h
+++ b/libebl/libebl.h
@@ -1,5 +1,5 @@
/* Interface for libebl.
- Copyright (C) 2000-2010, 2013, 2014, 2015 Red Hat, Inc.
+ Copyright (C) 2000-2010, 2013, 2014, 2015, 2016, 2017 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -73,13 +73,13 @@
/* Information about the descriptor. */
/* Get ELF machine. */
-extern int ebl_get_elfmachine (Ebl *ebl) __attribute__ ((__pure__));
+extern int ebl_get_elfmachine (Ebl *ebl) __pure_attribute__;
/* Get ELF class. */
-extern int ebl_get_elfclass (Ebl *ebl) __attribute__ ((__pure__));
+extern int ebl_get_elfclass (Ebl *ebl) __pure_attribute__;
/* Get ELF data encoding. */
-extern int ebl_get_elfdata (Ebl *ebl) __attribute__ ((__pure__));
+extern int ebl_get_elfdata (Ebl *ebl) __pure_attribute__;
/* Function to call the callback functions including default ELF
@@ -89,10 +89,6 @@
extern const char *ebl_backend_name (Ebl *ebl);
/* Return relocation type name. */
-extern const char *ebl_object_type_name (Ebl *ebl, int object,
- char *buf, size_t len);
-
-/* Return relocation type name. */
extern const char *ebl_reloc_type_name (Ebl *ebl, int reloc,
char *buf, size_t len);
@@ -160,13 +156,13 @@
const GElf_Sym *sym, const char *name,
const GElf_Shdr *destshdr);
+/* Check if this is a data marker symbol. e.g. '$d' symbols for ARM. */
+extern bool ebl_data_marker_symbol (Ebl *ebl, const GElf_Sym *sym,
+ const char *sname);
+
/* Check whether only valid bits are set on the st_other symbol flag. */
extern bool ebl_check_st_other_bits (Ebl *ebl, unsigned char st_other);
-/* Return combined section header flags value. */
-extern GElf_Word ebl_sh_flags_combine (Ebl *ebl, GElf_Word flags1,
- GElf_Word flags2);
-
/* Return symbolic representation of OS ABI. */
extern const char *ebl_osabi_name (Ebl *ebl, int osabi, char *buf, size_t len);
@@ -295,75 +291,6 @@
extern int ebl_abi_cfi (Ebl *ebl, Dwarf_CIE *abi_info)
__nonnull_attribute__ (2);
-/* ELF string table handling. */
-struct Ebl_Strtab;
-struct Ebl_Strent;
-
-/* Create new ELF string table object in memory. */
-extern struct Ebl_Strtab *ebl_strtabinit (bool nullstr);
-
-/* Free resources allocated for ELF string table ST. */
-extern void ebl_strtabfree (struct Ebl_Strtab *st);
-
-/* Add string STR (length LEN is != 0) to ELF string table ST. */
-extern struct Ebl_Strent *ebl_strtabadd (struct Ebl_Strtab *st,
- const char *str, size_t len);
-
-/* Finalize string table ST and store size and memory location information
- in DATA. */
-extern void ebl_strtabfinalize (struct Ebl_Strtab *st, Elf_Data *data);
-
-/* Get offset in string table for string associated with SE. */
-extern size_t ebl_strtaboffset (struct Ebl_Strent *se);
-
-/* Return the string associated with SE. */
-extern const char *ebl_string (struct Ebl_Strent *se);
-
-
-/* ELF wide char string table handling. */
-struct Ebl_WStrtab;
-struct Ebl_WStrent;
-
-/* Create new ELF wide char string table object in memory. */
-extern struct Ebl_WStrtab *ebl_wstrtabinit (bool nullstr);
-
-/* Free resources allocated for ELF wide char string table ST. */
-extern void ebl_wstrtabfree (struct Ebl_WStrtab *st);
-
-/* Add string STR (length LEN is != 0) to ELF string table ST. */
-extern struct Ebl_WStrent *ebl_wstrtabadd (struct Ebl_WStrtab *st,
- const wchar_t *str, size_t len);
-
-/* Finalize string table ST and store size and memory location information
- in DATA. */
-extern void ebl_wstrtabfinalize (struct Ebl_WStrtab *st, Elf_Data *data);
-
-/* Get offset in wide char string table for string associated with SE. */
-extern size_t ebl_wstrtaboffset (struct Ebl_WStrent *se);
-
-
-/* Generic string table handling. */
-struct Ebl_GStrtab;
-struct Ebl_GStrent;
-
-/* Create new string table object in memory. */
-extern struct Ebl_GStrtab *ebl_gstrtabinit (unsigned int width, bool nullstr);
-
-/* Free resources allocated for string table ST. */
-extern void ebl_gstrtabfree (struct Ebl_GStrtab *st);
-
-/* Add string STR (length LEN is != 0) to string table ST. */
-extern struct Ebl_GStrent *ebl_gstrtabadd (struct Ebl_GStrtab *st,
- const char *str, size_t len);
-
-/* Finalize string table ST and store size and memory location information
- in DATA. */
-extern void ebl_gstrtabfinalize (struct Ebl_GStrtab *st, Elf_Data *data);
-
-/* Get offset in wide char string table for string associated with SE. */
-extern size_t ebl_gstrtaboffset (struct Ebl_GStrent *se);
-
-
/* Register map info. */
typedef struct
{
diff --git a/libelf/ChangeLog b/libelf/ChangeLog
index afe6a6a..91d9b47 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -1,3 +1,191 @@
+2018-06-19 Mark Wielaard <mark@klomp.org>
+
+ * libelfP.h (__libelf_type_align): Remove !ALLOW_UNALIGNED guard.
+ * elf_getdata.c (__libelf_type_aligns): Likewise.
+ (convert_data): Remove ALLOW_UNALIGNED check.
+ * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Likewise.
+
+2018-06-21 Mark Wielaard <mark@klomp.org>
+
+ * elf.h: Update from glibc.
+
+2018-04-19 Andreas Schwab <schwab@suse.de>
+
+ * elf.h: Update from glibc.
+
+2018-02-16 Mark Wielaard <mark@klomp.org>
+
+ * elf.h: Update from glibc.
+
+2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
+
+ * elf32_updatenull.c (updatenull_wrlock): Use FALLTHROUGH macro
+ instead of comment.
+ * elf_begin.c (read_unmmaped_file): Likewise.
+ (elf_begin): Likewise.
+ * elf_cntl.c (elf_cntl): Likewise.
+
+2017-10-04 Mark Wielaard <mark@klomp.org>
+
+ * elf_begin.c (file_read_elf): Skip sanity checking e_shoff if scncnt
+ is zero, we won't use it then.
+
+2017-10-04 Mark Wielaard <mark@klomp.org>
+
+ * libelfP.h: Add ELF_E_INVALID_ELF to error values enum.
+ * elf_error.c (ELF_E_INVALID_ELF_IDX): New define. Use it as value
+ for ELF_E_INVALID_ELF in msgidx.
+ * elf_getshdrstrndx.c (elf_getshdrstrndx): Distinquish between pread
+ failing and not having enough data.
+ * elf_begin.c (get_shnum): Likewise. Explicitly set libelf errno on
+ too large value.
+ (file_read_elf): Make sure to always set libelf errno when returning
+ NULL. Distinquish between i/o file and elf data errors.
+
+2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
+
+ * gelf_xlate.c: Use attribute_packed.
+
+2017-04-27 Ulf Hermann <ulf.hermann@qt.io>
+
+ * libelfP.h: Use attribute_hidden.
+
+2017-04-27 Ulf Hermann <ulf.hermann@qt.io>
+
+ * Makefile.am: Use fpic_CFLAGS and dso_LDFLAGS.
+
+2017-08-15 Mark Wielaard <mark@klomp.org>
+
+ * elf.h: Update from glibc. Add new powerpc note descriptors.
+
+2017-07-19 Gustavo Romero <gromero@linux.vnet.ibm.com>
+
+ * elf.h: Add known type in notes segment descriptor for HTM SPRs.
+
+2017-02-17 Ulf hermann <ulf.hermann@qt.io>
+
+ * Makefile.am: Add libelf_so_DEPS, which include libeu.a,
+ libelf_so_LIBS.
+ (libelf_so_LDLIBS): Add $(libelf_so_DEPS).
+ (libelf.so$(EXEEXT): Use $(libelf_so_LIBS), require libelf.map
+ from the right directory.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * libelfP.h: Don't include config.h.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * elf_begin.c: Use F_GETFD rather than F_GETFL.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * libelf.h: Define macros for various function attributes and use
+ them.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * elf_update.c: Set ELF_F_MMAPPED flag if we mmap from elf_update.
+
+2017-04-19 Mark Wielaard <mark@klomp.org>
+
+ * elf_getarsym.c (elf_getarsym): Initialize n to zero.
+
+2017-03-27 Mark Wielaard <mark@klomp.org>
+
+ * elf32_updatefile.c (updatemmap): Always update last_positition.
+ (updatefile): Likewise.
+
+2017-03-24 Mark Wielaard <mark@klomp.org>
+
+ * elf_compress.c (__libelf_decompress): Check insane compression
+ ratios before trying to allocate output buffer.
+
+2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+ Mark Wielaard <mjw@redhat.com>
+
+ * gelf.h (gelf_newehdr): Change return type to void *.
+ (gelf_newphdr): Likewise.
+ * gelf_newehdr.c (gelf_newehdr): Likewise.
+ * gelf_newphdr.c (gelf_newphdr): Likewise.
+
+2016-10-21 Mark Wielaard <mjw@redhat.com>
+
+ * elf_getdata.c (__libelf_set_rawdata_wrlock): Sanity check
+ offset and size before trying to malloc and read data.
+
+2016-10-26 Mark Wielaard <mjw@redhat.com>
+
+ * elf_begin.c (read_file): Always set maxsize when parent == NULL.
+
+2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+
+ * elf_getarsym.c (elf_getarsym): Open code rawmemchr when not
+ available.
+ * elf_strptr.c: Include stdbool.h.
+ (validate_str): New function.
+ (elf_strptr): Use validate_str instead of memrchr.
+
+2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+
+ * elf32_updatefile.c: Remove sys/param.h include.
+ * elf32_updatenull.c: Likewise. Add system.h include.
+ * elf_begin.c: Remove sys/param.h.
+ * elf_compress: Likewise. Add system.h include.
+ (MAX): Remove definition.
+
+2016-08-07 Mark Wielaard <mjw@redhat.com>
+
+ * elf_compress.c (__libelf_reset_rawdata): Check scn->flags and
+ free rawdata_base when malloced. Set ELF_F_MALLOCED for scn->flags.
+ * elf_end.c (elf_end): Check scn->flags and free rawdata_base if
+ malloced.
+ * libelfP.h (struct Elf_Scn): Document flags ELF_F_MALLOCED usage.
+
+2016-07-06 Mark Wielaard <mjw@redhat.com>
+
+ * elf-knowledge.h (SH_FLAGS_COMBINE): Removed.
+ (SH_FLAGS_IMPORTANT): Likewise.
+
+2016-07-06 Mark Wielaard <mjw@redhat.com>
+
+ * elf32_updatenull.c (updatenull_wrlock): Ignore e_type when
+ updating phdrs.
+ * elf_getphdrnum.c (__elf_getphdrnum_chk_rdlock): Only do sanity
+ checking if phdrs haven't been read in yet.
+
+2016-06-24 John Ogness <john.ogness@linutronix.de>
+
+ * elf32_updatenull.c (updatenull_wrlock): Find first section.
+ * elf_nextscn.c (elf_nextscn): When scn is NULL start from 0th
+ section.
+
+2016-06-28 Richard Henderson <rth@redhat.com>
+
+ * elf.h: Update from glibc. Add lots of new EM_* definitions.
+
+2016-04-14 Mark Wielaard <mjw@redhat.com>
+
+ * elf_compress.c (__libelf_compress): Free out_buf if deflateInit
+ fails.
+
+2016-02-13 Mark Wielaard <mjw@redhat.com>
+
+ * elf32_updatefile.c (updatemmap): Free scns when out of memory.
+
+2016-01-28 Mark Wielaard <mjw@redhat.com>
+
+ * elf.h: Update from glibc. Add new i386 and x86_64 relocations.
+
+2016-02-12 Mark Wielaard <mjw@redhat.com>
+
+ * elf.h: Update from glibc. Add NT_ARM_SYSTEM_CALL.
+
+2016-02-04 Mark Wielaard <mjw@redhat.com>
+
+ * elf_getdata.c (__libelf_set_rawdata_wrlock): Don't adjust align
+ for SHT_NOBITS sections.
+
2016-01-22 Chih-Hung Hsieh <chh@google.com>
* elf_compress.c (__libelf_compress): Move nested function
diff --git a/libelf/Makefile.am b/libelf/Makefile.am
index 167a832..ddaeaa2 100644
--- a/libelf/Makefile.am
+++ b/libelf/Makefile.am
@@ -29,7 +29,7 @@
##
include $(top_srcdir)/config/eu.am
if BUILD_STATIC
-AM_CFLAGS += -fPIC
+AM_CFLAGS += $(fpic_CFLAGS)
endif
GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
VERSION = 1
@@ -95,16 +95,20 @@
libelf_pic_a_SOURCES =
am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
-libelf_so_LDLIBS = -lz
+libelf_so_DEPS = ../lib/libeu.a
+libelf_so_LDLIBS = $(libelf_so_DEPS) -lz
if USE_LOCKS
libelf_so_LDLIBS += -lpthread
endif
+libelf_so_LIBS = libelf_pic.a
libelf_so_SOURCES =
-libelf.so$(EXEEXT): libelf_pic.a libelf.map
- $(AM_V_CCLD)$(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
- -Wl,--version-script,$(srcdir)/libelf.map,--no-undefined \
- -Wl,--soname,$@.$(VERSION),-z,defs,-z,relro $(libelf_so_LDLIBS)
+libelf.so$(EXEEXT): $(srcdir)/libelf.map $(libelf_so_LIBS) $(libelf_so_DEPS)
+ $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
+ -Wl,--soname,$@.$(VERSION) \
+ -Wl,--version-script,$<,--no-undefined \
+ -Wl,--whole-archive $(libelf_so_LIBS) -Wl,--no-whole-archive \
+ $(libelf_so_LDLIBS)
@$(textrel_check)
$(AM_V_at)ln -fs $@ $@.$(VERSION)
diff --git a/libelf/elf-knowledge.h b/libelf/elf-knowledge.h
index 24534b3..64f5887 100644
--- a/libelf/elf-knowledge.h
+++ b/libelf/elf-knowledge.h
@@ -1,5 +1,5 @@
/* Accumulation of various pieces of knowledge about ELF.
- Copyright (C) 2000-2012, 2014 Red Hat, Inc.
+ Copyright (C) 2000-2012, 2014, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2000.
@@ -62,30 +62,6 @@
|| ((Shdr)->sh_flags & SHF_INFO_LINK) != 0)
-/* When combining ELF section flags we must distinguish two kinds:
-
- - flags which cause problem if not added to the result even if not
- present in all input sections
-
- - flags which cause problem if added to the result if not present
- in all input sections
-
- The following definition is for the general case. There might be
- machine specific extensions. */
-#define SH_FLAGS_COMBINE(Flags1, Flags2) \
- (((Flags1 | Flags2) \
- & (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR | SHF_LINK_ORDER \
- | SHF_OS_NONCONFORMING | SHF_GROUP)) \
- | (Flags1 & Flags2 & (SHF_MERGE | SHF_STRINGS | SHF_INFO_LINK)))
-
-/* Similar macro: return the bits of the flags which necessarily must
- match if two sections are automatically combined. Sections still
- can be forcefully combined in which case SH_FLAGS_COMBINE can be
- used to determine the combined flags. */
-#define SH_FLAGS_IMPORTANT(Flags) \
- ((Flags) & ~((GElf_Xword) 0 | SHF_LINK_ORDER | SHF_OS_NONCONFORMING))
-
-
/* Size of an entry in the hash table. The ELF specification says all
entries are regardless of platform 32-bits in size. Early 64-bit
ports (namely Alpha for Linux) got this wrong. The wording was not
diff --git a/libelf/elf.h b/libelf/elf.h
index 12feb91..75043bc 100644
--- a/libelf/elf.h
+++ b/libelf/elf.h
@@ -1,5 +1,5 @@
/* This file defines standard ELF types, structures, and macros.
- Copyright (C) 1995-2015 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -172,89 +172,200 @@
/* Legal values for e_machine (architecture). */
-#define EM_NONE 0 /* No machine */
-#define EM_M32 1 /* AT&T WE 32100 */
-#define EM_SPARC 2 /* SUN SPARC */
-#define EM_386 3 /* Intel 80386 */
-#define EM_68K 4 /* Motorola m68k family */
-#define EM_88K 5 /* Motorola m88k family */
-#define EM_860 7 /* Intel 80860 */
-#define EM_MIPS 8 /* MIPS R3000 big-endian */
-#define EM_S370 9 /* IBM System/370 */
-#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */
+#define EM_NONE 0 /* No machine */
+#define EM_M32 1 /* AT&T WE 32100 */
+#define EM_SPARC 2 /* SUN SPARC */
+#define EM_386 3 /* Intel 80386 */
+#define EM_68K 4 /* Motorola m68k family */
+#define EM_88K 5 /* Motorola m88k family */
+#define EM_IAMCU 6 /* Intel MCU */
+#define EM_860 7 /* Intel 80860 */
+#define EM_MIPS 8 /* MIPS R3000 big-endian */
+#define EM_S370 9 /* IBM System/370 */
+#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */
+ /* reserved 11-14 */
+#define EM_PARISC 15 /* HPPA */
+ /* reserved 16 */
+#define EM_VPP500 17 /* Fujitsu VPP500 */
+#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
+#define EM_960 19 /* Intel 80960 */
+#define EM_PPC 20 /* PowerPC */
+#define EM_PPC64 21 /* PowerPC 64-bit */
+#define EM_S390 22 /* IBM S390 */
+#define EM_SPU 23 /* IBM SPU/SPC */
+ /* reserved 24-35 */
+#define EM_V800 36 /* NEC V800 series */
+#define EM_FR20 37 /* Fujitsu FR20 */
+#define EM_RH32 38 /* TRW RH-32 */
+#define EM_RCE 39 /* Motorola RCE */
+#define EM_ARM 40 /* ARM */
+#define EM_FAKE_ALPHA 41 /* Digital Alpha */
+#define EM_SH 42 /* Hitachi SH */
+#define EM_SPARCV9 43 /* SPARC v9 64-bit */
+#define EM_TRICORE 44 /* Siemens Tricore */
+#define EM_ARC 45 /* Argonaut RISC Core */
+#define EM_H8_300 46 /* Hitachi H8/300 */
+#define EM_H8_300H 47 /* Hitachi H8/300H */
+#define EM_H8S 48 /* Hitachi H8S */
+#define EM_H8_500 49 /* Hitachi H8/500 */
+#define EM_IA_64 50 /* Intel Merced */
+#define EM_MIPS_X 51 /* Stanford MIPS-X */
+#define EM_COLDFIRE 52 /* Motorola Coldfire */
+#define EM_68HC12 53 /* Motorola M68HC12 */
+#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator */
+#define EM_PCP 55 /* Siemens PCP */
+#define EM_NCPU 56 /* Sony nCPU embeeded RISC */
+#define EM_NDR1 57 /* Denso NDR1 microprocessor */
+#define EM_STARCORE 58 /* Motorola Start*Core processor */
+#define EM_ME16 59 /* Toyota ME16 processor */
+#define EM_ST100 60 /* STMicroelectronic ST100 processor */
+#define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam */
+#define EM_X86_64 62 /* AMD x86-64 architecture */
+#define EM_PDSP 63 /* Sony DSP Processor */
+#define EM_PDP10 64 /* Digital PDP-10 */
+#define EM_PDP11 65 /* Digital PDP-11 */
+#define EM_FX66 66 /* Siemens FX66 microcontroller */
+#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */
+#define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */
+#define EM_68HC16 69 /* Motorola MC68HC16 microcontroller */
+#define EM_68HC11 70 /* Motorola MC68HC11 microcontroller */
+#define EM_68HC08 71 /* Motorola MC68HC08 microcontroller */
+#define EM_68HC05 72 /* Motorola MC68HC05 microcontroller */
+#define EM_SVX 73 /* Silicon Graphics SVx */
+#define EM_ST19 74 /* STMicroelectronics ST19 8 bit mc */
+#define EM_VAX 75 /* Digital VAX */
+#define EM_CRIS 76 /* Axis Communications 32-bit emb.proc */
+#define EM_JAVELIN 77 /* Infineon Technologies 32-bit emb.proc */
+#define EM_FIREPATH 78 /* Element 14 64-bit DSP Processor */
+#define EM_ZSP 79 /* LSI Logic 16-bit DSP Processor */
+#define EM_MMIX 80 /* Donald Knuth's educational 64-bit proc */
+#define EM_HUANY 81 /* Harvard University machine-independent object files */
+#define EM_PRISM 82 /* SiTera Prism */
+#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */
+#define EM_FR30 84 /* Fujitsu FR30 */
+#define EM_D10V 85 /* Mitsubishi D10V */
+#define EM_D30V 86 /* Mitsubishi D30V */
+#define EM_V850 87 /* NEC v850 */
+#define EM_M32R 88 /* Mitsubishi M32R */
+#define EM_MN10300 89 /* Matsushita MN10300 */
+#define EM_MN10200 90 /* Matsushita MN10200 */
+#define EM_PJ 91 /* picoJava */
+#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */
+#define EM_ARC_COMPACT 93 /* ARC International ARCompact */
+#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */
+#define EM_VIDEOCORE 95 /* Alphamosaic VideoCore */
+#define EM_TMM_GPP 96 /* Thompson Multimedia General Purpose Proc */
+#define EM_NS32K 97 /* National Semi. 32000 */
+#define EM_TPC 98 /* Tenor Network TPC */
+#define EM_SNP1K 99 /* Trebia SNP 1000 */
+#define EM_ST200 100 /* STMicroelectronics ST200 */
+#define EM_IP2K 101 /* Ubicom IP2xxx */
+#define EM_MAX 102 /* MAX processor */
+#define EM_CR 103 /* National Semi. CompactRISC */
+#define EM_F2MC16 104 /* Fujitsu F2MC16 */
+#define EM_MSP430 105 /* Texas Instruments msp430 */
+#define EM_BLACKFIN 106 /* Analog Devices Blackfin DSP */
+#define EM_SE_C33 107 /* Seiko Epson S1C33 family */
+#define EM_SEP 108 /* Sharp embedded microprocessor */
+#define EM_ARCA 109 /* Arca RISC */
+#define EM_UNICORE 110 /* PKU-Unity & MPRC Peking Uni. mc series */
+#define EM_EXCESS 111 /* eXcess configurable cpu */
+#define EM_DXP 112 /* Icera Semi. Deep Execution Processor */
+#define EM_ALTERA_NIOS2 113 /* Altera Nios II */
+#define EM_CRX 114 /* National Semi. CompactRISC CRX */
+#define EM_XGATE 115 /* Motorola XGATE */
+#define EM_C166 116 /* Infineon C16x/XC16x */
+#define EM_M16C 117 /* Renesas M16C */
+#define EM_DSPIC30F 118 /* Microchip Technology dsPIC30F */
+#define EM_CE 119 /* Freescale Communication Engine RISC */
+#define EM_M32C 120 /* Renesas M32C */
+ /* reserved 121-130 */
+#define EM_TSK3000 131 /* Altium TSK3000 */
+#define EM_RS08 132 /* Freescale RS08 */
+#define EM_SHARC 133 /* Analog Devices SHARC family */
+#define EM_ECOG2 134 /* Cyan Technology eCOG2 */
+#define EM_SCORE7 135 /* Sunplus S+core7 RISC */
+#define EM_DSP24 136 /* New Japan Radio (NJR) 24-bit DSP */
+#define EM_VIDEOCORE3 137 /* Broadcom VideoCore III */
+#define EM_LATTICEMICO32 138 /* RISC for Lattice FPGA */
+#define EM_SE_C17 139 /* Seiko Epson C17 */
+#define EM_TI_C6000 140 /* Texas Instruments TMS320C6000 DSP */
+#define EM_TI_C2000 141 /* Texas Instruments TMS320C2000 DSP */
+#define EM_TI_C5500 142 /* Texas Instruments TMS320C55x DSP */
+#define EM_TI_ARP32 143 /* Texas Instruments App. Specific RISC */
+#define EM_TI_PRU 144 /* Texas Instruments Prog. Realtime Unit */
+ /* reserved 145-159 */
+#define EM_MMDSP_PLUS 160 /* STMicroelectronics 64bit VLIW DSP */
+#define EM_CYPRESS_M8C 161 /* Cypress M8C */
+#define EM_R32C 162 /* Renesas R32C */
+#define EM_TRIMEDIA 163 /* NXP Semi. TriMedia */
+#define EM_QDSP6 164 /* QUALCOMM DSP6 */
+#define EM_8051 165 /* Intel 8051 and variants */
+#define EM_STXP7X 166 /* STMicroelectronics STxP7x */
+#define EM_NDS32 167 /* Andes Tech. compact code emb. RISC */
+#define EM_ECOG1X 168 /* Cyan Technology eCOG1X */
+#define EM_MAXQ30 169 /* Dallas Semi. MAXQ30 mc */
+#define EM_XIMO16 170 /* New Japan Radio (NJR) 16-bit DSP */
+#define EM_MANIK 171 /* M2000 Reconfigurable RISC */
+#define EM_CRAYNV2 172 /* Cray NV2 vector architecture */
+#define EM_RX 173 /* Renesas RX */
+#define EM_METAG 174 /* Imagination Tech. META */
+#define EM_MCST_ELBRUS 175 /* MCST Elbrus */
+#define EM_ECOG16 176 /* Cyan Technology eCOG16 */
+#define EM_CR16 177 /* National Semi. CompactRISC CR16 */
+#define EM_ETPU 178 /* Freescale Extended Time Processing Unit */
+#define EM_SLE9X 179 /* Infineon Tech. SLE9X */
+#define EM_L10M 180 /* Intel L10M */
+#define EM_K10M 181 /* Intel K10M */
+ /* reserved 182 */
+#define EM_AARCH64 183 /* ARM AARCH64 */
+ /* reserved 184 */
+#define EM_AVR32 185 /* Amtel 32-bit microprocessor */
+#define EM_STM8 186 /* STMicroelectronics STM8 */
+#define EM_TILE64 187 /* Tileta TILE64 */
+#define EM_TILEPRO 188 /* Tilera TILEPro */
+#define EM_MICROBLAZE 189 /* Xilinx MicroBlaze */
+#define EM_CUDA 190 /* NVIDIA CUDA */
+#define EM_TILEGX 191 /* Tilera TILE-Gx */
+#define EM_CLOUDSHIELD 192 /* CloudShield */
+#define EM_COREA_1ST 193 /* KIPO-KAIST Core-A 1st gen. */
+#define EM_COREA_2ND 194 /* KIPO-KAIST Core-A 2nd gen. */
+#define EM_ARC_COMPACT2 195 /* Synopsys ARCompact V2 */
+#define EM_OPEN8 196 /* Open8 RISC */
+#define EM_RL78 197 /* Renesas RL78 */
+#define EM_VIDEOCORE5 198 /* Broadcom VideoCore V */
+#define EM_78KOR 199 /* Renesas 78KOR */
+#define EM_56800EX 200 /* Freescale 56800EX DSC */
+#define EM_BA1 201 /* Beyond BA1 */
+#define EM_BA2 202 /* Beyond BA2 */
+#define EM_XCORE 203 /* XMOS xCORE */
+#define EM_MCHP_PIC 204 /* Microchip 8-bit PIC(r) */
+ /* reserved 205-209 */
+#define EM_KM32 210 /* KM211 KM32 */
+#define EM_KMX32 211 /* KM211 KMX32 */
+#define EM_EMX16 212 /* KM211 KMX16 */
+#define EM_EMX8 213 /* KM211 KMX8 */
+#define EM_KVARC 214 /* KM211 KVARC */
+#define EM_CDP 215 /* Paneve CDP */
+#define EM_COGE 216 /* Cognitive Smart Memory Processor */
+#define EM_COOL 217 /* Bluechip CoolEngine */
+#define EM_NORC 218 /* Nanoradio Optimized RISC */
+#define EM_CSR_KALIMBA 219 /* CSR Kalimba */
+#define EM_Z80 220 /* Zilog Z80 */
+#define EM_VISIUM 221 /* Controls and Data Services VISIUMcore */
+#define EM_FT32 222 /* FTDI Chip FT32 */
+#define EM_MOXIE 223 /* Moxie processor */
+#define EM_AMDGPU 224 /* AMD GPU */
+ /* reserved 225-242 */
+#define EM_RISCV 243 /* RISC-V */
-#define EM_PARISC 15 /* HPPA */
-#define EM_VPP500 17 /* Fujitsu VPP500 */
-#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
-#define EM_960 19 /* Intel 80960 */
-#define EM_PPC 20 /* PowerPC */
-#define EM_PPC64 21 /* PowerPC 64-bit */
-#define EM_S390 22 /* IBM S390 */
+#define EM_BPF 247 /* Linux BPF -- in-kernel virtual machine */
-#define EM_V800 36 /* NEC V800 series */
-#define EM_FR20 37 /* Fujitsu FR20 */
-#define EM_RH32 38 /* TRW RH-32 */
-#define EM_RCE 39 /* Motorola RCE */
-#define EM_ARM 40 /* ARM */
-#define EM_FAKE_ALPHA 41 /* Digital Alpha */
-#define EM_SH 42 /* Hitachi SH */
-#define EM_SPARCV9 43 /* SPARC v9 64-bit */
-#define EM_TRICORE 44 /* Siemens Tricore */
-#define EM_ARC 45 /* Argonaut RISC Core */
-#define EM_H8_300 46 /* Hitachi H8/300 */
-#define EM_H8_300H 47 /* Hitachi H8/300H */
-#define EM_H8S 48 /* Hitachi H8S */
-#define EM_H8_500 49 /* Hitachi H8/500 */
-#define EM_IA_64 50 /* Intel Merced */
-#define EM_MIPS_X 51 /* Stanford MIPS-X */
-#define EM_COLDFIRE 52 /* Motorola Coldfire */
-#define EM_68HC12 53 /* Motorola M68HC12 */
-#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator*/
-#define EM_PCP 55 /* Siemens PCP */
-#define EM_NCPU 56 /* Sony nCPU embeeded RISC */
-#define EM_NDR1 57 /* Denso NDR1 microprocessor */
-#define EM_STARCORE 58 /* Motorola Start*Core processor */
-#define EM_ME16 59 /* Toyota ME16 processor */
-#define EM_ST100 60 /* STMicroelectronic ST100 processor */
-#define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam*/
-#define EM_X86_64 62 /* AMD x86-64 architecture */
-#define EM_PDSP 63 /* Sony DSP Processor */
+#define EM_NUM 248
-#define EM_FX66 66 /* Siemens FX66 microcontroller */
-#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */
-#define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */
-#define EM_68HC16 69 /* Motorola MC68HC16 microcontroller */
-#define EM_68HC11 70 /* Motorola MC68HC11 microcontroller */
-#define EM_68HC08 71 /* Motorola MC68HC08 microcontroller */
-#define EM_68HC05 72 /* Motorola MC68HC05 microcontroller */
-#define EM_SVX 73 /* Silicon Graphics SVx */
-#define EM_ST19 74 /* STMicroelectronics ST19 8 bit mc */
-#define EM_VAX 75 /* Digital VAX */
-#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */
-#define EM_JAVELIN 77 /* Infineon Technologies 32-bit embedded processor */
-#define EM_FIREPATH 78 /* Element 14 64-bit DSP Processor */
-#define EM_ZSP 79 /* LSI Logic 16-bit DSP Processor */
-#define EM_MMIX 80 /* Donald Knuth's educational 64-bit processor */
-#define EM_HUANY 81 /* Harvard University machine-independent object files */
-#define EM_PRISM 82 /* SiTera Prism */
-#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */
-#define EM_FR30 84 /* Fujitsu FR30 */
-#define EM_D10V 85 /* Mitsubishi D10V */
-#define EM_D30V 86 /* Mitsubishi D30V */
-#define EM_V850 87 /* NEC v850 */
-#define EM_M32R 88 /* Mitsubishi M32R */
-#define EM_MN10300 89 /* Matsushita MN10300 */
-#define EM_MN10200 90 /* Matsushita MN10200 */
-#define EM_PJ 91 /* picoJava */
-#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */
-#define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */
-#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */
-#define EM_ALTERA_NIOS2 113 /* Altera Nios II */
-#define EM_AARCH64 183 /* ARM AARCH64 */
-#define EM_TILEPRO 188 /* Tilera TILEPro */
-#define EM_MICROBLAZE 189 /* Xilinx MicroBlaze */
-#define EM_TILEGX 191 /* Tilera TILE-Gx */
-#define EM_NUM 192
+/* Old spellings/synonyms. */
+
+#define EM_ARC_A5 EM_ARC_COMPACT
/* If it is necessary to assign new unofficial EM_* values, please
pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the
@@ -628,6 +739,8 @@
/* Legal values for note segment descriptor types for core files. */
#define NT_PRSTATUS 1 /* Contains copy of prstatus struct */
+#define NT_PRFPREG 2 /* Contains copy of fpregset
+ struct. */
#define NT_FPREGSET 2 /* Contains copy of fpregset struct */
#define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */
#define NT_PRXREG 4 /* Contains copy of prxregset struct */
@@ -651,6 +764,24 @@
#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */
#define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */
#define NT_PPC_VSX 0x102 /* PowerPC VSX registers */
+#define NT_PPC_TAR 0x103 /* Target Address Register */
+#define NT_PPC_PPR 0x104 /* Program Priority Register */
+#define NT_PPC_DSCR 0x105 /* Data Stream Control Register */
+#define NT_PPC_EBB 0x106 /* Event Based Branch Registers */
+#define NT_PPC_PMU 0x107 /* Performance Monitor Registers */
+#define NT_PPC_TM_CGPR 0x108 /* TM checkpointed GPR Registers */
+#define NT_PPC_TM_CFPR 0x109 /* TM checkpointed FPR Registers */
+#define NT_PPC_TM_CVMX 0x10a /* TM checkpointed VMX Registers */
+#define NT_PPC_TM_CVSX 0x10b /* TM checkpointed VSX Registers */
+#define NT_PPC_TM_SPR 0x10c /* TM Special Purpose Registers */
+#define NT_PPC_TM_CTAR 0x10d /* TM checkpointed Target Address
+ Register */
+#define NT_PPC_TM_CPPR 0x10e /* TM checkpointed Program Priority
+ Register */
+#define NT_PPC_TM_CDSCR 0x10f /* TM checkpointed Data Stream Control
+ Register */
+#define NT_PPC_PKEY 0x110 /* Memory Protection Keys
+ registers. */
#define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */
#define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */
#define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */
@@ -663,10 +794,20 @@
#define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */
#define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */
#define NT_S390_TDB 0x308 /* s390 transaction diagnostic block */
+#define NT_S390_VXRS_LOW 0x309 /* s390 vector registers 0-15
+ upper half. */
+#define NT_S390_VXRS_HIGH 0x30a /* s390 vector registers 16-31. */
+#define NT_S390_GS_CB 0x30b /* s390 guarded storage registers. */
+#define NT_S390_GS_BC 0x30c /* s390 guarded storage
+ broadcast control block. */
+#define NT_S390_RI_CB 0x30d /* s390 runtime instrumentation. */
#define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */
#define NT_ARM_TLS 0x401 /* ARM TLS register */
#define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */
#define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */
+#define NT_ARM_SYSTEM_CALL 0x404 /* ARM system call number */
+#define NT_ARM_SVE 0x405 /* ARM Scalable Vector Extension
+ registers */
/* Legal values for the note segment descriptor types for object files. */
@@ -731,7 +872,8 @@
#define DT_ENCODING 32 /* Start of encoded range */
#define DT_PREINIT_ARRAY 32 /* Array with addresses of preinit fct*/
#define DT_PREINIT_ARRAYSZ 33 /* size in bytes of DT_PREINIT_ARRAY */
-#define DT_NUM 34 /* Number used */
+#define DT_SYMTAB_SHNDX 34 /* Address of SYMTAB_SHNDX section */
+#define DT_NUM 35 /* Number used */
#define DT_LOOS 0x6000000d /* Start of OS-specific */
#define DT_HIOS 0x6ffff000 /* End of OS-specific */
#define DT_LOPROC 0x70000000 /* Start of processor-specific */
@@ -839,6 +981,8 @@
#define DF_1_SYMINTPOSE 0x00800000 /* Object has individual interposers. */
#define DF_1_GLOBAUDIT 0x01000000 /* Global auditing required. */
#define DF_1_SINGLETON 0x02000000 /* Singleton symbols are used. */
+#define DF_1_STUB 0x04000000
+#define DF_1_PIE 0x08000000
/* Flags for the feature selection in DT_FEATURE_1. */
#define DTF_1_PARINIT 0x00000001
@@ -1058,6 +1202,18 @@
#define AT_L2_CACHESHAPE 36
#define AT_L3_CACHESHAPE 37
+/* Shapes of the caches, with more room to describe them.
+ *GEOMETRY are comprised of cache line size in bytes in the bottom 16 bits
+ and the cache associativity in the next 16 bits. */
+#define AT_L1I_CACHESIZE 40
+#define AT_L1I_CACHEGEOMETRY 41
+#define AT_L1D_CACHESIZE 42
+#define AT_L1D_CACHEGEOMETRY 43
+#define AT_L2_CACHESIZE 44
+#define AT_L2_CACHEGEOMETRY 45
+#define AT_L3_CACHESIZE 46
+#define AT_L3_CACHEGEOMETRY 47
+
/* Note section contents. Each entry in the note section begins with
a header of a fixed form. */
@@ -1123,6 +1279,62 @@
/* Version note generated by GNU gold containing a version string. */
#define NT_GNU_GOLD_VERSION 4
+/* Program property. */
+#define NT_GNU_PROPERTY_TYPE_0 5
+
+/* Note section name of program property. */
+#define NOTE_GNU_PROPERTY_SECTION_NAME ".note.gnu.property"
+
+/* Values used in GNU .note.gnu.property notes (NT_GNU_PROPERTY_TYPE_0). */
+
+/* Stack size. */
+#define GNU_PROPERTY_STACK_SIZE 1
+/* No copy relocation on protected data symbol. */
+#define GNU_PROPERTY_NO_COPY_ON_PROTECTED 2
+
+/* Processor-specific semantics, lo */
+#define GNU_PROPERTY_LOPROC 0xc0000000
+/* Processor-specific semantics, hi */
+#define GNU_PROPERTY_HIPROC 0xdfffffff
+/* Application-specific semantics, lo */
+#define GNU_PROPERTY_LOUSER 0xe0000000
+/* Application-specific semantics, hi */
+#define GNU_PROPERTY_HIUSER 0xffffffff
+
+/* The x86 instruction sets indicated by the corresponding bits are
+ used in program. Their support in the hardware is optional. */
+#define GNU_PROPERTY_X86_ISA_1_USED 0xc0000000
+/* The x86 instruction sets indicated by the corresponding bits are
+ used in program and they must be supported by the hardware. */
+#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0000001
+/* X86 processor-specific features used in program. */
+#define GNU_PROPERTY_X86_FEATURE_1_AND 0xc0000002
+
+#define GNU_PROPERTY_X86_ISA_1_486 (1U << 0)
+#define GNU_PROPERTY_X86_ISA_1_586 (1U << 1)
+#define GNU_PROPERTY_X86_ISA_1_686 (1U << 2)
+#define GNU_PROPERTY_X86_ISA_1_SSE (1U << 3)
+#define GNU_PROPERTY_X86_ISA_1_SSE2 (1U << 4)
+#define GNU_PROPERTY_X86_ISA_1_SSE3 (1U << 5)
+#define GNU_PROPERTY_X86_ISA_1_SSSE3 (1U << 6)
+#define GNU_PROPERTY_X86_ISA_1_SSE4_1 (1U << 7)
+#define GNU_PROPERTY_X86_ISA_1_SSE4_2 (1U << 8)
+#define GNU_PROPERTY_X86_ISA_1_AVX (1U << 9)
+#define GNU_PROPERTY_X86_ISA_1_AVX2 (1U << 10)
+#define GNU_PROPERTY_X86_ISA_1_AVX512F (1U << 11)
+#define GNU_PROPERTY_X86_ISA_1_AVX512CD (1U << 12)
+#define GNU_PROPERTY_X86_ISA_1_AVX512ER (1U << 13)
+#define GNU_PROPERTY_X86_ISA_1_AVX512PF (1U << 14)
+#define GNU_PROPERTY_X86_ISA_1_AVX512VL (1U << 15)
+#define GNU_PROPERTY_X86_ISA_1_AVX512DQ (1U << 16)
+#define GNU_PROPERTY_X86_ISA_1_AVX512BW (1U << 17)
+
+/* This indicates that all executable sections are compatible with
+ IBT. */
+#define GNU_PROPERTY_X86_FEATURE_1_IBT (1U << 0)
+/* This indicates that all executable sections are compatible with
+ SHSTK. */
+#define GNU_PROPERTY_X86_FEATURE_1_SHSTK (1U << 1)
/* Move records. */
typedef struct
@@ -1269,8 +1481,10 @@
argument, returning the TLS
offset for the symbol. */
#define R_386_IRELATIVE 42 /* Adjust indirectly by program base */
+#define R_386_GOT32X 43 /* Load from 32 bit GOT entry,
+ relaxable. */
/* Keep this the last entry. */
-#define R_386_NUM 43
+#define R_386_NUM 44
/* SUN SPARC specific definitions. */
@@ -1727,7 +1941,11 @@
PLT is writable. For a non-writable PLT, this is omitted or has a zero
value. */
#define DT_MIPS_RWPLT 0x70000034
-#define DT_MIPS_NUM 0x35
+/* An alternative description of the classic MIPS RLD_MAP that is usable
+ in a PIE as it stores a relative offset from the address of the tag
+ rather than an absolute address. */
+#define DT_MIPS_RLD_MAP_REL 0x70000035
+#define DT_MIPS_NUM 0x36
/* Legal values for DT_MIPS_FLAGS Elf32_Dyn entry. */
@@ -2414,9 +2632,10 @@
#define DT_PPC64_OPT (DT_LOPROC + 3)
#define DT_PPC64_NUM 4
-/* PowerPC64 specific values for the DT_PPC64_OPT Dyn entry. */
+/* PowerPC64 specific bits in the DT_PPC64_OPT Dyn entry. */
#define PPC64_OPT_TLS 1
#define PPC64_OPT_MULTI_TOC 2
+#define PPC64_OPT_LOCALENTRY 4
/* PowerPC64 specific values for the Elf64_Sym st_other field. */
#define STO_PPC64_LOCAL_BIT 5
@@ -3140,8 +3359,18 @@
#define R_X86_64_TLSDESC 36 /* TLS descriptor. */
#define R_X86_64_IRELATIVE 37 /* Adjust indirectly by program base */
#define R_X86_64_RELATIVE64 38 /* 64-bit adjust by program base */
+ /* 39 Reserved was R_X86_64_PC32_BND */
+ /* 40 Reserved was R_X86_64_PLT32_BND */
+#define R_X86_64_GOTPCRELX 41 /* Load from 32 bit signed pc relative
+ offset to GOT entry without REX
+ prefix, relaxable. */
+#define R_X86_64_REX_GOTPCRELX 42 /* Load from 32 bit signed pc relative
+ offset to GOT entry with REX prefix,
+ relaxable. */
+#define R_X86_64_NUM 43
-#define R_X86_64_NUM 39
+/* x86-64 sh_type values. */
+#define SHT_X86_64_UNWIND 0x70000001 /* Unwind information. */
/* AM33 relocations. */
@@ -3552,6 +3781,139 @@
#define R_TILEGX_NUM 130
+/* RISC-V ELF Flags */
+#define EF_RISCV_RVC 0x0001
+#define EF_RISCV_FLOAT_ABI 0x0006
+#define EF_RISCV_FLOAT_ABI_SOFT 0x0000
+#define EF_RISCV_FLOAT_ABI_SINGLE 0x0002
+#define EF_RISCV_FLOAT_ABI_DOUBLE 0x0004
+#define EF_RISCV_FLOAT_ABI_QUAD 0x0006
+
+/* RISC-V relocations. */
+#define R_RISCV_NONE 0
+#define R_RISCV_32 1
+#define R_RISCV_64 2
+#define R_RISCV_RELATIVE 3
+#define R_RISCV_COPY 4
+#define R_RISCV_JUMP_SLOT 5
+#define R_RISCV_TLS_DTPMOD32 6
+#define R_RISCV_TLS_DTPMOD64 7
+#define R_RISCV_TLS_DTPREL32 8
+#define R_RISCV_TLS_DTPREL64 9
+#define R_RISCV_TLS_TPREL32 10
+#define R_RISCV_TLS_TPREL64 11
+#define R_RISCV_BRANCH 16
+#define R_RISCV_JAL 17
+#define R_RISCV_CALL 18
+#define R_RISCV_CALL_PLT 19
+#define R_RISCV_GOT_HI20 20
+#define R_RISCV_TLS_GOT_HI20 21
+#define R_RISCV_TLS_GD_HI20 22
+#define R_RISCV_PCREL_HI20 23
+#define R_RISCV_PCREL_LO12_I 24
+#define R_RISCV_PCREL_LO12_S 25
+#define R_RISCV_HI20 26
+#define R_RISCV_LO12_I 27
+#define R_RISCV_LO12_S 28
+#define R_RISCV_TPREL_HI20 29
+#define R_RISCV_TPREL_LO12_I 30
+#define R_RISCV_TPREL_LO12_S 31
+#define R_RISCV_TPREL_ADD 32
+#define R_RISCV_ADD8 33
+#define R_RISCV_ADD16 34
+#define R_RISCV_ADD32 35
+#define R_RISCV_ADD64 36
+#define R_RISCV_SUB8 37
+#define R_RISCV_SUB16 38
+#define R_RISCV_SUB32 39
+#define R_RISCV_SUB64 40
+#define R_RISCV_GNU_VTINHERIT 41
+#define R_RISCV_GNU_VTENTRY 42
+#define R_RISCV_ALIGN 43
+#define R_RISCV_RVC_BRANCH 44
+#define R_RISCV_RVC_JUMP 45
+#define R_RISCV_RVC_LUI 46
+#define R_RISCV_GPREL_I 47
+#define R_RISCV_GPREL_S 48
+#define R_RISCV_TPREL_I 49
+#define R_RISCV_TPREL_S 50
+#define R_RISCV_RELAX 51
+#define R_RISCV_SUB6 52
+#define R_RISCV_SET6 53
+#define R_RISCV_SET8 54
+#define R_RISCV_SET16 55
+#define R_RISCV_SET32 56
+#define R_RISCV_32_PCREL 57
+
+#define R_RISCV_NUM 58
+
+/* BPF specific declarations. */
+
+#define R_BPF_NONE 0 /* No reloc */
+#define R_BPF_64_64 1
+#define R_BPF_64_32 10
+
+/* Imagination Meta specific relocations. */
+
+#define R_METAG_HIADDR16 0
+#define R_METAG_LOADDR16 1
+#define R_METAG_ADDR32 2 /* 32bit absolute address */
+#define R_METAG_NONE 3 /* No reloc */
+#define R_METAG_RELBRANCH 4
+#define R_METAG_GETSETOFF 5
+
+/* Backward compatability */
+#define R_METAG_REG32OP1 6
+#define R_METAG_REG32OP2 7
+#define R_METAG_REG32OP3 8
+#define R_METAG_REG16OP1 9
+#define R_METAG_REG16OP2 10
+#define R_METAG_REG16OP3 11
+#define R_METAG_REG32OP4 12
+
+#define R_METAG_HIOG 13
+#define R_METAG_LOOG 14
+
+#define R_METAG_REL8 15
+#define R_METAG_REL16 16
+
+/* GNU */
+#define R_METAG_GNU_VTINHERIT 30
+#define R_METAG_GNU_VTENTRY 31
+
+/* PIC relocations */
+#define R_METAG_HI16_GOTOFF 32
+#define R_METAG_LO16_GOTOFF 33
+#define R_METAG_GETSET_GOTOFF 34
+#define R_METAG_GETSET_GOT 35
+#define R_METAG_HI16_GOTPC 36
+#define R_METAG_LO16_GOTPC 37
+#define R_METAG_HI16_PLT 38
+#define R_METAG_LO16_PLT 39
+#define R_METAG_RELBRANCH_PLT 40
+#define R_METAG_GOTOFF 41
+#define R_METAG_PLT 42
+#define R_METAG_COPY 43
+#define R_METAG_JMP_SLOT 44
+#define R_METAG_RELATIVE 45
+#define R_METAG_GLOB_DAT 46
+
+/* TLS relocations */
+#define R_METAG_TLS_GD 47
+#define R_METAG_TLS_LDM 48
+#define R_METAG_TLS_LDO_HI16 49
+#define R_METAG_TLS_LDO_LO16 50
+#define R_METAG_TLS_LDO 51
+#define R_METAG_TLS_IE 52
+#define R_METAG_TLS_IENONPIC 53
+#define R_METAG_TLS_IENONPIC_HI16 54
+#define R_METAG_TLS_IENONPIC_LO16 55
+#define R_METAG_TLS_TPOFF 56
+#define R_METAG_TLS_DTPMOD 57
+#define R_METAG_TLS_DTPOFF 58
+#define R_METAG_TLS_LE 59
+#define R_METAG_TLS_LE_HI16 60
+#define R_METAG_TLS_LE_LO16 61
__END_DECLS
diff --git a/libelf/elf32_updatefile.c b/libelf/elf32_updatefile.c
index 0909219..7ac9951 100644
--- a/libelf/elf32_updatefile.c
+++ b/libelf/elf32_updatefile.c
@@ -1,5 +1,5 @@
/* Write changed data structures.
- Copyright (C) 2000-2010, 2014, 2015 Red Hat, Inc.
+ Copyright (C) 2000-2010, 2014, 2015, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2000.
@@ -39,7 +39,6 @@
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>
-#include <sys/param.h>
#include <system.h>
#include "libelfP.h"
@@ -269,6 +268,7 @@
void *p = malloc (sizeof (ElfW2(LIBELFBITS,Shdr)));
if (unlikely (p == NULL))
{
+ free (scns);
__libelf_seterrno (ELF_E_NOMEM);
return -1;
}
@@ -295,6 +295,7 @@
void *p = malloc (scn->data_list.data.d.d_size);
if (unlikely (p == NULL))
{
+ free (scns);
__libelf_seterrno (ELF_E_NOMEM);
return -1;
}
@@ -342,9 +343,10 @@
{
fill_mmap (dl->data.d.d_off, last_position, scn_start,
shdr_start, shdr_end);
- last_position = scn_start + dl->data.d.d_off;
}
+ last_position = scn_start + dl->data.d.d_off;
+
if ((scn->flags | dl->flags | elf->flags) & ELF_F_DIRTY)
{
/* Let it go backward if the sections use a bogus
@@ -352,8 +354,6 @@
user's section data with the latest one, rather than
crashing. */
- last_position = scn_start + dl->data.d.d_off;
-
if (unlikely (change_bo))
{
#if EV_NUM != 2
@@ -727,6 +727,8 @@
}
}
+ last_offset = scn_start + dl->data.d.d_off;
+
if ((scn->flags | dl->flags | elf->flags) & ELF_F_DIRTY)
{
char tmpbuf[MAX_TMPBUF];
@@ -737,8 +739,6 @@
user's section data with the latest one, rather than
crashing. */
- last_offset = scn_start + dl->data.d.d_off;
-
if (unlikely (change_bo))
{
#if EV_NUM != 2
diff --git a/libelf/elf32_updatenull.c b/libelf/elf32_updatenull.c
index 03de032..3e9ef61 100644
--- a/libelf/elf32_updatenull.c
+++ b/libelf/elf32_updatenull.c
@@ -1,5 +1,5 @@
/* Update data structures for changes.
- Copyright (C) 2000-2010, 2015 Red Hat, Inc.
+ Copyright (C) 2000-2010, 2015, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2000.
@@ -36,8 +36,8 @@
#include <libelf.h>
#include <stdbool.h>
#include <string.h>
-#include <sys/param.h>
+#include <system.h>
#include "libelfP.h"
#include "elf-knowledge.h"
@@ -140,21 +140,10 @@
off_t size = elf_typesize (LIBELFBITS, ELF_T_EHDR, 1);
/* Set the program header position. */
- if (elf->state.ELFW(elf,LIBELFBITS).phdr == NULL
- && (ehdr->e_type == ET_EXEC || ehdr->e_type == ET_DYN
- || ehdr->e_type == ET_CORE))
+ if (elf->state.ELFW(elf,LIBELFBITS).phdr == NULL)
(void) __elfw2(LIBELFBITS,getphdr_wrlock) (elf);
if (elf->state.ELFW(elf,LIBELFBITS).phdr != NULL)
{
- /* Only executables, shared objects, and core files have a program
- header. */
- if (ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN
- && unlikely (ehdr->e_type != ET_CORE))
- {
- __libelf_seterrno (ELF_E_INVALID_PHDR);
- return -1;
- }
-
size_t phnum;
if (unlikely (__elf_getphdrnum_rdlock (elf, &phnum) != 0))
return -1;
@@ -180,6 +169,7 @@
if (shnum > 0)
{
+ struct Elf_Scn *scn1 = NULL;
Elf_ScnList *list;
bool first = true;
@@ -198,10 +188,16 @@
/* Go over all sections and find out how large they are. */
list = &elf->state.ELFW(elf,LIBELFBITS).scns;
+ /* Find the first section. */
+ if (list->cnt > 1)
+ scn1 = &list->data[1];
+ else if (list->next != NULL)
+ scn1 = &list->next->data[0];
+
/* Load the section headers if necessary. This loads the
headers for all sections. */
- if (list->data[1].shdr.ELFW(e,LIBELFBITS) == NULL)
- (void) __elfw2(LIBELFBITS,getshdr_wrlock) (&list->data[1]);
+ if (scn1 != NULL && scn1->shdr.ELFW(e,LIBELFBITS) == NULL)
+ (void) __elfw2(LIBELFBITS,getshdr_wrlock) (scn1);
do
{
@@ -236,7 +232,7 @@
__libelf_seterrno (ELF_E_GROUP_NOT_REL);
return -1;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case SHT_SYMTAB_SHNDX:
sh_entsize = elf_typesize (32, ELF_T_WORD, 1);
break;
diff --git a/libelf/elf_begin.c b/libelf/elf_begin.c
index 147f5f4..b20ab4f 100644
--- a/libelf/elf_begin.c
+++ b/libelf/elf_begin.c
@@ -1,5 +1,5 @@
/* Create descriptor for processing file.
- Copyright (C) 1998-2010, 2012, 2014, 2015 Red Hat, Inc.
+ Copyright (C) 1998-2010, 2012, 2014, 2015, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 1998.
@@ -40,7 +40,6 @@
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>
-#include <sys/param.h>
#include <sys/stat.h>
#include <system.h>
@@ -159,6 +158,7 @@
else
{
Elf32_Word size;
+ ssize_t r;
if (likely (map_address != NULL))
/* gcc will optimize the memcpy to a simple memory
@@ -168,11 +168,19 @@
+ offset))->sh_size,
sizeof (Elf32_Word));
else
- if (unlikely (pread_retry (fildes, &size, sizeof (Elf32_Word),
- offset + ehdr.e32->e_shoff
- + offsetof (Elf32_Shdr, sh_size))
+ if (unlikely ((r = pread_retry (fildes, &size,
+ sizeof (Elf32_Word),
+ offset + ehdr.e32->e_shoff
+ + offsetof (Elf32_Shdr,
+ sh_size)))
!= sizeof (Elf32_Word)))
- return (size_t) -1l;
+ {
+ if (r < 0)
+ __libelf_seterrno (ELF_E_INVALID_FILE);
+ else
+ __libelf_seterrno (ELF_E_INVALID_ELF);
+ return (size_t) -1l;
+ }
if (e_ident[EI_DATA] != MY_ELFDATA)
CONVERT (size);
@@ -208,6 +216,7 @@
+ offset))->sh_size;
else
{
+ ssize_t r;
if (likely (map_address != NULL))
/* gcc will optimize the memcpy to a simple memory
access while taking care of alignment issues. */
@@ -216,19 +225,30 @@
+ offset))->sh_size,
sizeof (Elf64_Xword));
else
- if (unlikely (pread_retry (fildes, &size, sizeof (Elf64_Xword),
- offset + ehdr.e64->e_shoff
- + offsetof (Elf64_Shdr, sh_size))
+ if (unlikely ((r = pread_retry (fildes, &size,
+ sizeof (Elf64_Xword),
+ offset + ehdr.e64->e_shoff
+ + offsetof (Elf64_Shdr,
+ sh_size)))
!= sizeof (Elf64_Xword)))
- return (size_t) -1l;
+ {
+ if (r < 0)
+ __libelf_seterrno (ELF_E_INVALID_FILE);
+ else
+ __libelf_seterrno (ELF_E_INVALID_ELF);
+ return (size_t) -1l;
+ }
if (e_ident[EI_DATA] != MY_ELFDATA)
CONVERT (size);
}
if (size > ~((GElf_Word) 0))
- /* Invalid value, it is too large. */
- return (size_t) -1l;
+ {
+ /* Invalid value, it is too large. */
+ __libelf_seterrno (ELF_E_INVALID_ELF);
+ return (size_t) -1l;
+ }
result = size;
}
@@ -256,11 +276,13 @@
&& e_ident[EI_DATA] != ELFDATA2MSB)))
{
/* Cannot handle this. */
- __libelf_seterrno (ELF_E_INVALID_FILE);
+ __libelf_seterrno (ELF_E_INVALID_ELF);
return NULL;
}
- /* Determine the number of sections. */
+ /* Determine the number of sections. Returns -1 and sets libelf errno
+ if the file handle or elf file is invalid. Returns zero if there
+ are no section headers (or they cannot be read). */
size_t scncnt = get_shnum (map_address, e_ident, fildes, offset, maxsize);
if (scncnt == (size_t) -1l)
/* Could not determine the number of sections. */
@@ -270,10 +292,16 @@
if (e_ident[EI_CLASS] == ELFCLASS32)
{
if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf32_Shdr)))
- return NULL;
+ {
+ __libelf_seterrno (ELF_E_INVALID_ELF);
+ return NULL;
+ }
}
else if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf64_Shdr)))
- return NULL;
+ {
+ __libelf_seterrno (ELF_E_INVALID_ELF);
+ return NULL;
+ }
/* We can now allocate the memory. Even if there are no section headers,
we allocate space for a zeroth section in case we need it later. */
@@ -282,7 +310,7 @@
Elf *elf = allocate_elf (fildes, map_address, offset, maxsize, cmd, parent,
ELF_K_ELF, scnmax * sizeof (Elf_Scn));
if (elf == NULL)
- /* Not enough memory. */
+ /* Not enough memory. allocate_elf will have set libelf errno. */
return NULL;
assert ((unsigned int) scncnt == scncnt);
@@ -345,13 +373,13 @@
|| (((uintptr_t) ((char *) ehdr + e_shoff)
& (__alignof__ (Elf32_Shdr) - 1)) == 0)))
{
- if (unlikely (e_shoff >= maxsize)
+ if (unlikely (scncnt > 0 && e_shoff >= maxsize)
|| unlikely (maxsize - e_shoff
< scncnt * sizeof (Elf32_Shdr)))
{
free_and_out:
free (elf);
- __libelf_seterrno (ELF_E_INVALID_FILE);
+ __libelf_seterrno (ELF_E_INVALID_ELF);
return NULL;
}
elf->state.elf32.shdr
@@ -447,7 +475,7 @@
|| (((uintptr_t) ((char *) ehdr + e_shoff)
& (__alignof__ (Elf64_Shdr) - 1)) == 0)))
{
- if (unlikely (e_shoff >= maxsize)
+ if (unlikely (scncnt > 0 && e_shoff >= maxsize)
|| unlikely (maxsize - e_shoff
< scncnt * sizeof (Elf64_Shdr)))
goto free_and_out;
@@ -583,7 +611,7 @@
? sizeof (Elf32_Ehdr) : sizeof (Elf64_Ehdr)))
return file_read_elf (fildes, NULL, mem.header, offset, maxsize, cmd,
parent);
- /* FALLTHROUGH */
+ FALLTHROUGH;
default:
break;
@@ -606,22 +634,30 @@
|| cmd == ELF_C_WRITE_MMAP
|| cmd == ELF_C_READ_MMAP_PRIVATE);
+ if (parent == NULL)
+ {
+ if (maxsize == ~((size_t) 0))
+ {
+ /* We don't know in the moment how large the file is.
+ Determine it now. */
+ struct stat st;
+
+ if (fstat (fildes, &st) == 0
+ && (sizeof (size_t) >= sizeof (st.st_size)
+ || st.st_size <= ~((size_t) 0)))
+ maxsize = (size_t) st.st_size;
+ }
+ }
+ else
+ {
+ /* The parent is already loaded. Use it. */
+ assert (maxsize != ~((size_t) 0));
+ }
+
if (use_mmap)
{
if (parent == NULL)
{
- if (maxsize == ~((size_t) 0))
- {
- /* We don't know in the moment how large the file is.
- Determine it now. */
- struct stat st;
-
- if (fstat (fildes, &st) == 0
- && (sizeof (size_t) >= sizeof (st.st_size)
- || st.st_size <= ~((size_t) 0)))
- maxsize = (size_t) st.st_size;
- }
-
/* We try to map the file ourself. */
map_address = mmap (NULL, maxsize, (cmd == ELF_C_READ_MMAP
? PROT_READ
@@ -636,9 +672,6 @@
}
else
{
- /* The parent is already loaded. Use it. */
- assert (maxsize != ~((size_t) 0));
-
map_address = parent->map_address;
}
}
@@ -1071,7 +1104,7 @@
if (ref != NULL)
/* Make sure the descriptor is not suddenly going away. */
rwlock_rdlock (ref->lock);
- else if (unlikely (fcntl (fildes, F_GETFL) == -1 && errno == EBADF))
+ else if (unlikely (fcntl (fildes, F_GETFD) == -1 && errno == EBADF))
{
/* We cannot do anything productive without a file descriptor. */
__libelf_seterrno (ELF_E_INVALID_FILE);
@@ -1093,7 +1126,7 @@
retval = NULL;
break;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case ELF_C_READ:
case ELF_C_READ_MMAP:
diff --git a/libelf/elf_cntl.c b/libelf/elf_cntl.c
index ab13ffb..fd68178 100644
--- a/libelf/elf_cntl.c
+++ b/libelf/elf_cntl.c
@@ -62,7 +62,7 @@
result = -1;
break;
}
- /* FALLTHROUGH */
+ FALLTHROUGH;
case ELF_C_FDDONE:
/* Mark the file descriptor as not usable. */
diff --git a/libelf/elf_compress.c b/libelf/elf_compress.c
index 4c7c35e..711be59 100644
--- a/libelf/elf_compress.c
+++ b/libelf/elf_compress.c
@@ -1,5 +1,5 @@
/* Compress or decompress a section.
- Copyright (C) 2015 Red Hat, Inc.
+ Copyright (C) 2015, 2016 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -31,20 +31,16 @@
#endif
#include <libelf.h>
+#include <system.h>
#include "libelfP.h"
#include "common.h"
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/param.h>
#include <unistd.h>
#include <zlib.h>
-#ifndef MAX
-# define MAX(a, b) ((a) > (b) ? (a) : (b))
-#endif
-
/* Cleanup and return result. Don't leak memory. */
static void *
do_deflate_cleanup (void *result, z_stream *z, void *out_buf,
@@ -117,6 +113,7 @@
int zrc = deflateInit (&z, Z_BEST_COMPRESSION);
if (zrc != Z_OK)
{
+ free (out_buf);
__libelf_seterrno (ELF_E_COMPRESS_ERROR);
return NULL;
}
@@ -214,6 +211,15 @@
internal_function
__libelf_decompress (void *buf_in, size_t size_in, size_t size_out)
{
+ /* Catch highly unlikely compression ratios so we don't allocate
+ some giant amount of memory for nothing. The max compression
+ factor 1032:1 comes from http://www.zlib.net/zlib_tech.html */
+ if (unlikely (size_out / 1032 > size_in))
+ {
+ __libelf_seterrno (ELF_E_INVALID_DATA);
+ return NULL;
+ }
+
void *buf_out = malloc (size_out);
if (unlikely (buf_out == NULL))
{
@@ -294,6 +300,7 @@
return buf_out;
}
+/* Assumes buf is a malloced buffer. */
void
internal_function
__libelf_reset_rawdata (Elf_Scn *scn, void *buf, size_t size, size_t align,
@@ -313,10 +320,12 @@
free (scn->data_base);
scn->data_base = NULL;
if (scn->elf->map_address == NULL
- || scn->rawdata_base == scn->zdata_base)
+ || scn->rawdata_base == scn->zdata_base
+ || (scn->flags & ELF_F_MALLOCED) != 0)
free (scn->rawdata_base);
scn->rawdata_base = buf;
+ scn->flags |= ELF_F_MALLOCED;
}
int
diff --git a/libelf/elf_end.c b/libelf/elf_end.c
index fde17b5..160f0b8 100644
--- a/libelf/elf_end.c
+++ b/libelf/elf_end.c
@@ -1,5 +1,5 @@
/* Free resources associated with Elf descriptor.
- Copyright (C) 1998,1999,2000,2001,2002,2004,2005,2007,2015 Red Hat, Inc.
+ Copyright (C) 1998,1999,2000,2001,2002,2004,2005,2007,2015,2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 1998.
@@ -166,7 +166,8 @@
/* The section data is allocated if we couldn't mmap
the file. Or if we had to decompress. */
if (elf->map_address == NULL
- || scn->rawdata_base == scn->zdata_base)
+ || scn->rawdata_base == scn->zdata_base
+ || (scn->flags & ELF_F_MALLOCED) != 0)
free (scn->rawdata_base);
/* Free the list of data buffers for the section.
diff --git a/libelf/elf_error.c b/libelf/elf_error.c
index 888b389..5364e68 100644
--- a/libelf/elf_error.c
+++ b/libelf/elf_error.c
@@ -94,8 +94,12 @@
(ELF_E_NOMEM_IDX + sizeof "out of memory")
N_("invalid file descriptor")
"\0"
-#define ELF_E_INVALID_OP_IDX \
+#define ELF_E_INVALID_ELF_IDX \
(ELF_E_INVALID_FILE_IDX + sizeof "invalid file descriptor")
+ N_("invalid ELF file data")
+ "\0"
+#define ELF_E_INVALID_OP_IDX \
+ (ELF_E_INVALID_ELF_IDX + sizeof "invalid ELF file data")
N_("invalid operation")
"\0"
#define ELF_E_NO_VERSION_IDX \
@@ -280,6 +284,7 @@
[ELF_E_INVALID_ENCODING] = ELF_E_INVALID_ENCODING_IDX,
[ELF_E_NOMEM] = ELF_E_NOMEM_IDX,
[ELF_E_INVALID_FILE] = ELF_E_INVALID_FILE_IDX,
+ [ELF_E_INVALID_ELF] = ELF_E_INVALID_ELF_IDX,
[ELF_E_INVALID_OP] = ELF_E_INVALID_OP_IDX,
[ELF_E_NO_VERSION] = ELF_E_NO_VERSION_IDX,
[ELF_E_INVALID_CMD] = ELF_E_INVALID_CMD_IDX,
diff --git a/libelf/elf_getarsym.c b/libelf/elf_getarsym.c
index 65c67cc..1f031fc 100644
--- a/libelf/elf_getarsym.c
+++ b/libelf/elf_getarsym.c
@@ -167,7 +167,7 @@
/* We have an archive. The first word in there is the number of
entries in the table. */
- uint64_t n;
+ uint64_t n = 0;
size_t off = elf->start_offset + SARMAG + sizeof (struct ar_hdr);
if (read_number_entries (&n, elf, &off, index64_p) < 0)
{
@@ -297,7 +297,15 @@
arsym[cnt].as_off = (*u32)[cnt];
arsym[cnt].as_hash = _dl_elf_hash (str_data);
+#if HAVE_DECL_RAWMEMCHR
str_data = rawmemchr (str_data, '\0') + 1;
+#else
+ char c;
+ do {
+ c = *str_data;
+ str_data++;
+ } while (c);
+#endif
}
/* At the end a special entry. */
diff --git a/libelf/elf_getdata.c b/libelf/elf_getdata.c
index 4ec94b9..278dfa8 100644
--- a/libelf/elf_getdata.c
+++ b/libelf/elf_getdata.c
@@ -1,5 +1,5 @@
/* Return the next data element from the section after possibly converting it.
- Copyright (C) 1998-2005, 2006, 2007, 2015 Red Hat, Inc.
+ Copyright (C) 1998-2005, 2006, 2007, 2015, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 1998.
@@ -76,7 +76,6 @@
}
};
-#if !ALLOW_UNALIGNED
/* Associate libelf types with their internal alignment requirements. */
const uint_fast8_t __libelf_type_aligns[EV_NUM - 1][ELFCLASSNUM - 1][ELF_T_NUM] =
{
@@ -115,7 +114,6 @@
}
# undef TYPE_ALIGNS
};
-#endif
Elf_Type
@@ -173,8 +171,7 @@
/* Make sure the source is correctly aligned for the conversion
function to directly access the data elements. */
char *rawdata_source;
- if (ALLOW_UNALIGNED ||
- ((((size_t) (char *) scn->rawdata_base)) & (align - 1)) == 0)
+ if (((((size_t) (char *) scn->rawdata_base)) & (align - 1)) == 0)
rawdata_source = scn->rawdata_base;
else
{
@@ -312,6 +309,17 @@
}
else if (likely (elf->fildes != -1))
{
+ /* First see whether the information in the section header is
+ valid and it does not ask for too much. Check for unsigned
+ overflow. */
+ if (unlikely (offset > elf->maximum_size
+ || elf->maximum_size - offset < size))
+ {
+ /* Something is wrong. */
+ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
+ return 1;
+ }
+
/* We have to read the data from the file. Allocate the needed
memory. */
scn->rawdata_base = scn->rawdata.d.d_buf
@@ -363,7 +371,7 @@
at least an ehdr this will only trigger for alignment values > 64
which should be uncommon. */
align = align ?: 1;
- if (align > offset)
+ if (type != SHT_NOBITS && align > offset)
align = offset;
scn->rawdata.d.d_align = align;
if (elf->class == ELFCLASS32
diff --git a/libelf/elf_getdata_rawchunk.c b/libelf/elf_getdata_rawchunk.c
index 31b2fe7..d0c0b75 100644
--- a/libelf/elf_getdata_rawchunk.c
+++ b/libelf/elf_getdata_rawchunk.c
@@ -80,8 +80,7 @@
{
/* If the file is mmap'ed we can use it directly, if aligned for type. */
char *rawdata = elf->map_address + elf->start_offset + offset;
- if (ALLOW_UNALIGNED ||
- ((uintptr_t) rawdata & (align - 1)) == 0)
+ if (((uintptr_t) rawdata & (align - 1)) == 0)
rawchunk = rawdata;
else
{
diff --git a/libelf/elf_getphdrnum.c b/libelf/elf_getphdrnum.c
index 061183b..f91cba9 100644
--- a/libelf/elf_getphdrnum.c
+++ b/libelf/elf_getphdrnum.c
@@ -1,5 +1,5 @@
/* Return number of program headers in the ELF file.
- Copyright (C) 2010, 2014, 2015 Red Hat, Inc.
+ Copyright (C) 2010, 2014, 2015, 2016 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -84,34 +84,38 @@
{
int result = __elf_getphdrnum_rdlock (elf, dst);
- /* Do some sanity checking to make sure phnum and phoff are consistent. */
- Elf64_Off off = (elf->class == ELFCLASS32
- ? elf->state.elf32.ehdr->e_phoff
- : elf->state.elf64.ehdr->e_phoff);
- if (unlikely (off == 0))
+ /* If the phdrs haven't been created or read in yet then do some
+ sanity checking to make sure phnum and phoff are consistent. */
+ if (elf->state.elf.phdr == NULL)
{
- *dst = 0;
- return result;
- }
+ Elf64_Off off = (elf->class == ELFCLASS32
+ ? elf->state.elf32.ehdr->e_phoff
+ : elf->state.elf64.ehdr->e_phoff);
+ if (unlikely (off == 0))
+ {
+ *dst = 0;
+ return result;
+ }
- if (unlikely (off >= elf->maximum_size))
- {
- __libelf_seterrno (ELF_E_INVALID_DATA);
- return -1;
- }
+ if (unlikely (off >= elf->maximum_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_DATA);
+ return -1;
+ }
- /* Check for too many sections. */
- size_t phdr_size = (elf->class == ELFCLASS32
- ? sizeof (Elf32_Phdr) : sizeof (Elf64_Phdr));
- if (unlikely (*dst > SIZE_MAX / phdr_size))
- {
- __libelf_seterrno (ELF_E_INVALID_DATA);
- return -1;
- }
+ /* Check for too many sections. */
+ size_t phdr_size = (elf->class == ELFCLASS32
+ ? sizeof (Elf32_Phdr) : sizeof (Elf64_Phdr));
+ if (unlikely (*dst > SIZE_MAX / phdr_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_DATA);
+ return -1;
+ }
- /* Truncated file? Don't return more than can be indexed. */
- if (unlikely (elf->maximum_size - off < *dst * phdr_size))
- *dst = (elf->maximum_size - off) / phdr_size;
+ /* Truncated file? Don't return more than can be indexed. */
+ if (unlikely (elf->maximum_size - off < *dst * phdr_size))
+ *dst = (elf->maximum_size - off) / phdr_size;
+ }
return result;
}
diff --git a/libelf/elf_getshdrstrndx.c b/libelf/elf_getshdrstrndx.c
index aead2fe..ad884fd 100644
--- a/libelf/elf_getshdrstrndx.c
+++ b/libelf/elf_getshdrstrndx.c
@@ -133,13 +133,17 @@
/* We avoid reading in all the section headers. Just read
the first one. */
Elf32_Shdr shdr_mem;
+ ssize_t r;
- if (unlikely (pread_retry (elf->fildes, &shdr_mem,
- sizeof (Elf32_Shdr), offset)
+ if (unlikely ((r = pread_retry (elf->fildes, &shdr_mem,
+ sizeof (Elf32_Shdr), offset))
!= sizeof (Elf32_Shdr)))
{
/* We must be able to read this ELF section header. */
- __libelf_seterrno (ELF_E_INVALID_FILE);
+ if (r < 0)
+ __libelf_seterrno (ELF_E_INVALID_FILE);
+ else
+ __libelf_seterrno (ELF_E_INVALID_ELF);
result = -1;
goto out;
}
@@ -194,13 +198,17 @@
/* We avoid reading in all the section headers. Just read
the first one. */
Elf64_Shdr shdr_mem;
+ ssize_t r;
- if (unlikely (pread_retry (elf->fildes, &shdr_mem,
- sizeof (Elf64_Shdr), offset)
+ if (unlikely ((r = pread_retry (elf->fildes, &shdr_mem,
+ sizeof (Elf64_Shdr), offset))
!= sizeof (Elf64_Shdr)))
{
/* We must be able to read this ELF section header. */
- __libelf_seterrno (ELF_E_INVALID_FILE);
+ if (r < 0)
+ __libelf_seterrno (ELF_E_INVALID_FILE);
+ else
+ __libelf_seterrno (ELF_E_INVALID_ELF);
result = -1;
goto out;
}
diff --git a/libelf/elf_nextscn.c b/libelf/elf_nextscn.c
index 62cb891..d2f3e7c 100644
--- a/libelf/elf_nextscn.c
+++ b/libelf/elf_nextscn.c
@@ -41,6 +41,7 @@
Elf_Scn *
elf_nextscn (Elf *elf, Elf_Scn *scn)
{
+ Elf_ScnList *list;
Elf_Scn *result = NULL;
if (elf == NULL)
@@ -50,34 +51,29 @@
if (scn == NULL)
{
- /* If no section handle is given return the first (not 0th) section. */
+ /* If no section handle is given return the first (not 0th) section.
+ Set scn to the 0th section and perform nextscn. */
if (elf->class == ELFCLASS32
|| (offsetof (Elf, state.elf32.scns)
== offsetof (Elf, state.elf64.scns)))
- {
- if (elf->state.elf32.scns.cnt > 1)
- result = &elf->state.elf32.scns.data[1];
- }
+ list = &elf->state.elf32.scns;
else
- {
- if (elf->state.elf64.scns.cnt > 1)
- result = &elf->state.elf64.scns.data[1];
- }
+ list = &elf->state.elf64.scns;
+
+ scn = &list->data[0];
}
else
- {
- Elf_ScnList *list = scn->list;
+ list = scn->list;
- if (scn + 1 < &list->data[list->cnt])
- result = scn + 1;
- else if (scn + 1 == &list->data[list->max]
- && (list = list->next) != NULL)
- {
- /* If there is another element in the section list it must
- have at least one entry. */
- assert (list->cnt > 0);
- result = &list->data[0];
- }
+ if (scn + 1 < &list->data[list->cnt])
+ result = scn + 1;
+ else if (scn + 1 == &list->data[list->max]
+ && (list = list->next) != NULL)
+ {
+ /* If there is another element in the section list it must
+ have at least one entry. */
+ assert (list->cnt > 0);
+ result = &list->data[0];
}
rwlock_unlock (elf->lock);
diff --git a/libelf/elf_strptr.c b/libelf/elf_strptr.c
index ea21045..e72a3a3 100644
--- a/libelf/elf_strptr.c
+++ b/libelf/elf_strptr.c
@@ -32,6 +32,7 @@
#endif
#include <libelf.h>
+#include <stdbool.h>
#include <stddef.h>
#include "libelfP.h"
@@ -52,6 +53,22 @@
return zdata;
}
+static bool validate_str (const char *str, size_t from, size_t to)
+{
+#if HAVE_DECL_MEMRCHR
+ return memrchr (&str[from], '\0', to - from) != NULL;
+#else
+ do {
+ if (to <= from)
+ return false;
+
+ to--;
+ } while (str[to]);
+
+ return true;
+#endif
+}
+
char *
elf_strptr (Elf *elf, size_t idx, size_t offset)
{
@@ -166,8 +183,7 @@
{
/* Make sure the string is NUL terminated. Start from the end,
which very likely is a NUL char. */
- if (likely (memrchr (&strscn->zdata_base[offset],
- '\0', sh_size - offset) != NULL))
+ if (likely (validate_str (strscn->zdata_base, offset, sh_size)))
result = &strscn->zdata_base[offset];
else
__libelf_seterrno (ELF_E_INVALID_INDEX);
@@ -185,8 +201,7 @@
/* Make sure the string is NUL terminated. Start from the end,
which very likely is a NUL char. */
- if (likely (memrchr (&strscn->rawdata_base[offset],
- '\0', sh_size - offset) != NULL))
+ if (likely (validate_str (strscn->rawdata_base, offset, sh_size)))
result = &strscn->rawdata_base[offset];
else
__libelf_seterrno (ELF_E_INVALID_INDEX);
@@ -203,10 +218,9 @@
{
/* Make sure the string is NUL terminated. Start from
the end, which very likely is a NUL char. */
- if (likely (memrchr ((char *) dl->data.d.d_buf
- + (offset - dl->data.d.d_off), '\0',
- (dl->data.d.d_size
- - (offset - dl->data.d.d_off))) != NULL))
+ if (likely (validate_str ((char *) dl->data.d.d_buf,
+ offset - dl->data.d.d_off,
+ dl->data.d.d_size)))
result = ((char *) dl->data.d.d_buf
+ (offset - dl->data.d.d_off));
else
diff --git a/libelf/elf_update.c b/libelf/elf_update.c
index c635eb3..8ce0782 100644
--- a/libelf/elf_update.c
+++ b/libelf/elf_update.c
@@ -74,6 +74,8 @@
MAP_SHARED, elf->fildes, 0);
if (unlikely (elf->map_address == MAP_FAILED))
elf->map_address = NULL;
+ else
+ elf->flags |= ELF_F_MMAPPED;
}
if (elf->map_address != NULL)
diff --git a/libelf/gelf.h b/libelf/gelf.h
index 1bc7ee7..0619880 100644
--- a/libelf/gelf.h
+++ b/libelf/gelf.h
@@ -165,8 +165,10 @@
/* Update the ELF header. */
extern int gelf_update_ehdr (Elf *__elf, GElf_Ehdr *__src);
-/* Create new ELF header if none exists. */
-extern unsigned long int gelf_newehdr (Elf *__elf, int __class);
+/* Create new ELF header if none exists. Creates an Elf32_Ehdr if CLASS
+ is ELFCLASS32 or an Elf64_Ehdr if CLASS is ELFCLASS64. Returns NULL
+ on error. */
+extern void *gelf_newehdr (Elf *__elf, int __class);
/* Get section at OFFSET. */
extern Elf_Scn *gelf_offscn (Elf *__elf, GElf_Off __offset);
@@ -183,8 +185,10 @@
/* Update the program header. */
extern int gelf_update_phdr (Elf *__elf, int __ndx, GElf_Phdr *__src);
-/* Create new program header with PHNUM entries. */
-extern unsigned long int gelf_newphdr (Elf *__elf, size_t __phnum);
+/* Create new program header with PHNUM entries. Creates either an
+ Elf32_Phdr or an Elf64_Phdr depending on whether the given ELF is
+ ELFCLASS32 or ELFCLASS64. Returns NULL on error. */
+extern void *gelf_newphdr (Elf *__elf, size_t __phnum);
/* Get compression header of section if any. Returns NULL and sets
elf_errno if the section isn't compressed or an error occurred. */
diff --git a/libelf/gelf_newehdr.c b/libelf/gelf_newehdr.c
index cfa80e1..2788906 100644
--- a/libelf/gelf_newehdr.c
+++ b/libelf/gelf_newehdr.c
@@ -37,10 +37,10 @@
#include "libelfP.h"
-unsigned long int
+void *
gelf_newehdr (Elf *elf, int class)
{
return (class == ELFCLASS32
- ? (unsigned long int) INTUSE(elf32_newehdr) (elf)
- : (unsigned long int) INTUSE(elf64_newehdr) (elf));
+ ? (void *) INTUSE(elf32_newehdr) (elf)
+ : (void *) INTUSE(elf64_newehdr) (elf));
}
diff --git a/libelf/gelf_newphdr.c b/libelf/gelf_newphdr.c
index 4e95474..84aad78 100644
--- a/libelf/gelf_newphdr.c
+++ b/libelf/gelf_newphdr.c
@@ -37,10 +37,10 @@
#include "libelfP.h"
-unsigned long int
+void *
gelf_newphdr ( Elf *elf, size_t phnum)
{
return (elf->class == ELFCLASS32
- ? (unsigned long int) INTUSE(elf32_newphdr) (elf, phnum)
- : (unsigned long int) INTUSE(elf64_newphdr) (elf, phnum));
+ ? (void *) INTUSE(elf32_newphdr) (elf, phnum)
+ : (void *) INTUSE(elf64_newphdr) (elf, phnum));
}
diff --git a/libelf/gelf_xlate.c b/libelf/gelf_xlate.c
index f3d3b7a..479f143 100644
--- a/libelf/gelf_xlate.c
+++ b/libelf/gelf_xlate.c
@@ -74,7 +74,7 @@
uint16_t u16;
uint32_t u32;
uint64_t u64;
- } __attribute__ ((packed));
+ } attribute_packed;
#define FETCH(Bits, ptr) (((const union unaligned *) ptr)->u##Bits)
#define STORE(Bits, ptr, val) (((union unaligned *) ptr)->u##Bits = val)
diff --git a/libelf/libelf.h b/libelf/libelf.h
index c0d6389..547c0f5 100644
--- a/libelf/libelf.h
+++ b/libelf/libelf.h
@@ -64,6 +64,30 @@
#define ELFCOMPRESS_HIPROC 0x7fffffff /* End of processor-specific. */
#endif
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
+# define __nonnull_attribute__(...) __attribute__ ((__nonnull__ (__VA_ARGS__)))
+# define __deprecated_attribute__ __attribute__ ((__deprecated__))
+# define __pure_attribute__ __attribute__ ((__pure__))
+# define __const_attribute__ __attribute__ ((__const__))
+#else
+# define __nonnull_attribute__(...)
+# define __deprecated_attribute__
+# define __pure_attribute__
+# define __const_attribute__
+#endif
+
+#if __GNUC__ < 4
+#define __noreturn_attribute__
+#else
+#define __noreturn_attribute__ __attribute__ ((noreturn))
+#endif
+
+#ifdef __GNUC_STDC_INLINE__
+# define __libdw_extern_inline extern __inline __attribute__ ((__gnu_inline__))
+#else
+# define __libdw_extern_inline extern __inline
+#endif
+
/* Known translation types. */
typedef enum
{
@@ -216,7 +240,7 @@
extern int64_t elf_update (Elf *__elf, Elf_Cmd __cmd);
/* Determine what kind of file is associated with ELF. */
-extern Elf_Kind elf_kind (Elf *__elf) __attribute__ ((__pure__));
+extern Elf_Kind elf_kind (Elf *__elf) __pure_attribute__;
/* Get the base offset for an object file. */
extern int64_t elf_getbase (Elf *__elf);
@@ -282,7 +306,7 @@
It was agreed to make the same functionality available under a different
name and obsolete the old name. */
extern int elf_getshnum (Elf *__elf, size_t *__dst)
- __attribute__ ((__deprecated__));
+ __deprecated_attribute__;
/* Get the section index of the section header string table in the ELF
@@ -294,7 +318,7 @@
It was agreed to make the same functionality available under a different
name and obsolete the old name. */
extern int elf_getshstrndx (Elf *__elf, size_t *__dst)
- __attribute__ ((__deprecated__));
+ __deprecated_attribute__;
/* Retrieve section header of ELFCLASS32 binary. */
@@ -429,11 +453,11 @@
The result is based on version VERSION of the ELF standard. */
extern size_t elf32_fsize (Elf_Type __type, size_t __count,
unsigned int __version)
- __attribute__ ((__const__));
+ __const_attribute__;
/* Similar but this time the binary calls is ELFCLASS64. */
extern size_t elf64_fsize (Elf_Type __type, size_t __count,
unsigned int __version)
- __attribute__ ((__const__));
+ __const_attribute__;
/* Convert data structure from the representation in the file represented
@@ -472,11 +496,11 @@
/* Compute hash value. */
extern unsigned long int elf_hash (const char *__string)
- __attribute__ ((__pure__));
+ __pure_attribute__;
/* Compute hash value using the GNU-specific hash function. */
extern unsigned long int elf_gnu_hash (const char *__string)
- __attribute__ ((__pure__));
+ __pure_attribute__;
/* Compute simple checksum from permanent parts of the ELF file. */
diff --git a/libelf/libelfP.h b/libelf/libelfP.h
index 57ccbce..ed216c8 100644
--- a/libelf/libelfP.h
+++ b/libelf/libelfP.h
@@ -1,5 +1,5 @@
/* Internal interfaces for libelf.
- Copyright (C) 1998-2010, 2015 Red Hat, Inc.
+ Copyright (C) 1998-2010, 2015, 2016 Red Hat, Inc.
This file is part of elfutils.
Contributed by Ulrich Drepper <drepper@redhat.com>, 1998.
@@ -30,10 +30,6 @@
#ifndef _LIBELFP_H
#define _LIBELFP_H 1
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
#include <ar.h>
#include <gelf.h>
@@ -106,6 +102,7 @@
ELF_E_INVALID_ENCODING,
ELF_E_NOMEM,
ELF_E_INVALID_FILE,
+ ELF_E_INVALID_ELF,
ELF_E_INVALID_OP,
ELF_E_NO_VERSION,
ELF_E_INVALID_CMD,
@@ -233,7 +230,13 @@
} shdr;
unsigned int shdr_flags; /* Section header modified? */
- unsigned int flags; /* Section changed in size? */
+ unsigned int flags; /* Section changed in size?
+ ELF_F_MALLOCED for a Elf_Data_Chunk
+ dummy_scn means the rawchunks
+ data.d.d_buf was malloced. For normal
+ sections it means rawdata_base was
+ malloced (by elf_compress) even if
+ the Elf was mmapped. */
char *rawdata_base; /* The unmodified data of the section. */
char *data_base; /* The converted data of the section. */
@@ -440,15 +443,11 @@
# define LIBELF_EV_IDX (__libelf_version - 1)
#endif
-#if !ALLOW_UNALIGNED
/* Array with alignment requirements of the internal types indexed by ELF
version, binary class, and type. */
extern const uint_fast8_t __libelf_type_aligns[EV_NUM - 1][ELFCLASSNUM - 1][ELF_T_NUM] attribute_hidden;
# define __libelf_type_align(class, type) \
(__libelf_type_aligns[LIBELF_EV_IDX][class - 1][type] ?: 1)
-#else
-# define __libelf_type_align(class, type) 1
-#endif
/* Given an Elf handle and a section type returns the Elf_Data d_type.
Should not be called when SHF_COMPRESSED is set, the d_type should
@@ -576,7 +575,7 @@
extern unsigned int __elf_version_internal (unsigned int __version)
attribute_hidden;
extern unsigned long int __elf_hash_internal (const char *__string)
- __attribute__ ((__pure__, visibility ("hidden")));
+ __attribute__ ((__pure__)) attribute_hidden;
extern long int __elf32_checksum_internal (Elf *__elf) attribute_hidden;
extern long int __elf64_checksum_internal (Elf *__elf) attribute_hidden;
diff --git a/po/ChangeLog b/po/ChangeLog
index 0acdda6..8f318aa 100644
--- a/po/ChangeLog
+++ b/po/ChangeLog
@@ -1,3 +1,53 @@
+2018-06-11 Mark Wielaard <mark@klomp.org>
+
+ * *.po: Update for 0.172.
+
+2018-06-01 Mark Wielaard <mark@klomp.org>
+
+ * *.po: Update for 0.171.
+
+2017-09-01 Mark Wielaard <mark@klomp.org>
+
+ * *.po: Regenerated. Replace \v with \n\n.
+
+2017-08-02 Mark Wielaard <mark@klomp.org>
+
+ * *.po: Update for 0.170.
+
+2017-05-05 Mark Wielaard <mark@klomp.org>
+
+ * *.po: Update for 0.169.
+
+2017-02-16 Ulf Hermann <ulf.hermann@qt.io>
+
+ * po/POTFILES.in: Removed lib/version.c, added lib/printversion.c.
+
+2016-12-27 Mark Wielaard <mark@klomp.org>
+
+ * *.po: Update for 0.168.
+
+2016-12-24 Mark Wielaard <mark@klomp.org>
+
+ * Makevars (COPYRIGHT_HOLDER): Set to the elfutils developers.
+ (MSGID_BUGS_ADDRESS): Set to http://sourceware.org/bugzilla/
+
+2016-08-24 Mark Wielaard <mjw@redhat.com>
+
+ * *.po: Regenerate.
+
+2016-08-04 Mark Wielaard <mjw@redhat.com>
+
+ * *.po: Update for 0.167.
+
+2016-07-06 Mark Wielaard <mjw@redhat.com>
+
+ * po/POTFILES.in: Removed libebl/eblobjecttypename.c,
+ src/i386_ld.c, src/ld.c, src/ldgeneric.c and src/ldscript.y.
+
+2016-03-31 Mark Wielaard <mjw@redhat.com>
+
+ * *.po: Update for 0.166.
+
2016-01-11 Mark Wielaard <mjw@redhat.com>
* *.po: Regenerate.
diff --git a/po/Makevars b/po/Makevars
index 8a8ebc6..0afcf4e 100644
--- a/po/Makevars
+++ b/po/Makevars
@@ -9,7 +9,8 @@
# These options get passed to xgettext.
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --flag=error:3:c-format \
- --flag=ERROR:1:c-format --flag=argp_error:2:c-format
+ --flag=ERROR:1:c-format --flag=argp_error:2:c-format \
+ --add-comments
# This is the copyright holder that gets inserted into the header of the
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
@@ -19,7 +20,7 @@
# or entity, or to disclaim their copyright. The empty string stands for
# the public domain; in this case the translators are expected to disclaim
# their copyright.
-COPYRIGHT_HOLDER = Red Hat, Inc.
+COPYRIGHT_HOLDER = The elfutils developers
# This is the email address or URL to which the translators shall report
# bugs in the untranslated strings:
@@ -35,7 +36,7 @@
# It can be your email address, or a mailing list address where translators
# can write to without being subscribed, or the URL of a web page through
# which the translators can contact you.
-MSGID_BUGS_ADDRESS = http://bugzilla.redhat.com/
+MSGID_BUGS_ADDRESS = https://sourceware.org/bugzilla/
# This is the list of locale categories, beyond LC_MESSAGES, for which the
# message catalogs shall be used. It is usually empty.
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 02433f9..4eac6d0 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -3,6 +3,7 @@
# Files from the compatibility library
lib/color.c
+lib/printversion.c
lib/xmalloc.c
# Library sources
@@ -13,7 +14,6 @@
libebl/eblbackendname.c
libebl/eblcorenotetypename.c
libebl/ebldynamictagname.c
-libebl/eblobjecttypename.c
libebl/eblobjnote.c
libebl/eblobjnotetypename.c
libebl/eblosabiname.c
@@ -30,12 +30,9 @@
src/arlib-argp.c
src/arlib.c
src/elfcmp.c
+src/elfcompress.c
src/elflint.c
src/findtextrel.c
-src/i386_ld.c
-src/ld.c
-src/ldgeneric.c
-src/ldscript.y
src/nm.c
src/objdump.c
src/ranlib.c
diff --git a/po/de.po b/po/de.po
index 2b937ac..738963a 100644
--- a/po/de.po
+++ b/po/de.po
@@ -10,8 +10,8 @@
msgid ""
msgstr ""
"Project-Id-Version: elfutils VERSION\n"
-"Report-Msgid-Bugs-To: http://bugzilla.redhat.com/\n"
-"POT-Creation-Date: 2016-01-11 08:48+0100\n"
+"Report-Msgid-Bugs-To: https://sourceware.org/bugzilla/\n"
+"POT-Creation-Date: 2018-06-29 20:47+0200\n"
"PO-Revision-Date: 2009-06-29 15:15+0200\n"
"Last-Translator: Michael Münch <micm@fedoraproject.org>\n"
"Language-Team: German\n"
@@ -37,29 +37,40 @@
" - 'auto', 'tty', 'if-tty'\n"
msgstr ""
-#: lib/color.c:190 src/objdump.c:738
+#: lib/color.c:190 src/objdump.c:727
#, fuzzy, c-format
msgid "cannot allocate memory"
msgstr "konnte Verzeichnis nicht erstellen: %s"
-#: lib/xmalloc.c:53 lib/xmalloc.c:66 lib/xmalloc.c:78 src/readelf.c:3282
-#: src/readelf.c:3669 src/readelf.c:8416 src/unstrip.c:2233 src/unstrip.c:2438
+#: lib/printversion.c:40
+#, fuzzy, c-format
+msgid ""
+"Copyright (C) %s The elfutils developers <%s>.\n"
+"This is free software; see the source for copying conditions. There is NO\n"
+"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
+msgstr ""
+"Copyright (C) %s Red Hat, Inc.\n"
+"Dies ist freie Software, siehe Quellcode für Kopierbedingungen. KEINE "
+"GARANTIE,\n"
+"auch nicht für Marktgängigkeit oder Eignung für einen Bestimmten Zweck.\n"
+
+#: lib/xmalloc.c:53 lib/xmalloc.c:66 lib/xmalloc.c:78 src/readelf.c:3395
+#: src/readelf.c:11196 src/unstrip.c:2227 src/unstrip.c:2433
#, c-format
msgid "memory exhausted"
msgstr "Kein Speicher mehr verfügbar"
-#: libasm/asm_error.c:65 libdw/dwarf_error.c:58 libdwfl/libdwflP.h:53
+#: libasm/asm_error.c:65 libdw/dwarf_error.c:57 libdwfl/libdwflP.h:50
#: libelf/elf_error.c:60
msgid "no error"
msgstr "kein Fehler"
-#: libasm/asm_error.c:66 libdw/dwarf_error.c:68 libdwfl/libdwflP.h:55
+#: libasm/asm_error.c:66 libdw/dwarf_error.c:67 libdwfl/libdwflP.h:52
#: libelf/elf_error.c:91
msgid "out of memory"
msgstr "nicht genügend Speicher"
-#: libasm/asm_error.c:67 src/ldgeneric.c:2677
-#, c-format
+#: libasm/asm_error.c:67
msgid "cannot create output file"
msgstr "Ausgangsdatei konnte nicht erstellt werden"
@@ -71,8 +82,7 @@
msgid "cannot change mode of output file"
msgstr "konnte Modus der Ausgabedatei nicht ändern"
-#: libasm/asm_error.c:70 src/ldgeneric.c:6990
-#, c-format
+#: libasm/asm_error.c:70
msgid "cannot rename output file"
msgstr "Ausgangsdatei konnte nicht umbenannt werden"
@@ -92,384 +102,426 @@
msgid "no backend support available"
msgstr "keine Backend-Unterstützung verfügbar"
-#: libasm/asm_error.c:83 libdw/dwarf_error.c:59 libdwfl/libdwflP.h:54
+#: libasm/asm_error.c:83 libdw/dwarf_error.c:58 libdwfl/libdwflP.h:51
#: libelf/elf_error.c:63
msgid "unknown error"
msgstr "unbekannter Fehler"
-#: libdw/dwarf_error.c:60
+#: libdw/dwarf_error.c:59
msgid "invalid access"
msgstr "Ungültiger Zugriff"
-#: libdw/dwarf_error.c:61
+#: libdw/dwarf_error.c:60
msgid "no regular file"
msgstr "Keine reguläre Date"
-#: libdw/dwarf_error.c:62
+#: libdw/dwarf_error.c:61
msgid "I/O error"
msgstr "I/O Fehler"
-#: libdw/dwarf_error.c:63
+#: libdw/dwarf_error.c:62
msgid "invalid ELF file"
msgstr "Ungültige ELF Datei"
-#: libdw/dwarf_error.c:64
+#: libdw/dwarf_error.c:63
msgid "no DWARF information"
msgstr "keine DWARF Information"
-#: libdw/dwarf_error.c:65
+#: libdw/dwarf_error.c:64
msgid "cannot decompress DWARF"
msgstr ""
-#: libdw/dwarf_error.c:66
+#: libdw/dwarf_error.c:65
msgid "no ELF file"
msgstr "keine ELF Datei"
-#: libdw/dwarf_error.c:67
+#: libdw/dwarf_error.c:66
msgid "cannot get ELF header"
msgstr "ELF Kopf konnte nicht ausgelesen werden"
-#: libdw/dwarf_error.c:69
+#: libdw/dwarf_error.c:68
msgid "not implemented"
msgstr "Nicht implementiert"
-#: libdw/dwarf_error.c:70 libelf/elf_error.c:107 libelf/elf_error.c:155
+#: libdw/dwarf_error.c:69 libelf/elf_error.c:111 libelf/elf_error.c:159
msgid "invalid command"
msgstr "Ungültiger Befehl"
-#: libdw/dwarf_error.c:71
+#: libdw/dwarf_error.c:70
msgid "invalid version"
msgstr "Ungültige Version"
-#: libdw/dwarf_error.c:72
+#: libdw/dwarf_error.c:71
msgid "invalid file"
msgstr "Ungültige Datei"
-#: libdw/dwarf_error.c:73
+#: libdw/dwarf_error.c:72
msgid "no entries found"
msgstr "Keine Einträge gefunden"
-#: libdw/dwarf_error.c:74
+#: libdw/dwarf_error.c:73
msgid "invalid DWARF"
msgstr "DWARF ungültig"
-#: libdw/dwarf_error.c:75
+#: libdw/dwarf_error.c:74
msgid "no string data"
msgstr ""
+#: libdw/dwarf_error.c:75
+#, fuzzy
+msgid ".debug_str section missing"
+msgstr ".debug_line Sektion fehlt"
+
#: libdw/dwarf_error.c:76
+#, fuzzy
+msgid ".debug_line_str section missing"
+msgstr ".debug_line Sektion fehlt"
+
+#: libdw/dwarf_error.c:77
+#, fuzzy
+msgid ".debug_str_offsets section missing"
+msgstr ".debug_line Sektion fehlt"
+
+#: libdw/dwarf_error.c:78
msgid "no address value"
msgstr "Kein Adress-Wert"
-#: libdw/dwarf_error.c:77
+#: libdw/dwarf_error.c:79
msgid "no constant value"
msgstr "Kein Konstanten-Wert"
-#: libdw/dwarf_error.c:78
+#: libdw/dwarf_error.c:80
msgid "no reference value"
msgstr "Kein Referenz-Wert"
-#: libdw/dwarf_error.c:79
+#: libdw/dwarf_error.c:81
msgid "invalid reference value"
msgstr "Ungültiger Referenz-Wert"
-#: libdw/dwarf_error.c:80
+#: libdw/dwarf_error.c:82
msgid ".debug_line section missing"
msgstr ".debug_line Sektion fehlt"
-#: libdw/dwarf_error.c:81
+#: libdw/dwarf_error.c:83
msgid "invalid .debug_line section"
msgstr "ungültige .debug_line Sektion"
-#: libdw/dwarf_error.c:82
+#: libdw/dwarf_error.c:84
msgid "debug information too big"
msgstr "Debug Information zu groß"
-#: libdw/dwarf_error.c:83
+#: libdw/dwarf_error.c:85
msgid "invalid DWARF version"
msgstr "Ungültige DWARF Version"
-#: libdw/dwarf_error.c:84
+#: libdw/dwarf_error.c:86
msgid "invalid directory index"
msgstr "ungültiger Verzeichnisindex"
-#: libdw/dwarf_error.c:85 libdwfl/libdwflP.h:74
+#: libdw/dwarf_error.c:87 libdwfl/libdwflP.h:71
msgid "address out of range"
msgstr "Außerhalb des Adressbereiches"
-#: libdw/dwarf_error.c:86
-msgid "no location list value"
-msgstr ""
+#: libdw/dwarf_error.c:88
+#, fuzzy
+msgid ".debug_loc section missing"
+msgstr ".debug_line Sektion fehlt"
-#: libdw/dwarf_error.c:87
+#: libdw/dwarf_error.c:89
+#, fuzzy
+msgid ".debug_loclists section missing"
+msgstr ".debug_line Sektion fehlt"
+
+#: libdw/dwarf_error.c:90
+#, fuzzy
+msgid "not a location list value"
+msgstr "Kein Konstanten-Wert"
+
+#: libdw/dwarf_error.c:91
msgid "no block data"
msgstr ""
-#: libdw/dwarf_error.c:88
+#: libdw/dwarf_error.c:92
msgid "invalid line index"
msgstr "Ungültiger Zeilenindex"
-#: libdw/dwarf_error.c:89
+#: libdw/dwarf_error.c:93
msgid "invalid address range index"
msgstr "Ungültiger Adressbereichs Index"
-#: libdw/dwarf_error.c:90 libdwfl/libdwflP.h:75
+#: libdw/dwarf_error.c:94 libdwfl/libdwflP.h:72
msgid "no matching address range"
msgstr "Kein passender Adressbereich"
-#: libdw/dwarf_error.c:91
+#: libdw/dwarf_error.c:95
msgid "no flag value"
msgstr ""
-#: libdw/dwarf_error.c:92 libelf/elf_error.c:232
+#: libdw/dwarf_error.c:96 libelf/elf_error.c:236
msgid "invalid offset"
msgstr "ungültiger Offset"
-#: libdw/dwarf_error.c:93
+#: libdw/dwarf_error.c:97
msgid ".debug_ranges section missing"
msgstr ""
-#: libdw/dwarf_error.c:94
+#: libdw/dwarf_error.c:98
+#, fuzzy
+msgid ".debug_rnglists section missing"
+msgstr ".debug_line Sektion fehlt"
+
+#: libdw/dwarf_error.c:99
#, fuzzy
msgid "invalid CFI section"
msgstr "ungültiger Abschnitt"
-#: libdw/dwarf_error.c:95
+#: libdw/dwarf_error.c:100
msgid "no alternative debug link found"
msgstr ""
-#: libdw/dwarf_error.c:96
+#: libdw/dwarf_error.c:101
#, fuzzy
msgid "invalid opcode"
msgstr "ungültiger Operand"
-#: libdw/dwarf_error.c:97
+#: libdw/dwarf_error.c:102
msgid "not a CU (unit) DIE"
msgstr ""
-#: libdwfl/argp-std.c:46 src/stack.c:642 src/unstrip.c:2380
+#: libdw/dwarf_error.c:103
+#, fuzzy
+msgid "unknown language code"
+msgstr "unbekannter Typ"
+
+#: libdw/dwarf_error.c:104
+#, fuzzy
+msgid ".debug_addr section missing"
+msgstr ".debug_line Sektion fehlt"
+
+#: libdwfl/argp-std.c:50 src/stack.c:639 src/unstrip.c:2374
msgid "Input selection options:"
msgstr "Eingabeauswahloptionen:"
-#: libdwfl/argp-std.c:47
+#: libdwfl/argp-std.c:51
msgid "Find addresses in FILE"
msgstr "Finde Adressen in FILE"
-#: libdwfl/argp-std.c:49
+#: libdwfl/argp-std.c:53
msgid "Find addresses from signatures found in COREFILE"
msgstr "Finde Adressen von Signatur aus COREFILE"
-#: libdwfl/argp-std.c:51
+#: libdwfl/argp-std.c:55
msgid "Find addresses in files mapped into process PID"
msgstr ""
-#: libdwfl/argp-std.c:53
+#: libdwfl/argp-std.c:57
msgid ""
"Find addresses in files mapped as read from FILE in Linux /proc/PID/maps "
"format"
msgstr ""
-#: libdwfl/argp-std.c:55
+#: libdwfl/argp-std.c:59
msgid "Find addresses in the running kernel"
msgstr "Finde Adressen im laufenden Kernel"
-#: libdwfl/argp-std.c:57
+#: libdwfl/argp-std.c:61
msgid "Kernel with all modules"
msgstr "Kernel mit allen Modulen"
-#: libdwfl/argp-std.c:59 src/stack.c:649
+#: libdwfl/argp-std.c:63 src/stack.c:646
msgid "Search path for separate debuginfo files"
msgstr "Dateisuchpfad für separate Debug-Informationen"
-#: libdwfl/argp-std.c:157
+#: libdwfl/argp-std.c:164
msgid "only one of -e, -p, -k, -K, or --core allowed"
msgstr "Nur eine Option von -e, -p, -k, -K, oder --core erlaubt"
-#: libdwfl/argp-std.c:230
+#: libdwfl/argp-std.c:237
msgid "cannot load kernel symbols"
msgstr "Konnte Kernel Symbole nicht laden"
-#: libdwfl/argp-std.c:234
+#. Non-fatal to have no modules since we do have the kernel.
+#: libdwfl/argp-std.c:241
msgid "cannot find kernel modules"
msgstr "Konnte Kernel Module nicht finden"
-#: libdwfl/argp-std.c:251
+#: libdwfl/argp-std.c:258
msgid "cannot find kernel or modules"
msgstr "Konnte Kernel oder Module nicht finden"
-#: libdwfl/argp-std.c:290
+#: libdwfl/argp-std.c:297
#, c-format
msgid "cannot read ELF core file: %s"
msgstr "Konnte ELF Kerndatei %s nicht lesen"
-#: libdwfl/argp-std.c:313
+#: libdwfl/argp-std.c:320
#, fuzzy
msgid "Not enough memory"
msgstr "nicht genügend Speicher"
-#: libdwfl/argp-std.c:323
+#: libdwfl/argp-std.c:330
msgid "No modules recognized in core file"
msgstr "Keine Module in der Kerndatei gefunden"
-#: libdwfl/libdwflP.h:56
+#: libdwfl/libdwflP.h:53
msgid "See errno"
msgstr ""
-#: libdwfl/libdwflP.h:57
+#: libdwfl/libdwflP.h:54
msgid "See elf_errno"
msgstr ""
-#: libdwfl/libdwflP.h:58
+#: libdwfl/libdwflP.h:55
msgid "See dwarf_errno"
msgstr ""
-#: libdwfl/libdwflP.h:59
+#: libdwfl/libdwflP.h:56
msgid "See ebl_errno (XXX missing)"
msgstr ""
-#: libdwfl/libdwflP.h:60
+#: libdwfl/libdwflP.h:57
msgid "gzip decompression failed"
msgstr ""
-#: libdwfl/libdwflP.h:61
+#: libdwfl/libdwflP.h:58
msgid "bzip2 decompression failed"
msgstr ""
-#: libdwfl/libdwflP.h:62
+#: libdwfl/libdwflP.h:59
msgid "LZMA decompression failed"
msgstr ""
-#: libdwfl/libdwflP.h:63
+#: libdwfl/libdwflP.h:60
msgid "no support library found for machine"
msgstr ""
-#: libdwfl/libdwflP.h:64
+#: libdwfl/libdwflP.h:61
msgid "Callbacks missing for ET_REL file"
msgstr ""
-#: libdwfl/libdwflP.h:65
+#: libdwfl/libdwflP.h:62
msgid "Unsupported relocation type"
msgstr ""
-#: libdwfl/libdwflP.h:66
+#: libdwfl/libdwflP.h:63
msgid "r_offset is bogus"
msgstr ""
-#: libdwfl/libdwflP.h:67 libelf/elf_error.c:111 libelf/elf_error.c:171
+#: libdwfl/libdwflP.h:64 libelf/elf_error.c:115 libelf/elf_error.c:175
msgid "offset out of range"
msgstr "Offset ausserhalb des Bereichs"
-#: libdwfl/libdwflP.h:68
+#: libdwfl/libdwflP.h:65
#, fuzzy
msgid "relocation refers to undefined symbol"
msgstr "Zeige Grösse der definierten Symbole"
-#: libdwfl/libdwflP.h:69
+#: libdwfl/libdwflP.h:66
msgid "Callback returned failure"
msgstr ""
-#: libdwfl/libdwflP.h:70
+#: libdwfl/libdwflP.h:67
#, fuzzy
msgid "No DWARF information found"
msgstr "keine DWARF Information"
-#: libdwfl/libdwflP.h:71
+#: libdwfl/libdwflP.h:68
msgid "No symbol table found"
msgstr ""
-#: libdwfl/libdwflP.h:72
+#: libdwfl/libdwflP.h:69
#, fuzzy
msgid "No ELF program headers"
msgstr "Programm-Köpfe anzeigen"
-#: libdwfl/libdwflP.h:73
+#: libdwfl/libdwflP.h:70
msgid "address range overlaps an existing module"
msgstr ""
-#: libdwfl/libdwflP.h:76
+#: libdwfl/libdwflP.h:73
msgid "image truncated"
msgstr ""
-#: libdwfl/libdwflP.h:77
+#: libdwfl/libdwflP.h:74
#, fuzzy
msgid "ELF file opened"
msgstr "keine ELF Datei"
-#: libdwfl/libdwflP.h:78
+#: libdwfl/libdwflP.h:75
#, fuzzy
msgid "not a valid ELF file"
msgstr "Ungültige ELF Datei"
-#: libdwfl/libdwflP.h:79
+#: libdwfl/libdwflP.h:76
#, fuzzy
msgid "cannot handle DWARF type description"
msgstr "konnte Elf-Deskriptor nicht erzeugen: %s"
-#: libdwfl/libdwflP.h:80
+#: libdwfl/libdwflP.h:77
msgid "ELF file does not match build ID"
msgstr ""
-#: libdwfl/libdwflP.h:81
+#: libdwfl/libdwflP.h:78
#, fuzzy
msgid "corrupt .gnu.prelink_undo section data"
msgstr "konnte Abschnittsdaten nicht holen: %s"
-#: libdwfl/libdwflP.h:82
+#: libdwfl/libdwflP.h:79
msgid "Internal error due to ebl"
msgstr ""
-#: libdwfl/libdwflP.h:83
+#: libdwfl/libdwflP.h:80
msgid "Missing data in core file"
msgstr ""
-#: libdwfl/libdwflP.h:84
+#: libdwfl/libdwflP.h:81
#, fuzzy
msgid "Invalid register"
msgstr "ungültiger Parameter"
-#: libdwfl/libdwflP.h:85
+#: libdwfl/libdwflP.h:82
msgid "Error reading process memory"
msgstr ""
-#: libdwfl/libdwflP.h:86
+#: libdwfl/libdwflP.h:83
msgid "Couldn't find architecture of any ELF"
msgstr ""
-#: libdwfl/libdwflP.h:87
+#: libdwfl/libdwflP.h:84
msgid "Error parsing /proc filesystem"
msgstr ""
-#: libdwfl/libdwflP.h:88
+#: libdwfl/libdwflP.h:85
#, fuzzy
msgid "Invalid DWARF"
msgstr "DWARF ungültig"
-#: libdwfl/libdwflP.h:89
+#: libdwfl/libdwflP.h:86
msgid "Unsupported DWARF"
msgstr ""
-#: libdwfl/libdwflP.h:90
+#: libdwfl/libdwflP.h:87
msgid "Unable to find more threads"
msgstr ""
-#: libdwfl/libdwflP.h:91
+#: libdwfl/libdwflP.h:88
msgid "Dwfl already has attached state"
msgstr ""
-#: libdwfl/libdwflP.h:92
+#: libdwfl/libdwflP.h:89
msgid "Dwfl has no attached state"
msgstr ""
-#: libdwfl/libdwflP.h:93
+#: libdwfl/libdwflP.h:90
msgid "Unwinding not supported for this architecture"
msgstr ""
-#: libdwfl/libdwflP.h:94
+#: libdwfl/libdwflP.h:91
#, fuzzy
msgid "Invalid argument"
msgstr "ungültiger Parameter"
-#: libdwfl/libdwflP.h:95
+#: libdwfl/libdwflP.h:92
#, fuzzy
msgid "Not an ET_CORE ELF file"
msgstr "Ungültige ELF Datei"
@@ -478,14 +530,14 @@
msgid "No backend"
msgstr "Kein Backend"
-#: libebl/eblcorenotetypename.c:98 libebl/eblobjecttypename.c:53
-#: libebl/eblobjnotetypename.c:69 libebl/eblosabiname.c:73
-#: libebl/eblsectionname.c:83 libebl/eblsectiontypename.c:115
-#: libebl/eblsegmenttypename.c:79
+#: libebl/eblcorenotetypename.c:100 libebl/eblobjnotetypename.c:76
+#: libebl/eblobjnotetypename.c:83 libebl/eblobjnotetypename.c:102
+#: libebl/eblosabiname.c:73 libebl/eblsectionname.c:83
+#: libebl/eblsectiontypename.c:115 libebl/eblsegmenttypename.c:79
msgid "<unknown>"
msgstr "<Unbekannt>"
-#: libebl/ebldynamictagname.c:101
+#: libebl/ebldynamictagname.c:103
#, c-format
msgid "<unknown>: %#<PRIx64>"
msgstr "<Unbekannt>: %#<PRIx64>"
@@ -535,6 +587,7 @@
msgid " Build ID: "
msgstr " Build ID: "
+#. A non-null terminated version string.
#: libebl/eblobjnote.c:152
#, c-format
msgid " Linker version: %.*s\n"
@@ -574,7 +627,7 @@
msgid "invalid size of destination operand"
msgstr "ungültige Grösse des Ziel-Operanden"
-#: libelf/elf_error.c:87 src/readelf.c:5473
+#: libelf/elf_error.c:87 src/readelf.c:6107
#, c-format
msgid "invalid encoding"
msgstr "ungültige Kodierung"
@@ -584,151 +637,156 @@
msgstr "ungültiger Datei-Deskriptor"
#: libelf/elf_error.c:99
+#, fuzzy
+msgid "invalid ELF file data"
+msgstr "Ungültige ELF Datei"
+
+#: libelf/elf_error.c:103
msgid "invalid operation"
msgstr "ungültige Operation"
-#: libelf/elf_error.c:103
+#: libelf/elf_error.c:107
msgid "ELF version not set"
msgstr "ELF-Version nicht gesetzt"
-#: libelf/elf_error.c:115
+#: libelf/elf_error.c:119
msgid "invalid fmag field in archive header"
msgstr "ungültiges fmag-Feld im Archivheader"
-#: libelf/elf_error.c:119
+#: libelf/elf_error.c:123
msgid "invalid archive file"
msgstr "Ungültige Archiv-Datei"
-#: libelf/elf_error.c:123
+#: libelf/elf_error.c:127
msgid "descriptor is not for an archive"
msgstr ""
-#: libelf/elf_error.c:127
+#: libelf/elf_error.c:131
msgid "no index available"
msgstr "kein Index verfügbar"
-#: libelf/elf_error.c:131
+#: libelf/elf_error.c:135
msgid "cannot read data from file"
msgstr "Daten aus der Datei konnten nicht gelesen werden"
-#: libelf/elf_error.c:135
+#: libelf/elf_error.c:139
msgid "cannot write data to file"
msgstr "Daten konnten nicht in die Datei geschrieben werden"
-#: libelf/elf_error.c:139
+#: libelf/elf_error.c:143
msgid "invalid binary class"
msgstr "ungültige Binärklasse"
-#: libelf/elf_error.c:143
+#: libelf/elf_error.c:147
msgid "invalid section index"
msgstr "ungültiger Abschnittsindex"
-#: libelf/elf_error.c:147
+#: libelf/elf_error.c:151
msgid "invalid operand"
msgstr "ungültiger Operand"
-#: libelf/elf_error.c:151
+#: libelf/elf_error.c:155
msgid "invalid section"
msgstr "ungültiger Abschnitt"
-#: libelf/elf_error.c:159
+#: libelf/elf_error.c:163
msgid "executable header not created first"
msgstr "ausführbarer Header wurde nicht zuerst erstellt"
-#: libelf/elf_error.c:163
+#: libelf/elf_error.c:167
msgid "file descriptor disabled"
msgstr "Datei-Deskriptor deaktiviert"
-#: libelf/elf_error.c:167
+#: libelf/elf_error.c:171
#, fuzzy
msgid "archive/member file descriptor mismatch"
msgstr "Datei-Deskriptor deaktiviert"
-#: libelf/elf_error.c:175
+#: libelf/elf_error.c:179
msgid "cannot manipulate null section"
msgstr ""
-#: libelf/elf_error.c:179
+#: libelf/elf_error.c:183
#, fuzzy
msgid "data/scn mismatch"
msgstr "data/scn Unterschied"
-#: libelf/elf_error.c:183
+#: libelf/elf_error.c:187
msgid "invalid section header"
msgstr "ungültiger Abschnitts-Header"
-#: libelf/elf_error.c:187 src/readelf.c:7342 src/readelf.c:7790
-#: src/readelf.c:7891 src/readelf.c:8072
+#: libelf/elf_error.c:191 src/readelf.c:9742 src/readelf.c:10313
+#: src/readelf.c:10414 src/readelf.c:10595
#, c-format
msgid "invalid data"
msgstr "Ungültige Daten"
-#: libelf/elf_error.c:191
+#: libelf/elf_error.c:195
msgid "unknown data encoding"
msgstr "Unbekannte Datenkodierung"
-#: libelf/elf_error.c:195
+#: libelf/elf_error.c:199
msgid "section `sh_size' too small for data"
msgstr "Abschnitt `sh_size' zu klein für Daten"
-#: libelf/elf_error.c:199
+#: libelf/elf_error.c:203
msgid "invalid section alignment"
msgstr "ungültige Abschnittsausrichtung"
-#: libelf/elf_error.c:203
+#: libelf/elf_error.c:207
msgid "invalid section entry size"
msgstr ""
-#: libelf/elf_error.c:207
+#: libelf/elf_error.c:211
msgid "update() for write on read-only file"
msgstr ""
-#: libelf/elf_error.c:211
+#: libelf/elf_error.c:215
msgid "no such file"
msgstr "Datei nicht gefunden"
-#: libelf/elf_error.c:215
+#: libelf/elf_error.c:219
msgid "only relocatable files can contain section groups"
msgstr ""
-#: libelf/elf_error.c:220
+#: libelf/elf_error.c:224
msgid ""
"program header only allowed in executables, shared objects, and core files"
msgstr ""
-#: libelf/elf_error.c:227
+#: libelf/elf_error.c:231
msgid "file has no program header"
msgstr "Datei hat keinen Programm-Kopf"
-#: libelf/elf_error.c:237
+#: libelf/elf_error.c:241
#, fuzzy
msgid "invalid section type"
msgstr "ungültiger Abschnitt"
-#: libelf/elf_error.c:242
+#: libelf/elf_error.c:246
#, fuzzy
msgid "invalid section flags"
msgstr "ungültiger Abschnitt"
-#: libelf/elf_error.c:247
+#: libelf/elf_error.c:251
msgid "section does not contain compressed data"
msgstr ""
-#: libelf/elf_error.c:252
+#: libelf/elf_error.c:256
msgid "section contains compressed data"
msgstr ""
-#: libelf/elf_error.c:257
+#: libelf/elf_error.c:261
#, fuzzy
msgid "unknown compression type"
msgstr "unbekannter Typ"
-#: libelf/elf_error.c:262
+#: libelf/elf_error.c:266
#, fuzzy
msgid "cannot compress data"
msgstr "konnte Abschnittsdaten nicht kopieren: %s"
-#: libelf/elf_error.c:267
+#: libelf/elf_error.c:271
#, fuzzy
msgid "cannot decompress data"
msgstr "konnte Abschnittsdaten nicht kopieren: %s"
@@ -789,59 +847,38 @@
msgid "Print all information on one line, and indent inlines"
msgstr ""
-#: src/addr2line.c:79 src/elfcmp.c:72 src/findtextrel.c:67 src/nm.c:100
+#: src/addr2line.c:79 src/elfcmp.c:71 src/findtextrel.c:66 src/nm.c:101
#: src/strings.c:79
msgid "Miscellaneous:"
msgstr "Verschiedenes:"
+#. Short description of program.
#: src/addr2line.c:87
msgid ""
"Locate source files and line information for ADDRs (in a.out by default)."
msgstr ""
+#. Strings for arguments in help texts.
#: src/addr2line.c:91
msgid "[ADDR...]"
msgstr ""
-#: src/addr2line.c:216 src/ar.c:285 src/elfcmp.c:672 src/elflint.c:235
-#: src/findtextrel.c:162 src/ld.c:943 src/nm.c:262 src/objdump.c:177
-#: src/ranlib.c:124 src/readelf.c:509 src/size.c:207 src/strings.c:230
-#: src/strip.c:218 src/unstrip.c:232
-#, c-format
-msgid ""
-"Copyright (C) %s Red Hat, Inc.\n"
-"This is free software; see the source for copying conditions. There is NO\n"
-"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
-msgstr ""
-"Copyright (C) %s Red Hat, Inc.\n"
-"Dies ist freie Software, siehe Quellcode für Kopierbedingungen. KEINE "
-"GARANTIE,\n"
-"auch nicht für Marktgängigkeit oder Eignung für einen Bestimmten Zweck.\n"
-
-#: src/addr2line.c:221 src/ar.c:290 src/elfcmp.c:677 src/elflint.c:240
-#: src/findtextrel.c:167 src/ld.c:948 src/nm.c:267 src/objdump.c:182
-#: src/ranlib.c:129 src/readelf.c:514 src/size.c:212 src/strings.c:235
-#: src/strip.c:223 src/unstrip.c:237
-#, c-format
-msgid "Written by %s.\n"
-msgstr "Geschrieben von %s.\n"
-
-#: src/addr2line.c:533
+#: src/addr2line.c:520
#, fuzzy, c-format
msgid "Section syntax requires exactly one module"
msgstr "Abschnitt syntax benötigt genau ein Modul"
-#: src/addr2line.c:556
+#: src/addr2line.c:543
#, c-format
msgid "offset %#<PRIxMAX> lies outside section '%s'"
msgstr ""
-#: src/addr2line.c:645
+#: src/addr2line.c:633
#, c-format
msgid "cannot find symbol '%s'"
msgstr "Konnte Symbol '%s' nicht finden"
-#: src/addr2line.c:650
+#: src/addr2line.c:638
#, c-format
msgid "offset %#<PRIxMAX> lies outside contents of '%s'"
msgstr ""
@@ -931,10 +968,12 @@
msgid "Update only older files in archive."
msgstr "Nur ältere Datein im Archiv aktualisieren"
+#. Short description of program.
#: src/ar.c:99
msgid "Create, modify, and extract from archives."
msgstr "Erstelle, ändere, extrahiere von Archiven"
+#. Strings for arguments in help texts.
#: src/ar.c:102
msgid "[MEMBER] [COUNT] ARCHIVE [FILE...]"
msgstr "[MEMBER] [COUNT] ARCHIVE [FILE...]"
@@ -979,121 +1018,146 @@
msgid "command option required"
msgstr ""
-#: src/ar.c:310
+#: src/ar.c:296
#, c-format
msgid "More than one operation specified"
msgstr "Mehr als eine Operation angegeben"
-#: src/ar.c:404
+#: src/ar.c:390
#, c-format
msgid "cannot open archive '%s'"
msgstr "Konnte Archiv '%s' nicht öffnen"
-#: src/ar.c:414
+#: src/ar.c:400
#, c-format
msgid "cannot open archive '%s': %s"
msgstr "Konnte Archiv '%s': %s nicht öffnen"
-#: src/ar.c:418
+#: src/ar.c:404
#, c-format
msgid "%s: not an archive file"
msgstr "%s: Keine Archiv-Datei"
-#: src/ar.c:422
+#: src/ar.c:408
#, c-format
msgid "cannot stat archive '%s'"
msgstr ""
-#: src/ar.c:434
+#: src/ar.c:420
#, c-format
msgid "no entry %s in archive\n"
msgstr "Kein Eintrag %s in Archiv\n"
-#: src/ar.c:487 src/ar.c:929 src/ar.c:1129
+#: src/ar.c:473 src/ar.c:918 src/ar.c:1122
#, c-format
msgid "cannot create hash table"
msgstr "Konnte Hash-Tabelle nicht erstellen"
-#: src/ar.c:494 src/ar.c:936 src/ar.c:1138
+#: src/ar.c:480 src/ar.c:925 src/ar.c:1131
#, c-format
msgid "cannot insert into hash table"
msgstr "Konnte nicht in Hash-Tabelle einfügen"
-#: src/ar.c:502 src/ranlib.c:164
+#: src/ar.c:488 src/ranlib.c:149
#, c-format
msgid "cannot stat '%s'"
msgstr ""
-#: src/ar.c:598
+#: src/ar.c:584
#, c-format
msgid "cannot read content of %s: %s"
msgstr "Konnte Inhalt von %s: %s nicht lesen"
-#: src/ar.c:641
+#: src/ar.c:627
#, c-format
msgid "cannot open %.*s"
msgstr "Konnte %.*s nicht öffnen"
-#: src/ar.c:663
+#: src/ar.c:649
#, c-format
msgid "failed to write %s"
msgstr "Konnte %s nicht schreiben"
-#: src/ar.c:675
+#: src/ar.c:661
#, c-format
msgid "cannot change mode of %s"
msgstr ""
-#: src/ar.c:691
+#: src/ar.c:677
#, c-format
msgid "cannot change modification time of %s"
msgstr "Konnte Bearbeitungszeit von %s nicht ändern"
-#: src/ar.c:737
+#: src/ar.c:723
#, c-format
msgid "cannot rename temporary file to %.*s"
msgstr "Konnte temporäre Datei nicht in %.*s umbenennen"
-#: src/ar.c:773 src/ar.c:1021 src/ar.c:1420 src/ranlib.c:238
+#: src/ar.c:759 src/ar.c:1010 src/ar.c:1411 src/ranlib.c:223
#, c-format
msgid "cannot create new file"
msgstr "neue Datei konnte nicht angelegt werden"
-#: src/ar.c:1220
+#: src/ar.c:1213
#, c-format
msgid "position member %s not found"
msgstr ""
-#: src/ar.c:1230
+#: src/ar.c:1223
#, c-format
msgid "%s: no entry %s in archive!\n"
msgstr "%s: Kein Eintrag %s in dem Archiv!\n"
-#: src/ar.c:1259 src/ldgeneric.c:509 src/objdump.c:253
+#: src/ar.c:1252 src/objdump.c:242
#, c-format
msgid "cannot open %s"
msgstr "Konnte %s nicht öffnen"
-#: src/ar.c:1264
+#: src/ar.c:1257
#, c-format
msgid "cannot stat %s"
msgstr ""
-#: src/ar.c:1270
+#: src/ar.c:1263
#, c-format
msgid "%s is no regular file"
msgstr "%s ist keine reguläre Datei"
-#: src/ar.c:1283
+#: src/ar.c:1276
#, c-format
msgid "cannot get ELF descriptor for %s: %s\n"
msgstr ""
-#: src/ar.c:1303
+#: src/ar.c:1296
#, c-format
msgid "cannot read %s: %s"
msgstr "Konnte %s: %s nicht lesen"
+#: src/ar.c:1471
+#, fuzzy, c-format
+msgid "cannot represent ar_date"
+msgstr "konnte Abschnittsdaten nicht kopieren: %s"
+
+#: src/ar.c:1477
+#, fuzzy, c-format
+msgid "cannot represent ar_uid"
+msgstr "konnte Abschnittsdaten nicht kopieren: %s"
+
+#: src/ar.c:1483
+#, fuzzy, c-format
+msgid "cannot represent ar_gid"
+msgstr "konnte Abschnittsdaten nicht kopieren: %s"
+
+#: src/ar.c:1489
+#, fuzzy, c-format
+msgid "cannot represent ar_mode"
+msgstr "konnte Abschnittsdaten nicht holen: %s"
+
+#: src/ar.c:1495
+#, fuzzy, c-format
+msgid "cannot represent ar_size"
+msgstr "Konnte %s nicht öffnen"
+
#: src/arlib-argp.c:32
msgid "Use zero for uid, gid, and date in archive members."
msgstr ""
@@ -1107,121 +1171,124 @@
msgid "%s (default)"
msgstr ""
-#: src/arlib.c:209
+#. The archive is too big.
+#: src/arlib.c:213
#, c-format
msgid "the archive '%s' is too large"
msgstr "Das Archiv '%s' ist zu groß"
-#: src/arlib.c:222
+#: src/arlib.c:226
#, c-format
msgid "cannot read ELF header of %s(%s): %s"
msgstr "\"Konnte ELF-Kopf von %s(%s): %s nicht lesen"
-#: src/elfcmp.c:62
+#: src/elfcmp.c:61
msgid "Control options:"
msgstr ""
-#: src/elfcmp.c:64
+#: src/elfcmp.c:63
msgid "Output all differences, not just the first"
msgstr ""
-#: src/elfcmp.c:65
+#: src/elfcmp.c:64
msgid ""
"Control treatment of gaps in loadable segments [ignore|match] (default: "
"ignore)"
msgstr ""
-#: src/elfcmp.c:67
+#: src/elfcmp.c:66
msgid "Ignore permutation of buckets in SHT_HASH section"
msgstr ""
-#: src/elfcmp.c:69
+#: src/elfcmp.c:68
msgid "Ignore differences in build ID"
msgstr ""
-#: src/elfcmp.c:70
+#: src/elfcmp.c:69
msgid "Output nothing; yield exit status only"
msgstr ""
-#: src/elfcmp.c:77
+#. Short description of program.
+#: src/elfcmp.c:76
msgid "Compare relevant parts of two ELF files for equality."
msgstr ""
-#: src/elfcmp.c:81
+#. Strings for arguments in help texts.
+#: src/elfcmp.c:80
#, fuzzy
msgid "FILE1 FILE2"
msgstr "DATEI1 DATEI2"
-#: src/elfcmp.c:143
+#: src/elfcmp.c:142
msgid "Invalid number of parameters.\n"
msgstr "Ungültige Anzahl von Parametern.\n"
-#: src/elfcmp.c:174 src/elfcmp.c:179
+#: src/elfcmp.c:173 src/elfcmp.c:178
#, c-format
msgid "cannot get ELF header of '%s': %s"
msgstr ""
-#: src/elfcmp.c:205
+#: src/elfcmp.c:204
#, c-format
msgid "%s %s diff: ELF header"
msgstr ""
-#: src/elfcmp.c:212 src/elfcmp.c:215
+#: src/elfcmp.c:211 src/elfcmp.c:214
#, fuzzy, c-format
msgid "cannot get section count of '%s': %s"
msgstr "konnte Abschnittsdaten nicht holen: %s"
-#: src/elfcmp.c:220
+#: src/elfcmp.c:219
#, c-format
msgid "%s %s diff: section count"
msgstr ""
-#: src/elfcmp.c:227 src/elfcmp.c:230
+#: src/elfcmp.c:226 src/elfcmp.c:229
#, fuzzy, c-format
msgid "cannot get program header count of '%s': %s"
msgstr "konnte Programm-Kopf nicht erstellen: %s"
-#: src/elfcmp.c:235
+#: src/elfcmp.c:234
#, fuzzy, c-format
msgid "%s %s diff: program header count"
msgstr "Datei hat keinen Programm-Kopf"
-#: src/elfcmp.c:293
+#: src/elfcmp.c:292
#, c-format
msgid "%s %s differ: section [%zu], [%zu] name"
msgstr ""
-#: src/elfcmp.c:316
+#: src/elfcmp.c:315
#, c-format
msgid "%s %s differ: section [%zu] '%s' header"
msgstr ""
-#: src/elfcmp.c:324 src/elfcmp.c:330
+#: src/elfcmp.c:323 src/elfcmp.c:329
#, c-format
msgid "cannot get content of section %zu in '%s': %s"
msgstr ""
-#: src/elfcmp.c:339
+#: src/elfcmp.c:338
#, c-format
msgid "symbol table [%zu] in '%s' has zero sh_entsize"
msgstr ""
-#: src/elfcmp.c:351 src/elfcmp.c:357
+#: src/elfcmp.c:350 src/elfcmp.c:356
#, c-format
msgid "cannot get symbol in '%s': %s"
msgstr ""
-#: src/elfcmp.c:379
+#: src/elfcmp.c:378
#, c-format
msgid "%s %s differ: symbol table [%zu]"
msgstr ""
-#: src/elfcmp.c:382
+#: src/elfcmp.c:381
#, c-format
msgid "%s %s differ: symbol table [%zu,%zu]"
msgstr ""
-#: src/elfcmp.c:428 src/elfcmp.c:497
+#: src/elfcmp.c:428 src/elfcmp.c:498
#, c-format
msgid "%s %s differ: section [%zu] '%s' number of notes"
msgstr ""
@@ -1231,104 +1298,172 @@
msgid "cannot read note section [%zu] '%s' in '%s': %s"
msgstr "konnte Abschnittsdaten nicht holen: %s"
-#: src/elfcmp.c:446
+#: src/elfcmp.c:447
#, c-format
msgid "%s %s differ: section [%zu] '%s' note name"
msgstr ""
-#: src/elfcmp.c:454
+#: src/elfcmp.c:455
#, c-format
msgid "%s %s differ: section [%zu] '%s' note '%s' type"
msgstr ""
-#: src/elfcmp.c:469
+#: src/elfcmp.c:470
#, c-format
msgid "%s %s differ: build ID length"
msgstr ""
-#: src/elfcmp.c:477
+#: src/elfcmp.c:478
#, c-format
msgid "%s %s differ: build ID content"
msgstr ""
-#: src/elfcmp.c:486
+#: src/elfcmp.c:487
#, c-format
msgid "%s %s differ: section [%zu] '%s' note '%s' content"
msgstr ""
-#: src/elfcmp.c:527
+#: src/elfcmp.c:528
#, c-format
msgid "%s %s differ: section [%zu] '%s' content"
msgstr ""
-#: src/elfcmp.c:531
+#: src/elfcmp.c:532
#, c-format
msgid "%s %s differ: section [%zu,%zu] '%s' content"
msgstr ""
-#: src/elfcmp.c:546
+#: src/elfcmp.c:547
#, c-format
msgid "%s %s differ: unequal amount of important sections"
msgstr ""
-#: src/elfcmp.c:579 src/elfcmp.c:584
+#: src/elfcmp.c:580 src/elfcmp.c:585
#, c-format
msgid "cannot load data of '%s': %s"
msgstr ""
-#: src/elfcmp.c:603 src/elfcmp.c:609
+#: src/elfcmp.c:604 src/elfcmp.c:610
#, c-format
msgid "cannot get program header entry %d of '%s': %s"
msgstr ""
-#: src/elfcmp.c:615
+#: src/elfcmp.c:616
#, c-format
msgid "%s %s differ: program header %d"
msgstr ""
-#: src/elfcmp.c:639
+#: src/elfcmp.c:640
#, c-format
msgid "%s %s differ: gap"
msgstr ""
-#: src/elfcmp.c:704
+#: src/elfcmp.c:691
#, c-format
msgid "Invalid value '%s' for --gaps parameter."
msgstr ""
-#: src/elfcmp.c:732 src/findtextrel.c:221 src/ldgeneric.c:1757
-#: src/ldgeneric.c:4247 src/nm.c:378 src/ranlib.c:157 src/size.c:289
-#: src/strings.c:186 src/strip.c:466 src/strip.c:503 src/unstrip.c:2029
-#: src/unstrip.c:2058
+#: src/elfcmp.c:719 src/findtextrel.c:206 src/nm.c:365 src/ranlib.c:142
+#: src/size.c:273 src/strings.c:186 src/strip.c:518 src/strip.c:555
+#: src/unstrip.c:2023 src/unstrip.c:2052
#, c-format
msgid "cannot open '%s'"
msgstr "'%s' kann nicht geöffnet werden"
-#: src/elfcmp.c:736 src/findtextrel.c:228 src/ranlib.c:174
+#: src/elfcmp.c:723 src/findtextrel.c:213 src/ranlib.c:159
#, c-format
msgid "cannot create ELF descriptor for '%s': %s"
msgstr ""
-#: src/elfcmp.c:741
+#: src/elfcmp.c:728
#, c-format
msgid "cannot create EBL descriptor for '%s'"
msgstr ""
-#: src/elfcmp.c:759 src/findtextrel.c:409
+#: src/elfcmp.c:746 src/findtextrel.c:394
#, c-format
msgid "cannot get section header of section %zu: %s"
msgstr ""
-#: src/elfcmp.c:769
+#: src/elfcmp.c:756
#, c-format
msgid "cannot get content of section %zu: %s"
msgstr ""
-#: src/elfcmp.c:779 src/elfcmp.c:793
+#: src/elfcmp.c:766 src/elfcmp.c:780
#, c-format
msgid "cannot get relocation: %s"
msgstr ""
+#: src/elfcompress.c:115 src/strip.c:297 src/unstrip.c:121
+#, c-format
+msgid "-o option specified twice"
+msgstr ""
+
+#: src/elfcompress.c:122
+#, fuzzy, c-format
+msgid "-t option specified twice"
+msgstr "Option -d zweimal angegeben"
+
+#: src/elfcompress.c:131
+#, fuzzy, c-format
+msgid "unknown compression type '%s'"
+msgstr "unbekannter Typ"
+
+#. We need at least one input file.
+#: src/elfcompress.c:143 src/elfcompress.c:1305
+#, fuzzy, c-format
+msgid "No input file given"
+msgstr "Eingabedatei '%s' ignoriert"
+
+#: src/elfcompress.c:149 src/elfcompress.c:1310
+#, c-format
+msgid "Only one input file allowed together with '-o'"
+msgstr ""
+
+#: src/elfcompress.c:1267
+msgid "Place (de)compressed output into FILE"
+msgstr ""
+
+#: src/elfcompress.c:1270
+msgid ""
+"What type of compression to apply. TYPE can be 'none' (decompress), "
+"'zlib' (ELF ZLIB compression, the default, 'zlib-gabi' is an alias) or 'zlib-"
+"gnu' (.zdebug GNU style compression, 'gnu' is an alias)"
+msgstr ""
+
+#: src/elfcompress.c:1273
+msgid ""
+"SECTION name to (de)compress, SECTION is an extended wildcard pattern "
+"(defaults to '.?(z)debug*')"
+msgstr ""
+
+#: src/elfcompress.c:1276
+msgid "Print a message for each section being (de)compressed"
+msgstr ""
+
+#: src/elfcompress.c:1279
+msgid "Force compression of section even if it would become larger"
+msgstr ""
+
+#: src/elfcompress.c:1282 src/strip.c:91
+msgid "Relax a few rules to handle slightly broken ELF files"
+msgstr ""
+
+#: src/elfcompress.c:1285
+#, fuzzy
+msgid "Be silent when a section cannot be compressed"
+msgstr "konnte Abschnittsdaten nicht holen: %s"
+
+#. Strings for arguments in help texts.
+#: src/elfcompress.c:1294 src/elflint.c:78 src/readelf.c:154
+msgid "FILE..."
+msgstr "DATEI..."
+
+#: src/elfcompress.c:1295
+msgid "Compress or decompress sections in an ELF file."
+msgstr ""
+
#: src/elflint.c:64
msgid "Be extremely strict, flag level 2 features."
msgstr ""
@@ -1347,15 +1482,12 @@
"certain ways"
msgstr ""
+#. Short description of program.
#: src/elflint.c:74
msgid "Pedantic checking of ELF files compliance with gABI/psABI spec."
msgstr ""
-#: src/elflint.c:78 src/readelf.c:126
-msgid "FILE..."
-msgstr "DATEI..."
-
-#: src/elflint.c:155 src/readelf.c:298
+#: src/elflint.c:155 src/readelf.c:347
#, c-format
msgid "cannot open input file"
msgstr "Kann Eingabedatei nicht öffnen"
@@ -1374,2530 +1506,1849 @@
msgid "No errors"
msgstr "Keine Fehler"
-#: src/elflint.c:219 src/readelf.c:474
+#: src/elflint.c:220 src/readelf.c:546
msgid "Missing file name.\n"
msgstr "Dateiname fehlt.\n"
-#: src/elflint.c:298
+#: src/elflint.c:285
#, c-format
msgid " error while freeing sub-ELF descriptor: %s\n"
msgstr ""
-#: src/elflint.c:306
+#. We cannot do anything.
+#: src/elflint.c:293
#, fuzzy, c-format
msgid "Not an ELF file - it has the wrong magic bytes at the start\n"
msgstr "Keine ELF-Datei - sie hat die falschen Magic Bytes am Anfang\n"
-#: src/elflint.c:371
+#: src/elflint.c:358
#, c-format
msgid "e_ident[%d] == %d is no known class\n"
msgstr ""
-#: src/elflint.c:376
+#: src/elflint.c:363
#, c-format
msgid "e_ident[%d] == %d is no known data encoding\n"
msgstr ""
-#: src/elflint.c:380
+#: src/elflint.c:367
#, c-format
msgid "unknown ELF header version number e_ident[%d] == %d\n"
msgstr ""
-#: src/elflint.c:386
+#: src/elflint.c:375
#, c-format
msgid "unsupported OS ABI e_ident[%d] == '%s'\n"
msgstr ""
-#: src/elflint.c:392
+#: src/elflint.c:381
#, c-format
-msgid "unsupport ABI version e_ident[%d] == %d\n"
+msgid "unsupported ABI version e_ident[%d] == %d\n"
msgstr ""
-#: src/elflint.c:397
+#: src/elflint.c:386
#, c-format
msgid "e_ident[%zu] is not zero\n"
msgstr "e_ident[%zu] ist nicht null\n"
-#: src/elflint.c:402
+#: src/elflint.c:391
#, c-format
msgid "unknown object file type %d\n"
msgstr ""
-#: src/elflint.c:409
+#: src/elflint.c:398
#, c-format
msgid "unknown machine type %d\n"
msgstr ""
-#: src/elflint.c:413
+#: src/elflint.c:402
#, c-format
msgid "unknown object file version\n"
msgstr ""
-#: src/elflint.c:419
+#: src/elflint.c:408
#, c-format
msgid "invalid program header offset\n"
msgstr ""
-#: src/elflint.c:421
+#: src/elflint.c:410
#, c-format
msgid "executables and DSOs cannot have zero program header offset\n"
msgstr ""
-#: src/elflint.c:425
+#: src/elflint.c:414
#, c-format
msgid "invalid number of program header entries\n"
msgstr ""
-#: src/elflint.c:433
+#: src/elflint.c:422
#, c-format
msgid "invalid section header table offset\n"
msgstr ""
-#: src/elflint.c:436
+#: src/elflint.c:425
#, c-format
msgid "section header table must be present\n"
msgstr ""
-#: src/elflint.c:450
+#: src/elflint.c:439
#, c-format
msgid "invalid number of section header table entries\n"
msgstr ""
-#: src/elflint.c:467
+#: src/elflint.c:456
#, c-format
msgid "invalid section header index\n"
msgstr ""
-#: src/elflint.c:481
+#: src/elflint.c:474
+#, c-format
+msgid "Can only check %u headers, shnum was %u\n"
+msgstr ""
+
+#: src/elflint.c:488
#, fuzzy, c-format
msgid "invalid number of program header table entries\n"
msgstr "Ungültige Anzahl von Parametern.\n"
-#: src/elflint.c:490
+#: src/elflint.c:505
+#, c-format
+msgid "Can only check %u headers, phnum was %u\n"
+msgstr ""
+
+#: src/elflint.c:510
#, c-format
msgid "invalid machine flags: %s\n"
msgstr ""
-#: src/elflint.c:497 src/elflint.c:514
+#: src/elflint.c:517 src/elflint.c:534
#, c-format
msgid "invalid ELF header size: %hd\n"
msgstr ""
-#: src/elflint.c:500 src/elflint.c:517
+#: src/elflint.c:520 src/elflint.c:537
#, c-format
msgid "invalid program header size: %hd\n"
msgstr ""
-#: src/elflint.c:503 src/elflint.c:520
+#: src/elflint.c:523 src/elflint.c:540
#, c-format
msgid "invalid program header position or size\n"
msgstr ""
-#: src/elflint.c:506 src/elflint.c:523
+#: src/elflint.c:526 src/elflint.c:543
#, c-format
msgid "invalid section header size: %hd\n"
msgstr ""
-#: src/elflint.c:509 src/elflint.c:526
+#: src/elflint.c:529 src/elflint.c:546
#, c-format
msgid "invalid section header position or size\n"
msgstr ""
-#: src/elflint.c:571
+#: src/elflint.c:591
#, c-format
msgid ""
"section [%2d] '%s': section with SHF_GROUP flag set not part of a section "
"group\n"
msgstr ""
-#: src/elflint.c:575
+#: src/elflint.c:595
#, c-format
msgid ""
"section [%2d] '%s': section group [%2zu] '%s' does not precede group member\n"
msgstr ""
-#: src/elflint.c:591 src/elflint.c:1475 src/elflint.c:1526 src/elflint.c:1632
-#: src/elflint.c:1968 src/elflint.c:2284 src/elflint.c:2898 src/elflint.c:3061
-#: src/elflint.c:3209 src/elflint.c:3399 src/elflint.c:4366
+#: src/elflint.c:611 src/elflint.c:1495 src/elflint.c:1546 src/elflint.c:1652
+#: src/elflint.c:1988 src/elflint.c:2311 src/elflint.c:2930 src/elflint.c:3093
+#: src/elflint.c:3241 src/elflint.c:3431 src/elflint.c:4399
#, c-format
msgid "section [%2d] '%s': cannot get section data\n"
msgstr ""
-#: src/elflint.c:604 src/elflint.c:1639
+#: src/elflint.c:624 src/elflint.c:1659
#, c-format
msgid ""
"section [%2d] '%s': referenced as string table for section [%2d] '%s' but "
"type is not SHT_STRTAB\n"
msgstr ""
-#: src/elflint.c:627
+#: src/elflint.c:647
#, c-format
msgid ""
"section [%2d] '%s': symbol table cannot have more than one extended index "
"section\n"
msgstr ""
-#: src/elflint.c:639
+#: src/elflint.c:659
#, c-format
msgid "section [%2u] '%s': entry size is does not match ElfXX_Sym\n"
msgstr ""
-#: src/elflint.c:648
+#: src/elflint.c:668
#, c-format
msgid "section [%2d] '%s': cannot get symbol %d: %s\n"
msgstr ""
-#: src/elflint.c:653 src/elflint.c:656 src/elflint.c:659 src/elflint.c:662
-#: src/elflint.c:665 src/elflint.c:668
+#: src/elflint.c:673 src/elflint.c:676 src/elflint.c:679 src/elflint.c:682
+#: src/elflint.c:685 src/elflint.c:688
#, c-format
msgid "section [%2d] '%s': '%s' in zeroth entry not zero\n"
msgstr ""
-#: src/elflint.c:671
+#: src/elflint.c:691
#, c-format
msgid "section [%2d] '%s': XINDEX for zeroth entry not zero\n"
msgstr ""
-#: src/elflint.c:681
+#: src/elflint.c:701
#, c-format
msgid "section [%2d] '%s': cannot get symbol %zu: %s\n"
msgstr ""
-#: src/elflint.c:690
+#: src/elflint.c:710
#, c-format
msgid "section [%2d] '%s': symbol %zu: invalid name value\n"
msgstr ""
-#: src/elflint.c:705
+#: src/elflint.c:725
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: too large section index but no extended "
"section index section\n"
msgstr ""
-#: src/elflint.c:711
+#: src/elflint.c:731
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: XINDEX used for index which would fit in "
"st_shndx (%<PRIu32>)\n"
msgstr ""
-#: src/elflint.c:723
+#. || sym->st_shndx > SHN_HIRESERVE always false
+#: src/elflint.c:743
#, c-format
msgid "section [%2d] '%s': symbol %zu: invalid section index\n"
msgstr ""
-#: src/elflint.c:731
+#: src/elflint.c:751
#, c-format
msgid "section [%2d] '%s': symbol %zu: unknown type\n"
msgstr ""
-#: src/elflint.c:737
+#: src/elflint.c:757
#, c-format
msgid "section [%2d] '%s': symbol %zu: unknown symbol binding\n"
msgstr ""
-#: src/elflint.c:742
+#: src/elflint.c:762
#, c-format
msgid "section [%2d] '%s': symbol %zu: unique symbol not of object type\n"
msgstr ""
-#: src/elflint.c:750
+#: src/elflint.c:770
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: COMMON only allowed in relocatable files\n"
msgstr ""
-#: src/elflint.c:754
+#: src/elflint.c:774
#, c-format
msgid "section [%2d] '%s': symbol %zu: local COMMON symbols are nonsense\n"
msgstr ""
-#: src/elflint.c:758
+#: src/elflint.c:778
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: function in COMMON section is nonsense\n"
msgstr ""
-#: src/elflint.c:809
+#: src/elflint.c:829
#, c-format
msgid "section [%2d] '%s': symbol %zu: st_value out of bounds\n"
msgstr ""
-#: src/elflint.c:815 src/elflint.c:840 src/elflint.c:889
+#: src/elflint.c:835 src/elflint.c:860 src/elflint.c:909
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu does not fit completely in referenced section "
"[%2d] '%s'\n"
msgstr ""
-#: src/elflint.c:824
+#: src/elflint.c:844
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: referenced section [%2d] '%s' does not have "
"SHF_TLS flag set\n"
msgstr ""
-#: src/elflint.c:834 src/elflint.c:882
+#: src/elflint.c:854 src/elflint.c:902
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: st_value out of bounds of referenced section "
"[%2d] '%s'\n"
msgstr ""
-#: src/elflint.c:861
+#: src/elflint.c:881
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: TLS symbol but no TLS program header entry\n"
msgstr ""
-#: src/elflint.c:867
+#: src/elflint.c:887
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: TLS symbol but couldn't get TLS program "
"header entry\n"
msgstr ""
-#: src/elflint.c:875
+#: src/elflint.c:895
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: st_value short of referenced section [%2d] "
"'%s'\n"
msgstr ""
-#: src/elflint.c:902
+#: src/elflint.c:922
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: local symbol outside range described in "
"sh_info\n"
msgstr ""
-#: src/elflint.c:909
+#: src/elflint.c:929
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: non-local symbol outside range described in "
"sh_info\n"
msgstr ""
-#: src/elflint.c:916
+#: src/elflint.c:936
#, c-format
msgid "section [%2d] '%s': symbol %zu: non-local section symbol\n"
msgstr ""
-#: src/elflint.c:966
+#: src/elflint.c:986
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to bad section "
"[%2d]\n"
msgstr ""
-#: src/elflint.c:973
+#: src/elflint.c:993
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to section [%2d] "
"'%s'\n"
msgstr ""
-#: src/elflint.c:989
+#. This test is more strict than the psABIs which
+#. usually allow the symbol to be in the middle of
+#. the .got section, allowing negative offsets.
+#: src/elflint.c:1009
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol value %#<PRIx64> does not "
"match %s section address %#<PRIx64>\n"
msgstr ""
-#: src/elflint.c:996
+#: src/elflint.c:1016
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol size %<PRIu64> does not "
"match %s section size %<PRIu64>\n"
msgstr ""
-#: src/elflint.c:1004
+#: src/elflint.c:1024
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol present, but no .got "
"section\n"
msgstr ""
-#: src/elflint.c:1020
+#: src/elflint.c:1040
#, c-format
msgid ""
"section [%2d] '%s': _DYNAMIC_ symbol value %#<PRIx64> does not match dynamic "
"segment address %#<PRIx64>\n"
msgstr ""
-#: src/elflint.c:1027
+#: src/elflint.c:1047
#, c-format
msgid ""
"section [%2d] '%s': _DYNAMIC symbol size %<PRIu64> does not match dynamic "
"segment size %<PRIu64>\n"
msgstr ""
-#: src/elflint.c:1040
+#: src/elflint.c:1060
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: symbol in dynamic symbol table with non-"
"default visibility\n"
msgstr ""
-#: src/elflint.c:1044
+#: src/elflint.c:1064
#, c-format
msgid "section [%2d] '%s': symbol %zu: unknown bit set in st_other\n"
msgstr ""
-#: src/elflint.c:1082
+#: src/elflint.c:1102
#, fuzzy, c-format
msgid "section [%2d] '%s': cannot get section data.\n"
msgstr "konnte Abschnittsdaten nicht holen: %s"
-#: src/elflint.c:1098
+#: src/elflint.c:1118
#, c-format
msgid "section [%2d] '%s': DT_RELCOUNT used for this RELA section\n"
msgstr ""
-#: src/elflint.c:1109 src/elflint.c:1162
+#: src/elflint.c:1129 src/elflint.c:1182
#, c-format
msgid "section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"
msgstr ""
-#: src/elflint.c:1134 src/elflint.c:1187
+#: src/elflint.c:1154 src/elflint.c:1207
#, c-format
msgid ""
"section [%2d] '%s': relative relocations after index %d as specified by "
"DT_RELCOUNT\n"
msgstr ""
-#: src/elflint.c:1140 src/elflint.c:1193
+#: src/elflint.c:1160 src/elflint.c:1213
#, c-format
msgid ""
"section [%2d] '%s': non-relative relocation at index %zu; DT_RELCOUNT "
"specified %d relative relocations\n"
msgstr ""
-#: src/elflint.c:1152
+#: src/elflint.c:1172
#, c-format
msgid "section [%2d] '%s': DT_RELACOUNT used for this REL section\n"
msgstr ""
-#: src/elflint.c:1235
+#: src/elflint.c:1255
#, c-format
msgid "section [%2d] '%s': invalid destination section index\n"
msgstr ""
-#: src/elflint.c:1247
+#: src/elflint.c:1267
#, c-format
msgid "section [%2d] '%s': invalid destination section type\n"
msgstr ""
-#: src/elflint.c:1255
+#: src/elflint.c:1275
#, c-format
msgid "section [%2d] '%s': sh_info should be zero\n"
msgstr ""
-#: src/elflint.c:1263
+#: src/elflint.c:1283
#, fuzzy, c-format
msgid ""
"section [%2d] '%s': no relocations for merge-able string sections possible\n"
msgstr "konnte Abschnittsdaten nicht holen: %s"
-#: src/elflint.c:1271
+#: src/elflint.c:1291
#, c-format
msgid "section [%2d] '%s': section entry size does not match ElfXX_Rela\n"
msgstr ""
-#: src/elflint.c:1331
+#: src/elflint.c:1351
#, c-format
msgid "text relocation flag set but there is no read-only segment\n"
msgstr ""
-#: src/elflint.c:1358
+#: src/elflint.c:1378
#, c-format
msgid "section [%2d] '%s': relocation %zu: invalid type\n"
msgstr ""
-#: src/elflint.c:1366
+#: src/elflint.c:1386
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: relocation type invalid for the file "
"type\n"
msgstr ""
-#: src/elflint.c:1374
+#: src/elflint.c:1394
#, c-format
msgid "section [%2d] '%s': relocation %zu: invalid symbol index\n"
msgstr ""
-#: src/elflint.c:1392
+#: src/elflint.c:1412
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: only symbol '_GLOBAL_OFFSET_TABLE_' can "
"be used with %s\n"
msgstr ""
-#: src/elflint.c:1409
+#: src/elflint.c:1429
#, c-format
msgid "section [%2d] '%s': relocation %zu: offset out of bounds\n"
msgstr ""
-#: src/elflint.c:1424
+#: src/elflint.c:1444
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: copy relocation against symbol of type "
"%s\n"
msgstr ""
-#: src/elflint.c:1445
+#: src/elflint.c:1465
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: read-only section modified but text "
"relocation flag not set\n"
msgstr ""
-#: src/elflint.c:1460
+#: src/elflint.c:1480
#, c-format
msgid "section [%2d] '%s': relocations are against loaded and unloaded data\n"
msgstr ""
-#: src/elflint.c:1500 src/elflint.c:1551
+#: src/elflint.c:1520 src/elflint.c:1571
#, c-format
msgid "section [%2d] '%s': cannot get relocation %zu: %s\n"
msgstr ""
-#: src/elflint.c:1627
+#: src/elflint.c:1647
#, c-format
msgid "more than one dynamic section present\n"
msgstr ""
-#: src/elflint.c:1645
+#: src/elflint.c:1665
#, c-format
msgid ""
"section [%2d]: referenced as string table for section [%2d] '%s' but section "
"link value is invalid\n"
msgstr ""
-#: src/elflint.c:1653
+#: src/elflint.c:1673
#, c-format
msgid "section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"
msgstr ""
-#: src/elflint.c:1658 src/elflint.c:1947
+#: src/elflint.c:1678 src/elflint.c:1967
#, c-format
msgid "section [%2d] '%s': sh_info not zero\n"
msgstr ""
-#: src/elflint.c:1668
+#: src/elflint.c:1688
#, c-format
msgid "section [%2d] '%s': cannot get dynamic section entry %zu: %s\n"
msgstr ""
-#: src/elflint.c:1676
+#: src/elflint.c:1696
#, c-format
msgid "section [%2d] '%s': non-DT_NULL entries follow DT_NULL entry\n"
msgstr ""
-#: src/elflint.c:1683
+#: src/elflint.c:1703
#, c-format
msgid "section [%2d] '%s': entry %zu: unknown tag\n"
msgstr ""
-#: src/elflint.c:1694
+#: src/elflint.c:1714
#, c-format
msgid "section [%2d] '%s': entry %zu: more than one entry with tag %s\n"
msgstr ""
-#: src/elflint.c:1704
+#: src/elflint.c:1724
#, c-format
msgid "section [%2d] '%s': entry %zu: level 2 tag %s used\n"
msgstr ""
-#: src/elflint.c:1722
+#: src/elflint.c:1742
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: DT_PLTREL value must be DT_REL or DT_RELA\n"
msgstr ""
-#: src/elflint.c:1735
+#: src/elflint.c:1755
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: pointer does not match address of section "
"[%2d] '%s' referenced by sh_link\n"
msgstr ""
-#: src/elflint.c:1778
+#: src/elflint.c:1798
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: %s value must point into loaded segment\n"
msgstr ""
-#: src/elflint.c:1793
+#: src/elflint.c:1813
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: %s value must be valid offset in section "
"[%2d] '%s'\n"
msgstr ""
-#: src/elflint.c:1813 src/elflint.c:1841
+#: src/elflint.c:1833 src/elflint.c:1861
#, c-format
msgid "section [%2d] '%s': contains %s entry but not %s\n"
msgstr ""
-#: src/elflint.c:1825
+#: src/elflint.c:1845
#, c-format
msgid "section [%2d] '%s': mandatory tag %s not present\n"
msgstr ""
-#: src/elflint.c:1834
+#: src/elflint.c:1854
#, c-format
msgid "section [%2d] '%s': no hash section present\n"
msgstr ""
-#: src/elflint.c:1849 src/elflint.c:1856
+#: src/elflint.c:1869 src/elflint.c:1876
#, c-format
msgid "section [%2d] '%s': not all of %s, %s, and %s are present\n"
msgstr ""
-#: src/elflint.c:1866 src/elflint.c:1870
+#: src/elflint.c:1886 src/elflint.c:1890
#, c-format
msgid "section [%2d] '%s': %s tag missing in DSO marked during prelinking\n"
msgstr ""
-#: src/elflint.c:1876
+#: src/elflint.c:1896
#, c-format
msgid "section [%2d] '%s': non-DSO file marked as dependency during prelink\n"
msgstr ""
-#: src/elflint.c:1887 src/elflint.c:1891 src/elflint.c:1895 src/elflint.c:1899
+#: src/elflint.c:1907 src/elflint.c:1911 src/elflint.c:1915 src/elflint.c:1919
#, c-format
msgid "section [%2d] '%s': %s tag missing in prelinked executable\n"
msgstr ""
-#: src/elflint.c:1911
+#: src/elflint.c:1931
#, c-format
msgid ""
"section [%2d] '%s': only relocatable files can have extended section index\n"
msgstr ""
-#: src/elflint.c:1921
+#: src/elflint.c:1941
#, c-format
msgid ""
"section [%2d] '%s': extended section index section not for symbol table\n"
msgstr ""
-#: src/elflint.c:1925
+#: src/elflint.c:1945
#, c-format
msgid "section [%2d] '%s': sh_link extended section index [%2d] is invalid\n"
msgstr ""
-#: src/elflint.c:1930
+#: src/elflint.c:1950
#, c-format
msgid "cannot get data for symbol section\n"
msgstr ""
-#: src/elflint.c:1933
+#: src/elflint.c:1953
#, c-format
msgid "section [%2d] '%s': entry size does not match Elf32_Word\n"
msgstr ""
-#: src/elflint.c:1942
+#: src/elflint.c:1962
#, c-format
msgid "section [%2d] '%s': extended index table too small for symbol table\n"
msgstr ""
-#: src/elflint.c:1957
+#: src/elflint.c:1977
#, c-format
msgid ""
"section [%2d] '%s': extended section index in section [%2zu] '%s' refers to "
"same symbol table\n"
msgstr ""
-#: src/elflint.c:1974
+#: src/elflint.c:1995
#, c-format
msgid "symbol 0 should have zero extended section index\n"
msgstr ""
-#: src/elflint.c:1986
+#: src/elflint.c:2007
#, c-format
msgid "cannot get data for symbol %zu\n"
msgstr ""
-#: src/elflint.c:1991
+#: src/elflint.c:2012
#, c-format
msgid "extended section index is %<PRIu32> but symbol index is not XINDEX\n"
msgstr ""
-#: src/elflint.c:2007 src/elflint.c:2058
+#: src/elflint.c:2029 src/elflint.c:2083
#, c-format
msgid ""
"section [%2d] '%s': hash table section is too small (is %ld, expected %ld)\n"
msgstr ""
-#: src/elflint.c:2019 src/elflint.c:2070
+#: src/elflint.c:2043 src/elflint.c:2097
#, c-format
msgid "section [%2d] '%s': chain array too large\n"
msgstr ""
-#: src/elflint.c:2033 src/elflint.c:2084
+#: src/elflint.c:2057 src/elflint.c:2111
#, c-format
msgid "section [%2d] '%s': hash bucket reference %zu out of bounds\n"
msgstr ""
-#: src/elflint.c:2043
+#: src/elflint.c:2067
#, c-format
msgid "section [%2d] '%s': hash chain reference %zu out of bounds\n"
msgstr ""
-#: src/elflint.c:2094
+#: src/elflint.c:2121
#, c-format
msgid "section [%2d] '%s': hash chain reference %<PRIu64> out of bounds\n"
msgstr ""
-#: src/elflint.c:2107
+#: src/elflint.c:2134
#, c-format
msgid "section [%2d] '%s': not enough data\n"
msgstr ""
-#: src/elflint.c:2119
+#: src/elflint.c:2146
#, c-format
msgid "section [%2d] '%s': bitmask size zero or not power of 2: %u\n"
msgstr ""
-#: src/elflint.c:2135
+#: src/elflint.c:2162
#, c-format
msgid ""
"section [%2d] '%s': hash table section is too small (is %ld, expected at "
"least %ld)\n"
msgstr ""
-#: src/elflint.c:2144
+#: src/elflint.c:2171
#, c-format
msgid "section [%2d] '%s': 2nd hash function shift too big: %u\n"
msgstr ""
-#: src/elflint.c:2178
+#: src/elflint.c:2205
#, c-format
msgid ""
"section [%2d] '%s': hash chain for bucket %zu lower than symbol index bias\n"
msgstr ""
-#: src/elflint.c:2199
+#: src/elflint.c:2226
#, c-format
msgid ""
"section [%2d] '%s': symbol %u referenced in chain for bucket %zu is "
"undefined\n"
msgstr ""
-#: src/elflint.c:2212
+#: src/elflint.c:2239
#, c-format
msgid ""
"section [%2d] '%s': hash value for symbol %u in chain for bucket %zu wrong\n"
msgstr ""
-#: src/elflint.c:2221
+#: src/elflint.c:2248
#, c-format
msgid ""
"section [%2d] '%s': mask index for symbol %u in chain for bucket %zu wrong\n"
msgstr ""
-#: src/elflint.c:2251
+#: src/elflint.c:2278
#, c-format
msgid "section [%2d] '%s': hash chain for bucket %zu out of bounds\n"
msgstr ""
-#: src/elflint.c:2256
+#: src/elflint.c:2283
#, c-format
msgid ""
"section [%2d] '%s': symbol reference in chain for bucket %zu out of bounds\n"
msgstr ""
-#: src/elflint.c:2262
+#: src/elflint.c:2289
#, c-format
msgid "section [%2d] '%s': bitmask does not match names in the hash table\n"
msgstr ""
-#: src/elflint.c:2275
+#: src/elflint.c:2302
#, c-format
msgid "section [%2d] '%s': relocatable files cannot have hash tables\n"
msgstr ""
-#: src/elflint.c:2293
+#: src/elflint.c:2320
#, c-format
msgid "section [%2d] '%s': hash table not for dynamic symbol table\n"
msgstr ""
-#: src/elflint.c:2297
+#: src/elflint.c:2324
#, c-format
msgid "section [%2d] '%s': invalid sh_link symbol table section index [%2d]\n"
msgstr ""
-#: src/elflint.c:2305
+#: src/elflint.c:2334
#, c-format
msgid "section [%2d] '%s': hash table entry size incorrect\n"
msgstr ""
-#: src/elflint.c:2310
+#: src/elflint.c:2339
#, c-format
msgid "section [%2d] '%s': not marked to be allocated\n"
msgstr ""
-#: src/elflint.c:2315
+#: src/elflint.c:2344
#, c-format
msgid ""
"section [%2d] '%s': hash table has not even room for initial administrative "
"entries\n"
msgstr ""
-#: src/elflint.c:2364
+#: src/elflint.c:2393
#, c-format
msgid "sh_link in hash sections [%2zu] '%s' and [%2zu] '%s' not identical\n"
msgstr ""
-#: src/elflint.c:2388 src/elflint.c:2453 src/elflint.c:2488
+#: src/elflint.c:2417 src/elflint.c:2482 src/elflint.c:2517
#, c-format
msgid "hash section [%2zu] '%s' does not contain enough data\n"
msgstr ""
-#: src/elflint.c:2409
+#: src/elflint.c:2438
#, c-format
msgid "hash section [%2zu] '%s' has zero bit mask words\n"
msgstr ""
-#: src/elflint.c:2420 src/elflint.c:2464 src/elflint.c:2501
+#: src/elflint.c:2449 src/elflint.c:2493 src/elflint.c:2530
#, c-format
msgid "hash section [%2zu] '%s' uses too much data\n"
msgstr ""
-#: src/elflint.c:2435
+#: src/elflint.c:2464
#, c-format
msgid ""
"hash section [%2zu] '%s' invalid symbol index %<PRIu32> (max_nsyms: "
"%<PRIu32>, nentries: %<PRIu32>\n"
msgstr ""
-#: src/elflint.c:2522
+#: src/elflint.c:2551
#, c-format
msgid "hash section [%2zu] '%s' invalid sh_entsize\n"
msgstr ""
-#: src/elflint.c:2532 src/elflint.c:2536
+#: src/elflint.c:2561 src/elflint.c:2565
#, c-format
msgid "section [%2zu] '%s': reference to symbol index 0\n"
msgstr ""
-#: src/elflint.c:2543
+#: src/elflint.c:2572
#, c-format
msgid ""
"symbol %d referenced in new hash table in [%2zu] '%s' but not in old hash "
"table in [%2zu] '%s'\n"
msgstr ""
-#: src/elflint.c:2555
+#: src/elflint.c:2584
#, c-format
msgid ""
"symbol %d referenced in old hash table in [%2zu] '%s' but not in new hash "
"table in [%2zu] '%s'\n"
msgstr ""
-#: src/elflint.c:2571
+#: src/elflint.c:2600
#, c-format
msgid "section [%2d] '%s': nonzero sh_%s for NULL section\n"
msgstr ""
-#: src/elflint.c:2591
+#: src/elflint.c:2620
#, c-format
msgid ""
"section [%2d] '%s': section groups only allowed in relocatable object files\n"
msgstr ""
-#: src/elflint.c:2602
+#: src/elflint.c:2631
#, c-format
msgid "section [%2d] '%s': cannot get symbol table: %s\n"
msgstr ""
-#: src/elflint.c:2607
+#: src/elflint.c:2636
#, c-format
msgid "section [%2d] '%s': section reference in sh_link is no symbol table\n"
msgstr ""
-#: src/elflint.c:2613
+#: src/elflint.c:2642
#, c-format
msgid "section [%2d] '%s': invalid symbol index in sh_info\n"
msgstr ""
-#: src/elflint.c:2618
+#: src/elflint.c:2647
#, c-format
msgid "section [%2d] '%s': sh_flags not zero\n"
msgstr ""
-#: src/elflint.c:2625
+#: src/elflint.c:2654
#, c-format
msgid "section [%2d] '%s': cannot get symbol for signature\n"
msgstr ""
-#: src/elflint.c:2629
+#: src/elflint.c:2658
#, c-format
msgid "section [%2d] '%s': cannot get symbol name for signature\n"
msgstr ""
-#: src/elflint.c:2634
+#: src/elflint.c:2663
#, c-format
msgid "section [%2d] '%s': signature symbol cannot be empty string\n"
msgstr ""
-#: src/elflint.c:2640
+#: src/elflint.c:2669
#, c-format
msgid "section [%2d] '%s': sh_flags not set correctly\n"
msgstr ""
-#: src/elflint.c:2646
+#: src/elflint.c:2675
#, c-format
msgid "section [%2d] '%s': cannot get data: %s\n"
msgstr ""
-#: src/elflint.c:2655
+#: src/elflint.c:2684
#, c-format
msgid "section [%2d] '%s': section size not multiple of sizeof(Elf32_Word)\n"
msgstr ""
-#: src/elflint.c:2660
+#: src/elflint.c:2690
#, c-format
msgid "section [%2d] '%s': section group without flags word\n"
msgstr ""
-#: src/elflint.c:2666
+#: src/elflint.c:2698
#, c-format
msgid "section [%2d] '%s': section group without member\n"
msgstr ""
-#: src/elflint.c:2670
+#: src/elflint.c:2702
#, c-format
msgid "section [%2d] '%s': section group with only one member\n"
msgstr ""
-#: src/elflint.c:2681
+#: src/elflint.c:2713
#, c-format
msgid "section [%2d] '%s': unknown section group flags\n"
msgstr ""
-#: src/elflint.c:2693
+#: src/elflint.c:2725
#, fuzzy, c-format
msgid "section [%2d] '%s': section index %zu out of range\n"
msgstr "konnte Abschnittsdaten nicht holen: %s"
-#: src/elflint.c:2702
+#: src/elflint.c:2734
#, c-format
msgid "section [%2d] '%s': cannot get section header for element %zu: %s\n"
msgstr ""
-#: src/elflint.c:2709
+#: src/elflint.c:2741
#, c-format
msgid "section [%2d] '%s': section group contains another group [%2d] '%s'\n"
msgstr ""
-#: src/elflint.c:2715
+#: src/elflint.c:2747
#, c-format
msgid ""
"section [%2d] '%s': element %zu references section [%2d] '%s' without "
"SHF_GROUP flag set\n"
msgstr ""
-#: src/elflint.c:2722
+#: src/elflint.c:2754
#, c-format
msgid "section [%2d] '%s' is contained in more than one section group\n"
msgstr ""
-#: src/elflint.c:2912
+#: src/elflint.c:2944
#, c-format
msgid ""
"section [%2d] '%s' refers in sh_link to section [%2d] '%s' which is no "
"dynamic symbol table\n"
msgstr ""
-#: src/elflint.c:2924
+#: src/elflint.c:2956
#, c-format
msgid ""
"section [%2d] '%s' has different number of entries than symbol table [%2d] "
"'%s'\n"
msgstr ""
-#: src/elflint.c:2940
+#: src/elflint.c:2972
#, c-format
msgid "section [%2d] '%s': symbol %d: cannot read version data\n"
msgstr ""
-#: src/elflint.c:2956
+#: src/elflint.c:2988
#, c-format
msgid "section [%2d] '%s': symbol %d: local symbol with global scope\n"
msgstr ""
-#: src/elflint.c:2964
+#: src/elflint.c:2996
#, c-format
msgid "section [%2d] '%s': symbol %d: local symbol with version\n"
msgstr ""
-#: src/elflint.c:2978
+#: src/elflint.c:3010
#, c-format
msgid "section [%2d] '%s': symbol %d: invalid version index %d\n"
msgstr ""
-#: src/elflint.c:2983
+#: src/elflint.c:3015
#, c-format
msgid ""
"section [%2d] '%s': symbol %d: version index %d is for defined version\n"
msgstr ""
-#: src/elflint.c:2993
+#: src/elflint.c:3025
#, c-format
msgid ""
"section [%2d] '%s': symbol %d: version index %d is for requested version\n"
msgstr ""
-#: src/elflint.c:3046
+#: src/elflint.c:3078
#, c-format
msgid "more than one version reference section present\n"
msgstr ""
-#: src/elflint.c:3054 src/elflint.c:3201
+#: src/elflint.c:3086 src/elflint.c:3233
#, c-format
msgid "section [%2d] '%s': sh_link does not link to string table\n"
msgstr ""
-#: src/elflint.c:3079 src/elflint.c:3255
+#: src/elflint.c:3111 src/elflint.c:3287
#, c-format
msgid "section [%2d] '%s': entry %d has wrong version %d\n"
msgstr ""
-#: src/elflint.c:3086 src/elflint.c:3262
+#: src/elflint.c:3118 src/elflint.c:3294
#, c-format
msgid "section [%2d] '%s': entry %d has wrong offset of auxiliary data\n"
msgstr ""
-#: src/elflint.c:3096
+#: src/elflint.c:3128
#, c-format
msgid "section [%2d] '%s': entry %d has invalid file reference\n"
msgstr ""
-#: src/elflint.c:3104
+#: src/elflint.c:3136
#, c-format
msgid "section [%2d] '%s': entry %d references unknown dependency\n"
msgstr ""
-#: src/elflint.c:3116
+#: src/elflint.c:3148
#, c-format
msgid "section [%2d] '%s': auxiliary entry %d of entry %d has unknown flag\n"
msgstr ""
-#: src/elflint.c:3124
+#: src/elflint.c:3156
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has invalid name "
"reference\n"
msgstr ""
-#: src/elflint.c:3133
+#: src/elflint.c:3165
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has wrong hash value: "
"%#x, expected %#x\n"
msgstr ""
-#: src/elflint.c:3142
+#: src/elflint.c:3174
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has duplicate version "
"name '%s'\n"
msgstr ""
-#: src/elflint.c:3153
+#: src/elflint.c:3185
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has wrong next field\n"
msgstr ""
-#: src/elflint.c:3170 src/elflint.c:3346
+#: src/elflint.c:3202 src/elflint.c:3378
#, c-format
msgid "section [%2d] '%s': entry %d has invalid offset to next entry\n"
msgstr ""
-#: src/elflint.c:3178 src/elflint.c:3354
+#: src/elflint.c:3210 src/elflint.c:3386
#, c-format
msgid ""
"section [%2d] '%s': entry %d has zero offset to next entry, but sh_info says "
"there are more entries\n"
msgstr ""
-#: src/elflint.c:3193
+#: src/elflint.c:3225
#, c-format
msgid "more than one version definition section present\n"
msgstr ""
-#: src/elflint.c:3240
+#: src/elflint.c:3272
#, c-format
msgid "section [%2d] '%s': more than one BASE definition\n"
msgstr ""
-#: src/elflint.c:3244
+#: src/elflint.c:3276
#, c-format
msgid "section [%2d] '%s': BASE definition must have index VER_NDX_GLOBAL\n"
msgstr ""
-#: src/elflint.c:3250
+#: src/elflint.c:3282
#, c-format
msgid "section [%2d] '%s': entry %d has unknown flag\n"
msgstr ""
-#: src/elflint.c:3277
+#: src/elflint.c:3309
#, c-format
msgid "section [%2d] '%s': entry %d has invalid name reference\n"
msgstr ""
-#: src/elflint.c:3284
+#: src/elflint.c:3316
#, c-format
msgid "section [%2d] '%s': entry %d has wrong hash value: %#x, expected %#x\n"
msgstr ""
-#: src/elflint.c:3292
+#: src/elflint.c:3324
#, c-format
msgid "section [%2d] '%s': entry %d has duplicate version name '%s'\n"
msgstr ""
-#: src/elflint.c:3312
+#: src/elflint.c:3344
#, c-format
msgid ""
"section [%2d] '%s': entry %d has invalid name reference in auxiliary data\n"
msgstr ""
-#: src/elflint.c:3329
+#: src/elflint.c:3361
#, c-format
msgid "section [%2d] '%s': entry %d has wrong next field in auxiliary data\n"
msgstr ""
-#: src/elflint.c:3362
+#: src/elflint.c:3394
#, c-format
msgid "section [%2d] '%s': no BASE definition\n"
msgstr ""
-#: src/elflint.c:3378
+#: src/elflint.c:3410
#, c-format
msgid "section [%2d] '%s': unknown parent version '%s'\n"
msgstr ""
-#: src/elflint.c:3391
+#: src/elflint.c:3423
#, c-format
msgid "section [%2d] '%s': empty object attributes section\n"
msgstr ""
-#: src/elflint.c:3412
+#: src/elflint.c:3444
#, c-format
msgid "section [%2d] '%s': unrecognized attribute format\n"
msgstr ""
-#: src/elflint.c:3428
+#: src/elflint.c:3460
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: zero length field in attribute section\n"
msgstr ""
-#: src/elflint.c:3437
+#: src/elflint.c:3469
#, c-format
msgid "section [%2d] '%s': offset %zu: invalid length in attribute section\n"
msgstr ""
-#: src/elflint.c:3449
+#: src/elflint.c:3481
#, c-format
msgid "section [%2d] '%s': offset %zu: unterminated vendor name string\n"
msgstr ""
-#: src/elflint.c:3466
+#: src/elflint.c:3498
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: endless ULEB128 in attribute subsection tag\n"
msgstr ""
-#: src/elflint.c:3475
+#: src/elflint.c:3507
#, c-format
msgid "section [%2d] '%s': offset %zu: truncated attribute section\n"
msgstr ""
-#: src/elflint.c:3484
+#: src/elflint.c:3516
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: zero length field in attribute subsection\n"
msgstr ""
-#: src/elflint.c:3499
+#: src/elflint.c:3531
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: invalid length in attribute subsection\n"
msgstr ""
-#: src/elflint.c:3510
+#. Tag_File
+#: src/elflint.c:3542
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: attribute subsection has unexpected tag %u\n"
msgstr ""
-#: src/elflint.c:3528
+#: src/elflint.c:3560
#, c-format
msgid "section [%2d] '%s': offset %zu: endless ULEB128 in attribute tag\n"
msgstr ""
-#: src/elflint.c:3539
+#: src/elflint.c:3571
#, c-format
msgid "section [%2d] '%s': offset %zu: unterminated string in attribute\n"
msgstr ""
-#: src/elflint.c:3552
+#: src/elflint.c:3584
#, c-format
msgid "section [%2d] '%s': offset %zu: unrecognized attribute tag %u\n"
msgstr ""
-#: src/elflint.c:3556
+#: src/elflint.c:3588
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: unrecognized %s attribute value %<PRIu64>\n"
msgstr ""
-#: src/elflint.c:3566
+#: src/elflint.c:3598
#, c-format
msgid "section [%2d] '%s': offset %zu: vendor '%s' unknown\n"
msgstr ""
-#: src/elflint.c:3572
+#: src/elflint.c:3604
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: extra bytes after last attribute section\n"
msgstr ""
-#: src/elflint.c:3661
+#: src/elflint.c:3693
#, c-format
msgid "cannot get section header of zeroth section\n"
msgstr ""
-#: src/elflint.c:3665
+#: src/elflint.c:3697
#, c-format
msgid "zeroth section has nonzero name\n"
msgstr ""
-#: src/elflint.c:3667
+#: src/elflint.c:3699
#, c-format
msgid "zeroth section has nonzero type\n"
msgstr ""
-#: src/elflint.c:3669
+#: src/elflint.c:3701
#, c-format
msgid "zeroth section has nonzero flags\n"
msgstr ""
-#: src/elflint.c:3671
+#: src/elflint.c:3703
#, c-format
msgid "zeroth section has nonzero address\n"
msgstr ""
-#: src/elflint.c:3673
+#: src/elflint.c:3705
#, c-format
msgid "zeroth section has nonzero offset\n"
msgstr ""
-#: src/elflint.c:3675
+#: src/elflint.c:3707
#, c-format
msgid "zeroth section has nonzero align value\n"
msgstr ""
-#: src/elflint.c:3677
+#: src/elflint.c:3709
#, c-format
msgid "zeroth section has nonzero entry size value\n"
msgstr ""
-#: src/elflint.c:3680
+#: src/elflint.c:3712
#, c-format
msgid ""
"zeroth section has nonzero size value while ELF header has nonzero shnum "
"value\n"
msgstr ""
-#: src/elflint.c:3684
+#: src/elflint.c:3716
#, c-format
msgid ""
"zeroth section has nonzero link value while ELF header does not signal "
"overflow in shstrndx\n"
msgstr ""
-#: src/elflint.c:3688
+#: src/elflint.c:3720
#, c-format
msgid ""
"zeroth section has nonzero link value while ELF header does not signal "
"overflow in phnum\n"
msgstr ""
-#: src/elflint.c:3706
+#: src/elflint.c:3738
#, c-format
msgid "cannot get section header for section [%2zu] '%s': %s\n"
msgstr ""
-#: src/elflint.c:3715
+#: src/elflint.c:3747
#, c-format
msgid "section [%2zu]: invalid name\n"
msgstr ""
-#: src/elflint.c:3742
+#: src/elflint.c:3774
#, c-format
msgid "section [%2d] '%s' has wrong type: expected %s, is %s\n"
msgstr ""
-#: src/elflint.c:3760
+#: src/elflint.c:3792
#, c-format
msgid "section [%2zu] '%s' has wrong flags: expected %s, is %s\n"
msgstr ""
-#: src/elflint.c:3778
+#: src/elflint.c:3810
#, c-format
msgid ""
"section [%2zu] '%s' has wrong flags: expected %s and possibly %s, is %s\n"
msgstr ""
-#: src/elflint.c:3796
+#: src/elflint.c:3828
#, c-format
msgid "section [%2zu] '%s' present in object file\n"
msgstr ""
-#: src/elflint.c:3802 src/elflint.c:3834
+#: src/elflint.c:3834 src/elflint.c:3866
#, c-format
msgid ""
"section [%2zu] '%s' has SHF_ALLOC flag set but there is no loadable segment\n"
msgstr ""
-#: src/elflint.c:3807 src/elflint.c:3839
+#: src/elflint.c:3839 src/elflint.c:3871
#, c-format
msgid ""
"section [%2zu] '%s' has SHF_ALLOC flag not set but there are loadable "
"segments\n"
msgstr ""
-#: src/elflint.c:3815
+#: src/elflint.c:3847
#, c-format
msgid ""
"section [%2zu] '%s' is extension section index table in non-object file\n"
msgstr ""
-#: src/elflint.c:3858
+#: src/elflint.c:3890
#, c-format
msgid "section [%2zu] '%s': size not multiple of entry size\n"
msgstr ""
-#: src/elflint.c:3863
+#: src/elflint.c:3895
#, c-format
msgid "cannot get section header\n"
msgstr ""
-#: src/elflint.c:3873
+#: src/elflint.c:3905
#, c-format
msgid "section [%2zu] '%s' has unsupported type %d\n"
msgstr ""
-#: src/elflint.c:3888
+#: src/elflint.c:3920
#, c-format
msgid ""
"section [%2zu] '%s' contains invalid processor-specific flag(s) %#<PRIx64>\n"
msgstr ""
-#: src/elflint.c:3895
+#: src/elflint.c:3927
#, c-format
msgid "section [%2zu] '%s' contains unknown flag(s) %#<PRIx64>\n"
msgstr ""
-#: src/elflint.c:3903
+#: src/elflint.c:3935
#, c-format
msgid "section [%2zu] '%s': thread-local data sections address not zero\n"
msgstr ""
-#: src/elflint.c:3913
+#: src/elflint.c:3945
#, fuzzy, c-format
msgid "section [%2zu] '%s': allocated section cannot be compressed\n"
msgstr "konnte Abschnittsdaten nicht holen: %s"
-#: src/elflint.c:3918
+#: src/elflint.c:3950
#, fuzzy, c-format
msgid "section [%2zu] '%s': nobits section cannot be compressed\n"
msgstr "konnte Abschnittsdaten nicht holen: %s"
-#: src/elflint.c:3924
+#: src/elflint.c:3956
#, c-format
msgid ""
"section [%2zu] '%s': compressed section with no compression header: %s\n"
msgstr ""
-#: src/elflint.c:3930
+#: src/elflint.c:3962
#, c-format
msgid "section [%2zu] '%s': invalid section reference in link value\n"
msgstr ""
-#: src/elflint.c:3935
+#: src/elflint.c:3967
#, c-format
msgid "section [%2zu] '%s': invalid section reference in info value\n"
msgstr ""
-#: src/elflint.c:3942
+#: src/elflint.c:3974
#, c-format
msgid "section [%2zu] '%s': strings flag set without merge flag\n"
msgstr ""
-#: src/elflint.c:3947
+#: src/elflint.c:3979
#, c-format
msgid "section [%2zu] '%s': merge flag set but entry size is zero\n"
msgstr ""
-#: src/elflint.c:3965
+#: src/elflint.c:3998
#, c-format
msgid "section [%2zu] '%s' has unexpected type %d for an executable section\n"
msgstr ""
-#: src/elflint.c:3974
+#: src/elflint.c:4007
#, c-format
msgid "section [%2zu] '%s' must be of type NOBITS in debuginfo files\n"
msgstr ""
-#: src/elflint.c:3981
+#: src/elflint.c:4014
#, c-format
msgid "section [%2zu] '%s' is both executable and writable\n"
msgstr ""
-#: src/elflint.c:4012
+#: src/elflint.c:4045
#, c-format
msgid ""
"section [%2zu] '%s' not fully contained in segment of program header entry "
"%d\n"
msgstr ""
-#: src/elflint.c:4022
+#: src/elflint.c:4055
#, c-format
msgid ""
"section [%2zu] '%s' has type NOBITS but is read from the file in segment of "
"program header entry %d\n"
msgstr ""
-#: src/elflint.c:4048
+#: src/elflint.c:4081
#, c-format
msgid ""
"section [%2zu] '%s' has type NOBITS but is read from the file in segment of "
"program header entry %d and file contents is non-zero\n"
msgstr ""
-#: src/elflint.c:4059
+#: src/elflint.c:4092
#, c-format
msgid ""
"section [%2zu] '%s' has not type NOBITS but is not read from the file in "
"segment of program header entry %d\n"
msgstr ""
-#: src/elflint.c:4070
+#: src/elflint.c:4103
#, c-format
msgid "section [%2zu] '%s' is executable in nonexecutable segment %d\n"
msgstr ""
-#: src/elflint.c:4080
+#: src/elflint.c:4113
#, c-format
msgid "section [%2zu] '%s' is writable in unwritable segment %d\n"
msgstr ""
-#: src/elflint.c:4090
+#: src/elflint.c:4123
#, c-format
msgid ""
"section [%2zu] '%s': alloc flag set but section not in any loaded segment\n"
msgstr ""
-#: src/elflint.c:4096
+#: src/elflint.c:4129
#, c-format
msgid ""
"section [%2zu] '%s': ELF header says this is the section header string table "
"but type is not SHT_TYPE\n"
msgstr ""
-#: src/elflint.c:4104
+#: src/elflint.c:4137
#, c-format
msgid ""
"section [%2zu] '%s': relocatable files cannot have dynamic symbol tables\n"
msgstr ""
-#: src/elflint.c:4155
+#: src/elflint.c:4188
#, c-format
msgid "more than one version symbol table present\n"
msgstr ""
-#: src/elflint.c:4178
+#: src/elflint.c:4211
#, c-format
msgid "INTERP program header entry but no .interp section\n"
msgstr ""
-#: src/elflint.c:4189
+#: src/elflint.c:4222
#, c-format
msgid ""
"loadable segment [%u] is executable but contains no executable sections\n"
msgstr ""
-#: src/elflint.c:4195
+#: src/elflint.c:4228
#, c-format
msgid "loadable segment [%u] is writable but contains no writable sections\n"
msgstr ""
-#: src/elflint.c:4206
+#: src/elflint.c:4239
#, c-format
msgid ""
"no .gnu.versym section present but .gnu.versym_d or .gnu.versym_r section "
"exist\n"
msgstr ""
-#: src/elflint.c:4219
+#: src/elflint.c:4252
#, c-format
msgid "duplicate version index %d\n"
msgstr ""
-#: src/elflint.c:4233
+#: src/elflint.c:4266
#, c-format
msgid ".gnu.versym section present without .gnu.versym_d or .gnu.versym_r\n"
msgstr ""
-#: src/elflint.c:4282
+#: src/elflint.c:4315
#, c-format
msgid "phdr[%d]: unknown core file note type %<PRIu32> at offset %<PRIu64>\n"
msgstr ""
-#: src/elflint.c:4286
+#: src/elflint.c:4319
#, c-format
msgid ""
"section [%2d] '%s': unknown core file note type %<PRIu32> at offset %zu\n"
msgstr ""
-#: src/elflint.c:4309
+#: src/elflint.c:4342
#, c-format
msgid "phdr[%d]: unknown object file note type %<PRIu32> at offset %zu\n"
msgstr ""
-#: src/elflint.c:4313
+#: src/elflint.c:4346
#, c-format
msgid ""
"section [%2d] '%s': unknown object file note type %<PRIu32> at offset %zu\n"
msgstr ""
-#: src/elflint.c:4330
+#: src/elflint.c:4363
#, c-format
msgid "phdr[%d]: no note entries defined for the type of file\n"
msgstr ""
-#: src/elflint.c:4349
+#: src/elflint.c:4382
#, c-format
msgid "phdr[%d]: cannot get content of note section: %s\n"
msgstr ""
-#: src/elflint.c:4352
+#: src/elflint.c:4385
#, c-format
msgid "phdr[%d]: extra %<PRIu64> bytes after last note\n"
msgstr ""
-#: src/elflint.c:4373
+#: src/elflint.c:4406
#, c-format
msgid "section [%2d] '%s': no note entries defined for the type of file\n"
msgstr ""
-#: src/elflint.c:4380
+#: src/elflint.c:4413
#, c-format
msgid "section [%2d] '%s': cannot get content of note section\n"
msgstr ""
-#: src/elflint.c:4383
+#: src/elflint.c:4416
#, c-format
msgid "section [%2d] '%s': extra %<PRIu64> bytes after last note\n"
msgstr ""
-#: src/elflint.c:4401
+#: src/elflint.c:4434
#, c-format
msgid ""
"only executables, shared objects, and core files can have program headers\n"
msgstr ""
-#: src/elflint.c:4416
+#: src/elflint.c:4449
#, c-format
msgid "cannot get program header entry %d: %s\n"
msgstr ""
-#: src/elflint.c:4425
+#: src/elflint.c:4458
#, c-format
msgid "program header entry %d: unknown program header entry type %#<PRIx64>\n"
msgstr ""
-#: src/elflint.c:4436
+#: src/elflint.c:4469
#, c-format
msgid "more than one INTERP entry in program header\n"
msgstr ""
-#: src/elflint.c:4444
+#: src/elflint.c:4477
#, c-format
msgid "more than one TLS entry in program header\n"
msgstr ""
-#: src/elflint.c:4451
+#: src/elflint.c:4484
#, c-format
msgid "static executable cannot have dynamic sections\n"
msgstr ""
-#: src/elflint.c:4465
+#: src/elflint.c:4498
#, c-format
msgid "dynamic section reference in program header has wrong offset\n"
msgstr ""
-#: src/elflint.c:4468
+#: src/elflint.c:4501
#, c-format
msgid "dynamic section size mismatch in program and section header\n"
msgstr ""
-#: src/elflint.c:4478
+#: src/elflint.c:4511
#, c-format
msgid "more than one GNU_RELRO entry in program header\n"
msgstr ""
-#: src/elflint.c:4499
+#: src/elflint.c:4532
#, c-format
msgid "loadable segment GNU_RELRO applies to is not writable\n"
msgstr ""
-#: src/elflint.c:4510
+#: src/elflint.c:4543
#, c-format
msgid "loadable segment [%u] flags do not match GNU_RELRO [%u] flags\n"
msgstr ""
-#: src/elflint.c:4517
+#: src/elflint.c:4550
#, c-format
msgid ""
"GNU_RELRO [%u] flags are not a subset of the loadable segment [%u] flags\n"
msgstr ""
-#: src/elflint.c:4526 src/elflint.c:4549
+#: src/elflint.c:4559 src/elflint.c:4582
#, c-format
msgid "%s segment not contained in a loaded segment\n"
msgstr ""
-#: src/elflint.c:4555
+#: src/elflint.c:4588
#, c-format
msgid "program header offset in ELF header and PHDR entry do not match"
msgstr ""
-#: src/elflint.c:4580
+#: src/elflint.c:4613
#, c-format
msgid "call frame search table reference in program header has wrong offset\n"
msgstr ""
-#: src/elflint.c:4583
+#: src/elflint.c:4616
#, c-format
msgid "call frame search table size mismatch in program and section header\n"
msgstr ""
-#: src/elflint.c:4596
+#: src/elflint.c:4629
#, c-format
msgid "PT_GNU_EH_FRAME present but no .eh_frame_hdr section\n"
msgstr ""
-#: src/elflint.c:4604
+#: src/elflint.c:4637
#, c-format
msgid "call frame search table must be allocated\n"
msgstr ""
-#: src/elflint.c:4607
+#: src/elflint.c:4640
#, c-format
msgid "section [%2zu] '%s' must be allocated\n"
msgstr ""
-#: src/elflint.c:4611
+#: src/elflint.c:4644
#, c-format
msgid "call frame search table must not be writable\n"
msgstr ""
-#: src/elflint.c:4614
+#: src/elflint.c:4647
#, c-format
msgid "section [%2zu] '%s' must not be writable\n"
msgstr ""
-#: src/elflint.c:4619
+#: src/elflint.c:4652
#, c-format
msgid "call frame search table must not be executable\n"
msgstr ""
-#: src/elflint.c:4622
+#: src/elflint.c:4655
#, c-format
msgid "section [%2zu] '%s' must not be executable\n"
msgstr ""
-#: src/elflint.c:4633
+#: src/elflint.c:4666
#, c-format
msgid "program header entry %d: file size greater than memory size\n"
msgstr ""
-#: src/elflint.c:4640
+#: src/elflint.c:4673
#, c-format
msgid "program header entry %d: alignment not a power of 2\n"
msgstr ""
-#: src/elflint.c:4643
+#: src/elflint.c:4676
#, c-format
msgid ""
"program header entry %d: file offset and virtual address not module of "
"alignment\n"
msgstr ""
-#: src/elflint.c:4656
+#: src/elflint.c:4689
#, c-format
msgid ""
"executable/DSO with .eh_frame_hdr section does not have a PT_GNU_EH_FRAME "
"program header entry"
msgstr ""
-#: src/elflint.c:4690
+#: src/elflint.c:4723
#, c-format
msgid "cannot read ELF header: %s\n"
msgstr ""
-#: src/elflint.c:4716
+#: src/elflint.c:4749
#, c-format
msgid "text relocation flag set but not needed\n"
msgstr ""
-#: src/findtextrel.c:62
+#: src/findtextrel.c:61
msgid "Input Selection:"
msgstr ""
-#: src/findtextrel.c:63
+#: src/findtextrel.c:62
msgid "Prepend PATH to all file names"
msgstr ""
-#: src/findtextrel.c:65
+#: src/findtextrel.c:64
msgid "Use PATH as root of debuginfo hierarchy"
msgstr ""
-#: src/findtextrel.c:72
+#. Short description of program.
+#: src/findtextrel.c:71
msgid "Locate source of text relocations in FILEs (a.out by default)."
msgstr ""
-#: src/findtextrel.c:76 src/nm.c:108 src/objdump.c:71 src/size.c:83
-#: src/strings.c:88 src/strip.c:95
+#. Strings for arguments in help texts.
+#: src/findtextrel.c:75 src/nm.c:109 src/objdump.c:72 src/size.c:81
+#: src/strings.c:88 src/strip.c:99
msgid "[FILE...]"
msgstr ""
-#: src/findtextrel.c:238
+#: src/findtextrel.c:223
#, c-format
msgid "cannot get ELF header '%s': %s"
msgstr ""
-#: src/findtextrel.c:249
+#: src/findtextrel.c:234
#, c-format
msgid "'%s' is not a DSO or PIE"
msgstr ""
-#: src/findtextrel.c:269
+#: src/findtextrel.c:254
#, c-format
msgid "getting get section header of section %zu: %s"
msgstr ""
-#: src/findtextrel.c:292
+#: src/findtextrel.c:277
#, c-format
msgid "cannot read dynamic section: %s"
msgstr ""
-#: src/findtextrel.c:313
+#: src/findtextrel.c:298
#, c-format
msgid "no text relocations reported in '%s'"
msgstr ""
-#: src/findtextrel.c:325
+#: src/findtextrel.c:310
#, c-format
msgid "while reading ELF file"
msgstr ""
-#: src/findtextrel.c:329
+#: src/findtextrel.c:314
#, fuzzy, c-format
msgid "cannot get program header count: %s"
msgstr "konnte Programm-Kopf nicht erstellen: %s"
-#: src/findtextrel.c:340 src/findtextrel.c:357
+#: src/findtextrel.c:325 src/findtextrel.c:342
#, fuzzy, c-format
msgid "cannot get program header index at offset %zd: %s"
msgstr "konnte Programm-Kopf nicht erstellen: %s"
-#: src/findtextrel.c:421
+#: src/findtextrel.c:406
#, c-format
msgid "cannot get symbol table section %zu in '%s': %s"
msgstr ""
-#: src/findtextrel.c:441 src/findtextrel.c:464
+#: src/findtextrel.c:426 src/findtextrel.c:449
#, c-format
msgid "cannot get relocation at index %d in section %zu in '%s': %s"
msgstr ""
-#: src/findtextrel.c:530
+#: src/findtextrel.c:515
#, c-format
msgid "%s not compiled with -fpic/-fPIC\n"
msgstr ""
-#: src/findtextrel.c:583
+#: src/findtextrel.c:568
#, c-format
msgid ""
"the file containing the function '%s' is not compiled with -fpic/-fPIC\n"
msgstr ""
-#: src/findtextrel.c:590 src/findtextrel.c:610
+#: src/findtextrel.c:575 src/findtextrel.c:595
#, c-format
msgid ""
"the file containing the function '%s' might not be compiled with -fpic/-"
"fPIC\n"
msgstr ""
-#: src/findtextrel.c:598
+#: src/findtextrel.c:583
#, c-format
msgid ""
"either the file containing the function '%s' or the file containing the "
"function '%s' is not compiled with -fpic/-fPIC\n"
msgstr ""
-#: src/findtextrel.c:618
+#: src/findtextrel.c:603
#, c-format
msgid ""
"a relocation modifies memory at offset %llu in a write-protected segment\n"
msgstr ""
-#: src/i386_ld.c:202
-#, c-format
-msgid "cannot allocate PLT section: %s"
-msgstr ""
-
-#: src/i386_ld.c:224
-#, c-format
-msgid "cannot allocate PLTREL section: %s"
-msgstr ""
-
-#: src/i386_ld.c:245
-#, c-format
-msgid "cannot allocate GOT section: %s"
-msgstr ""
-
-#: src/i386_ld.c:266
-#, c-format
-msgid "cannot allocate GOTPLT section: %s"
-msgstr ""
-
-#: src/i386_ld.c:653
-#, c-format
-msgid "initial-executable TLS relocation cannot be used "
-msgstr ""
-
-#: src/ld.c:78
-msgid "Input File Control:"
-msgstr ""
-
-#: src/ld.c:80
-msgid "Include whole archives in the output from now on."
-msgstr ""
-
-#: src/ld.c:82
-msgid "Stop including the whole archives in the output."
-msgstr ""
-
-#: src/ld.c:83 src/ld.c:97 src/ld.c:175
-msgid "FILE"
-msgstr "DATEI"
-
-#: src/ld.c:84
-msgid "Start a group."
-msgstr "Eine Gruppe starten."
-
-#: src/ld.c:85
-msgid "End a group."
-msgstr "Eine Gruppe beenden."
-
-#: src/ld.c:86
-msgid "PATH"
-msgstr "PFAD"
-
-#: src/ld.c:87
-msgid "Add PATH to list of directories files are searched in."
-msgstr ""
-
-#: src/ld.c:89
-msgid "Only set DT_NEEDED for following dynamic libs if actually used"
-msgstr ""
-
-#: src/ld.c:91
-msgid "Always set DT_NEEDED for following dynamic libs"
-msgstr ""
-
-#: src/ld.c:93
-msgid "Ignore LD_LIBRARY_PATH environment variable."
-msgstr ""
-
-#: src/ld.c:96
-msgid "Output File Control:"
-msgstr ""
-
-#: src/ld.c:97
-msgid "Place output in FILE."
-msgstr ""
-
-#: src/ld.c:100
-msgid "Object is marked to not use default search path at runtime."
-msgstr ""
-
-#: src/ld.c:102
-msgid "Same as --whole-archive."
-msgstr "Genau wie --whole-archive."
-
-#: src/ld.c:103
-msgid ""
-"Default rules of extracting from archive; weak references are not enough."
-msgstr ""
-
-#: src/ld.c:107
-msgid "Weak references cause extraction from archive."
-msgstr ""
-
-#: src/ld.c:109
-msgid "Allow multiple definitions; first is used."
-msgstr ""
-
-#: src/ld.c:111
-msgid "Disallow/allow undefined symbols in DSOs."
-msgstr ""
-
-#: src/ld.c:114
-msgid "Object requires immediate handling of $ORIGIN."
-msgstr ""
-
-#: src/ld.c:116
-msgid "Relocation will not be processed lazily."
-msgstr ""
-
-#: src/ld.c:118
-msgid "Object cannot be unloaded at runtime."
-msgstr ""
-
-#: src/ld.c:120
-msgid "Mark object to be initialized first."
-msgstr ""
-
-#: src/ld.c:122
-msgid "Enable/disable lazy-loading flag for following dependencies."
-msgstr ""
-
-#: src/ld.c:124
-msgid "Mark object as not loadable with 'dlopen'."
-msgstr ""
-
-#: src/ld.c:126
-msgid "Ignore/record dependencies on unused DSOs."
-msgstr ""
-
-#: src/ld.c:128
-msgid "Generated DSO will be a system library."
-msgstr ""
-
-#: src/ld.c:129
-msgid "ADDRESS"
-msgstr "ADRESSE"
-
-#: src/ld.c:129
-msgid "Set entry point address."
-msgstr ""
-
-#: src/ld.c:132
-msgid "Do not link against shared libraries."
-msgstr ""
-
-#: src/ld.c:135
-msgid "Prefer linking against shared libraries."
-msgstr ""
-
-#: src/ld.c:136
-msgid "Export all dynamic symbols."
-msgstr ""
-
-#: src/ld.c:137
-msgid "Strip all symbols."
-msgstr ""
-
-#: src/ld.c:138
-msgid "Strip debugging symbols."
-msgstr ""
-
-#: src/ld.c:140
-msgid "Assume pagesize for the target system to be SIZE."
-msgstr ""
-
-#: src/ld.c:142
-msgid "Set runtime DSO search path."
-msgstr ""
-
-#: src/ld.c:145
-msgid "Set link time DSO search path."
-msgstr ""
-
-#: src/ld.c:146
-msgid "Generate dynamic shared object."
-msgstr ""
-
-#: src/ld.c:147
-msgid "Generate relocatable object."
-msgstr ""
-
-#: src/ld.c:150
-msgid "Causes symbol not assigned to a version be reduced to local."
-msgstr ""
-
-#: src/ld.c:151
-msgid "Remove unused sections."
-msgstr ""
-
-#: src/ld.c:154
-msgid "Don't remove unused sections."
-msgstr ""
-
-#: src/ld.c:155
-msgid "Set soname of shared object."
-msgstr ""
-
-#: src/ld.c:156
-msgid "Set the dynamic linker name."
-msgstr ""
-
-#: src/ld.c:159
-msgid "Add/suppress addition indentifying link-editor to .comment section."
-msgstr ""
-
-#: src/ld.c:162
-msgid "Create .eh_frame_hdr section"
-msgstr ""
-
-#: src/ld.c:164
-msgid "Set hash style to sysv, gnu or both."
-msgstr ""
-
-#: src/ld.c:166
-msgid "Generate build ID note (md5, sha1 (default), uuid)."
-msgstr ""
-
-#: src/ld.c:168
-msgid "Linker Operation Control:"
-msgstr ""
-
-#: src/ld.c:169
-msgid "Verbose messages."
-msgstr ""
-
-#: src/ld.c:170
-msgid "Trace file opens."
-msgstr ""
-
-#: src/ld.c:172
-msgid "Trade speed for less memory usage"
-msgstr ""
-
-#: src/ld.c:173
-msgid "LEVEL"
-msgstr ""
-
-#: src/ld.c:174
-msgid "Set optimization level to LEVEL."
-msgstr ""
-
-#: src/ld.c:175
-msgid "Use linker script in FILE."
-msgstr ""
-
-#: src/ld.c:178
-msgid "Select to get parser debug information"
-msgstr ""
-
-#: src/ld.c:181
-msgid "Read version information from FILE."
-msgstr ""
-
-#: src/ld.c:182
-msgid "Set emulation to NAME."
-msgstr ""
-
-#: src/ld.c:188
-msgid "Combine object and archive files."
-msgstr ""
-
-#: src/ld.c:191
-msgid "[FILE]..."
-msgstr "[DATEI]..."
-
-#: src/ld.c:319
-#, c-format
-msgid "At least one input file needed"
-msgstr "Mindestens eine Eingabedatei benötigt"
-
-#: src/ld.c:335
-#, c-format
-msgid "error while preparing linking"
-msgstr ""
-
-#: src/ld.c:342
-#, c-format
-msgid "cannot open linker script '%s'"
-msgstr ""
-
-#: src/ld.c:383
-#, c-format
-msgid "-( without matching -)"
-msgstr "-( ohne Übereinstimmung -)"
-
-#: src/ld.c:558 src/ld.c:596
-#, c-format
-msgid "only one option of -G and -r is allowed"
-msgstr "nur eine Option aus -G und -r erlaubt"
-
-#: src/ld.c:580
-#, c-format
-msgid "more than one '-m' parameter"
-msgstr ""
-
-#: src/ld.c:590 src/ld.c:999
-#, c-format
-msgid "unknown option `-%c %s'"
-msgstr ""
-
-#: src/ld.c:632
-#, c-format
-msgid "invalid page size value '%s': ignored"
-msgstr ""
-
-#: src/ld.c:673
-#, c-format
-msgid "invalid hash style '%s'"
-msgstr ""
-
-#: src/ld.c:683
-#, c-format
-msgid "invalid build-ID style '%s'"
-msgstr ""
-
-#: src/ld.c:771
-#, c-format
-msgid "More than one output file name given."
-msgstr "Mehr als ein Name der Ausgabedatei angegeben."
-
-#: src/ld.c:788
-#, c-format
-msgid "Invalid optimization level `%s'"
-msgstr ""
-
-#: src/ld.c:836
-#, c-format
-msgid "nested -( -) groups are not allowed"
-msgstr ""
-
-#: src/ld.c:855
-#, c-format
-msgid "-) without matching -("
-msgstr "-) ohne Übereinstimmung -("
-
-#: src/ld.c:1032
-#, c-format
-msgid "unknown option '-%c %s'"
-msgstr "unbekannte Option '-%c %s'"
-
-#: src/ld.c:1138
-#, c-format
-msgid "could not find input file to determine output file format"
-msgstr ""
-
-#: src/ld.c:1140
-#, c-format
-msgid "try again with an appropriate '-m' parameter"
-msgstr ""
-
-#: src/ld.c:1434
-#, c-format
-msgid "cannot read version script '%s'"
-msgstr ""
-
-#: src/ld.c:1500 src/ld.c:1539
-#, c-format
-msgid "duplicate definition of '%s' in linker script"
-msgstr ""
-
-#: src/ldgeneric.c:201 src/ldgeneric.c:5141
-#, c-format
-msgid "cannot create string table"
-msgstr ""
-
-#: src/ldgeneric.c:247
-#, c-format
-msgid "cannot load ld backend library '%s': %s"
-msgstr ""
-
-#: src/ldgeneric.c:257
-#, c-format
-msgid "cannot find init function in ld backend library '%s': %s"
-msgstr ""
-
-#: src/ldgeneric.c:300
-#, c-format
-msgid "%s listed more than once as input"
-msgstr ""
-
-#: src/ldgeneric.c:414
-#, c-format
-msgid "%s (for -l%s)\n"
-msgstr ""
-
-#: src/ldgeneric.c:415
-#, c-format
-msgid "%s (for DT_NEEDED %s)\n"
-msgstr ""
-
-#: src/ldgeneric.c:563
-#, c-format
-msgid "Warning: type of `%s' changed from %s in %s to %s in %s"
-msgstr ""
-
-#: src/ldgeneric.c:576
-#, c-format
-msgid "Warning: size of `%s' changed from %<PRIu64> in %s to %<PRIu64> in %s"
-msgstr ""
-
-#: src/ldgeneric.c:651 src/ldgeneric.c:1112 src/readelf.c:536 src/readelf.c:852
-#: src/strip.c:589
-#, c-format
-msgid "cannot determine number of sections: %s"
-msgstr ""
-
-#: src/ldgeneric.c:667
-#, c-format
-msgid "(%s+%#<PRIx64>): multiple definition of %s `%s'\n"
-msgstr ""
-
-#: src/ldgeneric.c:690
-#, c-format
-msgid "(%s+%#<PRIx64>): first defined here\n"
-msgstr ""
-
-#: src/ldgeneric.c:809
-#, c-format
-msgid "%s: cannot get section group data: %s"
-msgstr ""
-
-#: src/ldgeneric.c:830
-#, c-format
-msgid "%s: section '%s' with group flag set does not belong to any group"
-msgstr ""
-
-#: src/ldgeneric.c:875
-#, c-format
-msgid "%s: section [%2d] '%s' is not in the correct section group"
-msgstr ""
-
-#: src/ldgeneric.c:1146 src/ldgeneric.c:1403 src/ldgeneric.c:1412
-#: src/ldgeneric.c:1471 src/ldgeneric.c:1480 src/ldgeneric.c:1743
-#: src/ldgeneric.c:1995
-#, c-format
-msgid "%s: invalid ELF file (%s:%d)\n"
-msgstr ""
-
-#: src/ldgeneric.c:1240
-#, c-format
-msgid "%s: only files of type ET_REL might contain section groups"
-msgstr ""
-
-#: src/ldgeneric.c:1292
-#, c-format
-msgid "%s: cannot determine signature of section group [%2zd] '%s': %s"
-msgstr ""
-
-#: src/ldgeneric.c:1304
-#, c-format
-msgid "%s: cannot get content of section group [%2zd] '%s': %s'"
-msgstr ""
-
-#: src/ldgeneric.c:1318
-#, c-format
-msgid ""
-"%s: group member %zu of section group [%2zd] '%s' has too high index: "
-"%<PRIu32>"
-msgstr ""
-
-#: src/ldgeneric.c:1340
-#, c-format
-msgid "%s: section '%s' has unknown type: %d"
-msgstr ""
-
-#: src/ldgeneric.c:1719
-#, c-format
-msgid "cannot get descriptor for ELF file (%s:%d): %s\n"
-msgstr ""
-
-#: src/ldgeneric.c:1889
-#, c-format
-msgid "cannot read archive `%s': %s"
-msgstr ""
-
-#: src/ldgeneric.c:2010
-#, c-format
-msgid "file of type %s cannot be linked in\n"
-msgstr ""
-
-#: src/ldgeneric.c:2022
-#, c-format
-msgid "%s: input file incompatible with ELF machine type %s\n"
-msgstr ""
-
-#: src/ldgeneric.c:2034
-#, c-format
-msgid "%s: cannot get section header string table index: %s\n"
-msgstr ""
-
-#: src/ldgeneric.c:2063
-#, c-format
-msgid "cannot use DSO '%s' when generating relocatable object file"
-msgstr ""
-
-#: src/ldgeneric.c:2148
-#, c-format
-msgid "input file '%s' ignored"
-msgstr "Eingabedatei '%s' ignoriert"
-
-#: src/ldgeneric.c:2362
-#, c-format
-msgid "undefined symbol `%s' in %s"
-msgstr "undefiniertes Symbol `%s' in %s"
-
-#: src/ldgeneric.c:2692
-#, c-format
-msgid "cannot create ELF descriptor for output file: %s"
-msgstr ""
-
-#: src/ldgeneric.c:2699
-#, c-format
-msgid "could not create ELF header for output file: %s"
-msgstr ""
-
-#: src/ldgeneric.c:3214 src/ldgeneric.c:3284 src/ldgeneric.c:3320
-#: src/ldgeneric.c:4447 src/ldgeneric.c:4496 src/ldgeneric.c:4528
-#: src/ldgeneric.c:4763 src/ldgeneric.c:4818 src/ldgeneric.c:5065
-#: src/ldgeneric.c:5121 src/ldgeneric.c:5590 src/ldgeneric.c:5602
-#, c-format
-msgid "cannot create section for output file: %s"
-msgstr ""
-
-#: src/ldgeneric.c:3434
-#, c-format
-msgid "address computation expression contains variable '%s'"
-msgstr ""
-
-#: src/ldgeneric.c:3479
-#, c-format
-msgid ""
-"argument '%<PRIuMAX>' of ALIGN in address computation expression is no power "
-"of two"
-msgstr ""
-
-#: src/ldgeneric.c:3674
-#, c-format
-msgid "cannot find entry symbol '%s': defaulting to %#0*<PRIx64>"
-msgstr ""
-
-#: src/ldgeneric.c:3680
-#, c-format
-msgid "no entry symbol specified: defaulting to %#0*<PRIx64>"
-msgstr ""
-
-#: src/ldgeneric.c:3910
-#, c-format
-msgid "cannot create GNU hash table section for output file: %s"
-msgstr ""
-
-#: src/ldgeneric.c:4061
-#, c-format
-msgid "cannot create hash table section for output file: %s"
-msgstr ""
-
-#: src/ldgeneric.c:4104
-#, c-format
-msgid "cannot create build ID section: %s"
-msgstr ""
-
-#: src/ldgeneric.c:4181
-#, c-format
-msgid "cannot convert section data to file format: %s"
-msgstr ""
-
-#: src/ldgeneric.c:4190
-#, c-format
-msgid "cannot convert section data to memory format: %s"
-msgstr ""
-
-#: src/ldgeneric.c:4251
-#, c-format
-msgid "cannot read enough data for UUID"
-msgstr ""
-
-#: src/ldgeneric.c:4348 src/ldgeneric.c:4369 src/ldgeneric.c:4398
-#: src/ldgeneric.c:6051
-#, c-format
-msgid "cannot create symbol table for output file: %s"
-msgstr ""
-
-#: src/ldgeneric.c:5290 src/ldgeneric.c:5842
-#, c-format
-msgid "section index too large in dynamic symbol table"
-msgstr ""
-
-#: src/ldgeneric.c:5735
-#, c-format
-msgid "cannot create versioning section: %s"
-msgstr "konnte Versionierungsabschnitt nicht erstellen: %s"
-
-#: src/ldgeneric.c:5808
-#, c-format
-msgid "cannot create dynamic symbol table for output file: %s"
-msgstr ""
-
-#: src/ldgeneric.c:5983
-#, c-format
-msgid "cannot create versioning data: %s"
-msgstr "konnte Versionierungsdaten nicht erstellen: %s"
-
-#: src/ldgeneric.c:6083 src/ldgeneric.c:6096 src/ldgeneric.c:6160
-#: src/ldgeneric.c:6168
-#, c-format
-msgid "cannot create section header string section: %s"
-msgstr ""
-
-#: src/ldgeneric.c:6090
-#, c-format
-msgid "cannot create section header string section"
-msgstr ""
-
-#: src/ldgeneric.c:6248
-#, c-format
-msgid "cannot create program header: %s"
-msgstr "konnte Programm-Kopf nicht erstellen: %s"
-
-#: src/ldgeneric.c:6256
-#, c-format
-msgid "while determining file layout: %s"
-msgstr ""
-
-#: src/ldgeneric.c:6377
-#, c-format
-msgid "internal error: non-nobits section follows nobits section"
-msgstr ""
-
-#: src/ldgeneric.c:6914
-#, c-format
-msgid "cannot get header of 0th section: %s"
-msgstr ""
-
-#: src/ldgeneric.c:6930 src/unstrip.c:1929
-#, c-format
-msgid "cannot update ELF header: %s"
-msgstr ""
-
-#: src/ldgeneric.c:6961
-#, c-format
-msgid "linker backend didn't specify function to relocate section"
-msgstr ""
-
-#: src/ldgeneric.c:6973
-#, c-format
-msgid "while writing output file: %s"
-msgstr ""
-
-#: src/ldgeneric.c:6978
-#, c-format
-msgid "while finishing output file: %s"
-msgstr ""
-
-#: src/ldgeneric.c:6984
-#, c-format
-msgid "cannot stat output file"
-msgstr ""
-
-#: src/ldgeneric.c:7000
-#, c-format
-msgid "WARNING: temporary output file overwritten before linking finished"
-msgstr ""
-
-#: src/ldgeneric.c:7053 src/ldgeneric.c:7064 src/ldgeneric.c:7075
-#: src/ldgeneric.c:7086 src/ldgeneric.c:7105 src/ldgeneric.c:7118
-#: src/ldgeneric.c:7130
-#, c-format
-msgid "no machine specific '%s' implementation"
-msgstr ""
-
-#: src/ldscript.y:170
-msgid "mode for segment invalid\n"
-msgstr ""
-
-#: src/ldscript.y:457
-#, c-format
-msgid "while reading version script '%s': %s at line %d"
-msgstr ""
-
-#: src/ldscript.y:458
-#, c-format
-msgid "while reading linker script '%s': %s at line %d"
-msgstr ""
-
-#: src/ldscript.y:737
-#, c-format
-msgid "symbol '%s' is declared both local and global for unnamed version '%s'"
-msgstr ""
-
-#: src/ldscript.y:739
-#, c-format
-msgid "symbol '%s' is declared both local and global for version '%s'"
-msgstr ""
-
-#: src/ldscript.y:759 src/ldscript.y:766
-#, c-format
-msgid "default visibility set as local and global"
-msgstr "Standard-Sichtbarkeit auf lokal und global gesetzt"
-
-#: src/nm.c:66 src/strip.c:67
+#: src/nm.c:67 src/strip.c:70
msgid "Output selection:"
msgstr ""
-#: src/nm.c:67
+#: src/nm.c:68
msgid "Display debugger-only symbols"
msgstr ""
-#: src/nm.c:68
+#: src/nm.c:69
msgid "Display only defined symbols"
msgstr "Zeige nur definierte Symbole"
-#: src/nm.c:71
+#: src/nm.c:72
msgid "Display dynamic symbols instead of normal symbols"
msgstr "Zeige dynamische Symbole anstelle normaler Symbole"
-#: src/nm.c:72
+#: src/nm.c:73
msgid "Display only external symbols"
msgstr "Zeige nur externe Symbole"
-#: src/nm.c:73
+#: src/nm.c:74
msgid "Display only undefined symbols"
msgstr "Zeige nur undefinierte Symbole"
-#: src/nm.c:75
+#: src/nm.c:76
msgid "Include index for symbols from archive members"
msgstr ""
-#: src/nm.c:77 src/size.c:57
+#: src/nm.c:78 src/size.c:55
msgid "Output format:"
msgstr "Ausgabeformat:"
-#: src/nm.c:79
+#: src/nm.c:80
#, fuzzy
msgid "Print name of the input file before every symbol"
msgstr "Zeige Name der Eingabedatei vor jedem Symbol"
-#: src/nm.c:82
+#: src/nm.c:83
msgid ""
"Use the output format FORMAT. FORMAT can be `bsd', `sysv' or `posix'. The "
"default is `sysv'"
@@ -3905,74 +3356,76 @@
"Benutze das Ausgabeformat FORMAT. FORMAT kann `bsd', `sysv' or `posix' sein. "
"Der Standard ist `sysv'"
-#: src/nm.c:84
+#: src/nm.c:85
msgid "Same as --format=bsd"
msgstr "Genau wie --format=bsd"
-#: src/nm.c:85
+#: src/nm.c:86
msgid "Same as --format=posix"
msgstr "Genau wie --format=posix"
-#: src/nm.c:86 src/size.c:63
+#: src/nm.c:87 src/size.c:61
msgid "Use RADIX for printing symbol values"
msgstr "Benutze RADIX zur Ausgabe von Symbolwerten"
-#: src/nm.c:87
+#: src/nm.c:88
#, fuzzy
msgid "Mark special symbols"
msgstr "Kennzeichne schwache Symbole"
-#: src/nm.c:89
+#: src/nm.c:90
#, fuzzy
msgid "Print size of defined symbols"
msgstr "Zeige Grösse der definierten Symbole"
-#: src/nm.c:91 src/size.c:71 src/strip.c:72 src/unstrip.c:72
+#: src/nm.c:92 src/size.c:69 src/strip.c:75 src/unstrip.c:73
msgid "Output options:"
msgstr "Ausgabeoptionen:"
-#: src/nm.c:92
+#: src/nm.c:93
msgid "Sort symbols numerically by address"
msgstr "Symbole anhand der Adresse numerisch sortieren"
-#: src/nm.c:94
+#: src/nm.c:95
msgid "Do not sort the symbols"
msgstr "Symbole nicht sortieren"
-#: src/nm.c:95
+#: src/nm.c:96
msgid "Reverse the sense of the sort"
msgstr "Sortierreihenfolge umkehren"
-#: src/nm.c:98
+#: src/nm.c:99
msgid "Decode low-level symbol names into source code names"
msgstr ""
-#: src/nm.c:105
+#. Short description of program.
+#: src/nm.c:106
msgid "List symbols from FILEs (a.out by default)."
msgstr ""
-#: src/nm.c:116 src/objdump.c:79
+#: src/nm.c:117 src/objdump.c:80
#, fuzzy
msgid "Output formatting"
msgstr "Ausgabeformat:"
-#: src/nm.c:140 src/objdump.c:103 src/size.c:108 src/strip.c:127
+#: src/nm.c:141 src/objdump.c:104 src/size.c:106 src/strip.c:131
#, fuzzy, c-format
msgid "%s: INTERNAL ERROR %d (%s): %s"
msgstr "%s: INTERNER FEHLER %d (%s-%s): %s"
-#: src/nm.c:395 src/nm.c:407 src/size.c:305 src/size.c:314 src/size.c:325
-#: src/strip.c:2280
+#: src/nm.c:382 src/nm.c:394 src/size.c:289 src/size.c:298 src/size.c:309
+#: src/strip.c:2421
#, c-format
msgid "while closing '%s'"
msgstr "beim Schliessen von '%s'"
-#: src/nm.c:417 src/objdump.c:292 src/strip.c:391
+#: src/nm.c:404 src/objdump.c:281 src/strip.c:443
#, c-format
msgid "%s: File format not recognized"
msgstr "%s: Dateiformat nicht erkannt"
-#: src/nm.c:457
+#. Note: 0 is no valid offset.
+#: src/nm.c:444
#, fuzzy
msgid ""
"\n"
@@ -3981,42 +3434,44 @@
"\n"
"Archiv-Index:"
-#: src/nm.c:466
+#: src/nm.c:453
#, c-format
msgid "invalid offset %zu for symbol %s"
msgstr "ungültiger Offset %zu für Symbol %s"
-#: src/nm.c:471
+#: src/nm.c:458
#, c-format
msgid "%s in %s\n"
msgstr ""
-#: src/nm.c:479
+#: src/nm.c:466
#, c-format
msgid "cannot reset archive offset to beginning"
msgstr ""
-#: src/nm.c:504 src/objdump.c:340
+#: src/nm.c:491 src/objdump.c:329
#, c-format
msgid "%s%s%s: file format not recognized"
msgstr "%s%s%s: Dateiformat nicht erkannt"
-#: src/nm.c:719
+#: src/nm.c:706
#, c-format
msgid "cannot create search tree"
msgstr "Kann Suchbaum nicht erstellen"
-#: src/nm.c:760 src/nm.c:1221 src/objdump.c:789 src/readelf.c:545
-#: src/readelf.c:1123 src/readelf.c:1323 src/readelf.c:1471 src/readelf.c:1667
-#: src/readelf.c:1873 src/readelf.c:2063 src/readelf.c:2300 src/readelf.c:2558
-#: src/readelf.c:2634 src/readelf.c:2721 src/readelf.c:3301 src/readelf.c:3347
-#: src/readelf.c:3410 src/readelf.c:8320 src/readelf.c:9420 src/readelf.c:9603
-#: src/readelf.c:9671 src/size.c:413 src/size.c:482 src/strip.c:520
+#: src/nm.c:747 src/nm.c:1208 src/objdump.c:778 src/readelf.c:606
+#: src/readelf.c:1196 src/readelf.c:1396 src/readelf.c:1544 src/readelf.c:1745
+#: src/readelf.c:1951 src/readelf.c:2141 src/readelf.c:2319 src/readelf.c:2395
+#: src/readelf.c:2653 src/readelf.c:2729 src/readelf.c:2816 src/readelf.c:3414
+#: src/readelf.c:3464 src/readelf.c:3527 src/readelf.c:11028
+#: src/readelf.c:12200 src/readelf.c:12403 src/readelf.c:12471 src/size.c:397
+#: src/size.c:466 src/strip.c:572
#, c-format
msgid "cannot get section header string table index"
msgstr ""
-#: src/nm.c:787
+#. We always print this prolog.
+#: src/nm.c:774
#, c-format
msgid ""
"\n"
@@ -4029,80 +3484,88 @@
"Symbole aus %s:\n"
"\n"
-#: src/nm.c:790
+#. The header line.
+#: src/nm.c:777
#, c-format
msgid ""
"%*s%-*s %-*s Class Type %-*s %*s Section\n"
"\n"
msgstr ""
-#: src/nm.c:1232
+#: src/nm.c:1219
#, fuzzy, c-format
msgid "%s: entry size in section %zd `%s' is not what we expect"
msgstr "%s: entry size in section `%s' is not what we expect"
-#: src/nm.c:1237
+#: src/nm.c:1224
#, fuzzy, c-format
msgid "%s: size of section %zd `%s' is not multiple of entry size"
msgstr "%s: entry size in section `%s' is not what we expect"
-#: src/nm.c:1537
+#: src/nm.c:1303
+#, fuzzy, c-format
+msgid "%s: entries (%zd) in section %zd `%s' is too large"
+msgstr "%s: entry size in section `%s' is not what we expect"
+
+#. XXX Add machine specific object file types.
+#: src/nm.c:1529
#, c-format
msgid "%s%s%s%s: Invalid operation"
msgstr "%s%s%s%s: Ungültige Operation"
-#: src/nm.c:1594
+#: src/nm.c:1586
#, c-format
msgid "%s%s%s: no symbols"
msgstr "%s%s%s: keine Symbole"
-#: src/objdump.c:52
+#: src/objdump.c:53
msgid "Mode selection:"
msgstr ""
-#: src/objdump.c:53
+#: src/objdump.c:54
msgid "Display relocation information."
msgstr ""
-#: src/objdump.c:55
+#: src/objdump.c:56
msgid "Display the full contents of all sections requested"
msgstr ""
-#: src/objdump.c:57
+#: src/objdump.c:58
msgid "Display assembler code of executable sections"
msgstr ""
-#: src/objdump.c:59
+#: src/objdump.c:60
#, fuzzy
msgid "Output content selection:"
msgstr "Eingabeauswahloptionen:"
-#: src/objdump.c:61
+#: src/objdump.c:62
msgid "Only display information for section NAME."
msgstr ""
-#: src/objdump.c:67
+#. Short description of program.
+#: src/objdump.c:68
msgid "Show information from FILEs (a.out by default)."
msgstr ""
-#: src/objdump.c:232 src/readelf.c:479
+#: src/objdump.c:219 src/readelf.c:551
msgid "No operation specified.\n"
msgstr "Keine Operation angegeben.\n"
-#: src/objdump.c:270 src/objdump.c:282
+#: src/objdump.c:259 src/objdump.c:271
#, c-format
msgid "while close `%s'"
msgstr ""
-#: src/objdump.c:375 src/readelf.c:1968 src/readelf.c:2160
+#: src/objdump.c:364 src/readelf.c:2046 src/readelf.c:2238
msgid "INVALID SYMBOL"
msgstr ""
-#: src/objdump.c:390 src/readelf.c:2002 src/readelf.c:2196
+#: src/objdump.c:379 src/readelf.c:2080 src/readelf.c:2274
msgid "INVALID SECTION"
msgstr ""
-#: src/objdump.c:510
+#: src/objdump.c:499
#, c-format
msgid ""
"\n"
@@ -4110,496 +3573,527 @@
"%-*s TYPE VALUE\n"
msgstr ""
-#: src/objdump.c:513
+#: src/objdump.c:502
msgid "OFFSET"
msgstr "OFFSET"
-#: src/objdump.c:578
+#: src/objdump.c:567
#, c-format
msgid "Contents of section %s:\n"
msgstr "Inhalt des Abschnitts %s:\n"
-#: src/objdump.c:699
+#: src/objdump.c:688
#, c-format
msgid "cannot disassemble"
msgstr "Disassemblieren nicht möglich"
-#: src/ranlib.c:65
+#. Short description of program.
+#: src/ranlib.c:64
msgid "Generate an index to speed access to archives."
msgstr "Erstelle einen Index zur Beschleunigung des Zugriffs auf Archive."
-#: src/ranlib.c:68
+#. Strings for arguments in help texts.
+#: src/ranlib.c:67
msgid "ARCHIVE"
msgstr "ARCHIV"
-#: src/ranlib.c:104
+#: src/ranlib.c:103
#, c-format
msgid "Archive name required"
msgstr "Archivname benötigt"
-#: src/ranlib.c:182
+#: src/ranlib.c:167
#, c-format
msgid "'%s' is no archive"
msgstr "'%s' ist kein Archiv"
-#: src/ranlib.c:217
+#: src/ranlib.c:202
#, c-format
msgid "error while freeing sub-ELF descriptor: %s"
msgstr ""
-#: src/readelf.c:72
+#: src/readelf.c:95
#, fuzzy
msgid "ELF input selection:"
msgstr "Eingabeauswahloptionen:"
-#: src/readelf.c:74
+#: src/readelf.c:97
msgid ""
"Use the named SECTION (default .gnu_debugdata) as (compressed) ELF input data"
msgstr ""
-#: src/readelf.c:76
+#: src/readelf.c:100
+msgid ""
+"Used with -w to find the skeleton Compile Units in FILE associated with the "
+"Split Compile units in a .dwo input file"
+msgstr ""
+
+#: src/readelf.c:102
#, fuzzy
msgid "ELF output selection:"
msgstr "Eingabeauswahloptionen:"
-#: src/readelf.c:78
+#: src/readelf.c:104
msgid "All these plus -p .strtab -p .dynstr -p .comment"
msgstr ""
-#: src/readelf.c:79
+#: src/readelf.c:105
msgid "Display the dynamic segment"
msgstr ""
-#: src/readelf.c:80
+#: src/readelf.c:106
msgid "Display the ELF file header"
msgstr ""
-#: src/readelf.c:82
+#: src/readelf.c:108
msgid "Display histogram of bucket list lengths"
msgstr ""
-#: src/readelf.c:83
+#: src/readelf.c:109
msgid "Display the program headers"
msgstr "Programm-Köpfe anzeigen"
-#: src/readelf.c:85
+#: src/readelf.c:111
msgid "Display relocations"
msgstr "Relocations anzeigen"
-#: src/readelf.c:86
+#: src/readelf.c:112
+#, fuzzy
+msgid "Display the section groups"
+msgstr "Programm-Köpfe anzeigen"
+
+#: src/readelf.c:113
#, fuzzy
msgid "Display the sections' headers"
msgstr "Programm-Köpfe anzeigen"
-#: src/readelf.c:88
-msgid "Display the symbol table"
+#: src/readelf.c:116
+#, fuzzy
+msgid "Display the symbol table sections"
msgstr "Symboltabelle anzeigen"
-#: src/readelf.c:89
+#: src/readelf.c:117
msgid "Display versioning information"
msgstr "Versionierungsinformationen anzeigen"
-#: src/readelf.c:90
+#: src/readelf.c:118
#, fuzzy
msgid "Display the ELF notes"
msgstr "Kernnotizen anzeigen"
-#: src/readelf.c:92
+#: src/readelf.c:120
#, fuzzy
msgid "Display architecture specific information, if any"
msgstr "Architekturspezifische Informationen anzeigen (falls vorhanden)"
-#: src/readelf.c:94
+#: src/readelf.c:122
msgid "Display sections for exception handling"
msgstr "Abschnitte für Ausnahmebehandlung anzeigen"
-#: src/readelf.c:96
+#: src/readelf.c:124
msgid "Additional output selection:"
msgstr ""
-#: src/readelf.c:98
+#: src/readelf.c:126
msgid ""
-"Display DWARF section content. SECTION can be one of abbrev, aranges, "
-"decodedaranges, frame, gdb_index, info, loc, line, decodedline, ranges, "
-"pubnames, str, macinfo, macro or exception"
+"Display DWARF section content. SECTION can be one of abbrev, addr, aranges, "
+"decodedaranges, frame, gdb_index, info, info+, loc, line, decodedline, "
+"ranges, pubnames, str, macinfo, macro or exception"
msgstr ""
-#: src/readelf.c:102
+#: src/readelf.c:130
msgid "Dump the uninterpreted contents of SECTION, by number or name"
msgstr ""
-#: src/readelf.c:104
+#: src/readelf.c:132
msgid "Print string contents of sections"
msgstr ""
-#: src/readelf.c:107
+#: src/readelf.c:135
msgid "Display the symbol index of an archive"
msgstr "Symbolindex des Archivs anzeigen"
-#: src/readelf.c:109
+#: src/readelf.c:137
msgid "Output control:"
msgstr "Ausgabekontrolle:"
-#: src/readelf.c:111
+#: src/readelf.c:139
msgid "Do not find symbol names for addresses in DWARF data"
msgstr "Keine symbolischen Namen für Adressen in DWARF-Daten suchen"
-#: src/readelf.c:113
+#: src/readelf.c:141
#, fuzzy
msgid ""
"Display just offsets instead of resolving values to addresses in DWARF data"
msgstr "Keine symbolischen Namen für Adressen in DWARF-Daten suchen"
-#: src/readelf.c:115
+#: src/readelf.c:143
msgid "Ignored for compatibility (lines always wide)"
msgstr ""
-#: src/readelf.c:117
+#: src/readelf.c:145
msgid ""
"Show compression information for compressed sections (when used with -S); "
"decompress section before dumping data (when used with -p or -x)"
msgstr ""
-#: src/readelf.c:122
+#. Short description of program.
+#: src/readelf.c:150
msgid "Print information from ELF file in human-readable form."
msgstr "Informationen aus der ELF-Datei in menschenlesbarer Form ausgeben."
-#: src/readelf.c:447
+#. Look up once.
+#: src/readelf.c:329
+msgid "yes"
+msgstr "ja"
+
+#: src/readelf.c:330
+msgid "no"
+msgstr "nein"
+
+#: src/readelf.c:519
#, c-format
msgid "Unknown DWARF debug section `%s'.\n"
msgstr ""
-#: src/readelf.c:529 src/readelf.c:640
+#: src/readelf.c:590 src/readelf.c:701
#, c-format
msgid "cannot generate Elf descriptor: %s"
msgstr "konnte Elf-Deskriptor nicht erzeugen: %s"
-#: src/readelf.c:554 src/readelf.c:1145 src/readelf.c:1347
+#: src/readelf.c:597 src/readelf.c:925 src/strip.c:641
+#, c-format
+msgid "cannot determine number of sections: %s"
+msgstr ""
+
+#: src/readelf.c:615 src/readelf.c:1218 src/readelf.c:1420
#, c-format
msgid "cannot get section: %s"
msgstr ""
-#: src/readelf.c:563 src/readelf.c:1152 src/readelf.c:1355 src/readelf.c:9623
-#: src/unstrip.c:387 src/unstrip.c:418 src/unstrip.c:467 src/unstrip.c:577
-#: src/unstrip.c:594 src/unstrip.c:631 src/unstrip.c:829 src/unstrip.c:1118
-#: src/unstrip.c:1309 src/unstrip.c:1369 src/unstrip.c:1490 src/unstrip.c:1543
-#: src/unstrip.c:1658 src/unstrip.c:1796 src/unstrip.c:1891
+#: src/readelf.c:624 src/readelf.c:1225 src/readelf.c:1428 src/readelf.c:12423
+#: src/unstrip.c:375 src/unstrip.c:406 src/unstrip.c:455 src/unstrip.c:565
+#: src/unstrip.c:582 src/unstrip.c:619 src/unstrip.c:817 src/unstrip.c:1109
+#: src/unstrip.c:1301 src/unstrip.c:1362 src/unstrip.c:1535 src/unstrip.c:1650
+#: src/unstrip.c:1790 src/unstrip.c:1885
#, c-format
msgid "cannot get section header: %s"
msgstr ""
-#: src/readelf.c:571
+#: src/readelf.c:632
#, fuzzy, c-format
msgid "cannot get section name"
msgstr "konnte Abschnittsdaten nicht holen: %s"
-#: src/readelf.c:580 src/readelf.c:5504 src/readelf.c:7778 src/readelf.c:7880
-#: src/readelf.c:8057
+#: src/readelf.c:641 src/readelf.c:6517 src/readelf.c:10301 src/readelf.c:10403
+#: src/readelf.c:10580
#, c-format
msgid "cannot get %s content: %s"
msgstr ""
-#: src/readelf.c:596
+#: src/readelf.c:657
#, fuzzy, c-format
msgid "cannot create temp file '%s'"
msgstr "neue Datei konnte nicht angelegt werden"
-#: src/readelf.c:605
+#: src/readelf.c:666
#, fuzzy, c-format
msgid "cannot write section data"
msgstr "konnte Abschnittsdaten nicht holen: %s"
-#: src/readelf.c:611 src/readelf.c:628 src/readelf.c:657
+#: src/readelf.c:672 src/readelf.c:689 src/readelf.c:718
#, c-format
msgid "error while closing Elf descriptor: %s"
msgstr ""
-#: src/readelf.c:618
+#: src/readelf.c:679
#, fuzzy, c-format
msgid "error while rewinding file descriptor"
msgstr "Fehler beim Schliessen des Elf-Desktriptor: %s\n"
-#: src/readelf.c:652
+#: src/readelf.c:713
#, c-format
msgid "'%s' is not an archive, cannot print archive index"
msgstr ""
-#: src/readelf.c:751
-#, fuzzy, c-format
-msgid "No such section '%s' in '%s'"
-msgstr "konnte Abschnittsdaten nicht holen: %s"
-
-#: src/readelf.c:778
+#: src/readelf.c:817
#, c-format
msgid "cannot stat input file"
msgstr ""
-#: src/readelf.c:780
+#: src/readelf.c:819
#, c-format
msgid "input file is empty"
msgstr ""
-#: src/readelf.c:782
+#: src/readelf.c:821
#, c-format
msgid "failed reading '%s': %s"
msgstr "Konnte '%s' nicht lesen: %s"
-#: src/readelf.c:837
+#: src/readelf.c:850
+#, fuzzy, c-format
+msgid "No such section '%s' in '%s'"
+msgstr "konnte Abschnittsdaten nicht holen: %s"
+
+#: src/readelf.c:910
#, c-format
msgid "cannot read ELF header: %s"
msgstr ""
-#: src/readelf.c:845
+#: src/readelf.c:918
#, c-format
msgid "cannot create EBL handle"
msgstr ""
-#: src/readelf.c:858
+#: src/readelf.c:931
#, fuzzy, c-format
msgid "cannot determine number of program headers: %s"
msgstr "konnte Programm-Kopf nicht erstellen: %s"
-#: src/readelf.c:948
+#: src/readelf.c:1021
msgid "NONE (None)"
msgstr ""
-#: src/readelf.c:949
+#: src/readelf.c:1022
msgid "REL (Relocatable file)"
msgstr ""
-#: src/readelf.c:950
+#: src/readelf.c:1023
msgid "EXEC (Executable file)"
msgstr ""
-#: src/readelf.c:951
+#: src/readelf.c:1024
msgid "DYN (Shared object file)"
msgstr ""
-#: src/readelf.c:952
+#: src/readelf.c:1025
msgid "CORE (Core file)"
msgstr ""
-#: src/readelf.c:957
+#: src/readelf.c:1030
#, c-format
msgid "OS Specific: (%x)\n"
msgstr ""
-#: src/readelf.c:959
+#. && e_type <= ET_HIPROC always true
+#: src/readelf.c:1032
#, c-format
msgid "Processor Specific: (%x)\n"
msgstr ""
-#: src/readelf.c:969
+#: src/readelf.c:1042
msgid ""
"ELF Header:\n"
" Magic: "
msgstr ""
-#: src/readelf.c:973
+#: src/readelf.c:1046
#, c-format
msgid ""
"\n"
" Class: %s\n"
msgstr ""
-#: src/readelf.c:978
+#: src/readelf.c:1051
#, fuzzy, c-format
msgid " Data: %s\n"
msgstr " Daten: %s\n"
-#: src/readelf.c:984
+#: src/readelf.c:1057
#, c-format
msgid " Ident Version: %hhd %s\n"
msgstr ""
-#: src/readelf.c:986 src/readelf.c:1003
+#: src/readelf.c:1059 src/readelf.c:1076
msgid "(current)"
msgstr "(aktuell)"
-#: src/readelf.c:990
+#: src/readelf.c:1063
#, c-format
msgid " OS/ABI: %s\n"
msgstr ""
-#: src/readelf.c:993
+#: src/readelf.c:1066
#, c-format
msgid " ABI Version: %hhd\n"
msgstr ""
-#: src/readelf.c:996
+#: src/readelf.c:1069
msgid " Type: "
msgstr " Typ: "
-#: src/readelf.c:999
+#: src/readelf.c:1072
#, c-format
msgid " Machine: %s\n"
msgstr ""
-#: src/readelf.c:1001
+#: src/readelf.c:1074
#, c-format
msgid " Version: %d %s\n"
msgstr ""
-#: src/readelf.c:1005
+#: src/readelf.c:1078
#, c-format
msgid " Entry point address: %#<PRIx64>\n"
msgstr ""
-#: src/readelf.c:1008
+#: src/readelf.c:1081
#, c-format
msgid " Start of program headers: %<PRId64> %s\n"
msgstr ""
-#: src/readelf.c:1009 src/readelf.c:1012
+#: src/readelf.c:1082 src/readelf.c:1085
msgid "(bytes into file)"
msgstr ""
-#: src/readelf.c:1011
+#: src/readelf.c:1084
#, c-format
msgid " Start of section headers: %<PRId64> %s\n"
msgstr ""
-#: src/readelf.c:1014
+#: src/readelf.c:1087
#, c-format
msgid " Flags: %s\n"
msgstr ""
-#: src/readelf.c:1017
+#: src/readelf.c:1090
#, c-format
msgid " Size of this header: %<PRId16> %s\n"
msgstr ""
-#: src/readelf.c:1018 src/readelf.c:1021 src/readelf.c:1038
+#: src/readelf.c:1091 src/readelf.c:1094 src/readelf.c:1111
msgid "(bytes)"
msgstr "(Bytes)"
-#: src/readelf.c:1020
+#: src/readelf.c:1093
#, c-format
msgid " Size of program header entries: %<PRId16> %s\n"
msgstr ""
-#: src/readelf.c:1023
+#: src/readelf.c:1096
#, c-format
msgid " Number of program headers entries: %<PRId16>"
msgstr ""
-#: src/readelf.c:1030
+#: src/readelf.c:1103
#, c-format
msgid " (%<PRIu32> in [0].sh_info)"
msgstr ""
-#: src/readelf.c:1033 src/readelf.c:1050 src/readelf.c:1064
+#: src/readelf.c:1106 src/readelf.c:1123 src/readelf.c:1137
msgid " ([0] not available)"
msgstr ""
-#: src/readelf.c:1037
+#: src/readelf.c:1110
#, c-format
msgid " Size of section header entries: %<PRId16> %s\n"
msgstr ""
-#: src/readelf.c:1040
+#: src/readelf.c:1113
#, c-format
msgid " Number of section headers entries: %<PRId16>"
msgstr ""
-#: src/readelf.c:1047
+#: src/readelf.c:1120
#, c-format
msgid " (%<PRIu32> in [0].sh_size)"
msgstr ""
-#: src/readelf.c:1060
+#. We managed to get the zeroth section.
+#: src/readelf.c:1133
#, c-format
msgid " (%<PRIu32> in [0].sh_link)"
msgstr ""
-#: src/readelf.c:1068
+#: src/readelf.c:1141
#, c-format
msgid ""
" Section header string table index: XINDEX%s\n"
"\n"
msgstr ""
-#: src/readelf.c:1072
+#: src/readelf.c:1145
#, c-format
msgid ""
" Section header string table index: %<PRId16>\n"
"\n"
msgstr ""
-#: src/readelf.c:1115
+#: src/readelf.c:1188
#, c-format
msgid ""
"There are %d section headers, starting at offset %#<PRIx64>:\n"
"\n"
msgstr ""
-#: src/readelf.c:1125
+#: src/readelf.c:1198
msgid "Section Headers:"
msgstr ""
-#: src/readelf.c:1128
+#: src/readelf.c:1201
msgid ""
"[Nr] Name Type Addr Off Size ES Flags Lk "
"Inf Al"
msgstr ""
-#: src/readelf.c:1130
+#: src/readelf.c:1203
msgid ""
"[Nr] Name Type Addr Off Size ES "
"Flags Lk Inf Al"
msgstr ""
-#: src/readelf.c:1135
+#: src/readelf.c:1208
msgid " [Compression Size Al]"
msgstr ""
-#: src/readelf.c:1137
+#: src/readelf.c:1210
msgid " [Compression Size Al]"
msgstr ""
-#: src/readelf.c:1213
+#: src/readelf.c:1286
#, c-format
msgid "bad compression header for section %zd: %s"
msgstr ""
-#: src/readelf.c:1224
+#: src/readelf.c:1297
#, c-format
msgid "bad gnu compressed size for section %zd: %s"
msgstr ""
-#: src/readelf.c:1242
+#: src/readelf.c:1315
msgid "Program Headers:"
msgstr "Programm-Köpfe:"
-#: src/readelf.c:1244
+#: src/readelf.c:1317
msgid ""
" Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align"
msgstr ""
-#: src/readelf.c:1247
+#: src/readelf.c:1320
msgid ""
" Type Offset VirtAddr PhysAddr FileSiz "
"MemSiz Flg Align"
msgstr ""
-#: src/readelf.c:1304
+#: src/readelf.c:1377
#, c-format
msgid "\t[Requesting program interpreter: %s]\n"
msgstr ""
-#: src/readelf.c:1325
+#: src/readelf.c:1398
msgid ""
"\n"
" Section to Segment mapping:\n"
" Segment Sections..."
msgstr ""
-#: src/readelf.c:1336 src/unstrip.c:1950 src/unstrip.c:1992 src/unstrip.c:1999
+#: src/readelf.c:1409 src/unstrip.c:1944 src/unstrip.c:1986 src/unstrip.c:1993
#, c-format
msgid "cannot get program header: %s"
msgstr ""
-#: src/readelf.c:1479
+#: src/readelf.c:1552
#, c-format
msgid ""
"\n"
@@ -4610,7 +4104,7 @@
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:1484
+#: src/readelf.c:1557
#, c-format
msgid ""
"\n"
@@ -4621,25 +4115,31 @@
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:1492
+#: src/readelf.c:1565
msgid "<INVALID SYMBOL>"
msgstr ""
-#: src/readelf.c:1506
+#: src/readelf.c:1579
msgid "<INVALID SECTION>"
msgstr ""
-#: src/readelf.c:1529 src/readelf.c:2238 src/readelf.c:3317
+#: src/readelf.c:1602 src/readelf.c:2329 src/readelf.c:3430 src/readelf.c:12294
+#: src/readelf.c:12301 src/readelf.c:12345 src/readelf.c:12352
msgid "Couldn't uncompress section"
msgstr ""
-#: src/readelf.c:1673 src/readelf.c:2306 src/readelf.c:2564 src/readelf.c:2640
-#: src/readelf.c:2944 src/readelf.c:3018 src/readelf.c:4716
+#: src/readelf.c:1607 src/readelf.c:2334 src/readelf.c:3435
+#, fuzzy, c-format
+msgid "cannot get section [%zd] header: %s"
+msgstr "konnte Abschnittsdaten nicht holen: %s"
+
+#: src/readelf.c:1751 src/readelf.c:2401 src/readelf.c:2659 src/readelf.c:2735
+#: src/readelf.c:3039 src/readelf.c:3113 src/readelf.c:5308
#, fuzzy, c-format
msgid "invalid sh_link value in section %zu"
msgstr "ungültige .debug_line Sektion"
-#: src/readelf.c:1676
+#: src/readelf.c:1754
#, c-format
msgid ""
"\n"
@@ -4652,43 +4152,43 @@
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:1686
+#: src/readelf.c:1764
msgid " Type Value\n"
msgstr ""
-#: src/readelf.c:1710
+#: src/readelf.c:1788
#, c-format
msgid "Shared library: [%s]\n"
msgstr ""
-#: src/readelf.c:1715
+#: src/readelf.c:1793
#, c-format
msgid "Library soname: [%s]\n"
msgstr ""
-#: src/readelf.c:1720
+#: src/readelf.c:1798
#, c-format
msgid "Library rpath: [%s]\n"
msgstr ""
-#: src/readelf.c:1725
+#: src/readelf.c:1803
#, c-format
msgid "Library runpath: [%s]\n"
msgstr ""
-#: src/readelf.c:1745
+#: src/readelf.c:1823
#, c-format
msgid "%<PRId64> (bytes)\n"
msgstr ""
-#: src/readelf.c:1858 src/readelf.c:2048
+#: src/readelf.c:1936 src/readelf.c:2126
#, c-format
msgid ""
"\n"
"Invalid symbol table at offset %#0<PRIx64>\n"
msgstr ""
-#: src/readelf.c:1876 src/readelf.c:2066
+#: src/readelf.c:1954 src/readelf.c:2144
#, c-format
msgid ""
"\n"
@@ -4701,7 +4201,13 @@
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:1891 src/readelf.c:2081
+#. The .rel.dyn section does not refer to a specific section but
+#. instead of section index zero. Do not try to print a section
+#. name.
+#. The .rela.dyn section does not refer to a specific section but
+#. instead of section index zero. Do not try to print a section
+#. name.
+#: src/readelf.c:1969 src/readelf.c:2159
#, c-format
msgid ""
"\n"
@@ -4712,29 +4218,29 @@
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:1901
+#: src/readelf.c:1979
msgid " Offset Type Value Name\n"
msgstr ""
-#: src/readelf.c:1903
+#: src/readelf.c:1981
msgid " Offset Type Value Name\n"
msgstr ""
-#: src/readelf.c:1956 src/readelf.c:1967 src/readelf.c:1980 src/readelf.c:2001
-#: src/readelf.c:2013 src/readelf.c:2147 src/readelf.c:2159 src/readelf.c:2173
-#: src/readelf.c:2195 src/readelf.c:2208
+#: src/readelf.c:2034 src/readelf.c:2045 src/readelf.c:2058 src/readelf.c:2079
+#: src/readelf.c:2091 src/readelf.c:2225 src/readelf.c:2237 src/readelf.c:2251
+#: src/readelf.c:2273 src/readelf.c:2286
msgid "<INVALID RELOC>"
msgstr ""
-#: src/readelf.c:2091
+#: src/readelf.c:2169
msgid " Offset Type Value Addend Name\n"
msgstr ""
-#: src/readelf.c:2093
+#: src/readelf.c:2171
msgid " Offset Type Value Addend Name\n"
msgstr ""
-#: src/readelf.c:2314
+#: src/readelf.c:2409
#, c-format
msgid ""
"\n"
@@ -4745,40 +4251,40 @@
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:2319
+#: src/readelf.c:2414
#, c-format
msgid " %lu local symbol String table: [%2u] '%s'\n"
msgid_plural " %lu local symbols String table: [%2u] '%s'\n"
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:2327
+#: src/readelf.c:2422
msgid " Num: Value Size Type Bind Vis Ndx Name\n"
msgstr ""
-#: src/readelf.c:2329
+#: src/readelf.c:2424
msgid " Num: Value Size Type Bind Vis Ndx Name\n"
msgstr ""
-#: src/readelf.c:2349
+#: src/readelf.c:2444
#, c-format
msgid "%5u: %0*<PRIx64> %6<PRId64> %-7s %-6s %-9s %6s %s"
msgstr ""
-#: src/readelf.c:2437
+#: src/readelf.c:2532
#, c-format
msgid "bad dynamic symbol"
msgstr ""
-#: src/readelf.c:2519
+#: src/readelf.c:2614
msgid "none"
msgstr "keine"
-#: src/readelf.c:2536
+#: src/readelf.c:2631
msgid "| <unknown>"
msgstr "| <unbekannt>"
-#: src/readelf.c:2567
+#: src/readelf.c:2662
#, c-format
msgid ""
"\n"
@@ -4791,17 +4297,17 @@
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:2588
+#: src/readelf.c:2683
#, fuzzy, c-format
msgid " %#06x: Version: %hu File: %s Cnt: %hu\n"
msgstr " %#06x: Version: %hu Datei: %s Cnt: %hu\n"
-#: src/readelf.c:2601
+#: src/readelf.c:2696
#, c-format
msgid " %#06x: Name: %s Flags: %s Version: %hu\n"
msgstr " %#06x: Name: %s Flags: %s Version: %hu\n"
-#: src/readelf.c:2644
+#: src/readelf.c:2739
#, c-format
msgid ""
"\n"
@@ -4814,17 +4320,18 @@
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:2672
+#: src/readelf.c:2767
#, c-format
msgid " %#06x: Version: %hd Flags: %s Index: %hd Cnt: %hd Name: %s\n"
msgstr ""
-#: src/readelf.c:2687
+#: src/readelf.c:2782
#, c-format
msgid " %#06x: Parent %d: %s\n"
msgstr ""
-#: src/readelf.c:2948
+#. Print the header.
+#: src/readelf.c:3043
#, c-format
msgid ""
"\n"
@@ -4837,15 +4344,15 @@
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:2976
+#: src/readelf.c:3071
msgid " 0 *local* "
msgstr " 0 *lokal* "
-#: src/readelf.c:2981
+#: src/readelf.c:3076
msgid " 1 *global* "
msgstr " 1 *global* "
-#: src/readelf.c:3023
+#: src/readelf.c:3118
#, c-format
msgid ""
"\n"
@@ -4860,56 +4367,66 @@
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:3045
+#: src/readelf.c:3140
#, no-c-format
msgid " Length Number % of total Coverage\n"
msgstr ""
-#: src/readelf.c:3047
+#: src/readelf.c:3142
#, c-format
msgid " 0 %6<PRIu32> %5.1f%%\n"
msgstr " 0 %6<PRIu32> %5.1f%%\n"
-#: src/readelf.c:3054
+#: src/readelf.c:3149
#, c-format
msgid "%7d %6<PRIu32> %5.1f%% %5.1f%%\n"
msgstr "%7d %6<PRIu32> %5.1f%% %5.1f%%\n"
-#: src/readelf.c:3067
+#: src/readelf.c:3162
#, c-format
msgid ""
" Average number of tests: successful lookup: %f\n"
"\t\t\t unsuccessful lookup: %f\n"
msgstr ""
-#: src/readelf.c:3085 src/readelf.c:3140 src/readelf.c:3197
+#: src/readelf.c:3180 src/readelf.c:3244 src/readelf.c:3310
#, c-format
msgid "cannot get data for section %d: %s"
msgstr ""
-#: src/readelf.c:3093
+#: src/readelf.c:3188
#, fuzzy, c-format
msgid "invalid data in sysv.hash section %d"
msgstr "ungültige .debug_line Sektion"
-#: src/readelf.c:3148
+#: src/readelf.c:3217
+#, fuzzy, c-format
+msgid "invalid chain in sysv.hash section %d"
+msgstr "ungültige .debug_line Sektion"
+
+#: src/readelf.c:3252
#, fuzzy, c-format
msgid "invalid data in sysv.hash64 section %d"
msgstr "ungültige .debug_line Sektion"
-#: src/readelf.c:3206
+#: src/readelf.c:3283
+#, fuzzy, c-format
+msgid "invalid chain in sysv.hash64 section %d"
+msgstr "ungültige .debug_line Sektion"
+
+#: src/readelf.c:3319
#, fuzzy, c-format
msgid "invalid data in gnu.hash section %d"
msgstr "ungültige .debug_line Sektion"
-#: src/readelf.c:3273
+#: src/readelf.c:3386
#, c-format
msgid ""
" Symbol Bias: %u\n"
" Bitmask Size: %zu bytes %<PRIuFAST32>%% bits set 2nd hash shift: %u\n"
msgstr ""
-#: src/readelf.c:3358
+#: src/readelf.c:3475
#, c-format
msgid ""
"\n"
@@ -4920,13 +4437,13 @@
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:3372
+#: src/readelf.c:3489
msgid ""
" Library Time Stamp Checksum Version "
"Flags"
msgstr ""
-#: src/readelf.c:3422
+#: src/readelf.c:3539
#, c-format
msgid ""
"\n"
@@ -4934,140 +4451,102 @@
"%#0<PRIx64>:\n"
msgstr ""
-#: src/readelf.c:3439
+#: src/readelf.c:3556
msgid " Owner Size\n"
msgstr ""
-#: src/readelf.c:3468
+#: src/readelf.c:3585
#, c-format
msgid " %-13s %4<PRIu32>\n"
msgstr " %-13s %4<PRIu32>\n"
-#: src/readelf.c:3507
+#. Unknown subsection, print and skip.
+#: src/readelf.c:3624
#, c-format
msgid " %-4u %12<PRIu32>\n"
msgstr " %-4u %12<PRIu32>\n"
-#: src/readelf.c:3512
+#. Tag_File
+#: src/readelf.c:3629
#, c-format
msgid " File: %11<PRIu32>\n"
msgstr " File: %11<PRIu32>\n"
-#: src/readelf.c:3561
+#: src/readelf.c:3678
#, c-format
msgid " %s: %<PRId64>, %s\n"
msgstr " %s: %<PRId64>, %s\n"
-#: src/readelf.c:3564
+#: src/readelf.c:3681
#, c-format
msgid " %s: %<PRId64>\n"
msgstr " %s: %<PRId64>\n"
-#: src/readelf.c:3567
+#: src/readelf.c:3684
#, c-format
msgid " %s: %s\n"
msgstr " %s: %s\n"
-#: src/readelf.c:3577
+#: src/readelf.c:3694
#, c-format
msgid " %u: %<PRId64>\n"
msgstr " %u: %<PRId64>\n"
-#: src/readelf.c:3580
+#: src/readelf.c:3697
#, c-format
msgid " %u: %s\n"
msgstr " %u: %s\n"
-#: src/readelf.c:3625
-#, c-format
-msgid "%s+%#<PRIx64> <%s+%#<PRIx64>>"
-msgstr "%s+%#<PRIx64> <%s+%#<PRIx64>>"
+#: src/readelf.c:3767
+#, fuzzy, c-format
+msgid "sprintf failure"
+msgstr "mprotect fehlgeschlagen"
-#: src/readelf.c:3628
-#, c-format
-msgid "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
-msgstr "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
-
-#: src/readelf.c:3633
-#, c-format
-msgid "%#<PRIx64> <%s+%#<PRIx64>>"
-msgstr "%#<PRIx64> <%s+%#<PRIx64>>"
-
-#: src/readelf.c:3636
-#, c-format
-msgid "%#0*<PRIx64> <%s+%#<PRIx64>>"
-msgstr "%#0*<PRIx64> <%s+%#<PRIx64>>"
-
-#: src/readelf.c:3642
-#, c-format
-msgid "%s+%#<PRIx64> <%s>"
-msgstr "%s+%#<PRIx64> <%s>"
-
-#: src/readelf.c:3645
-#, c-format
-msgid "%s+%#0*<PRIx64> <%s>"
-msgstr "%s+%#0*<PRIx64> <%s>"
-
-#: src/readelf.c:3649
-#, c-format
-msgid "%#<PRIx64> <%s>"
-msgstr "%#<PRIx64> <%s>"
-
-#: src/readelf.c:3652
-#, c-format
-msgid "%#0*<PRIx64> <%s>"
-msgstr "%#0*<PRIx64> <%s>"
-
-#: src/readelf.c:3657
-#, c-format
-msgid "%s+%#<PRIx64>"
-msgstr "%s+%#<PRIx64>"
-
-#: src/readelf.c:3660
-#, c-format
-msgid "%s+%#0*<PRIx64>"
-msgstr "%s+%#0*<PRIx64>"
-
-#: src/readelf.c:4038
+#: src/readelf.c:4249
msgid "empty block"
msgstr ""
-#: src/readelf.c:4041
+#: src/readelf.c:4252
#, c-format
msgid "%zu byte block:"
msgstr ""
-#: src/readelf.c:4438
+#: src/readelf.c:4730
#, c-format
-msgid "%*s[%4<PRIuMAX>] %s <TRUNCATED>\n"
+msgid "%*s[%2<PRIuMAX>] %s <TRUNCATED>\n"
msgstr ""
-#: src/readelf.c:4495
+#: src/readelf.c:4794
#, c-format
msgid "%s %#<PRIx64> used with different address sizes"
msgstr ""
-#: src/readelf.c:4502
+#: src/readelf.c:4801
#, c-format
msgid "%s %#<PRIx64> used with different offset sizes"
msgstr ""
-#: src/readelf.c:4509
+#: src/readelf.c:4808
#, c-format
msgid "%s %#<PRIx64> used with different base addresses"
msgstr ""
-#: src/readelf.c:4598
+#: src/readelf.c:4815
+#, c-format
+msgid "%s %#<PRIx64> used with different attribute %s and %s"
+msgstr ""
+
+#: src/readelf.c:4912
#, c-format
msgid " [%6tx] <UNUSED GARBAGE IN REST OF SECTION>\n"
msgstr ""
-#: src/readelf.c:4606
+#: src/readelf.c:4920
#, c-format
msgid " [%6tx] <UNUSED GARBAGE> ... %<PRIu64> bytes ...\n"
msgstr ""
-#: src/readelf.c:4632
+#: src/readelf.c:4998
#, c-format
msgid ""
"\n"
@@ -5075,37 +4554,79 @@
" [ Code]\n"
msgstr ""
-#: src/readelf.c:4640
+#: src/readelf.c:5006
#, c-format
msgid ""
"\n"
"Abbreviation section at offset %<PRIu64>:\n"
msgstr ""
-#: src/readelf.c:4653
+#: src/readelf.c:5019
#, c-format
msgid " *** error while reading abbreviation: %s\n"
msgstr ""
-#: src/readelf.c:4669
+#: src/readelf.c:5035
#, c-format
msgid " [%5u] offset: %<PRId64>, children: %s, tag: %s\n"
msgstr ""
-#: src/readelf.c:4672
-msgid "yes"
-msgstr "ja"
+#: src/readelf.c:5068 src/readelf.c:5377 src/readelf.c:5541 src/readelf.c:5926
+#: src/readelf.c:6527 src/readelf.c:8168 src/readelf.c:8838 src/readelf.c:9274
+#: src/readelf.c:9518 src/readelf.c:9683 src/readelf.c:10044
+#: src/readelf.c:10102
+#, c-format
+msgid ""
+"\n"
+"DWARF section [%2zu] '%s' at offset %#<PRIx64>:\n"
+msgstr ""
-#: src/readelf.c:4672
-msgid "no"
-msgstr "nein"
+#: src/readelf.c:5081
+#, fuzzy, c-format
+msgid "cannot get .debug_addr section data: %s"
+msgstr "konnte Abschnittsdaten nicht holen: %s"
-#: src/readelf.c:4706 src/readelf.c:4779
+#: src/readelf.c:5181 src/readelf.c:5205 src/readelf.c:5586 src/readelf.c:8883
+#, fuzzy, c-format
+msgid " Length: %8<PRIu64>\n"
+msgstr " %s: %<PRId64>\n"
+
+#: src/readelf.c:5183 src/readelf.c:5220 src/readelf.c:5599 src/readelf.c:8896
+#, fuzzy, c-format
+msgid " DWARF version: %8<PRIu16>\n"
+msgstr " %s: %<PRId64>\n"
+
+#: src/readelf.c:5184 src/readelf.c:5229 src/readelf.c:5608 src/readelf.c:8905
+#, fuzzy, c-format
+msgid " Address size: %8<PRIu64>\n"
+msgstr " %s: %<PRId64>\n"
+
+#: src/readelf.c:5186 src/readelf.c:5239 src/readelf.c:5618 src/readelf.c:8915
+#, fuzzy, c-format
+msgid " Segment size: %8<PRIu64>\n"
+msgstr " %s: %<PRId64>\n"
+
+#: src/readelf.c:5224 src/readelf.c:5603 src/readelf.c:8900 src/readelf.c:10234
+#, fuzzy, c-format
+msgid "Unknown version"
+msgstr "unbekannte Version"
+
+#: src/readelf.c:5234 src/readelf.c:5447 src/readelf.c:5613 src/readelf.c:8910
+#, fuzzy, c-format
+msgid "unsupported address size"
+msgstr "Kein Adress-Wert"
+
+#: src/readelf.c:5245 src/readelf.c:5456 src/readelf.c:5623 src/readelf.c:8920
+#, c-format
+msgid "unsupported segment size"
+msgstr ""
+
+#: src/readelf.c:5298 src/readelf.c:5372
#, c-format
msgid "cannot get .debug_aranges content: %s"
msgstr ""
-#: src/readelf.c:4721
+#: src/readelf.c:5313
#, c-format
msgid ""
"\n"
@@ -5116,193 +4637,241 @@
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:4752
+#: src/readelf.c:5344
#, c-format
msgid " [%*zu] ???\n"
msgstr " [%*zu] ???\n"
-#: src/readelf.c:4754
+#: src/readelf.c:5346
#, c-format
msgid ""
" [%*zu] start: %0#*<PRIx64>, length: %5<PRIu64>, CU DIE offset: %6<PRId64>\n"
msgstr ""
-#: src/readelf.c:4784 src/readelf.c:4938 src/readelf.c:5514 src/readelf.c:6468
-#: src/readelf.c:7000 src/readelf.c:7120 src/readelf.c:7284 src/readelf.c:7709
-#, c-format
-msgid ""
-"\n"
-"DWARF section [%2zu] '%s' at offset %#<PRIx64>:\n"
-msgstr ""
-
-#: src/readelf.c:4797 src/readelf.c:6494
+#: src/readelf.c:5390 src/readelf.c:8195
#, c-format
msgid ""
"\n"
"Table at offset %zu:\n"
msgstr ""
-#: src/readelf.c:4801 src/readelf.c:5538 src/readelf.c:6505
+#: src/readelf.c:5394 src/readelf.c:5567 src/readelf.c:6551 src/readelf.c:8206
+#: src/readelf.c:8864
#, c-format
msgid "invalid data in section [%zu] '%s'"
msgstr ""
-#: src/readelf.c:4817
+#: src/readelf.c:5410
#, fuzzy, c-format
msgid ""
"\n"
" Length: %6<PRIu64>\n"
msgstr " %s: %<PRId64>\n"
-#: src/readelf.c:4829
+#: src/readelf.c:5422
#, fuzzy, c-format
msgid " DWARF version: %6<PRIuFAST16>\n"
msgstr " %s: %<PRId64>\n"
-#: src/readelf.c:4833
+#: src/readelf.c:5426
#, c-format
msgid "unsupported aranges version"
msgstr ""
-#: src/readelf.c:4844
+#: src/readelf.c:5437
#, fuzzy, c-format
msgid " CU offset: %6<PRIx64>\n"
msgstr " %s: %<PRId64>\n"
-#: src/readelf.c:4850
+#: src/readelf.c:5443
#, c-format
msgid " Address size: %6<PRIu64>\n"
msgstr ""
-#: src/readelf.c:4854
-#, fuzzy, c-format
-msgid "unsupported address size"
-msgstr "Kein Adress-Wert"
-
-#: src/readelf.c:4859
+#: src/readelf.c:5452
#, c-format
msgid ""
" Segment size: %6<PRIu64>\n"
"\n"
msgstr ""
-#: src/readelf.c:4863
-#, c-format
-msgid "unsupported segment size"
-msgstr ""
-
-#: src/readelf.c:4903
-#, fuzzy, c-format
-msgid " %s..%s (%<PRIx64>)\n"
-msgstr " %s: %<PRId64>\n"
-
-#: src/readelf.c:4906
-#, fuzzy, c-format
-msgid " %s..%s\n"
-msgstr " [%6tx] %s..%s\n"
-
-#: src/readelf.c:4915
+#: src/readelf.c:5507
#, c-format
msgid " %zu padding bytes\n"
msgstr ""
-#: src/readelf.c:4933
+#: src/readelf.c:5550
+#, fuzzy, c-format
+msgid "cannot get .debug_rnglists content: %s"
+msgstr "konnte Programm-Kopf nicht erstellen: %s"
+
+#: src/readelf.c:5573 src/readelf.c:8870
+#, fuzzy, c-format
+msgid ""
+"Table at Offset 0x%<PRIx64>:\n"
+"\n"
+msgstr " %s: %<PRId64>\n"
+
+#: src/readelf.c:5628 src/readelf.c:8925
+#, fuzzy, c-format
+msgid " Offset entries: %8<PRIu64>\n"
+msgstr " %s: %<PRId64>\n"
+
+#: src/readelf.c:5644 src/readelf.c:8941
+#, c-format
+msgid " Unknown CU base: "
+msgstr ""
+
+#: src/readelf.c:5646 src/readelf.c:8943
+#, c-format
+msgid " CU [%6<PRIx64>] base: "
+msgstr ""
+
+#: src/readelf.c:5652 src/readelf.c:8949
+#, c-format
+msgid " Not associated with a CU.\n"
+msgstr ""
+
+#: src/readelf.c:5663 src/readelf.c:8960
+#, c-format
+msgid "too many offset entries for unit length"
+msgstr ""
+
+#: src/readelf.c:5667 src/readelf.c:8964
+#, fuzzy, c-format
+msgid " Offsets starting at 0x%<PRIx64>:\n"
+msgstr " %s: %<PRId64>\n"
+
+#: src/readelf.c:5719
+#, fuzzy, c-format
+msgid "invalid range list data"
+msgstr "Ungültige Daten"
+
+#: src/readelf.c:5904 src/readelf.c:9252
+#, c-format
+msgid ""
+" %zu padding bytes\n"
+"\n"
+msgstr ""
+
+#: src/readelf.c:5921
#, c-format
msgid "cannot get .debug_ranges content: %s"
msgstr ""
-#: src/readelf.c:4963 src/readelf.c:7027
+#: src/readelf.c:5957 src/readelf.c:9307
+#, c-format
+msgid ""
+"\n"
+" Unknown CU base: "
+msgstr ""
+
+#: src/readelf.c:5959 src/readelf.c:9309
+#, c-format
+msgid ""
+"\n"
+" CU [%6<PRIx64>] base: "
+msgstr ""
+
+#: src/readelf.c:5968 src/readelf.c:9335 src/readelf.c:9361
#, c-format
msgid " [%6tx] <INVALID DATA>\n"
msgstr ""
-#: src/readelf.c:4985 src/readelf.c:7049
+#: src/readelf.c:5989 src/readelf.c:9441
#, c-format
-msgid " [%6tx] base address %s\n"
+msgid ""
+" [%6tx] base address\n"
+" "
msgstr ""
-#: src/readelf.c:4992 src/readelf.c:7056
+#: src/readelf.c:5997 src/readelf.c:9449
#, fuzzy, c-format
-msgid " [%6tx] empty list\n"
+msgid " [%6tx] empty list\n"
msgstr " [%6tx] %s..%s\n"
-#: src/readelf.c:5003
-#, c-format
-msgid " [%6tx] %s..%s\n"
-msgstr " [%6tx] %s..%s\n"
-
-#: src/readelf.c:5005
-#, c-format
-msgid " %s..%s\n"
-msgstr " %s..%s\n"
-
-#: src/readelf.c:5184
+#: src/readelf.c:6252
msgid " <INVALID DATA>\n"
msgstr ""
-#: src/readelf.c:5493
+#: src/readelf.c:6505
#, fuzzy, c-format
msgid "cannot get ELF: %s"
msgstr "ELF Kopf konnte nicht ausgelesen werden"
-#: src/readelf.c:5510
+#: src/readelf.c:6523
#, c-format
msgid ""
"\n"
"Call frame information section [%2zu] '%s' at offset %#<PRIx64>:\n"
msgstr ""
-#: src/readelf.c:5560
+#: src/readelf.c:6573
#, c-format
msgid ""
"\n"
" [%6tx] Zero terminator\n"
msgstr ""
-#: src/readelf.c:5653 src/readelf.c:5808
+#: src/readelf.c:6666 src/readelf.c:6820
#, fuzzy, c-format
msgid "invalid augmentation length"
msgstr "ungültige Abschnittsausrichtung"
-#: src/readelf.c:5668
+#: src/readelf.c:6681
msgid "FDE address encoding: "
msgstr ""
-#: src/readelf.c:5674
+#: src/readelf.c:6687
msgid "LSDA pointer encoding: "
msgstr ""
-#: src/readelf.c:5785
+#: src/readelf.c:6797
#, c-format
msgid " (offset: %#<PRIx64>)"
msgstr ""
-#: src/readelf.c:5792
+#: src/readelf.c:6804
#, c-format
msgid " (end offset: %#<PRIx64>)"
msgstr ""
-#: src/readelf.c:5829
+#: src/readelf.c:6841
#, c-format
msgid " %-26sLSDA pointer: %#<PRIx64>\n"
msgstr ""
-#: src/readelf.c:5884
+#: src/readelf.c:6926
#, c-format
-msgid "cannot get attribute code: %s"
+msgid "DIE [%<PRIx64>] cannot get attribute code: %s"
msgstr ""
-#: src/readelf.c:5893
+#: src/readelf.c:6936
#, c-format
-msgid "cannot get attribute form: %s"
+msgid "DIE [%<PRIx64>] cannot get attribute form: %s"
msgstr ""
-#: src/readelf.c:5908
+#: src/readelf.c:6958
#, c-format
-msgid "cannot get attribute value: %s"
+msgid "DIE [%<PRIx64>] cannot get attribute '%s' (%s) value: %s"
msgstr ""
-#: src/readelf.c:6207
+#: src/readelf.c:7291
+#, fuzzy, c-format
+msgid "invalid file (%<PRId64>): %s"
+msgstr "Ungültige Datei"
+
+#: src/readelf.c:7295
+#, fuzzy, c-format
+msgid "no srcfiles for CU [%<PRIx64>]"
+msgstr "unbekannte Form %<PRIx64>"
+
+#: src/readelf.c:7299
+#, fuzzy, c-format
+msgid "couldn't get DWARF CU: %s"
+msgstr "ELF Kopf konnte nicht ausgelesen werden"
+
+#: src/readelf.c:7522
#, c-format
msgid ""
"\n"
@@ -5310,16 +4879,21 @@
" [Offset]\n"
msgstr ""
-#: src/readelf.c:6239
+#: src/readelf.c:7572
+#, fuzzy, c-format
+msgid "cannot get next unit: %s"
+msgstr "konnte Abschnittsdaten nicht holen: %s"
+
+#: src/readelf.c:7591
#, c-format
msgid ""
" Type unit at offset %<PRIu64>:\n"
" Version: %<PRIu16>, Abbreviation section offset: %<PRIu64>, Address size: "
"%<PRIu8>, Offset size: %<PRIu8>\n"
-" Type signature: %#<PRIx64>, Type offset: %#<PRIx64>\n"
+" Type signature: %#<PRIx64>, Type offset: %#<PRIx64> [%<PRIx64>]\n"
msgstr ""
-#: src/readelf.c:6248
+#: src/readelf.c:7603
#, c-format
msgid ""
" Compilation unit at offset %<PRIu64>:\n"
@@ -5327,32 +4901,45 @@
"%<PRIu8>, Offset size: %<PRIu8>\n"
msgstr ""
-#: src/readelf.c:6273
+#: src/readelf.c:7613 src/readelf.c:7776
#, c-format
-msgid "cannot get DIE at offset %<PRIu64> in section '%s': %s"
+msgid " Unit type: %s (%<PRIu8>)"
msgstr ""
-#: src/readelf.c:6287
+#: src/readelf.c:7640
+#, c-format
+msgid "unknown version (%d) or unit type (%d)"
+msgstr ""
+
+#: src/readelf.c:7669
#, c-format
msgid "cannot get DIE offset: %s"
msgstr ""
-#: src/readelf.c:6296
-#, c-format
-msgid "cannot get tag of DIE at offset %<PRIu64> in section '%s': %s"
-msgstr ""
+#: src/readelf.c:7678
+#, fuzzy, c-format
+msgid "cannot get tag of DIE at offset [%<PRIx64>] in section '%s': %s"
+msgstr "konnte Programm-Kopf nicht erstellen: %s"
-#: src/readelf.c:6328
+#: src/readelf.c:7716
#, c-format
msgid "cannot get next DIE: %s\n"
msgstr ""
-#: src/readelf.c:6336
+#: src/readelf.c:7724
#, c-format
msgid "cannot get next DIE: %s"
msgstr ""
-#: src/readelf.c:6372
+#: src/readelf.c:7768
+#, c-format
+msgid ""
+" Split compilation unit at offset %<PRIu64>:\n"
+" Version: %<PRIu16>, Abbreviation section offset: %<PRIu64>, Address size: "
+"%<PRIu8>, Offset size: %<PRIu8>\n"
+msgstr ""
+
+#: src/readelf.c:7819
#, c-format
msgid ""
"\n"
@@ -5360,271 +4947,305 @@
"\n"
msgstr ""
-#: src/readelf.c:6481
+#: src/readelf.c:8151
+#, fuzzy, c-format
+msgid "unknown form: %s"
+msgstr "unbekannte Form %<PRIx64>"
+
+#: src/readelf.c:8182
#, c-format
msgid "cannot get line data section data: %s"
msgstr ""
-#: src/readelf.c:6551
+#. Print what we got so far.
+#: src/readelf.c:8284
#, c-format
msgid ""
"\n"
-" Length: %<PRIu64>\n"
-" DWARF version: %<PRIuFAST16>\n"
-" Prologue length: %<PRIu64>\n"
-" Minimum instruction length: %<PRIuFAST8>\n"
-" Maximum operations per instruction: %<PRIuFAST8>\n"
-" Initial value if '%s': %<PRIuFAST8>\n"
-" Line base: %<PRIdFAST8>\n"
-" Line range: %<PRIuFAST8>\n"
-" Opcode base: %<PRIuFAST8>\n"
+" Length: %<PRIu64>\n"
+" DWARF version: %<PRIuFAST16>\n"
+" Prologue length: %<PRIu64>\n"
+" Address size: %zd\n"
+" Segment selector size: %zd\n"
+" Min instruction length: %<PRIuFAST8>\n"
+" Max operations per instruction: %<PRIuFAST8>\n"
+" Initial value if 'is_stmt': %<PRIuFAST8>\n"
+" Line base: %<PRIdFAST8>\n"
+" Line range: %<PRIuFAST8>\n"
+" Opcode base: %<PRIuFAST8>\n"
"\n"
"Opcodes:\n"
msgstr ""
-#: src/readelf.c:6572
+#: src/readelf.c:8306
+#, fuzzy, c-format
+msgid "cannot handle .debug_line version: %u\n"
+msgstr "ungültige .debug_line Sektion"
+
+#: src/readelf.c:8314
+#, fuzzy, c-format
+msgid "cannot handle address size: %u\n"
+msgstr "Kein Adress-Wert"
+
+#: src/readelf.c:8322
+#, c-format
+msgid "cannot handle segment selector size: %u\n"
+msgstr ""
+
+#: src/readelf.c:8332
#, c-format
msgid "invalid data at offset %tu in section [%zu] '%s'"
msgstr ""
-#: src/readelf.c:6587
+#: src/readelf.c:8347
#, c-format
msgid " [%*<PRIuFAST8>] %hhu argument\n"
msgid_plural " [%*<PRIuFAST8>] %hhu arguments\n"
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:6595
+#: src/readelf.c:8358
msgid ""
"\n"
"Directory table:"
msgstr ""
-#: src/readelf.c:6611
+#: src/readelf.c:8364 src/readelf.c:8439
+#, fuzzy, c-format
+msgid " ["
+msgstr " %s: %s\n"
+
+#: src/readelf.c:8433
msgid ""
"\n"
-"File name table:\n"
-" Entry Dir Time Size Name"
+"File name table:"
msgstr ""
-#: src/readelf.c:6646
+#: src/readelf.c:8494
+msgid " Entry Dir Time Size Name"
+msgstr ""
+
+#: src/readelf.c:8529
msgid ""
"\n"
"Line number statements:"
msgstr ""
-#: src/readelf.c:6697
+#: src/readelf.c:8552
#, c-format
msgid "invalid maximum operations per instruction is zero"
msgstr ""
-#: src/readelf.c:6733
+#: src/readelf.c:8586
#, c-format
-msgid " special opcode %u: address+%u = %s, op_index = %u, line%+d = %zu\n"
+msgid " special opcode %u: address+%u = "
msgstr ""
-#: src/readelf.c:6738
+#: src/readelf.c:8590
#, c-format
-msgid " special opcode %u: address+%u = %s, line%+d = %zu\n"
+msgid ", op_index = %u, line%+d = %zu\n"
msgstr ""
-#: src/readelf.c:6758
+#: src/readelf.c:8593
+#, c-format
+msgid ", line%+d = %zu\n"
+msgstr ""
+
+#: src/readelf.c:8611
#, c-format
msgid " extended opcode %u: "
msgstr ""
-#: src/readelf.c:6763
+#: src/readelf.c:8616
msgid " end of sequence"
msgstr ""
-#: src/readelf.c:6782
-#, c-format
-msgid " set address to %s\n"
-msgstr ""
+#: src/readelf.c:8634
+#, fuzzy, c-format
+msgid " set address to "
+msgstr "Außerhalb des Adressbereiches"
-#: src/readelf.c:6809
+#: src/readelf.c:8662
#, c-format
msgid " define new file: dir=%u, mtime=%<PRIu64>, length=%<PRIu64>, name=%s\n"
msgstr ""
-#: src/readelf.c:6822
+#: src/readelf.c:8675
#, c-format
msgid " set discriminator to %u\n"
msgstr ""
-#: src/readelf.c:6827
+#. Unknown, ignore it.
+#: src/readelf.c:8680
#, fuzzy
msgid " unknown opcode"
msgstr "unbekannter Typ"
-#: src/readelf.c:6839
+#. Takes no argument.
+#: src/readelf.c:8692
msgid " copy"
msgstr ""
-#: src/readelf.c:6850
+#: src/readelf.c:8701
#, c-format
-msgid " advance address by %u to %s, op_index to %u\n"
+msgid " advance address by %u to "
msgstr ""
-#: src/readelf.c:6854
+#: src/readelf.c:8705 src/readelf.c:8761
#, c-format
-msgid " advance address by %u to %s\n"
+msgid ", op_index to %u"
msgstr ""
-#: src/readelf.c:6865
+#: src/readelf.c:8715
#, c-format
msgid " advance line by constant %d to %<PRId64>\n"
msgstr ""
-#: src/readelf.c:6873
+#: src/readelf.c:8723
#, c-format
msgid " set file to %<PRIu64>\n"
msgstr ""
-#: src/readelf.c:6883
+#: src/readelf.c:8733
#, c-format
msgid " set column to %<PRIu64>\n"
msgstr ""
-#: src/readelf.c:6890
+#: src/readelf.c:8740
#, c-format
msgid " set '%s' to %<PRIuFAST8>\n"
msgstr ""
-#: src/readelf.c:6896
+#. Takes no argument.
+#: src/readelf.c:8746
msgid " set basic block flag"
msgstr ""
-#: src/readelf.c:6909
+#: src/readelf.c:8757
#, c-format
-msgid " advance address by constant %u to %s, op_index to %u\n"
+msgid " advance address by constant %u to "
msgstr ""
-#: src/readelf.c:6913
+#: src/readelf.c:8776
#, c-format
-msgid " advance address by constant %u to %s\n"
+msgid " advance address by fixed value %u to \n"
msgstr ""
-#: src/readelf.c:6931
-#, c-format
-msgid " advance address by fixed value %u to %s\n"
-msgstr ""
-
-#: src/readelf.c:6940
+#. Takes no argument.
+#: src/readelf.c:8786
msgid " set prologue end flag"
msgstr ""
-#: src/readelf.c:6945
+#. Takes no argument.
+#: src/readelf.c:8791
msgid " set epilogue begin flag"
msgstr ""
-#: src/readelf.c:6954
+#: src/readelf.c:8800
#, c-format
msgid " set isa to %u\n"
msgstr ""
-#: src/readelf.c:6963
+#. This is a new opcode the generator but not we know about.
+#. Read the parameters associated with it but then discard
+#. everything. Read all the parameters for this opcode.
+#: src/readelf.c:8809
#, c-format
msgid " unknown opcode with %<PRIu8> parameter:"
msgid_plural " unknown opcode with %<PRIu8> parameters:"
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:6995
+#: src/readelf.c:8847
+#, fuzzy, c-format
+msgid "cannot get .debug_loclists content: %s"
+msgstr "konnte Eintrag aus der Symboltabelle nicht holen: %s"
+
+#: src/readelf.c:9016
+#, fuzzy, c-format
+msgid "invalid loclists data"
+msgstr "Ungültige Daten"
+
+#: src/readelf.c:9269
#, c-format
msgid "cannot get .debug_loc content: %s"
msgstr ""
-#: src/readelf.c:7070
-#, c-format
-msgid " [%6tx] %s..%s"
-msgstr " [%6tx] %s..%s"
-
-#: src/readelf.c:7072
-#, c-format
-msgid " %s..%s"
-msgstr " %s..%s"
-
-#: src/readelf.c:7079 src/readelf.c:7967
+#: src/readelf.c:9476 src/readelf.c:10490
msgid " <INVALID DATA>\n"
msgstr ""
-#: src/readelf.c:7131 src/readelf.c:7293
+#: src/readelf.c:9530 src/readelf.c:9693
#, c-format
msgid "cannot get macro information section data: %s"
msgstr ""
-#: src/readelf.c:7211
+#: src/readelf.c:9610
#, c-format
msgid "%*s*** non-terminated string at end of section"
msgstr ""
-#: src/readelf.c:7234
+#: src/readelf.c:9633
#, c-format
msgid "%*s*** missing DW_MACINFO_start_file argument at end of section"
msgstr ""
-#: src/readelf.c:7334
+#: src/readelf.c:9734
#, fuzzy, c-format
msgid " Offset: 0x%<PRIx64>\n"
msgstr " %s: %<PRId64>\n"
-#: src/readelf.c:7346
+#: src/readelf.c:9746
#, fuzzy, c-format
msgid " Version: %<PRIu16>\n"
msgstr " %s: %<PRId64>\n"
-#: src/readelf.c:7352 src/readelf.c:8086
+#: src/readelf.c:9752 src/readelf.c:10609
#, c-format
msgid " unknown version, cannot parse section\n"
msgstr ""
-#: src/readelf.c:7359
+#: src/readelf.c:9759
#, fuzzy, c-format
msgid " Flag: 0x%<PRIx8>\n"
msgstr " %s: %<PRId64>\n"
-#: src/readelf.c:7362
+#: src/readelf.c:9762
#, c-format
msgid " Offset length: %<PRIu8>\n"
msgstr ""
-#: src/readelf.c:7370
+#: src/readelf.c:9770
#, c-format
msgid " .debug_line offset: 0x%<PRIx64>\n"
msgstr ""
-#: src/readelf.c:7383
+#: src/readelf.c:9795
#, c-format
msgid " extension opcode table, %<PRIu8> items:\n"
msgstr ""
-#: src/readelf.c:7390
+#: src/readelf.c:9802
#, c-format
msgid " [%<PRIx8>]"
msgstr ""
-#: src/readelf.c:7402
+#: src/readelf.c:9814
#, c-format
msgid " %<PRIu8> arguments:"
msgstr ""
-#: src/readelf.c:7430
+#: src/readelf.c:9829
#, c-format
msgid " no arguments."
msgstr ""
-#: src/readelf.c:7667
-#, c-format
-msgid "vendor opcode not verified?"
-msgstr ""
-
-#: src/readelf.c:7695
+#: src/readelf.c:10030
#, c-format
msgid " [%5d] DIE offset: %6<PRId64>, CU DIE offset: %6<PRId64>, name: %s\n"
msgstr ""
-#: src/readelf.c:7736
+#: src/readelf.c:10072
#, c-format
msgid ""
"\n"
@@ -5632,47 +5253,72 @@
" %*s String\n"
msgstr ""
-#: src/readelf.c:7750
+#: src/readelf.c:10087
#, c-format
-msgid " *** error while reading strings: %s\n"
+msgid " *** error, missing string terminator\n"
msgstr ""
-#: src/readelf.c:7770
+#: src/readelf.c:10115
+#, fuzzy, c-format
+msgid "cannot get .debug_str_offsets section data: %s"
+msgstr "konnte Abschnittsdaten nicht holen: %s"
+
+#: src/readelf.c:10214
+#, fuzzy, c-format
+msgid " Length: %8<PRIu64>\n"
+msgstr " %s: %<PRId64>\n"
+
+#: src/readelf.c:10216
+#, fuzzy, c-format
+msgid " Offset size: %8<PRIu8>\n"
+msgstr " %s: %<PRId64>\n"
+
+#: src/readelf.c:10230
+#, fuzzy, c-format
+msgid " DWARF version: %8<PRIu16>\n"
+msgstr " %s: %<PRId64>\n"
+
+#: src/readelf.c:10239
+#, fuzzy, c-format
+msgid " Padding: %8<PRIx16>\n"
+msgstr " %s: %<PRId64>\n"
+
+#: src/readelf.c:10293
#, c-format
msgid ""
"\n"
"Call frame search table section [%2zu] '.eh_frame_hdr':\n"
msgstr ""
-#: src/readelf.c:7872
+#: src/readelf.c:10395
#, c-format
msgid ""
"\n"
"Exception handling table section [%2zu] '.gcc_except_table':\n"
msgstr ""
-#: src/readelf.c:7895
+#: src/readelf.c:10418
#, c-format
msgid " LPStart encoding: %#x "
msgstr ""
-#: src/readelf.c:7907
+#: src/readelf.c:10430
#, c-format
msgid " TType encoding: %#x "
msgstr ""
-#: src/readelf.c:7922
+#: src/readelf.c:10445
#, c-format
msgid " Call site encoding: %#x "
msgstr ""
-#: src/readelf.c:7935
+#: src/readelf.c:10458
msgid ""
"\n"
" Call site table:"
msgstr ""
-#: src/readelf.c:7949
+#: src/readelf.c:10472
#, c-format
msgid ""
" [%4u] Call site start: %#<PRIx64>\n"
@@ -5681,141 +5327,142 @@
" Action: %u\n"
msgstr ""
-#: src/readelf.c:8022
+#: src/readelf.c:10545
#, c-format
msgid "invalid TType encoding"
msgstr ""
-#: src/readelf.c:8048
+#: src/readelf.c:10571
#, c-format
msgid ""
"\n"
"GDB section [%2zu] '%s' at offset %#<PRIx64> contains %<PRId64> bytes :\n"
msgstr ""
-#: src/readelf.c:8077
+#: src/readelf.c:10600
#, fuzzy, c-format
msgid " Version: %<PRId32>\n"
msgstr " %s: %<PRId64>\n"
-#: src/readelf.c:8095
+#: src/readelf.c:10618
#, c-format
msgid " CU offset: %#<PRIx32>\n"
msgstr ""
-#: src/readelf.c:8102
+#: src/readelf.c:10625
#, c-format
msgid " TU offset: %#<PRIx32>\n"
msgstr ""
-#: src/readelf.c:8109
+#: src/readelf.c:10632
#, c-format
msgid " address offset: %#<PRIx32>\n"
msgstr ""
-#: src/readelf.c:8116
+#: src/readelf.c:10639
#, c-format
msgid " symbol offset: %#<PRIx32>\n"
msgstr ""
-#: src/readelf.c:8123
+#: src/readelf.c:10646
#, c-format
msgid " constant offset: %#<PRIx32>\n"
msgstr ""
-#: src/readelf.c:8137
+#: src/readelf.c:10660
#, c-format
msgid ""
"\n"
" CU list at offset %#<PRIx32> contains %zu entries:\n"
msgstr ""
-#: src/readelf.c:8162
+#: src/readelf.c:10685
#, c-format
msgid ""
"\n"
" TU list at offset %#<PRIx32> contains %zu entries:\n"
msgstr ""
-#: src/readelf.c:8191
+#: src/readelf.c:10714
#, c-format
msgid ""
"\n"
" Address list at offset %#<PRIx32> contains %zu entries:\n"
msgstr ""
-#: src/readelf.c:8224
+#: src/readelf.c:10746
#, c-format
msgid ""
"\n"
" Symbol table at offset %#<PRIx32> contains %zu slots:\n"
msgstr ""
-#: src/readelf.c:8311
+#: src/readelf.c:10884
#, c-format
msgid "cannot get debug context descriptor: %s"
msgstr ""
-#: src/readelf.c:8467 src/readelf.c:9089 src/readelf.c:9200 src/readelf.c:9258
+#: src/readelf.c:11247 src/readelf.c:11869 src/readelf.c:11980
+#: src/readelf.c:12038
#, c-format
msgid "cannot convert core note data: %s"
msgstr ""
-#: src/readelf.c:8830
+#: src/readelf.c:11610
#, c-format
msgid ""
"\n"
"%*s... <repeats %u more times> ..."
msgstr ""
-#: src/readelf.c:9337
+#: src/readelf.c:12117
msgid " Owner Data size Type\n"
msgstr ""
-#: src/readelf.c:9355
+#: src/readelf.c:12135
#, c-format
msgid " %-13.*s %9<PRId32> %s\n"
msgstr ""
-#: src/readelf.c:9405
-#, c-format
-msgid "cannot get content of note section: %s"
-msgstr ""
+#: src/readelf.c:12185
+#, fuzzy, c-format
+msgid "cannot get content of note: %s"
+msgstr "Konnte Inhalt von %s: %s nicht lesen"
-#: src/readelf.c:9432
+#: src/readelf.c:12212
#, c-format
msgid ""
"\n"
"Note section [%2zu] '%s' of %<PRIu64> bytes at offset %#0<PRIx64>:\n"
msgstr ""
-#: src/readelf.c:9455
+#: src/readelf.c:12235
#, c-format
msgid ""
"\n"
"Note segment of %<PRIu64> bytes at offset %#0<PRIx64>:\n"
msgstr ""
-#: src/readelf.c:9501
+#: src/readelf.c:12281
#, fuzzy, c-format
msgid ""
"\n"
"Section [%zu] '%s' has no data to dump.\n"
msgstr "konnte Abschnittsdaten nicht holen: %s"
-#: src/readelf.c:9518 src/readelf.c:9559
+#: src/readelf.c:12308 src/readelf.c:12359
#, fuzzy, c-format
msgid "cannot get data for section [%zu] '%s': %s"
msgstr "konnte Abschnittsdaten nicht holen: %s"
-#: src/readelf.c:9523
+#: src/readelf.c:12313
#, c-format
msgid ""
"\n"
"Hex dump of section [%zu] '%s', %<PRIu64> bytes at offset %#0<PRIx64>:\n"
msgstr ""
-#: src/readelf.c:9528
+#: src/readelf.c:12318
#, c-format
msgid ""
"\n"
@@ -5823,21 +5470,21 @@
"%#0<PRIx64>:\n"
msgstr ""
-#: src/readelf.c:9542
+#: src/readelf.c:12332
#, fuzzy, c-format
msgid ""
"\n"
"Section [%zu] '%s' has no strings to dump.\n"
msgstr "konnte Abschnittsdaten nicht holen: %s"
-#: src/readelf.c:9564
+#: src/readelf.c:12364
#, c-format
msgid ""
"\n"
"String section [%zu] '%s' contains %<PRIu64> bytes at offset %#0<PRIx64>:\n"
msgstr ""
-#: src/readelf.c:9569
+#: src/readelf.c:12369
#, c-format
msgid ""
"\n"
@@ -5845,227 +5492,229 @@
"offset %#0<PRIx64>:\n"
msgstr ""
-#: src/readelf.c:9618
+#: src/readelf.c:12418
#, c-format
msgid ""
"\n"
"section [%lu] does not exist"
msgstr ""
-#: src/readelf.c:9647
+#: src/readelf.c:12447
#, c-format
msgid ""
"\n"
"section '%s' does not exist"
msgstr ""
-#: src/readelf.c:9704
+#: src/readelf.c:12504
#, c-format
msgid "cannot get symbol index of archive '%s': %s"
msgstr ""
-#: src/readelf.c:9707
+#: src/readelf.c:12507
#, c-format
msgid ""
"\n"
"Archive '%s' has no symbol index\n"
msgstr ""
-#: src/readelf.c:9711
+#: src/readelf.c:12511
#, c-format
msgid ""
"\n"
"Index of archive '%s' has %zu entries:\n"
msgstr ""
-#: src/readelf.c:9729
+#: src/readelf.c:12529
#, fuzzy, c-format
msgid "cannot extract member at offset %zu in '%s': %s"
msgstr "konnte Programm-Kopf nicht erstellen: %s"
-#: src/readelf.c:9734
+#: src/readelf.c:12534
#, c-format
msgid "Archive member '%s' contains:\n"
msgstr ""
-#: src/size.c:59
+#: src/size.c:57
msgid ""
"Use the output format FORMAT. FORMAT can be `bsd' or `sysv'. The default "
"is `bsd'"
msgstr ""
-#: src/size.c:61
+#: src/size.c:59
msgid "Same as `--format=sysv'"
msgstr "Genau wie `--format=sysv'"
-#: src/size.c:62
+#: src/size.c:60
msgid "Same as `--format=bsd'"
msgstr "Genau wie `--format=bsd'"
-#: src/size.c:65
+#: src/size.c:63
msgid "Same as `--radix=10'"
msgstr "Genau wie `--radix=10'"
-#: src/size.c:66
+#: src/size.c:64
msgid "Same as `--radix=8'"
msgstr "Genau wie `--radix=8'"
-#: src/size.c:67
+#: src/size.c:65
msgid "Same as `--radix=16'"
msgstr "Genau wie `--radix=16'"
-#: src/size.c:69
+#: src/size.c:67
msgid "Similar to `--format=sysv' output but in one line"
msgstr ""
-#: src/size.c:73
+#: src/size.c:71
msgid "Print size and permission flags for loadable segments"
msgstr ""
-#: src/size.c:74
+#: src/size.c:72
msgid "Display the total sizes (bsd only)"
msgstr ""
-#: src/size.c:79
+#. Short description of program.
+#: src/size.c:77
msgid "List section sizes of FILEs (a.out by default)."
msgstr ""
-#: src/size.c:257
+#: src/size.c:241
#, c-format
msgid "Invalid format: %s"
msgstr "Ungültiges Format: %s"
-#: src/size.c:268
+#: src/size.c:252
#, c-format
msgid "Invalid radix: %s"
msgstr ""
-#: src/size.c:327
+#: src/size.c:311
#, c-format
msgid "%s: file format not recognized"
msgstr ""
-#: src/size.c:433 src/size.c:566
+#: src/size.c:417 src/size.c:550
#, c-format
msgid " (ex %s)"
msgstr ""
-#: src/size.c:591
+#: src/size.c:575
msgid "(TOTALS)\n"
msgstr ""
-#: src/stack.c:488
+#: src/stack.c:483
#, c-format
msgid "-p PID should be a positive process id."
msgstr ""
-#: src/stack.c:494
+#: src/stack.c:489
#, fuzzy, c-format
msgid "Cannot open core file '%s'"
msgstr "Konnte Archiv '%s' nicht öffnen"
-#: src/stack.c:554
+#: src/stack.c:549
#, c-format
msgid "-n MAXFRAMES should be 0 or higher."
msgstr ""
-#: src/stack.c:566
+#: src/stack.c:561
#, c-format
msgid "-e EXEC needs a core given by --core."
msgstr ""
-#: src/stack.c:570
+#: src/stack.c:565
#, c-format
msgid "-1 needs a thread id given by -p."
msgstr ""
-#: src/stack.c:574
+#: src/stack.c:569
#, c-format
msgid "One of -p PID or --core COREFILE should be given."
msgstr ""
-#: src/stack.c:644
+#: src/stack.c:641
#, fuzzy
msgid "Show stack of process PID"
msgstr "Kann Suchbaum nicht erstellen"
-#: src/stack.c:646
+#: src/stack.c:643
msgid "Show stack found in COREFILE"
msgstr ""
-#: src/stack.c:647
+#: src/stack.c:644
msgid "(optional) EXECUTABLE that produced COREFILE"
msgstr ""
-#: src/stack.c:651
+#: src/stack.c:648
#, fuzzy
msgid "Output selection options:"
msgstr "Eingabeauswahloptionen:"
-#: src/stack.c:653
+#: src/stack.c:650
msgid "Additionally show frame activation"
msgstr ""
-#: src/stack.c:655
+#: src/stack.c:652
msgid "Additionally try to lookup DWARF debuginfo name for frame address"
msgstr ""
-#: src/stack.c:658
+#: src/stack.c:655
msgid ""
"Additionally show inlined function frames using DWARF debuginfo if available "
"(implies -d)"
msgstr ""
-#: src/stack.c:660
+#: src/stack.c:657
msgid "Additionally show module file information"
msgstr ""
-#: src/stack.c:662
+#: src/stack.c:659
msgid "Additionally show source file information"
msgstr ""
-#: src/stack.c:664
+#: src/stack.c:661
msgid ""
"Show all additional information (activation, debugname, inlines, module and "
"source)"
msgstr ""
-#: src/stack.c:666
+#: src/stack.c:663
msgid "Do not resolve address to function symbol name"
msgstr ""
-#: src/stack.c:668
+#: src/stack.c:665
msgid "Show raw function symbol names, do not try to demangle names"
msgstr ""
-#: src/stack.c:670
+#: src/stack.c:667
msgid "Show module build-id, load address and pc offset"
msgstr ""
-#: src/stack.c:672
+#: src/stack.c:669
msgid "Show the backtrace of only one thread"
msgstr ""
-#: src/stack.c:674
+#: src/stack.c:671
msgid "Show at most MAXFRAMES per thread (default 256, use 0 for unlimited)"
msgstr ""
-#: src/stack.c:676
+#: src/stack.c:673
msgid "Show module memory map with build-id, elf and debug files detected"
msgstr ""
-#: src/stack.c:684
+#: src/stack.c:681
msgid ""
-"Print a stack for each thread in a process or core file.\vProgram exits with "
-"return code 0 if all frames were shown without any errors. If some frames "
-"were shown, but there were some non-fatal errors, possibly causing an "
-"incomplete backtrace, the program exits with return code 1. If no frames "
-"could be shown, or a fatal error occured the program exits with return code "
-"2. If the program was invoked with bad or missing arguments it will exit "
-"with return code 64."
+"Print a stack for each thread in a process or core file.\n"
+"\n"
+"Program exits with return code 0 if all frames were shown without any "
+"errors. If some frames were shown, but there were some non-fatal errors, "
+"possibly causing an incomplete backtrace, the program exits with return code "
+"1. If no frames could be shown, or a fatal error occured the program exits "
+"with return code 2. If the program was invoked with bad or missing "
+"arguments it will exit with return code 64."
msgstr ""
-#: src/stack.c:757
+#: src/stack.c:756
#, c-format
msgid "Couldn't show any frames."
msgstr ""
@@ -6100,550 +5749,587 @@
msgid "Alias for --radix=o"
msgstr "Alias für --radix=o"
+#. Short description of program.
#: src/strings.c:84
msgid "Print the strings of printable characters in files."
msgstr ""
-#: src/strings.c:271 src/strings.c:306
+#: src/strings.c:257 src/strings.c:292
#, c-format
msgid "invalid value '%s' for %s parameter"
msgstr ""
-#: src/strings.c:317
+#: src/strings.c:303
#, c-format
msgid "invalid minimum length of matched string size"
msgstr ""
-#: src/strings.c:600
+#: src/strings.c:586
#, fuzzy, c-format
msgid "lseek failed"
msgstr "lseek64 fehlgeschlagen"
-#: src/strings.c:617 src/strings.c:681
+#: src/strings.c:603 src/strings.c:667
#, c-format
msgid "re-mmap failed"
msgstr "re-mmap fehlgeschlagen"
-#: src/strings.c:654
+#: src/strings.c:640
#, c-format
msgid "mprotect failed"
msgstr "mprotect fehlgeschlagen"
-#: src/strings.c:743
+#: src/strings.c:729
#, c-format
msgid "Skipping section %zd '%s' data outside file"
msgstr ""
-#: src/strip.c:68
+#: src/strip.c:71
msgid "Place stripped output into FILE"
msgstr ""
-#: src/strip.c:69
+#: src/strip.c:72
msgid "Extract the removed sections into FILE"
msgstr ""
-#: src/strip.c:70
+#: src/strip.c:73
msgid "Embed name FILE instead of -f argument"
msgstr ""
-#: src/strip.c:74
+#: src/strip.c:77
msgid "Remove all debugging symbols"
msgstr ""
-#: src/strip.c:78
+#: src/strip.c:81
msgid "Remove section headers (not recommended)"
msgstr ""
-#: src/strip.c:80
+#: src/strip.c:83
msgid "Copy modified/access timestamps to the output"
msgstr ""
-#: src/strip.c:82
+#: src/strip.c:85
msgid ""
"Resolve all trivial relocations between debug sections if the removed "
"sections are placed in a debug file (only relevant for ET_REL files, "
"operation is not reversable, needs -f)"
msgstr ""
-#: src/strip.c:84
+#: src/strip.c:87
msgid "Remove .comment section"
msgstr ""
-#: src/strip.c:87
-msgid "Relax a few rules to handle slightly broken ELF files"
+#: src/strip.c:88
+msgid ""
+"Remove the named section. SECTION is an extended wildcard pattern. May be "
+"given more than once. Only non-allocated sections can be removed."
msgstr ""
-#: src/strip.c:92
+#: src/strip.c:89
+msgid ""
+"Keep the named section. SECTION is an extended wildcard pattern. May be "
+"given more than once."
+msgstr ""
+
+#. Short description of program.
+#: src/strip.c:96
msgid "Discard symbols from object files."
msgstr ""
-#: src/strip.c:186
+#: src/strip.c:242
#, c-format
msgid "--reloc-debug-sections used without -f"
msgstr ""
-#: src/strip.c:200
+#: src/strip.c:256
#, c-format
msgid "Only one input file allowed together with '-o' and '-f'"
msgstr ""
-#: src/strip.c:236
+#: src/strip.c:279
#, c-format
msgid "-f option specified twice"
msgstr ""
-#: src/strip.c:245
+#: src/strip.c:288
#, c-format
msgid "-F option specified twice"
msgstr ""
-#: src/strip.c:254 src/unstrip.c:120
+#: src/strip.c:347
#, c-format
-msgid "-o option specified twice"
+msgid "cannot both keep and remove .comment section"
msgstr ""
-#: src/strip.c:278
-#, c-format
-msgid "-R option supports only .comment section"
-msgstr ""
-
-#: src/strip.c:320 src/strip.c:344
+#: src/strip.c:372 src/strip.c:396
#, c-format
msgid "cannot stat input file '%s'"
msgstr ""
-#: src/strip.c:334
+#: src/strip.c:386
#, c-format
msgid "while opening '%s'"
msgstr ""
-#: src/strip.c:372
+#: src/strip.c:424
#, c-format
msgid "%s: cannot use -o or -f when stripping archive"
msgstr ""
-#: src/strip.c:384
+#. We would like to support ar archives, but currently it just
+#. doesn't work at all since we call elf_clone on the members
+#. which doesn't really support ar members.
+#. result = handle_ar (fd, elf, NULL, fname,
+#. preserve_dates ? tv : NULL);
+#.
+#: src/strip.c:436
#, fuzzy, c-format
msgid "%s: no support for stripping archive"
msgstr "%s: Kein Eintrag %s in dem Archiv!\n"
-#: src/strip.c:483
+#: src/strip.c:535
#, c-format
msgid "cannot open EBL backend"
msgstr ""
-#: src/strip.c:528
+#: src/strip.c:580
#, fuzzy, c-format
msgid "cannot get number of phdrs"
msgstr "konnte Programm-Kopf nicht erstellen: %s"
-#: src/strip.c:544 src/strip.c:568
+#: src/strip.c:596 src/strip.c:620
#, c-format
msgid "cannot create new file '%s': %s"
msgstr ""
-#: src/strip.c:634
+#: src/strip.c:686
#, c-format
msgid "illformed file '%s'"
msgstr ""
-#: src/strip.c:968 src/strip.c:1067
+#: src/strip.c:696
+#, fuzzy, c-format
+msgid "Cannot remove allocated section '%s'"
+msgstr "konnte Abschnittsdaten nicht holen: %s"
+
+#: src/strip.c:705
+#, fuzzy, c-format
+msgid "Cannot both keep and remove section '%s'"
+msgstr "Konnte Archiv '%s' nicht öffnen"
+
+#: src/strip.c:1061 src/strip.c:1160
#, c-format
msgid "while generating output file: %s"
msgstr ""
-#: src/strip.c:1033 src/strip.c:2071
+#: src/strip.c:1126 src/strip.c:2208
#, c-format
msgid "%s: error while creating ELF header: %s"
msgstr ""
-#: src/strip.c:1050
+#: src/strip.c:1143
#, c-format
msgid "while preparing output for '%s'"
msgstr ""
-#: src/strip.c:1108 src/strip.c:1171
+#: src/strip.c:1205 src/strip.c:1268
#, c-format
msgid "while create section header section: %s"
msgstr ""
-#: src/strip.c:1117
+#: src/strip.c:1214
#, c-format
msgid "cannot allocate section data: %s"
msgstr ""
-#: src/strip.c:1183
+#: src/strip.c:1280
#, c-format
msgid "while create section header string table: %s"
msgstr ""
-#: src/strip.c:1861
+#: src/strip.c:1287
+#, c-format
+msgid "no memory to create section header string table"
+msgstr ""
+
+#: src/strip.c:1497
+#, c-format
+msgid "Cannot remove symbol [%zd] from allocated symbol table [%zd]"
+msgstr ""
+
+#: src/strip.c:1994
#, fuzzy, c-format
msgid "bad relocation"
msgstr "Relocations anzeigen"
-#: src/strip.c:1982 src/strip.c:2095
+#: src/strip.c:2119 src/strip.c:2232
#, c-format
msgid "while writing '%s': %s"
msgstr ""
-#: src/strip.c:1993
+#: src/strip.c:2130
#, c-format
msgid "while creating '%s'"
msgstr ""
-#: src/strip.c:2016
+#: src/strip.c:2153
#, c-format
msgid "while computing checksum for debug information"
msgstr ""
-#: src/strip.c:2080
+#: src/strip.c:2217
#, c-format
msgid "%s: error while reading the file: %s"
msgstr ""
-#: src/strip.c:2120 src/strip.c:2140
+#: src/strip.c:2257 src/strip.c:2277
#, fuzzy, c-format
msgid "while writing '%s'"
msgstr "beim Schliessen von '%s'"
-#: src/strip.c:2177 src/strip.c:2184
+#: src/strip.c:2314 src/strip.c:2321
#, c-format
msgid "error while finishing '%s': %s"
msgstr ""
-#: src/strip.c:2201 src/strip.c:2273
+#: src/strip.c:2338 src/strip.c:2414
#, c-format
msgid "cannot set access and modification date of '%s'"
msgstr ""
-#: src/unstrip.c:69
+#: src/unstrip.c:70
msgid "Match MODULE against file names, not module names"
msgstr ""
-#: src/unstrip.c:70
+#: src/unstrip.c:71
msgid "Silently skip unfindable files"
msgstr ""
-#: src/unstrip.c:73
+#: src/unstrip.c:74
msgid "Place output into FILE"
msgstr ""
-#: src/unstrip.c:75
+#: src/unstrip.c:76
msgid "Create multiple output files under DIRECTORY"
msgstr ""
-#: src/unstrip.c:76
+#: src/unstrip.c:77
msgid "Use module rather than file names"
msgstr ""
-#: src/unstrip.c:78
+#: src/unstrip.c:79
msgid "Create output for modules that have no separate debug information"
msgstr ""
-#: src/unstrip.c:81
+#: src/unstrip.c:82
msgid "Apply relocations to section contents in ET_REL files"
msgstr ""
-#: src/unstrip.c:83
+#: src/unstrip.c:84
msgid "Only list module and file names, build IDs"
msgstr ""
-#: src/unstrip.c:85
+#: src/unstrip.c:86
msgid "Force combining files even if some ELF headers don't seem to match"
msgstr ""
-#: src/unstrip.c:129
+#: src/unstrip.c:130
#, c-format
msgid "-d option specified twice"
msgstr "Option -d zweimal angegeben"
-#: src/unstrip.c:164
+#: src/unstrip.c:165
#, c-format
msgid "only one of -o or -d allowed"
msgstr "nur entweder -o oder -d erlaubt"
-#: src/unstrip.c:173
+#: src/unstrip.c:174
#, c-format
msgid "-n cannot be used with explicit files or -o or -d"
msgstr "-n kann nicht mit expliziten Dateien oder -o oder -d verwendet werden"
-#: src/unstrip.c:188
+#: src/unstrip.c:189
#, c-format
msgid "output directory '%s'"
msgstr "Ausgabeverzeichnis '%s'"
-#: src/unstrip.c:197
+#: src/unstrip.c:198
#, c-format
msgid "exactly two file arguments are required"
msgstr "genau zwei Datei-Argumente werden benötigt"
-#: src/unstrip.c:203
+#: src/unstrip.c:204
#, c-format
msgid "-m, -a, -R, and -i options not allowed with explicit files"
msgstr ""
-#: src/unstrip.c:216
+#: src/unstrip.c:217
#, c-format
msgid "-o or -d is required when using implicit files"
msgstr ""
-#: src/unstrip.c:252
+#: src/unstrip.c:240
#, c-format
msgid "cannot create ELF header: %s"
msgstr ""
-#: src/unstrip.c:257
+#: src/unstrip.c:245
#, c-format
msgid "cannot copy ELF header: %s"
msgstr ""
-#: src/unstrip.c:261 src/unstrip.c:1939 src/unstrip.c:1982
+#: src/unstrip.c:249 src/unstrip.c:1933 src/unstrip.c:1976
#, fuzzy, c-format
msgid "cannot get number of program headers: %s"
msgstr "konnte Programm-Kopf nicht erstellen: %s"
-#: src/unstrip.c:266 src/unstrip.c:1943
+#: src/unstrip.c:254 src/unstrip.c:1937
#, c-format
msgid "cannot create program headers: %s"
msgstr "konnte Programm-Kopf nicht erstellen: %s"
-#: src/unstrip.c:272
+#: src/unstrip.c:260
#, c-format
msgid "cannot copy program header: %s"
msgstr "konnte Programm-Kopf nicht kopieren: %s"
-#: src/unstrip.c:282
+#: src/unstrip.c:270
#, c-format
msgid "cannot copy section header: %s"
msgstr ""
-#: src/unstrip.c:285 src/unstrip.c:1576
+#: src/unstrip.c:273 src/unstrip.c:1568
#, c-format
msgid "cannot get section data: %s"
msgstr "konnte Abschnittsdaten nicht holen: %s"
-#: src/unstrip.c:287 src/unstrip.c:1578
+#: src/unstrip.c:275 src/unstrip.c:1570
#, c-format
msgid "cannot copy section data: %s"
msgstr "konnte Abschnittsdaten nicht kopieren: %s"
-#: src/unstrip.c:311
+#: src/unstrip.c:299
#, c-format
msgid "cannot create directory '%s'"
msgstr "konnte Verzeichnis nicht erstellen: %s"
-#: src/unstrip.c:383 src/unstrip.c:803 src/unstrip.c:1610
+#: src/unstrip.c:371 src/unstrip.c:791 src/unstrip.c:1602
#, c-format
msgid "cannot get symbol table entry: %s"
msgstr "konnte Eintrag aus der Symboltabelle nicht holen: %s"
-#: src/unstrip.c:399 src/unstrip.c:620 src/unstrip.c:641 src/unstrip.c:653
-#: src/unstrip.c:1631 src/unstrip.c:1805 src/unstrip.c:1829
+#: src/unstrip.c:387 src/unstrip.c:608 src/unstrip.c:629 src/unstrip.c:641
+#: src/unstrip.c:1623 src/unstrip.c:1799 src/unstrip.c:1823
#, c-format
msgid "cannot update symbol table: %s"
msgstr "konnte Symboltabelle nicht aktualisieren: %s"
-#: src/unstrip.c:409
+#: src/unstrip.c:397
#, c-format
msgid "cannot update section header: %s"
msgstr ""
-#: src/unstrip.c:448 src/unstrip.c:459
+#: src/unstrip.c:436 src/unstrip.c:447
#, c-format
msgid "cannot update relocation: %s"
msgstr ""
-#: src/unstrip.c:547
+#: src/unstrip.c:535
#, c-format
msgid "cannot get symbol version: %s"
msgstr ""
-#: src/unstrip.c:560
+#: src/unstrip.c:548
#, c-format
msgid "unexpected section type in [%zu] with sh_link to symtab"
msgstr ""
-#: src/unstrip.c:809
+#: src/unstrip.c:797
#, fuzzy, c-format
msgid "invalid string offset in symbol [%zu]"
msgstr "ungültiger Offset %zu für Symbol %s"
-#: src/unstrip.c:967 src/unstrip.c:1313
+#: src/unstrip.c:955 src/unstrip.c:1305
#, fuzzy, c-format
msgid "cannot read section [%zu] name: %s"
msgstr "konnte Abschnittsdaten nicht holen: %s"
-#: src/unstrip.c:1008 src/unstrip.c:1027 src/unstrip.c:1062
+#: src/unstrip.c:996 src/unstrip.c:1015 src/unstrip.c:1053
#, c-format
msgid "cannot read '.gnu.prelink_undo' section: %s"
msgstr ""
-#: src/unstrip.c:1048
-#, c-format
-msgid "invalid contents in '%s' section"
-msgstr ""
-
-#: src/unstrip.c:1054
+#: src/unstrip.c:1033
#, c-format
msgid "overflow with shnum = %zu in '%s' section"
msgstr ""
-#: src/unstrip.c:1108 src/unstrip.c:1433
+#: src/unstrip.c:1044
+#, c-format
+msgid "invalid contents in '%s' section"
+msgstr ""
+
+#: src/unstrip.c:1099 src/unstrip.c:1427
#, fuzzy, c-format
msgid "cannot find matching section for [%zu] '%s'"
msgstr "konnte Abschnittsdaten nicht holen: %s"
-#: src/unstrip.c:1233 src/unstrip.c:1248 src/unstrip.c:1514 src/unstrip.c:1766
+#: src/unstrip.c:1224 src/unstrip.c:1239 src/unstrip.c:1506 src/unstrip.c:1758
#, c-format
msgid "cannot add section name to string table: %s"
msgstr ""
-#: src/unstrip.c:1257
+#: src/unstrip.c:1248
#, c-format
msgid "cannot update section header string table data: %s"
msgstr ""
-#: src/unstrip.c:1284 src/unstrip.c:1288
+#: src/unstrip.c:1276 src/unstrip.c:1280
#, c-format
msgid "cannot get section header string table section index: %s"
msgstr ""
-#: src/unstrip.c:1292 src/unstrip.c:1296 src/unstrip.c:1529
+#: src/unstrip.c:1284 src/unstrip.c:1288 src/unstrip.c:1521
#, c-format
msgid "cannot get section count: %s"
msgstr ""
-#: src/unstrip.c:1299
+#: src/unstrip.c:1291
#, c-format
msgid "more sections in stripped file than debug file -- arguments reversed?"
msgstr ""
-#: src/unstrip.c:1358 src/unstrip.c:1448
+#: src/unstrip.c:1350 src/unstrip.c:1442
#, c-format
msgid "cannot read section header string table: %s"
msgstr ""
-#: src/unstrip.c:1508
+#: src/unstrip.c:1500
#, c-format
msgid "cannot add new section: %s"
msgstr ""
-#: src/unstrip.c:1618
+#: src/unstrip.c:1610
#, fuzzy, c-format
msgid "symbol [%zu] has invalid section index"
msgstr "ungültiger Abschnittsindex"
-#: src/unstrip.c:1900
+#: src/unstrip.c:1894
#, fuzzy, c-format
msgid "cannot read section data: %s"
msgstr "konnte Abschnittsdaten nicht holen: %s"
-#: src/unstrip.c:1921
+#: src/unstrip.c:1915
#, c-format
msgid "cannot get ELF header: %s"
msgstr ""
-#: src/unstrip.c:1953
+#: src/unstrip.c:1923
+#, c-format
+msgid "cannot update ELF header: %s"
+msgstr ""
+
+#: src/unstrip.c:1947
#, c-format
msgid "cannot update program header: %s"
msgstr "konnte Programm-Kopf nicht aktualisieren: %s"
-#: src/unstrip.c:1958 src/unstrip.c:2040
+#: src/unstrip.c:1952 src/unstrip.c:2034
#, c-format
msgid "cannot write output file: %s"
msgstr ""
-#: src/unstrip.c:2009
+#: src/unstrip.c:2003
#, c-format
msgid "DWARF data not adjusted for prelinking bias; consider prelink -u"
msgstr ""
-#: src/unstrip.c:2012
+#: src/unstrip.c:2006
#, c-format
msgid ""
"DWARF data in '%s' not adjusted for prelinking bias; consider prelink -u"
msgstr ""
-#: src/unstrip.c:2031 src/unstrip.c:2082 src/unstrip.c:2094 src/unstrip.c:2180
+#: src/unstrip.c:2025 src/unstrip.c:2076 src/unstrip.c:2088 src/unstrip.c:2174
#, c-format
msgid "cannot create ELF descriptor: %s"
msgstr ""
-#: src/unstrip.c:2073
+#: src/unstrip.c:2067
msgid "WARNING: "
msgstr ""
-#: src/unstrip.c:2075
+#: src/unstrip.c:2069
msgid ", use --force"
msgstr ""
-#: src/unstrip.c:2098
+#: src/unstrip.c:2092
msgid "ELF header identification (e_ident) different"
msgstr ""
-#: src/unstrip.c:2101
+#: src/unstrip.c:2095
msgid "ELF header type (e_type) different"
msgstr ""
-#: src/unstrip.c:2104
+#: src/unstrip.c:2098
msgid "ELF header machine type (e_machine) different"
msgstr ""
-#: src/unstrip.c:2107
+#: src/unstrip.c:2101
msgid "stripped program header (e_phnum) smaller than unstripped"
msgstr ""
-#: src/unstrip.c:2137
+#: src/unstrip.c:2131
#, c-format
msgid "cannot find stripped file for module '%s': %s"
msgstr ""
-#: src/unstrip.c:2141
+#: src/unstrip.c:2135
#, c-format
msgid "cannot open stripped file '%s' for module '%s': %s"
msgstr ""
-#: src/unstrip.c:2156
+#: src/unstrip.c:2150
#, c-format
msgid "cannot find debug file for module '%s': %s"
msgstr ""
-#: src/unstrip.c:2160
+#: src/unstrip.c:2154
#, c-format
msgid "cannot open debug file '%s' for module '%s': %s"
msgstr ""
-#: src/unstrip.c:2173
+#: src/unstrip.c:2167
#, c-format
msgid "module '%s' file '%s' is not stripped"
msgstr ""
-#: src/unstrip.c:2204
+#: src/unstrip.c:2198
#, c-format
msgid "cannot cache section addresses for module '%s': %s"
msgstr ""
-#: src/unstrip.c:2337
+#: src/unstrip.c:2331
#, c-format
msgid "no matching modules found"
msgstr "kein passendes Modul gefunden"
-#: src/unstrip.c:2346
+#: src/unstrip.c:2340
#, c-format
msgid "matched more than one module"
msgstr "mehr als ein passendes Modul"
-#: src/unstrip.c:2390
+#: src/unstrip.c:2384
msgid ""
"STRIPPED-FILE DEBUG-FILE\n"
"[MODULE...]"
msgstr ""
-#: src/unstrip.c:2391
+#: src/unstrip.c:2385
msgid ""
-"Combine stripped files with separate symbols and debug information.\vThe "
-"first form puts the result in DEBUG-FILE if -o was not given.\n"
+"Combine stripped files with separate symbols and debug information.\n"
+"\n"
+"The first form puts the result in DEBUG-FILE if -o was not given.\n"
"\n"
"MODULE arguments give file name patterns matching modules to process.\n"
"With -f these match the file name of the main (stripped) file (slashes are "
@@ -6667,7 +6353,7 @@
"was found, or . if FILE contains the debug information."
msgstr ""
-#: tests/backtrace.c:427
+#: tests/backtrace.c:442
msgid "Run executable"
msgstr ""
@@ -6679,6 +6365,113 @@
msgid "Show instances of inlined functions"
msgstr ""
+#~ msgid "%s+%#<PRIx64> <%s+%#<PRIx64>>"
+#~ msgstr "%s+%#<PRIx64> <%s+%#<PRIx64>>"
+
+#~ msgid "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
+#~ msgstr "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
+
+#~ msgid "%#<PRIx64> <%s+%#<PRIx64>>"
+#~ msgstr "%#<PRIx64> <%s+%#<PRIx64>>"
+
+#~ msgid "%#0*<PRIx64> <%s+%#<PRIx64>>"
+#~ msgstr "%#0*<PRIx64> <%s+%#<PRIx64>>"
+
+#~ msgid "%s+%#<PRIx64> <%s>"
+#~ msgstr "%s+%#<PRIx64> <%s>"
+
+#~ msgid "%s+%#0*<PRIx64> <%s>"
+#~ msgstr "%s+%#0*<PRIx64> <%s>"
+
+#~ msgid "%#<PRIx64> <%s>"
+#~ msgstr "%#<PRIx64> <%s>"
+
+#~ msgid "%#0*<PRIx64> <%s>"
+#~ msgstr "%#0*<PRIx64> <%s>"
+
+#~ msgid "%s+%#<PRIx64>"
+#~ msgstr "%s+%#<PRIx64>"
+
+#~ msgid "%s+%#0*<PRIx64>"
+#~ msgstr "%s+%#0*<PRIx64>"
+
+#, fuzzy
+#~ msgid " %s..%s (%<PRIx64>)\n"
+#~ msgstr " %s: %<PRId64>\n"
+
+#, fuzzy
+#~ msgid " %s..%s\n"
+#~ msgstr " [%6tx] %s..%s\n"
+
+#~ msgid " [%6tx] %s..%s\n"
+#~ msgstr " [%6tx] %s..%s\n"
+
+#~ msgid " %s..%s\n"
+#~ msgstr " %s..%s\n"
+
+#~ msgid " [%6tx] %s..%s"
+#~ msgstr " [%6tx] %s..%s"
+
+#~ msgid " %s..%s"
+#~ msgstr " %s..%s"
+
+#~ msgid "Written by %s.\n"
+#~ msgstr "Geschrieben von %s.\n"
+
+#~ msgid "FILE"
+#~ msgstr "DATEI"
+
+#~ msgid "Start a group."
+#~ msgstr "Eine Gruppe starten."
+
+#~ msgid "End a group."
+#~ msgstr "Eine Gruppe beenden."
+
+#~ msgid "PATH"
+#~ msgstr "PFAD"
+
+#~ msgid "Same as --whole-archive."
+#~ msgstr "Genau wie --whole-archive."
+
+#~ msgid "ADDRESS"
+#~ msgstr "ADRESSE"
+
+#~ msgid "[FILE]..."
+#~ msgstr "[DATEI]..."
+
+#~ msgid "At least one input file needed"
+#~ msgstr "Mindestens eine Eingabedatei benötigt"
+
+#~ msgid "-( without matching -)"
+#~ msgstr "-( ohne Übereinstimmung -)"
+
+#~ msgid "only one option of -G and -r is allowed"
+#~ msgstr "nur eine Option aus -G und -r erlaubt"
+
+#~ msgid "More than one output file name given."
+#~ msgstr "Mehr als ein Name der Ausgabedatei angegeben."
+
+#~ msgid "-) without matching -("
+#~ msgstr "-) ohne Übereinstimmung -("
+
+#~ msgid "unknown option '-%c %s'"
+#~ msgstr "unbekannte Option '-%c %s'"
+
+#~ msgid "undefined symbol `%s' in %s"
+#~ msgstr "undefiniertes Symbol `%s' in %s"
+
+#~ msgid "cannot create versioning section: %s"
+#~ msgstr "konnte Versionierungsabschnitt nicht erstellen: %s"
+
+#~ msgid "cannot create versioning data: %s"
+#~ msgstr "konnte Versionierungsdaten nicht erstellen: %s"
+
+#~ msgid "cannot create program header: %s"
+#~ msgstr "konnte Programm-Kopf nicht erstellen: %s"
+
+#~ msgid "default visibility set as local and global"
+#~ msgstr "Standard-Sichtbarkeit auf lokal und global gesetzt"
+
#, fuzzy
#~ msgid "cannot attach to core"
#~ msgstr "Kann Suchbaum nicht erstellen"
@@ -6695,10 +6488,6 @@
#~ msgid "unknown user attribute %hx"
#~ msgstr "unbekanntes Benutzer-Attribut %hx"
-#, fuzzy
-#~ msgid "unknown form %#<PRIx64>"
-#~ msgstr "unbekannte Form %<PRIx64>"
-
#~ msgid ""
#~ "\n"
#~ "\n"
diff --git a/po/es.po b/po/es.po
index ba58653..63a024e 100644
--- a/po/es.po
+++ b/po/es.po
@@ -9,8 +9,8 @@
msgid ""
msgstr ""
"Project-Id-Version: elfutils.master.es\n"
-"Report-Msgid-Bugs-To: http://bugzilla.redhat.com/\n"
-"POT-Creation-Date: 2016-01-11 08:48+0100\n"
+"Report-Msgid-Bugs-To: https://sourceware.org/bugzilla/\n"
+"POT-Creation-Date: 2018-06-29 20:47+0200\n"
"PO-Revision-Date: 2011-01-10 15:17-0300\n"
"Last-Translator: Claudio Rodrigo Pereyra Diaz <claudiorodrigo@pereyradiaz."
"com.ar>\n"
@@ -39,29 +39,41 @@
" - 'auto', 'tty', 'if-tty'\n"
msgstr ""
-#: lib/color.c:190 src/objdump.c:738
+#: lib/color.c:190 src/objdump.c:727
#, fuzzy, c-format
msgid "cannot allocate memory"
msgstr "No se puede asignar sección PLT: %s"
-#: lib/xmalloc.c:53 lib/xmalloc.c:66 lib/xmalloc.c:78 src/readelf.c:3282
-#: src/readelf.c:3669 src/readelf.c:8416 src/unstrip.c:2233 src/unstrip.c:2438
+#: lib/printversion.c:40
+#, fuzzy, c-format
+msgid ""
+"Copyright (C) %s The elfutils developers <%s>.\n"
+"This is free software; see the source for copying conditions. There is NO\n"
+"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
+msgstr ""
+"Copyright (C) %s Red Hat, Inc.\n"
+"El siguiente es un software libre; consulte el código para conocer las "
+"condiciones de copiado. NO tiene\n"
+"garantía, ni siquiera para SU COMERCIALIZACIÓN o PARA SER USADO CON UN FIN "
+"DETERMINADO.\n"
+
+#: lib/xmalloc.c:53 lib/xmalloc.c:66 lib/xmalloc.c:78 src/readelf.c:3395
+#: src/readelf.c:11196 src/unstrip.c:2227 src/unstrip.c:2433
#, c-format
msgid "memory exhausted"
msgstr "memoria agotada"
-#: libasm/asm_error.c:65 libdw/dwarf_error.c:58 libdwfl/libdwflP.h:53
+#: libasm/asm_error.c:65 libdw/dwarf_error.c:57 libdwfl/libdwflP.h:50
#: libelf/elf_error.c:60
msgid "no error"
msgstr "ningún error"
-#: libasm/asm_error.c:66 libdw/dwarf_error.c:68 libdwfl/libdwflP.h:55
+#: libasm/asm_error.c:66 libdw/dwarf_error.c:67 libdwfl/libdwflP.h:52
#: libelf/elf_error.c:91
msgid "out of memory"
msgstr "memoria agotada"
-#: libasm/asm_error.c:67 src/ldgeneric.c:2677
-#, c-format
+#: libasm/asm_error.c:67
msgid "cannot create output file"
msgstr "no se puede crear el archivo de salida"
@@ -73,8 +85,7 @@
msgid "cannot change mode of output file"
msgstr "no sepuede cambiar modo de archivo de salida"
-#: libasm/asm_error.c:70 src/ldgeneric.c:6990
-#, c-format
+#: libasm/asm_error.c:70
msgid "cannot rename output file"
msgstr "no se puede renombrar el archivo de salida"
@@ -94,177 +105,218 @@
msgid "no backend support available"
msgstr "No hay soporte de segundo plano"
-#: libasm/asm_error.c:83 libdw/dwarf_error.c:59 libdwfl/libdwflP.h:54
+#: libasm/asm_error.c:83 libdw/dwarf_error.c:58 libdwfl/libdwflP.h:51
#: libelf/elf_error.c:63
msgid "unknown error"
msgstr "error desconocido"
-#: libdw/dwarf_error.c:60
+#: libdw/dwarf_error.c:59
msgid "invalid access"
msgstr "Acceso inválido"
-#: libdw/dwarf_error.c:61
+#: libdw/dwarf_error.c:60
msgid "no regular file"
msgstr "no es un archivo regular"
-#: libdw/dwarf_error.c:62
+#: libdw/dwarf_error.c:61
msgid "I/O error"
msgstr "Error de E/S"
-#: libdw/dwarf_error.c:63
+#: libdw/dwarf_error.c:62
msgid "invalid ELF file"
msgstr "Archivo ELF inválido"
-#: libdw/dwarf_error.c:64
+#: libdw/dwarf_error.c:63
msgid "no DWARF information"
msgstr "Sin información de DWARF"
-#: libdw/dwarf_error.c:65
+#: libdw/dwarf_error.c:64
msgid "cannot decompress DWARF"
msgstr ""
-#: libdw/dwarf_error.c:66
+#: libdw/dwarf_error.c:65
msgid "no ELF file"
msgstr "No hay archivo ELF"
-#: libdw/dwarf_error.c:67
+#: libdw/dwarf_error.c:66
msgid "cannot get ELF header"
msgstr "no se puede obtener el encabezamiento ELF"
-#: libdw/dwarf_error.c:69
+#: libdw/dwarf_error.c:68
msgid "not implemented"
msgstr "sin implementar"
-#: libdw/dwarf_error.c:70 libelf/elf_error.c:107 libelf/elf_error.c:155
+#: libdw/dwarf_error.c:69 libelf/elf_error.c:111 libelf/elf_error.c:159
msgid "invalid command"
msgstr "comando inválido"
-#: libdw/dwarf_error.c:71
+#: libdw/dwarf_error.c:70
msgid "invalid version"
msgstr "versión inválida"
-#: libdw/dwarf_error.c:72
+#: libdw/dwarf_error.c:71
msgid "invalid file"
msgstr "Archivo inválido"
-#: libdw/dwarf_error.c:73
+#: libdw/dwarf_error.c:72
msgid "no entries found"
msgstr "No se hallaron entradas"
-#: libdw/dwarf_error.c:74
+#: libdw/dwarf_error.c:73
msgid "invalid DWARF"
msgstr "DWARF inválido"
-#: libdw/dwarf_error.c:75
+#: libdw/dwarf_error.c:74
msgid "no string data"
msgstr "no hay datos de cadena"
+#: libdw/dwarf_error.c:75
+#, fuzzy
+msgid ".debug_str section missing"
+msgstr ".debug_ranges section faltante"
+
#: libdw/dwarf_error.c:76
+#, fuzzy
+msgid ".debug_line_str section missing"
+msgstr ".debug_line section faltante"
+
+#: libdw/dwarf_error.c:77
+#, fuzzy
+msgid ".debug_str_offsets section missing"
+msgstr ".debug_ranges section faltante"
+
+#: libdw/dwarf_error.c:78
msgid "no address value"
msgstr "no hay valor de dirección"
-#: libdw/dwarf_error.c:77
+#: libdw/dwarf_error.c:79
msgid "no constant value"
msgstr "no hay valor constante"
-#: libdw/dwarf_error.c:78
+#: libdw/dwarf_error.c:80
msgid "no reference value"
msgstr "no hay valor de referencia"
-#: libdw/dwarf_error.c:79
+#: libdw/dwarf_error.c:81
msgid "invalid reference value"
msgstr "valor de la referencia inválido"
-#: libdw/dwarf_error.c:80
+#: libdw/dwarf_error.c:82
msgid ".debug_line section missing"
msgstr ".debug_line section faltante"
-#: libdw/dwarf_error.c:81
+#: libdw/dwarf_error.c:83
msgid "invalid .debug_line section"
msgstr ".debug_line section inválida"
-#: libdw/dwarf_error.c:82
+#: libdw/dwarf_error.c:84
msgid "debug information too big"
msgstr "información de depuración muy grande"
-#: libdw/dwarf_error.c:83
+#: libdw/dwarf_error.c:85
msgid "invalid DWARF version"
msgstr "versión DWARF inválida"
-#: libdw/dwarf_error.c:84
+#: libdw/dwarf_error.c:86
msgid "invalid directory index"
msgstr "Índice de directorio inválido"
-#: libdw/dwarf_error.c:85 libdwfl/libdwflP.h:74
+#: libdw/dwarf_error.c:87 libdwfl/libdwflP.h:71
msgid "address out of range"
msgstr "dirección fuera de rango"
-#: libdw/dwarf_error.c:86
-msgid "no location list value"
+#: libdw/dwarf_error.c:88
+#, fuzzy
+msgid ".debug_loc section missing"
+msgstr ".debug_line section faltante"
+
+#: libdw/dwarf_error.c:89
+#, fuzzy
+msgid ".debug_loclists section missing"
+msgstr ".debug_line section faltante"
+
+#: libdw/dwarf_error.c:90
+#, fuzzy
+msgid "not a location list value"
msgstr "valor de lista sin ubicación"
-#: libdw/dwarf_error.c:87
+#: libdw/dwarf_error.c:91
msgid "no block data"
msgstr "sin datos de bloque "
-#: libdw/dwarf_error.c:88
+#: libdw/dwarf_error.c:92
msgid "invalid line index"
msgstr "Índice de línea inválido"
-#: libdw/dwarf_error.c:89
+#: libdw/dwarf_error.c:93
msgid "invalid address range index"
msgstr "Índice de dirección de rango inválido"
-#: libdw/dwarf_error.c:90 libdwfl/libdwflP.h:75
+#: libdw/dwarf_error.c:94 libdwfl/libdwflP.h:72
msgid "no matching address range"
msgstr "dirección de rango no coincidente"
-#: libdw/dwarf_error.c:91
+#: libdw/dwarf_error.c:95
msgid "no flag value"
msgstr "sin valor de bandera"
-#: libdw/dwarf_error.c:92 libelf/elf_error.c:232
+#: libdw/dwarf_error.c:96 libelf/elf_error.c:236
msgid "invalid offset"
msgstr "desplazamiento inválido"
-#: libdw/dwarf_error.c:93
+#: libdw/dwarf_error.c:97
msgid ".debug_ranges section missing"
msgstr ".debug_ranges section faltante"
-#: libdw/dwarf_error.c:94
+#: libdw/dwarf_error.c:98
+#, fuzzy
+msgid ".debug_rnglists section missing"
+msgstr ".debug_ranges section faltante"
+
+#: libdw/dwarf_error.c:99
msgid "invalid CFI section"
msgstr "sección CFI inválida"
-#: libdw/dwarf_error.c:95
+#: libdw/dwarf_error.c:100
msgid "no alternative debug link found"
msgstr ""
-#: libdw/dwarf_error.c:96
+#: libdw/dwarf_error.c:101
#, fuzzy
msgid "invalid opcode"
msgstr "operando inválido"
-#: libdw/dwarf_error.c:97
+#: libdw/dwarf_error.c:102
msgid "not a CU (unit) DIE"
msgstr ""
-#: libdwfl/argp-std.c:46 src/stack.c:642 src/unstrip.c:2380
+#: libdw/dwarf_error.c:103
+#, fuzzy
+msgid "unknown language code"
+msgstr "código operativo desconocido "
+
+#: libdw/dwarf_error.c:104
+#, fuzzy
+msgid ".debug_addr section missing"
+msgstr ".debug_ranges section faltante"
+
+#: libdwfl/argp-std.c:50 src/stack.c:639 src/unstrip.c:2374
msgid "Input selection options:"
msgstr "Opciones de selección de entrada:"
-#: libdwfl/argp-std.c:47
+#: libdwfl/argp-std.c:51
msgid "Find addresses in FILE"
msgstr "Hallar direcciones en FICHERO"
-#: libdwfl/argp-std.c:49
+#: libdwfl/argp-std.c:53
msgid "Find addresses from signatures found in COREFILE"
msgstr "Buscar direcciones desde firmas encontradas en COREFILE"
-#: libdwfl/argp-std.c:51
+#: libdwfl/argp-std.c:55
msgid "Find addresses in files mapped into process PID"
msgstr "Busca direcciones en archivos mapeados sobre procesos PID"
-#: libdwfl/argp-std.c:53
+#: libdwfl/argp-std.c:57
msgid ""
"Find addresses in files mapped as read from FILE in Linux /proc/PID/maps "
"format"
@@ -272,201 +324,202 @@
"Busca direcciones en archivos asignados como leídos desde FILE en formato "
"Linux /proc/PID/maps"
-#: libdwfl/argp-std.c:55
+#: libdwfl/argp-std.c:59
msgid "Find addresses in the running kernel"
msgstr "Busca direcciones en el kernel que está ejecutándose"
-#: libdwfl/argp-std.c:57
+#: libdwfl/argp-std.c:61
msgid "Kernel with all modules"
msgstr "Kernel con todos los módulos"
-#: libdwfl/argp-std.c:59 src/stack.c:649
+#: libdwfl/argp-std.c:63 src/stack.c:646
msgid "Search path for separate debuginfo files"
msgstr "Ruta de búsqueda para archivos debugingfo independientes"
-#: libdwfl/argp-std.c:157
+#: libdwfl/argp-std.c:164
msgid "only one of -e, -p, -k, -K, or --core allowed"
msgstr "Sólo uno de -e, -p, -k, -K, ó --core está permitido"
-#: libdwfl/argp-std.c:230
+#: libdwfl/argp-std.c:237
msgid "cannot load kernel symbols"
msgstr "No se pueden cargar símbolos de kernel"
-#: libdwfl/argp-std.c:234
+#. Non-fatal to have no modules since we do have the kernel.
+#: libdwfl/argp-std.c:241
msgid "cannot find kernel modules"
msgstr "no se pueden hallar módulos de kernel"
-#: libdwfl/argp-std.c:251
+#: libdwfl/argp-std.c:258
msgid "cannot find kernel or modules"
msgstr "imposible encontrar kernel o módulos"
-#: libdwfl/argp-std.c:290
+#: libdwfl/argp-std.c:297
#, c-format
msgid "cannot read ELF core file: %s"
msgstr "No se puede leer archivo core ELF: %s"
-#: libdwfl/argp-std.c:313
+#: libdwfl/argp-std.c:320
#, fuzzy
msgid "Not enough memory"
msgstr "memoria agotada"
-#: libdwfl/argp-std.c:323
+#: libdwfl/argp-std.c:330
msgid "No modules recognized in core file"
msgstr "No hay módulos reconocidos en el archivo core"
-#: libdwfl/libdwflP.h:56
+#: libdwfl/libdwflP.h:53
msgid "See errno"
msgstr "Ve errno"
-#: libdwfl/libdwflP.h:57
+#: libdwfl/libdwflP.h:54
msgid "See elf_errno"
msgstr "Ver elf_errno"
-#: libdwfl/libdwflP.h:58
+#: libdwfl/libdwflP.h:55
msgid "See dwarf_errno"
msgstr "Ver dwarf_errno"
-#: libdwfl/libdwflP.h:59
+#: libdwfl/libdwflP.h:56
msgid "See ebl_errno (XXX missing)"
msgstr "Ver ebl_errno (no se encuentra XXX)"
-#: libdwfl/libdwflP.h:60
+#: libdwfl/libdwflP.h:57
msgid "gzip decompression failed"
msgstr "falló la descompresión gzip"
-#: libdwfl/libdwflP.h:61
+#: libdwfl/libdwflP.h:58
msgid "bzip2 decompression failed"
msgstr "falló la descompresión bzip2"
-#: libdwfl/libdwflP.h:62
+#: libdwfl/libdwflP.h:59
msgid "LZMA decompression failed"
msgstr "falló la descompresión LZMA"
-#: libdwfl/libdwflP.h:63
+#: libdwfl/libdwflP.h:60
msgid "no support library found for machine"
msgstr "no se ha encontrado una biblioteca de soporte para la máquina"
-#: libdwfl/libdwflP.h:64
+#: libdwfl/libdwflP.h:61
msgid "Callbacks missing for ET_REL file"
msgstr "No se encuentran rellamadas para el archivo ET_REL"
-#: libdwfl/libdwflP.h:65
+#: libdwfl/libdwflP.h:62
msgid "Unsupported relocation type"
msgstr "Tipo de reubicación no soportada"
-#: libdwfl/libdwflP.h:66
+#: libdwfl/libdwflP.h:63
msgid "r_offset is bogus"
msgstr "r_offset se encuentra inutilizable"
-#: libdwfl/libdwflP.h:67 libelf/elf_error.c:111 libelf/elf_error.c:171
+#: libdwfl/libdwflP.h:64 libelf/elf_error.c:115 libelf/elf_error.c:175
msgid "offset out of range"
msgstr "desplazamiento fuera de rango"
-#: libdwfl/libdwflP.h:68
+#: libdwfl/libdwflP.h:65
msgid "relocation refers to undefined symbol"
msgstr "la reubicación hace referencia a un símbolo no definido"
-#: libdwfl/libdwflP.h:69
+#: libdwfl/libdwflP.h:66
msgid "Callback returned failure"
msgstr "La rellamada devolvió un fallo"
-#: libdwfl/libdwflP.h:70
+#: libdwfl/libdwflP.h:67
msgid "No DWARF information found"
msgstr "No se ha encontrado una información DWARF"
-#: libdwfl/libdwflP.h:71
+#: libdwfl/libdwflP.h:68
msgid "No symbol table found"
msgstr "No se ha encontrado una tabla simbólica"
-#: libdwfl/libdwflP.h:72
+#: libdwfl/libdwflP.h:69
msgid "No ELF program headers"
msgstr "No existen encabezados de programa ELF"
-#: libdwfl/libdwflP.h:73
+#: libdwfl/libdwflP.h:70
msgid "address range overlaps an existing module"
msgstr "el rango de dirección se superpone con un módulo existente"
-#: libdwfl/libdwflP.h:76
+#: libdwfl/libdwflP.h:73
msgid "image truncated"
msgstr "imagen truncada"
-#: libdwfl/libdwflP.h:77
+#: libdwfl/libdwflP.h:74
msgid "ELF file opened"
msgstr "Archivo ELF abierto"
-#: libdwfl/libdwflP.h:78
+#: libdwfl/libdwflP.h:75
msgid "not a valid ELF file"
msgstr "no es un archivo ELF válido"
-#: libdwfl/libdwflP.h:79
+#: libdwfl/libdwflP.h:76
msgid "cannot handle DWARF type description"
msgstr "no es posible manipular tipo de descripción DWARF"
-#: libdwfl/libdwflP.h:80
+#: libdwfl/libdwflP.h:77
msgid "ELF file does not match build ID"
msgstr "El archivo ELF no coincide con el ID construido"
-#: libdwfl/libdwflP.h:81
+#: libdwfl/libdwflP.h:78
#, fuzzy
msgid "corrupt .gnu.prelink_undo section data"
msgstr "no se puede leer sección '.gnu.prelink_undo': %s"
-#: libdwfl/libdwflP.h:82
+#: libdwfl/libdwflP.h:79
msgid "Internal error due to ebl"
msgstr ""
-#: libdwfl/libdwflP.h:83
+#: libdwfl/libdwflP.h:80
msgid "Missing data in core file"
msgstr ""
-#: libdwfl/libdwflP.h:84
+#: libdwfl/libdwflP.h:81
#, fuzzy
msgid "Invalid register"
msgstr "Parámetro inválido"
-#: libdwfl/libdwflP.h:85
+#: libdwfl/libdwflP.h:82
msgid "Error reading process memory"
msgstr ""
-#: libdwfl/libdwflP.h:86
+#: libdwfl/libdwflP.h:83
msgid "Couldn't find architecture of any ELF"
msgstr ""
-#: libdwfl/libdwflP.h:87
+#: libdwfl/libdwflP.h:84
msgid "Error parsing /proc filesystem"
msgstr ""
-#: libdwfl/libdwflP.h:88
+#: libdwfl/libdwflP.h:85
#, fuzzy
msgid "Invalid DWARF"
msgstr "DWARF inválido"
-#: libdwfl/libdwflP.h:89
+#: libdwfl/libdwflP.h:86
msgid "Unsupported DWARF"
msgstr ""
-#: libdwfl/libdwflP.h:90
+#: libdwfl/libdwflP.h:87
msgid "Unable to find more threads"
msgstr ""
-#: libdwfl/libdwflP.h:91
+#: libdwfl/libdwflP.h:88
msgid "Dwfl already has attached state"
msgstr ""
-#: libdwfl/libdwflP.h:92
+#: libdwfl/libdwflP.h:89
msgid "Dwfl has no attached state"
msgstr ""
-#: libdwfl/libdwflP.h:93
+#: libdwfl/libdwflP.h:90
msgid "Unwinding not supported for this architecture"
msgstr ""
-#: libdwfl/libdwflP.h:94
+#: libdwfl/libdwflP.h:91
#, fuzzy
msgid "Invalid argument"
msgstr "Parámetro inválido"
-#: libdwfl/libdwflP.h:95
+#: libdwfl/libdwflP.h:92
#, fuzzy
msgid "Not an ET_CORE ELF file"
msgstr "no es un archivo ELF válido"
@@ -475,14 +528,14 @@
msgid "No backend"
msgstr "No hay segundo plano (Backend)"
-#: libebl/eblcorenotetypename.c:98 libebl/eblobjecttypename.c:53
-#: libebl/eblobjnotetypename.c:69 libebl/eblosabiname.c:73
-#: libebl/eblsectionname.c:83 libebl/eblsectiontypename.c:115
-#: libebl/eblsegmenttypename.c:79
+#: libebl/eblcorenotetypename.c:100 libebl/eblobjnotetypename.c:76
+#: libebl/eblobjnotetypename.c:83 libebl/eblobjnotetypename.c:102
+#: libebl/eblosabiname.c:73 libebl/eblsectionname.c:83
+#: libebl/eblsectiontypename.c:115 libebl/eblsegmenttypename.c:79
msgid "<unknown>"
msgstr "<desconocido>"
-#: libebl/ebldynamictagname.c:101
+#: libebl/ebldynamictagname.c:103
#, c-format
msgid "<unknown>: %#<PRIx64>"
msgstr "<desconocido>: %#<PRIx64>"
@@ -532,6 +585,7 @@
msgid " Build ID: "
msgstr " Build ID: "
+#. A non-null terminated version string.
#: libebl/eblobjnote.c:152
#, c-format
msgid " Linker version: %.*s\n"
@@ -571,7 +625,7 @@
msgid "invalid size of destination operand"
msgstr "tamaño inválido del operando destino"
-#: libelf/elf_error.c:87 src/readelf.c:5473
+#: libelf/elf_error.c:87 src/readelf.c:6107
#, c-format
msgid "invalid encoding"
msgstr "codificación inválida"
@@ -581,152 +635,157 @@
msgstr "descriptor de archivo inválido"
#: libelf/elf_error.c:99
+#, fuzzy
+msgid "invalid ELF file data"
+msgstr "Archivo ELF inválido"
+
+#: libelf/elf_error.c:103
msgid "invalid operation"
msgstr "operación inválida"
-#: libelf/elf_error.c:103
+#: libelf/elf_error.c:107
msgid "ELF version not set"
msgstr "no se estableció la versión de ELF"
-#: libelf/elf_error.c:115
+#: libelf/elf_error.c:119
msgid "invalid fmag field in archive header"
msgstr "campo fmag no válido en el encabezamiento del archivo"
-#: libelf/elf_error.c:119
+#: libelf/elf_error.c:123
msgid "invalid archive file"
msgstr "fichero de archivo inválido"
-#: libelf/elf_error.c:123
+#: libelf/elf_error.c:127
msgid "descriptor is not for an archive"
msgstr "el descriptor no es de un archivo"
-#: libelf/elf_error.c:127
+#: libelf/elf_error.c:131
msgid "no index available"
msgstr "no hay índice disponible"
-#: libelf/elf_error.c:131
+#: libelf/elf_error.c:135
msgid "cannot read data from file"
msgstr "no se pueden leer los datos del archivo"
-#: libelf/elf_error.c:135
+#: libelf/elf_error.c:139
msgid "cannot write data to file"
msgstr "no se puede escribir los datos al archivo"
-#: libelf/elf_error.c:139
+#: libelf/elf_error.c:143
msgid "invalid binary class"
msgstr "clase de binario inválida"
-#: libelf/elf_error.c:143
+#: libelf/elf_error.c:147
msgid "invalid section index"
msgstr "índice de sección inválido"
-#: libelf/elf_error.c:147
+#: libelf/elf_error.c:151
msgid "invalid operand"
msgstr "operando inválido"
-#: libelf/elf_error.c:151
+#: libelf/elf_error.c:155
msgid "invalid section"
msgstr "sección inválida"
-#: libelf/elf_error.c:159
+#: libelf/elf_error.c:163
msgid "executable header not created first"
msgstr "no se ha creado primero el encabezamiento ejecutable"
-#: libelf/elf_error.c:163
+#: libelf/elf_error.c:167
msgid "file descriptor disabled"
msgstr "descriptor de archivo inhabilitada"
-#: libelf/elf_error.c:167
+#: libelf/elf_error.c:171
msgid "archive/member file descriptor mismatch"
msgstr "archivo/miembro no coincide el descriptor de archivos"
-#: libelf/elf_error.c:175
+#: libelf/elf_error.c:179
msgid "cannot manipulate null section"
msgstr "no se pudo manipular una sección nula"
-#: libelf/elf_error.c:179
+#: libelf/elf_error.c:183
msgid "data/scn mismatch"
msgstr "no coinciden los datos/scn"
-#: libelf/elf_error.c:183
+#: libelf/elf_error.c:187
msgid "invalid section header"
msgstr "encabezamiento de sección inválida"
-#: libelf/elf_error.c:187 src/readelf.c:7342 src/readelf.c:7790
-#: src/readelf.c:7891 src/readelf.c:8072
+#: libelf/elf_error.c:191 src/readelf.c:9742 src/readelf.c:10313
+#: src/readelf.c:10414 src/readelf.c:10595
#, c-format
msgid "invalid data"
msgstr "datos inválidos"
-#: libelf/elf_error.c:191
+#: libelf/elf_error.c:195
msgid "unknown data encoding"
msgstr "codificación de caracteres desconocida"
-#: libelf/elf_error.c:195
+#: libelf/elf_error.c:199
msgid "section `sh_size' too small for data"
msgstr "el tamaño de la sección `sh_size' es demasiado pequeño para los datos "
-#: libelf/elf_error.c:199
+#: libelf/elf_error.c:203
msgid "invalid section alignment"
msgstr "alineación de la sección inválida"
-#: libelf/elf_error.c:203
+#: libelf/elf_error.c:207
msgid "invalid section entry size"
msgstr "tamaño de la entrada de la sección inválida"
-#: libelf/elf_error.c:207
+#: libelf/elf_error.c:211
msgid "update() for write on read-only file"
msgstr "update() para escribir sobre archivo de sólo lectura"
-#: libelf/elf_error.c:211
+#: libelf/elf_error.c:215
msgid "no such file"
msgstr "no hay tal archivo"
-#: libelf/elf_error.c:215
+#: libelf/elf_error.c:219
msgid "only relocatable files can contain section groups"
msgstr "solo los archivos reubicables pueden contener grupos de sección"
-#: libelf/elf_error.c:220
+#: libelf/elf_error.c:224
msgid ""
"program header only allowed in executables, shared objects, and core files"
msgstr ""
"los encabezamientos de los programas solo son permitidos en archivos "
"ejecutables, archivos principales, u objetos compartidos"
-#: libelf/elf_error.c:227
+#: libelf/elf_error.c:231
msgid "file has no program header"
msgstr "el archivo no tiene encabezamiento de programa"
-#: libelf/elf_error.c:237
+#: libelf/elf_error.c:241
#, fuzzy
msgid "invalid section type"
msgstr "sección inválida"
-#: libelf/elf_error.c:242
+#: libelf/elf_error.c:246
#, fuzzy
msgid "invalid section flags"
msgstr "sección inválida"
-#: libelf/elf_error.c:247
+#: libelf/elf_error.c:251
#, fuzzy
msgid "section does not contain compressed data"
msgstr "sección [%2zu] '%s' no debe ser ejecutable\n"
-#: libelf/elf_error.c:252
+#: libelf/elf_error.c:256
msgid "section contains compressed data"
msgstr ""
-#: libelf/elf_error.c:257
+#: libelf/elf_error.c:261
#, fuzzy
msgid "unknown compression type"
msgstr "tipo desconocido"
-#: libelf/elf_error.c:262
+#: libelf/elf_error.c:266
#, fuzzy
msgid "cannot compress data"
msgstr "no pueden copiar datos de sección: %s"
-#: libelf/elf_error.c:267
+#: libelf/elf_error.c:271
#, fuzzy
msgid "cannot decompress data"
msgstr "no pueden copiar datos de sección: %s"
@@ -790,11 +849,12 @@
msgid "Print all information on one line, and indent inlines"
msgstr ""
-#: src/addr2line.c:79 src/elfcmp.c:72 src/findtextrel.c:67 src/nm.c:100
+#: src/addr2line.c:79 src/elfcmp.c:71 src/findtextrel.c:66 src/nm.c:101
#: src/strings.c:79
msgid "Miscellaneous:"
msgstr "Misceláneos:"
+#. Short description of program.
#: src/addr2line.c:87
msgid ""
"Locate source files and line information for ADDRs (in a.out by default)."
@@ -802,50 +862,27 @@
"Localizar archivos fuente e información de línea para DIRECCIONES (en a.out "
"por defecto)."
+#. Strings for arguments in help texts.
#: src/addr2line.c:91
msgid "[ADDR...]"
msgstr "[DIREC...]"
-#: src/addr2line.c:216 src/ar.c:285 src/elfcmp.c:672 src/elflint.c:235
-#: src/findtextrel.c:162 src/ld.c:943 src/nm.c:262 src/objdump.c:177
-#: src/ranlib.c:124 src/readelf.c:509 src/size.c:207 src/strings.c:230
-#: src/strip.c:218 src/unstrip.c:232
-#, c-format
-msgid ""
-"Copyright (C) %s Red Hat, Inc.\n"
-"This is free software; see the source for copying conditions. There is NO\n"
-"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
-msgstr ""
-"Copyright (C) %s Red Hat, Inc.\n"
-"El siguiente es un software libre; consulte el código para conocer las "
-"condiciones de copiado. NO tiene\n"
-"garantía, ni siquiera para SU COMERCIALIZACIÓN o PARA SER USADO CON UN FIN "
-"DETERMINADO.\n"
-
-#: src/addr2line.c:221 src/ar.c:290 src/elfcmp.c:677 src/elflint.c:240
-#: src/findtextrel.c:167 src/ld.c:948 src/nm.c:267 src/objdump.c:182
-#: src/ranlib.c:129 src/readelf.c:514 src/size.c:212 src/strings.c:235
-#: src/strip.c:223 src/unstrip.c:237
-#, c-format
-msgid "Written by %s.\n"
-msgstr "Escrito por %s.\n"
-
-#: src/addr2line.c:533
+#: src/addr2line.c:520
#, c-format
msgid "Section syntax requires exactly one module"
msgstr "Sintaxis de sección requiere exactamente un módulo"
-#: src/addr2line.c:556
+#: src/addr2line.c:543
#, c-format
msgid "offset %#<PRIxMAX> lies outside section '%s'"
msgstr "Compensación %#<PRIxMAX> se encuentra fuera de sección '%s'"
-#: src/addr2line.c:645
+#: src/addr2line.c:633
#, c-format
msgid "cannot find symbol '%s'"
msgstr "no se puede encontrar símbolo '%s'"
-#: src/addr2line.c:650
+#: src/addr2line.c:638
#, c-format
msgid "offset %#<PRIxMAX> lies outside contents of '%s'"
msgstr "compensación %#<PRIxMAX> se encuentra fuera de contenido de '%s'"
@@ -934,10 +971,12 @@
msgid "Update only older files in archive."
msgstr "Actualizar sólo ficheros antiguos en archivo."
+#. Short description of program.
#: src/ar.c:99
msgid "Create, modify, and extract from archives."
msgstr "Crear, modificar, y extraer de archivos."
+#. Strings for arguments in help texts.
#: src/ar.c:102
msgid "[MEMBER] [COUNT] ARCHIVE [FILE...]"
msgstr "[MIEMBRO] [CONTAR] ARCHIVO [FICHERO...]"
@@ -982,121 +1021,146 @@
msgid "command option required"
msgstr ""
-#: src/ar.c:310
+#: src/ar.c:296
#, c-format
msgid "More than one operation specified"
msgstr "Más de una operación especificada"
-#: src/ar.c:404
+#: src/ar.c:390
#, c-format
msgid "cannot open archive '%s'"
msgstr "Imposible abrir el archivo '%s'"
-#: src/ar.c:414
+#: src/ar.c:400
#, c-format
msgid "cannot open archive '%s': %s"
msgstr "Imposible abrir el archivo '%s': %s"
-#: src/ar.c:418
+#: src/ar.c:404
#, c-format
msgid "%s: not an archive file"
msgstr "%s: no es un fichero de archivo"
-#: src/ar.c:422
+#: src/ar.c:408
#, c-format
msgid "cannot stat archive '%s'"
msgstr "no sepuede stat el archivo '%s'"
-#: src/ar.c:434
+#: src/ar.c:420
#, c-format
msgid "no entry %s in archive\n"
msgstr "no hay entrada %s en archivo\n"
-#: src/ar.c:487 src/ar.c:929 src/ar.c:1129
+#: src/ar.c:473 src/ar.c:918 src/ar.c:1122
#, c-format
msgid "cannot create hash table"
msgstr "Falló al crear la tabla de dispersión"
-#: src/ar.c:494 src/ar.c:936 src/ar.c:1138
+#: src/ar.c:480 src/ar.c:925 src/ar.c:1131
#, c-format
msgid "cannot insert into hash table"
msgstr "no sepuede insertar en tabla de dispersión"
-#: src/ar.c:502 src/ranlib.c:164
+#: src/ar.c:488 src/ranlib.c:149
#, c-format
msgid "cannot stat '%s'"
msgstr "no se puede stat '%s'"
-#: src/ar.c:598
+#: src/ar.c:584
#, c-format
msgid "cannot read content of %s: %s"
msgstr "no se puede leer el contenido de %s: %s"
-#: src/ar.c:641
+#: src/ar.c:627
#, c-format
msgid "cannot open %.*s"
msgstr " Imposible abrir %.*s"
-#: src/ar.c:663
+#: src/ar.c:649
#, c-format
msgid "failed to write %s"
msgstr "Falló al escribir %s"
-#: src/ar.c:675
+#: src/ar.c:661
#, c-format
msgid "cannot change mode of %s"
msgstr "No se puede cambiar el modo de %s"
-#: src/ar.c:691
+#: src/ar.c:677
#, c-format
msgid "cannot change modification time of %s"
msgstr "No puede cambiar tiempo de modificación de %s"
-#: src/ar.c:737
+#: src/ar.c:723
#, c-format
msgid "cannot rename temporary file to %.*s"
msgstr "no sepuede renombrar fichero temporal para %.*s"
-#: src/ar.c:773 src/ar.c:1021 src/ar.c:1420 src/ranlib.c:238
+#: src/ar.c:759 src/ar.c:1010 src/ar.c:1411 src/ranlib.c:223
#, c-format
msgid "cannot create new file"
msgstr "no sepuede crear fichero nuevo"
-#: src/ar.c:1220
+#: src/ar.c:1213
#, c-format
msgid "position member %s not found"
msgstr "no se encuentra miembro de posición %s "
-#: src/ar.c:1230
+#: src/ar.c:1223
#, c-format
msgid "%s: no entry %s in archive!\n"
msgstr "%s: ¡no hay entrada %s en archive!\n"
-#: src/ar.c:1259 src/ldgeneric.c:509 src/objdump.c:253
+#: src/ar.c:1252 src/objdump.c:242
#, c-format
msgid "cannot open %s"
msgstr "no sepuede abrir %s"
-#: src/ar.c:1264
+#: src/ar.c:1257
#, c-format
msgid "cannot stat %s"
msgstr "no sepuede efectuar stat %s"
-#: src/ar.c:1270
+#: src/ar.c:1263
#, c-format
msgid "%s is no regular file"
msgstr " %s no es un fichero ordinario "
-#: src/ar.c:1283
+#: src/ar.c:1276
#, c-format
msgid "cannot get ELF descriptor for %s: %s\n"
msgstr "no sepuede obtener descriptor ELF para %s: %s\n"
-#: src/ar.c:1303
+#: src/ar.c:1296
#, c-format
msgid "cannot read %s: %s"
msgstr "no sepuede leer %s: %s"
+#: src/ar.c:1471
+#, fuzzy, c-format
+msgid "cannot represent ar_date"
+msgstr "no pueden copiar datos de sección: %s"
+
+#: src/ar.c:1477
+#, fuzzy, c-format
+msgid "cannot represent ar_uid"
+msgstr "no pueden copiar datos de sección: %s"
+
+#: src/ar.c:1483
+#, fuzzy, c-format
+msgid "cannot represent ar_gid"
+msgstr "no pueden copiar datos de sección: %s"
+
+#: src/ar.c:1489
+#, fuzzy, c-format
+msgid "cannot represent ar_mode"
+msgstr "no se puede obtener encabezamiento de sección\n"
+
+#: src/ar.c:1495
+#, fuzzy, c-format
+msgid "cannot represent ar_size"
+msgstr "no sepuede abrir %s"
+
#: src/arlib-argp.c:32
msgid "Use zero for uid, gid, and date in archive members."
msgstr ""
@@ -1110,25 +1174,26 @@
msgid "%s (default)"
msgstr ""
-#: src/arlib.c:209
+#. The archive is too big.
+#: src/arlib.c:213
#, c-format
msgid "the archive '%s' is too large"
msgstr " El archivo '%s' es demasiado grande"
-#: src/arlib.c:222
+#: src/arlib.c:226
#, c-format
msgid "cannot read ELF header of %s(%s): %s"
msgstr "no se puede leer el encabezamiento ELF de %s(%s): %s"
-#: src/elfcmp.c:62
+#: src/elfcmp.c:61
msgid "Control options:"
msgstr "Opciones de control:"
-#: src/elfcmp.c:64
+#: src/elfcmp.c:63
msgid "Output all differences, not just the first"
msgstr ""
-#: src/elfcmp.c:65
+#: src/elfcmp.c:64
msgid ""
"Control treatment of gaps in loadable segments [ignore|match] (default: "
"ignore)"
@@ -1136,98 +1201,100 @@
"Tratamiento de control de brechas en segmento cargables [ignorar|"
"coincidencia] (por defecto: ignorar)"
-#: src/elfcmp.c:67
+#: src/elfcmp.c:66
msgid "Ignore permutation of buckets in SHT_HASH section"
msgstr "Ignorar permutación de cubetas en sección SHT_HASH"
-#: src/elfcmp.c:69
+#: src/elfcmp.c:68
msgid "Ignore differences in build ID"
msgstr ""
-#: src/elfcmp.c:70
+#: src/elfcmp.c:69
msgid "Output nothing; yield exit status only"
msgstr "Nada de salida; producir estado de salida únicamente"
-#: src/elfcmp.c:77
+#. Short description of program.
+#: src/elfcmp.c:76
msgid "Compare relevant parts of two ELF files for equality."
msgstr "Comparar partes relevantes de dos ficheros ELF para igualdad."
-#: src/elfcmp.c:81
+#. Strings for arguments in help texts.
+#: src/elfcmp.c:80
msgid "FILE1 FILE2"
msgstr "FICHERO1 FICHERO2"
-#: src/elfcmp.c:143
+#: src/elfcmp.c:142
msgid "Invalid number of parameters.\n"
msgstr "Número inválido de parámetros.\n"
-#: src/elfcmp.c:174 src/elfcmp.c:179
+#: src/elfcmp.c:173 src/elfcmp.c:178
#, c-format
msgid "cannot get ELF header of '%s': %s"
msgstr "no se puede obtener encabezamiento de '%s': %s"
-#: src/elfcmp.c:205
+#: src/elfcmp.c:204
#, c-format
msgid "%s %s diff: ELF header"
msgstr "%s %s diff: encabezamiento ELF"
-#: src/elfcmp.c:212 src/elfcmp.c:215
+#: src/elfcmp.c:211 src/elfcmp.c:214
#, c-format
msgid "cannot get section count of '%s': %s"
msgstr "no se puede obtener un conteo de sección en '%s': %s"
-#: src/elfcmp.c:220
+#: src/elfcmp.c:219
#, c-format
msgid "%s %s diff: section count"
msgstr "%s %s diff: conteo de sección"
-#: src/elfcmp.c:227 src/elfcmp.c:230
+#: src/elfcmp.c:226 src/elfcmp.c:229
#, c-format
msgid "cannot get program header count of '%s': %s"
msgstr "no se puede obtener un conteo de encabezado de programa de '%s': %s"
-#: src/elfcmp.c:235
+#: src/elfcmp.c:234
#, c-format
msgid "%s %s diff: program header count"
msgstr "%s %s diff: encabezado de programa"
-#: src/elfcmp.c:293
+#: src/elfcmp.c:292
#, fuzzy, c-format
msgid "%s %s differ: section [%zu], [%zu] name"
msgstr "%s %s differ: sección [%zu,%zu] contenido '%s'"
-#: src/elfcmp.c:316
+#: src/elfcmp.c:315
#, fuzzy, c-format
msgid "%s %s differ: section [%zu] '%s' header"
msgstr "%s %s differ: sección [%zu] contenido '%s'"
-#: src/elfcmp.c:324 src/elfcmp.c:330
+#: src/elfcmp.c:323 src/elfcmp.c:329
#, c-format
msgid "cannot get content of section %zu in '%s': %s"
msgstr "No se puede obtener contenido de sección %zu en '%s': %s"
-#: src/elfcmp.c:339
+#: src/elfcmp.c:338
#, fuzzy, c-format
msgid "symbol table [%zu] in '%s' has zero sh_entsize"
msgstr ""
"\n"
"La tabla de símbolos [%2u] '%s' contiene entrada %u:\n"
-#: src/elfcmp.c:351 src/elfcmp.c:357
+#: src/elfcmp.c:350 src/elfcmp.c:356
#, c-format
msgid "cannot get symbol in '%s': %s"
msgstr "No se puede obtener símbolo en '%s': %s"
-#: src/elfcmp.c:379
+#: src/elfcmp.c:378
#, c-format
msgid "%s %s differ: symbol table [%zu]"
msgstr "%s %s differ: tabla de símbolos [%zu]"
-#: src/elfcmp.c:382
+#: src/elfcmp.c:381
#, c-format
msgid "%s %s differ: symbol table [%zu,%zu]"
msgstr "%s %s differ: tabla de símbolos [%zu,%zu]"
-#: src/elfcmp.c:428 src/elfcmp.c:497
+#: src/elfcmp.c:428 src/elfcmp.c:498
#, fuzzy, c-format
msgid "%s %s differ: section [%zu] '%s' number of notes"
msgstr "%s %s differ: sección [%zu] contenido '%s'"
@@ -1237,105 +1304,175 @@
msgid "cannot read note section [%zu] '%s' in '%s': %s"
msgstr "No se puede obtener contenido de sección %zu en '%s': %s"
-#: src/elfcmp.c:446
+#: src/elfcmp.c:447
#, fuzzy, c-format
msgid "%s %s differ: section [%zu] '%s' note name"
msgstr "%s %s differ: sección [%zu] contenido '%s'"
-#: src/elfcmp.c:454
+#: src/elfcmp.c:455
#, fuzzy, c-format
msgid "%s %s differ: section [%zu] '%s' note '%s' type"
msgstr "%s %s differ: sección [%zu] contenido '%s'"
-#: src/elfcmp.c:469
+#: src/elfcmp.c:470
#, fuzzy, c-format
msgid "%s %s differ: build ID length"
msgstr "%s %s differ: brecha"
-#: src/elfcmp.c:477
+#: src/elfcmp.c:478
#, fuzzy, c-format
msgid "%s %s differ: build ID content"
msgstr "%s %s differ: sección [%zu] contenido '%s'"
-#: src/elfcmp.c:486
+#: src/elfcmp.c:487
#, fuzzy, c-format
msgid "%s %s differ: section [%zu] '%s' note '%s' content"
msgstr "%s %s differ: sección [%zu] contenido '%s'"
-#: src/elfcmp.c:527
+#: src/elfcmp.c:528
#, c-format
msgid "%s %s differ: section [%zu] '%s' content"
msgstr "%s %s differ: sección [%zu] contenido '%s'"
-#: src/elfcmp.c:531
+#: src/elfcmp.c:532
#, c-format
msgid "%s %s differ: section [%zu,%zu] '%s' content"
msgstr "%s %s differ: sección [%zu,%zu] contenido '%s'"
-#: src/elfcmp.c:546
+#: src/elfcmp.c:547
#, c-format
msgid "%s %s differ: unequal amount of important sections"
msgstr "%s %s differ: cantidad desigual de secciones importantes"
-#: src/elfcmp.c:579 src/elfcmp.c:584
+#: src/elfcmp.c:580 src/elfcmp.c:585
#, c-format
msgid "cannot load data of '%s': %s"
msgstr "no se pueden cargar los datos de '%s': %s"
-#: src/elfcmp.c:603 src/elfcmp.c:609
+#: src/elfcmp.c:604 src/elfcmp.c:610
#, c-format
msgid "cannot get program header entry %d of '%s': %s"
msgstr ""
"no se puede obtener entrada de encabezamiento de programa %d de '%s': %s"
-#: src/elfcmp.c:615
+#: src/elfcmp.c:616
#, c-format
msgid "%s %s differ: program header %d"
msgstr "%s %s differ: encabezamiento de programa %d"
-#: src/elfcmp.c:639
+#: src/elfcmp.c:640
#, c-format
msgid "%s %s differ: gap"
msgstr "%s %s differ: brecha"
-#: src/elfcmp.c:704
+#: src/elfcmp.c:691
#, c-format
msgid "Invalid value '%s' for --gaps parameter."
msgstr "Valor inválido '%s' para parámetro --gaps"
-#: src/elfcmp.c:732 src/findtextrel.c:221 src/ldgeneric.c:1757
-#: src/ldgeneric.c:4247 src/nm.c:378 src/ranlib.c:157 src/size.c:289
-#: src/strings.c:186 src/strip.c:466 src/strip.c:503 src/unstrip.c:2029
-#: src/unstrip.c:2058
+#: src/elfcmp.c:719 src/findtextrel.c:206 src/nm.c:365 src/ranlib.c:142
+#: src/size.c:273 src/strings.c:186 src/strip.c:518 src/strip.c:555
+#: src/unstrip.c:2023 src/unstrip.c:2052
#, c-format
msgid "cannot open '%s'"
msgstr "Imposible abrir '%s'"
-#: src/elfcmp.c:736 src/findtextrel.c:228 src/ranlib.c:174
+#: src/elfcmp.c:723 src/findtextrel.c:213 src/ranlib.c:159
#, c-format
msgid "cannot create ELF descriptor for '%s': %s"
msgstr "No puede crear descriptor ELF para '%s': %s"
-#: src/elfcmp.c:741
+#: src/elfcmp.c:728
#, c-format
msgid "cannot create EBL descriptor for '%s'"
msgstr "no se puede crear el descriptor EBL para '%s'"
-#: src/elfcmp.c:759 src/findtextrel.c:409
+#: src/elfcmp.c:746 src/findtextrel.c:394
#, c-format
msgid "cannot get section header of section %zu: %s"
msgstr "No se puede obtener el encabezamiento de sección %zu: %s"
-#: src/elfcmp.c:769
+#: src/elfcmp.c:756
#, c-format
msgid "cannot get content of section %zu: %s"
msgstr "No se puede obtener contenido de sección %zu: %s"
-#: src/elfcmp.c:779 src/elfcmp.c:793
+#: src/elfcmp.c:766 src/elfcmp.c:780
#, c-format
msgid "cannot get relocation: %s"
msgstr "No se puede obtener reubicación: %s"
+#: src/elfcompress.c:115 src/strip.c:297 src/unstrip.c:121
+#, c-format
+msgid "-o option specified twice"
+msgstr "opción -o especificada dos veces"
+
+#: src/elfcompress.c:122
+#, fuzzy, c-format
+msgid "-t option specified twice"
+msgstr "opción -f especificada dos veces"
+
+#: src/elfcompress.c:131
+#, fuzzy, c-format
+msgid "unknown compression type '%s'"
+msgstr "tipo desconocido"
+
+#. We need at least one input file.
+#: src/elfcompress.c:143 src/elfcompress.c:1305
+#, fuzzy, c-format
+msgid "No input file given"
+msgstr "archivo de entrada vacío"
+
+#: src/elfcompress.c:149 src/elfcompress.c:1310
+#, fuzzy, c-format
+msgid "Only one input file allowed together with '-o'"
+msgstr "Sólo se permite ingresar un archivo junto con '-o' y '-f'"
+
+#: src/elfcompress.c:1267
+#, fuzzy
+msgid "Place (de)compressed output into FILE"
+msgstr "Colocar la salida obtenida en FICHERO"
+
+#: src/elfcompress.c:1270
+msgid ""
+"What type of compression to apply. TYPE can be 'none' (decompress), "
+"'zlib' (ELF ZLIB compression, the default, 'zlib-gabi' is an alias) or 'zlib-"
+"gnu' (.zdebug GNU style compression, 'gnu' is an alias)"
+msgstr ""
+
+#: src/elfcompress.c:1273
+msgid ""
+"SECTION name to (de)compress, SECTION is an extended wildcard pattern "
+"(defaults to '.?(z)debug*')"
+msgstr ""
+
+#: src/elfcompress.c:1276
+msgid "Print a message for each section being (de)compressed"
+msgstr ""
+
+#: src/elfcompress.c:1279
+msgid "Force compression of section even if it would become larger"
+msgstr ""
+
+#: src/elfcompress.c:1282 src/strip.c:91
+msgid "Relax a few rules to handle slightly broken ELF files"
+msgstr "Relaja algunas reglas para manejar ficheros ELF rotos"
+
+#: src/elfcompress.c:1285
+#, fuzzy
+msgid "Be silent when a section cannot be compressed"
+msgstr ""
+"Sección [%2zu] '%s': dirección de secciones de datos de hilo-local no cero\n"
+
+#. Strings for arguments in help texts.
+#: src/elfcompress.c:1294 src/elflint.c:78 src/readelf.c:154
+msgid "FILE..."
+msgstr "FICHERO..."
+
+#: src/elfcompress.c:1295
+msgid "Compress or decompress sections in an ELF file."
+msgstr ""
+
#: src/elflint.c:64
msgid "Be extremely strict, flag level 2 features."
msgstr "Sea extremadamente estricto, característica de marca de nivel 2."
@@ -1356,15 +1493,12 @@
"Binario ha sido creado con GNU Id y por lo tanto se sabe que puede estar "
"roto de alguna forma"
+#. Short description of program.
#: src/elflint.c:74
msgid "Pedantic checking of ELF files compliance with gABI/psABI spec."
msgstr "Chequeo minucioso de ficheros ELF de acuerdo con gABI/psABI "
-#: src/elflint.c:78 src/readelf.c:126
-msgid "FILE..."
-msgstr "FICHERO..."
-
-#: src/elflint.c:155 src/readelf.c:298
+#: src/elflint.c:155 src/readelf.c:347
#, c-format
msgid "cannot open input file"
msgstr "no se puede abrir el fichero de entrada"
@@ -1383,140 +1517,151 @@
msgid "No errors"
msgstr "No hay errores"
-#: src/elflint.c:219 src/readelf.c:474
+#: src/elflint.c:220 src/readelf.c:546
msgid "Missing file name.\n"
msgstr "Falta el nombre de archivo.\n"
-#: src/elflint.c:298
+#: src/elflint.c:285
#, c-format
msgid " error while freeing sub-ELF descriptor: %s\n"
msgstr " error al liberar descriptor sub-ELF: %s\n"
-#: src/elflint.c:306
+#. We cannot do anything.
+#: src/elflint.c:293
#, c-format
msgid "Not an ELF file - it has the wrong magic bytes at the start\n"
msgstr "No es un fichero ELF - tiene los bytes mágicos errados en el inicio\n"
-#: src/elflint.c:371
+#: src/elflint.c:358
#, c-format
msgid "e_ident[%d] == %d is no known class\n"
msgstr "e_ident[%d] == %d es una clase desconocida\n"
-#: src/elflint.c:376
+#: src/elflint.c:363
#, c-format
msgid "e_ident[%d] == %d is no known data encoding\n"
msgstr "e_ident[%d] == %d es una codificación de datos desconocida\n"
-#: src/elflint.c:380
+#: src/elflint.c:367
#, c-format
msgid "unknown ELF header version number e_ident[%d] == %d\n"
msgstr ""
"número de versión de encabezamiento ELF desconocido e_ident[%d] == %d\n"
-#: src/elflint.c:386
+#: src/elflint.c:375
#, c-format
msgid "unsupported OS ABI e_ident[%d] == '%s'\n"
msgstr "Sistema operativo OS ABI e_ident[%d] == '%s' incompatible\n"
-#: src/elflint.c:392
-#, c-format
-msgid "unsupport ABI version e_ident[%d] == %d\n"
+#: src/elflint.c:381
+#, fuzzy, c-format
+msgid "unsupported ABI version e_ident[%d] == %d\n"
msgstr "Versión incompatible ABI e_ident[%d] == %d\n"
-#: src/elflint.c:397
+#: src/elflint.c:386
#, c-format
msgid "e_ident[%zu] is not zero\n"
msgstr "e_ident[%zu] no es cero\n"
-#: src/elflint.c:402
+#: src/elflint.c:391
#, c-format
msgid "unknown object file type %d\n"
msgstr "tipo de fichero objeto desconocido %d\n"
-#: src/elflint.c:409
+#: src/elflint.c:398
#, c-format
msgid "unknown machine type %d\n"
msgstr "tipo de máquina desconocido %d\n"
-#: src/elflint.c:413
+#: src/elflint.c:402
#, c-format
msgid "unknown object file version\n"
msgstr "versión de fichero objeto desconocido\n"
-#: src/elflint.c:419
+#: src/elflint.c:408
#, c-format
msgid "invalid program header offset\n"
msgstr "Compensación de encabezamiento de programa inválida\n"
-#: src/elflint.c:421
+#: src/elflint.c:410
#, c-format
msgid "executables and DSOs cannot have zero program header offset\n"
msgstr ""
"tanto los ejecutables como los DSO no pueden tener compensación de "
"encabezamiento de programa cero\n"
-#: src/elflint.c:425
+#: src/elflint.c:414
#, c-format
msgid "invalid number of program header entries\n"
msgstr "cantidad no válida de entradas del encabezamiento del programa\n"
-#: src/elflint.c:433
+#: src/elflint.c:422
#, c-format
msgid "invalid section header table offset\n"
msgstr "compensación de sección de tabla de encabezamiento inválida\n"
-#: src/elflint.c:436
+#: src/elflint.c:425
#, c-format
msgid "section header table must be present\n"
msgstr "tabla de encabezamiento de sección debe estar presente\n"
-#: src/elflint.c:450
+#: src/elflint.c:439
#, c-format
msgid "invalid number of section header table entries\n"
msgstr ""
"cantidad no válida de entradas en la tabla del encabezamiento de sección\n"
-#: src/elflint.c:467
+#: src/elflint.c:456
#, c-format
msgid "invalid section header index\n"
msgstr "Índice de sección de encabezamiento inválido\n"
-#: src/elflint.c:481
+#: src/elflint.c:474
+#, c-format
+msgid "Can only check %u headers, shnum was %u\n"
+msgstr ""
+
+#: src/elflint.c:488
#, c-format
msgid "invalid number of program header table entries\n"
msgstr "cantidad no válida de entradas de tabla de encabezado del programa\n"
-#: src/elflint.c:490
+#: src/elflint.c:505
+#, c-format
+msgid "Can only check %u headers, phnum was %u\n"
+msgstr ""
+
+#: src/elflint.c:510
#, c-format
msgid "invalid machine flags: %s\n"
msgstr "Indicadores de máquina inválidos: %s\n"
-#: src/elflint.c:497 src/elflint.c:514
+#: src/elflint.c:517 src/elflint.c:534
#, c-format
msgid "invalid ELF header size: %hd\n"
msgstr "tamaño inválido del encabezamiento ELF: %hd\n"
-#: src/elflint.c:500 src/elflint.c:517
+#: src/elflint.c:520 src/elflint.c:537
#, c-format
msgid "invalid program header size: %hd\n"
msgstr "tamaño inválido del encabezamiento del programa: %hd\n"
-#: src/elflint.c:503 src/elflint.c:520
+#: src/elflint.c:523 src/elflint.c:540
#, c-format
msgid "invalid program header position or size\n"
msgstr "tamaño o posición inválidos del encabezamiento del programa\n"
-#: src/elflint.c:506 src/elflint.c:523
+#: src/elflint.c:526 src/elflint.c:543
#, c-format
msgid "invalid section header size: %hd\n"
msgstr "tamaño inválido del encabezamiento de sección: %hd\n"
-#: src/elflint.c:509 src/elflint.c:526
+#: src/elflint.c:529 src/elflint.c:546
#, c-format
msgid "invalid section header position or size\n"
msgstr "tamaño o posición no válidos del encabezamiento de sección\n"
-#: src/elflint.c:571
+#: src/elflint.c:591
#, c-format
msgid ""
"section [%2d] '%s': section with SHF_GROUP flag set not part of a section "
@@ -1525,7 +1670,7 @@
"sección [%2d] '%s': sección con la bandera SHF_GROUP no es parte de una "
"sección de grupo\n"
-#: src/elflint.c:575
+#: src/elflint.c:595
#, c-format
msgid ""
"section [%2d] '%s': section group [%2zu] '%s' does not precede group member\n"
@@ -1533,14 +1678,14 @@
"sección [%2d] '%s': el grupo de sección [%2zu] '%s' no precede al miembro de "
"grupo\n"
-#: src/elflint.c:591 src/elflint.c:1475 src/elflint.c:1526 src/elflint.c:1632
-#: src/elflint.c:1968 src/elflint.c:2284 src/elflint.c:2898 src/elflint.c:3061
-#: src/elflint.c:3209 src/elflint.c:3399 src/elflint.c:4366
+#: src/elflint.c:611 src/elflint.c:1495 src/elflint.c:1546 src/elflint.c:1652
+#: src/elflint.c:1988 src/elflint.c:2311 src/elflint.c:2930 src/elflint.c:3093
+#: src/elflint.c:3241 src/elflint.c:3431 src/elflint.c:4399
#, c-format
msgid "section [%2d] '%s': cannot get section data\n"
msgstr "Sección [%2d] '%s': No se pueden obtener datos de sección\n"
-#: src/elflint.c:604 src/elflint.c:1639
+#: src/elflint.c:624 src/elflint.c:1659
#, c-format
msgid ""
"section [%2d] '%s': referenced as string table for section [%2d] '%s' but "
@@ -1549,7 +1694,7 @@
"sección [%2d] '%s': nombrado como una tabla de cadena para la sección [%2d] "
"'%s' pero el tipo no es SHT_STRTAB\n"
-#: src/elflint.c:627
+#: src/elflint.c:647
#, c-format
msgid ""
"section [%2d] '%s': symbol table cannot have more than one extended index "
@@ -1558,39 +1703,39 @@
"sección [%2d] '%s': la tabla de símbolo no puede tener más de una sección de "
"índice extendido\n"
-#: src/elflint.c:639
+#: src/elflint.c:659
#, c-format
msgid "section [%2u] '%s': entry size is does not match ElfXX_Sym\n"
msgstr ""
"sección [%2u] '%s': el tamaño de la entrada no coincide con ElfXX_Sym\n"
-#: src/elflint.c:648
+#: src/elflint.c:668
#, c-format
msgid "section [%2d] '%s': cannot get symbol %d: %s\n"
msgstr "Sección [%2d] '%s': no se puede obtener símbolo %d: %s\n"
-#: src/elflint.c:653 src/elflint.c:656 src/elflint.c:659 src/elflint.c:662
-#: src/elflint.c:665 src/elflint.c:668
+#: src/elflint.c:673 src/elflint.c:676 src/elflint.c:679 src/elflint.c:682
+#: src/elflint.c:685 src/elflint.c:688
#, c-format
msgid "section [%2d] '%s': '%s' in zeroth entry not zero\n"
msgstr "Sección [%2d] '%s': '%s' en la entrada zeroth no es cero\n"
-#: src/elflint.c:671
+#: src/elflint.c:691
#, c-format
msgid "section [%2d] '%s': XINDEX for zeroth entry not zero\n"
msgstr "sección [%2d] '%s': XINDEX en la entrada zeroth no es cero\n"
-#: src/elflint.c:681
+#: src/elflint.c:701
#, c-format
msgid "section [%2d] '%s': cannot get symbol %zu: %s\n"
msgstr "sección [%2d] '%s': no es posible obtener el símbolo %zu: %s\n"
-#: src/elflint.c:690
+#: src/elflint.c:710
#, c-format
msgid "section [%2d] '%s': symbol %zu: invalid name value\n"
msgstr "sección [%2d] '%s': símbolo %zu: valor de nombre inválido\n"
-#: src/elflint.c:705
+#: src/elflint.c:725
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: too large section index but no extended "
@@ -1599,7 +1744,7 @@
"Sección [%2d] '%s': símbolo %zu: el índice de sección es demasiado extenso, "
"pero no la sección extendida de la sección de índice\n"
-#: src/elflint.c:711
+#: src/elflint.c:731
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: XINDEX used for index which would fit in "
@@ -1608,27 +1753,28 @@
"Sección [%2d] '%s': símbolo %zu: XINDEX es utilizado para índice que pueda "
"caber en st_shndx (%<PRIu32>)\n"
-#: src/elflint.c:723
+#. || sym->st_shndx > SHN_HIRESERVE always false
+#: src/elflint.c:743
#, c-format
msgid "section [%2d] '%s': symbol %zu: invalid section index\n"
msgstr "sección [%2d] '%s': símbolo %zu: índice de sección inválido\n"
-#: src/elflint.c:731
+#: src/elflint.c:751
#, c-format
msgid "section [%2d] '%s': symbol %zu: unknown type\n"
msgstr "sección [%2d] '%s': símbolo %zu: tipo desconocido\n"
-#: src/elflint.c:737
+#: src/elflint.c:757
#, c-format
msgid "section [%2d] '%s': symbol %zu: unknown symbol binding\n"
msgstr "sección [%2d] '%s': símbolo %zu: asociación de símbolo desconocida\n"
-#: src/elflint.c:742
+#: src/elflint.c:762
#, c-format
msgid "section [%2d] '%s': symbol %zu: unique symbol not of object type\n"
msgstr "Sección [%2d] '%s': símbolo %zu: símbolo único no de tipo de objeto\n"
-#: src/elflint.c:750
+#: src/elflint.c:770
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: COMMON only allowed in relocatable files\n"
@@ -1636,25 +1782,25 @@
"sección [%2d] '%s': símbolo %zu: COMMON solo es permitido en archivos "
"realojables\n"
-#: src/elflint.c:754
+#: src/elflint.c:774
#, c-format
msgid "section [%2d] '%s': symbol %zu: local COMMON symbols are nonsense\n"
msgstr ""
"Sección [%2d] '%s': símbolo %zu: símbolos locales COMMON no tienen sentido\n"
-#: src/elflint.c:758
+#: src/elflint.c:778
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: function in COMMON section is nonsense\n"
msgstr ""
"Sección [%2d] '%s': símbolo %zu: función en sección COMMON no tiene sentido\n"
-#: src/elflint.c:809
+#: src/elflint.c:829
#, c-format
msgid "section [%2d] '%s': symbol %zu: st_value out of bounds\n"
msgstr "sección [%2d] '%s': símbolo %zu: st_value fuera de límites\n"
-#: src/elflint.c:815 src/elflint.c:840 src/elflint.c:889
+#: src/elflint.c:835 src/elflint.c:860 src/elflint.c:909
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu does not fit completely in referenced section "
@@ -1663,7 +1809,7 @@
"Sección [%2d] '%s': símbolo %zu no se ajusta totalmente en la sección [%2d] "
"'%s'\n"
-#: src/elflint.c:824
+#: src/elflint.c:844
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: referenced section [%2d] '%s' does not have "
@@ -1672,7 +1818,7 @@
"Sección [%2d] '%s': símbolo %zu: sección de referencia [%2d] '%s' no tiene "
"establecida bandera SHF_TLS\n"
-#: src/elflint.c:834 src/elflint.c:882
+#: src/elflint.c:854 src/elflint.c:902
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: st_value out of bounds of referenced section "
@@ -1681,7 +1827,7 @@
"Sección [%2d] '%s': símbolo %zu: st_value fuera de límites de sección de "
"referencia [%2d] '%s'\n"
-#: src/elflint.c:861
+#: src/elflint.c:881
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: TLS symbol but no TLS program header entry\n"
@@ -1689,7 +1835,7 @@
"Sección [%2d] '%s': símbolo %zu: símbolo TLS, pero no hay entrada de "
"programa TLS\n"
-#: src/elflint.c:867
+#: src/elflint.c:887
#, fuzzy, c-format
msgid ""
"section [%2d] '%s': symbol %zu: TLS symbol but couldn't get TLS program "
@@ -1698,7 +1844,7 @@
"Sección [%2d] '%s': símbolo %zu: símbolo TLS, pero no hay entrada de "
"programa TLS\n"
-#: src/elflint.c:875
+#: src/elflint.c:895
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: st_value short of referenced section [%2d] "
@@ -1707,7 +1853,7 @@
"Sección [%2d] '%s': símbolo %zu: st_value falta sección de referencia [%2d] "
"'%s'\n"
-#: src/elflint.c:902
+#: src/elflint.c:922
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: local symbol outside range described in "
@@ -1716,7 +1862,7 @@
"Sección [%2d] '%s': símbolo %zu: símbolo local fuera del rango descrito en "
"sh_info\n"
-#: src/elflint.c:909
+#: src/elflint.c:929
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: non-local symbol outside range described in "
@@ -1725,12 +1871,12 @@
"Sección [%2d] '%s': símbolo %zu: símbolo non-local fuera del rango descrito "
"en sh_info\n"
-#: src/elflint.c:916
+#: src/elflint.c:936
#, c-format
msgid "section [%2d] '%s': symbol %zu: non-local section symbol\n"
msgstr "Sección [%2d] '%s': símbolo %zu: símbolo de sección non-local\n"
-#: src/elflint.c:966
+#: src/elflint.c:986
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to bad section "
@@ -1739,7 +1885,7 @@
"Sección [%2d] '%s': símbolo _GLOBAL_OFFSET_TABLE_ se refiere a sección "
"errada [%2d]\n"
-#: src/elflint.c:973
+#: src/elflint.c:993
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to section [%2d] "
@@ -1748,7 +1894,10 @@
"Sección [%2d] '%s': símbolo _GLOBAL_OFFSET_TABLE_ se refiere a sección [%2d] "
"'%s'\n"
-#: src/elflint.c:989
+#. This test is more strict than the psABIs which
+#. usually allow the symbol to be in the middle of
+#. the .got section, allowing negative offsets.
+#: src/elflint.c:1009
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol value %#<PRIx64> does not "
@@ -1757,7 +1906,7 @@
"Sección [%2d] '%s': valor del símbolo _GLOBAL_OFFSET_TABLE_ %#<PRIx64> no "
"coincide con dirección de sección %s %#<PRIx64>\n"
-#: src/elflint.c:996
+#: src/elflint.c:1016
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol size %<PRIu64> does not "
@@ -1766,7 +1915,7 @@
"Sección [%2d] '%s': tamaño de símbolo _GLOBAL_OFFSET_TABLE_ %<PRIu64> no "
"coincide con tamaño de sección %s %<PRIu64>\n"
-#: src/elflint.c:1004
+#: src/elflint.c:1024
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol present, but no .got "
@@ -1775,7 +1924,7 @@
"Sección [%2d] '%s': símbolo _GLOBAL_OFFSET_TABLE_ presente, pero no. sección "
"got\n"
-#: src/elflint.c:1020
+#: src/elflint.c:1040
#, c-format
msgid ""
"section [%2d] '%s': _DYNAMIC_ symbol value %#<PRIx64> does not match dynamic "
@@ -1784,7 +1933,7 @@
"sección [%2d] '%s': Valor de símbolo _DYNAMIC_ %#<PRIx64> no coincide con la "
"dirección de segmento%#<PRIx64>\n"
-#: src/elflint.c:1027
+#: src/elflint.c:1047
#, c-format
msgid ""
"section [%2d] '%s': _DYNAMIC symbol size %<PRIu64> does not match dynamic "
@@ -1793,7 +1942,7 @@
"Sección [%2d] '%s': tamaño de símbolo _DYNAMIC %<PRIu64> no coincide con "
"tamaño de segmento %<PRIu64>\n"
-#: src/elflint.c:1040
+#: src/elflint.c:1060
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: symbol in dynamic symbol table with non-"
@@ -1802,29 +1951,29 @@
"Sección [%2d] '%s': símbolo %zu: símbolo en tabla de símbolos dinámicos sin "
"visibilidad predeterminada\n"
-#: src/elflint.c:1044
+#: src/elflint.c:1064
#, c-format
msgid "section [%2d] '%s': symbol %zu: unknown bit set in st_other\n"
msgstr ""
"Sección [%2d] '%s': símbolo %zu: bit desconocido establecido en st_other\n"
-#: src/elflint.c:1082
+#: src/elflint.c:1102
#, fuzzy, c-format
msgid "section [%2d] '%s': cannot get section data.\n"
msgstr "Sección [%2d] '%s': No se pueden obtener datos de sección\n"
-#: src/elflint.c:1098
+#: src/elflint.c:1118
#, c-format
msgid "section [%2d] '%s': DT_RELCOUNT used for this RELA section\n"
msgstr "Sección [%2d] '%s': DT_RELCOUNT utilizada para esta sección RELA\n"
-#: src/elflint.c:1109 src/elflint.c:1162
+#: src/elflint.c:1129 src/elflint.c:1182
#, c-format
msgid "section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"
msgstr ""
"Sección [%2d] '%s': valor DT_RELCOUNT %d demasiado alto para esta sección\n"
-#: src/elflint.c:1134 src/elflint.c:1187
+#: src/elflint.c:1154 src/elflint.c:1207
#, c-format
msgid ""
"section [%2d] '%s': relative relocations after index %d as specified by "
@@ -1833,7 +1982,7 @@
"Sección [%2d] '%s': reubicaciones relativas después de que el %d de índice "
"haya sido especificado por DT_RELCOUNT\n"
-#: src/elflint.c:1140 src/elflint.c:1193
+#: src/elflint.c:1160 src/elflint.c:1213
#, c-format
msgid ""
"section [%2d] '%s': non-relative relocation at index %zu; DT_RELCOUNT "
@@ -1842,50 +1991,50 @@
"Sección [%2d] '%s': reubicación no-relativa en %zu de índice; DT_RELCOUNT "
"especificado %d reubicaciones relativas\n"
-#: src/elflint.c:1152
+#: src/elflint.c:1172
#, c-format
msgid "section [%2d] '%s': DT_RELACOUNT used for this REL section\n"
msgstr "sección [%2d] '%s': DT_RELACOUNT utilizado para esta sección REL\n"
-#: src/elflint.c:1235
+#: src/elflint.c:1255
#, c-format
msgid "section [%2d] '%s': invalid destination section index\n"
msgstr "Sección [%2d] '%s': índice de sección de destino inválido\n"
-#: src/elflint.c:1247
+#: src/elflint.c:1267
#, c-format
msgid "section [%2d] '%s': invalid destination section type\n"
msgstr "Sección [%2d] '%s': tipo de sección de destino inválido\n"
-#: src/elflint.c:1255
+#: src/elflint.c:1275
#, c-format
msgid "section [%2d] '%s': sh_info should be zero\n"
msgstr "Sección [%2d] '%s': sh_info debe ser cero\n"
-#: src/elflint.c:1263
+#: src/elflint.c:1283
#, fuzzy, c-format
msgid ""
"section [%2d] '%s': no relocations for merge-able string sections possible\n"
msgstr ""
"Sección [%2d] '%s': no reubicaciones para secciones de fusión posibles\n"
-#: src/elflint.c:1271
+#: src/elflint.c:1291
#, c-format
msgid "section [%2d] '%s': section entry size does not match ElfXX_Rela\n"
msgstr ""
"Sección [%2d] '%s': tamaño de entrada de sección no coincide con ElfXX_Rela\n"
-#: src/elflint.c:1331
+#: src/elflint.c:1351
#, c-format
msgid "text relocation flag set but there is no read-only segment\n"
msgstr "Reubicación de bandera pero no hay segmento de sólo lectura\n"
-#: src/elflint.c:1358
+#: src/elflint.c:1378
#, c-format
msgid "section [%2d] '%s': relocation %zu: invalid type\n"
msgstr "Sección [%2d] '%s': reubicación %zu: tipo inválido\n"
-#: src/elflint.c:1366
+#: src/elflint.c:1386
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: relocation type invalid for the file "
@@ -1894,12 +2043,12 @@
"Sección [%2d] '%s': reubicación %zu: tipo de reubicación inválido para el "
"tipo de archivo\n"
-#: src/elflint.c:1374
+#: src/elflint.c:1394
#, c-format
msgid "section [%2d] '%s': relocation %zu: invalid symbol index\n"
msgstr "Sección [%2d] '%s': reubicación %zu: índice de símbolo inválido\n"
-#: src/elflint.c:1392
+#: src/elflint.c:1412
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: only symbol '_GLOBAL_OFFSET_TABLE_' can "
@@ -1908,12 +2057,12 @@
"Sección [%2d] '%s': reubicación %zu: sólo el símbolo '_GLOBAL_OFFSET_TABLE_' "
"puede utilizarse con %s\n"
-#: src/elflint.c:1409
+#: src/elflint.c:1429
#, c-format
msgid "section [%2d] '%s': relocation %zu: offset out of bounds\n"
msgstr "Sección [%2d] '%s': reubicación %zu: compensación fuera de límites\n"
-#: src/elflint.c:1424
+#: src/elflint.c:1444
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: copy relocation against symbol of type "
@@ -1922,7 +2071,7 @@
"Sección [%2d] '%s': reubicación %zu: reubicación de copia con símbolo de "
"tipo %s\n"
-#: src/elflint.c:1445
+#: src/elflint.c:1465
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: read-only section modified but text "
@@ -1931,24 +2080,24 @@
"Sección [%2d] '%s': reubicación %zu: sección de sólo-lectura modificada, "
"pero no se estableció bandera de reubicación\n"
-#: src/elflint.c:1460
+#: src/elflint.c:1480
#, c-format
msgid "section [%2d] '%s': relocations are against loaded and unloaded data\n"
msgstr ""
"Sección [%2d] '%s': las reubicaciones se hacen con datos cargados y "
"descargados\n"
-#: src/elflint.c:1500 src/elflint.c:1551
+#: src/elflint.c:1520 src/elflint.c:1571
#, c-format
msgid "section [%2d] '%s': cannot get relocation %zu: %s\n"
msgstr "Sección [%2d] '%s': no puede obtener reubicación %zu: %s\n"
-#: src/elflint.c:1627
+#: src/elflint.c:1647
#, c-format
msgid "more than one dynamic section present\n"
msgstr "más de una sección dinámica presente\n"
-#: src/elflint.c:1645
+#: src/elflint.c:1665
#, fuzzy, c-format
msgid ""
"section [%2d]: referenced as string table for section [%2d] '%s' but section "
@@ -1957,44 +2106,44 @@
"sección [%2d] '%s': nombrado como una tabla de cadena para la sección [%2d] "
"'%s' pero el tipo no es SHT_STRTAB\n"
-#: src/elflint.c:1653
+#: src/elflint.c:1673
#, c-format
msgid "section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"
msgstr ""
"Sección [%2d] '%s': tamaño de entrada de sección no coincide con ElfXX_Dyn\n"
-#: src/elflint.c:1658 src/elflint.c:1947
+#: src/elflint.c:1678 src/elflint.c:1967
#, c-format
msgid "section [%2d] '%s': sh_info not zero\n"
msgstr "Sección [%2d] '%s': sh_info no es cero\n"
-#: src/elflint.c:1668
+#: src/elflint.c:1688
#, c-format
msgid "section [%2d] '%s': cannot get dynamic section entry %zu: %s\n"
msgstr ""
"Sección [%2d] '%s': no puede obtener entrada de sección dinámica %zu: %s\n"
-#: src/elflint.c:1676
+#: src/elflint.c:1696
#, c-format
msgid "section [%2d] '%s': non-DT_NULL entries follow DT_NULL entry\n"
msgstr "Sección [%2d] '%s': entradas non-DT_NULL siguen a la entrada DT_NULL\n"
-#: src/elflint.c:1683
+#: src/elflint.c:1703
#, c-format
msgid "section [%2d] '%s': entry %zu: unknown tag\n"
msgstr "Sección [%2d] '%s': entrada %zu: etiqueta desconocida\n"
-#: src/elflint.c:1694
+#: src/elflint.c:1714
#, c-format
msgid "section [%2d] '%s': entry %zu: more than one entry with tag %s\n"
msgstr "Sección [%2d] '%s': entrada %zu: más de una entrada con etiqueta %s\n"
-#: src/elflint.c:1704
+#: src/elflint.c:1724
#, c-format
msgid "section [%2d] '%s': entry %zu: level 2 tag %s used\n"
msgstr "Sección [%2d] '%s': entrada %zu: nivel 2 etiqueta %s utilizada\n"
-#: src/elflint.c:1722
+#: src/elflint.c:1742
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: DT_PLTREL value must be DT_REL or DT_RELA\n"
@@ -2002,7 +2151,7 @@
"Sección [%2d] '%s': entrada %zu: el valor DT_PLTREL debe ser DT_REL or "
"DT_RELA\n"
-#: src/elflint.c:1735
+#: src/elflint.c:1755
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: pointer does not match address of section "
@@ -2011,14 +2160,14 @@
"Sección [%2d] '%s': entrada %zu: puntero no coincide con dirección de "
"sección [%2d] '%s' al que hace referencia sh_link\n"
-#: src/elflint.c:1778
+#: src/elflint.c:1798
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: %s value must point into loaded segment\n"
msgstr ""
"Sección [%2d] '%s': entrada %zu: valor %s debe apuntar en segmento cargado\n"
-#: src/elflint.c:1793
+#: src/elflint.c:1813
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: %s value must be valid offset in section "
@@ -2027,46 +2176,46 @@
"sección [%2d] '%s': entrada %zu: valor %s debe ser compensación válida en "
"sección [%2d] '%s'\n"
-#: src/elflint.c:1813 src/elflint.c:1841
+#: src/elflint.c:1833 src/elflint.c:1861
#, c-format
msgid "section [%2d] '%s': contains %s entry but not %s\n"
msgstr "Sección [%2d] '%s': contiene entrada %s pero no %s\n"
-#: src/elflint.c:1825
+#: src/elflint.c:1845
#, c-format
msgid "section [%2d] '%s': mandatory tag %s not present\n"
msgstr "Sección [%2d] '%s': etiqueta obligatoria %s no está presente\n"
-#: src/elflint.c:1834
+#: src/elflint.c:1854
#, c-format
msgid "section [%2d] '%s': no hash section present\n"
msgstr "Sección [%2d] '%s': no hay sección de dispersión presente\n"
-#: src/elflint.c:1849 src/elflint.c:1856
+#: src/elflint.c:1869 src/elflint.c:1876
#, c-format
msgid "section [%2d] '%s': not all of %s, %s, and %s are present\n"
msgstr "Sección [%2d] '%s': no todas las %s, %s, y %s están presentes\n"
-#: src/elflint.c:1866 src/elflint.c:1870
+#: src/elflint.c:1886 src/elflint.c:1890
#, c-format
msgid "section [%2d] '%s': %s tag missing in DSO marked during prelinking\n"
msgstr ""
"Sección [%2d] '%s': etiqueta %s faltante en DSO marcada durante el pre-"
"enlace\n"
-#: src/elflint.c:1876
+#: src/elflint.c:1896
#, c-format
msgid "section [%2d] '%s': non-DSO file marked as dependency during prelink\n"
msgstr ""
"Sección [%2d] '%s': archivo no-DSO marcado como dependencia durante el pre-"
"enlace\n"
-#: src/elflint.c:1887 src/elflint.c:1891 src/elflint.c:1895 src/elflint.c:1899
+#: src/elflint.c:1907 src/elflint.c:1911 src/elflint.c:1915 src/elflint.c:1919
#, c-format
msgid "section [%2d] '%s': %s tag missing in prelinked executable\n"
msgstr "Sección [%2d] '%s': etiqueta %s faltante en pre-enlace ejecutable\n"
-#: src/elflint.c:1911
+#: src/elflint.c:1931
#, c-format
msgid ""
"section [%2d] '%s': only relocatable files can have extended section index\n"
@@ -2074,37 +2223,37 @@
"Sección [%2d] '%s': sólo los archivos reubicables pueden tener índice de "
"sección extendido\n"
-#: src/elflint.c:1921
+#: src/elflint.c:1941
#, c-format
msgid ""
"section [%2d] '%s': extended section index section not for symbol table\n"
msgstr ""
"Sección [%2d] '%s': índice de sección extendido no para tabla de símbolos\n"
-#: src/elflint.c:1925
+#: src/elflint.c:1945
#, fuzzy, c-format
msgid "section [%2d] '%s': sh_link extended section index [%2d] is invalid\n"
msgstr ""
"Sección [%2d] '%s': índice de sección extendido no para tabla de símbolos\n"
-#: src/elflint.c:1930
+#: src/elflint.c:1950
#, c-format
msgid "cannot get data for symbol section\n"
msgstr "no se puede obtener sección para símbolos\n"
-#: src/elflint.c:1933
+#: src/elflint.c:1953
#, c-format
msgid "section [%2d] '%s': entry size does not match Elf32_Word\n"
msgstr "Sección [%2d] '%s': tamaño de entrada no coincide con Elf32_Word\n"
-#: src/elflint.c:1942
+#: src/elflint.c:1962
#, c-format
msgid "section [%2d] '%s': extended index table too small for symbol table\n"
msgstr ""
"Sección [%2d] '%s': tabla de índice extendida demasiado pequeña para tabla "
"de símbolos\n"
-#: src/elflint.c:1957
+#: src/elflint.c:1977
#, c-format
msgid ""
"section [%2d] '%s': extended section index in section [%2zu] '%s' refers to "
@@ -2113,24 +2262,24 @@
"Sección [%2d] '%s': índice de sección extendida en sección [%2zu] '%s' se "
"refiere a la misma tabla de símbolos\n"
-#: src/elflint.c:1974
+#: src/elflint.c:1995
#, c-format
msgid "symbol 0 should have zero extended section index\n"
msgstr "símbolo 0 debe tener índice de sección extendida cero\n"
-#: src/elflint.c:1986
+#: src/elflint.c:2007
#, c-format
msgid "cannot get data for symbol %zu\n"
msgstr "no puede obtener datos para símbolo %zu\n"
-#: src/elflint.c:1991
+#: src/elflint.c:2012
#, c-format
msgid "extended section index is %<PRIu32> but symbol index is not XINDEX\n"
msgstr ""
"índice de sección extendida es %<PRIu32> pero índice de símbolo no es "
"XINDEX\n"
-#: src/elflint.c:2007 src/elflint.c:2058
+#: src/elflint.c:2029 src/elflint.c:2083
#, c-format
msgid ""
"section [%2d] '%s': hash table section is too small (is %ld, expected %ld)\n"
@@ -2138,42 +2287,42 @@
"Sección [%2d] '%s': sección de tabla de dispersión es demasiado pequeña (es "
"%ld, se espera %ld)\n"
-#: src/elflint.c:2019 src/elflint.c:2070
+#: src/elflint.c:2043 src/elflint.c:2097
#, c-format
msgid "section [%2d] '%s': chain array too large\n"
msgstr "Sección [%2d] '%s': índice de la cadena es demasiado grande\n"
-#: src/elflint.c:2033 src/elflint.c:2084
+#: src/elflint.c:2057 src/elflint.c:2111
#, c-format
msgid "section [%2d] '%s': hash bucket reference %zu out of bounds\n"
msgstr ""
"Sección [%2d] '%s': referencia de cubetas de dispersión %zu fuera de "
"límites\n"
-#: src/elflint.c:2043
+#: src/elflint.c:2067
#, c-format
msgid "section [%2d] '%s': hash chain reference %zu out of bounds\n"
msgstr ""
"Sección [%2d] '%s': referencia de cadena de dispersión %zu fuera de límites\n"
-#: src/elflint.c:2094
+#: src/elflint.c:2121
#, c-format
msgid "section [%2d] '%s': hash chain reference %<PRIu64> out of bounds\n"
msgstr ""
"Sección [%2d] '%s': referencia de cadena de dispersión %<PRIu64> fuera de "
"límites\n"
-#: src/elflint.c:2107
+#: src/elflint.c:2134
#, fuzzy, c-format
msgid "section [%2d] '%s': not enough data\n"
msgstr "Sección [%2d] '%s': no puede obtener datos: %s\n"
-#: src/elflint.c:2119
+#: src/elflint.c:2146
#, fuzzy, c-format
msgid "section [%2d] '%s': bitmask size zero or not power of 2: %u\n"
msgstr "Sección [%2d] '%s': tamaño de bitmask no es potencia de 2: %u\n"
-#: src/elflint.c:2135
+#: src/elflint.c:2162
#, fuzzy, c-format
msgid ""
"section [%2d] '%s': hash table section is too small (is %ld, expected at "
@@ -2182,14 +2331,14 @@
"Sección [%2d] '%s': sección de tabla de dispersión es demasiado pequeña (es "
"%ld, se espera al menos least%ld)\n"
-#: src/elflint.c:2144
+#: src/elflint.c:2171
#, c-format
msgid "section [%2d] '%s': 2nd hash function shift too big: %u\n"
msgstr ""
"Sección [%2d] '%s': segundo cambio de función de dispersión demasiado "
"grande: %u\n"
-#: src/elflint.c:2178
+#: src/elflint.c:2205
#, c-format
msgid ""
"section [%2d] '%s': hash chain for bucket %zu lower than symbol index bias\n"
@@ -2197,7 +2346,7 @@
"Sección [%2d] '%s': cadena de dispersión para cubetas %zu inferior a "
"polarización de índice de símbolo\n"
-#: src/elflint.c:2199
+#: src/elflint.c:2226
#, c-format
msgid ""
"section [%2d] '%s': symbol %u referenced in chain for bucket %zu is "
@@ -2206,7 +2355,7 @@
"Sección [%2d] '%s': el símbolo %u al que se hace referencia en cadena para "
"cubeta %zu es indefinido\n"
-#: src/elflint.c:2212
+#: src/elflint.c:2239
#, c-format
msgid ""
"section [%2d] '%s': hash value for symbol %u in chain for bucket %zu wrong\n"
@@ -2214,7 +2363,7 @@
"Sección [%2d] '%s': valor de dispersión para símbolo %u en cadena para "
"cubeta %zu está errado\n"
-#: src/elflint.c:2221
+#: src/elflint.c:2248
#, fuzzy, c-format
msgid ""
"section [%2d] '%s': mask index for symbol %u in chain for bucket %zu wrong\n"
@@ -2222,13 +2371,13 @@
"Sección [%2d] '%s': valor de dispersión para símbolo %u en cadena para "
"cubeta %zu está errado\n"
-#: src/elflint.c:2251
+#: src/elflint.c:2278
#, c-format
msgid "section [%2d] '%s': hash chain for bucket %zu out of bounds\n"
msgstr ""
"Sección [%2d] '%s': cadena de dispersión para cubeta %zu fuera de limites\n"
-#: src/elflint.c:2256
+#: src/elflint.c:2283
#, c-format
msgid ""
"section [%2d] '%s': symbol reference in chain for bucket %zu out of bounds\n"
@@ -2236,43 +2385,43 @@
"Sección [%2d] '%s': referencia de símbolo en cadena para cubeta %zu fuera de "
"límites\n"
-#: src/elflint.c:2262
+#: src/elflint.c:2289
#, c-format
msgid "section [%2d] '%s': bitmask does not match names in the hash table\n"
msgstr ""
"Sección [%2d] '%s': bitmask no coincide con nombres en la tabla de "
"dispersión\n"
-#: src/elflint.c:2275
+#: src/elflint.c:2302
#, c-format
msgid "section [%2d] '%s': relocatable files cannot have hash tables\n"
msgstr ""
"Sección [%2d] '%s': archivos reubicables no pueden tener tablas de "
"dispersión\n"
-#: src/elflint.c:2293
+#: src/elflint.c:2320
#, c-format
msgid "section [%2d] '%s': hash table not for dynamic symbol table\n"
msgstr ""
"Sección [%2d] '%s': tabla de dispersión no para tabla de símbolos dinámicos\n"
-#: src/elflint.c:2297
+#: src/elflint.c:2324
#, fuzzy, c-format
msgid "section [%2d] '%s': invalid sh_link symbol table section index [%2d]\n"
msgstr "Sección [%2d] '%s': índice de sección de destino inválido\n"
-#: src/elflint.c:2305
+#: src/elflint.c:2334
#, c-format
msgid "section [%2d] '%s': hash table entry size incorrect\n"
msgstr ""
"Sección [%2d] '%s': tamaño incorrecto de entrada de tabla de dispersión\n"
-#: src/elflint.c:2310
+#: src/elflint.c:2339
#, c-format
msgid "section [%2d] '%s': not marked to be allocated\n"
msgstr "Sección [%2d] '%s': no marcada para ser asignada\n"
-#: src/elflint.c:2315
+#: src/elflint.c:2344
#, c-format
msgid ""
"section [%2d] '%s': hash table has not even room for initial administrative "
@@ -2281,46 +2430,46 @@
"Sección [%2d] '%s': tabla de dispersión no tiene ni siquiera espacio para "
"entradas administrativas iniciales\n"
-#: src/elflint.c:2364
+#: src/elflint.c:2393
#, c-format
msgid "sh_link in hash sections [%2zu] '%s' and [%2zu] '%s' not identical\n"
msgstr ""
"sh_link en secciones de dispersión [%2zu] '%s' y [%2zu] '%s' no son "
"idénticas\n"
-#: src/elflint.c:2388 src/elflint.c:2453 src/elflint.c:2488
+#: src/elflint.c:2417 src/elflint.c:2482 src/elflint.c:2517
#, fuzzy, c-format
msgid "hash section [%2zu] '%s' does not contain enough data\n"
msgstr "sección [%2zu] '%s' no debe ser ejecutable\n"
-#: src/elflint.c:2409
+#: src/elflint.c:2438
#, fuzzy, c-format
msgid "hash section [%2zu] '%s' has zero bit mask words\n"
msgstr "Sección [%2d] '%s': grupo de sección sin palabra de banderas\n"
-#: src/elflint.c:2420 src/elflint.c:2464 src/elflint.c:2501
+#: src/elflint.c:2449 src/elflint.c:2493 src/elflint.c:2530
#, fuzzy, c-format
msgid "hash section [%2zu] '%s' uses too much data\n"
msgstr "sección [%2zu] '%s' debe ser asignada\n"
-#: src/elflint.c:2435
+#: src/elflint.c:2464
#, c-format
msgid ""
"hash section [%2zu] '%s' invalid symbol index %<PRIu32> (max_nsyms: "
"%<PRIu32>, nentries: %<PRIu32>\n"
msgstr ""
-#: src/elflint.c:2522
+#: src/elflint.c:2551
#, fuzzy, c-format
msgid "hash section [%2zu] '%s' invalid sh_entsize\n"
msgstr "Sección [%2zu]: nombre inválido\n"
-#: src/elflint.c:2532 src/elflint.c:2536
+#: src/elflint.c:2561 src/elflint.c:2565
#, c-format
msgid "section [%2zu] '%s': reference to symbol index 0\n"
msgstr "Sección [%2zu] '%s': referencia al índice de símbolo 0\n"
-#: src/elflint.c:2543
+#: src/elflint.c:2572
#, c-format
msgid ""
"symbol %d referenced in new hash table in [%2zu] '%s' but not in old hash "
@@ -2329,7 +2478,7 @@
"Símbolo %d nombrado en nueva tabla de dispersión en [%2zu] '%s' pero no en "
"la tabla de dispersión anterior en [%2zu] '%s'\n"
-#: src/elflint.c:2555
+#: src/elflint.c:2584
#, c-format
msgid ""
"symbol %d referenced in old hash table in [%2zu] '%s' but not in new hash "
@@ -2338,12 +2487,12 @@
"Símbolo %d nombrado en la tabla de dispersión anterior en [%2zu] '%s' pero "
"no en la nueva tabla de dispersión en [%2zu] '%s'\n"
-#: src/elflint.c:2571
+#: src/elflint.c:2600
#, c-format
msgid "section [%2d] '%s': nonzero sh_%s for NULL section\n"
msgstr "Sección [%2d] '%s': nonzero sh_%s para sección NULL\n"
-#: src/elflint.c:2591
+#: src/elflint.c:2620
#, c-format
msgid ""
"section [%2d] '%s': section groups only allowed in relocatable object files\n"
@@ -2351,99 +2500,99 @@
"Sección [%2d] '%s': grupos de sección sólo permitidos en archivos de objeto "
"reubicables\n"
-#: src/elflint.c:2602
+#: src/elflint.c:2631
#, c-format
msgid "section [%2d] '%s': cannot get symbol table: %s\n"
msgstr "Sección [%2d] '%s': no puede obtener tabla de símbolos: %s\n"
-#: src/elflint.c:2607
+#: src/elflint.c:2636
#, c-format
msgid "section [%2d] '%s': section reference in sh_link is no symbol table\n"
msgstr ""
"Sección [%2d] '%s': referencia de sección en sh_link no es una tabla de "
"símbolos\n"
-#: src/elflint.c:2613
+#: src/elflint.c:2642
#, c-format
msgid "section [%2d] '%s': invalid symbol index in sh_info\n"
msgstr "Sección [%2d] '%s': índice de símbolo inválido en sh_info\n"
-#: src/elflint.c:2618
+#: src/elflint.c:2647
#, c-format
msgid "section [%2d] '%s': sh_flags not zero\n"
msgstr "Sección [%2d] '%s': sh_flags no cero\n"
-#: src/elflint.c:2625
+#: src/elflint.c:2654
#, c-format
msgid "section [%2d] '%s': cannot get symbol for signature\n"
msgstr "Sección [%2d] '%s': no puede obtener símbolo para firma\n"
-#: src/elflint.c:2629
+#: src/elflint.c:2658
#, fuzzy, c-format
msgid "section [%2d] '%s': cannot get symbol name for signature\n"
msgstr "Sección [%2d] '%s': no puede obtener símbolo para firma\n"
-#: src/elflint.c:2634
+#: src/elflint.c:2663
#, c-format
msgid "section [%2d] '%s': signature symbol cannot be empty string\n"
msgstr ""
"sección [%2d] '%s': el símbolo de firma no puede ser una cadena vacía\n"
-#: src/elflint.c:2640
+#: src/elflint.c:2669
#, c-format
msgid "section [%2d] '%s': sh_flags not set correctly\n"
msgstr "Sección [%2d] '%s': sh_flags no establecida correctamente\n"
-#: src/elflint.c:2646
+#: src/elflint.c:2675
#, c-format
msgid "section [%2d] '%s': cannot get data: %s\n"
msgstr "Sección [%2d] '%s': no puede obtener datos: %s\n"
-#: src/elflint.c:2655
+#: src/elflint.c:2684
#, c-format
msgid "section [%2d] '%s': section size not multiple of sizeof(Elf32_Word)\n"
msgstr ""
"Sección [%2d] '%s': tamaño de sección no es múltiplo de tamaño de "
"(Elf32_Word)\n"
-#: src/elflint.c:2660
+#: src/elflint.c:2690
#, c-format
msgid "section [%2d] '%s': section group without flags word\n"
msgstr "Sección [%2d] '%s': grupo de sección sin palabra de banderas\n"
-#: src/elflint.c:2666
+#: src/elflint.c:2698
#, c-format
msgid "section [%2d] '%s': section group without member\n"
msgstr "Sección [%2d] '%s': grupo de sección sin miembro\n"
-#: src/elflint.c:2670
+#: src/elflint.c:2702
#, c-format
msgid "section [%2d] '%s': section group with only one member\n"
msgstr "Sección [%2d] '%s': grupo de sección con sólo un miembro\n"
-#: src/elflint.c:2681
+#: src/elflint.c:2713
#, c-format
msgid "section [%2d] '%s': unknown section group flags\n"
msgstr "Sección [%2d] '%s': banderas de grupo de sección desconocido\n"
-#: src/elflint.c:2693
+#: src/elflint.c:2725
#, fuzzy, c-format
msgid "section [%2d] '%s': section index %zu out of range\n"
msgstr "Sección [%2d] '%s': índice de sección %Zu fuera de rango\n"
-#: src/elflint.c:2702
+#: src/elflint.c:2734
#, c-format
msgid "section [%2d] '%s': cannot get section header for element %zu: %s\n"
msgstr ""
"Sección [%2d] '%s': no se puede obtener encabezamiento de sección para "
"elemento %zu: %s\n"
-#: src/elflint.c:2709
+#: src/elflint.c:2741
#, c-format
msgid "section [%2d] '%s': section group contains another group [%2d] '%s'\n"
msgstr "Sección [%2d] '%s': grupo de sección contiene otro grupo [%2d] '%s'\n"
-#: src/elflint.c:2715
+#: src/elflint.c:2747
#, fuzzy, c-format
msgid ""
"section [%2d] '%s': element %zu references section [%2d] '%s' without "
@@ -2452,12 +2601,12 @@
"Sección [%2d] '%s': elemento %Zu hace referencia a sección [%2d] '%s' sin "
"establecer bandera SHF_GROUP\n"
-#: src/elflint.c:2722
+#: src/elflint.c:2754
#, c-format
msgid "section [%2d] '%s' is contained in more than one section group\n"
msgstr "Sección [%2d] '%s' está contenida en más de un grupo de sección\n"
-#: src/elflint.c:2912
+#: src/elflint.c:2944
#, c-format
msgid ""
"section [%2d] '%s' refers in sh_link to section [%2d] '%s' which is no "
@@ -2466,7 +2615,7 @@
"Sección [%2d] '%s' se refiere en sh_link a la sección [%2d] '%s' la cual no "
"es una tabla de símbolos dinámicos\n"
-#: src/elflint.c:2924
+#: src/elflint.c:2956
#, c-format
msgid ""
"section [%2d] '%s' has different number of entries than symbol table [%2d] "
@@ -2475,29 +2624,29 @@
"Sección [%2d] '%s' tiene un número diferente de entradas a la de la tabla de "
"símbolos [%2d] '%s'\n"
-#: src/elflint.c:2940
+#: src/elflint.c:2972
#, c-format
msgid "section [%2d] '%s': symbol %d: cannot read version data\n"
msgstr ""
"Sección [%2d] '%s': el símbolo %d: no se pueden leer datos de versión\n"
-#: src/elflint.c:2956
+#: src/elflint.c:2988
#, c-format
msgid "section [%2d] '%s': symbol %d: local symbol with global scope\n"
msgstr ""
"Sección [%2d] '%s': el símbolo %d: el símbolo local con alcance mundial\n"
-#: src/elflint.c:2964
+#: src/elflint.c:2996
#, c-format
msgid "section [%2d] '%s': symbol %d: local symbol with version\n"
msgstr "Sección [%2d] '%s': símbolo %d: símbolo local con versión\n"
-#: src/elflint.c:2978
+#: src/elflint.c:3010
#, c-format
msgid "section [%2d] '%s': symbol %d: invalid version index %d\n"
msgstr "Sección [%2d] '%s': símbolo %d: índice de versión inválida %d\n"
-#: src/elflint.c:2983
+#: src/elflint.c:3015
#, c-format
msgid ""
"section [%2d] '%s': symbol %d: version index %d is for defined version\n"
@@ -2505,7 +2654,7 @@
"Sección [%2d] '%s': símbolo %d: índice de versión %d es para versión "
"definida\n"
-#: src/elflint.c:2993
+#: src/elflint.c:3025
#, c-format
msgid ""
"section [%2d] '%s': symbol %d: version index %d is for requested version\n"
@@ -2513,46 +2662,46 @@
"Sección [%2d] '%s': símbolo %d: índice de versión %d es para la versión "
"solicitada\n"
-#: src/elflint.c:3046
+#: src/elflint.c:3078
#, c-format
msgid "more than one version reference section present\n"
msgstr "Más de una sección de referencia de versión presente\n"
-#: src/elflint.c:3054 src/elflint.c:3201
+#: src/elflint.c:3086 src/elflint.c:3233
#, c-format
msgid "section [%2d] '%s': sh_link does not link to string table\n"
msgstr "Sección [%2d] '%s': sh_link no se enlaza a la tabla de cadenas\n"
-#: src/elflint.c:3079 src/elflint.c:3255
+#: src/elflint.c:3111 src/elflint.c:3287
#, c-format
msgid "section [%2d] '%s': entry %d has wrong version %d\n"
msgstr "Sección [%2d] '%s': entrada %d tiene versión %d errada\n"
-#: src/elflint.c:3086 src/elflint.c:3262
+#: src/elflint.c:3118 src/elflint.c:3294
#, c-format
msgid "section [%2d] '%s': entry %d has wrong offset of auxiliary data\n"
msgstr ""
"Sección [%2d] '%s': entrada %d tiene compensación errada de datos "
"auxiliares\n"
-#: src/elflint.c:3096
+#: src/elflint.c:3128
#, c-format
msgid "section [%2d] '%s': entry %d has invalid file reference\n"
msgstr "Sección [%2d] '%s': entrada %d tiene referencia de archivo inválida\n"
-#: src/elflint.c:3104
+#: src/elflint.c:3136
#, c-format
msgid "section [%2d] '%s': entry %d references unknown dependency\n"
msgstr "Sección [%2d] '%s': %d hace referencia a dependencia desconocida\n"
-#: src/elflint.c:3116
+#: src/elflint.c:3148
#, c-format
msgid "section [%2d] '%s': auxiliary entry %d of entry %d has unknown flag\n"
msgstr ""
"sección [%2d] '%s': entrada auxiliar %d de entrada %d tiene bandera "
"desconocida\n"
-#: src/elflint.c:3124
+#: src/elflint.c:3156
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has invalid name "
@@ -2561,7 +2710,7 @@
"Sección [%2d] '%s': entrada auxiliar %d de entrada %d tiene referencia de "
"nombre inválida\n"
-#: src/elflint.c:3133
+#: src/elflint.c:3165
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has wrong hash value: "
@@ -2570,7 +2719,7 @@
"Sección [%2d] '%s': entrada auxiliar %d de entrada %d tiene valor de "
"dispersión: %#x, esperado %#x\n"
-#: src/elflint.c:3142
+#: src/elflint.c:3174
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has duplicate version "
@@ -2579,7 +2728,7 @@
"sección [%2d] '%s': entrada auxiliar %d de entrada %d tiene nombre duplicado "
"'%s'\n"
-#: src/elflint.c:3153
+#: src/elflint.c:3185
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has wrong next field\n"
@@ -2587,14 +2736,14 @@
"sección [%2d] '%s': entrada auxiliar %d de entrada %d tiene próximo campo "
"errado\n"
-#: src/elflint.c:3170 src/elflint.c:3346
+#: src/elflint.c:3202 src/elflint.c:3378
#, c-format
msgid "section [%2d] '%s': entry %d has invalid offset to next entry\n"
msgstr ""
"sección [%2d] '%s': entrada %d tiene compensación inválida para próxima "
"entrada\n"
-#: src/elflint.c:3178 src/elflint.c:3354
+#: src/elflint.c:3210 src/elflint.c:3386
#, fuzzy, c-format
msgid ""
"section [%2d] '%s': entry %d has zero offset to next entry, but sh_info says "
@@ -2603,46 +2752,46 @@
"sección [%2d] '%s': entrada %d tiene compensación inválida para próxima "
"entrada\n"
-#: src/elflint.c:3193
+#: src/elflint.c:3225
#, c-format
msgid "more than one version definition section present\n"
msgstr "más de una definición de versión presente de sección\n"
-#: src/elflint.c:3240
+#: src/elflint.c:3272
#, c-format
msgid "section [%2d] '%s': more than one BASE definition\n"
msgstr "Sección [%2d] '%s': más de una definición de BASE\n"
-#: src/elflint.c:3244
+#: src/elflint.c:3276
#, c-format
msgid "section [%2d] '%s': BASE definition must have index VER_NDX_GLOBAL\n"
msgstr ""
"Sección [%2d] '%s': definición de BASE debe tener índice VER_NDX_GLOBAL\n"
-#: src/elflint.c:3250
+#: src/elflint.c:3282
#, c-format
msgid "section [%2d] '%s': entry %d has unknown flag\n"
msgstr "Sección [%2d] '%s': entrada %d tiene bandera desconocida\n"
-#: src/elflint.c:3277
+#: src/elflint.c:3309
#, c-format
msgid "section [%2d] '%s': entry %d has invalid name reference\n"
msgstr "Sección [%2d] '%s': entrada %d tiene referencia de nombre inválida\n"
-#: src/elflint.c:3284
+#: src/elflint.c:3316
#, c-format
msgid "section [%2d] '%s': entry %d has wrong hash value: %#x, expected %#x\n"
msgstr ""
"Sección [%2d] '%s': entrada %d tiene valor de dispersión errado: %#x, "
"esperado %#x\n"
-#: src/elflint.c:3292
+#: src/elflint.c:3324
#, c-format
msgid "section [%2d] '%s': entry %d has duplicate version name '%s'\n"
msgstr ""
"Sección [%2d] '%s': entrada %d tiene nombre de versión duplicado '%s'\n"
-#: src/elflint.c:3312
+#: src/elflint.c:3344
#, c-format
msgid ""
"section [%2d] '%s': entry %d has invalid name reference in auxiliary data\n"
@@ -2650,34 +2799,34 @@
"Sección [%2d] '%s': entrada %d tiene referencia de nombre inválida en datos "
"auxiliares\n"
-#: src/elflint.c:3329
+#: src/elflint.c:3361
#, c-format
msgid "section [%2d] '%s': entry %d has wrong next field in auxiliary data\n"
msgstr ""
"Sección [%2d] '%s': entrada %d tiene próximo campo errado en datos "
"auxiliares\n"
-#: src/elflint.c:3362
+#: src/elflint.c:3394
#, c-format
msgid "section [%2d] '%s': no BASE definition\n"
msgstr "Sección [%2d] '%s': no hay definición de BASE\n"
-#: src/elflint.c:3378
+#: src/elflint.c:3410
#, c-format
msgid "section [%2d] '%s': unknown parent version '%s'\n"
msgstr "Sección [%2d] '%s': desconocida versión principal '%s'\n"
-#: src/elflint.c:3391
+#: src/elflint.c:3423
#, c-format
msgid "section [%2d] '%s': empty object attributes section\n"
msgstr "Sección [%2d] '%s': sección de atributos de objeto vacío\n"
-#: src/elflint.c:3412
+#: src/elflint.c:3444
#, c-format
msgid "section [%2d] '%s': unrecognized attribute format\n"
msgstr "Sección[%2d] '%s': formato de atributo no reconocido\n"
-#: src/elflint.c:3428
+#: src/elflint.c:3460
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: zero length field in attribute section\n"
@@ -2685,21 +2834,21 @@
"Sección[%2d] '%s': compensación %zu: campo de longitud cero en sección de "
"atributo\n"
-#: src/elflint.c:3437
+#: src/elflint.c:3469
#, c-format
msgid "section [%2d] '%s': offset %zu: invalid length in attribute section\n"
msgstr ""
"Sección[%2d] '%s': compensación %zu: longitud inválida en sección de "
"atributo\n"
-#: src/elflint.c:3449
+#: src/elflint.c:3481
#, c-format
msgid "section [%2d] '%s': offset %zu: unterminated vendor name string\n"
msgstr ""
"Sección[%2d] '%s': compensación %zu: cadena de nombre de proveedor sin "
"terminar\n"
-#: src/elflint.c:3466
+#: src/elflint.c:3498
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: endless ULEB128 in attribute subsection tag\n"
@@ -2707,12 +2856,12 @@
"Sección [%2d] '%s': compensación %zu: sin fin ULEB128 en etiqueta de sub-"
"sección de atributo\n"
-#: src/elflint.c:3475
+#: src/elflint.c:3507
#, c-format
msgid "section [%2d] '%s': offset %zu: truncated attribute section\n"
msgstr "Sección [%2d] '%s': compensación %zu: sección de atributo truncado\n"
-#: src/elflint.c:3484
+#: src/elflint.c:3516
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: zero length field in attribute subsection\n"
@@ -2720,7 +2869,7 @@
"Sección [%2d] '%s': compensación %zu: campo de longitud cero length en sub-"
"sección de atributo\n"
-#: src/elflint.c:3499
+#: src/elflint.c:3531
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: invalid length in attribute subsection\n"
@@ -2728,7 +2877,8 @@
"Sección [%2d] '%s': compensación %zu: longitud inválida en sub-sección de "
"atributo\n"
-#: src/elflint.c:3510
+#. Tag_File
+#: src/elflint.c:3542
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: attribute subsection has unexpected tag %u\n"
@@ -2736,26 +2886,26 @@
"Sección[%2d] '%s': compensación %zu: sub-sección de atributo tiene etiqueta "
"inesperada %u\n"
-#: src/elflint.c:3528
+#: src/elflint.c:3560
#, c-format
msgid "section [%2d] '%s': offset %zu: endless ULEB128 in attribute tag\n"
msgstr ""
"Sección[%2d] '%s': compensación %zu: sin fin ULEB128 en etiqueta de "
"atributo\n"
-#: src/elflint.c:3539
+#: src/elflint.c:3571
#, c-format
msgid "section [%2d] '%s': offset %zu: unterminated string in attribute\n"
msgstr ""
"Sección [%2d] '%s': compensación %zu: cadena sin terminar en atributo\n"
-#: src/elflint.c:3552
+#: src/elflint.c:3584
#, c-format
msgid "section [%2d] '%s': offset %zu: unrecognized attribute tag %u\n"
msgstr ""
"Sección [%2d] '%s': compensación %zu: etiqueta de atributo no reconocida %u\n"
-#: src/elflint.c:3556
+#: src/elflint.c:3588
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: unrecognized %s attribute value %<PRIu64>\n"
@@ -2763,12 +2913,12 @@
"Sección [%2d] '%s': compensación %zu: no reconocido %s valor de atributo "
"%<PRIu64>\n"
-#: src/elflint.c:3566
+#: src/elflint.c:3598
#, c-format
msgid "section [%2d] '%s': offset %zu: vendor '%s' unknown\n"
msgstr "Sección [%2d] '%s': compensación %zu: proveedor '%s' desconocido\n"
-#: src/elflint.c:3572
+#: src/elflint.c:3604
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: extra bytes after last attribute section\n"
@@ -2776,47 +2926,47 @@
"Sección [%2d] '%s': compensación %zu: extra bytes después de la última "
"sección de atributo\n"
-#: src/elflint.c:3661
+#: src/elflint.c:3693
#, c-format
msgid "cannot get section header of zeroth section\n"
msgstr "no puede obtener encabezamiento de sección de sección zeroth\n"
-#: src/elflint.c:3665
+#: src/elflint.c:3697
#, c-format
msgid "zeroth section has nonzero name\n"
msgstr "Sección zeroth tiene nombre nonzero\n"
-#: src/elflint.c:3667
+#: src/elflint.c:3699
#, c-format
msgid "zeroth section has nonzero type\n"
msgstr "Sección zeroth tiene tipo nonzero\n"
-#: src/elflint.c:3669
+#: src/elflint.c:3701
#, c-format
msgid "zeroth section has nonzero flags\n"
msgstr "Sección zeroth tiene banderas nonzero\n"
-#: src/elflint.c:3671
+#: src/elflint.c:3703
#, c-format
msgid "zeroth section has nonzero address\n"
msgstr "Sección zeroth tiene dirección nonzero\n"
-#: src/elflint.c:3673
+#: src/elflint.c:3705
#, c-format
msgid "zeroth section has nonzero offset\n"
msgstr "Sección zeroth tiene compensación nonzero\n"
-#: src/elflint.c:3675
+#: src/elflint.c:3707
#, c-format
msgid "zeroth section has nonzero align value\n"
msgstr "Sección zeroth tiene valor de alineación nonzero\n"
-#: src/elflint.c:3677
+#: src/elflint.c:3709
#, c-format
msgid "zeroth section has nonzero entry size value\n"
msgstr "Sección zeroth tiene valor de tamaño de entrada nonzero\n"
-#: src/elflint.c:3680
+#: src/elflint.c:3712
#, c-format
msgid ""
"zeroth section has nonzero size value while ELF header has nonzero shnum "
@@ -2825,7 +2975,7 @@
"Sección zeroth tiene valor de tamaño nonzero mientras que el encabezamiento "
"ELF tiene valor shnum nonzero\n"
-#: src/elflint.c:3684
+#: src/elflint.c:3716
#, c-format
msgid ""
"zeroth section has nonzero link value while ELF header does not signal "
@@ -2834,7 +2984,7 @@
"Sección zeroth tiene valor de enlace nonzero mientras que el encabezamiento "
"ELF no señala sobreflujo en shstrndx\n"
-#: src/elflint.c:3688
+#: src/elflint.c:3720
#, c-format
msgid ""
"zeroth section has nonzero link value while ELF header does not signal "
@@ -2843,27 +2993,27 @@
"la sección zeroth tiene un valor de enlace distinto a cero mientras que el "
"encabezamiento ELF no señala desbordamiento en phnum\n"
-#: src/elflint.c:3706
+#: src/elflint.c:3738
#, c-format
msgid "cannot get section header for section [%2zu] '%s': %s\n"
msgstr "No se puede obtener encabezamiento para sección [%2zu] '%s': %s\n"
-#: src/elflint.c:3715
+#: src/elflint.c:3747
#, c-format
msgid "section [%2zu]: invalid name\n"
msgstr "Sección [%2zu]: nombre inválido\n"
-#: src/elflint.c:3742
+#: src/elflint.c:3774
#, c-format
msgid "section [%2d] '%s' has wrong type: expected %s, is %s\n"
msgstr "Sección [%2d] '%s' tiene tipo errado: %s esperado, es %s\n"
-#: src/elflint.c:3760
+#: src/elflint.c:3792
#, c-format
msgid "section [%2zu] '%s' has wrong flags: expected %s, is %s\n"
msgstr "Sección [%2zu] '%s' tiene banderas erradas: %s esperado, es %s\n"
-#: src/elflint.c:3778
+#: src/elflint.c:3810
#, c-format
msgid ""
"section [%2zu] '%s' has wrong flags: expected %s and possibly %s, is %s\n"
@@ -2871,12 +3021,12 @@
"Sección [%2zu] '%s' tiene banderas erradas: %s esperado y posiblemente %s, "
"es %s\n"
-#: src/elflint.c:3796
+#: src/elflint.c:3828
#, c-format
msgid "section [%2zu] '%s' present in object file\n"
msgstr "Sección [%2zu] '%s' presente en archivo objeto\n"
-#: src/elflint.c:3802 src/elflint.c:3834
+#: src/elflint.c:3834 src/elflint.c:3866
#, c-format
msgid ""
"section [%2zu] '%s' has SHF_ALLOC flag set but there is no loadable segment\n"
@@ -2884,7 +3034,7 @@
"Sección [%2zu] '%s' tiene bandera SHF_ALLOC establecida pero no es un "
"segmento cargable\n"
-#: src/elflint.c:3807 src/elflint.c:3839
+#: src/elflint.c:3839 src/elflint.c:3871
#, c-format
msgid ""
"section [%2zu] '%s' has SHF_ALLOC flag not set but there are loadable "
@@ -2893,7 +3043,7 @@
"Sección [%2zu] '%s' no tiene bandera SHF_ALLOC establecida pero hay "
"segmentos cargables\n"
-#: src/elflint.c:3815
+#: src/elflint.c:3847
#, c-format
msgid ""
"section [%2zu] '%s' is extension section index table in non-object file\n"
@@ -2901,22 +3051,22 @@
"Sección [%2zu] '%s' es tabla de índice de sección de extensión en archivo no-"
"objeto\n"
-#: src/elflint.c:3858
+#: src/elflint.c:3890
#, c-format
msgid "section [%2zu] '%s': size not multiple of entry size\n"
msgstr "Sección [%2zu] '%s': tamaño no es múltiplo de tamaño de entrada\n"
-#: src/elflint.c:3863
+#: src/elflint.c:3895
#, c-format
msgid "cannot get section header\n"
msgstr "no se puede obtener encabezamiento de sección\n"
-#: src/elflint.c:3873
+#: src/elflint.c:3905
#, c-format
msgid "section [%2zu] '%s' has unsupported type %d\n"
msgstr "sección [%2zu] '%s' tiene tipo %d incompatible \n"
-#: src/elflint.c:3888
+#: src/elflint.c:3920
#, c-format
msgid ""
"section [%2zu] '%s' contains invalid processor-specific flag(s) %#<PRIx64>\n"
@@ -2924,76 +3074,76 @@
"Sección [%2zu] '%s' contiene bandera(s) de procesador-específico inválidas "
"%#<PRIx64>\n"
-#: src/elflint.c:3895
+#: src/elflint.c:3927
#, c-format
msgid "section [%2zu] '%s' contains unknown flag(s) %#<PRIx64>\n"
msgstr "Sección [%2zu] '%s' contiene bandera(s) desconocidas %#<PRIx64>\n"
-#: src/elflint.c:3903
+#: src/elflint.c:3935
#, c-format
msgid "section [%2zu] '%s': thread-local data sections address not zero\n"
msgstr ""
"Sección [%2zu] '%s': dirección de secciones de datos de hilo-local no cero\n"
-#: src/elflint.c:3913
+#: src/elflint.c:3945
#, fuzzy, c-format
msgid "section [%2zu] '%s': allocated section cannot be compressed\n"
msgstr ""
"Sección [%2zu] '%s': dirección de secciones de datos de hilo-local no cero\n"
-#: src/elflint.c:3918
+#: src/elflint.c:3950
#, fuzzy, c-format
msgid "section [%2zu] '%s': nobits section cannot be compressed\n"
msgstr "Sección [%2d] '%s': no hay sección de dispersión presente\n"
-#: src/elflint.c:3924
+#: src/elflint.c:3956
#, fuzzy, c-format
msgid ""
"section [%2zu] '%s': compressed section with no compression header: %s\n"
msgstr "Sección [%2d] '%s': grupo de sección con sólo un miembro\n"
-#: src/elflint.c:3930
+#: src/elflint.c:3962
#, c-format
msgid "section [%2zu] '%s': invalid section reference in link value\n"
msgstr ""
"Sección [%2zu] '%s': referencia de sección inválida en valor de enlace\n"
-#: src/elflint.c:3935
+#: src/elflint.c:3967
#, c-format
msgid "section [%2zu] '%s': invalid section reference in info value\n"
msgstr ""
"Sección [%2zu] '%s': referencia de sección inválida en valor de información\n"
-#: src/elflint.c:3942
+#: src/elflint.c:3974
#, c-format
msgid "section [%2zu] '%s': strings flag set without merge flag\n"
msgstr ""
"Sección [%2zu] '%s': bandera de cadenas establecida sin bandera de fusión\n"
-#: src/elflint.c:3947
+#: src/elflint.c:3979
#, c-format
msgid "section [%2zu] '%s': merge flag set but entry size is zero\n"
msgstr ""
"Sección [%2zu] '%s': bandera de fusión establecida pero tamaño de entrada es "
"cero\n"
-#: src/elflint.c:3965
+#: src/elflint.c:3998
#, c-format
msgid "section [%2zu] '%s' has unexpected type %d for an executable section\n"
msgstr ""
"Sección [%2zu] '%s' tiene un tipo %d inesperado para una sección ejecutable\n"
-#: src/elflint.c:3974
+#: src/elflint.c:4007
#, fuzzy, c-format
msgid "section [%2zu] '%s' must be of type NOBITS in debuginfo files\n"
msgstr "sección [%2zu] '%s' no debe tener permiso de escritura\n"
-#: src/elflint.c:3981
+#: src/elflint.c:4014
#, c-format
msgid "section [%2zu] '%s' is both executable and writable\n"
msgstr "Sección [%2zu] '%s' es tanto de ejecución como de escritura\n"
-#: src/elflint.c:4012
+#: src/elflint.c:4045
#, c-format
msgid ""
"section [%2zu] '%s' not fully contained in segment of program header entry "
@@ -3002,7 +3152,7 @@
"Sección [%2zu] '%s' no contenida totalmente en segmento de entrada de "
"encabezamiento de programa %d\n"
-#: src/elflint.c:4022
+#: src/elflint.c:4055
#, c-format
msgid ""
"section [%2zu] '%s' has type NOBITS but is read from the file in segment of "
@@ -3011,7 +3161,7 @@
"Sección [%2zu] '%s' no tiene tipo NOBITS pero es leída desde el archivo en "
"segmento de entrada de encabezamiento de programa %d\n"
-#: src/elflint.c:4048
+#: src/elflint.c:4081
#, fuzzy, c-format
msgid ""
"section [%2zu] '%s' has type NOBITS but is read from the file in segment of "
@@ -3020,7 +3170,7 @@
"Sección [%2zu] '%s' no tiene tipo NOBITS pero es leída desde el archivo en "
"segmento de entrada de encabezamiento de programa %d\n"
-#: src/elflint.c:4059
+#: src/elflint.c:4092
#, c-format
msgid ""
"section [%2zu] '%s' has not type NOBITS but is not read from the file in "
@@ -3029,18 +3179,18 @@
"Sección [%2zu] '%s' no tiene tipo NOBITS pero no es leída desde el fichero "
"en segmento de entrada de encabezamiento de programa %d\n"
-#: src/elflint.c:4070
+#: src/elflint.c:4103
#, c-format
msgid "section [%2zu] '%s' is executable in nonexecutable segment %d\n"
msgstr "Sección [%2zu] '%s' es ejecutable en segmento no ejecutable %d\n"
-#: src/elflint.c:4080
+#: src/elflint.c:4113
#, c-format
msgid "section [%2zu] '%s' is writable in unwritable segment %d\n"
msgstr ""
"Sección [%2zu] '%s' es de escritura en segmento que no es de escritura %d\n"
-#: src/elflint.c:4090
+#: src/elflint.c:4123
#, c-format
msgid ""
"section [%2zu] '%s': alloc flag set but section not in any loaded segment\n"
@@ -3048,7 +3198,7 @@
"Sección [%2zu] '%s': asignación de bandera establecida pero sección no en "
"ningún segmento cargado\n"
-#: src/elflint.c:4096
+#: src/elflint.c:4129
#, c-format
msgid ""
"section [%2zu] '%s': ELF header says this is the section header string table "
@@ -3057,7 +3207,7 @@
"Sección [%2zu] '%s': encabezamiento ELF dice esta es la tabla de cadena de "
"encabezamiento de sección, pero el tipo no es SHT_TYPE\n"
-#: src/elflint.c:4104
+#: src/elflint.c:4137
#, c-format
msgid ""
"section [%2zu] '%s': relocatable files cannot have dynamic symbol tables\n"
@@ -3065,32 +3215,32 @@
"sección [%2zu] '%s': ficheros reubicables no pueden tener tablas de símbolos "
"dinámicos\n"
-#: src/elflint.c:4155
+#: src/elflint.c:4188
#, c-format
msgid "more than one version symbol table present\n"
msgstr "Más de una tabla de símbolos presente\n"
-#: src/elflint.c:4178
+#: src/elflint.c:4211
#, c-format
msgid "INTERP program header entry but no .interp section\n"
msgstr ""
"Entrada de encabezamiento de programa INTERP pero no la sección .interp\n"
-#: src/elflint.c:4189
+#: src/elflint.c:4222
#, c-format
msgid ""
"loadable segment [%u] is executable but contains no executable sections\n"
msgstr ""
"segmento cargable [%u] es ejecutable pero no contiene secciones ejecutables\n"
-#: src/elflint.c:4195
+#: src/elflint.c:4228
#, c-format
msgid "loadable segment [%u] is writable but contains no writable sections\n"
msgstr ""
"segmento cargable [%u] es de escritura pero contiene secciones protegidas "
"contra escritura\n"
-#: src/elflint.c:4206
+#: src/elflint.c:4239
#, c-format
msgid ""
"no .gnu.versym section present but .gnu.versym_d or .gnu.versym_r section "
@@ -3099,26 +3249,26 @@
"Sección no .gnu.versym presente, pero la sección .gnu.versym_d o la sección ."
"gnu.versym_r existen\n"
-#: src/elflint.c:4219
+#: src/elflint.c:4252
#, c-format
msgid "duplicate version index %d\n"
msgstr "Duplicar índice de versión %d\n"
-#: src/elflint.c:4233
+#: src/elflint.c:4266
#, c-format
msgid ".gnu.versym section present without .gnu.versym_d or .gnu.versym_r\n"
msgstr ""
"Sección .gnu.versym presente sin las secciones .gnu.versym_d o .gnu."
"versym_r\n"
-#: src/elflint.c:4282
+#: src/elflint.c:4315
#, c-format
msgid "phdr[%d]: unknown core file note type %<PRIu32> at offset %<PRIu64>\n"
msgstr ""
"phdr[%d]: tipo de nota de fichero core desconocido %<PRIu32> en compensación "
"%<PRIu64>\n"
-#: src/elflint.c:4286
+#: src/elflint.c:4319
#, fuzzy, c-format
msgid ""
"section [%2d] '%s': unknown core file note type %<PRIu32> at offset %zu\n"
@@ -3126,14 +3276,14 @@
"Sección [%2d] '%s': tipo de nota de fichero core desconocido %<PRIu32> en "
"compensación %Zu\n"
-#: src/elflint.c:4309
+#: src/elflint.c:4342
#, fuzzy, c-format
msgid "phdr[%d]: unknown object file note type %<PRIu32> at offset %zu\n"
msgstr ""
"phdr[%d]: tipo de nota de fichero objeto desconocido %<PRIu32> en "
"compensación %Zu\n"
-#: src/elflint.c:4313
+#: src/elflint.c:4346
#, fuzzy, c-format
msgid ""
"section [%2d] '%s': unknown object file note type %<PRIu32> at offset %zu\n"
@@ -3141,40 +3291,40 @@
"Sección [%2d] '%s': tipo de nota de fichero objeto desconocido %<PRIu32> en "
"compensación %Zu\n"
-#: src/elflint.c:4330
+#: src/elflint.c:4363
#, c-format
msgid "phdr[%d]: no note entries defined for the type of file\n"
msgstr "phdr[%d]: no hay entradas de nota definidas para el tipo de archivo\n"
-#: src/elflint.c:4349
+#: src/elflint.c:4382
#, c-format
msgid "phdr[%d]: cannot get content of note section: %s\n"
msgstr "phdr[%d]: no puede obtener contenido de sección de nota: %s\n"
-#: src/elflint.c:4352
+#: src/elflint.c:4385
#, c-format
msgid "phdr[%d]: extra %<PRIu64> bytes after last note\n"
msgstr "phdr[%d]: extra %<PRIu64> bytes después de la última nota\n"
-#: src/elflint.c:4373
+#: src/elflint.c:4406
#, c-format
msgid "section [%2d] '%s': no note entries defined for the type of file\n"
msgstr ""
"Sección [%2d] '%s': no hay entradas de nota definidas para el tipo de "
"archivo\n"
-#: src/elflint.c:4380
+#: src/elflint.c:4413
#, c-format
msgid "section [%2d] '%s': cannot get content of note section\n"
msgstr ""
"Sección[%2d] '%s': no se puede obtener el contenido de sección de nota\n"
-#: src/elflint.c:4383
+#: src/elflint.c:4416
#, c-format
msgid "section [%2d] '%s': extra %<PRIu64> bytes after last note\n"
msgstr "Sección[%2d] '%s': extra %<PRIu64> bytes después de la última nota\n"
-#: src/elflint.c:4401
+#: src/elflint.c:4434
#, c-format
msgid ""
"only executables, shared objects, and core files can have program headers\n"
@@ -3182,145 +3332,145 @@
"Sólo ejecutables, objetos compartidos y ficheros core pueden tener "
"encabezamientos de programas\n"
-#: src/elflint.c:4416
+#: src/elflint.c:4449
#, c-format
msgid "cannot get program header entry %d: %s\n"
msgstr "no se puede obtener entrada de encabezamiento %d: %s\n"
-#: src/elflint.c:4425
+#: src/elflint.c:4458
#, c-format
msgid "program header entry %d: unknown program header entry type %#<PRIx64>\n"
msgstr ""
"entrada de encabezamiento de programa %d: tipo %#<PRIx64> de entrada de "
"encabezamiento de programa desconocido\n"
-#: src/elflint.c:4436
+#: src/elflint.c:4469
#, c-format
msgid "more than one INTERP entry in program header\n"
msgstr "Más de una entrada INTERP en encabezamiento de programa\n"
-#: src/elflint.c:4444
+#: src/elflint.c:4477
#, c-format
msgid "more than one TLS entry in program header\n"
msgstr "más de una entrada TLS en encabezamiento de programa\n"
-#: src/elflint.c:4451
+#: src/elflint.c:4484
#, c-format
msgid "static executable cannot have dynamic sections\n"
msgstr "ejecutable estático no puede tener secciones dinámicas\n"
-#: src/elflint.c:4465
+#: src/elflint.c:4498
#, c-format
msgid "dynamic section reference in program header has wrong offset\n"
msgstr ""
"Referencia de sección dinámica en encabezamiento de programa tiene "
"compensación errada\n"
-#: src/elflint.c:4468
+#: src/elflint.c:4501
#, c-format
msgid "dynamic section size mismatch in program and section header\n"
msgstr ""
"No coinciden tamaño de sección dinámica en programa y encabezamiento de "
"sección\n"
-#: src/elflint.c:4478
+#: src/elflint.c:4511
#, c-format
msgid "more than one GNU_RELRO entry in program header\n"
msgstr "Más de una entrada GNU_RELRO en encabezamiento de programa\n"
-#: src/elflint.c:4499
+#: src/elflint.c:4532
#, c-format
msgid "loadable segment GNU_RELRO applies to is not writable\n"
msgstr "Segmento cargable GNU_RELRO que se aplica no es de escritura\n"
-#: src/elflint.c:4510
+#: src/elflint.c:4543
#, c-format
msgid "loadable segment [%u] flags do not match GNU_RELRO [%u] flags\n"
msgstr ""
"Banderas de segmento cargable [%u] no coinciden con banderas GNU_RELRO [%u]\n"
-#: src/elflint.c:4517
+#: src/elflint.c:4550
#, c-format
msgid ""
"GNU_RELRO [%u] flags are not a subset of the loadable segment [%u] flags\n"
msgstr ""
-#: src/elflint.c:4526 src/elflint.c:4549
+#: src/elflint.c:4559 src/elflint.c:4582
#, c-format
msgid "%s segment not contained in a loaded segment\n"
msgstr "Segmento %s no contenido en un segmento cargable\n"
-#: src/elflint.c:4555
+#: src/elflint.c:4588
#, c-format
msgid "program header offset in ELF header and PHDR entry do not match"
msgstr ""
"Compensación de encabezamiento de programa en encabezamiento ELF y entrada "
"PHDR no coinciden"
-#: src/elflint.c:4580
+#: src/elflint.c:4613
#, c-format
msgid "call frame search table reference in program header has wrong offset\n"
msgstr ""
"Referencia de tabla de búsqueda de marco de llamada en encabezamiento de "
"programa tiene una compensación errada\n"
-#: src/elflint.c:4583
+#: src/elflint.c:4616
#, c-format
msgid "call frame search table size mismatch in program and section header\n"
msgstr ""
"Tamaño de tabla de búsqueda de marco de llamada no coincide con programa y "
"encabezamiento de sección\n"
-#: src/elflint.c:4596
+#: src/elflint.c:4629
#, c-format
msgid "PT_GNU_EH_FRAME present but no .eh_frame_hdr section\n"
msgstr "PT_GNU_EH_FRAME presente pero no la sección.eh_frame_hdr\n"
-#: src/elflint.c:4604
+#: src/elflint.c:4637
#, c-format
msgid "call frame search table must be allocated\n"
msgstr "tabla de búsqueda de marco de llamada debe ser asignada\n"
-#: src/elflint.c:4607
+#: src/elflint.c:4640
#, c-format
msgid "section [%2zu] '%s' must be allocated\n"
msgstr "sección [%2zu] '%s' debe ser asignada\n"
-#: src/elflint.c:4611
+#: src/elflint.c:4644
#, c-format
msgid "call frame search table must not be writable\n"
msgstr ""
"tabla de búsqueda de marco de llamada no debe tener permiso de escritura\n"
-#: src/elflint.c:4614
+#: src/elflint.c:4647
#, c-format
msgid "section [%2zu] '%s' must not be writable\n"
msgstr "sección [%2zu] '%s' no debe tener permiso de escritura\n"
-#: src/elflint.c:4619
+#: src/elflint.c:4652
#, c-format
msgid "call frame search table must not be executable\n"
msgstr "tabla de búsqueda de marco de llamada no debe ser ejecutable\n"
-#: src/elflint.c:4622
+#: src/elflint.c:4655
#, c-format
msgid "section [%2zu] '%s' must not be executable\n"
msgstr "sección [%2zu] '%s' no debe ser ejecutable\n"
-#: src/elflint.c:4633
+#: src/elflint.c:4666
#, c-format
msgid "program header entry %d: file size greater than memory size\n"
msgstr ""
"entrada de encabezamiento de programa %d: tamaño de fichero mayor que el "
"tamaño de memoria\n"
-#: src/elflint.c:4640
+#: src/elflint.c:4673
#, c-format
msgid "program header entry %d: alignment not a power of 2\n"
msgstr ""
"entrada de encabezamiento de programa %d: alineamiento no es potencia de 2\n"
-#: src/elflint.c:4643
+#: src/elflint.c:4676
#, c-format
msgid ""
"program header entry %d: file offset and virtual address not module of "
@@ -3329,7 +3479,7 @@
"entrada de encabezamiento de programa %d: compensación de fichero y "
"dirección virtual no módulo de alineación\n"
-#: src/elflint.c:4656
+#: src/elflint.c:4689
#, c-format
msgid ""
"executable/DSO with .eh_frame_hdr section does not have a PT_GNU_EH_FRAME "
@@ -3338,104 +3488,106 @@
"ejecutable/DSO con sección .eh_frame_hdr no tiene una entrada de "
"encabezamiento de programa PT_GNU_EH_FRAME"
-#: src/elflint.c:4690
+#: src/elflint.c:4723
#, c-format
msgid "cannot read ELF header: %s\n"
msgstr "No se puede leer encabezamiento ELF: %s\n"
-#: src/elflint.c:4716
+#: src/elflint.c:4749
#, c-format
msgid "text relocation flag set but not needed\n"
msgstr "Bandera de reubicación de texto establecida pero no necesaria\n"
-#: src/findtextrel.c:62
+#: src/findtextrel.c:61
msgid "Input Selection:"
msgstr "Selección de entrada:"
-#: src/findtextrel.c:63
+#: src/findtextrel.c:62
msgid "Prepend PATH to all file names"
msgstr "Agregar RUTA a todos los nombres de ficheros"
-#: src/findtextrel.c:65
+#: src/findtextrel.c:64
msgid "Use PATH as root of debuginfo hierarchy"
msgstr "Usar RUTA como root de jerarquía de debuginfo"
-#: src/findtextrel.c:72
+#. Short description of program.
+#: src/findtextrel.c:71
msgid "Locate source of text relocations in FILEs (a.out by default)."
msgstr ""
"Localizar origen de reubicaciones de texto en FICHEROS (a.out por defecto)."
-#: src/findtextrel.c:76 src/nm.c:108 src/objdump.c:71 src/size.c:83
-#: src/strings.c:88 src/strip.c:95
+#. Strings for arguments in help texts.
+#: src/findtextrel.c:75 src/nm.c:109 src/objdump.c:72 src/size.c:81
+#: src/strings.c:88 src/strip.c:99
msgid "[FILE...]"
msgstr "[FICHERO...]"
-#: src/findtextrel.c:238
+#: src/findtextrel.c:223
#, c-format
msgid "cannot get ELF header '%s': %s"
msgstr "No se puede obtener encabezamiento ELF '%s': %s"
-#: src/findtextrel.c:249
+#: src/findtextrel.c:234
#, c-format
msgid "'%s' is not a DSO or PIE"
msgstr "'%s' es no un DSO o PIE"
-#: src/findtextrel.c:269
+#: src/findtextrel.c:254
#, c-format
msgid "getting get section header of section %zu: %s"
msgstr "obtener encabezamiento de sección get de sección %zu: %s"
-#: src/findtextrel.c:292
+#: src/findtextrel.c:277
#, c-format
msgid "cannot read dynamic section: %s"
msgstr "No se puede leer sección dinámica: %s"
-#: src/findtextrel.c:313
+#: src/findtextrel.c:298
#, c-format
msgid "no text relocations reported in '%s'"
msgstr "no hay reubicaciones de texto reportado en '%s'"
-#: src/findtextrel.c:325
+#: src/findtextrel.c:310
#, c-format
msgid "while reading ELF file"
msgstr "Error al leer fichero ELF"
-#: src/findtextrel.c:329
+#: src/findtextrel.c:314
#, fuzzy, c-format
msgid "cannot get program header count: %s"
msgstr "no se puede obtener memoria para encabezamiento del programa: %s"
-#: src/findtextrel.c:340 src/findtextrel.c:357
+#: src/findtextrel.c:325 src/findtextrel.c:342
#, fuzzy, c-format
msgid "cannot get program header index at offset %zd: %s"
msgstr ""
"Nos se puede obtener el índice de encabezamiento de programa en compensación "
"%d: %s"
-#: src/findtextrel.c:421
+#: src/findtextrel.c:406
#, c-format
msgid "cannot get symbol table section %zu in '%s': %s"
msgstr "No se puede obtener tabla de símbolos %zu en '%s': %s"
-#: src/findtextrel.c:441 src/findtextrel.c:464
+#: src/findtextrel.c:426 src/findtextrel.c:449
#, c-format
msgid "cannot get relocation at index %d in section %zu in '%s': %s"
msgstr ""
"No se puede obtener reubicación en índice %d en sección %zu en '%s': %s"
-#: src/findtextrel.c:530
+#: src/findtextrel.c:515
#, c-format
msgid "%s not compiled with -fpic/-fPIC\n"
msgstr "%s no compilado con -fpic/-fPIC\n"
-#: src/findtextrel.c:583
+#: src/findtextrel.c:568
#, c-format
msgid ""
"the file containing the function '%s' is not compiled with -fpic/-fPIC\n"
msgstr ""
"El archivo que contiene la función '%s' no está compilado con -fpic/-fPIC\n"
-#: src/findtextrel.c:590 src/findtextrel.c:610
+#: src/findtextrel.c:575 src/findtextrel.c:595
#, c-format
msgid ""
"the file containing the function '%s' might not be compiled with -fpic/-"
@@ -3444,7 +3596,7 @@
"el fichero que contiene la función '%s' podría no estar compilado con -fpic/-"
"fPIC\n"
-#: src/findtextrel.c:598
+#: src/findtextrel.c:583
#, c-format
msgid ""
"either the file containing the function '%s' or the file containing the "
@@ -3453,7 +3605,7 @@
"Tanto el fichero que contiene la función '%s' como el fichero que contiene "
"la función '%s' no están compilados con -fpic/-fPIC\n"
-#: src/findtextrel.c:618
+#: src/findtextrel.c:603
#, c-format
msgid ""
"a relocation modifies memory at offset %llu in a write-protected segment\n"
@@ -3461,787 +3613,43 @@
"Una reubicación modifica memoria en compensación %llu en un segmento "
"protegido contra escritura\n"
-#: src/i386_ld.c:202
-#, c-format
-msgid "cannot allocate PLT section: %s"
-msgstr "No se puede asignar sección PLT: %s"
-
-#: src/i386_ld.c:224
-#, c-format
-msgid "cannot allocate PLTREL section: %s"
-msgstr "No se puede asignar sección PLTREL: %s"
-
-#: src/i386_ld.c:245
-#, c-format
-msgid "cannot allocate GOT section: %s"
-msgstr "No se puede asignar sección GOT: %s"
-
-#: src/i386_ld.c:266
-#, c-format
-msgid "cannot allocate GOTPLT section: %s"
-msgstr "No se puede asignar sección GOTPLT: %s"
-
-#: src/i386_ld.c:653
-#, c-format
-msgid "initial-executable TLS relocation cannot be used "
-msgstr "Reubicación TLS ejecutable-inicial no se puede utilizar"
-
-#: src/ld.c:78
-msgid "Input File Control:"
-msgstr "Control de fichero de entrada:"
-
-#: src/ld.c:80
-msgid "Include whole archives in the output from now on."
-msgstr "A partir de ahora incluye archivos completos en la salida."
-
-#: src/ld.c:82
-msgid "Stop including the whole archives in the output."
-msgstr "Deja de incluir archivos completos en la salida."
-
-#: src/ld.c:83 src/ld.c:97 src/ld.c:175
-msgid "FILE"
-msgstr "FICHERO"
-
-#: src/ld.c:84
-msgid "Start a group."
-msgstr "Inicia un grupo"
-
-#: src/ld.c:85
-msgid "End a group."
-msgstr "Termina un grupo."
-
-#: src/ld.c:86
-msgid "PATH"
-msgstr "RUTA"
-
-#: src/ld.c:87
-msgid "Add PATH to list of directories files are searched in."
-msgstr ""
-"Agrega RUTA a la lista de los directorios en los que se realiza la búsqueda."
-
-#: src/ld.c:89
-msgid "Only set DT_NEEDED for following dynamic libs if actually used"
-msgstr ""
-"Sólo se define DT_NEEDED para las siguientes bibliotecas dinámicas, si están "
-"siendo utilizadas"
-
-#: src/ld.c:91
-msgid "Always set DT_NEEDED for following dynamic libs"
-msgstr "Siempre establece DT_NEEDED para las siguientes bibliotecas dinámicas"
-
-#: src/ld.c:93
-msgid "Ignore LD_LIBRARY_PATH environment variable."
-msgstr "Ignora la variable de entorno LD_LIBRARY_PATH."
-
-#: src/ld.c:96
-msgid "Output File Control:"
-msgstr "Control de fichero de salida:"
-
-#: src/ld.c:97
-msgid "Place output in FILE."
-msgstr "Coloca salida en FICHERO."
-
-#: src/ld.c:100
-msgid "Object is marked to not use default search path at runtime."
-msgstr ""
-"Objeto está marcado para no usar ruta de búsqueda predeterminada en tiempo "
-"de ejecución."
-
-#: src/ld.c:102
-msgid "Same as --whole-archive."
-msgstr "Lo mismo que --whole-archive."
-
-#: src/ld.c:103
-msgid ""
-"Default rules of extracting from archive; weak references are not enough."
-msgstr ""
-"Reglas establecidas por defecto para extraer desde el archivo; las "
-"referencias débiles no son suficientes."
-
-#: src/ld.c:107
-msgid "Weak references cause extraction from archive."
-msgstr "Referencias débiles causan extracción del archivo."
-
-#: src/ld.c:109
-msgid "Allow multiple definitions; first is used."
-msgstr "Permite definiciones múltiples; se utiliza la primera."
-
-#: src/ld.c:111
-msgid "Disallow/allow undefined symbols in DSOs."
-msgstr "Habilita/inhabilita símbolos indefinidos en los DSO."
-
-#: src/ld.c:114
-msgid "Object requires immediate handling of $ORIGIN."
-msgstr "Los objetos requieren manipulación inmediata de $ORIGIN."
-
-#: src/ld.c:116
-msgid "Relocation will not be processed lazily."
-msgstr "La reubicación no se procesará de forma perezosa."
-
-#: src/ld.c:118
-msgid "Object cannot be unloaded at runtime."
-msgstr "El objeto no se puede descargar en tiempo de ejecución."
-
-#: src/ld.c:120
-msgid "Mark object to be initialized first."
-msgstr "Marcar objeto a ser inicializado primero."
-
-#: src/ld.c:122
-msgid "Enable/disable lazy-loading flag for following dependencies."
-msgstr ""
-"Activar/desactivar marca lazy-loading para las siguientes dependencias."
-
-#: src/ld.c:124
-msgid "Mark object as not loadable with 'dlopen'."
-msgstr "Marcar el objeto como no cargable con 'dlopen'"
-
-#: src/ld.c:126
-msgid "Ignore/record dependencies on unused DSOs."
-msgstr "Ignorar/registrar dependencias sobre DSO no utilizados."
-
-#: src/ld.c:128
-msgid "Generated DSO will be a system library."
-msgstr "El DSO generado será una biblioteca del sistema."
-
-#: src/ld.c:129
-msgid "ADDRESS"
-msgstr "DIRECCIÓN"
-
-#: src/ld.c:129
-msgid "Set entry point address."
-msgstr "Establecer dirección de entrada de punto"
-
-#: src/ld.c:132
-msgid "Do not link against shared libraries."
-msgstr "No enlazar con bibliotecas compartidas."
-
-#: src/ld.c:135
-msgid "Prefer linking against shared libraries."
-msgstr "No enlazar con bibliotecas compartidas."
-
-#: src/ld.c:136
-msgid "Export all dynamic symbols."
-msgstr "Exportar todos los símbolos dinámicos."
-
-#: src/ld.c:137
-msgid "Strip all symbols."
-msgstr "Descartar todos los símbolos."
-
-#: src/ld.c:138
-msgid "Strip debugging symbols."
-msgstr "Descartar los símbolos de depuración."
-
-#: src/ld.c:140
-msgid "Assume pagesize for the target system to be SIZE."
-msgstr "Asumir que pagesize para el sistema de destino sea SIZE."
-
-#: src/ld.c:142
-msgid "Set runtime DSO search path."
-msgstr "Establecer la ruta de búsqueda tiempo de ejecución DSO."
-
-#: src/ld.c:145
-msgid "Set link time DSO search path."
-msgstr "Establecer ruta de tiempo de enlace DSO."
-
-#: src/ld.c:146
-msgid "Generate dynamic shared object."
-msgstr "Generar objeto compartido dinámico."
-
-#: src/ld.c:147
-msgid "Generate relocatable object."
-msgstr "Generar objeto reubicable"
-
-#: src/ld.c:150
-msgid "Causes symbol not assigned to a version be reduced to local."
-msgstr "Hacer que un símbolo no asignado a una versión sea reducido a local."
-
-#: src/ld.c:151
-msgid "Remove unused sections."
-msgstr "Eliminar las secciones no utilizadas."
-
-#: src/ld.c:154
-msgid "Don't remove unused sections."
-msgstr "No eliminar las secciones no utilizadas."
-
-#: src/ld.c:155
-msgid "Set soname of shared object."
-msgstr "Establecer soname de objeto compartido."
-
-#: src/ld.c:156
-msgid "Set the dynamic linker name."
-msgstr "Establecer el nombre de enlazador dinámico."
-
-#: src/ld.c:159
-msgid "Add/suppress addition indentifying link-editor to .comment section."
-msgstr ""
-"Añadir/suprimir adición identificando enlace-editor para .sección de "
-"comentario."
-
-#: src/ld.c:162
-msgid "Create .eh_frame_hdr section"
-msgstr "Crear una sección .eh_frame_hdr"
-
-#: src/ld.c:164
-msgid "Set hash style to sysv, gnu or both."
-msgstr "Establecer el estilo de dispersión un sysv, gnu o ambos."
-
-#: src/ld.c:166
-msgid "Generate build ID note (md5, sha1 (default), uuid)."
-msgstr "Crear una nota del ID de compilación (md5, sha1 (por defecto), uuid)."
-
-#: src/ld.c:168
-msgid "Linker Operation Control:"
-msgstr "Control de volumen desconocido:"
-
-#: src/ld.c:169
-msgid "Verbose messages."
-msgstr "Mensajes explicativos."
-
-#: src/ld.c:170
-msgid "Trace file opens."
-msgstr "Rastrear apertura de ficheros."
-
-#: src/ld.c:172
-msgid "Trade speed for less memory usage"
-msgstr "Intercambiar velocidad por menor utilización de memoria"
-
-#: src/ld.c:173
-msgid "LEVEL"
-msgstr "NIVEL"
-
-#: src/ld.c:174
-msgid "Set optimization level to LEVEL."
-msgstr "Establecer el nivel de optimización a LEVEL."
-
-#: src/ld.c:175
-msgid "Use linker script in FILE."
-msgstr "Usar script enlazador en FICHERO."
-
-#: src/ld.c:178
-msgid "Select to get parser debug information"
-msgstr "Seleccionar para obtener análisis de información de depuración"
-
-#: src/ld.c:181
-msgid "Read version information from FILE."
-msgstr "Leer información de versión de FICHERO."
-
-#: src/ld.c:182
-msgid "Set emulation to NAME."
-msgstr "Establecer emulación a NOMBRE."
-
-#: src/ld.c:188
-msgid "Combine object and archive files."
-msgstr "Combinar objeto y archivos de almacenamiento."
-
-#: src/ld.c:191
-msgid "[FILE]..."
-msgstr "[FICHERO]..."
-
-#: src/ld.c:319
-#, c-format
-msgid "At least one input file needed"
-msgstr "Se necesita al menos un fichero de entrada"
-
-#: src/ld.c:335
-#, c-format
-msgid "error while preparing linking"
-msgstr "Error al preparar vinculación"
-
-#: src/ld.c:342
-#, c-format
-msgid "cannot open linker script '%s'"
-msgstr "no se puede abrir script enlazador '%s'"
-
-#: src/ld.c:383
-#, c-format
-msgid "-( without matching -)"
-msgstr "-( sin coincidir -)"
-
-#: src/ld.c:558 src/ld.c:596
-#, c-format
-msgid "only one option of -G and -r is allowed"
-msgstr "Solamente una opción de -G y -r es permitida"
-
-#: src/ld.c:580
-#, c-format
-msgid "more than one '-m' parameter"
-msgstr "más de un parámetro '-m'"
-
-#: src/ld.c:590 src/ld.c:999
-#, c-format
-msgid "unknown option `-%c %s'"
-msgstr "opción desconocida `-%c %s'"
-
-#: src/ld.c:632
-#, c-format
-msgid "invalid page size value '%s': ignored"
-msgstr "Valor de tamaño de página'%s': ignorado"
-
-#: src/ld.c:673
-#, c-format
-msgid "invalid hash style '%s'"
-msgstr "estilo de dispersión inválido '%s'"
-
-#: src/ld.c:683
-#, c-format
-msgid "invalid build-ID style '%s'"
-msgstr "estilo de cuerpo-ID inválido '%s'"
-
-#: src/ld.c:771
-#, c-format
-msgid "More than one output file name given."
-msgstr "Se ha dado más de un nombre de archivo de salida."
-
-#: src/ld.c:788
-#, c-format
-msgid "Invalid optimization level `%s'"
-msgstr "Nivel de optimización inválido `%s'"
-
-#: src/ld.c:836
-#, c-format
-msgid "nested -( -) groups are not allowed"
-msgstr "no se permiten grupos -( -) en nido"
-
-#: src/ld.c:855
-#, c-format
-msgid "-) without matching -("
-msgstr "-) sin coincidir -("
-
-#: src/ld.c:1032
-#, c-format
-msgid "unknown option '-%c %s'"
-msgstr "Opción desconocida '-%c %s'"
-
-#: src/ld.c:1138
-#, c-format
-msgid "could not find input file to determine output file format"
-msgstr ""
-"no se pudo encontrar un archivo de entrada que determine el formato del "
-"archivo de salida"
-
-#: src/ld.c:1140
-#, c-format
-msgid "try again with an appropriate '-m' parameter"
-msgstr "Inténtelo con una parámetro '-m' apropiado"
-
-#: src/ld.c:1434
-#, c-format
-msgid "cannot read version script '%s'"
-msgstr "No se puede leer script de versión '%s'"
-
-#: src/ld.c:1500 src/ld.c:1539
-#, c-format
-msgid "duplicate definition of '%s' in linker script"
-msgstr "Duplicar definición de '%s' en script enlazador"
-
-#: src/ldgeneric.c:201 src/ldgeneric.c:5141
-#, c-format
-msgid "cannot create string table"
-msgstr "no puede crear tabla de cadenas"
-
-#: src/ldgeneric.c:247
-#, c-format
-msgid "cannot load ld backend library '%s': %s"
-msgstr "no se puede cargar biblioteca ID de segundo plano '%s': %s"
-
-#: src/ldgeneric.c:257
-#, c-format
-msgid "cannot find init function in ld backend library '%s': %s"
-msgstr ""
-"no se pudo encontrar la función init en la biblioteca ld de segundo plano "
-"'%s': %s"
-
-#: src/ldgeneric.c:300
-#, c-format
-msgid "%s listed more than once as input"
-msgstr "%s listado más de una vez como entrada"
-
-#: src/ldgeneric.c:414
-#, c-format
-msgid "%s (for -l%s)\n"
-msgstr "%s (para -l%s)\n"
-
-#: src/ldgeneric.c:415
-#, c-format
-msgid "%s (for DT_NEEDED %s)\n"
-msgstr "%s (para DT_NEEDED %s)\n"
-
-#: src/ldgeneric.c:563
-#, c-format
-msgid "Warning: type of `%s' changed from %s in %s to %s in %s"
-msgstr "Advertencia: el tipo de `%s' cambió de %s en %s a %s en %s"
-
-#: src/ldgeneric.c:576
-#, c-format
-msgid "Warning: size of `%s' changed from %<PRIu64> in %s to %<PRIu64> in %s"
-msgstr ""
-"Advertencia: el tamaño de `%s' cambió de %<PRIu64> en %s a %<PRIu64> en %s"
-
-#: src/ldgeneric.c:651 src/ldgeneric.c:1112 src/readelf.c:536 src/readelf.c:852
-#: src/strip.c:589
-#, c-format
-msgid "cannot determine number of sections: %s"
-msgstr "no se pudieron determinar el número de secciones: %s"
-
-#: src/ldgeneric.c:667
-#, c-format
-msgid "(%s+%#<PRIx64>): multiple definition of %s `%s'\n"
-msgstr "(%s+%#<PRIx64>): definición múltiplo de %s `%s'\n"
-
-#: src/ldgeneric.c:690
-#, c-format
-msgid "(%s+%#<PRIx64>): first defined here\n"
-msgstr "(%s+%#<PRIx64>): se definió primero aquí\n"
-
-#: src/ldgeneric.c:809
-#, c-format
-msgid "%s: cannot get section group data: %s"
-msgstr "%s: no se pueden obtener datos de sección de grupo: %s"
-
-#: src/ldgeneric.c:830
-#, c-format
-msgid "%s: section '%s' with group flag set does not belong to any group"
-msgstr ""
-"%s: la sección '%s' con bandera de grupo establecida no pertenece a ningún "
-"grupo"
-
-#: src/ldgeneric.c:875
-#, c-format
-msgid "%s: section [%2d] '%s' is not in the correct section group"
-msgstr ""
-"%s: la sección [%2d] '%s' no se encuentra en el grupo de sección correcto"
-
-#: src/ldgeneric.c:1146 src/ldgeneric.c:1403 src/ldgeneric.c:1412
-#: src/ldgeneric.c:1471 src/ldgeneric.c:1480 src/ldgeneric.c:1743
-#: src/ldgeneric.c:1995
-#, c-format
-msgid "%s: invalid ELF file (%s:%d)\n"
-msgstr "%s: fichero ELF inválido (%s:%d)\n"
-
-#: src/ldgeneric.c:1240
-#, c-format
-msgid "%s: only files of type ET_REL might contain section groups"
-msgstr "%s: solo archivos de tipo ET_REL pueden contener grupos de sección"
-
-#: src/ldgeneric.c:1292
-#, c-format
-msgid "%s: cannot determine signature of section group [%2zd] '%s': %s"
-msgstr ""
-"%s: no es posible determinar la firma del grupo de sección [%2zd] '%s': %s "
-
-#: src/ldgeneric.c:1304
-#, c-format
-msgid "%s: cannot get content of section group [%2zd] '%s': %s'"
-msgstr ""
-"%s: no es posible obtener el contenido de la sección del grupo [%2zd] '%s': "
-"%s'"
-
-#: src/ldgeneric.c:1318
-#, c-format
-msgid ""
-"%s: group member %zu of section group [%2zd] '%s' has too high index: "
-"%<PRIu32>"
-msgstr ""
-"%s el miembro del grupo %zu del grupo de sección [%2zd] '%s' posee el índice "
-"demasiado alto: %<PRIu32>"
-
-#: src/ldgeneric.c:1340
-#, c-format
-msgid "%s: section '%s' has unknown type: %d"
-msgstr "%s: sección '%s' tiene tipo desconocido: %d"
-
-#: src/ldgeneric.c:1719
-#, c-format
-msgid "cannot get descriptor for ELF file (%s:%d): %s\n"
-msgstr "no es posible obtener descriptor para el archivo ELF (%s:%d): %s\n"
-
-#: src/ldgeneric.c:1889
-#, c-format
-msgid "cannot read archive `%s': %s"
-msgstr "no se puede leer archivo `%s': %s"
-
-#: src/ldgeneric.c:2010
-#, c-format
-msgid "file of type %s cannot be linked in\n"
-msgstr "archivo de tipo %s no puede ser enlazado en\n"
-
-#: src/ldgeneric.c:2022
-#, c-format
-msgid "%s: input file incompatible with ELF machine type %s\n"
-msgstr "%s: el archivo ingresado es incompatible con una máquina ELF tipo %s\n"
-
-#: src/ldgeneric.c:2034
-#, c-format
-msgid "%s: cannot get section header string table index: %s\n"
-msgstr ""
-"%s: no se ha podido obtener un índice para la tabla de la cadena del "
-"encabezamiento de la sección: %s\n"
-
-#: src/ldgeneric.c:2063
-#, c-format
-msgid "cannot use DSO '%s' when generating relocatable object file"
-msgstr ""
-"no es posible utilizar DSO '%s' al general un archivo de objeto realojable"
-
-#: src/ldgeneric.c:2148
-#, c-format
-msgid "input file '%s' ignored"
-msgstr "archivo de entrada '%s' ignorado"
-
-#: src/ldgeneric.c:2362
-#, c-format
-msgid "undefined symbol `%s' in %s"
-msgstr "símbolo indefinido `%s' en %s"
-
-#: src/ldgeneric.c:2692
-#, c-format
-msgid "cannot create ELF descriptor for output file: %s"
-msgstr "no es posible crear un descriptor ELF para el archivo de salida: %s"
-
-#: src/ldgeneric.c:2699
-#, c-format
-msgid "could not create ELF header for output file: %s"
-msgstr ""
-"no es posible crear un encabezamiento ELF para el archivo de salida: %s"
-
-#: src/ldgeneric.c:3214 src/ldgeneric.c:3284 src/ldgeneric.c:3320
-#: src/ldgeneric.c:4447 src/ldgeneric.c:4496 src/ldgeneric.c:4528
-#: src/ldgeneric.c:4763 src/ldgeneric.c:4818 src/ldgeneric.c:5065
-#: src/ldgeneric.c:5121 src/ldgeneric.c:5590 src/ldgeneric.c:5602
-#, c-format
-msgid "cannot create section for output file: %s"
-msgstr "no se puede crear sección para archivo de salida: %s"
-
-#: src/ldgeneric.c:3434
-#, c-format
-msgid "address computation expression contains variable '%s'"
-msgstr "la expresión de computación contiene la variable '%s'"
-
-#: src/ldgeneric.c:3479
-#, c-format
-msgid ""
-"argument '%<PRIuMAX>' of ALIGN in address computation expression is no power "
-"of two"
-msgstr ""
-"el argumento '%<PRIuMAX>' de ALIGN en expresión de dirección de computación "
-"no es potencia de dos"
-
-#: src/ldgeneric.c:3674
-#, c-format
-msgid "cannot find entry symbol '%s': defaulting to %#0*<PRIx64>"
-msgstr ""
-"no se puede encontrar símbolo de entrada '%s': predeterminada para "
-"%#0*<PRIx64>"
-
-#: src/ldgeneric.c:3680
-#, c-format
-msgid "no entry symbol specified: defaulting to %#0*<PRIx64>"
-msgstr ""
-"no se ha especificado una entrada de símbolo: estableciendo por defecto a "
-"%#0*<PRIx64>"
-
-#: src/ldgeneric.c:3910
-#, c-format
-msgid "cannot create GNU hash table section for output file: %s"
-msgstr ""
-"no se puede crear una tabla de dispersión GNU para archivo de salida: %s"
-
-#: src/ldgeneric.c:4061
-#, c-format
-msgid "cannot create hash table section for output file: %s"
-msgstr ""
-"no es posible crear una sección para la tabla de dispersión del archivo de "
-"salida: %s"
-
-#: src/ldgeneric.c:4104
-#, c-format
-msgid "cannot create build ID section: %s"
-msgstr "no se puede crear sección de creación de ID: %s"
-
-#: src/ldgeneric.c:4181
-#, c-format
-msgid "cannot convert section data to file format: %s"
-msgstr ""
-"no es posible convertir los datos de la sección en formato de archivo: %s"
-
-#: src/ldgeneric.c:4190
-#, c-format
-msgid "cannot convert section data to memory format: %s"
-msgstr "no es posible convertir datos de la sección en formato de memoria: %s"
-
-#: src/ldgeneric.c:4251
-#, c-format
-msgid "cannot read enough data for UUID"
-msgstr "no es posible leer suficientes datos para el UUID"
-
-#: src/ldgeneric.c:4348 src/ldgeneric.c:4369 src/ldgeneric.c:4398
-#: src/ldgeneric.c:6051
-#, c-format
-msgid "cannot create symbol table for output file: %s"
-msgstr "no es posible crear tabla de símbolo para el comando de salida: %s"
-
-#: src/ldgeneric.c:5290 src/ldgeneric.c:5842
-#, c-format
-msgid "section index too large in dynamic symbol table"
-msgstr ""
-"el índice de la sección es demasiado extenso en la tabla de símbolos "
-"dinámicos"
-
-#: src/ldgeneric.c:5735
-#, c-format
-msgid "cannot create versioning section: %s"
-msgstr "no se puede crear sección de versión: %s"
-
-#: src/ldgeneric.c:5808
-#, c-format
-msgid "cannot create dynamic symbol table for output file: %s"
-msgstr ""
-"no es posible crear tabla de símbolos dinámicos para el archivo de salida: %s"
-
-#: src/ldgeneric.c:5983
-#, c-format
-msgid "cannot create versioning data: %s"
-msgstr "no se pueden crear datos de versión: %s"
-
-#: src/ldgeneric.c:6083 src/ldgeneric.c:6096 src/ldgeneric.c:6160
-#: src/ldgeneric.c:6168
-#, c-format
-msgid "cannot create section header string section: %s"
-msgstr "no se puede crear sección de cadenas de encabezamiento de sección: %s"
-
-#: src/ldgeneric.c:6090
-#, c-format
-msgid "cannot create section header string section"
-msgstr "no se puede crear sección de cadenas de encabezamiento de sección"
-
-#: src/ldgeneric.c:6248
-#, c-format
-msgid "cannot create program header: %s"
-msgstr "no se puede crear encabezamiento de programa: %s"
-
-#: src/ldgeneric.c:6256
-#, c-format
-msgid "while determining file layout: %s"
-msgstr "al determinar diseño de fichero: %s"
-
-#: src/ldgeneric.c:6377
-#, c-format
-msgid "internal error: non-nobits section follows nobits section"
-msgstr "error interno: sección non-nobits sigue a sección nobits"
-
-#: src/ldgeneric.c:6914
-#, c-format
-msgid "cannot get header of 0th section: %s"
-msgstr "No se puede obtener encabezamiento de sección 0th: %s"
-
-#: src/ldgeneric.c:6930 src/unstrip.c:1929
-#, c-format
-msgid "cannot update ELF header: %s"
-msgstr "No se puede actualizar encabezamiento ELF: %s"
-
-#: src/ldgeneric.c:6961
-#, c-format
-msgid "linker backend didn't specify function to relocate section"
-msgstr "enlazador de segundo plano no especificó función para reubicar sección"
-
-#: src/ldgeneric.c:6973
-#, c-format
-msgid "while writing output file: %s"
-msgstr "Ocurrió un error de fichero de salida: %s"
-
-#: src/ldgeneric.c:6978
-#, c-format
-msgid "while finishing output file: %s"
-msgstr "error al cerrar el fichero de salida: %s"
-
-#: src/ldgeneric.c:6984
-#, c-format
-msgid "cannot stat output file"
-msgstr "no se puede generar stat de fichero de salida"
-
-#: src/ldgeneric.c:7000
-#, c-format
-msgid "WARNING: temporary output file overwritten before linking finished"
-msgstr ""
-"ADVERTENCIA: archivo de salida temporal sobreescrito antes que haya "
-"concluido el enlazamiento"
-
-#: src/ldgeneric.c:7053 src/ldgeneric.c:7064 src/ldgeneric.c:7075
-#: src/ldgeneric.c:7086 src/ldgeneric.c:7105 src/ldgeneric.c:7118
-#: src/ldgeneric.c:7130
-#, c-format
-msgid "no machine specific '%s' implementation"
-msgstr "no hay máquina específica de implementación '%s'"
-
-#: src/ldscript.y:170
-msgid "mode for segment invalid\n"
-msgstr "modo para segmento inválido\n"
-
-#: src/ldscript.y:457
-#, c-format
-msgid "while reading version script '%s': %s at line %d"
-msgstr "al leer script de versión '%s': %s en línea %d"
-
-#: src/ldscript.y:458
-#, c-format
-msgid "while reading linker script '%s': %s at line %d"
-msgstr "al leer script de enlace '%s': %s en línea %d"
-
-#: src/ldscript.y:737
-#, fuzzy, c-format
-msgid "symbol '%s' is declared both local and global for unnamed version '%s'"
-msgstr ""
-"el símbolo '%s' es declarado tanto local como global para la versión sin "
-"nombre"
-
-#: src/ldscript.y:739
-#, c-format
-msgid "symbol '%s' is declared both local and global for version '%s'"
-msgstr ""
-"el símbolo '%s' es declarado tanto local como global para la versión '%s'"
-
-#: src/ldscript.y:759 src/ldscript.y:766
-#, c-format
-msgid "default visibility set as local and global"
-msgstr "la visibilidad establecida por defecto establecida como local y global"
-
-#: src/nm.c:66 src/strip.c:67
+#: src/nm.c:67 src/strip.c:70
msgid "Output selection:"
msgstr "Selección de salida:"
-#: src/nm.c:67
+#: src/nm.c:68
msgid "Display debugger-only symbols"
msgstr "Mostrar sólo símbolos del depurador"
-#: src/nm.c:68
+#: src/nm.c:69
msgid "Display only defined symbols"
msgstr "Mostrar sólo símbolos definidos"
-#: src/nm.c:71
+#: src/nm.c:72
msgid "Display dynamic symbols instead of normal symbols"
msgstr "Mostrar símbolos dinámicos en lugar de símbolos normales"
-#: src/nm.c:72
+#: src/nm.c:73
msgid "Display only external symbols"
msgstr "Mostrar sólo símbolos externos"
-#: src/nm.c:73
+#: src/nm.c:74
msgid "Display only undefined symbols"
msgstr "Mostrar sólo símbolos indefinidos"
-#: src/nm.c:75
+#: src/nm.c:76
msgid "Include index for symbols from archive members"
msgstr "Incluir índices para símbolos de miembros de archivo"
-#: src/nm.c:77 src/size.c:57
+#: src/nm.c:78 src/size.c:55
msgid "Output format:"
msgstr "Formato de salida:"
-#: src/nm.c:79
+#: src/nm.c:80
msgid "Print name of the input file before every symbol"
msgstr "Imprimir nombre de archivo de entrada antes de cada símbolo"
-#: src/nm.c:82
+#: src/nm.c:83
msgid ""
"Use the output format FORMAT. FORMAT can be `bsd', `sysv' or `posix'. The "
"default is `sysv'"
@@ -4249,73 +3657,75 @@
"Usar el formato de salida FORMATO. FORMATO puede ser o bien `bsd', o "
"`sysv', o `posix'. El establecido por defecto es `sysv'"
-#: src/nm.c:84
+#: src/nm.c:85
msgid "Same as --format=bsd"
msgstr "lo mismo que --format=bsd"
-#: src/nm.c:85
+#: src/nm.c:86
msgid "Same as --format=posix"
msgstr "lo mismo que --format=posix"
-#: src/nm.c:86 src/size.c:63
+#: src/nm.c:87 src/size.c:61
msgid "Use RADIX for printing symbol values"
msgstr "Utilizar RADIX para imprimir valores de símbolo"
-#: src/nm.c:87
+#: src/nm.c:88
#, fuzzy
msgid "Mark special symbols"
msgstr "Marcar símbolos débiles"
-#: src/nm.c:89
+#: src/nm.c:90
msgid "Print size of defined symbols"
msgstr "Tamaño de impresión de símbolos definidos"
-#: src/nm.c:91 src/size.c:71 src/strip.c:72 src/unstrip.c:72
+#: src/nm.c:92 src/size.c:69 src/strip.c:75 src/unstrip.c:73
msgid "Output options:"
msgstr "Opciones de salida:"
-#: src/nm.c:92
+#: src/nm.c:93
msgid "Sort symbols numerically by address"
msgstr "Ordenar los símbolos numéricos por dirección"
-#: src/nm.c:94
+#: src/nm.c:95
msgid "Do not sort the symbols"
msgstr "No ordenar los símbolos"
-#: src/nm.c:95
+#: src/nm.c:96
msgid "Reverse the sense of the sort"
msgstr "Invertir el orden"
-#: src/nm.c:98
+#: src/nm.c:99
msgid "Decode low-level symbol names into source code names"
msgstr ""
-#: src/nm.c:105
+#. Short description of program.
+#: src/nm.c:106
msgid "List symbols from FILEs (a.out by default)."
msgstr "Listar símbolos de FICHEROS (a.out por defecto)."
-#: src/nm.c:116 src/objdump.c:79
+#: src/nm.c:117 src/objdump.c:80
#, fuzzy
msgid "Output formatting"
msgstr "Formato de salida:"
-#: src/nm.c:140 src/objdump.c:103 src/size.c:108 src/strip.c:127
+#: src/nm.c:141 src/objdump.c:104 src/size.c:106 src/strip.c:131
#, fuzzy, c-format
msgid "%s: INTERNAL ERROR %d (%s): %s"
msgstr "%s: ERROR INTERNO %d (%s-%s): %s"
-#: src/nm.c:395 src/nm.c:407 src/size.c:305 src/size.c:314 src/size.c:325
-#: src/strip.c:2280
+#: src/nm.c:382 src/nm.c:394 src/size.c:289 src/size.c:298 src/size.c:309
+#: src/strip.c:2421
#, c-format
msgid "while closing '%s'"
msgstr "error al cerrar '%s'"
-#: src/nm.c:417 src/objdump.c:292 src/strip.c:391
+#: src/nm.c:404 src/objdump.c:281 src/strip.c:443
#, c-format
msgid "%s: File format not recognized"
msgstr "%s: No se reconoce el formato del fichero"
-#: src/nm.c:457
+#. Note: 0 is no valid offset.
+#: src/nm.c:444
#, fuzzy
msgid ""
"\n"
@@ -4324,42 +3734,44 @@
"\n"
"Índice de archivo:"
-#: src/nm.c:466
+#: src/nm.c:453
#, c-format
msgid "invalid offset %zu for symbol %s"
msgstr "Compensación %zu inválida para símbolo %s"
-#: src/nm.c:471
+#: src/nm.c:458
#, c-format
msgid "%s in %s\n"
msgstr "%s en %s\n"
-#: src/nm.c:479
+#: src/nm.c:466
#, c-format
msgid "cannot reset archive offset to beginning"
msgstr "imposible restablecer compensación de archivo al inicio"
-#: src/nm.c:504 src/objdump.c:340
+#: src/nm.c:491 src/objdump.c:329
#, c-format
msgid "%s%s%s: file format not recognized"
msgstr "%s%s%s: no se reconoció el formato de fichero"
-#: src/nm.c:719
+#: src/nm.c:706
#, c-format
msgid "cannot create search tree"
msgstr "No se puede crear el árbol de búsqueda"
-#: src/nm.c:760 src/nm.c:1221 src/objdump.c:789 src/readelf.c:545
-#: src/readelf.c:1123 src/readelf.c:1323 src/readelf.c:1471 src/readelf.c:1667
-#: src/readelf.c:1873 src/readelf.c:2063 src/readelf.c:2300 src/readelf.c:2558
-#: src/readelf.c:2634 src/readelf.c:2721 src/readelf.c:3301 src/readelf.c:3347
-#: src/readelf.c:3410 src/readelf.c:8320 src/readelf.c:9420 src/readelf.c:9603
-#: src/readelf.c:9671 src/size.c:413 src/size.c:482 src/strip.c:520
+#: src/nm.c:747 src/nm.c:1208 src/objdump.c:778 src/readelf.c:606
+#: src/readelf.c:1196 src/readelf.c:1396 src/readelf.c:1544 src/readelf.c:1745
+#: src/readelf.c:1951 src/readelf.c:2141 src/readelf.c:2319 src/readelf.c:2395
+#: src/readelf.c:2653 src/readelf.c:2729 src/readelf.c:2816 src/readelf.c:3414
+#: src/readelf.c:3464 src/readelf.c:3527 src/readelf.c:11028
+#: src/readelf.c:12200 src/readelf.c:12403 src/readelf.c:12471 src/size.c:397
+#: src/size.c:466 src/strip.c:572
#, c-format
msgid "cannot get section header string table index"
msgstr "no se puede obtener índice de cadena de encabezamiento de sección"
-#: src/nm.c:787
+#. We always print this prolog.
+#: src/nm.c:774
#, c-format
msgid ""
"\n"
@@ -4372,7 +3784,8 @@
"Símbolos de %s:\n"
"\n"
-#: src/nm.c:790
+#. The header line.
+#: src/nm.c:777
#, c-format
msgid ""
"%*s%-*s %-*s Class Type %-*s %*s Section\n"
@@ -4381,74 +3794,82 @@
"%*s%-*s %-*s Clase Tipo %-*s %*s Sección\n"
"\n"
-#: src/nm.c:1232
+#: src/nm.c:1219
#, fuzzy, c-format
msgid "%s: entry size in section %zd `%s' is not what we expect"
msgstr ""
"%s: el tamaño de la entrada en la sección `%s' no es el que esperábamos "
-#: src/nm.c:1237
+#: src/nm.c:1224
#, fuzzy, c-format
msgid "%s: size of section %zd `%s' is not multiple of entry size"
msgstr "%s: Tamaño de sección `%s' no es múltiplo de tamaño de entrada"
-#: src/nm.c:1537
+#: src/nm.c:1303
+#, fuzzy, c-format
+msgid "%s: entries (%zd) in section %zd `%s' is too large"
+msgstr ""
+"%s: el tamaño de la entrada en la sección `%s' no es el que esperábamos "
+
+#. XXX Add machine specific object file types.
+#: src/nm.c:1529
#, c-format
msgid "%s%s%s%s: Invalid operation"
msgstr "%s%s%s%s: Operación inválida"
-#: src/nm.c:1594
+#: src/nm.c:1586
#, c-format
msgid "%s%s%s: no symbols"
msgstr "%s%s%s: No hay símbolos"
-#: src/objdump.c:52
+#: src/objdump.c:53
msgid "Mode selection:"
msgstr "Selección de modo:"
-#: src/objdump.c:53
+#: src/objdump.c:54
msgid "Display relocation information."
msgstr "Mostrar la reubicación de información."
-#: src/objdump.c:55
+#: src/objdump.c:56
msgid "Display the full contents of all sections requested"
msgstr "Mostrar el contenido total de todas las secciones solicitadas"
-#: src/objdump.c:57
+#: src/objdump.c:58
msgid "Display assembler code of executable sections"
msgstr "Mostrar código de ensamblador de secciones ejecutables"
-#: src/objdump.c:59
+#: src/objdump.c:60
#, fuzzy
msgid "Output content selection:"
msgstr "Selección de opción de salida:"
-#: src/objdump.c:61
+#: src/objdump.c:62
msgid "Only display information for section NAME."
msgstr "Sólo muestra información para NOMBRE de sección."
-#: src/objdump.c:67
+#. Short description of program.
+#: src/objdump.c:68
msgid "Show information from FILEs (a.out by default)."
msgstr "Muestra información de FICHEROS (a.out por defecto)."
-#: src/objdump.c:232 src/readelf.c:479
+#: src/objdump.c:219 src/readelf.c:551
msgid "No operation specified.\n"
msgstr "No se especificó una operación.\n"
-#: src/objdump.c:270 src/objdump.c:282
+#: src/objdump.c:259 src/objdump.c:271
#, c-format
msgid "while close `%s'"
msgstr "mientras cierra `%s'"
-#: src/objdump.c:375 src/readelf.c:1968 src/readelf.c:2160
+#: src/objdump.c:364 src/readelf.c:2046 src/readelf.c:2238
msgid "INVALID SYMBOL"
msgstr "SÍMBOLO INVÁLIDO"
-#: src/objdump.c:390 src/readelf.c:2002 src/readelf.c:2196
+#: src/objdump.c:379 src/readelf.c:2080 src/readelf.c:2274
msgid "INVALID SECTION"
msgstr "SECCIÓN INVÁLIDA"
-#: src/objdump.c:510
+#: src/objdump.c:499
#, c-format
msgid ""
"\n"
@@ -4459,290 +3880,320 @@
"REUBICACIÓN DE REGISTROS PARA [%s]:\n"
"%-*s TIPO VALOR\n"
-#: src/objdump.c:513
+#: src/objdump.c:502
msgid "OFFSET"
msgstr "COMPENSACIÓN"
-#: src/objdump.c:578
+#: src/objdump.c:567
#, c-format
msgid "Contents of section %s:\n"
msgstr "Contenido de la sección %s:\n"
-#: src/objdump.c:699
+#: src/objdump.c:688
#, c-format
msgid "cannot disassemble"
msgstr "No se puede desensamblar"
-#: src/ranlib.c:65
+#. Short description of program.
+#: src/ranlib.c:64
msgid "Generate an index to speed access to archives."
msgstr " Generar un índice para acelerar el acceso a los archivos."
-#: src/ranlib.c:68
+#. Strings for arguments in help texts.
+#: src/ranlib.c:67
msgid "ARCHIVE"
msgstr "ARCHIVO "
-#: src/ranlib.c:104
+#: src/ranlib.c:103
#, c-format
msgid "Archive name required"
msgstr "Se requiere nombre de archivo"
-#: src/ranlib.c:182
+#: src/ranlib.c:167
#, c-format
msgid "'%s' is no archive"
msgstr "%s: no es un archivo"
-#: src/ranlib.c:217
+#: src/ranlib.c:202
#, c-format
msgid "error while freeing sub-ELF descriptor: %s"
msgstr "error al liberar descriptor sub-ELF: %s"
-#: src/readelf.c:72
+#: src/readelf.c:95
#, fuzzy
msgid "ELF input selection:"
msgstr "Selección de salida de ELF:"
-#: src/readelf.c:74
+#: src/readelf.c:97
msgid ""
"Use the named SECTION (default .gnu_debugdata) as (compressed) ELF input data"
msgstr ""
-#: src/readelf.c:76
+#: src/readelf.c:100
+msgid ""
+"Used with -w to find the skeleton Compile Units in FILE associated with the "
+"Split Compile units in a .dwo input file"
+msgstr ""
+
+#: src/readelf.c:102
msgid "ELF output selection:"
msgstr "Selección de salida de ELF:"
-#: src/readelf.c:78
+#: src/readelf.c:104
msgid "All these plus -p .strtab -p .dynstr -p .comment"
msgstr "Todo esto mas -p .strtab -p .dynstr -p .comment"
-#: src/readelf.c:79
+#: src/readelf.c:105
msgid "Display the dynamic segment"
msgstr "Mostrar el segmento dinámico"
-#: src/readelf.c:80
+#: src/readelf.c:106
msgid "Display the ELF file header"
msgstr "Mostrar el encabezamiento del fichero ELF"
-#: src/readelf.c:82
+#: src/readelf.c:108
msgid "Display histogram of bucket list lengths"
msgstr "Mostrar histograma de las longitudes de las listas de cubetas"
-#: src/readelf.c:83
+#: src/readelf.c:109
msgid "Display the program headers"
msgstr "Mostrar encabezamientos de programa"
-#: src/readelf.c:85
+#: src/readelf.c:111
msgid "Display relocations"
msgstr "Mostrar reubicaciones"
-#: src/readelf.c:86
+#: src/readelf.c:112
+#, fuzzy
+msgid "Display the section groups"
+msgstr "Mostrar los encabezados de las secciones"
+
+#: src/readelf.c:113
msgid "Display the sections' headers"
msgstr "Mostrar los encabezados de las secciones"
-#: src/readelf.c:88
-msgid "Display the symbol table"
+#: src/readelf.c:116
+#, fuzzy
+msgid "Display the symbol table sections"
msgstr "Mostrar la tabla de símbolos"
-#: src/readelf.c:89
+#: src/readelf.c:117
msgid "Display versioning information"
msgstr "Mostrar información de versión"
-#: src/readelf.c:90
+#: src/readelf.c:118
msgid "Display the ELF notes"
msgstr "Mostrar las notas ELF"
-#: src/readelf.c:92
+#: src/readelf.c:120
msgid "Display architecture specific information, if any"
msgstr "Mostrar información específica de la arquitectura (si es que la hay)"
-#: src/readelf.c:94
+#: src/readelf.c:122
msgid "Display sections for exception handling"
msgstr "Muestra secciones para manejo de excepciones"
-#: src/readelf.c:96
+#: src/readelf.c:124
msgid "Additional output selection:"
msgstr "Selección de salida adicional:"
-#: src/readelf.c:98
+#: src/readelf.c:126
#, fuzzy
msgid ""
-"Display DWARF section content. SECTION can be one of abbrev, aranges, "
-"decodedaranges, frame, gdb_index, info, loc, line, decodedline, ranges, "
-"pubnames, str, macinfo, macro or exception"
+"Display DWARF section content. SECTION can be one of abbrev, addr, aranges, "
+"decodedaranges, frame, gdb_index, info, info+, loc, line, decodedline, "
+"ranges, pubnames, str, macinfo, macro or exception"
msgstr ""
"Mostrar el contenido de la sección DWARF. SECCIÓN puede ser algo de lo "
"siguiente: abbrev, aranges, frame, info, loc, line, ranges, pubnames, str, "
"macinfo, o exception"
-#: src/readelf.c:102
+#: src/readelf.c:130
msgid "Dump the uninterpreted contents of SECTION, by number or name"
msgstr "Vuelca los contenidos no interpretados de SECCIÓN, por número o nombre"
-#: src/readelf.c:104
+#: src/readelf.c:132
msgid "Print string contents of sections"
msgstr "Imprime contenido de cadena de secciones"
-#: src/readelf.c:107
+#: src/readelf.c:135
msgid "Display the symbol index of an archive"
msgstr "Muestra el índice de símbolos de un archivo"
-#: src/readelf.c:109
+#: src/readelf.c:137
msgid "Output control:"
msgstr "Control de salida:"
-#: src/readelf.c:111
+#: src/readelf.c:139
msgid "Do not find symbol names for addresses in DWARF data"
msgstr ""
"No se encuentran los nombres de símbolos para direcciones en datos DWARF"
-#: src/readelf.c:113
+#: src/readelf.c:141
#, fuzzy
msgid ""
"Display just offsets instead of resolving values to addresses in DWARF data"
msgstr ""
"No se encuentran los nombres de símbolos para direcciones en datos DWARF"
-#: src/readelf.c:115
+#: src/readelf.c:143
msgid "Ignored for compatibility (lines always wide)"
msgstr ""
-#: src/readelf.c:117
+#: src/readelf.c:145
msgid ""
"Show compression information for compressed sections (when used with -S); "
"decompress section before dumping data (when used with -p or -x)"
msgstr ""
-#: src/readelf.c:122
+#. Short description of program.
+#: src/readelf.c:150
msgid "Print information from ELF file in human-readable form."
msgstr ""
"Imprimir información del fichero ELF en una forma comprensible para los "
"seres humanos."
-#: src/readelf.c:447
+#. Look up once.
+#: src/readelf.c:329
+msgid "yes"
+msgstr "sí"
+
+#: src/readelf.c:330
+msgid "no"
+msgstr "no"
+
+#: src/readelf.c:519
#, c-format
msgid "Unknown DWARF debug section `%s'.\n"
msgstr "Sección de depuración DWARF desconocida `%s'.\n"
-#: src/readelf.c:529 src/readelf.c:640
+#: src/readelf.c:590 src/readelf.c:701
#, c-format
msgid "cannot generate Elf descriptor: %s"
msgstr "no se puede crear descriptor ELF: %s"
-#: src/readelf.c:554 src/readelf.c:1145 src/readelf.c:1347
+#: src/readelf.c:597 src/readelf.c:925 src/strip.c:641
+#, c-format
+msgid "cannot determine number of sections: %s"
+msgstr "no se pudieron determinar el número de secciones: %s"
+
+#: src/readelf.c:615 src/readelf.c:1218 src/readelf.c:1420
#, c-format
msgid "cannot get section: %s"
msgstr "No se puede encontrar la sección: %s"
-#: src/readelf.c:563 src/readelf.c:1152 src/readelf.c:1355 src/readelf.c:9623
-#: src/unstrip.c:387 src/unstrip.c:418 src/unstrip.c:467 src/unstrip.c:577
-#: src/unstrip.c:594 src/unstrip.c:631 src/unstrip.c:829 src/unstrip.c:1118
-#: src/unstrip.c:1309 src/unstrip.c:1369 src/unstrip.c:1490 src/unstrip.c:1543
-#: src/unstrip.c:1658 src/unstrip.c:1796 src/unstrip.c:1891
+#: src/readelf.c:624 src/readelf.c:1225 src/readelf.c:1428 src/readelf.c:12423
+#: src/unstrip.c:375 src/unstrip.c:406 src/unstrip.c:455 src/unstrip.c:565
+#: src/unstrip.c:582 src/unstrip.c:619 src/unstrip.c:817 src/unstrip.c:1109
+#: src/unstrip.c:1301 src/unstrip.c:1362 src/unstrip.c:1535 src/unstrip.c:1650
+#: src/unstrip.c:1790 src/unstrip.c:1885
#, c-format
msgid "cannot get section header: %s"
msgstr "No se puede obtener encabezamiento de sección: %s"
-#: src/readelf.c:571
+#: src/readelf.c:632
#, fuzzy, c-format
msgid "cannot get section name"
msgstr "no se puede obtener encabezamiento de sección\n"
-#: src/readelf.c:580 src/readelf.c:5504 src/readelf.c:7778 src/readelf.c:7880
-#: src/readelf.c:8057
+#: src/readelf.c:641 src/readelf.c:6517 src/readelf.c:10301 src/readelf.c:10403
+#: src/readelf.c:10580
#, c-format
msgid "cannot get %s content: %s"
msgstr "No se puede obtener el contenido %s: %s"
-#: src/readelf.c:596
+#: src/readelf.c:657
#, fuzzy, c-format
msgid "cannot create temp file '%s'"
msgstr "no se puede crear fichero nuevo '%s': %s"
-#: src/readelf.c:605
+#: src/readelf.c:666
#, fuzzy, c-format
msgid "cannot write section data"
msgstr "no se puede leer la sección de datos: %s"
-#: src/readelf.c:611 src/readelf.c:628 src/readelf.c:657
+#: src/readelf.c:672 src/readelf.c:689 src/readelf.c:718
#, c-format
msgid "error while closing Elf descriptor: %s"
msgstr "error al cerrar el descriptor ELF: %s"
-#: src/readelf.c:618
+#: src/readelf.c:679
#, fuzzy, c-format
msgid "error while rewinding file descriptor"
msgstr "error al cerrar el descriptor ELF: %s"
-#: src/readelf.c:652
+#: src/readelf.c:713
#, c-format
msgid "'%s' is not an archive, cannot print archive index"
msgstr "'%s' no es un archivo, no se puede imprimir índice de archivo"
-#: src/readelf.c:751
-#, fuzzy, c-format
-msgid "No such section '%s' in '%s'"
-msgstr "No se puede obtener contenido de sección %zu en '%s': %s"
-
-#: src/readelf.c:778
+#: src/readelf.c:817
#, c-format
msgid "cannot stat input file"
msgstr "no sepudo stat archivo de entrada"
-#: src/readelf.c:780
+#: src/readelf.c:819
#, c-format
msgid "input file is empty"
msgstr "archivo de entrada vacío"
-#: src/readelf.c:782
+#: src/readelf.c:821
#, c-format
msgid "failed reading '%s': %s"
msgstr "Falló lectura de '%s': %s"
-#: src/readelf.c:837
+#: src/readelf.c:850
+#, fuzzy, c-format
+msgid "No such section '%s' in '%s'"
+msgstr "No se puede obtener contenido de sección %zu en '%s': %s"
+
+#: src/readelf.c:910
#, c-format
msgid "cannot read ELF header: %s"
msgstr "no se pudo leer encabezamiento ELF: %s"
-#: src/readelf.c:845
+#: src/readelf.c:918
#, c-format
msgid "cannot create EBL handle"
msgstr "no se puede crear EBL"
-#: src/readelf.c:858
+#: src/readelf.c:931
#, c-format
msgid "cannot determine number of program headers: %s"
msgstr "no se pudo determinar la cantidad de encabezados de programa: %s"
-#: src/readelf.c:948
+#: src/readelf.c:1021
msgid "NONE (None)"
msgstr "NONE (Ninguno)"
-#: src/readelf.c:949
+#: src/readelf.c:1022
msgid "REL (Relocatable file)"
msgstr "REL (Fichero reubicable)"
-#: src/readelf.c:950
+#: src/readelf.c:1023
msgid "EXEC (Executable file)"
msgstr "EXEC (Fichero ejecutable)"
-#: src/readelf.c:951
+#: src/readelf.c:1024
msgid "DYN (Shared object file)"
msgstr "DYN (Fichero objeto compartido)"
-#: src/readelf.c:952
+#: src/readelf.c:1025
msgid "CORE (Core file)"
msgstr "CORE (Fichero núcleo)"
-#: src/readelf.c:957
+#: src/readelf.c:1030
#, c-format
msgid "OS Specific: (%x)\n"
msgstr "OS Specific: (%x)\n"
-#: src/readelf.c:959
+#. && e_type <= ET_HIPROC always true
+#: src/readelf.c:1032
#, c-format
msgid "Processor Specific: (%x)\n"
msgstr "Específico del procesador: (%x)\n"
-#: src/readelf.c:969
+#: src/readelf.c:1042
msgid ""
"ELF Header:\n"
" Magic: "
@@ -4750,7 +4201,7 @@
"Encabezamiento ELF:\n"
" Mágico: "
-#: src/readelf.c:973
+#: src/readelf.c:1046
#, c-format
msgid ""
"\n"
@@ -4759,119 +4210,120 @@
"\n"
" Clase: %s\n"
-#: src/readelf.c:978
+#: src/readelf.c:1051
#, c-format
msgid " Data: %s\n"
msgstr " Datos: %s\n"
-#: src/readelf.c:984
+#: src/readelf.c:1057
#, c-format
msgid " Ident Version: %hhd %s\n"
msgstr " Versión ident: %hhd %s\n"
-#: src/readelf.c:986 src/readelf.c:1003
+#: src/readelf.c:1059 src/readelf.c:1076
msgid "(current)"
msgstr "(actual)"
-#: src/readelf.c:990
+#: src/readelf.c:1063
#, c-format
msgid " OS/ABI: %s\n"
msgstr " OS/ABI: %s\n"
-#: src/readelf.c:993
+#: src/readelf.c:1066
#, c-format
msgid " ABI Version: %hhd\n"
msgstr " Versión ABI: %hhd\n"
-#: src/readelf.c:996
+#: src/readelf.c:1069
msgid " Type: "
msgstr " Tipo: "
-#: src/readelf.c:999
+#: src/readelf.c:1072
#, c-format
msgid " Machine: %s\n"
msgstr " Máquina: %s\n"
-#: src/readelf.c:1001
+#: src/readelf.c:1074
#, c-format
msgid " Version: %d %s\n"
msgstr " Versión: %d %s\n"
-#: src/readelf.c:1005
+#: src/readelf.c:1078
#, c-format
msgid " Entry point address: %#<PRIx64>\n"
msgstr " Dirección de punto de entrada: %#<PRIx64>\n"
-#: src/readelf.c:1008
+#: src/readelf.c:1081
#, c-format
msgid " Start of program headers: %<PRId64> %s\n"
msgstr " Inicio de encabezamientos de programa: %<PRId64> %s\n"
-#: src/readelf.c:1009 src/readelf.c:1012
+#: src/readelf.c:1082 src/readelf.c:1085
msgid "(bytes into file)"
msgstr " (bytes en el archivo)"
-#: src/readelf.c:1011
+#: src/readelf.c:1084
#, c-format
msgid " Start of section headers: %<PRId64> %s\n"
msgstr " Inicio de encabezamientos de sección: %<PRId64> %s\n"
-#: src/readelf.c:1014
+#: src/readelf.c:1087
#, c-format
msgid " Flags: %s\n"
msgstr " Indicadores: %s\n"
-#: src/readelf.c:1017
+#: src/readelf.c:1090
#, c-format
msgid " Size of this header: %<PRId16> %s\n"
msgstr " Tamaño de este encabezamiento: %<PRId16> %s\n"
-#: src/readelf.c:1018 src/readelf.c:1021 src/readelf.c:1038
+#: src/readelf.c:1091 src/readelf.c:1094 src/readelf.c:1111
msgid "(bytes)"
msgstr "(bytes)"
-#: src/readelf.c:1020
+#: src/readelf.c:1093
#, c-format
msgid " Size of program header entries: %<PRId16> %s\n"
msgstr ""
" Tamaño de las entradas en encabezamiento del programa: %<PRId16> %s\n"
-#: src/readelf.c:1023
+#: src/readelf.c:1096
#, c-format
msgid " Number of program headers entries: %<PRId16>"
msgstr " Cantidad de entradas de encabezados de programa: %<PRId16>"
-#: src/readelf.c:1030
+#: src/readelf.c:1103
#, c-format
msgid " (%<PRIu32> in [0].sh_info)"
msgstr " (%<PRIu32> in [0].sh_info)"
-#: src/readelf.c:1033 src/readelf.c:1050 src/readelf.c:1064
+#: src/readelf.c:1106 src/readelf.c:1123 src/readelf.c:1137
msgid " ([0] not available)"
msgstr " ([0] no disponible)"
-#: src/readelf.c:1037
+#: src/readelf.c:1110
#, c-format
msgid " Size of section header entries: %<PRId16> %s\n"
msgstr ""
" Tamaño de las entradas en el encabezamiento de sección: %<PRId16> %s\n"
-#: src/readelf.c:1040
+#: src/readelf.c:1113
#, c-format
msgid " Number of section headers entries: %<PRId16>"
msgstr " Cantidad de entradas en los encabezamientos de sección: %<PRId16>"
-#: src/readelf.c:1047
+#: src/readelf.c:1120
#, c-format
msgid " (%<PRIu32> in [0].sh_size)"
msgstr " (%<PRIu32> en [0].sh_size)"
-#: src/readelf.c:1060
+#. We managed to get the zeroth section.
+#: src/readelf.c:1133
#, c-format
msgid " (%<PRIu32> in [0].sh_link)"
msgstr " (%<PRIu32> en [0].sh_link)"
-#: src/readelf.c:1068
+#: src/readelf.c:1141
#, c-format
msgid ""
" Section header string table index: XINDEX%s\n"
@@ -4880,14 +4332,14 @@
" Índice de tabla de cadenas de sección de encabezamiento de : XINDEX%s\n"
"\n"
-#: src/readelf.c:1072
+#: src/readelf.c:1145
#, c-format
msgid ""
" Section header string table index: %<PRId16>\n"
"\n"
msgstr " Índice de tabla de cadenas de sección de encabezamiento: %<PRId16>\n"
-#: src/readelf.c:1115
+#: src/readelf.c:1188
#, c-format
msgid ""
"There are %d section headers, starting at offset %#<PRIx64>:\n"
@@ -4896,11 +4348,11 @@
"Hay %d encabezamientos de sección, comenzando en compensación %#<PRIx64>:\n"
"\n"
-#: src/readelf.c:1125
+#: src/readelf.c:1198
msgid "Section Headers:"
msgstr "encabezamientos de sección:"
-#: src/readelf.c:1128
+#: src/readelf.c:1201
msgid ""
"[Nr] Name Type Addr Off Size ES Flags Lk "
"Inf Al"
@@ -4908,7 +4360,7 @@
"[Nr] Nombre Tipo Dirección Off Tamaño Inf Al "
"Enlace banderas ES"
-#: src/readelf.c:1130
+#: src/readelf.c:1203
msgid ""
"[Nr] Name Type Addr Off Size ES "
"Flags Lk Inf Al"
@@ -4916,36 +4368,36 @@
"[Nr] Name Type Addr Off Size ES "
"Flags Lk Inf Al"
-#: src/readelf.c:1135
+#: src/readelf.c:1208
msgid " [Compression Size Al]"
msgstr ""
-#: src/readelf.c:1137
+#: src/readelf.c:1210
msgid " [Compression Size Al]"
msgstr ""
-#: src/readelf.c:1213
+#: src/readelf.c:1286
#, fuzzy, c-format
msgid "bad compression header for section %zd: %s"
msgstr "No se puede obtener el encabezamiento de sección %zu: %s"
-#: src/readelf.c:1224
+#: src/readelf.c:1297
#, fuzzy, c-format
msgid "bad gnu compressed size for section %zd: %s"
msgstr "No se pueden obtener datos para la sección %d: %s"
-#: src/readelf.c:1242
+#: src/readelf.c:1315
msgid "Program Headers:"
msgstr "encabezamientos de programa:"
-#: src/readelf.c:1244
+#: src/readelf.c:1317
msgid ""
" Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align"
msgstr ""
" Tipo Compensación Dirección Virtual Dirección "
"Física Tamaño de Fichero Tamaño de Memoria Alineación de bandera"
-#: src/readelf.c:1247
+#: src/readelf.c:1320
msgid ""
" Type Offset VirtAddr PhysAddr FileSiz "
"MemSiz Flg Align"
@@ -4953,12 +4405,12 @@
" Tipo Compensación Dirección Virtual Dirección "
"Física Tamaño de Fichero Tamaño de Memoria Alineación de bandera"
-#: src/readelf.c:1304
+#: src/readelf.c:1377
#, c-format
msgid "\t[Requesting program interpreter: %s]\n"
msgstr "\t[Solicitando intérprete de programa: %s]\n"
-#: src/readelf.c:1325
+#: src/readelf.c:1398
msgid ""
"\n"
" Section to Segment mapping:\n"
@@ -4968,12 +4420,12 @@
" Sección para asignación de segmento:\n"
" Secciones de segmento..."
-#: src/readelf.c:1336 src/unstrip.c:1950 src/unstrip.c:1992 src/unstrip.c:1999
+#: src/readelf.c:1409 src/unstrip.c:1944 src/unstrip.c:1986 src/unstrip.c:1993
#, c-format
msgid "cannot get program header: %s"
msgstr "no se puede obtener memoria para encabezamiento del programa: %s"
-#: src/readelf.c:1479
+#: src/readelf.c:1552
#, c-format
msgid ""
"\n"
@@ -4988,7 +4440,7 @@
"\n"
"Grupo de sección COMDAT [%2zu] '%s' con firma '%s' contiene entradas %zu:\n"
-#: src/readelf.c:1484
+#: src/readelf.c:1557
#, c-format
msgid ""
"\n"
@@ -5003,25 +4455,31 @@
"\n"
"Grupo de sección [%2zu] '%s' con firma '%s' contiene entradas %zu:\n"
-#: src/readelf.c:1492
+#: src/readelf.c:1565
msgid "<INVALID SYMBOL>"
msgstr "<SÍMBOLO INVÁLIDO>"
-#: src/readelf.c:1506
+#: src/readelf.c:1579
msgid "<INVALID SECTION>"
msgstr "<SECCIÓN INVÁLIDA>"
-#: src/readelf.c:1529 src/readelf.c:2238 src/readelf.c:3317
+#: src/readelf.c:1602 src/readelf.c:2329 src/readelf.c:3430 src/readelf.c:12294
+#: src/readelf.c:12301 src/readelf.c:12345 src/readelf.c:12352
msgid "Couldn't uncompress section"
msgstr ""
-#: src/readelf.c:1673 src/readelf.c:2306 src/readelf.c:2564 src/readelf.c:2640
-#: src/readelf.c:2944 src/readelf.c:3018 src/readelf.c:4716
+#: src/readelf.c:1607 src/readelf.c:2334 src/readelf.c:3435
+#, fuzzy, c-format
+msgid "cannot get section [%zd] header: %s"
+msgstr "No se puede obtener encabezamiento de sección: %s"
+
+#: src/readelf.c:1751 src/readelf.c:2401 src/readelf.c:2659 src/readelf.c:2735
+#: src/readelf.c:3039 src/readelf.c:3113 src/readelf.c:5308
#, fuzzy, c-format
msgid "invalid sh_link value in section %zu"
msgstr ".debug_line section inválida"
-#: src/readelf.c:1676
+#: src/readelf.c:1754
#, c-format
msgid ""
"\n"
@@ -5042,36 +4500,36 @@
" Dirección: %#0*<PRIx64> Compensación: %#08<PRIx64> Enlace a sección: "
"[%2u] '%s'\n"
-#: src/readelf.c:1686
+#: src/readelf.c:1764
msgid " Type Value\n"
msgstr " Tipo Valor\n"
-#: src/readelf.c:1710
+#: src/readelf.c:1788
#, c-format
msgid "Shared library: [%s]\n"
msgstr "Biblioteca compartida: [%s]\n"
-#: src/readelf.c:1715
+#: src/readelf.c:1793
#, c-format
msgid "Library soname: [%s]\n"
msgstr "Nombre-so de la biblioteca: [%s]\n"
-#: src/readelf.c:1720
+#: src/readelf.c:1798
#, c-format
msgid "Library rpath: [%s]\n"
msgstr "Rpath de la biblioteca: [%s]\n"
-#: src/readelf.c:1725
+#: src/readelf.c:1803
#, c-format
msgid "Library runpath: [%s]\n"
msgstr "Ruta de ejecución de la biblioteca: [%s]\n"
-#: src/readelf.c:1745
+#: src/readelf.c:1823
#, c-format
msgid "%<PRId64> (bytes)\n"
msgstr "%<PRId64> (bytes)\n"
-#: src/readelf.c:1858 src/readelf.c:2048
+#: src/readelf.c:1936 src/readelf.c:2126
#, c-format
msgid ""
"\n"
@@ -5080,7 +4538,7 @@
"\n"
"Tabla de símbolos inválida en compensación %#0<PRIx64>\n"
-#: src/readelf.c:1876 src/readelf.c:2066
+#: src/readelf.c:1954 src/readelf.c:2144
#, c-format
msgid ""
"\n"
@@ -5099,7 +4557,13 @@
"Sección de reubicación [%2zu] '%s' para sección [%2u] '%s' en compensación "
"%#0<PRIx64> contiene entradas %d:\n"
-#: src/readelf.c:1891 src/readelf.c:2081
+#. The .rel.dyn section does not refer to a specific section but
+#. instead of section index zero. Do not try to print a section
+#. name.
+#. The .rela.dyn section does not refer to a specific section but
+#. instead of section index zero. Do not try to print a section
+#. name.
+#: src/readelf.c:1969 src/readelf.c:2159
#, c-format
msgid ""
"\n"
@@ -5116,29 +4580,29 @@
"Sección de reubicación [%2u] '%s' en compensación %#0<PRIx64> contiene "
"entradas %d:\n"
-#: src/readelf.c:1901
+#: src/readelf.c:1979
msgid " Offset Type Value Name\n"
msgstr " Compensación Tipo Valor Nombre\n"
-#: src/readelf.c:1903
+#: src/readelf.c:1981
msgid " Offset Type Value Name\n"
msgstr " Compensación Tipo Valor Nombre\n"
-#: src/readelf.c:1956 src/readelf.c:1967 src/readelf.c:1980 src/readelf.c:2001
-#: src/readelf.c:2013 src/readelf.c:2147 src/readelf.c:2159 src/readelf.c:2173
-#: src/readelf.c:2195 src/readelf.c:2208
+#: src/readelf.c:2034 src/readelf.c:2045 src/readelf.c:2058 src/readelf.c:2079
+#: src/readelf.c:2091 src/readelf.c:2225 src/readelf.c:2237 src/readelf.c:2251
+#: src/readelf.c:2273 src/readelf.c:2286
msgid "<INVALID RELOC>"
msgstr "<REUBIC INVÁLIDA>"
-#: src/readelf.c:2091
+#: src/readelf.c:2169
msgid " Offset Type Value Addend Name\n"
msgstr " Compensación Tipo Valor Nombre Adend\n"
-#: src/readelf.c:2093
+#: src/readelf.c:2171
msgid " Offset Type Value Addend Name\n"
msgstr " Compensación Tipo Valor Nombre Adend\n"
-#: src/readelf.c:2314
+#: src/readelf.c:2409
#, c-format
msgid ""
"\n"
@@ -5153,40 +4617,40 @@
"\n"
"La tabla de símbolos [%2u] '%s' contiene entradas %u:\n"
-#: src/readelf.c:2319
+#: src/readelf.c:2414
#, c-format
msgid " %lu local symbol String table: [%2u] '%s'\n"
msgid_plural " %lu local symbols String table: [%2u] '%s'\n"
msgstr[0] "símbolos locales %lu Tabla de cadena: [%2u] '%s'\n"
msgstr[1] " Símbolos locales %lu Tabla de cadenas: [%2u] '%s'\n"
-#: src/readelf.c:2327
+#: src/readelf.c:2422
msgid " Num: Value Size Type Bind Vis Ndx Name\n"
msgstr " Núm: Valor Tamaño Tipo Unión Vis Nombre Ndx\n"
-#: src/readelf.c:2329
+#: src/readelf.c:2424
msgid " Num: Value Size Type Bind Vis Ndx Name\n"
msgstr " Num: Valor Tamaño Tipo Unión Vis Nombre Ndx\n"
-#: src/readelf.c:2349
+#: src/readelf.c:2444
#, c-format
msgid "%5u: %0*<PRIx64> %6<PRId64> %-7s %-6s %-9s %6s %s"
msgstr "%5u: %0*<PRIx64> %6<PRId64> %-7s %-6s %-9s %6s %s"
-#: src/readelf.c:2437
+#: src/readelf.c:2532
#, c-format
msgid "bad dynamic symbol"
msgstr "símbolo dinámico erróneo"
-#: src/readelf.c:2519
+#: src/readelf.c:2614
msgid "none"
msgstr "nada"
-#: src/readelf.c:2536
+#: src/readelf.c:2631
msgid "| <unknown>"
msgstr "| <desconocido>"
-#: src/readelf.c:2567
+#: src/readelf.c:2662
#, c-format
msgid ""
"\n"
@@ -5207,17 +4671,17 @@
" Dirección: %#0*<PRIx64> Compensación: %#08<PRIx64> Enlace a sección: "
"[%2u] '%s'\n"
-#: src/readelf.c:2588
+#: src/readelf.c:2683
#, c-format
msgid " %#06x: Version: %hu File: %s Cnt: %hu\n"
msgstr " %#06x: Versión: %hu Fichero: %s Conteo: %hu\n"
-#: src/readelf.c:2601
+#: src/readelf.c:2696
#, c-format
msgid " %#06x: Name: %s Flags: %s Version: %hu\n"
msgstr " %#06x: Nombre: %s Banderas: %s Versión: %hu\n"
-#: src/readelf.c:2644
+#: src/readelf.c:2739
#, c-format
msgid ""
"\n"
@@ -5238,18 +4702,19 @@
" Dirección: %#0*<PRIx64> Compensación: %#08<PRIx64> Enlace a sección: "
"[%2u] '%s'\n"
-#: src/readelf.c:2672
+#: src/readelf.c:2767
#, c-format
msgid " %#06x: Version: %hd Flags: %s Index: %hd Cnt: %hd Name: %s\n"
msgstr ""
" %#06x: Versión: %hd Banderas: %s Índice: %hd Conteo: %hd Nombre: %s\n"
-#: src/readelf.c:2687
+#: src/readelf.c:2782
#, c-format
msgid " %#06x: Parent %d: %s\n"
msgstr " %#06x: Principal %d: %s\n"
-#: src/readelf.c:2948
+#. Print the header.
+#: src/readelf.c:3043
#, c-format
msgid ""
"\n"
@@ -5270,15 +4735,15 @@
" Dirección: %#0*<PRIx64> Compensación: %#08<PRIx64> Enlace a sección: "
"[%2u] '%s'"
-#: src/readelf.c:2976
+#: src/readelf.c:3071
msgid " 0 *local* "
msgstr " 0 *local* "
-#: src/readelf.c:2981
+#: src/readelf.c:3076
msgid " 1 *global* "
msgstr " 1 *global* "
-#: src/readelf.c:3023
+#: src/readelf.c:3118
#, c-format
msgid ""
"\n"
@@ -5303,22 +4768,22 @@
" Dirección: %#0*<PRIx64> Compensación: %#08<PRIx64> Enlace a sección: "
"[%2u] '%s'\n"
-#: src/readelf.c:3045
+#: src/readelf.c:3140
#, no-c-format
msgid " Length Number % of total Coverage\n"
msgstr " Longitud Número % of total Cobertura\n"
-#: src/readelf.c:3047
+#: src/readelf.c:3142
#, c-format
msgid " 0 %6<PRIu32> %5.1f%%\n"
msgstr " 0 %6<PRIu32> %5.1f%%\n"
-#: src/readelf.c:3054
+#: src/readelf.c:3149
#, c-format
msgid "%7d %6<PRIu32> %5.1f%% %5.1f%%\n"
msgstr "%7d %6<PRIu32> %5.1f%% %5.1f%%\n"
-#: src/readelf.c:3067
+#: src/readelf.c:3162
#, c-format
msgid ""
" Average number of tests: successful lookup: %f\n"
@@ -5327,27 +4792,37 @@
" Número promedio de pruebas: búsqueda exitosa: %f\n"
" búsqueda sin éxito: %f\n"
-#: src/readelf.c:3085 src/readelf.c:3140 src/readelf.c:3197
+#: src/readelf.c:3180 src/readelf.c:3244 src/readelf.c:3310
#, c-format
msgid "cannot get data for section %d: %s"
msgstr "No se pueden obtener datos para la sección %d: %s"
-#: src/readelf.c:3093
+#: src/readelf.c:3188
#, fuzzy, c-format
msgid "invalid data in sysv.hash section %d"
msgstr "Datos inválidos en sección [%zu] '%s'"
-#: src/readelf.c:3148
+#: src/readelf.c:3217
+#, fuzzy, c-format
+msgid "invalid chain in sysv.hash section %d"
+msgstr "Datos inválidos en sección [%zu] '%s'"
+
+#: src/readelf.c:3252
#, fuzzy, c-format
msgid "invalid data in sysv.hash64 section %d"
msgstr "Datos inválidos en sección [%zu] '%s'"
-#: src/readelf.c:3206
+#: src/readelf.c:3283
+#, fuzzy, c-format
+msgid "invalid chain in sysv.hash64 section %d"
+msgstr "Datos inválidos en sección [%zu] '%s'"
+
+#: src/readelf.c:3319
#, fuzzy, c-format
msgid "invalid data in gnu.hash section %d"
msgstr "Datos inválidos en sección [%zu] '%s'"
-#: src/readelf.c:3273
+#: src/readelf.c:3386
#, c-format
msgid ""
" Symbol Bias: %u\n"
@@ -5357,7 +4832,7 @@
" Tamaño de Bitmask: %zu bytes %<PRIuFAST32>%% bits establecen segundo "
"cambio de dispersión: %u\n"
-#: src/readelf.c:3358
+#: src/readelf.c:3475
#, c-format
msgid ""
"\n"
@@ -5374,7 +4849,7 @@
"Sección de lista de biblioteca [%2zu] '%s' en compensación %#0<PRIx64> "
"contiene entradas %d:\n"
-#: src/readelf.c:3372
+#: src/readelf.c:3489
msgid ""
" Library Time Stamp Checksum Version "
"Flags"
@@ -5382,7 +4857,7 @@
" Biblioteca Marca de tiempo Indicadores "
"de versión de suma de verificación"
-#: src/readelf.c:3422
+#: src/readelf.c:3539
#, c-format
msgid ""
"\n"
@@ -5393,140 +4868,102 @@
"Sección de atributos de objeto [%2zu] '%s' de %<PRIu64> bytes con "
"desplazamiento %#0<PRIx64>:\n"
-#: src/readelf.c:3439
+#: src/readelf.c:3556
msgid " Owner Size\n"
msgstr " Propietario Tamaño\n"
-#: src/readelf.c:3468
+#: src/readelf.c:3585
#, c-format
msgid " %-13s %4<PRIu32>\n"
msgstr " %-13s %4<PRIu32>\n"
-#: src/readelf.c:3507
+#. Unknown subsection, print and skip.
+#: src/readelf.c:3624
#, c-format
msgid " %-4u %12<PRIu32>\n"
msgstr " %-4u %12<PRIu32>\n"
-#: src/readelf.c:3512
+#. Tag_File
+#: src/readelf.c:3629
#, c-format
msgid " File: %11<PRIu32>\n"
msgstr " File: %11<PRIu32>\n"
-#: src/readelf.c:3561
+#: src/readelf.c:3678
#, c-format
msgid " %s: %<PRId64>, %s\n"
msgstr " %s: %<PRId64>, %s\n"
-#: src/readelf.c:3564
+#: src/readelf.c:3681
#, c-format
msgid " %s: %<PRId64>\n"
msgstr " %s: %<PRId64>\n"
-#: src/readelf.c:3567
+#: src/readelf.c:3684
#, c-format
msgid " %s: %s\n"
msgstr " %s: %s\n"
-#: src/readelf.c:3577
+#: src/readelf.c:3694
#, c-format
msgid " %u: %<PRId64>\n"
msgstr " %u: %<PRId64>\n"
-#: src/readelf.c:3580
+#: src/readelf.c:3697
#, c-format
msgid " %u: %s\n"
msgstr " %u: %s\n"
-#: src/readelf.c:3625
-#, c-format
-msgid "%s+%#<PRIx64> <%s+%#<PRIx64>>"
-msgstr "%s+%#<PRIx64> <%s+%#<PRIx64>>"
+#: src/readelf.c:3767
+#, fuzzy, c-format
+msgid "sprintf failure"
+msgstr "mprotect falló"
-#: src/readelf.c:3628
-#, c-format
-msgid "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
-msgstr "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
-
-#: src/readelf.c:3633
-#, c-format
-msgid "%#<PRIx64> <%s+%#<PRIx64>>"
-msgstr "%#<PRIx64> <%s+%#<PRIx64>>"
-
-#: src/readelf.c:3636
-#, c-format
-msgid "%#0*<PRIx64> <%s+%#<PRIx64>>"
-msgstr "%#0*<PRIx64> <%s+%#<PRIx64>>"
-
-#: src/readelf.c:3642
-#, c-format
-msgid "%s+%#<PRIx64> <%s>"
-msgstr "%s+%#<PRIx64> <%s>"
-
-#: src/readelf.c:3645
-#, c-format
-msgid "%s+%#0*<PRIx64> <%s>"
-msgstr "%s+%#0*<PRIx64> <%s>"
-
-#: src/readelf.c:3649
-#, c-format
-msgid "%#<PRIx64> <%s>"
-msgstr "%#<PRIx64> <%s>"
-
-#: src/readelf.c:3652
-#, c-format
-msgid "%#0*<PRIx64> <%s>"
-msgstr "%#0*<PRIx64> <%s>"
-
-#: src/readelf.c:3657
-#, c-format
-msgid "%s+%#<PRIx64>"
-msgstr "%s+%#<PRIx64>"
-
-#: src/readelf.c:3660
-#, c-format
-msgid "%s+%#0*<PRIx64>"
-msgstr "%s+%#0*<PRIx64>"
-
-#: src/readelf.c:4038
+#: src/readelf.c:4249
msgid "empty block"
msgstr "bloque vacío"
-#: src/readelf.c:4041
+#: src/readelf.c:4252
#, c-format
msgid "%zu byte block:"
msgstr "bloque de byte %zu:"
-#: src/readelf.c:4438
-#, c-format
-msgid "%*s[%4<PRIuMAX>] %s <TRUNCATED>\n"
+#: src/readelf.c:4730
+#, fuzzy, c-format
+msgid "%*s[%2<PRIuMAX>] %s <TRUNCATED>\n"
msgstr "%*s[%4<PRIuMAX>] %s <TRUNCATED>\n"
-#: src/readelf.c:4495
+#: src/readelf.c:4794
#, c-format
msgid "%s %#<PRIx64> used with different address sizes"
msgstr "%s %#<PRIx64> utilizado con direcciones de diferente tamaño"
-#: src/readelf.c:4502
+#: src/readelf.c:4801
#, c-format
msgid "%s %#<PRIx64> used with different offset sizes"
msgstr "%s %#<PRIx64> utilizado con offsetr de diferente tamaño"
-#: src/readelf.c:4509
+#: src/readelf.c:4808
#, fuzzy, c-format
msgid "%s %#<PRIx64> used with different base addresses"
msgstr "%s %#<PRIx64> utilizado con direcciones de diferente tamaño"
-#: src/readelf.c:4598
+#: src/readelf.c:4815
+#, fuzzy, c-format
+msgid "%s %#<PRIx64> used with different attribute %s and %s"
+msgstr "%s %#<PRIx64> utilizado con direcciones de diferente tamaño"
+
+#: src/readelf.c:4912
#, c-format
msgid " [%6tx] <UNUSED GARBAGE IN REST OF SECTION>\n"
msgstr " [%6tx] <MATERIAL INUTIL SIN UTILIZAR EN EL RESTO DE LA SECCION>\n"
-#: src/readelf.c:4606
+#: src/readelf.c:4920
#, c-format
msgid " [%6tx] <UNUSED GARBAGE> ... %<PRIu64> bytes ...\n"
msgstr " [%6tx] <MATERIAL INUTIL NO UTILIZADO> ... %<PRIu64> bytes ...\n"
-#: src/readelf.c:4632
+#: src/readelf.c:4998
#, c-format
msgid ""
"\n"
@@ -5537,7 +4974,7 @@
"Sección DWARF [%2zu] '%s' en compensación %#<PRIx64>:\n"
" [ Código]\n"
-#: src/readelf.c:4640
+#: src/readelf.c:5006
#, c-format
msgid ""
"\n"
@@ -5546,30 +4983,74 @@
"\n"
"Sección de abreviatura en compensación %<PRIu64>:\n"
-#: src/readelf.c:4653
+#: src/readelf.c:5019
#, c-format
msgid " *** error while reading abbreviation: %s\n"
msgstr " *** error en lectura de abreviatura: %s\n"
-#: src/readelf.c:4669
+#: src/readelf.c:5035
#, c-format
msgid " [%5u] offset: %<PRId64>, children: %s, tag: %s\n"
msgstr " [%5u] compensación: %<PRId64>, hijos: %s, etiqueta: %s\n"
-#: src/readelf.c:4672
-msgid "yes"
-msgstr "sí"
+#: src/readelf.c:5068 src/readelf.c:5377 src/readelf.c:5541 src/readelf.c:5926
+#: src/readelf.c:6527 src/readelf.c:8168 src/readelf.c:8838 src/readelf.c:9274
+#: src/readelf.c:9518 src/readelf.c:9683 src/readelf.c:10044
+#: src/readelf.c:10102
+#, c-format
+msgid ""
+"\n"
+"DWARF section [%2zu] '%s' at offset %#<PRIx64>:\n"
+msgstr ""
+"\n"
+"Sección DWARF [%2zu] '%s' en compensación %#<PRIx64>:\n"
-#: src/readelf.c:4672
-msgid "no"
-msgstr "no"
+#: src/readelf.c:5081
+#, fuzzy, c-format
+msgid "cannot get .debug_addr section data: %s"
+msgstr "no se pueden obtener datos de sección: %s"
-#: src/readelf.c:4706 src/readelf.c:4779
+#: src/readelf.c:5181 src/readelf.c:5205 src/readelf.c:5586 src/readelf.c:8883
+#, fuzzy, c-format
+msgid " Length: %8<PRIu64>\n"
+msgstr " (compensación: %#<PRIx64>)"
+
+#: src/readelf.c:5183 src/readelf.c:5220 src/readelf.c:5599 src/readelf.c:8896
+#, fuzzy, c-format
+msgid " DWARF version: %8<PRIu16>\n"
+msgstr " %s: %<PRId64>\n"
+
+#: src/readelf.c:5184 src/readelf.c:5229 src/readelf.c:5608 src/readelf.c:8905
+#, fuzzy, c-format
+msgid " Address size: %8<PRIu64>\n"
+msgstr " (fin de compensación: %#<PRIx64>)"
+
+#: src/readelf.c:5186 src/readelf.c:5239 src/readelf.c:5618 src/readelf.c:8915
+#, fuzzy, c-format
+msgid " Segment size: %8<PRIu64>\n"
+msgstr " establecer archivo a %<PRIu64>\n"
+
+#: src/readelf.c:5224 src/readelf.c:5603 src/readelf.c:8900 src/readelf.c:10234
+#, fuzzy, c-format
+msgid "Unknown version"
+msgstr "versión desconocida"
+
+#: src/readelf.c:5234 src/readelf.c:5447 src/readelf.c:5613 src/readelf.c:8910
+#, fuzzy, c-format
+msgid "unsupported address size"
+msgstr "no hay valor de dirección"
+
+#: src/readelf.c:5245 src/readelf.c:5456 src/readelf.c:5623 src/readelf.c:8920
+#, c-format
+msgid "unsupported segment size"
+msgstr ""
+
+#: src/readelf.c:5298 src/readelf.c:5372
#, c-format
msgid "cannot get .debug_aranges content: %s"
msgstr "no se ha podido obtener contenido de .debug_aranges: %s"
-#: src/readelf.c:4721
+#: src/readelf.c:5313
#, c-format
msgid ""
"\n"
@@ -5584,12 +5065,12 @@
"\n"
"Sección DWARF [%2zu] '%s' en compensación %#<PRIx64> contiene entradas %zu:\n"
-#: src/readelf.c:4752
+#: src/readelf.c:5344
#, c-format
msgid " [%*zu] ???\n"
msgstr " [%*zu] ???\n"
-#: src/readelf.c:4754
+#: src/readelf.c:5346
#, c-format
msgid ""
" [%*zu] start: %0#*<PRIx64>, length: %5<PRIu64>, CU DIE offset: %6<PRId64>\n"
@@ -5597,17 +5078,7 @@
" Inicio [%*zu]: %0#*<PRIx64>, longitud: %5<PRIu64>, compensación CU DIE: "
"%6<PRId64>\n"
-#: src/readelf.c:4784 src/readelf.c:4938 src/readelf.c:5514 src/readelf.c:6468
-#: src/readelf.c:7000 src/readelf.c:7120 src/readelf.c:7284 src/readelf.c:7709
-#, c-format
-msgid ""
-"\n"
-"DWARF section [%2zu] '%s' at offset %#<PRIx64>:\n"
-msgstr ""
-"\n"
-"Sección DWARF [%2zu] '%s' en compensación %#<PRIx64>:\n"
-
-#: src/readelf.c:4797 src/readelf.c:6494
+#: src/readelf.c:5390 src/readelf.c:8195
#, fuzzy, c-format
msgid ""
"\n"
@@ -5616,111 +5087,152 @@
"\n"
"Tabla en compensación %Zu:\n"
-#: src/readelf.c:4801 src/readelf.c:5538 src/readelf.c:6505
+#: src/readelf.c:5394 src/readelf.c:5567 src/readelf.c:6551 src/readelf.c:8206
+#: src/readelf.c:8864
#, c-format
msgid "invalid data in section [%zu] '%s'"
msgstr "Datos inválidos en sección [%zu] '%s'"
-#: src/readelf.c:4817
+#: src/readelf.c:5410
#, fuzzy, c-format
msgid ""
"\n"
" Length: %6<PRIu64>\n"
msgstr " (compensación: %#<PRIx64>)"
-#: src/readelf.c:4829
+#: src/readelf.c:5422
#, fuzzy, c-format
msgid " DWARF version: %6<PRIuFAST16>\n"
msgstr " %s: %<PRId64>\n"
-#: src/readelf.c:4833
+#: src/readelf.c:5426
#, c-format
msgid "unsupported aranges version"
msgstr ""
-#: src/readelf.c:4844
+#: src/readelf.c:5437
#, fuzzy, c-format
msgid " CU offset: %6<PRIx64>\n"
msgstr " (compensación: %#<PRIx64>)"
-#: src/readelf.c:4850
+#: src/readelf.c:5443
#, fuzzy, c-format
msgid " Address size: %6<PRIu64>\n"
msgstr " (fin de compensación: %#<PRIx64>)"
-#: src/readelf.c:4854
-#, fuzzy, c-format
-msgid "unsupported address size"
-msgstr "no hay valor de dirección"
-
-#: src/readelf.c:4859
+#: src/readelf.c:5452
#, fuzzy, c-format
msgid ""
" Segment size: %6<PRIu64>\n"
"\n"
msgstr " establecer archivo a %<PRIu64>\n"
-#: src/readelf.c:4863
-#, c-format
-msgid "unsupported segment size"
-msgstr ""
-
-#: src/readelf.c:4903
-#, fuzzy, c-format
-msgid " %s..%s (%<PRIx64>)\n"
-msgstr " %s: %<PRId64>\n"
-
-#: src/readelf.c:4906
-#, fuzzy, c-format
-msgid " %s..%s\n"
-msgstr " [%6tx] %s..%s\n"
-
-#: src/readelf.c:4915
+#: src/readelf.c:5507
#, c-format
msgid " %zu padding bytes\n"
msgstr ""
-#: src/readelf.c:4933
+#: src/readelf.c:5550
+#, fuzzy, c-format
+msgid "cannot get .debug_rnglists content: %s"
+msgstr "no se ha podido obtener contenido de .debug_ranges: %s"
+
+#: src/readelf.c:5573 src/readelf.c:8870
+#, fuzzy, c-format
+msgid ""
+"Table at Offset 0x%<PRIx64>:\n"
+"\n"
+msgstr " (fin de compensación: %#<PRIx64>)"
+
+#: src/readelf.c:5628 src/readelf.c:8925
+#, fuzzy, c-format
+msgid " Offset entries: %8<PRIu64>\n"
+msgstr " (compensación: %#<PRIx64>)"
+
+#: src/readelf.c:5644 src/readelf.c:8941
+#, c-format
+msgid " Unknown CU base: "
+msgstr ""
+
+#: src/readelf.c:5646 src/readelf.c:8943
+#, c-format
+msgid " CU [%6<PRIx64>] base: "
+msgstr ""
+
+#: src/readelf.c:5652 src/readelf.c:8949
+#, c-format
+msgid " Not associated with a CU.\n"
+msgstr ""
+
+#: src/readelf.c:5663 src/readelf.c:8960
+#, c-format
+msgid "too many offset entries for unit length"
+msgstr ""
+
+#: src/readelf.c:5667 src/readelf.c:8964
+#, fuzzy, c-format
+msgid " Offsets starting at 0x%<PRIx64>:\n"
+msgstr " Propietario Tamaño\n"
+
+#: src/readelf.c:5719
+#, fuzzy, c-format
+msgid "invalid range list data"
+msgstr "datos inválidos"
+
+#: src/readelf.c:5904 src/readelf.c:9252
+#, c-format
+msgid ""
+" %zu padding bytes\n"
+"\n"
+msgstr ""
+
+#: src/readelf.c:5921
#, c-format
msgid "cannot get .debug_ranges content: %s"
msgstr "no se ha podido obtener contenido de .debug_ranges: %s"
-#: src/readelf.c:4963 src/readelf.c:7027
+#: src/readelf.c:5957 src/readelf.c:9307
+#, c-format
+msgid ""
+"\n"
+" Unknown CU base: "
+msgstr ""
+
+#: src/readelf.c:5959 src/readelf.c:9309
+#, c-format
+msgid ""
+"\n"
+" CU [%6<PRIx64>] base: "
+msgstr ""
+
+#: src/readelf.c:5968 src/readelf.c:9335 src/readelf.c:9361
#, c-format
msgid " [%6tx] <INVALID DATA>\n"
msgstr " [%6tx] <DATOS INVÁLIDOS>\n"
-#: src/readelf.c:4985 src/readelf.c:7049
-#, c-format
-msgid " [%6tx] base address %s\n"
+#: src/readelf.c:5989 src/readelf.c:9441
+#, fuzzy, c-format
+msgid ""
+" [%6tx] base address\n"
+" "
msgstr " [%6tx] (dirección base) %s\n"
-#: src/readelf.c:4992 src/readelf.c:7056
-#, c-format
-msgid " [%6tx] empty list\n"
+#: src/readelf.c:5997 src/readelf.c:9449
+#, fuzzy, c-format
+msgid " [%6tx] empty list\n"
msgstr " [%6tx] lista vacía\n"
-#: src/readelf.c:5003
-#, c-format
-msgid " [%6tx] %s..%s\n"
-msgstr " [%6tx] %s..%s\n"
-
-#: src/readelf.c:5005
-#, c-format
-msgid " %s..%s\n"
-msgstr " %s..%s\n"
-
-#: src/readelf.c:5184
+#: src/readelf.c:6252
#, fuzzy
msgid " <INVALID DATA>\n"
msgstr " <DATOS INVÁLIDOS>\n"
-#: src/readelf.c:5493
+#: src/readelf.c:6505
#, fuzzy, c-format
msgid "cannot get ELF: %s"
msgstr "no se puede leer encabezamiento ELF: %s"
-#: src/readelf.c:5510
+#: src/readelf.c:6523
#, c-format
msgid ""
"\n"
@@ -5730,7 +5242,7 @@
"Sección de información de marco de llamada [%2zu] '%s' en compensación "
"%#<PRIx64>:\n"
-#: src/readelf.c:5560
+#: src/readelf.c:6573
#, c-format
msgid ""
"\n"
@@ -5739,50 +5251,65 @@
"\n"
" [%6tx] Terminator cero\n"
-#: src/readelf.c:5653 src/readelf.c:5808
+#: src/readelf.c:6666 src/readelf.c:6820
#, c-format
msgid "invalid augmentation length"
msgstr "longitud de aumento inválida"
-#: src/readelf.c:5668
+#: src/readelf.c:6681
msgid "FDE address encoding: "
msgstr "Codificación de dirección FDE:"
-#: src/readelf.c:5674
+#: src/readelf.c:6687
msgid "LSDA pointer encoding: "
msgstr "Codificación de puntero LSDA:"
-#: src/readelf.c:5785
+#: src/readelf.c:6797
#, c-format
msgid " (offset: %#<PRIx64>)"
msgstr " (compensación: %#<PRIx64>)"
-#: src/readelf.c:5792
+#: src/readelf.c:6804
#, c-format
msgid " (end offset: %#<PRIx64>)"
msgstr " (fin de compensación: %#<PRIx64>)"
-#: src/readelf.c:5829
+#: src/readelf.c:6841
#, c-format
msgid " %-26sLSDA pointer: %#<PRIx64>\n"
msgstr "Puntero %-26sLSDA: %#<PRIx64>\n"
-#: src/readelf.c:5884
-#, c-format
-msgid "cannot get attribute code: %s"
+#: src/readelf.c:6926
+#, fuzzy, c-format
+msgid "DIE [%<PRIx64>] cannot get attribute code: %s"
msgstr "No se puede obtener código de atributo: %s"
-#: src/readelf.c:5893
-#, c-format
-msgid "cannot get attribute form: %s"
+#: src/readelf.c:6936
+#, fuzzy, c-format
+msgid "DIE [%<PRIx64>] cannot get attribute form: %s"
msgstr "No se puede obtener forma de atributo: %s"
-#: src/readelf.c:5908
-#, c-format
-msgid "cannot get attribute value: %s"
+#: src/readelf.c:6958
+#, fuzzy, c-format
+msgid "DIE [%<PRIx64>] cannot get attribute '%s' (%s) value: %s"
msgstr "No se puede obtener valor: %s"
-#: src/readelf.c:6207
+#: src/readelf.c:7291
+#, fuzzy, c-format
+msgid "invalid file (%<PRId64>): %s"
+msgstr "Archivo inválido"
+
+#: src/readelf.c:7295
+#, fuzzy, c-format
+msgid "no srcfiles for CU [%<PRIx64>]"
+msgstr " establecer archivo a %<PRIu64>\n"
+
+#: src/readelf.c:7299
+#, fuzzy, c-format
+msgid "couldn't get DWARF CU: %s"
+msgstr "no se puede leer encabezamiento ELF: %s"
+
+#: src/readelf.c:7522
#, c-format
msgid ""
"\n"
@@ -5793,20 +5320,25 @@
"Sección DWARF [%2zu] '%s' en compensación %#<PRIx64>:\n"
" [Offset]\n"
-#: src/readelf.c:6239
-#, c-format
+#: src/readelf.c:7572
+#, fuzzy, c-format
+msgid "cannot get next unit: %s"
+msgstr "No se puede obtener próximo DIE: %s"
+
+#: src/readelf.c:7591
+#, fuzzy, c-format
msgid ""
" Type unit at offset %<PRIu64>:\n"
" Version: %<PRIu16>, Abbreviation section offset: %<PRIu64>, Address size: "
"%<PRIu8>, Offset size: %<PRIu8>\n"
-" Type signature: %#<PRIx64>, Type offset: %#<PRIx64>\n"
+" Type signature: %#<PRIx64>, Type offset: %#<PRIx64> [%<PRIx64>]\n"
msgstr ""
"Tipo de unidad al compensar %<PRIu64>:\n"
" Versión: %<PRIu16>, Abreviación de sección de compensación: %<PRIu64>, "
"Tamaño de dirección: %<PRIu8>, Tamaño de compensación: %<PRIu8>\n"
" Tipo de firma: %#<PRIx64>, Tipo de compensación: %#<PRIx64>\n"
-#: src/readelf.c:6248
+#: src/readelf.c:7603
#, c-format
msgid ""
" Compilation unit at offset %<PRIu64>:\n"
@@ -5817,34 +5349,50 @@
" Versión: %<PRIu16>, Compensación de sección de abreviatura: %<PRIu64>, "
"Tamaño de dirección: %<PRIu8>, Tamaño de compensación: %<PRIu8>\n"
-#: src/readelf.c:6273
+#: src/readelf.c:7613 src/readelf.c:7776
#, c-format
-msgid "cannot get DIE at offset %<PRIu64> in section '%s': %s"
-msgstr "no se puede obtener DIE en compensación %<PRIu64> en sección '%s': %s"
+msgid " Unit type: %s (%<PRIu8>)"
+msgstr ""
-#: src/readelf.c:6287
+#: src/readelf.c:7640
+#, c-format
+msgid "unknown version (%d) or unit type (%d)"
+msgstr ""
+
+#: src/readelf.c:7669
#, c-format
msgid "cannot get DIE offset: %s"
msgstr "no se puede obtener DIE en compensación: %s"
-#: src/readelf.c:6296
-#, c-format
-msgid "cannot get tag of DIE at offset %<PRIu64> in section '%s': %s"
+#: src/readelf.c:7678
+#, fuzzy, c-format
+msgid "cannot get tag of DIE at offset [%<PRIx64>] in section '%s': %s"
msgstr ""
"no se ha podido obtener etiqueta de DIE en compensación%<PRIu64> en sección "
"'%s': %s"
-#: src/readelf.c:6328
+#: src/readelf.c:7716
#, c-format
msgid "cannot get next DIE: %s\n"
msgstr "No se puede obtener próximo DIE: %s\n"
-#: src/readelf.c:6336
+#: src/readelf.c:7724
#, c-format
msgid "cannot get next DIE: %s"
msgstr "No se puede obtener próximo DIE: %s"
-#: src/readelf.c:6372
+#: src/readelf.c:7768
+#, fuzzy, c-format
+msgid ""
+" Split compilation unit at offset %<PRIu64>:\n"
+" Version: %<PRIu16>, Abbreviation section offset: %<PRIu64>, Address size: "
+"%<PRIu8>, Offset size: %<PRIu8>\n"
+msgstr ""
+"Unidad de compilación en compensación %<PRIu64>:\n"
+" Versión: %<PRIu16>, Compensación de sección de abreviatura: %<PRIu64>, "
+"Tamaño de dirección: %<PRIu8>, Tamaño de compensación: %<PRIu8>\n"
+
+#: src/readelf.c:7819
#, fuzzy, c-format
msgid ""
"\n"
@@ -5854,24 +5402,32 @@
"\n"
"Sección DWARF [%2zu] '%s' en compensación %#<PRIx64>:\n"
-#: src/readelf.c:6481
+#: src/readelf.c:8151
+#, fuzzy, c-format
+msgid "unknown form: %s"
+msgstr "Forma %<PRIx64> desconocida"
+
+#: src/readelf.c:8182
#, c-format
msgid "cannot get line data section data: %s"
msgstr "No se puede obtener sección de datos de línea: %s"
-#: src/readelf.c:6551
-#, c-format
+#. Print what we got so far.
+#: src/readelf.c:8284
+#, fuzzy, c-format
msgid ""
"\n"
-" Length: %<PRIu64>\n"
-" DWARF version: %<PRIuFAST16>\n"
-" Prologue length: %<PRIu64>\n"
-" Minimum instruction length: %<PRIuFAST8>\n"
-" Maximum operations per instruction: %<PRIuFAST8>\n"
-" Initial value if '%s': %<PRIuFAST8>\n"
-" Line base: %<PRIdFAST8>\n"
-" Line range: %<PRIuFAST8>\n"
-" Opcode base: %<PRIuFAST8>\n"
+" Length: %<PRIu64>\n"
+" DWARF version: %<PRIuFAST16>\n"
+" Prologue length: %<PRIu64>\n"
+" Address size: %zd\n"
+" Segment selector size: %zd\n"
+" Min instruction length: %<PRIuFAST8>\n"
+" Max operations per instruction: %<PRIuFAST8>\n"
+" Initial value if 'is_stmt': %<PRIuFAST8>\n"
+" Line base: %<PRIdFAST8>\n"
+" Line range: %<PRIuFAST8>\n"
+" Opcode base: %<PRIuFAST8>\n"
"\n"
"Opcodes:\n"
msgstr ""
@@ -5888,19 +5444,34 @@
"\n"
"Códigos operativos:\n"
-#: src/readelf.c:6572
+#: src/readelf.c:8306
+#, fuzzy, c-format
+msgid "cannot handle .debug_line version: %u\n"
+msgstr "no se puede obtener versión de símbolo: %s"
+
+#: src/readelf.c:8314
+#, fuzzy, c-format
+msgid "cannot handle address size: %u\n"
+msgstr "no hay valor de dirección"
+
+#: src/readelf.c:8322
+#, fuzzy, c-format
+msgid "cannot handle segment selector size: %u\n"
+msgstr "No se puede encontrar la sección: %s"
+
+#: src/readelf.c:8332
#, c-format
msgid "invalid data at offset %tu in section [%zu] '%s'"
msgstr "datos inválidos en compensación %tu en sección [%zu] '%s'"
-#: src/readelf.c:6587
+#: src/readelf.c:8347
#, c-format
msgid " [%*<PRIuFAST8>] %hhu argument\n"
msgid_plural " [%*<PRIuFAST8>] %hhu arguments\n"
msgstr[0] " [%*<PRIuFAST8>] argumento %hhu \n"
msgstr[1] " [%*<PRIuFAST8>] argumento %hhu\n"
-#: src/readelf.c:6595
+#: src/readelf.c:8358
msgid ""
"\n"
"Directory table:"
@@ -5908,17 +5479,29 @@
"\n"
"Tabla de Directorio:"
-#: src/readelf.c:6611
+#: src/readelf.c:8364 src/readelf.c:8439
+#, fuzzy, c-format
+msgid " ["
+msgstr " %s: %s\n"
+
+#: src/readelf.c:8433
+#, fuzzy
msgid ""
"\n"
-"File name table:\n"
-" Entry Dir Time Size Name"
+"File name table:"
+msgstr ""
+"\n"
+" Tabla de sitio de llamada:"
+
+#: src/readelf.c:8494
+#, fuzzy
+msgid " Entry Dir Time Size Name"
msgstr ""
"\n"
"Tabla de nombre de archivo:\n"
" Directorio de entrada Tiempo Tamaño Nombre"
-#: src/readelf.c:6646
+#: src/readelf.c:8529
msgid ""
"\n"
"Line number statements:"
@@ -5926,224 +5509,227 @@
"\n"
" Declaraciones de número de Línea:"
-#: src/readelf.c:6697
+#: src/readelf.c:8552
#, fuzzy, c-format
msgid "invalid maximum operations per instruction is zero"
msgstr "longitud mínima inválida de tamaño de cadena coincidente"
-#: src/readelf.c:6733
-#, c-format
-msgid " special opcode %u: address+%u = %s, op_index = %u, line%+d = %zu\n"
+#: src/readelf.c:8586
+#, fuzzy, c-format
+msgid " special opcode %u: address+%u = "
+msgstr " opcode especial %u: dirección+%u = %s, línea%+d = %zu\n"
+
+#: src/readelf.c:8590
+#, fuzzy, c-format
+msgid ", op_index = %u, line%+d = %zu\n"
msgstr ""
" opcode especial %u: dirección+%u = %s, op_index = %u, línea%+d = %zu\n"
-#: src/readelf.c:6738
+#: src/readelf.c:8593
#, c-format
-msgid " special opcode %u: address+%u = %s, line%+d = %zu\n"
-msgstr " opcode especial %u: dirección+%u = %s, línea%+d = %zu\n"
+msgid ", line%+d = %zu\n"
+msgstr ""
-#: src/readelf.c:6758
+#: src/readelf.c:8611
#, c-format
msgid " extended opcode %u: "
msgstr " Código operativo extendido %u: "
-#: src/readelf.c:6763
+#: src/readelf.c:8616
#, fuzzy
msgid " end of sequence"
msgstr "Fin de secuencia"
-#: src/readelf.c:6782
+#: src/readelf.c:8634
#, fuzzy, c-format
-msgid " set address to %s\n"
+msgid " set address to "
msgstr "Establecer dirección a %s\n"
-#: src/readelf.c:6809
+#: src/readelf.c:8662
#, fuzzy, c-format
msgid " define new file: dir=%u, mtime=%<PRIu64>, length=%<PRIu64>, name=%s\n"
msgstr ""
"definir nuevo archivo: dir=%u, mtime=%<PRIu64>, longitud=%<PRIu64>, nombre="
"%s\n"
-#: src/readelf.c:6822
+#: src/readelf.c:8675
#, c-format
msgid " set discriminator to %u\n"
msgstr " establecer discriminador a %u\n"
-#: src/readelf.c:6827
+#. Unknown, ignore it.
+#: src/readelf.c:8680
#, fuzzy
msgid " unknown opcode"
msgstr "código operativo desconocido "
-#: src/readelf.c:6839
+#. Takes no argument.
+#: src/readelf.c:8692
msgid " copy"
msgstr "Copiar"
-#: src/readelf.c:6850
+#: src/readelf.c:8701
#, fuzzy, c-format
-msgid " advance address by %u to %s, op_index to %u\n"
-msgstr "dirección avanzada por %u a %s, op_index a %u\n"
-
-#: src/readelf.c:6854
-#, fuzzy, c-format
-msgid " advance address by %u to %s\n"
+msgid " advance address by %u to "
msgstr "Dirección de avance por %u a %s\n"
-#: src/readelf.c:6865
+#: src/readelf.c:8705 src/readelf.c:8761
+#, c-format
+msgid ", op_index to %u"
+msgstr ""
+
+#: src/readelf.c:8715
#, c-format
msgid " advance line by constant %d to %<PRId64>\n"
msgstr " línea de avance por la constante %d a %<PRId64>\n"
-#: src/readelf.c:6873
+#: src/readelf.c:8723
#, c-format
msgid " set file to %<PRIu64>\n"
msgstr " establecer archivo a %<PRIu64>\n"
-#: src/readelf.c:6883
+#: src/readelf.c:8733
#, c-format
msgid " set column to %<PRIu64>\n"
msgstr " Establecer columna a %<PRIu64>\n"
-#: src/readelf.c:6890
+#: src/readelf.c:8740
#, c-format
msgid " set '%s' to %<PRIuFAST8>\n"
msgstr "Establecer '%s' a %<PRIuFAST8>\n"
-#: src/readelf.c:6896
+#. Takes no argument.
+#: src/readelf.c:8746
msgid " set basic block flag"
msgstr "Establecer bandera de bloque básico"
-#: src/readelf.c:6909
+#: src/readelf.c:8757
#, fuzzy, c-format
-msgid " advance address by constant %u to %s, op_index to %u\n"
-msgstr "dirección avanzada por constante %u a %s, op_index a %u\n"
-
-#: src/readelf.c:6913
-#, fuzzy, c-format
-msgid " advance address by constant %u to %s\n"
+msgid " advance address by constant %u to "
msgstr "Dirección de avance por constante %u a %s\n"
-#: src/readelf.c:6931
+#: src/readelf.c:8776
#, fuzzy, c-format
-msgid " advance address by fixed value %u to %s\n"
+msgid " advance address by fixed value %u to \n"
msgstr "dirección de avance por valor corregido %u a %s\n"
-#: src/readelf.c:6940
+#. Takes no argument.
+#: src/readelf.c:8786
msgid " set prologue end flag"
msgstr " Establecer bandera prologue_end"
-#: src/readelf.c:6945
+#. Takes no argument.
+#: src/readelf.c:8791
msgid " set epilogue begin flag"
msgstr " Establecer bandera epilogue_begin"
-#: src/readelf.c:6954
+#: src/readelf.c:8800
#, c-format
msgid " set isa to %u\n"
msgstr " establecer isa para %u\n"
-#: src/readelf.c:6963
+#. This is a new opcode the generator but not we know about.
+#. Read the parameters associated with it but then discard
+#. everything. Read all the parameters for this opcode.
+#: src/readelf.c:8809
#, c-format
msgid " unknown opcode with %<PRIu8> parameter:"
msgid_plural " unknown opcode with %<PRIu8> parameters:"
msgstr[0] " opcódigo con parámetro %<PRIu8> desconocido:"
msgstr[1] " opcódigo con parámetros %<PRIu8> desconocido:"
-#: src/readelf.c:6995
+#: src/readelf.c:8847
+#, fuzzy, c-format
+msgid "cannot get .debug_loclists content: %s"
+msgstr "no es posible obtener contenido de .debug_loc: %s"
+
+#: src/readelf.c:9016
+#, fuzzy, c-format
+msgid "invalid loclists data"
+msgstr "datos inválidos"
+
+#: src/readelf.c:9269
#, c-format
msgid "cannot get .debug_loc content: %s"
msgstr "no es posible obtener contenido de .debug_loc: %s"
-#: src/readelf.c:7070
-#, c-format
-msgid " [%6tx] %s..%s"
-msgstr " [%6tx] %s..%s"
-
-#: src/readelf.c:7072
-#, c-format
-msgid " %s..%s"
-msgstr " %s..%s"
-
-#: src/readelf.c:7079 src/readelf.c:7967
+#: src/readelf.c:9476 src/readelf.c:10490
msgid " <INVALID DATA>\n"
msgstr " <DATOS INVÁLIDOS>\n"
-#: src/readelf.c:7131 src/readelf.c:7293
+#: src/readelf.c:9530 src/readelf.c:9693
#, c-format
msgid "cannot get macro information section data: %s"
msgstr "no es posible obtener datos de la sección de macro información: %s"
-#: src/readelf.c:7211
+#: src/readelf.c:9610
#, c-format
msgid "%*s*** non-terminated string at end of section"
msgstr "%*s*** cadena no finalizada al final de la sección"
-#: src/readelf.c:7234
+#: src/readelf.c:9633
#, fuzzy, c-format
msgid "%*s*** missing DW_MACINFO_start_file argument at end of section"
msgstr "%*s*** cadena no finalizada al final de la sección"
-#: src/readelf.c:7334
+#: src/readelf.c:9734
#, fuzzy, c-format
msgid " Offset: 0x%<PRIx64>\n"
msgstr " Propietario Tamaño\n"
-#: src/readelf.c:7346
+#: src/readelf.c:9746
#, fuzzy, c-format
msgid " Version: %<PRIu16>\n"
msgstr " %s: %<PRId64>\n"
-#: src/readelf.c:7352 src/readelf.c:8086
+#: src/readelf.c:9752 src/readelf.c:10609
#, c-format
msgid " unknown version, cannot parse section\n"
msgstr ""
-#: src/readelf.c:7359
+#: src/readelf.c:9759
#, fuzzy, c-format
msgid " Flag: 0x%<PRIx8>\n"
msgstr " Dirección de punto de entrada: %#<PRIx64>\n"
-#: src/readelf.c:7362
+#: src/readelf.c:9762
#, fuzzy, c-format
msgid " Offset length: %<PRIu8>\n"
msgstr " (compensación: %#<PRIx64>)"
-#: src/readelf.c:7370
+#: src/readelf.c:9770
#, fuzzy, c-format
msgid " .debug_line offset: 0x%<PRIx64>\n"
msgstr " (fin de compensación: %#<PRIx64>)"
-#: src/readelf.c:7383
+#: src/readelf.c:9795
#, fuzzy, c-format
msgid " extension opcode table, %<PRIu8> items:\n"
msgstr " opcódigo con parámetro %<PRIu8> desconocido:"
-#: src/readelf.c:7390
+#: src/readelf.c:9802
#, c-format
msgid " [%<PRIx8>]"
msgstr ""
-#: src/readelf.c:7402
+#: src/readelf.c:9814
#, fuzzy, c-format
msgid " %<PRIu8> arguments:"
msgstr " [%*<PRIuFAST8>] argumento %hhu \n"
-#: src/readelf.c:7430
+#: src/readelf.c:9829
#, c-format
msgid " no arguments."
msgstr ""
-#: src/readelf.c:7667
-#, c-format
-msgid "vendor opcode not verified?"
-msgstr ""
-
-#: src/readelf.c:7695
+#: src/readelf.c:10030
#, c-format
msgid " [%5d] DIE offset: %6<PRId64>, CU DIE offset: %6<PRId64>, name: %s\n"
msgstr ""
" Compensación [%5d] DIE: %6<PRId64>, Compensación CU DIE: %6<PRId64>, "
"nombre: %s\n"
-#: src/readelf.c:7736
+#: src/readelf.c:10072
#, c-format
msgid ""
"\n"
@@ -6154,12 +5740,37 @@
"Sección DWARF [%2zu] '%s' en compensación %#<PRIx64>:\n"
" %*s String\n"
-#: src/readelf.c:7750
-#, c-format
-msgid " *** error while reading strings: %s\n"
+#: src/readelf.c:10087
+#, fuzzy, c-format
+msgid " *** error, missing string terminator\n"
msgstr " *** error en lectura de cadenas: %s\n"
-#: src/readelf.c:7770
+#: src/readelf.c:10115
+#, fuzzy, c-format
+msgid "cannot get .debug_str_offsets section data: %s"
+msgstr "no se pueden obtener datos de sección: %s"
+
+#: src/readelf.c:10214
+#, fuzzy, c-format
+msgid " Length: %8<PRIu64>\n"
+msgstr " (compensación: %#<PRIx64>)"
+
+#: src/readelf.c:10216
+#, fuzzy, c-format
+msgid " Offset size: %8<PRIu8>\n"
+msgstr " (compensación: %#<PRIx64>)"
+
+#: src/readelf.c:10230
+#, fuzzy, c-format
+msgid " DWARF version: %8<PRIu16>\n"
+msgstr " %s: %<PRId64>\n"
+
+#: src/readelf.c:10239
+#, fuzzy, c-format
+msgid " Padding: %8<PRIx16>\n"
+msgstr " (compensación: %#<PRIx64>)"
+
+#: src/readelf.c:10293
#, c-format
msgid ""
"\n"
@@ -6168,7 +5779,7 @@
"\n"
"Sección de tabla de búsqueda de marco de llamada [%2zu] '.eh_frame_hdr':\n"
-#: src/readelf.c:7872
+#: src/readelf.c:10395
#, c-format
msgid ""
"\n"
@@ -6177,22 +5788,22 @@
"\n"
"Excepción en el manejo de la sección de tabla [%2zu] '.gcc_except_table':\n"
-#: src/readelf.c:7895
+#: src/readelf.c:10418
#, c-format
msgid " LPStart encoding: %#x "
msgstr "Codificación LPStart: %#x "
-#: src/readelf.c:7907
+#: src/readelf.c:10430
#, c-format
msgid " TType encoding: %#x "
msgstr "Codificación TType: %#x "
-#: src/readelf.c:7922
+#: src/readelf.c:10445
#, c-format
msgid " Call site encoding: %#x "
msgstr "Codificación de sitio de llamada: %#x "
-#: src/readelf.c:7935
+#: src/readelf.c:10458
msgid ""
"\n"
" Call site table:"
@@ -6200,7 +5811,7 @@
"\n"
" Tabla de sitio de llamada:"
-#: src/readelf.c:7949
+#: src/readelf.c:10472
#, c-format
msgid ""
" [%4u] Call site start: %#<PRIx64>\n"
@@ -6213,12 +5824,12 @@
" Landing pad: %#<PRIx64>\n"
" Action: %u\n"
-#: src/readelf.c:8022
+#: src/readelf.c:10545
#, c-format
msgid "invalid TType encoding"
msgstr "Codificación TType inválida"
-#: src/readelf.c:8048
+#: src/readelf.c:10571
#, fuzzy, c-format
msgid ""
"\n"
@@ -6227,37 +5838,37 @@
"\n"
"Sección DWARF [%2zu] '%s' en compensación %#<PRIx64> contiene entrada %zu:\n"
-#: src/readelf.c:8077
+#: src/readelf.c:10600
#, fuzzy, c-format
msgid " Version: %<PRId32>\n"
msgstr " %s: %<PRId64>\n"
-#: src/readelf.c:8095
+#: src/readelf.c:10618
#, fuzzy, c-format
msgid " CU offset: %#<PRIx32>\n"
msgstr " (compensación: %#<PRIx64>)"
-#: src/readelf.c:8102
+#: src/readelf.c:10625
#, fuzzy, c-format
msgid " TU offset: %#<PRIx32>\n"
msgstr " (compensación: %#<PRIx64>)"
-#: src/readelf.c:8109
+#: src/readelf.c:10632
#, fuzzy, c-format
msgid " address offset: %#<PRIx32>\n"
msgstr " (fin de compensación: %#<PRIx64>)"
-#: src/readelf.c:8116
+#: src/readelf.c:10639
#, fuzzy, c-format
msgid " symbol offset: %#<PRIx32>\n"
msgstr " (compensación: %#<PRIx64>)"
-#: src/readelf.c:8123
+#: src/readelf.c:10646
#, fuzzy, c-format
msgid " constant offset: %#<PRIx32>\n"
msgstr " (fin de compensación: %#<PRIx64>)"
-#: src/readelf.c:8137
+#: src/readelf.c:10660
#, fuzzy, c-format
msgid ""
"\n"
@@ -6266,7 +5877,7 @@
"\n"
"Sección DWARF [%2zu] '%s' en compensación %#<PRIx64> contiene entrada %zu:\n"
-#: src/readelf.c:8162
+#: src/readelf.c:10685
#, fuzzy, c-format
msgid ""
"\n"
@@ -6275,7 +5886,7 @@
"\n"
"Sección DWARF [%2zu] '%s' en compensación %#<PRIx64> contiene entrada %zu:\n"
-#: src/readelf.c:8191
+#: src/readelf.c:10714
#, fuzzy, c-format
msgid ""
"\n"
@@ -6284,7 +5895,7 @@
"\n"
"Sección DWARF [%2zu] '%s' en compensación %#<PRIx64> contiene entrada %zu:\n"
-#: src/readelf.c:8224
+#: src/readelf.c:10746
#, fuzzy, c-format
msgid ""
"\n"
@@ -6293,17 +5904,18 @@
"\n"
"Tabla de símbolos inválida en compensación %#0<PRIx64>\n"
-#: src/readelf.c:8311
+#: src/readelf.c:10884
#, c-format
msgid "cannot get debug context descriptor: %s"
msgstr "no se puede depurar descriptor de contexto: %s"
-#: src/readelf.c:8467 src/readelf.c:9089 src/readelf.c:9200 src/readelf.c:9258
+#: src/readelf.c:11247 src/readelf.c:11869 src/readelf.c:11980
+#: src/readelf.c:12038
#, c-format
msgid "cannot convert core note data: %s"
msgstr "no es posible convertir datos de la nota principal: %s"
-#: src/readelf.c:8830
+#: src/readelf.c:11610
#, c-format
msgid ""
"\n"
@@ -6312,21 +5924,21 @@
"\n"
"%*s... <repeats %u more times> ..."
-#: src/readelf.c:9337
+#: src/readelf.c:12117
msgid " Owner Data size Type\n"
msgstr " Owner Data size Type\n"
-#: src/readelf.c:9355
+#: src/readelf.c:12135
#, c-format
msgid " %-13.*s %9<PRId32> %s\n"
msgstr " %-13.*s %9<PRId32> %s\n"
-#: src/readelf.c:9405
-#, c-format
-msgid "cannot get content of note section: %s"
+#: src/readelf.c:12185
+#, fuzzy, c-format
+msgid "cannot get content of note: %s"
msgstr "no se puede obtener el contenido de sección de nota: %s"
-#: src/readelf.c:9432
+#: src/readelf.c:12212
#, c-format
msgid ""
"\n"
@@ -6335,7 +5947,7 @@
"\n"
"Sección de nota [%2zu] '%s' de %<PRIu64> bytes en compensación %#0<PRIx64>:\n"
-#: src/readelf.c:9455
+#: src/readelf.c:12235
#, c-format
msgid ""
"\n"
@@ -6344,7 +5956,7 @@
"\n"
"Segmento de nota de %<PRIu64> bytes en compensación %#0<PRIx64>:\n"
-#: src/readelf.c:9501
+#: src/readelf.c:12281
#, fuzzy, c-format
msgid ""
"\n"
@@ -6353,12 +5965,12 @@
"\n"
"Sección [%Zu] '%s' no tiene datos para volcar.\n"
-#: src/readelf.c:9518 src/readelf.c:9559
+#: src/readelf.c:12308 src/readelf.c:12359
#, fuzzy, c-format
msgid "cannot get data for section [%zu] '%s': %s"
msgstr "no se pueden obtener datos para sección [%Zu] '%s': %s"
-#: src/readelf.c:9523
+#: src/readelf.c:12313
#, fuzzy, c-format
msgid ""
"\n"
@@ -6368,7 +5980,7 @@
"Volcado Hex de sección [%Zu] '%s', %<PRIu64> bytes en compensación "
"%#0<PRIx64>:\n"
-#: src/readelf.c:9528
+#: src/readelf.c:12318
#, fuzzy, c-format
msgid ""
"\n"
@@ -6379,7 +5991,7 @@
"Volcado Hex de sección [%Zu] '%s', %<PRIu64> bytes en compensación "
"%#0<PRIx64>:\n"
-#: src/readelf.c:9542
+#: src/readelf.c:12332
#, fuzzy, c-format
msgid ""
"\n"
@@ -6388,7 +6000,7 @@
"\n"
"Sección [%Zu] '%s' no tiene datos para volcar.\n"
-#: src/readelf.c:9564
+#: src/readelf.c:12364
#, fuzzy, c-format
msgid ""
"\n"
@@ -6398,7 +6010,7 @@
"Sección de cadena [%Zu] '%s' contiene %<PRIu64> bytes en compensación "
"%#0<PRIx64>:\n"
-#: src/readelf.c:9569
+#: src/readelf.c:12369
#, fuzzy, c-format
msgid ""
"\n"
@@ -6409,7 +6021,7 @@
"Sección de cadena [%Zu] '%s' contiene %<PRIu64> bytes en compensación "
"%#0<PRIx64>:\n"
-#: src/readelf.c:9618
+#: src/readelf.c:12418
#, c-format
msgid ""
"\n"
@@ -6418,7 +6030,7 @@
"\n"
"sección [%lu] no existe"
-#: src/readelf.c:9647
+#: src/readelf.c:12447
#, c-format
msgid ""
"\n"
@@ -6427,12 +6039,12 @@
"\n"
"sección '%s' no existe"
-#: src/readelf.c:9704
+#: src/readelf.c:12504
#, c-format
msgid "cannot get symbol index of archive '%s': %s"
msgstr "no se puede obtener el índice de símbolo de archivo '%s': %s"
-#: src/readelf.c:9707
+#: src/readelf.c:12507
#, c-format
msgid ""
"\n"
@@ -6441,7 +6053,7 @@
"\n"
"Archivo '%s' no tiene índice de símbolo\n"
-#: src/readelf.c:9711
+#: src/readelf.c:12511
#, fuzzy, c-format
msgid ""
"\n"
@@ -6450,17 +6062,17 @@
"\n"
"Índice de archivo '%s' tiene %Zu entradas:\n"
-#: src/readelf.c:9729
+#: src/readelf.c:12529
#, fuzzy, c-format
msgid "cannot extract member at offset %zu in '%s': %s"
msgstr "no es posible extraer miembro en compensación %Zu en '%s': %s"
-#: src/readelf.c:9734
+#: src/readelf.c:12534
#, c-format
msgid "Archive member '%s' contains:\n"
msgstr "Miembro de archivo contiene '%s':\n"
-#: src/size.c:59
+#: src/size.c:57
msgid ""
"Use the output format FORMAT. FORMAT can be `bsd' or `sysv'. The default "
"is `bsd'"
@@ -6468,181 +6080,183 @@
"Utilice el formato de salida FORMAT. FORMAT puede ser tanto `bsd' como "
"`sysv'. El establecido por defecto es `bsd'"
-#: src/size.c:61
+#: src/size.c:59
msgid "Same as `--format=sysv'"
msgstr "lo mismo que `--format=sysv'"
-#: src/size.c:62
+#: src/size.c:60
msgid "Same as `--format=bsd'"
msgstr "lo mismo que `--format=bsd'"
-#: src/size.c:65
+#: src/size.c:63
msgid "Same as `--radix=10'"
msgstr "lo mismo que `--radix=10'"
-#: src/size.c:66
+#: src/size.c:64
msgid "Same as `--radix=8'"
msgstr "lo mismo que `--radix=8'"
-#: src/size.c:67
+#: src/size.c:65
msgid "Same as `--radix=16'"
msgstr "lo mismo que`--radix=16'"
-#: src/size.c:69
+#: src/size.c:67
msgid "Similar to `--format=sysv' output but in one line"
msgstr "Similar a la salida `--format=sysv' pero en una sola línea"
-#: src/size.c:73
+#: src/size.c:71
msgid "Print size and permission flags for loadable segments"
msgstr ""
"Imprime el tamaño y las marcas de permiso para los segmentos que pueden ser "
"cargados"
-#: src/size.c:74
+#: src/size.c:72
msgid "Display the total sizes (bsd only)"
msgstr "Muestra el tamaño total (bsd solamente)"
-#: src/size.c:79
+#. Short description of program.
+#: src/size.c:77
msgid "List section sizes of FILEs (a.out by default)."
msgstr "Lista los tamaños de sección de FICHEROS (por defecto a.out). "
-#: src/size.c:257
+#: src/size.c:241
#, c-format
msgid "Invalid format: %s"
msgstr "Formato de archivo inválido: %s"
-#: src/size.c:268
+#: src/size.c:252
#, c-format
msgid "Invalid radix: %s"
msgstr "Radical inválido: %s"
-#: src/size.c:327
+#: src/size.c:311
#, c-format
msgid "%s: file format not recognized"
msgstr "%s: No se reconoce el formato del fichero"
-#: src/size.c:433 src/size.c:566
+#: src/size.c:417 src/size.c:550
#, c-format
msgid " (ex %s)"
msgstr " (ex %s)"
-#: src/size.c:591
+#: src/size.c:575
msgid "(TOTALS)\n"
msgstr "(TOTALES)\n"
-#: src/stack.c:488
+#: src/stack.c:483
#, c-format
msgid "-p PID should be a positive process id."
msgstr ""
-#: src/stack.c:494
+#: src/stack.c:489
#, fuzzy, c-format
msgid "Cannot open core file '%s'"
msgstr "Imposible abrir el archivo '%s'"
-#: src/stack.c:554
+#: src/stack.c:549
#, c-format
msgid "-n MAXFRAMES should be 0 or higher."
msgstr ""
-#: src/stack.c:566
+#: src/stack.c:561
#, c-format
msgid "-e EXEC needs a core given by --core."
msgstr ""
-#: src/stack.c:570
+#: src/stack.c:565
#, c-format
msgid "-1 needs a thread id given by -p."
msgstr ""
-#: src/stack.c:574
+#: src/stack.c:569
#, c-format
msgid "One of -p PID or --core COREFILE should be given."
msgstr ""
-#: src/stack.c:644
+#: src/stack.c:641
#, fuzzy
msgid "Show stack of process PID"
msgstr "No se puede crear el árbol de búsqueda"
-#: src/stack.c:646
+#: src/stack.c:643
msgid "Show stack found in COREFILE"
msgstr ""
-#: src/stack.c:647
+#: src/stack.c:644
msgid "(optional) EXECUTABLE that produced COREFILE"
msgstr ""
-#: src/stack.c:651
+#: src/stack.c:648
msgid "Output selection options:"
msgstr "Opciones de selección de salida:"
-#: src/stack.c:653
+#: src/stack.c:650
#, fuzzy
msgid "Additionally show frame activation"
msgstr "Selección de salida adicional:"
-#: src/stack.c:655
+#: src/stack.c:652
msgid "Additionally try to lookup DWARF debuginfo name for frame address"
msgstr ""
-#: src/stack.c:658
+#: src/stack.c:655
msgid ""
"Additionally show inlined function frames using DWARF debuginfo if available "
"(implies -d)"
msgstr ""
-#: src/stack.c:660
+#: src/stack.c:657
msgid "Additionally show module file information"
msgstr ""
-#: src/stack.c:662
+#: src/stack.c:659
#, fuzzy
msgid "Additionally show source file information"
msgstr "Selección de salida adicional:"
-#: src/stack.c:664
+#: src/stack.c:661
msgid ""
"Show all additional information (activation, debugname, inlines, module and "
"source)"
msgstr ""
-#: src/stack.c:666
+#: src/stack.c:663
msgid "Do not resolve address to function symbol name"
msgstr ""
-#: src/stack.c:668
+#: src/stack.c:665
msgid "Show raw function symbol names, do not try to demangle names"
msgstr ""
-#: src/stack.c:670
+#: src/stack.c:667
msgid "Show module build-id, load address and pc offset"
msgstr ""
-#: src/stack.c:672
+#: src/stack.c:669
msgid "Show the backtrace of only one thread"
msgstr ""
-#: src/stack.c:674
+#: src/stack.c:671
msgid "Show at most MAXFRAMES per thread (default 256, use 0 for unlimited)"
msgstr ""
-#: src/stack.c:676
+#: src/stack.c:673
msgid "Show module memory map with build-id, elf and debug files detected"
msgstr ""
-#: src/stack.c:684
+#: src/stack.c:681
msgid ""
-"Print a stack for each thread in a process or core file.\vProgram exits with "
-"return code 0 if all frames were shown without any errors. If some frames "
-"were shown, but there were some non-fatal errors, possibly causing an "
-"incomplete backtrace, the program exits with return code 1. If no frames "
-"could be shown, or a fatal error occured the program exits with return code "
-"2. If the program was invoked with bad or missing arguments it will exit "
-"with return code 64."
+"Print a stack for each thread in a process or core file.\n"
+"\n"
+"Program exits with return code 0 if all frames were shown without any "
+"errors. If some frames were shown, but there were some non-fatal errors, "
+"possibly causing an incomplete backtrace, the program exits with return code "
+"1. If no frames could be shown, or a fatal error occured the program exits "
+"with return code 2. If the program was invoked with bad or missing "
+"arguments it will exit with return code 64."
msgstr ""
-#: src/stack.c:757
+#: src/stack.c:756
#, c-format
msgid "Couldn't show any frames."
msgstr ""
@@ -6679,476 +6293,512 @@
msgid "Alias for --radix=o"
msgstr "Alias para --radix=o"
+#. Short description of program.
#: src/strings.c:84
msgid "Print the strings of printable characters in files."
msgstr "Imprimir las cadenas de caracteres imprimibles en archivos."
-#: src/strings.c:271 src/strings.c:306
+#: src/strings.c:257 src/strings.c:292
#, c-format
msgid "invalid value '%s' for %s parameter"
msgstr "Valor inválido '%s' para parámetro %s"
-#: src/strings.c:317
+#: src/strings.c:303
#, c-format
msgid "invalid minimum length of matched string size"
msgstr "longitud mínima inválida de tamaño de cadena coincidente"
-#: src/strings.c:600
+#: src/strings.c:586
#, fuzzy, c-format
msgid "lseek failed"
msgstr "lseek64 falló"
-#: src/strings.c:617 src/strings.c:681
+#: src/strings.c:603 src/strings.c:667
#, c-format
msgid "re-mmap failed"
msgstr "re-mmap falló"
-#: src/strings.c:654
+#: src/strings.c:640
#, c-format
msgid "mprotect failed"
msgstr "mprotect falló"
-#: src/strings.c:743
+#: src/strings.c:729
#, c-format
msgid "Skipping section %zd '%s' data outside file"
msgstr ""
-#: src/strip.c:68
+#: src/strip.c:71
msgid "Place stripped output into FILE"
msgstr "Colocar la salida obtenida en FICHERO"
-#: src/strip.c:69
+#: src/strip.c:72
msgid "Extract the removed sections into FILE"
msgstr "Extraer secciones eliminadas en FICHERO"
-#: src/strip.c:70
+#: src/strip.c:73
msgid "Embed name FILE instead of -f argument"
msgstr "Incorporar nombre FILE en lugar de argumento -f"
-#: src/strip.c:74
+#: src/strip.c:77
msgid "Remove all debugging symbols"
msgstr "Elimina todos los símbolos de depuración"
-#: src/strip.c:78
+#: src/strip.c:81
msgid "Remove section headers (not recommended)"
msgstr "Quitar sección de cabeceras (no recomendado)"
-#: src/strip.c:80
+#: src/strip.c:83
msgid "Copy modified/access timestamps to the output"
msgstr "Copiar marcas de tiempo modificadas/acceso a la salida"
-#: src/strip.c:82
+#: src/strip.c:85
msgid ""
"Resolve all trivial relocations between debug sections if the removed "
"sections are placed in a debug file (only relevant for ET_REL files, "
"operation is not reversable, needs -f)"
msgstr ""
-#: src/strip.c:84
+#: src/strip.c:87
msgid "Remove .comment section"
msgstr "Quitar sección de comentario"
-#: src/strip.c:87
-msgid "Relax a few rules to handle slightly broken ELF files"
-msgstr "Relaja algunas reglas para manejar ficheros ELF rotos"
+#: src/strip.c:88
+msgid ""
+"Remove the named section. SECTION is an extended wildcard pattern. May be "
+"given more than once. Only non-allocated sections can be removed."
+msgstr ""
-#: src/strip.c:92
+#: src/strip.c:89
+msgid ""
+"Keep the named section. SECTION is an extended wildcard pattern. May be "
+"given more than once."
+msgstr ""
+
+#. Short description of program.
+#: src/strip.c:96
msgid "Discard symbols from object files."
msgstr "Descarta símbolos de archivos objeto."
-#: src/strip.c:186
+#: src/strip.c:242
#, c-format
msgid "--reloc-debug-sections used without -f"
msgstr ""
-#: src/strip.c:200
+#: src/strip.c:256
#, c-format
msgid "Only one input file allowed together with '-o' and '-f'"
msgstr "Sólo se permite ingresar un archivo junto con '-o' y '-f'"
-#: src/strip.c:236
+#: src/strip.c:279
#, c-format
msgid "-f option specified twice"
msgstr "opción -f especificada dos veces"
-#: src/strip.c:245
+#: src/strip.c:288
#, c-format
msgid "-F option specified twice"
msgstr "opción -F especificada dos veces"
-#: src/strip.c:254 src/unstrip.c:120
-#, c-format
-msgid "-o option specified twice"
-msgstr "opción -o especificada dos veces"
+#: src/strip.c:347
+#, fuzzy, c-format
+msgid "cannot both keep and remove .comment section"
+msgstr "Quitar sección de comentario"
-#: src/strip.c:278
-#, c-format
-msgid "-R option supports only .comment section"
-msgstr "la opción -R soporta únicamente. sección de comentario"
-
-#: src/strip.c:320 src/strip.c:344
+#: src/strip.c:372 src/strip.c:396
#, c-format
msgid "cannot stat input file '%s'"
msgstr "no sepuede stat fichero de entrada '%s'"
-#: src/strip.c:334
+#: src/strip.c:386
#, c-format
msgid "while opening '%s'"
msgstr "mientras se abría '%s'"
-#: src/strip.c:372
+#: src/strip.c:424
#, c-format
msgid "%s: cannot use -o or -f when stripping archive"
msgstr "%s: no puede utilizarse -o o -f cuando se extrae un archivo"
-#: src/strip.c:384
+#. We would like to support ar archives, but currently it just
+#. doesn't work at all since we call elf_clone on the members
+#. which doesn't really support ar members.
+#. result = handle_ar (fd, elf, NULL, fname,
+#. preserve_dates ? tv : NULL);
+#.
+#: src/strip.c:436
#, fuzzy, c-format
msgid "%s: no support for stripping archive"
msgstr "%s: no puede utilizarse -o o -f cuando se extrae un archivo"
-#: src/strip.c:483
+#: src/strip.c:535
#, c-format
msgid "cannot open EBL backend"
msgstr "No se puede abrir el segundo plano EBL"
-#: src/strip.c:528
+#: src/strip.c:580
#, fuzzy, c-format
msgid "cannot get number of phdrs"
msgstr "no se pudo determinar la cantidad de encabezados de programa: %s"
-#: src/strip.c:544 src/strip.c:568
+#: src/strip.c:596 src/strip.c:620
#, c-format
msgid "cannot create new file '%s': %s"
msgstr "no se puede crear fichero nuevo '%s': %s"
-#: src/strip.c:634
+#: src/strip.c:686
#, c-format
msgid "illformed file '%s'"
msgstr "Fichero illformed '%s'"
-#: src/strip.c:968 src/strip.c:1067
+#: src/strip.c:696
+#, fuzzy, c-format
+msgid "Cannot remove allocated section '%s'"
+msgstr "No se puede asignar sección PLT: %s"
+
+#: src/strip.c:705
+#, fuzzy, c-format
+msgid "Cannot both keep and remove section '%s'"
+msgstr "No se puede añadir nueva sección: %s"
+
+#: src/strip.c:1061 src/strip.c:1160
#, c-format
msgid "while generating output file: %s"
msgstr "al generar fichero de salida: %s"
-#: src/strip.c:1033 src/strip.c:2071
+#: src/strip.c:1126 src/strip.c:2208
#, c-format
msgid "%s: error while creating ELF header: %s"
msgstr "%s: error al crear encabezamiento ELF: %s"
-#: src/strip.c:1050
+#: src/strip.c:1143
#, c-format
msgid "while preparing output for '%s'"
msgstr "al preparar salida para '%s'"
-#: src/strip.c:1108 src/strip.c:1171
+#: src/strip.c:1205 src/strip.c:1268
#, c-format
msgid "while create section header section: %s"
msgstr "al crear sección de encabezamiento de sección: %s"
-#: src/strip.c:1117
+#: src/strip.c:1214
#, c-format
msgid "cannot allocate section data: %s"
msgstr "no se puede asignar espacio para los datos: %s"
-#: src/strip.c:1183
+#: src/strip.c:1280
#, c-format
msgid "while create section header string table: %s"
msgstr "al crear tabla de cadenas de encabezamiento de sección: %s"
-#: src/strip.c:1861
+#: src/strip.c:1287
+#, fuzzy, c-format
+msgid "no memory to create section header string table"
+msgstr "al crear tabla de cadenas de encabezamiento de sección: %s"
+
+#: src/strip.c:1497
+#, c-format
+msgid "Cannot remove symbol [%zd] from allocated symbol table [%zd]"
+msgstr ""
+
+#: src/strip.c:1994
#, fuzzy, c-format
msgid "bad relocation"
msgstr "Mostrar reubicaciones"
-#: src/strip.c:1982 src/strip.c:2095
+#: src/strip.c:2119 src/strip.c:2232
#, c-format
msgid "while writing '%s': %s"
msgstr "al escribir '%s': %s"
-#: src/strip.c:1993
+#: src/strip.c:2130
#, c-format
msgid "while creating '%s'"
msgstr "al crear '%s'"
-#: src/strip.c:2016
+#: src/strip.c:2153
#, c-format
msgid "while computing checksum for debug information"
msgstr "al computar la suma de verificación para información de depuración"
-#: src/strip.c:2080
+#: src/strip.c:2217
#, c-format
msgid "%s: error while reading the file: %s"
msgstr "%s: error al leer el fichero: %s"
-#: src/strip.c:2120 src/strip.c:2140
+#: src/strip.c:2257 src/strip.c:2277
#, c-format
msgid "while writing '%s'"
msgstr "al escribir '%s'"
-#: src/strip.c:2177 src/strip.c:2184
+#: src/strip.c:2314 src/strip.c:2321
#, c-format
msgid "error while finishing '%s': %s"
msgstr "Error al terminar '%s': %s"
-#: src/strip.c:2201 src/strip.c:2273
+#: src/strip.c:2338 src/strip.c:2414
#, c-format
msgid "cannot set access and modification date of '%s'"
msgstr "no es posible establecer acceso y fecha de modificación de '%s'"
-#: src/unstrip.c:69
+#: src/unstrip.c:70
msgid "Match MODULE against file names, not module names"
msgstr "Coincidir MODULO con nombres de archivo, no con nombres de módulo"
-#: src/unstrip.c:70
+#: src/unstrip.c:71
msgid "Silently skip unfindable files"
msgstr "Omitir silenciosamente los archivos perdidos"
-#: src/unstrip.c:73
+#: src/unstrip.c:74
msgid "Place output into FILE"
msgstr "Colocar salida en FICHERO"
-#: src/unstrip.c:75
+#: src/unstrip.c:76
msgid "Create multiple output files under DIRECTORY"
msgstr "Crear archivos de salida múltiple bajo DIRECTORIO"
-#: src/unstrip.c:76
+#: src/unstrip.c:77
msgid "Use module rather than file names"
msgstr "Usar módulo en lugar de nombres de archivo"
-#: src/unstrip.c:78
+#: src/unstrip.c:79
msgid "Create output for modules that have no separate debug information"
msgstr ""
"Crear salida para módulos que no tienen información de depuración "
"independiente"
-#: src/unstrip.c:81
+#: src/unstrip.c:82
msgid "Apply relocations to section contents in ET_REL files"
msgstr "Aplicar reubicaciones a contenido de sección en archivos ET_REL"
-#: src/unstrip.c:83
+#: src/unstrip.c:84
msgid "Only list module and file names, build IDs"
msgstr "Solamente listar módulo y nombres de archivo, crear los ID"
-#: src/unstrip.c:85
+#: src/unstrip.c:86
msgid "Force combining files even if some ELF headers don't seem to match"
msgstr ""
-#: src/unstrip.c:129
+#: src/unstrip.c:130
#, c-format
msgid "-d option specified twice"
msgstr "opción -d especificada dos veces"
-#: src/unstrip.c:164
+#: src/unstrip.c:165
#, c-format
msgid "only one of -o or -d allowed"
msgstr "Sólo se permite usar -o ó -d "
-#: src/unstrip.c:173
+#: src/unstrip.c:174
#, c-format
msgid "-n cannot be used with explicit files or -o or -d"
msgstr "-n no puede utilizarse con archivos explícitos o con -o ó -d"
-#: src/unstrip.c:188
+#: src/unstrip.c:189
#, c-format
msgid "output directory '%s'"
msgstr "Directorio de salida '%s'"
-#: src/unstrip.c:197
+#: src/unstrip.c:198
#, c-format
msgid "exactly two file arguments are required"
msgstr "dos argumentos de archivos se requieren exactamente"
-#: src/unstrip.c:203
+#: src/unstrip.c:204
#, c-format
msgid "-m, -a, -R, and -i options not allowed with explicit files"
msgstr "No se permiten las opciones -m, -a, -R, ni -i con archivos explícitos"
-#: src/unstrip.c:216
+#: src/unstrip.c:217
#, c-format
msgid "-o or -d is required when using implicit files"
msgstr "se requiere -o ó -d cuando se utilizan archivos implícitos"
-#: src/unstrip.c:252
+#: src/unstrip.c:240
#, c-format
msgid "cannot create ELF header: %s"
msgstr "no se puede crear el encabezamiento ELF: %s"
-#: src/unstrip.c:257
+#: src/unstrip.c:245
#, c-format
msgid "cannot copy ELF header: %s"
msgstr "no se puede copiar encabezamiento ELF: %s"
-#: src/unstrip.c:261 src/unstrip.c:1939 src/unstrip.c:1982
+#: src/unstrip.c:249 src/unstrip.c:1933 src/unstrip.c:1976
#, fuzzy, c-format
msgid "cannot get number of program headers: %s"
msgstr "no se pudo determinar la cantidad de encabezados de programa: %s"
-#: src/unstrip.c:266 src/unstrip.c:1943
+#: src/unstrip.c:254 src/unstrip.c:1937
#, c-format
msgid "cannot create program headers: %s"
msgstr "No pueden crear encabezamientos de programa: %s"
-#: src/unstrip.c:272
+#: src/unstrip.c:260
#, c-format
msgid "cannot copy program header: %s"
msgstr "no puede copiar encabezamiento de programa: %s"
-#: src/unstrip.c:282
+#: src/unstrip.c:270
#, c-format
msgid "cannot copy section header: %s"
msgstr "no se puede copiar encabezamiento de sección: %s"
-#: src/unstrip.c:285 src/unstrip.c:1576
+#: src/unstrip.c:273 src/unstrip.c:1568
#, c-format
msgid "cannot get section data: %s"
msgstr "no se pueden obtener datos de sección: %s"
-#: src/unstrip.c:287 src/unstrip.c:1578
+#: src/unstrip.c:275 src/unstrip.c:1570
#, c-format
msgid "cannot copy section data: %s"
msgstr "no pueden copiar datos de sección: %s"
-#: src/unstrip.c:311
+#: src/unstrip.c:299
#, c-format
msgid "cannot create directory '%s'"
msgstr "no se puede crear el directorio '%s'"
-#: src/unstrip.c:383 src/unstrip.c:803 src/unstrip.c:1610
+#: src/unstrip.c:371 src/unstrip.c:791 src/unstrip.c:1602
#, c-format
msgid "cannot get symbol table entry: %s"
msgstr "no se puede obtener entrada de tabla de símbolos: %s"
-#: src/unstrip.c:399 src/unstrip.c:620 src/unstrip.c:641 src/unstrip.c:653
-#: src/unstrip.c:1631 src/unstrip.c:1805 src/unstrip.c:1829
+#: src/unstrip.c:387 src/unstrip.c:608 src/unstrip.c:629 src/unstrip.c:641
+#: src/unstrip.c:1623 src/unstrip.c:1799 src/unstrip.c:1823
#, c-format
msgid "cannot update symbol table: %s"
msgstr "no se puede actualizar tabla de símbolos: %s"
-#: src/unstrip.c:409
+#: src/unstrip.c:397
#, c-format
msgid "cannot update section header: %s"
msgstr "no se puede actualizar encabezamiento de sección: %s"
-#: src/unstrip.c:448 src/unstrip.c:459
+#: src/unstrip.c:436 src/unstrip.c:447
#, c-format
msgid "cannot update relocation: %s"
msgstr "no se puede actualizar reubicación: %s"
-#: src/unstrip.c:547
+#: src/unstrip.c:535
#, c-format
msgid "cannot get symbol version: %s"
msgstr "no se puede obtener versión de símbolo: %s"
-#: src/unstrip.c:560
+#: src/unstrip.c:548
#, fuzzy, c-format
msgid "unexpected section type in [%zu] with sh_link to symtab"
msgstr "tipo de sección inesperado en [%Zu] con sh_link para symtab"
-#: src/unstrip.c:809
+#: src/unstrip.c:797
#, fuzzy, c-format
msgid "invalid string offset in symbol [%zu]"
msgstr "compensación de cadena inválida en símbolo [%Zu]"
-#: src/unstrip.c:967 src/unstrip.c:1313
+#: src/unstrip.c:955 src/unstrip.c:1305
#, fuzzy, c-format
msgid "cannot read section [%zu] name: %s"
msgstr "no se puede leer nombre [%Zu]: %s"
-#: src/unstrip.c:1008 src/unstrip.c:1027 src/unstrip.c:1062
+#: src/unstrip.c:996 src/unstrip.c:1015 src/unstrip.c:1053
#, c-format
msgid "cannot read '.gnu.prelink_undo' section: %s"
msgstr "no se puede leer sección '.gnu.prelink_undo': %s"
-#: src/unstrip.c:1048
-#, c-format
-msgid "invalid contents in '%s' section"
-msgstr "contenido inválido en sección '%s'"
-
-#: src/unstrip.c:1054
+#: src/unstrip.c:1033
#, c-format
msgid "overflow with shnum = %zu in '%s' section"
msgstr ""
-#: src/unstrip.c:1108 src/unstrip.c:1433
+#: src/unstrip.c:1044
+#, c-format
+msgid "invalid contents in '%s' section"
+msgstr "contenido inválido en sección '%s'"
+
+#: src/unstrip.c:1099 src/unstrip.c:1427
#, fuzzy, c-format
msgid "cannot find matching section for [%zu] '%s'"
msgstr "no se puede hallar sección coincidente para [%Zu] '%s'"
-#: src/unstrip.c:1233 src/unstrip.c:1248 src/unstrip.c:1514 src/unstrip.c:1766
+#: src/unstrip.c:1224 src/unstrip.c:1239 src/unstrip.c:1506 src/unstrip.c:1758
#, c-format
msgid "cannot add section name to string table: %s"
msgstr "no se puede añadir nombre de sección a tabla de cadenas: %s"
-#: src/unstrip.c:1257
+#: src/unstrip.c:1248
#, c-format
msgid "cannot update section header string table data: %s"
msgstr ""
"no se pueden actualizar datos de tabla de cadenas de encabezamiento de "
"sección: %s"
-#: src/unstrip.c:1284 src/unstrip.c:1288
+#: src/unstrip.c:1276 src/unstrip.c:1280
#, c-format
msgid "cannot get section header string table section index: %s"
msgstr ""
"no se puede obtener índice de sección de tabla de cadenas de encabezamiento "
"de sección: %s"
-#: src/unstrip.c:1292 src/unstrip.c:1296 src/unstrip.c:1529
+#: src/unstrip.c:1284 src/unstrip.c:1288 src/unstrip.c:1521
#, c-format
msgid "cannot get section count: %s"
msgstr "No se puede obtener cuenta de sección: %s"
-#: src/unstrip.c:1299
+#: src/unstrip.c:1291
#, c-format
msgid "more sections in stripped file than debug file -- arguments reversed?"
msgstr ""
"más secciones en el archivo despojado que en el archivo de depuración -- "
"¿argumentos invertidos?"
-#: src/unstrip.c:1358 src/unstrip.c:1448
+#: src/unstrip.c:1350 src/unstrip.c:1442
#, c-format
msgid "cannot read section header string table: %s"
msgstr "no se puede obtener tabla de cadenas de encabezamiento de sección: %s"
-#: src/unstrip.c:1508
+#: src/unstrip.c:1500
#, c-format
msgid "cannot add new section: %s"
msgstr "No se puede añadir nueva sección: %s"
-#: src/unstrip.c:1618
+#: src/unstrip.c:1610
#, fuzzy, c-format
msgid "symbol [%zu] has invalid section index"
msgstr "símbolo [%Zu] tiene índice de sección inválido"
-#: src/unstrip.c:1900
+#: src/unstrip.c:1894
#, c-format
msgid "cannot read section data: %s"
msgstr "no se puede leer la sección de datos: %s"
-#: src/unstrip.c:1921
+#: src/unstrip.c:1915
#, c-format
msgid "cannot get ELF header: %s"
msgstr "no se puede leer encabezamiento ELF: %s"
-#: src/unstrip.c:1953
+#: src/unstrip.c:1923
+#, c-format
+msgid "cannot update ELF header: %s"
+msgstr "No se puede actualizar encabezamiento ELF: %s"
+
+#: src/unstrip.c:1947
#, c-format
msgid "cannot update program header: %s"
msgstr "no se puede actualizar encabezamiento de programa: %s"
-#: src/unstrip.c:1958 src/unstrip.c:2040
+#: src/unstrip.c:1952 src/unstrip.c:2034
#, c-format
msgid "cannot write output file: %s"
msgstr "no se puede escribir al archivo de salida: %s"
-#: src/unstrip.c:2009
+#: src/unstrip.c:2003
#, c-format
msgid "DWARF data not adjusted for prelinking bias; consider prelink -u"
msgstr ""
"datos DWARF no se ajustan para polarización de pre-enlace; considere prelink "
"-u"
-#: src/unstrip.c:2012
+#: src/unstrip.c:2006
#, c-format
msgid ""
"DWARF data in '%s' not adjusted for prelinking bias; consider prelink -u"
@@ -7156,77 +6806,77 @@
"Datos DWARF en '%s' no se ajustan a polarización de pre-enlace; considere "
"prelink -u"
-#: src/unstrip.c:2031 src/unstrip.c:2082 src/unstrip.c:2094 src/unstrip.c:2180
+#: src/unstrip.c:2025 src/unstrip.c:2076 src/unstrip.c:2088 src/unstrip.c:2174
#, c-format
msgid "cannot create ELF descriptor: %s"
msgstr "no se puede crear un descriptor ELF: %s"
-#: src/unstrip.c:2073
+#: src/unstrip.c:2067
msgid "WARNING: "
msgstr ""
-#: src/unstrip.c:2075
+#: src/unstrip.c:2069
msgid ", use --force"
msgstr ""
-#: src/unstrip.c:2098
+#: src/unstrip.c:2092
msgid "ELF header identification (e_ident) different"
msgstr ""
-#: src/unstrip.c:2101
+#: src/unstrip.c:2095
msgid "ELF header type (e_type) different"
msgstr ""
-#: src/unstrip.c:2104
+#: src/unstrip.c:2098
msgid "ELF header machine type (e_machine) different"
msgstr ""
-#: src/unstrip.c:2107
+#: src/unstrip.c:2101
msgid "stripped program header (e_phnum) smaller than unstripped"
msgstr ""
-#: src/unstrip.c:2137
+#: src/unstrip.c:2131
#, c-format
msgid "cannot find stripped file for module '%s': %s"
msgstr "no se puede hallar archivo obtenido para módulo '%s': %s "
-#: src/unstrip.c:2141
+#: src/unstrip.c:2135
#, c-format
msgid "cannot open stripped file '%s' for module '%s': %s"
msgstr "No se puede abrir el archivo '%s' obtenido para módulo '%s': %s"
-#: src/unstrip.c:2156
+#: src/unstrip.c:2150
#, c-format
msgid "cannot find debug file for module '%s': %s"
msgstr "no puede hallar archivo de depuración para módulo '%s': %su"
-#: src/unstrip.c:2160
+#: src/unstrip.c:2154
#, c-format
msgid "cannot open debug file '%s' for module '%s': %s"
msgstr "No puede abrir archivo de depuración '%s' para módulo '%s': %s"
-#: src/unstrip.c:2173
+#: src/unstrip.c:2167
#, c-format
msgid "module '%s' file '%s' is not stripped"
msgstr "No se obtuvo el archivo '%s' de módulo '%s' "
-#: src/unstrip.c:2204
+#: src/unstrip.c:2198
#, c-format
msgid "cannot cache section addresses for module '%s': %s"
msgstr ""
"No puede almacenar en cache direcciones de sección para módulo '%s': %s"
-#: src/unstrip.c:2337
+#: src/unstrip.c:2331
#, c-format
msgid "no matching modules found"
msgstr "No se encontraron módulos coincidentes"
-#: src/unstrip.c:2346
+#: src/unstrip.c:2340
#, c-format
msgid "matched more than one module"
msgstr "coincidió con más de un módulo"
-#: src/unstrip.c:2390
+#: src/unstrip.c:2384
msgid ""
"STRIPPED-FILE DEBUG-FILE\n"
"[MODULE...]"
@@ -7234,10 +6884,12 @@
"STRIPPED-FILE DEBUG-FILE\n"
"[MODULE...]"
-#: src/unstrip.c:2391
+#: src/unstrip.c:2385
+#, fuzzy
msgid ""
-"Combine stripped files with separate symbols and debug information.\vThe "
-"first form puts the result in DEBUG-FILE if -o was not given.\n"
+"Combine stripped files with separate symbols and debug information.\n"
+"\n"
+"The first form puts the result in DEBUG-FILE if -o was not given.\n"
"\n"
"MODULE arguments give file name patterns matching modules to process.\n"
"With -f these match the file name of the main (stripped) file (slashes are "
@@ -7260,8 +6912,9 @@
"file. DEBUGFILE is the separate debuginfo file name, or - if no debuginfo "
"was found, or . if FILE contains the debug information."
msgstr ""
-"Combine stripped files with separate symbols and debug information.\vThe "
-"first form puts the result in DEBUG-FILE if -o was not given.\n"
+"Combine stripped files with separate symbols and debug information.\n"
+"\n"
+"The first form puts the result in DEBUG-FILE if -o was not given.\n"
"\n"
"MODULE arguments give file name patterns matching modules to process.\n"
"With -f these match the file name of the main (stripped) file (slashes are "
@@ -7284,7 +6937,7 @@
"file. DEBUGFILE is the separate debuginfo file name, or - if no debuginfo "
"was found, or . if FILE contains the debug information."
-#: tests/backtrace.c:427
+#: tests/backtrace.c:442
msgid "Run executable"
msgstr ""
@@ -7297,6 +6950,576 @@
msgid "Show instances of inlined functions"
msgstr ""
+#~ msgid "%s+%#<PRIx64> <%s+%#<PRIx64>>"
+#~ msgstr "%s+%#<PRIx64> <%s+%#<PRIx64>>"
+
+#~ msgid "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
+#~ msgstr "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
+
+#~ msgid "%#<PRIx64> <%s+%#<PRIx64>>"
+#~ msgstr "%#<PRIx64> <%s+%#<PRIx64>>"
+
+#~ msgid "%#0*<PRIx64> <%s+%#<PRIx64>>"
+#~ msgstr "%#0*<PRIx64> <%s+%#<PRIx64>>"
+
+#~ msgid "%s+%#<PRIx64> <%s>"
+#~ msgstr "%s+%#<PRIx64> <%s>"
+
+#~ msgid "%s+%#0*<PRIx64> <%s>"
+#~ msgstr "%s+%#0*<PRIx64> <%s>"
+
+#~ msgid "%#<PRIx64> <%s>"
+#~ msgstr "%#<PRIx64> <%s>"
+
+#~ msgid "%#0*<PRIx64> <%s>"
+#~ msgstr "%#0*<PRIx64> <%s>"
+
+#~ msgid "%s+%#<PRIx64>"
+#~ msgstr "%s+%#<PRIx64>"
+
+#~ msgid "%s+%#0*<PRIx64>"
+#~ msgstr "%s+%#0*<PRIx64>"
+
+#, fuzzy
+#~ msgid " %s..%s (%<PRIx64>)\n"
+#~ msgstr " %s: %<PRId64>\n"
+
+#, fuzzy
+#~ msgid " %s..%s\n"
+#~ msgstr " [%6tx] %s..%s\n"
+
+#, fuzzy
+#~ msgid " advance address by %u to %s, op_index to %u\n"
+#~ msgstr "dirección avanzada por %u a %s, op_index a %u\n"
+
+#, fuzzy
+#~ msgid " advance address by constant %u to %s, op_index to %u\n"
+#~ msgstr "dirección avanzada por constante %u a %s, op_index a %u\n"
+
+#~ msgid " [%6tx] %s..%s\n"
+#~ msgstr " [%6tx] %s..%s\n"
+
+#~ msgid " %s..%s\n"
+#~ msgstr " %s..%s\n"
+
+#~ msgid "cannot get DIE at offset %<PRIu64> in section '%s': %s"
+#~ msgstr ""
+#~ "no se puede obtener DIE en compensación %<PRIu64> en sección '%s': %s"
+
+#~ msgid " [%6tx] %s..%s"
+#~ msgstr " [%6tx] %s..%s"
+
+#~ msgid " %s..%s"
+#~ msgstr " %s..%s"
+
+#~ msgid "-R option supports only .comment section"
+#~ msgstr "la opción -R soporta únicamente. sección de comentario"
+
+#~ msgid "Written by %s.\n"
+#~ msgstr "Escrito por %s.\n"
+
+#~ msgid "cannot allocate PLTREL section: %s"
+#~ msgstr "No se puede asignar sección PLTREL: %s"
+
+#~ msgid "cannot allocate GOT section: %s"
+#~ msgstr "No se puede asignar sección GOT: %s"
+
+#~ msgid "cannot allocate GOTPLT section: %s"
+#~ msgstr "No se puede asignar sección GOTPLT: %s"
+
+#~ msgid "initial-executable TLS relocation cannot be used "
+#~ msgstr "Reubicación TLS ejecutable-inicial no se puede utilizar"
+
+#~ msgid "Input File Control:"
+#~ msgstr "Control de fichero de entrada:"
+
+#~ msgid "Include whole archives in the output from now on."
+#~ msgstr "A partir de ahora incluye archivos completos en la salida."
+
+#~ msgid "Stop including the whole archives in the output."
+#~ msgstr "Deja de incluir archivos completos en la salida."
+
+#~ msgid "FILE"
+#~ msgstr "FICHERO"
+
+#~ msgid "Start a group."
+#~ msgstr "Inicia un grupo"
+
+#~ msgid "End a group."
+#~ msgstr "Termina un grupo."
+
+#~ msgid "PATH"
+#~ msgstr "RUTA"
+
+#~ msgid "Add PATH to list of directories files are searched in."
+#~ msgstr ""
+#~ "Agrega RUTA a la lista de los directorios en los que se realiza la "
+#~ "búsqueda."
+
+#~ msgid "Only set DT_NEEDED for following dynamic libs if actually used"
+#~ msgstr ""
+#~ "Sólo se define DT_NEEDED para las siguientes bibliotecas dinámicas, si "
+#~ "están siendo utilizadas"
+
+#~ msgid "Always set DT_NEEDED for following dynamic libs"
+#~ msgstr ""
+#~ "Siempre establece DT_NEEDED para las siguientes bibliotecas dinámicas"
+
+#~ msgid "Ignore LD_LIBRARY_PATH environment variable."
+#~ msgstr "Ignora la variable de entorno LD_LIBRARY_PATH."
+
+#~ msgid "Output File Control:"
+#~ msgstr "Control de fichero de salida:"
+
+#~ msgid "Place output in FILE."
+#~ msgstr "Coloca salida en FICHERO."
+
+#~ msgid "Object is marked to not use default search path at runtime."
+#~ msgstr ""
+#~ "Objeto está marcado para no usar ruta de búsqueda predeterminada en "
+#~ "tiempo de ejecución."
+
+#~ msgid "Same as --whole-archive."
+#~ msgstr "Lo mismo que --whole-archive."
+
+#~ msgid ""
+#~ "Default rules of extracting from archive; weak references are not enough."
+#~ msgstr ""
+#~ "Reglas establecidas por defecto para extraer desde el archivo; las "
+#~ "referencias débiles no son suficientes."
+
+#~ msgid "Weak references cause extraction from archive."
+#~ msgstr "Referencias débiles causan extracción del archivo."
+
+#~ msgid "Allow multiple definitions; first is used."
+#~ msgstr "Permite definiciones múltiples; se utiliza la primera."
+
+#~ msgid "Disallow/allow undefined symbols in DSOs."
+#~ msgstr "Habilita/inhabilita símbolos indefinidos en los DSO."
+
+#~ msgid "Object requires immediate handling of $ORIGIN."
+#~ msgstr "Los objetos requieren manipulación inmediata de $ORIGIN."
+
+#~ msgid "Relocation will not be processed lazily."
+#~ msgstr "La reubicación no se procesará de forma perezosa."
+
+#~ msgid "Object cannot be unloaded at runtime."
+#~ msgstr "El objeto no se puede descargar en tiempo de ejecución."
+
+#~ msgid "Mark object to be initialized first."
+#~ msgstr "Marcar objeto a ser inicializado primero."
+
+#~ msgid "Enable/disable lazy-loading flag for following dependencies."
+#~ msgstr ""
+#~ "Activar/desactivar marca lazy-loading para las siguientes dependencias."
+
+#~ msgid "Mark object as not loadable with 'dlopen'."
+#~ msgstr "Marcar el objeto como no cargable con 'dlopen'"
+
+#~ msgid "Ignore/record dependencies on unused DSOs."
+#~ msgstr "Ignorar/registrar dependencias sobre DSO no utilizados."
+
+#~ msgid "Generated DSO will be a system library."
+#~ msgstr "El DSO generado será una biblioteca del sistema."
+
+#~ msgid "ADDRESS"
+#~ msgstr "DIRECCIÓN"
+
+#~ msgid "Set entry point address."
+#~ msgstr "Establecer dirección de entrada de punto"
+
+#~ msgid "Do not link against shared libraries."
+#~ msgstr "No enlazar con bibliotecas compartidas."
+
+#~ msgid "Prefer linking against shared libraries."
+#~ msgstr "No enlazar con bibliotecas compartidas."
+
+#~ msgid "Export all dynamic symbols."
+#~ msgstr "Exportar todos los símbolos dinámicos."
+
+#~ msgid "Strip all symbols."
+#~ msgstr "Descartar todos los símbolos."
+
+#~ msgid "Strip debugging symbols."
+#~ msgstr "Descartar los símbolos de depuración."
+
+#~ msgid "Assume pagesize for the target system to be SIZE."
+#~ msgstr "Asumir que pagesize para el sistema de destino sea SIZE."
+
+#~ msgid "Set runtime DSO search path."
+#~ msgstr "Establecer la ruta de búsqueda tiempo de ejecución DSO."
+
+#~ msgid "Set link time DSO search path."
+#~ msgstr "Establecer ruta de tiempo de enlace DSO."
+
+#~ msgid "Generate dynamic shared object."
+#~ msgstr "Generar objeto compartido dinámico."
+
+#~ msgid "Generate relocatable object."
+#~ msgstr "Generar objeto reubicable"
+
+#~ msgid "Causes symbol not assigned to a version be reduced to local."
+#~ msgstr ""
+#~ "Hacer que un símbolo no asignado a una versión sea reducido a local."
+
+#~ msgid "Remove unused sections."
+#~ msgstr "Eliminar las secciones no utilizadas."
+
+#~ msgid "Don't remove unused sections."
+#~ msgstr "No eliminar las secciones no utilizadas."
+
+#~ msgid "Set soname of shared object."
+#~ msgstr "Establecer soname de objeto compartido."
+
+#~ msgid "Set the dynamic linker name."
+#~ msgstr "Establecer el nombre de enlazador dinámico."
+
+#~ msgid "Add/suppress addition indentifying link-editor to .comment section."
+#~ msgstr ""
+#~ "Añadir/suprimir adición identificando enlace-editor para .sección de "
+#~ "comentario."
+
+#~ msgid "Create .eh_frame_hdr section"
+#~ msgstr "Crear una sección .eh_frame_hdr"
+
+#~ msgid "Set hash style to sysv, gnu or both."
+#~ msgstr "Establecer el estilo de dispersión un sysv, gnu o ambos."
+
+#~ msgid "Generate build ID note (md5, sha1 (default), uuid)."
+#~ msgstr ""
+#~ "Crear una nota del ID de compilación (md5, sha1 (por defecto), uuid)."
+
+#~ msgid "Linker Operation Control:"
+#~ msgstr "Control de volumen desconocido:"
+
+#~ msgid "Verbose messages."
+#~ msgstr "Mensajes explicativos."
+
+#~ msgid "Trace file opens."
+#~ msgstr "Rastrear apertura de ficheros."
+
+#~ msgid "Trade speed for less memory usage"
+#~ msgstr "Intercambiar velocidad por menor utilización de memoria"
+
+#~ msgid "LEVEL"
+#~ msgstr "NIVEL"
+
+#~ msgid "Set optimization level to LEVEL."
+#~ msgstr "Establecer el nivel de optimización a LEVEL."
+
+#~ msgid "Use linker script in FILE."
+#~ msgstr "Usar script enlazador en FICHERO."
+
+#~ msgid "Select to get parser debug information"
+#~ msgstr "Seleccionar para obtener análisis de información de depuración"
+
+#~ msgid "Read version information from FILE."
+#~ msgstr "Leer información de versión de FICHERO."
+
+#~ msgid "Set emulation to NAME."
+#~ msgstr "Establecer emulación a NOMBRE."
+
+#~ msgid "Combine object and archive files."
+#~ msgstr "Combinar objeto y archivos de almacenamiento."
+
+#~ msgid "[FILE]..."
+#~ msgstr "[FICHERO]..."
+
+#~ msgid "At least one input file needed"
+#~ msgstr "Se necesita al menos un fichero de entrada"
+
+#~ msgid "error while preparing linking"
+#~ msgstr "Error al preparar vinculación"
+
+#~ msgid "cannot open linker script '%s'"
+#~ msgstr "no se puede abrir script enlazador '%s'"
+
+#~ msgid "-( without matching -)"
+#~ msgstr "-( sin coincidir -)"
+
+#~ msgid "only one option of -G and -r is allowed"
+#~ msgstr "Solamente una opción de -G y -r es permitida"
+
+#~ msgid "more than one '-m' parameter"
+#~ msgstr "más de un parámetro '-m'"
+
+#~ msgid "unknown option `-%c %s'"
+#~ msgstr "opción desconocida `-%c %s'"
+
+#~ msgid "invalid page size value '%s': ignored"
+#~ msgstr "Valor de tamaño de página'%s': ignorado"
+
+#~ msgid "invalid hash style '%s'"
+#~ msgstr "estilo de dispersión inválido '%s'"
+
+#~ msgid "invalid build-ID style '%s'"
+#~ msgstr "estilo de cuerpo-ID inválido '%s'"
+
+#~ msgid "More than one output file name given."
+#~ msgstr "Se ha dado más de un nombre de archivo de salida."
+
+#~ msgid "Invalid optimization level `%s'"
+#~ msgstr "Nivel de optimización inválido `%s'"
+
+#~ msgid "nested -( -) groups are not allowed"
+#~ msgstr "no se permiten grupos -( -) en nido"
+
+#~ msgid "-) without matching -("
+#~ msgstr "-) sin coincidir -("
+
+#~ msgid "unknown option '-%c %s'"
+#~ msgstr "Opción desconocida '-%c %s'"
+
+#~ msgid "could not find input file to determine output file format"
+#~ msgstr ""
+#~ "no se pudo encontrar un archivo de entrada que determine el formato del "
+#~ "archivo de salida"
+
+#~ msgid "try again with an appropriate '-m' parameter"
+#~ msgstr "Inténtelo con una parámetro '-m' apropiado"
+
+#~ msgid "cannot read version script '%s'"
+#~ msgstr "No se puede leer script de versión '%s'"
+
+#~ msgid "duplicate definition of '%s' in linker script"
+#~ msgstr "Duplicar definición de '%s' en script enlazador"
+
+#~ msgid "cannot create string table"
+#~ msgstr "no puede crear tabla de cadenas"
+
+#~ msgid "cannot load ld backend library '%s': %s"
+#~ msgstr "no se puede cargar biblioteca ID de segundo plano '%s': %s"
+
+#~ msgid "cannot find init function in ld backend library '%s': %s"
+#~ msgstr ""
+#~ "no se pudo encontrar la función init en la biblioteca ld de segundo plano "
+#~ "'%s': %s"
+
+#~ msgid "%s listed more than once as input"
+#~ msgstr "%s listado más de una vez como entrada"
+
+#~ msgid "%s (for -l%s)\n"
+#~ msgstr "%s (para -l%s)\n"
+
+#~ msgid "%s (for DT_NEEDED %s)\n"
+#~ msgstr "%s (para DT_NEEDED %s)\n"
+
+#~ msgid "Warning: type of `%s' changed from %s in %s to %s in %s"
+#~ msgstr "Advertencia: el tipo de `%s' cambió de %s en %s a %s en %s"
+
+#~ msgid ""
+#~ "Warning: size of `%s' changed from %<PRIu64> in %s to %<PRIu64> in %s"
+#~ msgstr ""
+#~ "Advertencia: el tamaño de `%s' cambió de %<PRIu64> en %s a %<PRIu64> en %s"
+
+#~ msgid "(%s+%#<PRIx64>): multiple definition of %s `%s'\n"
+#~ msgstr "(%s+%#<PRIx64>): definición múltiplo de %s `%s'\n"
+
+#~ msgid "(%s+%#<PRIx64>): first defined here\n"
+#~ msgstr "(%s+%#<PRIx64>): se definió primero aquí\n"
+
+#~ msgid "%s: cannot get section group data: %s"
+#~ msgstr "%s: no se pueden obtener datos de sección de grupo: %s"
+
+#~ msgid "%s: section '%s' with group flag set does not belong to any group"
+#~ msgstr ""
+#~ "%s: la sección '%s' con bandera de grupo establecida no pertenece a "
+#~ "ningún grupo"
+
+#~ msgid "%s: section [%2d] '%s' is not in the correct section group"
+#~ msgstr ""
+#~ "%s: la sección [%2d] '%s' no se encuentra en el grupo de sección correcto"
+
+#~ msgid "%s: invalid ELF file (%s:%d)\n"
+#~ msgstr "%s: fichero ELF inválido (%s:%d)\n"
+
+#~ msgid "%s: only files of type ET_REL might contain section groups"
+#~ msgstr "%s: solo archivos de tipo ET_REL pueden contener grupos de sección"
+
+#~ msgid "%s: cannot determine signature of section group [%2zd] '%s': %s"
+#~ msgstr ""
+#~ "%s: no es posible determinar la firma del grupo de sección [%2zd] '%s': "
+#~ "%s "
+
+#~ msgid "%s: cannot get content of section group [%2zd] '%s': %s'"
+#~ msgstr ""
+#~ "%s: no es posible obtener el contenido de la sección del grupo [%2zd] "
+#~ "'%s': %s'"
+
+#~ msgid ""
+#~ "%s: group member %zu of section group [%2zd] '%s' has too high index: "
+#~ "%<PRIu32>"
+#~ msgstr ""
+#~ "%s el miembro del grupo %zu del grupo de sección [%2zd] '%s' posee el "
+#~ "índice demasiado alto: %<PRIu32>"
+
+#~ msgid "%s: section '%s' has unknown type: %d"
+#~ msgstr "%s: sección '%s' tiene tipo desconocido: %d"
+
+#~ msgid "cannot get descriptor for ELF file (%s:%d): %s\n"
+#~ msgstr "no es posible obtener descriptor para el archivo ELF (%s:%d): %s\n"
+
+#~ msgid "cannot read archive `%s': %s"
+#~ msgstr "no se puede leer archivo `%s': %s"
+
+#~ msgid "file of type %s cannot be linked in\n"
+#~ msgstr "archivo de tipo %s no puede ser enlazado en\n"
+
+#~ msgid "%s: input file incompatible with ELF machine type %s\n"
+#~ msgstr ""
+#~ "%s: el archivo ingresado es incompatible con una máquina ELF tipo %s\n"
+
+#~ msgid "%s: cannot get section header string table index: %s\n"
+#~ msgstr ""
+#~ "%s: no se ha podido obtener un índice para la tabla de la cadena del "
+#~ "encabezamiento de la sección: %s\n"
+
+#~ msgid "cannot use DSO '%s' when generating relocatable object file"
+#~ msgstr ""
+#~ "no es posible utilizar DSO '%s' al general un archivo de objeto realojable"
+
+#~ msgid "input file '%s' ignored"
+#~ msgstr "archivo de entrada '%s' ignorado"
+
+#~ msgid "undefined symbol `%s' in %s"
+#~ msgstr "símbolo indefinido `%s' en %s"
+
+#~ msgid "cannot create ELF descriptor for output file: %s"
+#~ msgstr "no es posible crear un descriptor ELF para el archivo de salida: %s"
+
+#~ msgid "could not create ELF header for output file: %s"
+#~ msgstr ""
+#~ "no es posible crear un encabezamiento ELF para el archivo de salida: %s"
+
+#~ msgid "cannot create section for output file: %s"
+#~ msgstr "no se puede crear sección para archivo de salida: %s"
+
+#~ msgid "address computation expression contains variable '%s'"
+#~ msgstr "la expresión de computación contiene la variable '%s'"
+
+#~ msgid ""
+#~ "argument '%<PRIuMAX>' of ALIGN in address computation expression is no "
+#~ "power of two"
+#~ msgstr ""
+#~ "el argumento '%<PRIuMAX>' de ALIGN en expresión de dirección de "
+#~ "computación no es potencia de dos"
+
+#~ msgid "cannot find entry symbol '%s': defaulting to %#0*<PRIx64>"
+#~ msgstr ""
+#~ "no se puede encontrar símbolo de entrada '%s': predeterminada para "
+#~ "%#0*<PRIx64>"
+
+#~ msgid "no entry symbol specified: defaulting to %#0*<PRIx64>"
+#~ msgstr ""
+#~ "no se ha especificado una entrada de símbolo: estableciendo por defecto a "
+#~ "%#0*<PRIx64>"
+
+#~ msgid "cannot create GNU hash table section for output file: %s"
+#~ msgstr ""
+#~ "no se puede crear una tabla de dispersión GNU para archivo de salida: %s"
+
+#~ msgid "cannot create hash table section for output file: %s"
+#~ msgstr ""
+#~ "no es posible crear una sección para la tabla de dispersión del archivo "
+#~ "de salida: %s"
+
+#~ msgid "cannot create build ID section: %s"
+#~ msgstr "no se puede crear sección de creación de ID: %s"
+
+#~ msgid "cannot convert section data to file format: %s"
+#~ msgstr ""
+#~ "no es posible convertir los datos de la sección en formato de archivo: %s"
+
+#~ msgid "cannot convert section data to memory format: %s"
+#~ msgstr ""
+#~ "no es posible convertir datos de la sección en formato de memoria: %s"
+
+#~ msgid "cannot read enough data for UUID"
+#~ msgstr "no es posible leer suficientes datos para el UUID"
+
+#~ msgid "cannot create symbol table for output file: %s"
+#~ msgstr "no es posible crear tabla de símbolo para el comando de salida: %s"
+
+#~ msgid "section index too large in dynamic symbol table"
+#~ msgstr ""
+#~ "el índice de la sección es demasiado extenso en la tabla de símbolos "
+#~ "dinámicos"
+
+#~ msgid "cannot create versioning section: %s"
+#~ msgstr "no se puede crear sección de versión: %s"
+
+#~ msgid "cannot create dynamic symbol table for output file: %s"
+#~ msgstr ""
+#~ "no es posible crear tabla de símbolos dinámicos para el archivo de "
+#~ "salida: %s"
+
+#~ msgid "cannot create versioning data: %s"
+#~ msgstr "no se pueden crear datos de versión: %s"
+
+#~ msgid "cannot create section header string section: %s"
+#~ msgstr ""
+#~ "no se puede crear sección de cadenas de encabezamiento de sección: %s"
+
+#~ msgid "cannot create section header string section"
+#~ msgstr "no se puede crear sección de cadenas de encabezamiento de sección"
+
+#~ msgid "cannot create program header: %s"
+#~ msgstr "no se puede crear encabezamiento de programa: %s"
+
+#~ msgid "while determining file layout: %s"
+#~ msgstr "al determinar diseño de fichero: %s"
+
+#~ msgid "internal error: non-nobits section follows nobits section"
+#~ msgstr "error interno: sección non-nobits sigue a sección nobits"
+
+#~ msgid "cannot get header of 0th section: %s"
+#~ msgstr "No se puede obtener encabezamiento de sección 0th: %s"
+
+#~ msgid "linker backend didn't specify function to relocate section"
+#~ msgstr ""
+#~ "enlazador de segundo plano no especificó función para reubicar sección"
+
+#~ msgid "while writing output file: %s"
+#~ msgstr "Ocurrió un error de fichero de salida: %s"
+
+#~ msgid "while finishing output file: %s"
+#~ msgstr "error al cerrar el fichero de salida: %s"
+
+#~ msgid "cannot stat output file"
+#~ msgstr "no se puede generar stat de fichero de salida"
+
+#~ msgid "WARNING: temporary output file overwritten before linking finished"
+#~ msgstr ""
+#~ "ADVERTENCIA: archivo de salida temporal sobreescrito antes que haya "
+#~ "concluido el enlazamiento"
+
+#~ msgid "no machine specific '%s' implementation"
+#~ msgstr "no hay máquina específica de implementación '%s'"
+
+#~ msgid "mode for segment invalid\n"
+#~ msgstr "modo para segmento inválido\n"
+
+#~ msgid "while reading version script '%s': %s at line %d"
+#~ msgstr "al leer script de versión '%s': %s en línea %d"
+
+#~ msgid "while reading linker script '%s': %s at line %d"
+#~ msgstr "al leer script de enlace '%s': %s en línea %d"
+
+#, fuzzy
+#~ msgid ""
+#~ "symbol '%s' is declared both local and global for unnamed version '%s'"
+#~ msgstr ""
+#~ "el símbolo '%s' es declarado tanto local como global para la versión sin "
+#~ "nombre"
+
+#~ msgid "symbol '%s' is declared both local and global for version '%s'"
+#~ msgstr ""
+#~ "el símbolo '%s' es declarado tanto local como global para la versión '%s'"
+
+#~ msgid "default visibility set as local and global"
+#~ msgstr ""
+#~ "la visibilidad establecida por defecto establecida como local y global"
+
#~ msgid "cannot get section header of section %Zu: %s"
#~ msgstr "No se puede obtener encabezamiento de sección %Zu: %s"
@@ -7319,10 +7542,6 @@
#~ msgid "unknown user attribute %hx"
#~ msgstr "Atributo de usuario desconocido %hx"
-#, fuzzy
-#~ msgid "unknown form %#<PRIx64>"
-#~ msgstr "Forma %<PRIx64> desconocida"
-
#~ msgid ""
#~ "\n"
#~ "\n"
diff --git a/po/fr.po b/po/fr.po
index 53c1fb1..1a7a3f8 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -5639,7 +5639,7 @@
#: src/unstrip.c:2248
msgid ""
-"Combine stripped files with separate symbols and debug information.\vThe "
+"Combine stripped files with separate symbols and debug information.\n\nThe "
"first form puts the result in DEBUG-FILE if -o was not given.\n"
"\n"
"MODULE arguments give file name patterns matching modules to process.\n"
diff --git a/po/it.po b/po/it.po
index 0e2d3b2..61e8ae0 100644
--- a/po/it.po
+++ b/po/it.po
@@ -5640,7 +5640,7 @@
#: src/unstrip.c:2248
msgid ""
-"Combine stripped files with separate symbols and debug information.\vThe "
+"Combine stripped files with separate symbols and debug information.\n\nThe "
"first form puts the result in DEBUG-FILE if -o was not given.\n"
"\n"
"MODULE arguments give file name patterns matching modules to process.\n"
diff --git a/po/ja.po b/po/ja.po
index 6d99a25..63fb6de 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -7,8 +7,8 @@
msgid ""
msgstr ""
"Project-Id-Version: ja\n"
-"Report-Msgid-Bugs-To: http://bugzilla.redhat.com/\n"
-"POT-Creation-Date: 2016-01-11 08:48+0100\n"
+"Report-Msgid-Bugs-To: https://sourceware.org/bugzilla/\n"
+"POT-Creation-Date: 2018-06-29 20:47+0200\n"
"PO-Revision-Date: 2009-09-20 15:32+0900\n"
"Last-Translator: Hyu_gabaru Ryu_ichi <hyu_gabaru@yahoo.co.jp>\n"
"Language-Team: Japanese <jp@li.org>\n"
@@ -34,29 +34,39 @@
" - 'auto', 'tty', 'if-tty'\n"
msgstr ""
-#: lib/color.c:190 src/objdump.c:738
+#: lib/color.c:190 src/objdump.c:727
#, fuzzy, c-format
msgid "cannot allocate memory"
msgstr "PLT セクションを割り当てられません: %s"
-#: lib/xmalloc.c:53 lib/xmalloc.c:66 lib/xmalloc.c:78 src/readelf.c:3282
-#: src/readelf.c:3669 src/readelf.c:8416 src/unstrip.c:2233 src/unstrip.c:2438
+#: lib/printversion.c:40
+#, fuzzy, c-format
+msgid ""
+"Copyright (C) %s The elfutils developers <%s>.\n"
+"This is free software; see the source for copying conditions. There is NO\n"
+"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
+msgstr ""
+"Copyright (C) %s Red Hat, Inc.\n"
+"This is free software; see the source for copying conditions. There is NO\n"
+"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
+
+#: lib/xmalloc.c:53 lib/xmalloc.c:66 lib/xmalloc.c:78 src/readelf.c:3395
+#: src/readelf.c:11196 src/unstrip.c:2227 src/unstrip.c:2433
#, c-format
msgid "memory exhausted"
msgstr "メモリー消費済み"
-#: libasm/asm_error.c:65 libdw/dwarf_error.c:58 libdwfl/libdwflP.h:53
+#: libasm/asm_error.c:65 libdw/dwarf_error.c:57 libdwfl/libdwflP.h:50
#: libelf/elf_error.c:60
msgid "no error"
msgstr "エラー無し"
-#: libasm/asm_error.c:66 libdw/dwarf_error.c:68 libdwfl/libdwflP.h:55
+#: libasm/asm_error.c:66 libdw/dwarf_error.c:67 libdwfl/libdwflP.h:52
#: libelf/elf_error.c:91
msgid "out of memory"
msgstr "メモリー不足"
-#: libasm/asm_error.c:67 src/ldgeneric.c:2677
-#, c-format
+#: libasm/asm_error.c:67
msgid "cannot create output file"
msgstr "出力ファイルを作成できません"
@@ -68,8 +78,7 @@
msgid "cannot change mode of output file"
msgstr "出力ファイルのモードを変更できません"
-#: libasm/asm_error.c:70 src/ldgeneric.c:6990
-#, c-format
+#: libasm/asm_error.c:70
msgid "cannot rename output file"
msgstr "出力ファイルの名前を変更できません"
@@ -89,177 +98,218 @@
msgid "no backend support available"
msgstr "バックエンドサポートが利用できません"
-#: libasm/asm_error.c:83 libdw/dwarf_error.c:59 libdwfl/libdwflP.h:54
+#: libasm/asm_error.c:83 libdw/dwarf_error.c:58 libdwfl/libdwflP.h:51
#: libelf/elf_error.c:63
msgid "unknown error"
msgstr "不明なエラー"
-#: libdw/dwarf_error.c:60
+#: libdw/dwarf_error.c:59
msgid "invalid access"
msgstr "不当なアクセス"
-#: libdw/dwarf_error.c:61
+#: libdw/dwarf_error.c:60
msgid "no regular file"
msgstr "一般ファイルではありません"
-#: libdw/dwarf_error.c:62
+#: libdw/dwarf_error.c:61
msgid "I/O error"
msgstr "I/O エラー"
-#: libdw/dwarf_error.c:63
+#: libdw/dwarf_error.c:62
msgid "invalid ELF file"
msgstr "不当な ELF ファイル"
-#: libdw/dwarf_error.c:64
+#: libdw/dwarf_error.c:63
msgid "no DWARF information"
msgstr "DWARF 情報がありません"
-#: libdw/dwarf_error.c:65
+#: libdw/dwarf_error.c:64
msgid "cannot decompress DWARF"
msgstr ""
-#: libdw/dwarf_error.c:66
+#: libdw/dwarf_error.c:65
msgid "no ELF file"
msgstr "ELF ファイルがありません"
-#: libdw/dwarf_error.c:67
+#: libdw/dwarf_error.c:66
msgid "cannot get ELF header"
msgstr "ELF ヘッダーを得られません"
-#: libdw/dwarf_error.c:69
+#: libdw/dwarf_error.c:68
msgid "not implemented"
msgstr "未実装"
-#: libdw/dwarf_error.c:70 libelf/elf_error.c:107 libelf/elf_error.c:155
+#: libdw/dwarf_error.c:69 libelf/elf_error.c:111 libelf/elf_error.c:159
msgid "invalid command"
msgstr "不当なコマンド"
-#: libdw/dwarf_error.c:71
+#: libdw/dwarf_error.c:70
msgid "invalid version"
msgstr "不当なバージョン"
-#: libdw/dwarf_error.c:72
+#: libdw/dwarf_error.c:71
msgid "invalid file"
msgstr "不当なファイル"
-#: libdw/dwarf_error.c:73
+#: libdw/dwarf_error.c:72
msgid "no entries found"
msgstr "項目が見つかりません"
-#: libdw/dwarf_error.c:74
+#: libdw/dwarf_error.c:73
msgid "invalid DWARF"
msgstr "不当な DWARF"
-#: libdw/dwarf_error.c:75
+#: libdw/dwarf_error.c:74
msgid "no string data"
msgstr "文字データがありません"
+#: libdw/dwarf_error.c:75
+#, fuzzy
+msgid ".debug_str section missing"
+msgstr ".debug_ranges セクションがありません"
+
#: libdw/dwarf_error.c:76
+#, fuzzy
+msgid ".debug_line_str section missing"
+msgstr ".debug_line セクションがありません"
+
+#: libdw/dwarf_error.c:77
+#, fuzzy
+msgid ".debug_str_offsets section missing"
+msgstr ".debug_ranges セクションがありません"
+
+#: libdw/dwarf_error.c:78
msgid "no address value"
msgstr "アドレス値ではありません"
-#: libdw/dwarf_error.c:77
+#: libdw/dwarf_error.c:79
msgid "no constant value"
msgstr "固定値ではありません"
-#: libdw/dwarf_error.c:78
+#: libdw/dwarf_error.c:80
msgid "no reference value"
msgstr "参照値がありません"
-#: libdw/dwarf_error.c:79
+#: libdw/dwarf_error.c:81
msgid "invalid reference value"
msgstr "不当な参照値"
-#: libdw/dwarf_error.c:80
+#: libdw/dwarf_error.c:82
msgid ".debug_line section missing"
msgstr ".debug_line セクションがありません"
-#: libdw/dwarf_error.c:81
+#: libdw/dwarf_error.c:83
msgid "invalid .debug_line section"
msgstr "不当な .debug_line セクション"
-#: libdw/dwarf_error.c:82
+#: libdw/dwarf_error.c:84
msgid "debug information too big"
msgstr "デバッグ情報が大きすぎます"
-#: libdw/dwarf_error.c:83
+#: libdw/dwarf_error.c:85
msgid "invalid DWARF version"
msgstr "不当な DWARF バージョン"
-#: libdw/dwarf_error.c:84
+#: libdw/dwarf_error.c:86
msgid "invalid directory index"
msgstr "不当なディレクトリー索引"
-#: libdw/dwarf_error.c:85 libdwfl/libdwflP.h:74
+#: libdw/dwarf_error.c:87 libdwfl/libdwflP.h:71
msgid "address out of range"
msgstr "アドレスが範囲外です"
-#: libdw/dwarf_error.c:86
-msgid "no location list value"
+#: libdw/dwarf_error.c:88
+#, fuzzy
+msgid ".debug_loc section missing"
+msgstr ".debug_line セクションがありません"
+
+#: libdw/dwarf_error.c:89
+#, fuzzy
+msgid ".debug_loclists section missing"
+msgstr ".debug_line セクションがありません"
+
+#: libdw/dwarf_error.c:90
+#, fuzzy
+msgid "not a location list value"
msgstr "ロケーションリスト値ではありません"
-#: libdw/dwarf_error.c:87
+#: libdw/dwarf_error.c:91
msgid "no block data"
msgstr "ブロックデータではありません"
-#: libdw/dwarf_error.c:88
+#: libdw/dwarf_error.c:92
msgid "invalid line index"
msgstr "不当な行索引"
-#: libdw/dwarf_error.c:89
+#: libdw/dwarf_error.c:93
msgid "invalid address range index"
msgstr "不当なアドレス範囲索引"
-#: libdw/dwarf_error.c:90 libdwfl/libdwflP.h:75
+#: libdw/dwarf_error.c:94 libdwfl/libdwflP.h:72
msgid "no matching address range"
msgstr "アドレス範囲に対応しません"
-#: libdw/dwarf_error.c:91
+#: libdw/dwarf_error.c:95
msgid "no flag value"
msgstr "フラグ値がありません"
-#: libdw/dwarf_error.c:92 libelf/elf_error.c:232
+#: libdw/dwarf_error.c:96 libelf/elf_error.c:236
msgid "invalid offset"
msgstr "不当なオフセット"
-#: libdw/dwarf_error.c:93
+#: libdw/dwarf_error.c:97
msgid ".debug_ranges section missing"
msgstr ".debug_ranges セクションがありません"
-#: libdw/dwarf_error.c:94
+#: libdw/dwarf_error.c:98
+#, fuzzy
+msgid ".debug_rnglists section missing"
+msgstr ".debug_ranges セクションがありません"
+
+#: libdw/dwarf_error.c:99
msgid "invalid CFI section"
msgstr "不当な CFI セクション"
-#: libdw/dwarf_error.c:95
+#: libdw/dwarf_error.c:100
msgid "no alternative debug link found"
msgstr ""
-#: libdw/dwarf_error.c:96
+#: libdw/dwarf_error.c:101
#, fuzzy
msgid "invalid opcode"
msgstr "不当なオペランド"
-#: libdw/dwarf_error.c:97
+#: libdw/dwarf_error.c:102
msgid "not a CU (unit) DIE"
msgstr ""
-#: libdwfl/argp-std.c:46 src/stack.c:642 src/unstrip.c:2380
+#: libdw/dwarf_error.c:103
+#, fuzzy
+msgid "unknown language code"
+msgstr "不明な命令コード"
+
+#: libdw/dwarf_error.c:104
+#, fuzzy
+msgid ".debug_addr section missing"
+msgstr ".debug_ranges セクションがありません"
+
+#: libdwfl/argp-std.c:50 src/stack.c:639 src/unstrip.c:2374
msgid "Input selection options:"
msgstr "選択オプションを入力してください:"
-#: libdwfl/argp-std.c:47
+#: libdwfl/argp-std.c:51
msgid "Find addresses in FILE"
msgstr "ふぁいる 中のアドレスを探す"
-#: libdwfl/argp-std.c:49
+#: libdwfl/argp-std.c:53
msgid "Find addresses from signatures found in COREFILE"
msgstr "COREFILE 中で見つかった署名からアドレスを探す"
-#: libdwfl/argp-std.c:51
+#: libdwfl/argp-std.c:55
msgid "Find addresses in files mapped into process PID"
msgstr "プロセス PID に対応するファイル中のアドレスを探す"
-#: libdwfl/argp-std.c:53
+#: libdwfl/argp-std.c:57
msgid ""
"Find addresses in files mapped as read from FILE in Linux /proc/PID/maps "
"format"
@@ -267,207 +317,208 @@
"Linux の /proc/PID/maps 形式の ふぁいる から読み込んだものに対応するファイル"
"のアドレスを探す"
-#: libdwfl/argp-std.c:55
+#: libdwfl/argp-std.c:59
msgid "Find addresses in the running kernel"
msgstr "実行中のカーネルのアドレスを探す"
-#: libdwfl/argp-std.c:57
+#: libdwfl/argp-std.c:61
msgid "Kernel with all modules"
msgstr "全てのモジュール付きのカーネル"
-#: libdwfl/argp-std.c:59 src/stack.c:649
+#: libdwfl/argp-std.c:63 src/stack.c:646
msgid "Search path for separate debuginfo files"
msgstr "分離した debuginfo ファイルべきパスを探す"
-#: libdwfl/argp-std.c:157
+#: libdwfl/argp-std.c:164
msgid "only one of -e, -p, -k, -K, or --core allowed"
msgstr "-e か、-p、-k、-K、--core のひとつだけが認められます"
-#: libdwfl/argp-std.c:230
+#: libdwfl/argp-std.c:237
msgid "cannot load kernel symbols"
msgstr "カーネルシンボルをロードできません"
-#: libdwfl/argp-std.c:234
+#. Non-fatal to have no modules since we do have the kernel.
+#: libdwfl/argp-std.c:241
msgid "cannot find kernel modules"
msgstr "カーネルモジュールを見つけられません"
-#: libdwfl/argp-std.c:251
+#: libdwfl/argp-std.c:258
msgid "cannot find kernel or modules"
msgstr "カーネルかモジュールを見つけられません"
-#: libdwfl/argp-std.c:290
+#: libdwfl/argp-std.c:297
#, c-format
msgid "cannot read ELF core file: %s"
msgstr "ELF コアファイルを読めません: %s"
-#: libdwfl/argp-std.c:313
+#: libdwfl/argp-std.c:320
#, fuzzy
msgid "Not enough memory"
msgstr "メモリー不足"
-#: libdwfl/argp-std.c:323
+#: libdwfl/argp-std.c:330
msgid "No modules recognized in core file"
msgstr "コアファイルの中にモジュールを認識できません"
-#: libdwfl/libdwflP.h:56
+#: libdwfl/libdwflP.h:53
msgid "See errno"
msgstr ""
-#: libdwfl/libdwflP.h:57
+#: libdwfl/libdwflP.h:54
msgid "See elf_errno"
msgstr ""
-#: libdwfl/libdwflP.h:58
+#: libdwfl/libdwflP.h:55
msgid "See dwarf_errno"
msgstr ""
-#: libdwfl/libdwflP.h:59
+#: libdwfl/libdwflP.h:56
msgid "See ebl_errno (XXX missing)"
msgstr ""
-#: libdwfl/libdwflP.h:60
+#: libdwfl/libdwflP.h:57
msgid "gzip decompression failed"
msgstr ""
-#: libdwfl/libdwflP.h:61
+#: libdwfl/libdwflP.h:58
msgid "bzip2 decompression failed"
msgstr ""
-#: libdwfl/libdwflP.h:62
+#: libdwfl/libdwflP.h:59
msgid "LZMA decompression failed"
msgstr ""
-#: libdwfl/libdwflP.h:63
+#: libdwfl/libdwflP.h:60
msgid "no support library found for machine"
msgstr ""
-#: libdwfl/libdwflP.h:64
+#: libdwfl/libdwflP.h:61
msgid "Callbacks missing for ET_REL file"
msgstr ""
-#: libdwfl/libdwflP.h:65
+#: libdwfl/libdwflP.h:62
msgid "Unsupported relocation type"
msgstr ""
-#: libdwfl/libdwflP.h:66
+#: libdwfl/libdwflP.h:63
msgid "r_offset is bogus"
msgstr ""
-#: libdwfl/libdwflP.h:67 libelf/elf_error.c:111 libelf/elf_error.c:171
+#: libdwfl/libdwflP.h:64 libelf/elf_error.c:115 libelf/elf_error.c:175
msgid "offset out of range"
msgstr "オフセットが範囲を越えている"
-#: libdwfl/libdwflP.h:68
+#: libdwfl/libdwflP.h:65
#, fuzzy
msgid "relocation refers to undefined symbol"
msgstr "定義されたシンボルの印刷サイズ"
-#: libdwfl/libdwflP.h:69
+#: libdwfl/libdwflP.h:66
msgid "Callback returned failure"
msgstr ""
-#: libdwfl/libdwflP.h:70
+#: libdwfl/libdwflP.h:67
#, fuzzy
msgid "No DWARF information found"
msgstr "DWARF 情報がありません"
-#: libdwfl/libdwflP.h:71
+#: libdwfl/libdwflP.h:68
msgid "No symbol table found"
msgstr ""
-#: libdwfl/libdwflP.h:72
+#: libdwfl/libdwflP.h:69
#, fuzzy
msgid "No ELF program headers"
msgstr "プログラムヘッダーを得られません: %s"
-#: libdwfl/libdwflP.h:73
+#: libdwfl/libdwflP.h:70
msgid "address range overlaps an existing module"
msgstr ""
-#: libdwfl/libdwflP.h:76
+#: libdwfl/libdwflP.h:73
msgid "image truncated"
msgstr ""
-#: libdwfl/libdwflP.h:77
+#: libdwfl/libdwflP.h:74
#, fuzzy
msgid "ELF file opened"
msgstr "ファイルのオープンを追跡します。"
-#: libdwfl/libdwflP.h:78
+#: libdwfl/libdwflP.h:75
#, fuzzy
msgid "not a valid ELF file"
msgstr "不当な ELF ファイル"
-#: libdwfl/libdwflP.h:79
+#: libdwfl/libdwflP.h:76
#, fuzzy
msgid "cannot handle DWARF type description"
msgstr "Elf 記述子を生成できません: %s"
-#: libdwfl/libdwflP.h:80
+#: libdwfl/libdwflP.h:77
msgid "ELF file does not match build ID"
msgstr ""
-#: libdwfl/libdwflP.h:81
+#: libdwfl/libdwflP.h:78
#, fuzzy
msgid "corrupt .gnu.prelink_undo section data"
msgstr "ラインデータセクションデータを得られません: %s"
-#: libdwfl/libdwflP.h:82
+#: libdwfl/libdwflP.h:79
msgid "Internal error due to ebl"
msgstr ""
-#: libdwfl/libdwflP.h:83
+#: libdwfl/libdwflP.h:80
msgid "Missing data in core file"
msgstr ""
-#: libdwfl/libdwflP.h:84
+#: libdwfl/libdwflP.h:81
#, fuzzy
msgid "Invalid register"
msgstr "不当なパラメーター"
-#: libdwfl/libdwflP.h:85
+#: libdwfl/libdwflP.h:82
msgid "Error reading process memory"
msgstr ""
-#: libdwfl/libdwflP.h:86
+#: libdwfl/libdwflP.h:83
msgid "Couldn't find architecture of any ELF"
msgstr ""
-#: libdwfl/libdwflP.h:87
+#: libdwfl/libdwflP.h:84
msgid "Error parsing /proc filesystem"
msgstr ""
-#: libdwfl/libdwflP.h:88
+#: libdwfl/libdwflP.h:85
#, fuzzy
msgid "Invalid DWARF"
msgstr "不当な DWARF"
-#: libdwfl/libdwflP.h:89
+#: libdwfl/libdwflP.h:86
msgid "Unsupported DWARF"
msgstr ""
-#: libdwfl/libdwflP.h:90
+#: libdwfl/libdwflP.h:87
msgid "Unable to find more threads"
msgstr ""
-#: libdwfl/libdwflP.h:91
+#: libdwfl/libdwflP.h:88
msgid "Dwfl already has attached state"
msgstr ""
-#: libdwfl/libdwflP.h:92
+#: libdwfl/libdwflP.h:89
msgid "Dwfl has no attached state"
msgstr ""
-#: libdwfl/libdwflP.h:93
+#: libdwfl/libdwflP.h:90
msgid "Unwinding not supported for this architecture"
msgstr ""
-#: libdwfl/libdwflP.h:94
+#: libdwfl/libdwflP.h:91
#, fuzzy
msgid "Invalid argument"
msgstr "不当なパラメーター"
-#: libdwfl/libdwflP.h:95
+#: libdwfl/libdwflP.h:92
#, fuzzy
msgid "Not an ET_CORE ELF file"
msgstr "不当な ELF ファイル"
@@ -476,14 +527,14 @@
msgid "No backend"
msgstr "バックエンドがありません"
-#: libebl/eblcorenotetypename.c:98 libebl/eblobjecttypename.c:53
-#: libebl/eblobjnotetypename.c:69 libebl/eblosabiname.c:73
-#: libebl/eblsectionname.c:83 libebl/eblsectiontypename.c:115
-#: libebl/eblsegmenttypename.c:79
+#: libebl/eblcorenotetypename.c:100 libebl/eblobjnotetypename.c:76
+#: libebl/eblobjnotetypename.c:83 libebl/eblobjnotetypename.c:102
+#: libebl/eblosabiname.c:73 libebl/eblsectionname.c:83
+#: libebl/eblsectiontypename.c:115 libebl/eblsegmenttypename.c:79
msgid "<unknown>"
msgstr "<不明>"
-#: libebl/ebldynamictagname.c:101
+#: libebl/ebldynamictagname.c:103
#, c-format
msgid "<unknown>: %#<PRIx64>"
msgstr "<不明>: %#<PRIx64>"
@@ -533,6 +584,7 @@
msgid " Build ID: "
msgstr " ビルト ID: "
+#. A non-null terminated version string.
#: libebl/eblobjnote.c:152
#, c-format
msgid " Linker version: %.*s\n"
@@ -572,7 +624,7 @@
msgid "invalid size of destination operand"
msgstr "宛先演算子の大きさが無効"
-#: libelf/elf_error.c:87 src/readelf.c:5473
+#: libelf/elf_error.c:87 src/readelf.c:6107
#, c-format
msgid "invalid encoding"
msgstr "無効なエンコード"
@@ -582,153 +634,158 @@
msgstr "不当なファイル記述子"
#: libelf/elf_error.c:99
+#, fuzzy
+msgid "invalid ELF file data"
+msgstr "不当な ELF ファイル"
+
+#: libelf/elf_error.c:103
msgid "invalid operation"
msgstr "不当な操作"
-#: libelf/elf_error.c:103
+#: libelf/elf_error.c:107
msgid "ELF version not set"
msgstr "ELF のバージョンが設定されていない"
-#: libelf/elf_error.c:115
+#: libelf/elf_error.c:119
msgid "invalid fmag field in archive header"
msgstr "アーカイブヘッダーの不当な fmag 領域"
-#: libelf/elf_error.c:119
+#: libelf/elf_error.c:123
msgid "invalid archive file"
msgstr "不当なアーカイブファイル"
-#: libelf/elf_error.c:123
+#: libelf/elf_error.c:127
msgid "descriptor is not for an archive"
msgstr "記述子はアーカイブ用ではありません"
-#: libelf/elf_error.c:127
+#: libelf/elf_error.c:131
msgid "no index available"
msgstr "索引が使えません"
-#: libelf/elf_error.c:131
+#: libelf/elf_error.c:135
msgid "cannot read data from file"
msgstr "ファイルからデータを読みません"
-#: libelf/elf_error.c:135
+#: libelf/elf_error.c:139
msgid "cannot write data to file"
msgstr "ファイルへデータを書けません"
-#: libelf/elf_error.c:139
+#: libelf/elf_error.c:143
msgid "invalid binary class"
msgstr "不当なバイナリークラス"
-#: libelf/elf_error.c:143
+#: libelf/elf_error.c:147
msgid "invalid section index"
msgstr "不当なセクション索引"
-#: libelf/elf_error.c:147
+#: libelf/elf_error.c:151
msgid "invalid operand"
msgstr "不当なオペランド"
-#: libelf/elf_error.c:151
+#: libelf/elf_error.c:155
msgid "invalid section"
msgstr "不当なセクション"
-#: libelf/elf_error.c:159
+#: libelf/elf_error.c:163
msgid "executable header not created first"
msgstr "エクゼキュータブルヘッダーが最初に作られていません"
-#: libelf/elf_error.c:163
+#: libelf/elf_error.c:167
msgid "file descriptor disabled"
msgstr "ファイル記述子が機能しません"
-#: libelf/elf_error.c:167
+#: libelf/elf_error.c:171
#, fuzzy
msgid "archive/member file descriptor mismatch"
msgstr "アーカイブ/メンバー領域が不整合です"
-#: libelf/elf_error.c:175
+#: libelf/elf_error.c:179
msgid "cannot manipulate null section"
msgstr "null セクションを操作できません"
-#: libelf/elf_error.c:179
+#: libelf/elf_error.c:183
msgid "data/scn mismatch"
msgstr "データ/scnが不整合です"
-#: libelf/elf_error.c:183
+#: libelf/elf_error.c:187
msgid "invalid section header"
msgstr "不当なセクションヘッダー"
-#: libelf/elf_error.c:187 src/readelf.c:7342 src/readelf.c:7790
-#: src/readelf.c:7891 src/readelf.c:8072
+#: libelf/elf_error.c:191 src/readelf.c:9742 src/readelf.c:10313
+#: src/readelf.c:10414 src/readelf.c:10595
#, c-format
msgid "invalid data"
msgstr "不当なデータ"
-#: libelf/elf_error.c:191
+#: libelf/elf_error.c:195
msgid "unknown data encoding"
msgstr "不明なデータエンコード"
-#: libelf/elf_error.c:195
+#: libelf/elf_error.c:199
msgid "section `sh_size' too small for data"
msgstr "`sh_size' セクションがデータには小さすぎます"
-#: libelf/elf_error.c:199
+#: libelf/elf_error.c:203
msgid "invalid section alignment"
msgstr "不当なセクション調整"
-#: libelf/elf_error.c:203
+#: libelf/elf_error.c:207
msgid "invalid section entry size"
msgstr "不当なセクション項目の大きさ"
-#: libelf/elf_error.c:207
+#: libelf/elf_error.c:211
msgid "update() for write on read-only file"
msgstr "読込み専用ファイルでの書込みのための update()"
-#: libelf/elf_error.c:211
+#: libelf/elf_error.c:215
msgid "no such file"
msgstr "そのようなファイルはありません"
-#: libelf/elf_error.c:215
+#: libelf/elf_error.c:219
msgid "only relocatable files can contain section groups"
msgstr "リロケータブルファイルのみセクショングループを含むことができます"
-#: libelf/elf_error.c:220
+#: libelf/elf_error.c:224
msgid ""
"program header only allowed in executables, shared objects, and core files"
msgstr ""
"プログラムヘッダーはエクゼキュータブルか、共用オブジェクト、コアファイルにの"
"み認められています"
-#: libelf/elf_error.c:227
+#: libelf/elf_error.c:231
msgid "file has no program header"
msgstr "ファイルにプログラムヘッダーがありません"
-#: libelf/elf_error.c:237
+#: libelf/elf_error.c:241
#, fuzzy
msgid "invalid section type"
msgstr "不当なセクション"
-#: libelf/elf_error.c:242
+#: libelf/elf_error.c:246
#, fuzzy
msgid "invalid section flags"
msgstr "不当なセクション"
-#: libelf/elf_error.c:247
+#: libelf/elf_error.c:251
#, fuzzy
msgid "section does not contain compressed data"
msgstr "セクション [%2d] '%s': セクションデータを得られません\n"
-#: libelf/elf_error.c:252
+#: libelf/elf_error.c:256
msgid "section contains compressed data"
msgstr ""
-#: libelf/elf_error.c:257
+#: libelf/elf_error.c:261
#, fuzzy
msgid "unknown compression type"
msgstr "不明なタイプ"
-#: libelf/elf_error.c:262
+#: libelf/elf_error.c:266
#, fuzzy
msgid "cannot compress data"
msgstr "セクションデータを割り当てられません: %s"
-#: libelf/elf_error.c:267
+#: libelf/elf_error.c:271
#, fuzzy
msgid "cannot decompress data"
msgstr "セクションデータを割り当てられません: %s"
@@ -789,58 +846,38 @@
msgid "Print all information on one line, and indent inlines"
msgstr ""
-#: src/addr2line.c:79 src/elfcmp.c:72 src/findtextrel.c:67 src/nm.c:100
+#: src/addr2line.c:79 src/elfcmp.c:71 src/findtextrel.c:66 src/nm.c:101
#: src/strings.c:79
msgid "Miscellaneous:"
msgstr "雑則:"
+#. Short description of program.
#: src/addr2line.c:87
msgid ""
"Locate source files and line information for ADDRs (in a.out by default)."
msgstr ""
+#. Strings for arguments in help texts.
#: src/addr2line.c:91
msgid "[ADDR...]"
msgstr ""
-#: src/addr2line.c:216 src/ar.c:285 src/elfcmp.c:672 src/elflint.c:235
-#: src/findtextrel.c:162 src/ld.c:943 src/nm.c:262 src/objdump.c:177
-#: src/ranlib.c:124 src/readelf.c:509 src/size.c:207 src/strings.c:230
-#: src/strip.c:218 src/unstrip.c:232
-#, c-format
-msgid ""
-"Copyright (C) %s Red Hat, Inc.\n"
-"This is free software; see the source for copying conditions. There is NO\n"
-"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
-msgstr ""
-"Copyright (C) %s Red Hat, Inc.\n"
-"This is free software; see the source for copying conditions. There is NO\n"
-"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
-
-#: src/addr2line.c:221 src/ar.c:290 src/elfcmp.c:677 src/elflint.c:240
-#: src/findtextrel.c:167 src/ld.c:948 src/nm.c:267 src/objdump.c:182
-#: src/ranlib.c:129 src/readelf.c:514 src/size.c:212 src/strings.c:235
-#: src/strip.c:223 src/unstrip.c:237
-#, c-format
-msgid "Written by %s.\n"
-msgstr "%s によって書かれました。\n"
-
-#: src/addr2line.c:533
+#: src/addr2line.c:520
#, c-format
msgid "Section syntax requires exactly one module"
msgstr ""
-#: src/addr2line.c:556
+#: src/addr2line.c:543
#, c-format
msgid "offset %#<PRIxMAX> lies outside section '%s'"
msgstr ""
-#: src/addr2line.c:645
+#: src/addr2line.c:633
#, c-format
msgid "cannot find symbol '%s'"
msgstr ""
-#: src/addr2line.c:650
+#: src/addr2line.c:638
#, c-format
msgid "offset %#<PRIxMAX> lies outside contents of '%s'"
msgstr ""
@@ -929,10 +966,12 @@
msgid "Update only older files in archive."
msgstr "アーカイブの古いファイルのみ更新する。"
+#. Short description of program.
#: src/ar.c:99
msgid "Create, modify, and extract from archives."
msgstr "アーカイブから作成や、修正、抽出する。"
+#. Strings for arguments in help texts.
#: src/ar.c:102
msgid "[MEMBER] [COUNT] ARCHIVE [FILE...]"
msgstr "[メンバー] [合計] アーカイブ [ファイル...]"
@@ -977,121 +1016,146 @@
msgid "command option required"
msgstr ""
-#: src/ar.c:310
+#: src/ar.c:296
#, c-format
msgid "More than one operation specified"
msgstr "1つを越える操作が指定されました"
-#: src/ar.c:404
+#: src/ar.c:390
#, c-format
msgid "cannot open archive '%s'"
msgstr "アーカイブ '%s' を開くことができません"
-#: src/ar.c:414
+#: src/ar.c:400
#, c-format
msgid "cannot open archive '%s': %s"
msgstr "アーカイブ '%s' を開けません: %s"
-#: src/ar.c:418
+#: src/ar.c:404
#, c-format
msgid "%s: not an archive file"
msgstr "%s: アーカイブファイルではありません"
-#: src/ar.c:422
+#: src/ar.c:408
#, c-format
msgid "cannot stat archive '%s'"
msgstr "アーカイブに stat できません: '%s'"
-#: src/ar.c:434
+#: src/ar.c:420
#, c-format
msgid "no entry %s in archive\n"
msgstr "アーカイブに項目 %s がありません\n"
-#: src/ar.c:487 src/ar.c:929 src/ar.c:1129
+#: src/ar.c:473 src/ar.c:918 src/ar.c:1122
#, c-format
msgid "cannot create hash table"
msgstr "ハッシュテーブルを生成できません"
-#: src/ar.c:494 src/ar.c:936 src/ar.c:1138
+#: src/ar.c:480 src/ar.c:925 src/ar.c:1131
#, c-format
msgid "cannot insert into hash table"
msgstr "ハッシュに挿入できません"
-#: src/ar.c:502 src/ranlib.c:164
+#: src/ar.c:488 src/ranlib.c:149
#, c-format
msgid "cannot stat '%s'"
msgstr "'%s' に stat できません"
-#: src/ar.c:598
+#: src/ar.c:584
#, c-format
msgid "cannot read content of %s: %s"
msgstr "%s の内容を読むことができません: %s"
-#: src/ar.c:641
+#: src/ar.c:627
#, c-format
msgid "cannot open %.*s"
msgstr "%.*s を開けません"
-#: src/ar.c:663
+#: src/ar.c:649
#, c-format
msgid "failed to write %s"
msgstr "%s への書込みに失敗しました"
-#: src/ar.c:675
+#: src/ar.c:661
#, c-format
msgid "cannot change mode of %s"
msgstr "%s のモードを変更できません"
-#: src/ar.c:691
+#: src/ar.c:677
#, c-format
msgid "cannot change modification time of %s"
msgstr "%s の更新時間を変更できません"
-#: src/ar.c:737
+#: src/ar.c:723
#, c-format
msgid "cannot rename temporary file to %.*s"
msgstr "一時ファイルを %.*s に名前変更できません"
-#: src/ar.c:773 src/ar.c:1021 src/ar.c:1420 src/ranlib.c:238
+#: src/ar.c:759 src/ar.c:1010 src/ar.c:1411 src/ranlib.c:223
#, c-format
msgid "cannot create new file"
msgstr "新しいファイルを生成できません"
-#: src/ar.c:1220
+#: src/ar.c:1213
#, c-format
msgid "position member %s not found"
msgstr "位置メンバー %s が見つかりません"
-#: src/ar.c:1230
+#: src/ar.c:1223
#, c-format
msgid "%s: no entry %s in archive!\n"
msgstr "%s: 項目 %s がアーカイブにありません!\n"
-#: src/ar.c:1259 src/ldgeneric.c:509 src/objdump.c:253
+#: src/ar.c:1252 src/objdump.c:242
#, c-format
msgid "cannot open %s"
msgstr "%s を開けません"
-#: src/ar.c:1264
+#: src/ar.c:1257
#, c-format
msgid "cannot stat %s"
msgstr "%s を stat できません"
-#: src/ar.c:1270
+#: src/ar.c:1263
#, c-format
msgid "%s is no regular file"
msgstr "%s は一般ファイルではありません"
-#: src/ar.c:1283
+#: src/ar.c:1276
#, c-format
msgid "cannot get ELF descriptor for %s: %s\n"
msgstr "%s の ELF 記述子を得られません: %s\n"
-#: src/ar.c:1303
+#: src/ar.c:1296
#, c-format
msgid "cannot read %s: %s"
msgstr "%s を読みません: %s"
+#: src/ar.c:1471
+#, fuzzy, c-format
+msgid "cannot represent ar_date"
+msgstr "セクションデータを割り当てられません: %s"
+
+#: src/ar.c:1477
+#, fuzzy, c-format
+msgid "cannot represent ar_uid"
+msgstr "セクションデータを割り当てられません: %s"
+
+#: src/ar.c:1483
+#, fuzzy, c-format
+msgid "cannot represent ar_gid"
+msgstr "セクションデータを割り当てられません: %s"
+
+#: src/ar.c:1489
+#, fuzzy, c-format
+msgid "cannot represent ar_mode"
+msgstr "セクションを得られません: %s"
+
+#: src/ar.c:1495
+#, fuzzy, c-format
+msgid "cannot represent ar_size"
+msgstr "%s を開けません"
+
#: src/arlib-argp.c:32
msgid "Use zero for uid, gid, and date in archive members."
msgstr ""
@@ -1105,122 +1169,125 @@
msgid "%s (default)"
msgstr ""
-#: src/arlib.c:209
+#. The archive is too big.
+#: src/arlib.c:213
#, c-format
msgid "the archive '%s' is too large"
msgstr "アーカイブ '%s' は大きすぎます"
-#: src/arlib.c:222
+#: src/arlib.c:226
#, c-format
msgid "cannot read ELF header of %s(%s): %s"
msgstr "%s(%s) の ELF ヘッダーを読めません: %s"
-#: src/elfcmp.c:62
+#: src/elfcmp.c:61
msgid "Control options:"
msgstr ""
-#: src/elfcmp.c:64
+#: src/elfcmp.c:63
msgid "Output all differences, not just the first"
msgstr ""
-#: src/elfcmp.c:65
+#: src/elfcmp.c:64
msgid ""
"Control treatment of gaps in loadable segments [ignore|match] (default: "
"ignore)"
msgstr ""
-#: src/elfcmp.c:67
+#: src/elfcmp.c:66
msgid "Ignore permutation of buckets in SHT_HASH section"
msgstr ""
-#: src/elfcmp.c:69
+#: src/elfcmp.c:68
msgid "Ignore differences in build ID"
msgstr ""
-#: src/elfcmp.c:70
+#: src/elfcmp.c:69
msgid "Output nothing; yield exit status only"
msgstr ""
-#: src/elfcmp.c:77
+#. Short description of program.
+#: src/elfcmp.c:76
msgid "Compare relevant parts of two ELF files for equality."
msgstr ""
-#: src/elfcmp.c:81
+#. Strings for arguments in help texts.
+#: src/elfcmp.c:80
msgid "FILE1 FILE2"
msgstr ""
-#: src/elfcmp.c:143
+#: src/elfcmp.c:142
msgid "Invalid number of parameters.\n"
msgstr ""
-#: src/elfcmp.c:174 src/elfcmp.c:179
+#: src/elfcmp.c:173 src/elfcmp.c:178
#, c-format
msgid "cannot get ELF header of '%s': %s"
msgstr ""
-#: src/elfcmp.c:205
+#: src/elfcmp.c:204
#, c-format
msgid "%s %s diff: ELF header"
msgstr ""
-#: src/elfcmp.c:212 src/elfcmp.c:215
+#: src/elfcmp.c:211 src/elfcmp.c:214
#, fuzzy, c-format
msgid "cannot get section count of '%s': %s"
msgstr "セクションを得られません: %s"
-#: src/elfcmp.c:220
+#: src/elfcmp.c:219
#, c-format
msgid "%s %s diff: section count"
msgstr ""
-#: src/elfcmp.c:227 src/elfcmp.c:230
+#: src/elfcmp.c:226 src/elfcmp.c:229
#, fuzzy, c-format
msgid "cannot get program header count of '%s': %s"
msgstr "プログラムヘッダーを得られません: %s"
-#: src/elfcmp.c:235
+#: src/elfcmp.c:234
#, fuzzy, c-format
msgid "%s %s diff: program header count"
msgstr "ファイルにプログラムヘッダーがありません"
-#: src/elfcmp.c:293
+#: src/elfcmp.c:292
#, c-format
msgid "%s %s differ: section [%zu], [%zu] name"
msgstr ""
-#: src/elfcmp.c:316
+#: src/elfcmp.c:315
#, fuzzy, c-format
msgid "%s %s differ: section [%zu] '%s' header"
msgstr "セクション [%zu] '%s' の不当なデータ"
-#: src/elfcmp.c:324 src/elfcmp.c:330
+#: src/elfcmp.c:323 src/elfcmp.c:329
#, c-format
msgid "cannot get content of section %zu in '%s': %s"
msgstr ""
-#: src/elfcmp.c:339
+#: src/elfcmp.c:338
#, fuzzy, c-format
msgid "symbol table [%zu] in '%s' has zero sh_entsize"
msgstr ""
"\n"
"シンボルテーブル [%2u] '%s' には %u 個の項目があります:\n"
-#: src/elfcmp.c:351 src/elfcmp.c:357
+#: src/elfcmp.c:350 src/elfcmp.c:356
#, c-format
msgid "cannot get symbol in '%s': %s"
msgstr ""
-#: src/elfcmp.c:379
+#: src/elfcmp.c:378
#, c-format
msgid "%s %s differ: symbol table [%zu]"
msgstr ""
-#: src/elfcmp.c:382
+#: src/elfcmp.c:381
#, c-format
msgid "%s %s differ: symbol table [%zu,%zu]"
msgstr ""
-#: src/elfcmp.c:428 src/elfcmp.c:497
+#: src/elfcmp.c:428 src/elfcmp.c:498
#, c-format
msgid "%s %s differ: section [%zu] '%s' number of notes"
msgstr ""
@@ -1230,104 +1297,173 @@
msgid "cannot read note section [%zu] '%s' in '%s': %s"
msgstr "セクション [%Zu] '%s' からデータが得られません: %s"
-#: src/elfcmp.c:446
+#: src/elfcmp.c:447
#, c-format
msgid "%s %s differ: section [%zu] '%s' note name"
msgstr ""
-#: src/elfcmp.c:454
+#: src/elfcmp.c:455
#, c-format
msgid "%s %s differ: section [%zu] '%s' note '%s' type"
msgstr ""
-#: src/elfcmp.c:469
+#: src/elfcmp.c:470
#, c-format
msgid "%s %s differ: build ID length"
msgstr ""
-#: src/elfcmp.c:477
+#: src/elfcmp.c:478
#, c-format
msgid "%s %s differ: build ID content"
msgstr ""
-#: src/elfcmp.c:486
+#: src/elfcmp.c:487
#, c-format
msgid "%s %s differ: section [%zu] '%s' note '%s' content"
msgstr ""
-#: src/elfcmp.c:527
+#: src/elfcmp.c:528
#, c-format
msgid "%s %s differ: section [%zu] '%s' content"
msgstr ""
-#: src/elfcmp.c:531
+#: src/elfcmp.c:532
#, c-format
msgid "%s %s differ: section [%zu,%zu] '%s' content"
msgstr ""
-#: src/elfcmp.c:546
+#: src/elfcmp.c:547
#, c-format
msgid "%s %s differ: unequal amount of important sections"
msgstr ""
-#: src/elfcmp.c:579 src/elfcmp.c:584
+#: src/elfcmp.c:580 src/elfcmp.c:585
#, c-format
msgid "cannot load data of '%s': %s"
msgstr ""
-#: src/elfcmp.c:603 src/elfcmp.c:609
+#: src/elfcmp.c:604 src/elfcmp.c:610
#, c-format
msgid "cannot get program header entry %d of '%s': %s"
msgstr ""
-#: src/elfcmp.c:615
+#: src/elfcmp.c:616
#, c-format
msgid "%s %s differ: program header %d"
msgstr ""
-#: src/elfcmp.c:639
+#: src/elfcmp.c:640
#, c-format
msgid "%s %s differ: gap"
msgstr ""
-#: src/elfcmp.c:704
+#: src/elfcmp.c:691
#, c-format
msgid "Invalid value '%s' for --gaps parameter."
msgstr ""
-#: src/elfcmp.c:732 src/findtextrel.c:221 src/ldgeneric.c:1757
-#: src/ldgeneric.c:4247 src/nm.c:378 src/ranlib.c:157 src/size.c:289
-#: src/strings.c:186 src/strip.c:466 src/strip.c:503 src/unstrip.c:2029
-#: src/unstrip.c:2058
+#: src/elfcmp.c:719 src/findtextrel.c:206 src/nm.c:365 src/ranlib.c:142
+#: src/size.c:273 src/strings.c:186 src/strip.c:518 src/strip.c:555
+#: src/unstrip.c:2023 src/unstrip.c:2052
#, c-format
msgid "cannot open '%s'"
msgstr "'%s' を開けません"
-#: src/elfcmp.c:736 src/findtextrel.c:228 src/ranlib.c:174
+#: src/elfcmp.c:723 src/findtextrel.c:213 src/ranlib.c:159
#, c-format
msgid "cannot create ELF descriptor for '%s': %s"
msgstr ""
-#: src/elfcmp.c:741
+#: src/elfcmp.c:728
#, c-format
msgid "cannot create EBL descriptor for '%s'"
msgstr ""
-#: src/elfcmp.c:759 src/findtextrel.c:409
+#: src/elfcmp.c:746 src/findtextrel.c:394
#, c-format
msgid "cannot get section header of section %zu: %s"
msgstr ""
-#: src/elfcmp.c:769
+#: src/elfcmp.c:756
#, c-format
msgid "cannot get content of section %zu: %s"
msgstr ""
-#: src/elfcmp.c:779 src/elfcmp.c:793
+#: src/elfcmp.c:766 src/elfcmp.c:780
#, c-format
msgid "cannot get relocation: %s"
msgstr ""
+#: src/elfcompress.c:115 src/strip.c:297 src/unstrip.c:121
+#, c-format
+msgid "-o option specified twice"
+msgstr "-o オプションが 2 回指定されています"
+
+#: src/elfcompress.c:122
+#, fuzzy, c-format
+msgid "-t option specified twice"
+msgstr "-f オプションが 2 回指定されています"
+
+#: src/elfcompress.c:131
+#, fuzzy, c-format
+msgid "unknown compression type '%s'"
+msgstr "不明なタイプ"
+
+#. We need at least one input file.
+#: src/elfcompress.c:143 src/elfcompress.c:1305
+#, fuzzy, c-format
+msgid "No input file given"
+msgstr "入力ファイルが空です"
+
+#: src/elfcompress.c:149 src/elfcompress.c:1310
+#, fuzzy, c-format
+msgid "Only one input file allowed together with '-o'"
+msgstr "'-o' と '-f' と一緒の場合は入力ファイルは 1 つしか認められません"
+
+#: src/elfcompress.c:1267
+#, fuzzy
+msgid "Place (de)compressed output into FILE"
+msgstr "はぎ取った出力を ふぁいる に置く"
+
+#: src/elfcompress.c:1270
+msgid ""
+"What type of compression to apply. TYPE can be 'none' (decompress), "
+"'zlib' (ELF ZLIB compression, the default, 'zlib-gabi' is an alias) or 'zlib-"
+"gnu' (.zdebug GNU style compression, 'gnu' is an alias)"
+msgstr ""
+
+#: src/elfcompress.c:1273
+msgid ""
+"SECTION name to (de)compress, SECTION is an extended wildcard pattern "
+"(defaults to '.?(z)debug*')"
+msgstr ""
+
+#: src/elfcompress.c:1276
+msgid "Print a message for each section being (de)compressed"
+msgstr ""
+
+#: src/elfcompress.c:1279
+msgid "Force compression of section even if it would become larger"
+msgstr ""
+
+#: src/elfcompress.c:1282 src/strip.c:91
+msgid "Relax a few rules to handle slightly broken ELF files"
+msgstr "少し壊れた ELF ファイルを取り扱うためにルールを少し緩和する"
+
+#: src/elfcompress.c:1285
+#, fuzzy
+msgid "Be silent when a section cannot be compressed"
+msgstr "セクション [%2d] '%s': セクションデータを得られません\n"
+
+#. Strings for arguments in help texts.
+#: src/elfcompress.c:1294 src/elflint.c:78 src/readelf.c:154
+msgid "FILE..."
+msgstr "ふぁいる..."
+
+#: src/elfcompress.c:1295
+msgid "Compress or decompress sections in an ELF file."
+msgstr ""
+
#: src/elflint.c:64
msgid "Be extremely strict, flag level 2 features."
msgstr "非常に厳密にやってください、フラグレベル 2 機能。"
@@ -1347,15 +1483,12 @@
msgstr ""
"バイナリーは GNU ld で作成され、従ってある方法で壊れているのが知られている"
+#. Short description of program.
#: src/elflint.c:74
msgid "Pedantic checking of ELF files compliance with gABI/psABI spec."
msgstr "ELF ファイルが gABI/psABI 仕様へ準拠しているかの厳密なチェック。"
-#: src/elflint.c:78 src/readelf.c:126
-msgid "FILE..."
-msgstr "ふぁいる..."
-
-#: src/elflint.c:155 src/readelf.c:298
+#: src/elflint.c:155 src/readelf.c:347
#, c-format
msgid "cannot open input file"
msgstr "入力ファイルを開けません"
@@ -1374,137 +1507,148 @@
msgid "No errors"
msgstr "エラーはありません"
-#: src/elflint.c:219 src/readelf.c:474
+#: src/elflint.c:220 src/readelf.c:546
msgid "Missing file name.\n"
msgstr "ファイル名がありません。\n"
-#: src/elflint.c:298
+#: src/elflint.c:285
#, c-format
msgid " error while freeing sub-ELF descriptor: %s\n"
msgstr "副-ELF 記述子を解放している時にエラー: %s\n"
-#: src/elflint.c:306
+#. We cannot do anything.
+#: src/elflint.c:293
#, c-format
msgid "Not an ELF file - it has the wrong magic bytes at the start\n"
msgstr "ELF ファイルではありません - 最初に誤ったマジックバイトがあります\n"
-#: src/elflint.c:371
+#: src/elflint.c:358
#, c-format
msgid "e_ident[%d] == %d is no known class\n"
msgstr "e_ident[%d] == %d は既知のクラスではありません\n"
-#: src/elflint.c:376
+#: src/elflint.c:363
#, c-format
msgid "e_ident[%d] == %d is no known data encoding\n"
msgstr "e_ident[%d] == %d は既知のデータエンコードではありません\n"
-#: src/elflint.c:380
+#: src/elflint.c:367
#, c-format
msgid "unknown ELF header version number e_ident[%d] == %d\n"
msgstr "不明な ELF ヘッダーバージョン数 e_ident[%d] == %d\n"
-#: src/elflint.c:386
+#: src/elflint.c:375
#, c-format
msgid "unsupported OS ABI e_ident[%d] == '%s'\n"
msgstr "不明な OS ABI e_ident[%d] == '%s'\n"
-#: src/elflint.c:392
-#, c-format
-msgid "unsupport ABI version e_ident[%d] == %d\n"
+#: src/elflint.c:381
+#, fuzzy, c-format
+msgid "unsupported ABI version e_ident[%d] == %d\n"
msgstr "不明な ABI バージョン e_ident[%d] == %d\n"
-#: src/elflint.c:397
+#: src/elflint.c:386
#, c-format
msgid "e_ident[%zu] is not zero\n"
msgstr "e_ident[%zu] がゼロではありません\n"
-#: src/elflint.c:402
+#: src/elflint.c:391
#, c-format
msgid "unknown object file type %d\n"
msgstr "不明なオブジェクトファイルタイプ %d\n"
-#: src/elflint.c:409
+#: src/elflint.c:398
#, c-format
msgid "unknown machine type %d\n"
msgstr "不明なマシンタイプ %d\n"
-#: src/elflint.c:413
+#: src/elflint.c:402
#, c-format
msgid "unknown object file version\n"
msgstr "不明なオブジェクトファイルバージョン\n"
-#: src/elflint.c:419
+#: src/elflint.c:408
#, c-format
msgid "invalid program header offset\n"
msgstr "不当なプログラムヘッダーオフセット\n"
-#: src/elflint.c:421
+#: src/elflint.c:410
#, c-format
msgid "executables and DSOs cannot have zero program header offset\n"
msgstr ""
"実行ファイルと DSO はプログラムヘッダーオフセットが 0 であってはいけません\n"
-#: src/elflint.c:425
+#: src/elflint.c:414
#, c-format
msgid "invalid number of program header entries\n"
msgstr "プログラムヘッダー項目数として不当な数\n"
-#: src/elflint.c:433
+#: src/elflint.c:422
#, c-format
msgid "invalid section header table offset\n"
msgstr "不当なセクションヘッダーテーブルオフセット\n"
-#: src/elflint.c:436
+#: src/elflint.c:425
#, c-format
msgid "section header table must be present\n"
msgstr "セクションヘッダーテーブルがなければなりません\n"
-#: src/elflint.c:450
+#: src/elflint.c:439
#, c-format
msgid "invalid number of section header table entries\n"
msgstr "セクションヘッダーテーブル項目数として不当な数\n"
-#: src/elflint.c:467
+#: src/elflint.c:456
#, c-format
msgid "invalid section header index\n"
msgstr "不当なセクションヘッダーインデックス\n"
-#: src/elflint.c:481
+#: src/elflint.c:474
+#, c-format
+msgid "Can only check %u headers, shnum was %u\n"
+msgstr ""
+
+#: src/elflint.c:488
#, fuzzy, c-format
msgid "invalid number of program header table entries\n"
msgstr "プログラムヘッダー項目数として不当な数\n"
-#: src/elflint.c:490
+#: src/elflint.c:505
+#, c-format
+msgid "Can only check %u headers, phnum was %u\n"
+msgstr ""
+
+#: src/elflint.c:510
#, c-format
msgid "invalid machine flags: %s\n"
msgstr "不当なマシンフラグ: %s\n"
-#: src/elflint.c:497 src/elflint.c:514
+#: src/elflint.c:517 src/elflint.c:534
#, c-format
msgid "invalid ELF header size: %hd\n"
msgstr "不当な ELF ヘッダーサイズ: %hd\n"
-#: src/elflint.c:500 src/elflint.c:517
+#: src/elflint.c:520 src/elflint.c:537
#, c-format
msgid "invalid program header size: %hd\n"
msgstr "不当なプログラムヘッダーサイズ: %hd\n"
-#: src/elflint.c:503 src/elflint.c:520
+#: src/elflint.c:523 src/elflint.c:540
#, c-format
msgid "invalid program header position or size\n"
msgstr "不当なプログラムヘッダー位置かサイズ\n"
-#: src/elflint.c:506 src/elflint.c:523
+#: src/elflint.c:526 src/elflint.c:543
#, c-format
msgid "invalid section header size: %hd\n"
msgstr "不当なセクションヘッダーサイズ: %hd\n"
-#: src/elflint.c:509 src/elflint.c:526
+#: src/elflint.c:529 src/elflint.c:546
#, c-format
msgid "invalid section header position or size\n"
msgstr "不当なセクションヘッダー位置かサイズ\n"
-#: src/elflint.c:571
+#: src/elflint.c:591
#, c-format
msgid ""
"section [%2d] '%s': section with SHF_GROUP flag set not part of a section "
@@ -1513,7 +1657,7 @@
"セクション [%2d] '%s': SHF_GROUP フラグのあるセクションにセクショングループの"
"一部分が設定されていません\n"
-#: src/elflint.c:575
+#: src/elflint.c:595
#, fuzzy, c-format
msgid ""
"section [%2d] '%s': section group [%2zu] '%s' does not precede group member\n"
@@ -1521,14 +1665,14 @@
"セクション [%2d] '%s': セクショングループ [%2zu] '%s' がグループメンバーを継"
"続していません\n"
-#: src/elflint.c:591 src/elflint.c:1475 src/elflint.c:1526 src/elflint.c:1632
-#: src/elflint.c:1968 src/elflint.c:2284 src/elflint.c:2898 src/elflint.c:3061
-#: src/elflint.c:3209 src/elflint.c:3399 src/elflint.c:4366
+#: src/elflint.c:611 src/elflint.c:1495 src/elflint.c:1546 src/elflint.c:1652
+#: src/elflint.c:1988 src/elflint.c:2311 src/elflint.c:2930 src/elflint.c:3093
+#: src/elflint.c:3241 src/elflint.c:3431 src/elflint.c:4399
#, c-format
msgid "section [%2d] '%s': cannot get section data\n"
msgstr "セクション [%2d] '%s': セクションデータを得られません\n"
-#: src/elflint.c:604 src/elflint.c:1639
+#: src/elflint.c:624 src/elflint.c:1659
#, c-format
msgid ""
"section [%2d] '%s': referenced as string table for section [%2d] '%s' but "
@@ -1537,7 +1681,7 @@
"セクション [%2d] '%s': セクション [%2d] '%s' 用の文字列テーブルとして参照され"
"ていますが、タイプが SHT_STRTAB ではありません\n"
-#: src/elflint.c:627
+#: src/elflint.c:647
#, c-format
msgid ""
"section [%2d] '%s': symbol table cannot have more than one extended index "
@@ -1546,38 +1690,38 @@
"セクション [%2d] '%s': シンボルテーブルは 1 個を越える拡張インデックスセク"
"ションを持てません\n"
-#: src/elflint.c:639
+#: src/elflint.c:659
#, c-format
msgid "section [%2u] '%s': entry size is does not match ElfXX_Sym\n"
msgstr "セクション [%2u] '%s': 項目サイズが ElfXX_Sym と一致しません\n"
-#: src/elflint.c:648
+#: src/elflint.c:668
#, c-format
msgid "section [%2d] '%s': cannot get symbol %d: %s\n"
msgstr "セクション [%2d] '%s': シンボル %d を得られません: %s\n"
-#: src/elflint.c:653 src/elflint.c:656 src/elflint.c:659 src/elflint.c:662
-#: src/elflint.c:665 src/elflint.c:668
+#: src/elflint.c:673 src/elflint.c:676 src/elflint.c:679 src/elflint.c:682
+#: src/elflint.c:685 src/elflint.c:688
#, c-format
msgid "section [%2d] '%s': '%s' in zeroth entry not zero\n"
msgstr "セクション [%2d] '%s': 0番目の項目にある '%s' ゼロではありません\n"
-#: src/elflint.c:671
+#: src/elflint.c:691
#, c-format
msgid "section [%2d] '%s': XINDEX for zeroth entry not zero\n"
msgstr "セクション [%2d] '%s': 0番目の項目用の XINDEX がゼロではありません\n"
-#: src/elflint.c:681
+#: src/elflint.c:701
#, c-format
msgid "section [%2d] '%s': cannot get symbol %zu: %s\n"
msgstr "セクション [%2d] '%s': シンボル %zu を得られません: %s\n"
-#: src/elflint.c:690
+#: src/elflint.c:710
#, c-format
msgid "section [%2d] '%s': symbol %zu: invalid name value\n"
msgstr "セクション [%2d] '%s': シンボル %zu: 不当な名前の値\n"
-#: src/elflint.c:705
+#: src/elflint.c:725
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: too large section index but no extended "
@@ -1586,7 +1730,7 @@
"セクション [%2d] '%s': シンボル %zu: 大きすぎるセクションインデックスだが、拡"
"張セクションインデックスセクションがありません\n"
-#: src/elflint.c:711
+#: src/elflint.c:731
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: XINDEX used for index which would fit in "
@@ -1595,29 +1739,30 @@
"セクション [%2d] '%s': シンボル %zu: st_shndx (%<PRIu32>) に適合するインデッ"
"クス用に使われる XINDEX\n"
-#: src/elflint.c:723
+#. || sym->st_shndx > SHN_HIRESERVE always false
+#: src/elflint.c:743
#, c-format
msgid "section [%2d] '%s': symbol %zu: invalid section index\n"
msgstr "セクション [%2d] '%s': シンボル %zu: 不当なセクションインデックス\n"
-#: src/elflint.c:731
+#: src/elflint.c:751
#, c-format
msgid "section [%2d] '%s': symbol %zu: unknown type\n"
msgstr "セクション [%2d] '%s': シンボル %zu: 不明なタイプ\n"
-#: src/elflint.c:737
+#: src/elflint.c:757
#, c-format
msgid "section [%2d] '%s': symbol %zu: unknown symbol binding\n"
msgstr "セクション [%2d] '%s': シンボル %zu: 不明なシンボルバインディング\n"
-#: src/elflint.c:742
+#: src/elflint.c:762
#, c-format
msgid "section [%2d] '%s': symbol %zu: unique symbol not of object type\n"
msgstr ""
"セクション [%2d] '%s': シンボル %zu: オブジェクトタイプと異なる固有のシンボ"
"ル\n"
-#: src/elflint.c:750
+#: src/elflint.c:770
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: COMMON only allowed in relocatable files\n"
@@ -1625,14 +1770,14 @@
"セクション [%2d] '%s': シンボル %zu: COMMON はリロケータブルファイル内のみで"
"許されます\n"
-#: src/elflint.c:754
+#: src/elflint.c:774
#, c-format
msgid "section [%2d] '%s': symbol %zu: local COMMON symbols are nonsense\n"
msgstr ""
"セクション [%2d] '%s': シンボル %zu: ローカルな COMMON シンボルは意味がありま"
"せん\n"
-#: src/elflint.c:758
+#: src/elflint.c:778
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: function in COMMON section is nonsense\n"
@@ -1640,12 +1785,12 @@
"セクション [%2d] '%s': シンボル %zu: COMMON セクションの機能は意味がありませ"
"ん\n"
-#: src/elflint.c:809
+#: src/elflint.c:829
#, c-format
msgid "section [%2d] '%s': symbol %zu: st_value out of bounds\n"
msgstr "セクション [%2d] '%s': シンボル %zu: st_value 境界外\n"
-#: src/elflint.c:815 src/elflint.c:840 src/elflint.c:889
+#: src/elflint.c:835 src/elflint.c:860 src/elflint.c:909
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu does not fit completely in referenced section "
@@ -1654,7 +1799,7 @@
"セクション [%2d] '%s': シンボル %zu は参照されるセクション [%2d] '%s' とは完"
"全に一致しません\n"
-#: src/elflint.c:824
+#: src/elflint.c:844
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: referenced section [%2d] '%s' does not have "
@@ -1663,7 +1808,7 @@
"セクション [%2d] '%s': シンボル %zu: 参照されるセクション [%2d] '%s' は "
"SHF_TLS フラグが設定されていません\n"
-#: src/elflint.c:834 src/elflint.c:882
+#: src/elflint.c:854 src/elflint.c:902
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: st_value out of bounds of referenced section "
@@ -1672,7 +1817,7 @@
"セクション [%2d] '%s': シンボル %zu: st_value 参照されるセクション [%2d] "
"'%s' の境界外\n"
-#: src/elflint.c:861
+#: src/elflint.c:881
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: TLS symbol but no TLS program header entry\n"
@@ -1680,7 +1825,7 @@
"セクション [%2d] '%s': シンボル %zu: TLS プログラムヘッダー項目がない TLS シ"
"ンボル\n"
-#: src/elflint.c:867
+#: src/elflint.c:887
#, fuzzy, c-format
msgid ""
"section [%2d] '%s': symbol %zu: TLS symbol but couldn't get TLS program "
@@ -1689,7 +1834,7 @@
"セクション [%2d] '%s': シンボル %zu: TLS プログラムヘッダー項目がない TLS シ"
"ンボル\n"
-#: src/elflint.c:875
+#: src/elflint.c:895
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: st_value short of referenced section [%2d] "
@@ -1698,7 +1843,7 @@
"セクション [%2d] '%s': シンボル %zu: 参照されるセクション [%2d] '%s' の"
"st_value 不足\n"
-#: src/elflint.c:902
+#: src/elflint.c:922
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: local symbol outside range described in "
@@ -1707,7 +1852,7 @@
"セクション [%2d] '%s': シンボル %zu: sh_info に記述された範囲外のローカルシン"
"ボル\n"
-#: src/elflint.c:909
+#: src/elflint.c:929
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: non-local symbol outside range described in "
@@ -1716,12 +1861,12 @@
"セクション [%2d] '%s': シンボル %zu: sh_info に記述された範囲外の非ローカルシ"
"ンボル\n"
-#: src/elflint.c:916
+#: src/elflint.c:936
#, c-format
msgid "section [%2d] '%s': symbol %zu: non-local section symbol\n"
msgstr "セクション [%2d] '%s': シンボル %zu: 非ローカルセクションシンボル\n"
-#: src/elflint.c:966
+#: src/elflint.c:986
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to bad section "
@@ -1730,7 +1875,7 @@
"セクション [%2d] '%s': _GLOBAL_OFFSET_TABLE_ シンボルが間違ったセクション "
"[%2d] を参照しています\n"
-#: src/elflint.c:973
+#: src/elflint.c:993
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to section [%2d] "
@@ -1739,7 +1884,10 @@
"セクション [%2d] '%s': _GLOBAL_OFFSET_TABLE_ シンボルはセクション [%2d] '%s' "
"を参照しています\n"
-#: src/elflint.c:989
+#. This test is more strict than the psABIs which
+#. usually allow the symbol to be in the middle of
+#. the .got section, allowing negative offsets.
+#: src/elflint.c:1009
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol value %#<PRIx64> does not "
@@ -1748,7 +1896,7 @@
"セクション [%2d] '%s': _GLOBAL_OFFSET_TABLE_ シンボル値 %#<PRIx64> は %s のセ"
"クションアドレス %#<PRIx64> と一致しません\n"
-#: src/elflint.c:996
+#: src/elflint.c:1016
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol size %<PRIu64> does not "
@@ -1757,7 +1905,7 @@
"セクション [%2d] '%s': _GLOBAL_OFFSET_TABLE_ シンボルサイズ %<PRIu64> は %s "
"のセクションサイズ %<PRIu64> と一致しません\n"
-#: src/elflint.c:1004
+#: src/elflint.c:1024
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol present, but no .got "
@@ -1766,7 +1914,7 @@
"セクション [%2d] '%s': _GLOBAL_OFFSET_TABLE_ シンボルはありますが、.got セク"
"ションがありません\n"
-#: src/elflint.c:1020
+#: src/elflint.c:1040
#, c-format
msgid ""
"section [%2d] '%s': _DYNAMIC_ symbol value %#<PRIx64> does not match dynamic "
@@ -1775,7 +1923,7 @@
"セクション [%2d] '%s': _DYNAMIC_ シンボル値 %#<PRIx64> は動的セグメントアドレ"
"ス %#<PRIx64> と一致しません\n"
-#: src/elflint.c:1027
+#: src/elflint.c:1047
#, c-format
msgid ""
"section [%2d] '%s': _DYNAMIC symbol size %<PRIu64> does not match dynamic "
@@ -1784,7 +1932,7 @@
"セクション [%2d] '%s': _DYNAMIC シンボルサイズ %<PRIu64> は動的セグメントサイ"
"ズ %<PRIu64> と一致しません\n"
-#: src/elflint.c:1040
+#: src/elflint.c:1060
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: symbol in dynamic symbol table with non-"
@@ -1793,29 +1941,29 @@
"セクション [%2d] '%s': シンボル %zu: 省略以外の可視性を持った動的シンボルテー"
"ブル中のシンボル\n"
-#: src/elflint.c:1044
+#: src/elflint.c:1064
#, c-format
msgid "section [%2d] '%s': symbol %zu: unknown bit set in st_other\n"
msgstr ""
"セクション [%2d] '%s': シンボル %zu: st_other 中に設定された不明なビット\n"
-#: src/elflint.c:1082
+#: src/elflint.c:1102
#, fuzzy, c-format
msgid "section [%2d] '%s': cannot get section data.\n"
msgstr "セクション [%2d] '%s': セクションデータを得られません\n"
-#: src/elflint.c:1098
+#: src/elflint.c:1118
#, c-format
msgid "section [%2d] '%s': DT_RELCOUNT used for this RELA section\n"
msgstr "セクション [%2d] '%s': この RELA セクション用に使われる DT_RELCOUNT\n"
-#: src/elflint.c:1109 src/elflint.c:1162
+#: src/elflint.c:1129 src/elflint.c:1182
#, c-format
msgid "section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"
msgstr ""
"セクション [%2d] '%s': このセクション用には高すぎる DT_RELCOUNT 値 %d\n"
-#: src/elflint.c:1134 src/elflint.c:1187
+#: src/elflint.c:1154 src/elflint.c:1207
#, c-format
msgid ""
"section [%2d] '%s': relative relocations after index %d as specified by "
@@ -1824,7 +1972,7 @@
"セクション [%2d] '%s': UT_RELOCOUNT で指定されたインデックス %d 後の相対リロ"
"ケーション\n"
-#: src/elflint.c:1140 src/elflint.c:1193
+#: src/elflint.c:1160 src/elflint.c:1213
#, c-format
msgid ""
"section [%2d] '%s': non-relative relocation at index %zu; DT_RELCOUNT "
@@ -1833,52 +1981,52 @@
"セクション [%2d] '%s': インデックス %zu での非相対リロケーション; %d 相対リ"
"ロケーションで指定された DT_RELCOUNT\n"
-#: src/elflint.c:1152
+#: src/elflint.c:1172
#, c-format
msgid "section [%2d] '%s': DT_RELACOUNT used for this REL section\n"
msgstr "セクション [%2d] '%s': この REL セクション用に使われる DT_RELACOUNT\n"
-#: src/elflint.c:1235
+#: src/elflint.c:1255
#, c-format
msgid "section [%2d] '%s': invalid destination section index\n"
msgstr "セクション [%2d] '%s': 不当な宛先セクションインデックス\n"
-#: src/elflint.c:1247
+#: src/elflint.c:1267
#, c-format
msgid "section [%2d] '%s': invalid destination section type\n"
msgstr "セクション [%2d] '%s': 不当な宛先セクションタイプ\n"
-#: src/elflint.c:1255
+#: src/elflint.c:1275
#, c-format
msgid "section [%2d] '%s': sh_info should be zero\n"
msgstr "セクション [%2d] '%s': sh_info はゼロでなければなりません\n"
-#: src/elflint.c:1263
+#: src/elflint.c:1283
#, fuzzy, c-format
msgid ""
"section [%2d] '%s': no relocations for merge-able string sections possible\n"
msgstr ""
"セクション [%2d] '%s': マージできるセクションのリロケーションは不可能です\n"
-#: src/elflint.c:1271
+#: src/elflint.c:1291
#, c-format
msgid "section [%2d] '%s': section entry size does not match ElfXX_Rela\n"
msgstr ""
"セクション [%2d] '%s': セクション項目サイズが ElfXX_Rela と一致しません\n"
-#: src/elflint.c:1331
+#: src/elflint.c:1351
#, c-format
msgid "text relocation flag set but there is no read-only segment\n"
msgstr ""
"テキストリロケーションフラグが設定されていますが、読込み専用セグメントがあり"
"ません\n"
-#: src/elflint.c:1358
+#: src/elflint.c:1378
#, c-format
msgid "section [%2d] '%s': relocation %zu: invalid type\n"
msgstr "セクション [%2d] '%s': リロケーション %zu: 不当なタイプ\n"
-#: src/elflint.c:1366
+#: src/elflint.c:1386
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: relocation type invalid for the file "
@@ -1887,13 +2035,13 @@
"セクション [%2d] '%s': リロケーション %zu: このファイル用のリロケーションタイ"
"プは不当です\n"
-#: src/elflint.c:1374
+#: src/elflint.c:1394
#, c-format
msgid "section [%2d] '%s': relocation %zu: invalid symbol index\n"
msgstr ""
"セクション [%2d] '%s': リロケーション %zu: 不当なシンボルインデックス\n"
-#: src/elflint.c:1392
+#: src/elflint.c:1412
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: only symbol '_GLOBAL_OFFSET_TABLE_' can "
@@ -1902,12 +2050,12 @@
"セクション [%2d] '%s': リロケーション %zu: シンボル '_GLOBAL_OFFSET_TABLE_' "
"のみが %s と一緒に使用できます\n"
-#: src/elflint.c:1409
+#: src/elflint.c:1429
#, c-format
msgid "section [%2d] '%s': relocation %zu: offset out of bounds\n"
msgstr "セクション [%2d] '%s': リロケーション %zu: オフセット境界外\n"
-#: src/elflint.c:1424
+#: src/elflint.c:1444
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: copy relocation against symbol of type "
@@ -1916,7 +2064,7 @@
"セクション [%2d] '%s': リロケーション %zu: タイプ %s のシンボルに対するコピー"
"リロケーション\n"
-#: src/elflint.c:1445
+#: src/elflint.c:1465
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: read-only section modified but text "
@@ -1925,24 +2073,24 @@
"セクション [%2d] '%s': リロケーション %zu: 読込み専用セクションが変更されまし"
"たが、テキストリロケーションフラグが設定されていません\n"
-#: src/elflint.c:1460
+#: src/elflint.c:1480
#, c-format
msgid "section [%2d] '%s': relocations are against loaded and unloaded data\n"
msgstr ""
"セクション [%2d] '%s': リロケーションがロードされたデータとロードされなかった"
"データに対してです\n"
-#: src/elflint.c:1500 src/elflint.c:1551
+#: src/elflint.c:1520 src/elflint.c:1571
#, c-format
msgid "section [%2d] '%s': cannot get relocation %zu: %s\n"
msgstr ""
-#: src/elflint.c:1627
+#: src/elflint.c:1647
#, c-format
msgid "more than one dynamic section present\n"
msgstr ""
-#: src/elflint.c:1645
+#: src/elflint.c:1665
#, fuzzy, c-format
msgid ""
"section [%2d]: referenced as string table for section [%2d] '%s' but section "
@@ -1951,427 +2099,427 @@
"セクション [%2d] '%s': セクション [%2d] '%s' 用の文字列テーブルとして参照され"
"ていますが、タイプが SHT_STRTAB ではありません\n"
-#: src/elflint.c:1653
+#: src/elflint.c:1673
#, c-format
msgid "section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"
msgstr ""
-#: src/elflint.c:1658 src/elflint.c:1947
+#: src/elflint.c:1678 src/elflint.c:1967
#, c-format
msgid "section [%2d] '%s': sh_info not zero\n"
msgstr ""
-#: src/elflint.c:1668
+#: src/elflint.c:1688
#, c-format
msgid "section [%2d] '%s': cannot get dynamic section entry %zu: %s\n"
msgstr ""
-#: src/elflint.c:1676
+#: src/elflint.c:1696
#, c-format
msgid "section [%2d] '%s': non-DT_NULL entries follow DT_NULL entry\n"
msgstr ""
-#: src/elflint.c:1683
+#: src/elflint.c:1703
#, c-format
msgid "section [%2d] '%s': entry %zu: unknown tag\n"
msgstr ""
-#: src/elflint.c:1694
+#: src/elflint.c:1714
#, c-format
msgid "section [%2d] '%s': entry %zu: more than one entry with tag %s\n"
msgstr ""
-#: src/elflint.c:1704
+#: src/elflint.c:1724
#, c-format
msgid "section [%2d] '%s': entry %zu: level 2 tag %s used\n"
msgstr ""
-#: src/elflint.c:1722
+#: src/elflint.c:1742
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: DT_PLTREL value must be DT_REL or DT_RELA\n"
msgstr ""
-#: src/elflint.c:1735
+#: src/elflint.c:1755
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: pointer does not match address of section "
"[%2d] '%s' referenced by sh_link\n"
msgstr ""
-#: src/elflint.c:1778
+#: src/elflint.c:1798
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: %s value must point into loaded segment\n"
msgstr ""
-#: src/elflint.c:1793
+#: src/elflint.c:1813
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: %s value must be valid offset in section "
"[%2d] '%s'\n"
msgstr ""
-#: src/elflint.c:1813 src/elflint.c:1841
+#: src/elflint.c:1833 src/elflint.c:1861
#, c-format
msgid "section [%2d] '%s': contains %s entry but not %s\n"
msgstr ""
-#: src/elflint.c:1825
+#: src/elflint.c:1845
#, c-format
msgid "section [%2d] '%s': mandatory tag %s not present\n"
msgstr ""
-#: src/elflint.c:1834
+#: src/elflint.c:1854
#, c-format
msgid "section [%2d] '%s': no hash section present\n"
msgstr ""
-#: src/elflint.c:1849 src/elflint.c:1856
+#: src/elflint.c:1869 src/elflint.c:1876
#, c-format
msgid "section [%2d] '%s': not all of %s, %s, and %s are present\n"
msgstr ""
-#: src/elflint.c:1866 src/elflint.c:1870
+#: src/elflint.c:1886 src/elflint.c:1890
#, c-format
msgid "section [%2d] '%s': %s tag missing in DSO marked during prelinking\n"
msgstr ""
-#: src/elflint.c:1876
+#: src/elflint.c:1896
#, c-format
msgid "section [%2d] '%s': non-DSO file marked as dependency during prelink\n"
msgstr ""
-#: src/elflint.c:1887 src/elflint.c:1891 src/elflint.c:1895 src/elflint.c:1899
+#: src/elflint.c:1907 src/elflint.c:1911 src/elflint.c:1915 src/elflint.c:1919
#, c-format
msgid "section [%2d] '%s': %s tag missing in prelinked executable\n"
msgstr ""
-#: src/elflint.c:1911
+#: src/elflint.c:1931
#, c-format
msgid ""
"section [%2d] '%s': only relocatable files can have extended section index\n"
msgstr ""
-#: src/elflint.c:1921
+#: src/elflint.c:1941
#, c-format
msgid ""
"section [%2d] '%s': extended section index section not for symbol table\n"
msgstr ""
-#: src/elflint.c:1925
+#: src/elflint.c:1945
#, fuzzy, c-format
msgid "section [%2d] '%s': sh_link extended section index [%2d] is invalid\n"
msgstr "セクション [%2d] '%s': 不当な宛先セクションインデックス\n"
-#: src/elflint.c:1930
+#: src/elflint.c:1950
#, c-format
msgid "cannot get data for symbol section\n"
msgstr ""
-#: src/elflint.c:1933
+#: src/elflint.c:1953
#, c-format
msgid "section [%2d] '%s': entry size does not match Elf32_Word\n"
msgstr ""
-#: src/elflint.c:1942
+#: src/elflint.c:1962
#, c-format
msgid "section [%2d] '%s': extended index table too small for symbol table\n"
msgstr ""
-#: src/elflint.c:1957
+#: src/elflint.c:1977
#, c-format
msgid ""
"section [%2d] '%s': extended section index in section [%2zu] '%s' refers to "
"same symbol table\n"
msgstr ""
-#: src/elflint.c:1974
+#: src/elflint.c:1995
#, c-format
msgid "symbol 0 should have zero extended section index\n"
msgstr ""
-#: src/elflint.c:1986
+#: src/elflint.c:2007
#, c-format
msgid "cannot get data for symbol %zu\n"
msgstr ""
-#: src/elflint.c:1991
+#: src/elflint.c:2012
#, c-format
msgid "extended section index is %<PRIu32> but symbol index is not XINDEX\n"
msgstr ""
-#: src/elflint.c:2007 src/elflint.c:2058
+#: src/elflint.c:2029 src/elflint.c:2083
#, c-format
msgid ""
"section [%2d] '%s': hash table section is too small (is %ld, expected %ld)\n"
msgstr ""
-#: src/elflint.c:2019 src/elflint.c:2070
+#: src/elflint.c:2043 src/elflint.c:2097
#, c-format
msgid "section [%2d] '%s': chain array too large\n"
msgstr ""
-#: src/elflint.c:2033 src/elflint.c:2084
+#: src/elflint.c:2057 src/elflint.c:2111
#, c-format
msgid "section [%2d] '%s': hash bucket reference %zu out of bounds\n"
msgstr ""
-#: src/elflint.c:2043
+#: src/elflint.c:2067
#, c-format
msgid "section [%2d] '%s': hash chain reference %zu out of bounds\n"
msgstr ""
-#: src/elflint.c:2094
+#: src/elflint.c:2121
#, c-format
msgid "section [%2d] '%s': hash chain reference %<PRIu64> out of bounds\n"
msgstr ""
-#: src/elflint.c:2107
+#: src/elflint.c:2134
#, fuzzy, c-format
msgid "section [%2d] '%s': not enough data\n"
msgstr "セクション [%2d] '%s': セクションデータを得られません\n"
-#: src/elflint.c:2119
+#: src/elflint.c:2146
#, fuzzy, c-format
msgid "section [%2d] '%s': bitmask size zero or not power of 2: %u\n"
msgstr "セクション [%2d] '%s': 0番目の項目にある '%s' ゼロではありません\n"
-#: src/elflint.c:2135
+#: src/elflint.c:2162
#, c-format
msgid ""
"section [%2d] '%s': hash table section is too small (is %ld, expected at "
"least %ld)\n"
msgstr ""
-#: src/elflint.c:2144
+#: src/elflint.c:2171
#, c-format
msgid "section [%2d] '%s': 2nd hash function shift too big: %u\n"
msgstr ""
-#: src/elflint.c:2178
+#: src/elflint.c:2205
#, c-format
msgid ""
"section [%2d] '%s': hash chain for bucket %zu lower than symbol index bias\n"
msgstr ""
-#: src/elflint.c:2199
+#: src/elflint.c:2226
#, c-format
msgid ""
"section [%2d] '%s': symbol %u referenced in chain for bucket %zu is "
"undefined\n"
msgstr ""
-#: src/elflint.c:2212
+#: src/elflint.c:2239
#, c-format
msgid ""
"section [%2d] '%s': hash value for symbol %u in chain for bucket %zu wrong\n"
msgstr ""
-#: src/elflint.c:2221
+#: src/elflint.c:2248
#, fuzzy, c-format
msgid ""
"section [%2d] '%s': mask index for symbol %u in chain for bucket %zu wrong\n"
msgstr "セクション [%2d] '%s': セクションデータを得られません\n"
-#: src/elflint.c:2251
+#: src/elflint.c:2278
#, c-format
msgid "section [%2d] '%s': hash chain for bucket %zu out of bounds\n"
msgstr ""
-#: src/elflint.c:2256
+#: src/elflint.c:2283
#, c-format
msgid ""
"section [%2d] '%s': symbol reference in chain for bucket %zu out of bounds\n"
msgstr ""
-#: src/elflint.c:2262
+#: src/elflint.c:2289
#, c-format
msgid "section [%2d] '%s': bitmask does not match names in the hash table\n"
msgstr ""
-#: src/elflint.c:2275
+#: src/elflint.c:2302
#, c-format
msgid "section [%2d] '%s': relocatable files cannot have hash tables\n"
msgstr ""
-#: src/elflint.c:2293
+#: src/elflint.c:2320
#, c-format
msgid "section [%2d] '%s': hash table not for dynamic symbol table\n"
msgstr ""
-#: src/elflint.c:2297
+#: src/elflint.c:2324
#, fuzzy, c-format
msgid "section [%2d] '%s': invalid sh_link symbol table section index [%2d]\n"
msgstr "セクション [%2d] '%s': 不当な宛先セクションインデックス\n"
-#: src/elflint.c:2305
+#: src/elflint.c:2334
#, c-format
msgid "section [%2d] '%s': hash table entry size incorrect\n"
msgstr ""
-#: src/elflint.c:2310
+#: src/elflint.c:2339
#, c-format
msgid "section [%2d] '%s': not marked to be allocated\n"
msgstr ""
-#: src/elflint.c:2315
+#: src/elflint.c:2344
#, c-format
msgid ""
"section [%2d] '%s': hash table has not even room for initial administrative "
"entries\n"
msgstr ""
-#: src/elflint.c:2364
+#: src/elflint.c:2393
#, c-format
msgid "sh_link in hash sections [%2zu] '%s' and [%2zu] '%s' not identical\n"
msgstr ""
-#: src/elflint.c:2388 src/elflint.c:2453 src/elflint.c:2488
+#: src/elflint.c:2417 src/elflint.c:2482 src/elflint.c:2517
#, fuzzy, c-format
msgid "hash section [%2zu] '%s' does not contain enough data\n"
msgstr "セクション [%2d] '%s': セクションデータを得られません\n"
-#: src/elflint.c:2409
+#: src/elflint.c:2438
#, fuzzy, c-format
msgid "hash section [%2zu] '%s' has zero bit mask words\n"
msgstr ""
"\n"
"セクション [%Zu] '%s' にはダンプすべきデータがありません。\n"
-#: src/elflint.c:2420 src/elflint.c:2464 src/elflint.c:2501
+#: src/elflint.c:2449 src/elflint.c:2493 src/elflint.c:2530
#, fuzzy, c-format
msgid "hash section [%2zu] '%s' uses too much data\n"
msgstr "セクション [%2d] '%s': セクションデータを得られません\n"
-#: src/elflint.c:2435
+#: src/elflint.c:2464
#, c-format
msgid ""
"hash section [%2zu] '%s' invalid symbol index %<PRIu32> (max_nsyms: "
"%<PRIu32>, nentries: %<PRIu32>\n"
msgstr ""
-#: src/elflint.c:2522
+#: src/elflint.c:2551
#, fuzzy, c-format
msgid "hash section [%2zu] '%s' invalid sh_entsize\n"
msgstr "セクション [%2d] '%s': 不当な宛先セクションタイプ\n"
-#: src/elflint.c:2532 src/elflint.c:2536
+#: src/elflint.c:2561 src/elflint.c:2565
#, c-format
msgid "section [%2zu] '%s': reference to symbol index 0\n"
msgstr ""
-#: src/elflint.c:2543
+#: src/elflint.c:2572
#, c-format
msgid ""
"symbol %d referenced in new hash table in [%2zu] '%s' but not in old hash "
"table in [%2zu] '%s'\n"
msgstr ""
-#: src/elflint.c:2555
+#: src/elflint.c:2584
#, c-format
msgid ""
"symbol %d referenced in old hash table in [%2zu] '%s' but not in new hash "
"table in [%2zu] '%s'\n"
msgstr ""
-#: src/elflint.c:2571
+#: src/elflint.c:2600
#, c-format
msgid "section [%2d] '%s': nonzero sh_%s for NULL section\n"
msgstr ""
-#: src/elflint.c:2591
+#: src/elflint.c:2620
#, c-format
msgid ""
"section [%2d] '%s': section groups only allowed in relocatable object files\n"
msgstr ""
-#: src/elflint.c:2602
+#: src/elflint.c:2631
#, c-format
msgid "section [%2d] '%s': cannot get symbol table: %s\n"
msgstr ""
-#: src/elflint.c:2607
+#: src/elflint.c:2636
#, c-format
msgid "section [%2d] '%s': section reference in sh_link is no symbol table\n"
msgstr ""
-#: src/elflint.c:2613
+#: src/elflint.c:2642
#, c-format
msgid "section [%2d] '%s': invalid symbol index in sh_info\n"
msgstr ""
-#: src/elflint.c:2618
+#: src/elflint.c:2647
#, c-format
msgid "section [%2d] '%s': sh_flags not zero\n"
msgstr ""
-#: src/elflint.c:2625
+#: src/elflint.c:2654
#, c-format
msgid "section [%2d] '%s': cannot get symbol for signature\n"
msgstr ""
-#: src/elflint.c:2629
+#: src/elflint.c:2658
#, fuzzy, c-format
msgid "section [%2d] '%s': cannot get symbol name for signature\n"
msgstr "セクション [%2d] '%s': シンボル %d を得られません: %s\n"
-#: src/elflint.c:2634
+#: src/elflint.c:2663
#, fuzzy, c-format
msgid "section [%2d] '%s': signature symbol cannot be empty string\n"
msgstr "セクション [%2d] '%s': セクションデータを得られません\n"
-#: src/elflint.c:2640
+#: src/elflint.c:2669
#, c-format
msgid "section [%2d] '%s': sh_flags not set correctly\n"
msgstr ""
-#: src/elflint.c:2646
+#: src/elflint.c:2675
#, c-format
msgid "section [%2d] '%s': cannot get data: %s\n"
msgstr ""
-#: src/elflint.c:2655
+#: src/elflint.c:2684
#, c-format
msgid "section [%2d] '%s': section size not multiple of sizeof(Elf32_Word)\n"
msgstr ""
-#: src/elflint.c:2660
+#: src/elflint.c:2690
#, c-format
msgid "section [%2d] '%s': section group without flags word\n"
msgstr ""
-#: src/elflint.c:2666
+#: src/elflint.c:2698
#, c-format
msgid "section [%2d] '%s': section group without member\n"
msgstr ""
-#: src/elflint.c:2670
+#: src/elflint.c:2702
#, c-format
msgid "section [%2d] '%s': section group with only one member\n"
msgstr ""
-#: src/elflint.c:2681
+#: src/elflint.c:2713
#, c-format
msgid "section [%2d] '%s': unknown section group flags\n"
msgstr ""
-#: src/elflint.c:2693
+#: src/elflint.c:2725
#, fuzzy, c-format
msgid "section [%2d] '%s': section index %zu out of range\n"
msgstr "セクション [%2d] '%s': リロケーション %zu: オフセット境界外\n"
-#: src/elflint.c:2702
+#: src/elflint.c:2734
#, c-format
msgid "section [%2d] '%s': cannot get section header for element %zu: %s\n"
msgstr ""
-#: src/elflint.c:2709
+#: src/elflint.c:2741
#, c-format
msgid "section [%2d] '%s': section group contains another group [%2d] '%s'\n"
msgstr ""
-#: src/elflint.c:2715
+#: src/elflint.c:2747
#, fuzzy, c-format
msgid ""
"section [%2d] '%s': element %zu references section [%2d] '%s' without "
@@ -2380,1618 +2528,907 @@
"セクション [%2d] '%s': シンボル %zu: 参照されるセクション [%2d] '%s' は "
"SHF_TLS フラグが設定されていません\n"
-#: src/elflint.c:2722
+#: src/elflint.c:2754
#, c-format
msgid "section [%2d] '%s' is contained in more than one section group\n"
msgstr ""
-#: src/elflint.c:2912
+#: src/elflint.c:2944
#, c-format
msgid ""
"section [%2d] '%s' refers in sh_link to section [%2d] '%s' which is no "
"dynamic symbol table\n"
msgstr ""
-#: src/elflint.c:2924
+#: src/elflint.c:2956
#, c-format
msgid ""
"section [%2d] '%s' has different number of entries than symbol table [%2d] "
"'%s'\n"
msgstr ""
-#: src/elflint.c:2940
+#: src/elflint.c:2972
#, c-format
msgid "section [%2d] '%s': symbol %d: cannot read version data\n"
msgstr ""
-#: src/elflint.c:2956
+#: src/elflint.c:2988
#, c-format
msgid "section [%2d] '%s': symbol %d: local symbol with global scope\n"
msgstr ""
-#: src/elflint.c:2964
+#: src/elflint.c:2996
#, c-format
msgid "section [%2d] '%s': symbol %d: local symbol with version\n"
msgstr ""
-#: src/elflint.c:2978
+#: src/elflint.c:3010
#, c-format
msgid "section [%2d] '%s': symbol %d: invalid version index %d\n"
msgstr ""
-#: src/elflint.c:2983
+#: src/elflint.c:3015
#, c-format
msgid ""
"section [%2d] '%s': symbol %d: version index %d is for defined version\n"
msgstr ""
-#: src/elflint.c:2993
+#: src/elflint.c:3025
#, c-format
msgid ""
"section [%2d] '%s': symbol %d: version index %d is for requested version\n"
msgstr ""
-#: src/elflint.c:3046
+#: src/elflint.c:3078
#, c-format
msgid "more than one version reference section present\n"
msgstr ""
-#: src/elflint.c:3054 src/elflint.c:3201
+#: src/elflint.c:3086 src/elflint.c:3233
#, c-format
msgid "section [%2d] '%s': sh_link does not link to string table\n"
msgstr ""
-#: src/elflint.c:3079 src/elflint.c:3255
+#: src/elflint.c:3111 src/elflint.c:3287
#, c-format
msgid "section [%2d] '%s': entry %d has wrong version %d\n"
msgstr ""
-#: src/elflint.c:3086 src/elflint.c:3262
+#: src/elflint.c:3118 src/elflint.c:3294
#, c-format
msgid "section [%2d] '%s': entry %d has wrong offset of auxiliary data\n"
msgstr ""
-#: src/elflint.c:3096
+#: src/elflint.c:3128
#, c-format
msgid "section [%2d] '%s': entry %d has invalid file reference\n"
msgstr ""
-#: src/elflint.c:3104
+#: src/elflint.c:3136
#, c-format
msgid "section [%2d] '%s': entry %d references unknown dependency\n"
msgstr ""
-#: src/elflint.c:3116
+#: src/elflint.c:3148
#, c-format
msgid "section [%2d] '%s': auxiliary entry %d of entry %d has unknown flag\n"
msgstr ""
-#: src/elflint.c:3124
+#: src/elflint.c:3156
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has invalid name "
"reference\n"
msgstr ""
-#: src/elflint.c:3133
+#: src/elflint.c:3165
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has wrong hash value: "
"%#x, expected %#x\n"
msgstr ""
-#: src/elflint.c:3142
+#: src/elflint.c:3174
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has duplicate version "
"name '%s'\n"
msgstr ""
-#: src/elflint.c:3153
+#: src/elflint.c:3185
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has wrong next field\n"
msgstr ""
-#: src/elflint.c:3170 src/elflint.c:3346
+#: src/elflint.c:3202 src/elflint.c:3378
#, c-format
msgid "section [%2d] '%s': entry %d has invalid offset to next entry\n"
msgstr ""
-#: src/elflint.c:3178 src/elflint.c:3354
+#: src/elflint.c:3210 src/elflint.c:3386
#, c-format
msgid ""
"section [%2d] '%s': entry %d has zero offset to next entry, but sh_info says "
"there are more entries\n"
msgstr ""
-#: src/elflint.c:3193
+#: src/elflint.c:3225
#, c-format
msgid "more than one version definition section present\n"
msgstr ""
-#: src/elflint.c:3240
+#: src/elflint.c:3272
#, c-format
msgid "section [%2d] '%s': more than one BASE definition\n"
msgstr ""
-#: src/elflint.c:3244
+#: src/elflint.c:3276
#, c-format
msgid "section [%2d] '%s': BASE definition must have index VER_NDX_GLOBAL\n"
msgstr ""
-#: src/elflint.c:3250
+#: src/elflint.c:3282
#, c-format
msgid "section [%2d] '%s': entry %d has unknown flag\n"
msgstr ""
-#: src/elflint.c:3277
+#: src/elflint.c:3309
#, c-format
msgid "section [%2d] '%s': entry %d has invalid name reference\n"
msgstr ""
-#: src/elflint.c:3284
+#: src/elflint.c:3316
#, c-format
msgid "section [%2d] '%s': entry %d has wrong hash value: %#x, expected %#x\n"
msgstr ""
-#: src/elflint.c:3292
+#: src/elflint.c:3324
#, c-format
msgid "section [%2d] '%s': entry %d has duplicate version name '%s'\n"
msgstr ""
-#: src/elflint.c:3312
+#: src/elflint.c:3344
#, c-format
msgid ""
"section [%2d] '%s': entry %d has invalid name reference in auxiliary data\n"
msgstr ""
-#: src/elflint.c:3329
+#: src/elflint.c:3361
#, c-format
msgid "section [%2d] '%s': entry %d has wrong next field in auxiliary data\n"
msgstr ""
-#: src/elflint.c:3362
+#: src/elflint.c:3394
#, c-format
msgid "section [%2d] '%s': no BASE definition\n"
msgstr ""
-#: src/elflint.c:3378
+#: src/elflint.c:3410
#, c-format
msgid "section [%2d] '%s': unknown parent version '%s'\n"
msgstr ""
-#: src/elflint.c:3391
+#: src/elflint.c:3423
#, c-format
msgid "section [%2d] '%s': empty object attributes section\n"
msgstr ""
-#: src/elflint.c:3412
+#: src/elflint.c:3444
#, c-format
msgid "section [%2d] '%s': unrecognized attribute format\n"
msgstr ""
-#: src/elflint.c:3428
+#: src/elflint.c:3460
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: zero length field in attribute section\n"
msgstr ""
-#: src/elflint.c:3437
+#: src/elflint.c:3469
#, c-format
msgid "section [%2d] '%s': offset %zu: invalid length in attribute section\n"
msgstr ""
-#: src/elflint.c:3449
+#: src/elflint.c:3481
#, c-format
msgid "section [%2d] '%s': offset %zu: unterminated vendor name string\n"
msgstr ""
-#: src/elflint.c:3466
+#: src/elflint.c:3498
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: endless ULEB128 in attribute subsection tag\n"
msgstr ""
-#: src/elflint.c:3475
+#: src/elflint.c:3507
#, c-format
msgid "section [%2d] '%s': offset %zu: truncated attribute section\n"
msgstr ""
-#: src/elflint.c:3484
+#: src/elflint.c:3516
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: zero length field in attribute subsection\n"
msgstr ""
-#: src/elflint.c:3499
+#: src/elflint.c:3531
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: invalid length in attribute subsection\n"
msgstr ""
-#: src/elflint.c:3510
+#. Tag_File
+#: src/elflint.c:3542
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: attribute subsection has unexpected tag %u\n"
msgstr ""
-#: src/elflint.c:3528
+#: src/elflint.c:3560
#, c-format
msgid "section [%2d] '%s': offset %zu: endless ULEB128 in attribute tag\n"
msgstr ""
-#: src/elflint.c:3539
+#: src/elflint.c:3571
#, c-format
msgid "section [%2d] '%s': offset %zu: unterminated string in attribute\n"
msgstr ""
-#: src/elflint.c:3552
+#: src/elflint.c:3584
#, c-format
msgid "section [%2d] '%s': offset %zu: unrecognized attribute tag %u\n"
msgstr ""
-#: src/elflint.c:3556
+#: src/elflint.c:3588
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: unrecognized %s attribute value %<PRIu64>\n"
msgstr ""
-#: src/elflint.c:3566
+#: src/elflint.c:3598
#, c-format
msgid "section [%2d] '%s': offset %zu: vendor '%s' unknown\n"
msgstr ""
-#: src/elflint.c:3572
+#: src/elflint.c:3604
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: extra bytes after last attribute section\n"
msgstr ""
-#: src/elflint.c:3661
+#: src/elflint.c:3693
#, c-format
msgid "cannot get section header of zeroth section\n"
msgstr ""
-#: src/elflint.c:3665
+#: src/elflint.c:3697
#, c-format
msgid "zeroth section has nonzero name\n"
msgstr ""
-#: src/elflint.c:3667
+#: src/elflint.c:3699
#, c-format
msgid "zeroth section has nonzero type\n"
msgstr ""
-#: src/elflint.c:3669
+#: src/elflint.c:3701
#, c-format
msgid "zeroth section has nonzero flags\n"
msgstr ""
-#: src/elflint.c:3671
+#: src/elflint.c:3703
#, c-format
msgid "zeroth section has nonzero address\n"
msgstr ""
-#: src/elflint.c:3673
+#: src/elflint.c:3705
#, c-format
msgid "zeroth section has nonzero offset\n"
msgstr ""
-#: src/elflint.c:3675
+#: src/elflint.c:3707
#, c-format
msgid "zeroth section has nonzero align value\n"
msgstr ""
-#: src/elflint.c:3677
+#: src/elflint.c:3709
#, c-format
msgid "zeroth section has nonzero entry size value\n"
msgstr ""
-#: src/elflint.c:3680
+#: src/elflint.c:3712
#, c-format
msgid ""
"zeroth section has nonzero size value while ELF header has nonzero shnum "
"value\n"
msgstr ""
-#: src/elflint.c:3684
+#: src/elflint.c:3716
#, c-format
msgid ""
"zeroth section has nonzero link value while ELF header does not signal "
"overflow in shstrndx\n"
msgstr ""
-#: src/elflint.c:3688
+#: src/elflint.c:3720
#, c-format
msgid ""
"zeroth section has nonzero link value while ELF header does not signal "
"overflow in phnum\n"
msgstr ""
-#: src/elflint.c:3706
+#: src/elflint.c:3738
#, c-format
msgid "cannot get section header for section [%2zu] '%s': %s\n"
msgstr ""
-#: src/elflint.c:3715
+#: src/elflint.c:3747
#, c-format
msgid "section [%2zu]: invalid name\n"
msgstr ""
-#: src/elflint.c:3742
+#: src/elflint.c:3774
#, c-format
msgid "section [%2d] '%s' has wrong type: expected %s, is %s\n"
msgstr ""
-#: src/elflint.c:3760
+#: src/elflint.c:3792
#, c-format
msgid "section [%2zu] '%s' has wrong flags: expected %s, is %s\n"
msgstr ""
-#: src/elflint.c:3778
+#: src/elflint.c:3810
#, c-format
msgid ""
"section [%2zu] '%s' has wrong flags: expected %s and possibly %s, is %s\n"
msgstr ""
-#: src/elflint.c:3796
+#: src/elflint.c:3828
#, c-format
msgid "section [%2zu] '%s' present in object file\n"
msgstr ""
-#: src/elflint.c:3802 src/elflint.c:3834
+#: src/elflint.c:3834 src/elflint.c:3866
#, c-format
msgid ""
"section [%2zu] '%s' has SHF_ALLOC flag set but there is no loadable segment\n"
msgstr ""
-#: src/elflint.c:3807 src/elflint.c:3839
+#: src/elflint.c:3839 src/elflint.c:3871
#, c-format
msgid ""
"section [%2zu] '%s' has SHF_ALLOC flag not set but there are loadable "
"segments\n"
msgstr ""
-#: src/elflint.c:3815
+#: src/elflint.c:3847
#, c-format
msgid ""
"section [%2zu] '%s' is extension section index table in non-object file\n"
msgstr ""
-#: src/elflint.c:3858
+#: src/elflint.c:3890
#, c-format
msgid "section [%2zu] '%s': size not multiple of entry size\n"
msgstr ""
-#: src/elflint.c:3863
+#: src/elflint.c:3895
#, c-format
msgid "cannot get section header\n"
msgstr ""
-#: src/elflint.c:3873
+#: src/elflint.c:3905
#, c-format
msgid "section [%2zu] '%s' has unsupported type %d\n"
msgstr ""
-#: src/elflint.c:3888
+#: src/elflint.c:3920
#, c-format
msgid ""
"section [%2zu] '%s' contains invalid processor-specific flag(s) %#<PRIx64>\n"
msgstr ""
-#: src/elflint.c:3895
+#: src/elflint.c:3927
#, c-format
msgid "section [%2zu] '%s' contains unknown flag(s) %#<PRIx64>\n"
msgstr ""
-#: src/elflint.c:3903
+#: src/elflint.c:3935
#, c-format
msgid "section [%2zu] '%s': thread-local data sections address not zero\n"
msgstr ""
-#: src/elflint.c:3913
+#: src/elflint.c:3945
#, fuzzy, c-format
msgid "section [%2zu] '%s': allocated section cannot be compressed\n"
msgstr "セクション [%2d] '%s': セクションデータを得られません\n"
-#: src/elflint.c:3918
+#: src/elflint.c:3950
#, fuzzy, c-format
msgid "section [%2zu] '%s': nobits section cannot be compressed\n"
msgstr "セクション [%2d] '%s': セクションデータを得られません\n"
-#: src/elflint.c:3924
+#: src/elflint.c:3956
#, c-format
msgid ""
"section [%2zu] '%s': compressed section with no compression header: %s\n"
msgstr ""
-#: src/elflint.c:3930
+#: src/elflint.c:3962
#, c-format
msgid "section [%2zu] '%s': invalid section reference in link value\n"
msgstr ""
-#: src/elflint.c:3935
+#: src/elflint.c:3967
#, c-format
msgid "section [%2zu] '%s': invalid section reference in info value\n"
msgstr ""
-#: src/elflint.c:3942
+#: src/elflint.c:3974
#, c-format
msgid "section [%2zu] '%s': strings flag set without merge flag\n"
msgstr ""
-#: src/elflint.c:3947
+#: src/elflint.c:3979
#, c-format
msgid "section [%2zu] '%s': merge flag set but entry size is zero\n"
msgstr ""
-#: src/elflint.c:3965
+#: src/elflint.c:3998
#, c-format
msgid "section [%2zu] '%s' has unexpected type %d for an executable section\n"
msgstr ""
-#: src/elflint.c:3974
+#: src/elflint.c:4007
#, c-format
msgid "section [%2zu] '%s' must be of type NOBITS in debuginfo files\n"
msgstr ""
-#: src/elflint.c:3981
+#: src/elflint.c:4014
#, c-format
msgid "section [%2zu] '%s' is both executable and writable\n"
msgstr ""
-#: src/elflint.c:4012
+#: src/elflint.c:4045
#, c-format
msgid ""
"section [%2zu] '%s' not fully contained in segment of program header entry "
"%d\n"
msgstr ""
-#: src/elflint.c:4022
+#: src/elflint.c:4055
#, c-format
msgid ""
"section [%2zu] '%s' has type NOBITS but is read from the file in segment of "
"program header entry %d\n"
msgstr ""
-#: src/elflint.c:4048
+#: src/elflint.c:4081
#, c-format
msgid ""
"section [%2zu] '%s' has type NOBITS but is read from the file in segment of "
"program header entry %d and file contents is non-zero\n"
msgstr ""
-#: src/elflint.c:4059
+#: src/elflint.c:4092
#, c-format
msgid ""
"section [%2zu] '%s' has not type NOBITS but is not read from the file in "
"segment of program header entry %d\n"
msgstr ""
-#: src/elflint.c:4070
+#: src/elflint.c:4103
#, c-format
msgid "section [%2zu] '%s' is executable in nonexecutable segment %d\n"
msgstr ""
-#: src/elflint.c:4080
+#: src/elflint.c:4113
#, c-format
msgid "section [%2zu] '%s' is writable in unwritable segment %d\n"
msgstr ""
-#: src/elflint.c:4090
+#: src/elflint.c:4123
#, c-format
msgid ""
"section [%2zu] '%s': alloc flag set but section not in any loaded segment\n"
msgstr ""
-#: src/elflint.c:4096
+#: src/elflint.c:4129
#, c-format
msgid ""
"section [%2zu] '%s': ELF header says this is the section header string table "
"but type is not SHT_TYPE\n"
msgstr ""
-#: src/elflint.c:4104
+#: src/elflint.c:4137
#, c-format
msgid ""
"section [%2zu] '%s': relocatable files cannot have dynamic symbol tables\n"
msgstr ""
-#: src/elflint.c:4155
+#: src/elflint.c:4188
#, c-format
msgid "more than one version symbol table present\n"
msgstr ""
-#: src/elflint.c:4178
+#: src/elflint.c:4211
#, c-format
msgid "INTERP program header entry but no .interp section\n"
msgstr ""
-#: src/elflint.c:4189
+#: src/elflint.c:4222
#, c-format
msgid ""
"loadable segment [%u] is executable but contains no executable sections\n"
msgstr ""
-#: src/elflint.c:4195
+#: src/elflint.c:4228
#, c-format
msgid "loadable segment [%u] is writable but contains no writable sections\n"
msgstr ""
-#: src/elflint.c:4206
+#: src/elflint.c:4239
#, c-format
msgid ""
"no .gnu.versym section present but .gnu.versym_d or .gnu.versym_r section "
"exist\n"
msgstr ""
-#: src/elflint.c:4219
+#: src/elflint.c:4252
#, c-format
msgid "duplicate version index %d\n"
msgstr ""
-#: src/elflint.c:4233
+#: src/elflint.c:4266
#, c-format
msgid ".gnu.versym section present without .gnu.versym_d or .gnu.versym_r\n"
msgstr ""
-#: src/elflint.c:4282
+#: src/elflint.c:4315
#, c-format
msgid "phdr[%d]: unknown core file note type %<PRIu32> at offset %<PRIu64>\n"
msgstr ""
-#: src/elflint.c:4286
+#: src/elflint.c:4319
#, c-format
msgid ""
"section [%2d] '%s': unknown core file note type %<PRIu32> at offset %zu\n"
msgstr ""
-#: src/elflint.c:4309
+#: src/elflint.c:4342
#, c-format
msgid "phdr[%d]: unknown object file note type %<PRIu32> at offset %zu\n"
msgstr ""
-#: src/elflint.c:4313
+#: src/elflint.c:4346
#, c-format
msgid ""
"section [%2d] '%s': unknown object file note type %<PRIu32> at offset %zu\n"
msgstr ""
-#: src/elflint.c:4330
+#: src/elflint.c:4363
#, c-format
msgid "phdr[%d]: no note entries defined for the type of file\n"
msgstr ""
-#: src/elflint.c:4349
+#: src/elflint.c:4382
#, c-format
msgid "phdr[%d]: cannot get content of note section: %s\n"
msgstr ""
-#: src/elflint.c:4352
+#: src/elflint.c:4385
#, c-format
msgid "phdr[%d]: extra %<PRIu64> bytes after last note\n"
msgstr ""
-#: src/elflint.c:4373
+#: src/elflint.c:4406
#, c-format
msgid "section [%2d] '%s': no note entries defined for the type of file\n"
msgstr ""
-#: src/elflint.c:4380
+#: src/elflint.c:4413
#, c-format
msgid "section [%2d] '%s': cannot get content of note section\n"
msgstr ""
-#: src/elflint.c:4383
+#: src/elflint.c:4416
#, c-format
msgid "section [%2d] '%s': extra %<PRIu64> bytes after last note\n"
msgstr ""
-#: src/elflint.c:4401
+#: src/elflint.c:4434
#, c-format
msgid ""
"only executables, shared objects, and core files can have program headers\n"
msgstr ""
-#: src/elflint.c:4416
+#: src/elflint.c:4449
#, c-format
msgid "cannot get program header entry %d: %s\n"
msgstr ""
-#: src/elflint.c:4425
+#: src/elflint.c:4458
#, c-format
msgid "program header entry %d: unknown program header entry type %#<PRIx64>\n"
msgstr ""
-#: src/elflint.c:4436
+#: src/elflint.c:4469
#, c-format
msgid "more than one INTERP entry in program header\n"
msgstr ""
-#: src/elflint.c:4444
+#: src/elflint.c:4477
#, c-format
msgid "more than one TLS entry in program header\n"
msgstr ""
-#: src/elflint.c:4451
+#: src/elflint.c:4484
#, c-format
msgid "static executable cannot have dynamic sections\n"
msgstr ""
-#: src/elflint.c:4465
+#: src/elflint.c:4498
#, c-format
msgid "dynamic section reference in program header has wrong offset\n"
msgstr ""
-#: src/elflint.c:4468
+#: src/elflint.c:4501
#, c-format
msgid "dynamic section size mismatch in program and section header\n"
msgstr ""
-#: src/elflint.c:4478
+#: src/elflint.c:4511
#, c-format
msgid "more than one GNU_RELRO entry in program header\n"
msgstr ""
-#: src/elflint.c:4499
+#: src/elflint.c:4532
#, c-format
msgid "loadable segment GNU_RELRO applies to is not writable\n"
msgstr ""
-#: src/elflint.c:4510
+#: src/elflint.c:4543
#, c-format
msgid "loadable segment [%u] flags do not match GNU_RELRO [%u] flags\n"
msgstr ""
-#: src/elflint.c:4517
+#: src/elflint.c:4550
#, c-format
msgid ""
"GNU_RELRO [%u] flags are not a subset of the loadable segment [%u] flags\n"
msgstr ""
-#: src/elflint.c:4526 src/elflint.c:4549
+#: src/elflint.c:4559 src/elflint.c:4582
#, c-format
msgid "%s segment not contained in a loaded segment\n"
msgstr ""
-#: src/elflint.c:4555
+#: src/elflint.c:4588
#, c-format
msgid "program header offset in ELF header and PHDR entry do not match"
msgstr ""
-#: src/elflint.c:4580
+#: src/elflint.c:4613
#, c-format
msgid "call frame search table reference in program header has wrong offset\n"
msgstr ""
-#: src/elflint.c:4583
+#: src/elflint.c:4616
#, c-format
msgid "call frame search table size mismatch in program and section header\n"
msgstr ""
-#: src/elflint.c:4596
+#: src/elflint.c:4629
#, c-format
msgid "PT_GNU_EH_FRAME present but no .eh_frame_hdr section\n"
msgstr ""
-#: src/elflint.c:4604
+#: src/elflint.c:4637
#, c-format
msgid "call frame search table must be allocated\n"
msgstr ""
-#: src/elflint.c:4607
+#: src/elflint.c:4640
#, c-format
msgid "section [%2zu] '%s' must be allocated\n"
msgstr ""
-#: src/elflint.c:4611
+#: src/elflint.c:4644
#, c-format
msgid "call frame search table must not be writable\n"
msgstr ""
-#: src/elflint.c:4614
+#: src/elflint.c:4647
#, c-format
msgid "section [%2zu] '%s' must not be writable\n"
msgstr ""
-#: src/elflint.c:4619
+#: src/elflint.c:4652
#, c-format
msgid "call frame search table must not be executable\n"
msgstr ""
-#: src/elflint.c:4622
+#: src/elflint.c:4655
#, c-format
msgid "section [%2zu] '%s' must not be executable\n"
msgstr ""
-#: src/elflint.c:4633
+#: src/elflint.c:4666
#, c-format
msgid "program header entry %d: file size greater than memory size\n"
msgstr ""
-#: src/elflint.c:4640
+#: src/elflint.c:4673
#, c-format
msgid "program header entry %d: alignment not a power of 2\n"
msgstr ""
-#: src/elflint.c:4643
+#: src/elflint.c:4676
#, c-format
msgid ""
"program header entry %d: file offset and virtual address not module of "
"alignment\n"
msgstr ""
-#: src/elflint.c:4656
+#: src/elflint.c:4689
#, c-format
msgid ""
"executable/DSO with .eh_frame_hdr section does not have a PT_GNU_EH_FRAME "
"program header entry"
msgstr ""
-#: src/elflint.c:4690
+#: src/elflint.c:4723
#, c-format
msgid "cannot read ELF header: %s\n"
msgstr ""
-#: src/elflint.c:4716
+#: src/elflint.c:4749
#, c-format
msgid "text relocation flag set but not needed\n"
msgstr ""
-#: src/findtextrel.c:62
+#: src/findtextrel.c:61
msgid "Input Selection:"
msgstr ""
-#: src/findtextrel.c:63
+#: src/findtextrel.c:62
msgid "Prepend PATH to all file names"
msgstr ""
-#: src/findtextrel.c:65
+#: src/findtextrel.c:64
msgid "Use PATH as root of debuginfo hierarchy"
msgstr ""
-#: src/findtextrel.c:72
+#. Short description of program.
+#: src/findtextrel.c:71
msgid "Locate source of text relocations in FILEs (a.out by default)."
msgstr ""
-#: src/findtextrel.c:76 src/nm.c:108 src/objdump.c:71 src/size.c:83
-#: src/strings.c:88 src/strip.c:95
+#. Strings for arguments in help texts.
+#: src/findtextrel.c:75 src/nm.c:109 src/objdump.c:72 src/size.c:81
+#: src/strings.c:88 src/strip.c:99
msgid "[FILE...]"
msgstr "[ふぁいる...]"
-#: src/findtextrel.c:238
+#: src/findtextrel.c:223
#, c-format
msgid "cannot get ELF header '%s': %s"
msgstr ""
-#: src/findtextrel.c:249
+#: src/findtextrel.c:234
#, c-format
msgid "'%s' is not a DSO or PIE"
msgstr ""
-#: src/findtextrel.c:269
+#: src/findtextrel.c:254
#, c-format
msgid "getting get section header of section %zu: %s"
msgstr ""
-#: src/findtextrel.c:292
+#: src/findtextrel.c:277
#, c-format
msgid "cannot read dynamic section: %s"
msgstr ""
-#: src/findtextrel.c:313
+#: src/findtextrel.c:298
#, c-format
msgid "no text relocations reported in '%s'"
msgstr ""
-#: src/findtextrel.c:325
+#: src/findtextrel.c:310
#, c-format
msgid "while reading ELF file"
msgstr ""
-#: src/findtextrel.c:329
+#: src/findtextrel.c:314
#, fuzzy, c-format
msgid "cannot get program header count: %s"
msgstr "プログラムヘッダーを得られません: %s"
-#: src/findtextrel.c:340 src/findtextrel.c:357
+#: src/findtextrel.c:325 src/findtextrel.c:342
#, fuzzy, c-format
msgid "cannot get program header index at offset %zd: %s"
msgstr "プログラムヘッダーを得られません: %s"
-#: src/findtextrel.c:421
+#: src/findtextrel.c:406
#, c-format
msgid "cannot get symbol table section %zu in '%s': %s"
msgstr ""
-#: src/findtextrel.c:441 src/findtextrel.c:464
+#: src/findtextrel.c:426 src/findtextrel.c:449
#, c-format
msgid "cannot get relocation at index %d in section %zu in '%s': %s"
msgstr ""
-#: src/findtextrel.c:530
+#: src/findtextrel.c:515
#, c-format
msgid "%s not compiled with -fpic/-fPIC\n"
msgstr ""
-#: src/findtextrel.c:583
+#: src/findtextrel.c:568
#, c-format
msgid ""
"the file containing the function '%s' is not compiled with -fpic/-fPIC\n"
msgstr ""
-#: src/findtextrel.c:590 src/findtextrel.c:610
+#: src/findtextrel.c:575 src/findtextrel.c:595
#, c-format
msgid ""
"the file containing the function '%s' might not be compiled with -fpic/-"
"fPIC\n"
msgstr ""
-#: src/findtextrel.c:598
+#: src/findtextrel.c:583
#, c-format
msgid ""
"either the file containing the function '%s' or the file containing the "
"function '%s' is not compiled with -fpic/-fPIC\n"
msgstr ""
-#: src/findtextrel.c:618
+#: src/findtextrel.c:603
#, c-format
msgid ""
"a relocation modifies memory at offset %llu in a write-protected segment\n"
msgstr ""
-#: src/i386_ld.c:202
-#, c-format
-msgid "cannot allocate PLT section: %s"
-msgstr "PLT セクションを割り当てられません: %s"
-
-#: src/i386_ld.c:224
-#, c-format
-msgid "cannot allocate PLTREL section: %s"
-msgstr "PLTREL セクションを割り当てられません: %s"
-
-#: src/i386_ld.c:245
-#, c-format
-msgid "cannot allocate GOT section: %s"
-msgstr "GOT セクションを割り当てられません: %s"
-
-#: src/i386_ld.c:266
-#, c-format
-msgid "cannot allocate GOTPLT section: %s"
-msgstr "GOTPLT セクションを割り当てられません: %s"
-
-#: src/i386_ld.c:653
-#, c-format
-msgid "initial-executable TLS relocation cannot be used "
-msgstr "最初に実行される TLS リロケーションが使用されません "
-
-#: src/ld.c:78
-msgid "Input File Control:"
-msgstr "入力ファイル制御:"
-
-#: src/ld.c:80
-msgid "Include whole archives in the output from now on."
-msgstr "今から出力中の全アーカイブを含める。"
-
-#: src/ld.c:82
-#, fuzzy
-msgid "Stop including the whole archives in the output."
-msgstr "出力中の全アーカイブを含めるのを止める。"
-
-#: src/ld.c:83 src/ld.c:97 src/ld.c:175
-msgid "FILE"
-msgstr "ふぁいる"
-
-#: src/ld.c:84
-msgid "Start a group."
-msgstr "グループの開始。"
-
-#: src/ld.c:85
-msgid "End a group."
-msgstr "グループの終了。"
-
-#: src/ld.c:86
-msgid "PATH"
-msgstr "パス"
-
-#: src/ld.c:87
-msgid "Add PATH to list of directories files are searched in."
-msgstr "ファイルが検索されるディレクトリーの一覧にPATHを追加する。"
-
-#: src/ld.c:89
-msgid "Only set DT_NEEDED for following dynamic libs if actually used"
-msgstr ""
-"実際に使用されるのなら以下のダイナミックライブラリーに DT_NEEDED を設定する"
-
-#: src/ld.c:91
-msgid "Always set DT_NEEDED for following dynamic libs"
-msgstr "以下のダイナミックライブラリーに常に DT_NEEDED を設定する"
-
-#: src/ld.c:93
-msgid "Ignore LD_LIBRARY_PATH environment variable."
-msgstr "LD_LIBRARY_PATH 環境変数を無視する。"
-
-#: src/ld.c:96
-msgid "Output File Control:"
-msgstr "出力ファイル制御:"
-
-#: src/ld.c:97
-msgid "Place output in FILE."
-msgstr "出力を ふぁいる に置く。"
-
-#: src/ld.c:100
-msgid "Object is marked to not use default search path at runtime."
-msgstr "オブジェクトは実行時に省略値の検索パスを使わないと記されています。"
-
-#: src/ld.c:102
-msgid "Same as --whole-archive."
-msgstr "--whole-archive と同じ。"
-
-#: src/ld.c:103
-msgid ""
-"Default rules of extracting from archive; weak references are not enough."
-msgstr ""
-"アーカイブから抽出する時の省略値の規則: 弱い参照では十分ではありません。"
-
-#: src/ld.c:107
-msgid "Weak references cause extraction from archive."
-msgstr "弱い参照はアーカイブから抽出します。"
-
-#: src/ld.c:109
-msgid "Allow multiple definitions; first is used."
-msgstr "複数の定義を認めます: 最初を使用します。"
-
-#: src/ld.c:111
-msgid "Disallow/allow undefined symbols in DSOs."
-msgstr "DSO 中の未定義のシンボルを認めない/認める。"
-
-#: src/ld.c:114
-msgid "Object requires immediate handling of $ORIGIN."
-msgstr "オブジェクトには %ORIGIN の直接ハンドルが必要です。"
-
-#: src/ld.c:116
-msgid "Relocation will not be processed lazily."
-msgstr "リロケーションは遅延処理されません。"
-
-#: src/ld.c:118
-msgid "Object cannot be unloaded at runtime."
-msgstr "オプションは実行時にはアンロードできません。"
-
-#: src/ld.c:120
-msgid "Mark object to be initialized first."
-msgstr "オブジェクトは最初に初期化されると記します。"
-
-#: src/ld.c:122
-msgid "Enable/disable lazy-loading flag for following dependencies."
-msgstr "以下の依存性のための遅延ロードを有効/無効にします。"
-
-#: src/ld.c:124
-msgid "Mark object as not loadable with 'dlopen'."
-msgstr "'dlopen' でロードできないと記します。"
-
-#: src/ld.c:126
-msgid "Ignore/record dependencies on unused DSOs."
-msgstr "使用されない DSO の依存性を無視/記録します。"
-
-#: src/ld.c:128
-msgid "Generated DSO will be a system library."
-msgstr "生成された DSO はシステムライブラリーになります。"
-
-#: src/ld.c:129
-msgid "ADDRESS"
-msgstr "アドレス"
-
-#: src/ld.c:129
-msgid "Set entry point address."
-msgstr "入口点アドレスを設定します。"
-
-#: src/ld.c:132
-msgid "Do not link against shared libraries."
-msgstr "共用ライブラリーに対してリンクを設定してはいけません。"
-
-#: src/ld.c:135
-msgid "Prefer linking against shared libraries."
-msgstr "共用ライブラリーに対してリンクを好みます。"
-
-#: src/ld.c:136
-msgid "Export all dynamic symbols."
-msgstr "全ダイナミックシンボルをエクスポートします。"
-
-#: src/ld.c:137
-msgid "Strip all symbols."
-msgstr "全シンボルを取り除きます。"
-
-#: src/ld.c:138
-msgid "Strip debugging symbols."
-msgstr "デバッグシンボルを取り除きます。"
-
-#: src/ld.c:140
-msgid "Assume pagesize for the target system to be SIZE."
-msgstr "ターゲットシステムのページサイズを SIZE と見做します。"
-
-#: src/ld.c:142
-msgid "Set runtime DSO search path."
-msgstr "実行時 DSO 検索パスを設定します。"
-
-#: src/ld.c:145
-msgid "Set link time DSO search path."
-msgstr "リンク時 DSO 検索パスを設定します。"
-
-#: src/ld.c:146
-msgid "Generate dynamic shared object."
-msgstr "動的共用オブジェクトを生成します。"
-
-#: src/ld.c:147
-msgid "Generate relocatable object."
-msgstr "リロケータブルオブジェクトを生成します。"
-
-#: src/ld.c:150
-msgid "Causes symbol not assigned to a version be reduced to local."
-msgstr "バージョンが指定されていないシンボルはローカルに減少します。"
-
-#: src/ld.c:151
-msgid "Remove unused sections."
-msgstr "使用されていないセクションを取り除きます。"
-
-#: src/ld.c:154
-msgid "Don't remove unused sections."
-msgstr "利用されていていセクションを取り除いてはいけません。"
-
-#: src/ld.c:155
-msgid "Set soname of shared object."
-msgstr "共用ライブラリーの so 名を設定します。"
-
-#: src/ld.c:156
-msgid "Set the dynamic linker name."
-msgstr "動的リンカーの名前を設定します。"
-
-#: src/ld.c:159
-msgid "Add/suppress addition indentifying link-editor to .comment section."
-msgstr ""
-".comment セクションにリンクエディターを識別する追加情報を追加/抑止します。"
-
-#: src/ld.c:162
-msgid "Create .eh_frame_hdr section"
-msgstr ".eh_frame_hdr セクションを生成します"
-
-#: src/ld.c:164
-msgid "Set hash style to sysv, gnu or both."
-msgstr "ハッシュ形式を sysvか、gnu、両方のどれかに設定します。"
-
-#: src/ld.c:166
-msgid "Generate build ID note (md5, sha1 (default), uuid)."
-msgstr "ビルド ID ノート (md5、sh1 (省略値)、uuid) を生成します。"
-
-#: src/ld.c:168
-msgid "Linker Operation Control:"
-msgstr "リンカー操作制御:"
-
-#: src/ld.c:169
-msgid "Verbose messages."
-msgstr "饒舌メッセージ。"
-
-#: src/ld.c:170
-msgid "Trace file opens."
-msgstr "ファイルのオープンを追跡します。"
-
-#: src/ld.c:172
-msgid "Trade speed for less memory usage"
-msgstr "速度と引き換えにメモリー使用量を減らします"
-
-#: src/ld.c:173
-msgid "LEVEL"
-msgstr "れべる"
-
-#: src/ld.c:174
-msgid "Set optimization level to LEVEL."
-msgstr "最適化レベルを れべる に設定します。"
-
-#: src/ld.c:175
-msgid "Use linker script in FILE."
-msgstr "ふぁいる でリンカースクリプトを使用します。"
-
-#: src/ld.c:178
-msgid "Select to get parser debug information"
-msgstr "パーサーのデバッグ情報を得るように選択します"
-
-#: src/ld.c:181
-msgid "Read version information from FILE."
-msgstr "ふぁいる からバージョン情報を読みます。"
-
-#: src/ld.c:182
-msgid "Set emulation to NAME."
-msgstr "エミュレーションを なまえ に設定します。"
-
-#: src/ld.c:188
-msgid "Combine object and archive files."
-msgstr "オブジェクトとアーカイブファイルを一体化します。"
-
-#: src/ld.c:191
-msgid "[FILE]..."
-msgstr "[ふぁいる]..."
-
-#: src/ld.c:319
-#, c-format
-msgid "At least one input file needed"
-msgstr "少なくとも 1 つの入力ファイルが必要です"
-
-#: src/ld.c:335
-#, c-format
-msgid "error while preparing linking"
-msgstr "リンクの準備中にエラー"
-
-#: src/ld.c:342
-#, c-format
-msgid "cannot open linker script '%s'"
-msgstr "リンカースクリプト '%s' を開けません"
-
-#: src/ld.c:383
-#, c-format
-msgid "-( without matching -)"
-msgstr "-( 何も一致しない -)"
-
-#: src/ld.c:558 src/ld.c:596
-#, c-format
-msgid "only one option of -G and -r is allowed"
-msgstr "-G か -r のどちらかひとつのオプションだけ認められます"
-
-#: src/ld.c:580
-#, c-format
-msgid "more than one '-m' parameter"
-msgstr "-m パラメーターが1つを越えています"
-
-#: src/ld.c:590 src/ld.c:999
-#, c-format
-msgid "unknown option `-%c %s'"
-msgstr "不明なオプション `%c %s'"
-
-#: src/ld.c:632
-#, c-format
-msgid "invalid page size value '%s': ignored"
-msgstr "不当なページサイズ値 '%s': 無視しました"
-
-#: src/ld.c:673
-#, c-format
-msgid "invalid hash style '%s'"
-msgstr "不当なハッシュスタイル '%s'"
-
-#: src/ld.c:683
-#, c-format
-msgid "invalid build-ID style '%s'"
-msgstr "不当なビルド-ID スタイル '%s'"
-
-#: src/ld.c:771
-#, c-format
-msgid "More than one output file name given."
-msgstr "ひとつを越える出力ファイル名が与えられました。"
-
-#: src/ld.c:788
-#, c-format
-msgid "Invalid optimization level `%s'"
-msgstr "不当な最適化レベル `%s'"
-
-#: src/ld.c:836
-#, c-format
-msgid "nested -( -) groups are not allowed"
-msgstr "ネストされた -( -) グループは認められません"
-
-#: src/ld.c:855
-#, c-format
-msgid "-) without matching -("
-msgstr "対応する -( がない -)"
-
-#: src/ld.c:1032
-#, c-format
-msgid "unknown option '-%c %s'"
-msgstr "不明なオプション '-%c %s'"
-
-#: src/ld.c:1138
-#, c-format
-msgid "could not find input file to determine output file format"
-msgstr "出力ファイル形式を決定するための入力ファイルが見つかりません"
-
-#: src/ld.c:1140
-#, c-format
-msgid "try again with an appropriate '-m' parameter"
-msgstr "適切な '-m' パラメーターを付けて再試行してください"
-
-#: src/ld.c:1434
-#, c-format
-msgid "cannot read version script '%s'"
-msgstr "バージョンスクリプト '%s' を読めません"
-
-#: src/ld.c:1500 src/ld.c:1539
-#, c-format
-msgid "duplicate definition of '%s' in linker script"
-msgstr "リンカースクリプトに '%s' の重複定義"
-
-#: src/ldgeneric.c:201 src/ldgeneric.c:5141
-#, c-format
-msgid "cannot create string table"
-msgstr "文字列テーブルを生成できません"
-
-#: src/ldgeneric.c:247
-#, c-format
-msgid "cannot load ld backend library '%s': %s"
-msgstr "ld バックエンドライブラリー '%s' をロードできません: %s"
-
-#: src/ldgeneric.c:257
-#, c-format
-msgid "cannot find init function in ld backend library '%s': %s"
-msgstr "ld バックエンドライブラリー '%s' に初期化機能が見つかりません: %s "
-
-#: src/ldgeneric.c:300
-#, c-format
-msgid "%s listed more than once as input"
-msgstr "入力に %s が 1回を越えて書かれています"
-
-#: src/ldgeneric.c:414
-#, c-format
-msgid "%s (for -l%s)\n"
-msgstr "%s (-l%s 用)\n"
-
-#: src/ldgeneric.c:415
-#, c-format
-msgid "%s (for DT_NEEDED %s)\n"
-msgstr "%s (DT_NEEDED %s 用)\n"
-
-#: src/ldgeneric.c:563
-#, c-format
-msgid "Warning: type of `%s' changed from %s in %s to %s in %s"
-msgstr ""
-"警告: `%1$s' のタイプが %3$s の %2$s から %5$s の %4$s に変更されました"
-
-#: src/ldgeneric.c:576
-#, c-format
-msgid "Warning: size of `%s' changed from %<PRIu64> in %s to %<PRIu64> in %s"
-msgstr ""
-"警告: `%1$s の大きさが %3$s の %2$<PRIu64> から %5$s の %4$<PRIu64> に変更さ"
-"れました"
-
-#: src/ldgeneric.c:651 src/ldgeneric.c:1112 src/readelf.c:536 src/readelf.c:852
-#: src/strip.c:589
-#, c-format
-msgid "cannot determine number of sections: %s"
-msgstr "セクション数を決定できません: %s"
-
-#: src/ldgeneric.c:667
-#, c-format
-msgid "(%s+%#<PRIx64>): multiple definition of %s `%s'\n"
-msgstr "(%s+%#<PRIx64>): %s の複数定義 '%s'\n"
-
-#: src/ldgeneric.c:690
-#, c-format
-msgid "(%s+%#<PRIx64>): first defined here\n"
-msgstr "(%s+%#<PRIx64>): 最初の定義はここ\n"
-
-#: src/ldgeneric.c:809
-#, c-format
-msgid "%s: cannot get section group data: %s"
-msgstr "%s: セクショングループデータを得られません: %s"
-
-#: src/ldgeneric.c:830
-#, c-format
-msgid "%s: section '%s' with group flag set does not belong to any group"
-msgstr ""
-"%s: グループフラグが設定されているセクション '%s' はどのグループにも属してい"
-"ません"
-
-#: src/ldgeneric.c:875
-#, c-format
-msgid "%s: section [%2d] '%s' is not in the correct section group"
-msgstr "%s: セクション [%2d] '%s& は正しいセクショングループに入っていません"
-
-#: src/ldgeneric.c:1146 src/ldgeneric.c:1403 src/ldgeneric.c:1412
-#: src/ldgeneric.c:1471 src/ldgeneric.c:1480 src/ldgeneric.c:1743
-#: src/ldgeneric.c:1995
-#, c-format
-msgid "%s: invalid ELF file (%s:%d)\n"
-msgstr "%s: 不当な ELF ファイル (%s:%d)\n"
-
-#: src/ldgeneric.c:1240
-#, c-format
-msgid "%s: only files of type ET_REL might contain section groups"
-msgstr "%s: タイプ ET_REL のファイルのみセクショングループを含むことができます"
-
-#: src/ldgeneric.c:1292
-#, c-format
-msgid "%s: cannot determine signature of section group [%2zd] '%s': %s"
-msgstr "%s: セクショングループ [%2zd] '%s' の署名を決定できません: %s"
-
-#: src/ldgeneric.c:1304
-#, c-format
-msgid "%s: cannot get content of section group [%2zd] '%s': %s'"
-msgstr "%s: セクショングループ [%2zd] '%s' の内容を得られません: %s'"
-
-#: src/ldgeneric.c:1318
-#, c-format
-msgid ""
-"%s: group member %zu of section group [%2zd] '%s' has too high index: "
-"%<PRIu32>"
-msgstr ""
-"%1$s: セクショングループ [%3$2zd] '%4$s' のグループメンバー %2$zu は大きすぎ"
-"るインデックスを持っています: %5$<PRIu32>"
-
-#: src/ldgeneric.c:1340
-#, c-format
-msgid "%s: section '%s' has unknown type: %d"
-msgstr "%s: セクション '%s' は不明なタイプを持っています: %d"
-
-#: src/ldgeneric.c:1719
-#, c-format
-msgid "cannot get descriptor for ELF file (%s:%d): %s\n"
-msgstr "ELF ファイル (%s:%d) のための記述子を得られません: %s\n"
-
-#: src/ldgeneric.c:1889
-#, c-format
-msgid "cannot read archive `%s': %s"
-msgstr "アーカイブ `%s' を読めません: %s"
-
-#: src/ldgeneric.c:2010
-#, c-format
-msgid "file of type %s cannot be linked in\n"
-msgstr "%s のファイルタイプがリンクされていません\n"
-
-#: src/ldgeneric.c:2022
-#, c-format
-msgid "%s: input file incompatible with ELF machine type %s\n"
-msgstr "%s: 入力ファイルは ELF マシンタイプ %s と互換性がありません\n"
-
-#: src/ldgeneric.c:2034
-#, c-format
-msgid "%s: cannot get section header string table index: %s\n"
-msgstr "%s: セクションヘッダー文字列テーブルインデックスを得られません: %s\n"
-
-#: src/ldgeneric.c:2063
-#, c-format
-msgid "cannot use DSO '%s' when generating relocatable object file"
-msgstr "リロケータブルオブジェクトファイル生成時に DSO '%s' を使えません"
-
-#: src/ldgeneric.c:2148
-#, c-format
-msgid "input file '%s' ignored"
-msgstr "入力ファイル '%s' を無視しました"
-
-#: src/ldgeneric.c:2362
-#, c-format
-msgid "undefined symbol `%s' in %s"
-msgstr "%2$s 中に未定義のシンボル `%1$s'"
-
-#: src/ldgeneric.c:2692
-#, c-format
-msgid "cannot create ELF descriptor for output file: %s"
-msgstr "出力ファイル用の ELF 記述子を生成できません: %s"
-
-#: src/ldgeneric.c:2699
-#, c-format
-msgid "could not create ELF header for output file: %s"
-msgstr "出力ファイル用の ELF ヘッダーを生成できませんでした: %s"
-
-#: src/ldgeneric.c:3214 src/ldgeneric.c:3284 src/ldgeneric.c:3320
-#: src/ldgeneric.c:4447 src/ldgeneric.c:4496 src/ldgeneric.c:4528
-#: src/ldgeneric.c:4763 src/ldgeneric.c:4818 src/ldgeneric.c:5065
-#: src/ldgeneric.c:5121 src/ldgeneric.c:5590 src/ldgeneric.c:5602
-#, c-format
-msgid "cannot create section for output file: %s"
-msgstr "出力ファイル用のセクションを生成できません: %s"
-
-#: src/ldgeneric.c:3434
-#, c-format
-msgid "address computation expression contains variable '%s'"
-msgstr "アドレス計算式が変数 '%s' を含んでいます"
-
-#: src/ldgeneric.c:3479
-#, c-format
-msgid ""
-"argument '%<PRIuMAX>' of ALIGN in address computation expression is no power "
-"of two"
-msgstr ""
-"アドレス計算式中の ALIGN のパラメーター %<PRIuMAX> が 2 の累乗ではありません"
-
-#: src/ldgeneric.c:3674
-#, c-format
-msgid "cannot find entry symbol '%s': defaulting to %#0*<PRIx64>"
-msgstr ""
-"エントリーシンボル '%s' が見つかりません: デフォルトの %#0*<PRIx64> にします"
-
-#: src/ldgeneric.c:3680
-#, c-format
-msgid "no entry symbol specified: defaulting to %#0*<PRIx64>"
-msgstr ""
-"エントリーシンボルが指定されていません: デフォルトの %#0*<PRIx64> にします"
-
-#: src/ldgeneric.c:3910
-#, c-format
-msgid "cannot create GNU hash table section for output file: %s"
-msgstr "出力ファイル用の GNU ハッシュテーブルセクションを生成できません: %s"
-
-#: src/ldgeneric.c:4061
-#, c-format
-msgid "cannot create hash table section for output file: %s"
-msgstr "出力ファイル用のハッシュテーブルセクションを生成できません: %s"
-
-#: src/ldgeneric.c:4104
-#, c-format
-msgid "cannot create build ID section: %s"
-msgstr "ビルド ID セクションを生成できません: %s"
-
-#: src/ldgeneric.c:4181
-#, c-format
-msgid "cannot convert section data to file format: %s"
-msgstr "セクションデータをファイル形式に変換できません: %s"
-
-#: src/ldgeneric.c:4190
-#, c-format
-msgid "cannot convert section data to memory format: %s"
-msgstr "セクションデータをメモリー形式に変換できません: %s"
-
-#: src/ldgeneric.c:4251
-#, c-format
-msgid "cannot read enough data for UUID"
-msgstr "UUID に十分なデータを読めません"
-
-#: src/ldgeneric.c:4348 src/ldgeneric.c:4369 src/ldgeneric.c:4398
-#: src/ldgeneric.c:6051
-#, c-format
-msgid "cannot create symbol table for output file: %s"
-msgstr "出力ファイル用のシンボルテーブルを生成できません: %s"
-
-#: src/ldgeneric.c:5290 src/ldgeneric.c:5842
-#, c-format
-msgid "section index too large in dynamic symbol table"
-msgstr "動的シンボルテーブルのセクションインデックスが大きすぎます"
-
-#: src/ldgeneric.c:5735
-#, c-format
-msgid "cannot create versioning section: %s"
-msgstr "バージョニングセクションを生成できません: %s"
-
-#: src/ldgeneric.c:5808
-#, c-format
-msgid "cannot create dynamic symbol table for output file: %s"
-msgstr "出力ファイル用の動的シンボルテーブルを生成できません: %s"
-
-#: src/ldgeneric.c:5983
-#, c-format
-msgid "cannot create versioning data: %s"
-msgstr "バージョニングデータを生成できません: %s"
-
-#: src/ldgeneric.c:6083 src/ldgeneric.c:6096 src/ldgeneric.c:6160
-#: src/ldgeneric.c:6168
-#, c-format
-msgid "cannot create section header string section: %s"
-msgstr "セクションヘッダー文字列セクションを生成できません: %s"
-
-#: src/ldgeneric.c:6090
-#, c-format
-msgid "cannot create section header string section"
-msgstr "セクションヘッダー文字列セクションを生成できません"
-
-#: src/ldgeneric.c:6248
-#, c-format
-msgid "cannot create program header: %s"
-msgstr "プログラムヘッダーを生成できません: %s"
-
-#: src/ldgeneric.c:6256
-#, c-format
-msgid "while determining file layout: %s"
-msgstr "ファイルレイアウトを決定中: %s"
-
-#: src/ldgeneric.c:6377
-#, c-format
-msgid "internal error: non-nobits section follows nobits section"
-msgstr "内部エラー: 非 nobits セクションが nobits セクションに続きます"
-
-#: src/ldgeneric.c:6914
-#, c-format
-msgid "cannot get header of 0th section: %s"
-msgstr "0番目のセクションのヘッダーを得られません: %s"
-
-#: src/ldgeneric.c:6930 src/unstrip.c:1929
-#, c-format
-msgid "cannot update ELF header: %s"
-msgstr "ELF ヘッダーを更新できません: %s"
-
-#: src/ldgeneric.c:6961
-#, c-format
-msgid "linker backend didn't specify function to relocate section"
-msgstr ""
-"リンカーバックエンドがセクションをリロケートするための機能を指定していません"
-
-#: src/ldgeneric.c:6973
-#, c-format
-msgid "while writing output file: %s"
-msgstr "出力ファイルに書込み中: %s"
-
-#: src/ldgeneric.c:6978
-#, c-format
-msgid "while finishing output file: %s"
-msgstr "出力ファイルの仕上げ中: %s"
-
-#: src/ldgeneric.c:6984
-#, c-format
-msgid "cannot stat output file"
-msgstr "出力ファイルを stat できません"
-
-#: src/ldgeneric.c:7000
-#, c-format
-msgid "WARNING: temporary output file overwritten before linking finished"
-msgstr "警告: リンクを仕上げる前に一時出力ファイルが上書きされました"
-
-#: src/ldgeneric.c:7053 src/ldgeneric.c:7064 src/ldgeneric.c:7075
-#: src/ldgeneric.c:7086 src/ldgeneric.c:7105 src/ldgeneric.c:7118
-#: src/ldgeneric.c:7130
-#, c-format
-msgid "no machine specific '%s' implementation"
-msgstr "マシン固有の '%s' 実装はありません"
-
-#: src/ldscript.y:170
-msgid "mode for segment invalid\n"
-msgstr "セグメント用のモードが不当です\n"
-
-#: src/ldscript.y:457
-#, c-format
-msgid "while reading version script '%s': %s at line %d"
-msgstr "バージョンスクリプト '%1$s' 読込み中: %3$d 行目の %2$s"
-
-#: src/ldscript.y:458
-#, c-format
-msgid "while reading linker script '%s': %s at line %d"
-msgstr "リンカースクリプト '%1$s' 読込み中: %3$d 行目の %2$s"
-
-#: src/ldscript.y:737
-#, fuzzy, c-format
-msgid "symbol '%s' is declared both local and global for unnamed version '%s'"
-msgstr "名前なしバージョン用のローカルとグローバルで宣言されたシンボル '%s'"
-
-#: src/ldscript.y:739
-#, fuzzy, c-format
-msgid "symbol '%s' is declared both local and global for version '%s'"
-msgstr "バージョン '%2$s' 用のローカルとグローバルで宣言されたシンボル '%1$s'"
-
-#: src/ldscript.y:759 src/ldscript.y:766
-#, c-format
-msgid "default visibility set as local and global"
-msgstr "ローカルとグローバルに設定されたデフォルトの可視性"
-
-#: src/nm.c:66 src/strip.c:67
+#: src/nm.c:67 src/strip.c:70
msgid "Output selection:"
msgstr "出力選択:"
-#: src/nm.c:67
+#: src/nm.c:68
msgid "Display debugger-only symbols"
msgstr "デバッガー専用シンボルを表示"
-#: src/nm.c:68
+#: src/nm.c:69
msgid "Display only defined symbols"
msgstr "定義されたシンボルのみを表示"
-#: src/nm.c:71
+#: src/nm.c:72
msgid "Display dynamic symbols instead of normal symbols"
msgstr "通常シンボルの代わりに動的シンボルを表示"
-#: src/nm.c:72
+#: src/nm.c:73
msgid "Display only external symbols"
msgstr "外部シンボルのみを表示"
-#: src/nm.c:73
+#: src/nm.c:74
msgid "Display only undefined symbols"
msgstr "未定義シンボルのみを表示"
-#: src/nm.c:75
+#: src/nm.c:76
msgid "Include index for symbols from archive members"
msgstr "アーカイブメンバーからのシンボルの索引を含める"
-#: src/nm.c:77 src/size.c:57
+#: src/nm.c:78 src/size.c:55
msgid "Output format:"
msgstr "出力形式:"
-#: src/nm.c:79
+#: src/nm.c:80
msgid "Print name of the input file before every symbol"
msgstr "全てのシンボルの前に入力ファイル名を印刷"
-#: src/nm.c:82
+#: src/nm.c:83
msgid ""
"Use the output format FORMAT. FORMAT can be `bsd', `sysv' or `posix'. The "
"default is `sysv'"
@@ -3999,73 +3436,75 @@
"出力形式として FORMATを使う。FORMAT は `bsd'か、`sysv'、`posix' のどれか。省"
"略値は `sysv'"
-#: src/nm.c:84
+#: src/nm.c:85
msgid "Same as --format=bsd"
msgstr "--format=bsd と同じ"
-#: src/nm.c:85
+#: src/nm.c:86
msgid "Same as --format=posix"
msgstr "--format=posix と同じ"
-#: src/nm.c:86 src/size.c:63
+#: src/nm.c:87 src/size.c:61
msgid "Use RADIX for printing symbol values"
msgstr "シンボル値を印刷するために RADIX を使う"
-#: src/nm.c:87
+#: src/nm.c:88
#, fuzzy
msgid "Mark special symbols"
msgstr "弱いシンボルに印を点ける"
-#: src/nm.c:89
+#: src/nm.c:90
msgid "Print size of defined symbols"
msgstr "定義されたシンボルの印刷サイズ"
-#: src/nm.c:91 src/size.c:71 src/strip.c:72 src/unstrip.c:72
+#: src/nm.c:92 src/size.c:69 src/strip.c:75 src/unstrip.c:73
msgid "Output options:"
msgstr "出力オプション:"
-#: src/nm.c:92
+#: src/nm.c:93
msgid "Sort symbols numerically by address"
msgstr "シンボルをアドレスにより数値的に並べ替える"
-#: src/nm.c:94
+#: src/nm.c:95
msgid "Do not sort the symbols"
msgstr "シンボルを並べ替えない"
-#: src/nm.c:95
+#: src/nm.c:96
msgid "Reverse the sense of the sort"
msgstr "並べ替えの意味を逆にする"
-#: src/nm.c:98
+#: src/nm.c:99
msgid "Decode low-level symbol names into source code names"
msgstr ""
-#: src/nm.c:105
+#. Short description of program.
+#: src/nm.c:106
msgid "List symbols from FILEs (a.out by default)."
msgstr "ふぁいる からシンボルを表示 (デフォルトではa.out)。"
-#: src/nm.c:116 src/objdump.c:79
+#: src/nm.c:117 src/objdump.c:80
#, fuzzy
msgid "Output formatting"
msgstr "出力形式:"
-#: src/nm.c:140 src/objdump.c:103 src/size.c:108 src/strip.c:127
+#: src/nm.c:141 src/objdump.c:104 src/size.c:106 src/strip.c:131
#, fuzzy, c-format
msgid "%s: INTERNAL ERROR %d (%s): %s"
msgstr "%s: 内部エラー %d (%s-%s): %s"
-#: src/nm.c:395 src/nm.c:407 src/size.c:305 src/size.c:314 src/size.c:325
-#: src/strip.c:2280
+#: src/nm.c:382 src/nm.c:394 src/size.c:289 src/size.c:298 src/size.c:309
+#: src/strip.c:2421
#, c-format
msgid "while closing '%s'"
msgstr "'%s' を閉じている最中"
-#: src/nm.c:417 src/objdump.c:292 src/strip.c:391
+#: src/nm.c:404 src/objdump.c:281 src/strip.c:443
#, c-format
msgid "%s: File format not recognized"
msgstr "%s: ファイル形式を認識できませんでした"
-#: src/nm.c:457
+#. Note: 0 is no valid offset.
+#: src/nm.c:444
#, fuzzy
msgid ""
"\n"
@@ -4074,42 +3513,44 @@
"\n"
"アーカイブ索引:"
-#: src/nm.c:466
+#: src/nm.c:453
#, c-format
msgid "invalid offset %zu for symbol %s"
msgstr "シンボル %2$sの不正なオフセット %1$zu "
-#: src/nm.c:471
+#: src/nm.c:458
#, c-format
msgid "%s in %s\n"
msgstr "%2$s の中の %1$s\n"
-#: src/nm.c:479
+#: src/nm.c:466
#, c-format
msgid "cannot reset archive offset to beginning"
msgstr "アーカイブのオフセットを最初にリセットできません"
-#: src/nm.c:504 src/objdump.c:340
+#: src/nm.c:491 src/objdump.c:329
#, c-format
msgid "%s%s%s: file format not recognized"
msgstr "%s%s%s: ファイル形式を認識できません"
-#: src/nm.c:719
+#: src/nm.c:706
#, c-format
msgid "cannot create search tree"
msgstr "検索ツリーを生成できません"
-#: src/nm.c:760 src/nm.c:1221 src/objdump.c:789 src/readelf.c:545
-#: src/readelf.c:1123 src/readelf.c:1323 src/readelf.c:1471 src/readelf.c:1667
-#: src/readelf.c:1873 src/readelf.c:2063 src/readelf.c:2300 src/readelf.c:2558
-#: src/readelf.c:2634 src/readelf.c:2721 src/readelf.c:3301 src/readelf.c:3347
-#: src/readelf.c:3410 src/readelf.c:8320 src/readelf.c:9420 src/readelf.c:9603
-#: src/readelf.c:9671 src/size.c:413 src/size.c:482 src/strip.c:520
+#: src/nm.c:747 src/nm.c:1208 src/objdump.c:778 src/readelf.c:606
+#: src/readelf.c:1196 src/readelf.c:1396 src/readelf.c:1544 src/readelf.c:1745
+#: src/readelf.c:1951 src/readelf.c:2141 src/readelf.c:2319 src/readelf.c:2395
+#: src/readelf.c:2653 src/readelf.c:2729 src/readelf.c:2816 src/readelf.c:3414
+#: src/readelf.c:3464 src/readelf.c:3527 src/readelf.c:11028
+#: src/readelf.c:12200 src/readelf.c:12403 src/readelf.c:12471 src/size.c:397
+#: src/size.c:466 src/strip.c:572
#, c-format
msgid "cannot get section header string table index"
msgstr "セクションヘッダー文字列テーブル索引が得られません"
-#: src/nm.c:787
+#. We always print this prolog.
+#: src/nm.c:774
#, c-format
msgid ""
"\n"
@@ -4122,7 +3563,8 @@
"%s からのシンボル:\n"
"\n"
-#: src/nm.c:790
+#. The header line.
+#: src/nm.c:777
#, c-format
msgid ""
"%*s%-*s %-*s Class Type %-*s %*s Section\n"
@@ -4131,73 +3573,80 @@
"%*s%-*s %-*s クラス タイプ %-*s %*s セクション\n"
"\n"
-#: src/nm.c:1232
+#: src/nm.c:1219
#, fuzzy, c-format
msgid "%s: entry size in section %zd `%s' is not what we expect"
msgstr "%s: セクションの項目の大きさ `%s' は予期したものとは異なります"
-#: src/nm.c:1237
+#: src/nm.c:1224
#, fuzzy, c-format
msgid "%s: size of section %zd `%s' is not multiple of entry size"
msgstr "%s: セクション `%s' の大きさは項目の大きさの整数倍ではありません"
-#: src/nm.c:1537
+#: src/nm.c:1303
+#, fuzzy, c-format
+msgid "%s: entries (%zd) in section %zd `%s' is too large"
+msgstr "%s: セクションの項目の大きさ `%s' は予期したものとは異なります"
+
+#. XXX Add machine specific object file types.
+#: src/nm.c:1529
#, c-format
msgid "%s%s%s%s: Invalid operation"
msgstr "%s%s%s%s: 不当な操作"
-#: src/nm.c:1594
+#: src/nm.c:1586
#, c-format
msgid "%s%s%s: no symbols"
msgstr "%s%s%s: シンボルがありません"
-#: src/objdump.c:52
+#: src/objdump.c:53
msgid "Mode selection:"
msgstr ""
-#: src/objdump.c:53
+#: src/objdump.c:54
msgid "Display relocation information."
msgstr ""
-#: src/objdump.c:55
+#: src/objdump.c:56
msgid "Display the full contents of all sections requested"
msgstr ""
-#: src/objdump.c:57
+#: src/objdump.c:58
msgid "Display assembler code of executable sections"
msgstr ""
-#: src/objdump.c:59
+#: src/objdump.c:60
#, fuzzy
msgid "Output content selection:"
msgstr "出力選択:"
-#: src/objdump.c:61
+#: src/objdump.c:62
msgid "Only display information for section NAME."
msgstr ""
-#: src/objdump.c:67
+#. Short description of program.
+#: src/objdump.c:68
msgid "Show information from FILEs (a.out by default)."
msgstr ""
-#: src/objdump.c:232 src/readelf.c:479
+#: src/objdump.c:219 src/readelf.c:551
msgid "No operation specified.\n"
msgstr "操作が指定されていません。\n"
-#: src/objdump.c:270 src/objdump.c:282
+#: src/objdump.c:259 src/objdump.c:271
#, c-format
msgid "while close `%s'"
msgstr ""
-#: src/objdump.c:375 src/readelf.c:1968 src/readelf.c:2160
+#: src/objdump.c:364 src/readelf.c:2046 src/readelf.c:2238
msgid "INVALID SYMBOL"
msgstr "不当なシンボル"
-#: src/objdump.c:390 src/readelf.c:2002 src/readelf.c:2196
+#: src/objdump.c:379 src/readelf.c:2080 src/readelf.c:2274
msgid "INVALID SECTION"
msgstr "不当なセクション"
-#: src/objdump.c:510
+#: src/objdump.c:499
#, c-format
msgid ""
"\n"
@@ -4205,290 +3654,320 @@
"%-*s TYPE VALUE\n"
msgstr ""
-#: src/objdump.c:513
+#: src/objdump.c:502
msgid "OFFSET"
msgstr ""
-#: src/objdump.c:578
+#: src/objdump.c:567
#, c-format
msgid "Contents of section %s:\n"
msgstr ""
-#: src/objdump.c:699
+#: src/objdump.c:688
#, c-format
msgid "cannot disassemble"
msgstr ""
-#: src/ranlib.c:65
+#. Short description of program.
+#: src/ranlib.c:64
msgid "Generate an index to speed access to archives."
msgstr ""
-#: src/ranlib.c:68
+#. Strings for arguments in help texts.
+#: src/ranlib.c:67
msgid "ARCHIVE"
msgstr ""
-#: src/ranlib.c:104
+#: src/ranlib.c:103
#, c-format
msgid "Archive name required"
msgstr ""
-#: src/ranlib.c:182
+#: src/ranlib.c:167
#, c-format
msgid "'%s' is no archive"
msgstr ""
-#: src/ranlib.c:217
+#: src/ranlib.c:202
#, c-format
msgid "error while freeing sub-ELF descriptor: %s"
msgstr ""
-#: src/readelf.c:72
+#: src/readelf.c:95
#, fuzzy
msgid "ELF input selection:"
msgstr "出力選択:"
-#: src/readelf.c:74
+#: src/readelf.c:97
msgid ""
"Use the named SECTION (default .gnu_debugdata) as (compressed) ELF input data"
msgstr ""
-#: src/readelf.c:76
+#: src/readelf.c:100
+msgid ""
+"Used with -w to find the skeleton Compile Units in FILE associated with the "
+"Split Compile units in a .dwo input file"
+msgstr ""
+
+#: src/readelf.c:102
#, fuzzy
msgid "ELF output selection:"
msgstr "出力選択:"
-#: src/readelf.c:78
+#: src/readelf.c:104
msgid "All these plus -p .strtab -p .dynstr -p .comment"
msgstr ""
-#: src/readelf.c:79
+#: src/readelf.c:105
msgid "Display the dynamic segment"
msgstr "動的セグメントを表示"
-#: src/readelf.c:80
+#: src/readelf.c:106
msgid "Display the ELF file header"
msgstr "ELF ファイルヘッダーを表示"
-#: src/readelf.c:82
+#: src/readelf.c:108
msgid "Display histogram of bucket list lengths"
msgstr "バケットリスト長の柱状図を表示"
-#: src/readelf.c:83
+#: src/readelf.c:109
msgid "Display the program headers"
msgstr "プログラムヘッダーを表示"
-#: src/readelf.c:85
+#: src/readelf.c:111
msgid "Display relocations"
msgstr "リロケーションを表示"
-#: src/readelf.c:86
+#: src/readelf.c:112
+#, fuzzy
+msgid "Display the section groups"
+msgstr "セクションのヘッダーを表示"
+
+#: src/readelf.c:113
#, fuzzy
msgid "Display the sections' headers"
msgstr "セクションのヘッダーを表示"
-#: src/readelf.c:88
-msgid "Display the symbol table"
+#: src/readelf.c:116
+#, fuzzy
+msgid "Display the symbol table sections"
msgstr "シンボルテーブルを表示"
-#: src/readelf.c:89
+#: src/readelf.c:117
msgid "Display versioning information"
msgstr "バージョニング情報の表示"
-#: src/readelf.c:90
+#: src/readelf.c:118
#, fuzzy
msgid "Display the ELF notes"
msgstr "コアノートを表示"
-#: src/readelf.c:92
+#: src/readelf.c:120
#, fuzzy
msgid "Display architecture specific information, if any"
msgstr "(もしあれば)アーキテクチャー固有の情報を表示"
-#: src/readelf.c:94
+#: src/readelf.c:122
msgid "Display sections for exception handling"
msgstr "例外を取り扱うためのセクションを表示"
-#: src/readelf.c:96
+#: src/readelf.c:124
#, fuzzy
msgid "Additional output selection:"
msgstr "出力選択:"
-#: src/readelf.c:98
+#: src/readelf.c:126
#, fuzzy
msgid ""
-"Display DWARF section content. SECTION can be one of abbrev, aranges, "
-"decodedaranges, frame, gdb_index, info, loc, line, decodedline, ranges, "
-"pubnames, str, macinfo, macro or exception"
+"Display DWARF section content. SECTION can be one of abbrev, addr, aranges, "
+"decodedaranges, frame, gdb_index, info, info+, loc, line, decodedline, "
+"ranges, pubnames, str, macinfo, macro or exception"
msgstr ""
"DWARF セクションの内容を表示。SECTION は addrevか、aranges、frame、info、"
"loc、ranges、pubnames、str、macinfo、exception のいずれかです"
-#: src/readelf.c:102
+#: src/readelf.c:130
msgid "Dump the uninterpreted contents of SECTION, by number or name"
msgstr "数字か名前で解釈できないセクションの内容をダンプする"
-#: src/readelf.c:104
+#: src/readelf.c:132
msgid "Print string contents of sections"
msgstr "セクションの文字列内容を印刷する"
-#: src/readelf.c:107
+#: src/readelf.c:135
msgid "Display the symbol index of an archive"
msgstr "アーカイブのシンボル索引を表示"
-#: src/readelf.c:109
+#: src/readelf.c:137
msgid "Output control:"
msgstr "出力制御:"
-#: src/readelf.c:111
+#: src/readelf.c:139
msgid "Do not find symbol names for addresses in DWARF data"
msgstr "DWARFデータ中のアドレスのためのシンボル名を探さない"
-#: src/readelf.c:113
+#: src/readelf.c:141
#, fuzzy
msgid ""
"Display just offsets instead of resolving values to addresses in DWARF data"
msgstr "DWARFデータ中のアドレスのためのシンボル名を探さない"
-#: src/readelf.c:115
+#: src/readelf.c:143
msgid "Ignored for compatibility (lines always wide)"
msgstr ""
-#: src/readelf.c:117
+#: src/readelf.c:145
msgid ""
"Show compression information for compressed sections (when used with -S); "
"decompress section before dumping data (when used with -p or -x)"
msgstr ""
-#: src/readelf.c:122
+#. Short description of program.
+#: src/readelf.c:150
msgid "Print information from ELF file in human-readable form."
msgstr "ELF ファイルから人間が読める形で情報を印刷する。"
-#: src/readelf.c:447
+#. Look up once.
+#: src/readelf.c:329
+msgid "yes"
+msgstr "はい"
+
+#: src/readelf.c:330
+msgid "no"
+msgstr "いいえ"
+
+#: src/readelf.c:519
#, c-format
msgid "Unknown DWARF debug section `%s'.\n"
msgstr "不明な DWARF デバッグセクション `%s'.\n"
-#: src/readelf.c:529 src/readelf.c:640
+#: src/readelf.c:590 src/readelf.c:701
#, c-format
msgid "cannot generate Elf descriptor: %s"
msgstr "Elf 記述子を生成できません: %s"
-#: src/readelf.c:554 src/readelf.c:1145 src/readelf.c:1347
+#: src/readelf.c:597 src/readelf.c:925 src/strip.c:641
+#, c-format
+msgid "cannot determine number of sections: %s"
+msgstr "セクション数を決定できません: %s"
+
+#: src/readelf.c:615 src/readelf.c:1218 src/readelf.c:1420
#, c-format
msgid "cannot get section: %s"
msgstr "セクションを得られません: %s"
-#: src/readelf.c:563 src/readelf.c:1152 src/readelf.c:1355 src/readelf.c:9623
-#: src/unstrip.c:387 src/unstrip.c:418 src/unstrip.c:467 src/unstrip.c:577
-#: src/unstrip.c:594 src/unstrip.c:631 src/unstrip.c:829 src/unstrip.c:1118
-#: src/unstrip.c:1309 src/unstrip.c:1369 src/unstrip.c:1490 src/unstrip.c:1543
-#: src/unstrip.c:1658 src/unstrip.c:1796 src/unstrip.c:1891
+#: src/readelf.c:624 src/readelf.c:1225 src/readelf.c:1428 src/readelf.c:12423
+#: src/unstrip.c:375 src/unstrip.c:406 src/unstrip.c:455 src/unstrip.c:565
+#: src/unstrip.c:582 src/unstrip.c:619 src/unstrip.c:817 src/unstrip.c:1109
+#: src/unstrip.c:1301 src/unstrip.c:1362 src/unstrip.c:1535 src/unstrip.c:1650
+#: src/unstrip.c:1790 src/unstrip.c:1885
#, c-format
msgid "cannot get section header: %s"
msgstr "セクションヘッダーを得られません: %s"
-#: src/readelf.c:571
+#: src/readelf.c:632
#, fuzzy, c-format
msgid "cannot get section name"
msgstr "セクションを得られません: %s"
-#: src/readelf.c:580 src/readelf.c:5504 src/readelf.c:7778 src/readelf.c:7880
-#: src/readelf.c:8057
+#: src/readelf.c:641 src/readelf.c:6517 src/readelf.c:10301 src/readelf.c:10403
+#: src/readelf.c:10580
#, c-format
msgid "cannot get %s content: %s"
msgstr "%s の内容を得られません: %s"
-#: src/readelf.c:596
+#: src/readelf.c:657
#, fuzzy, c-format
msgid "cannot create temp file '%s'"
msgstr "新しいファイル '%s' を生成できません: %s"
-#: src/readelf.c:605
+#: src/readelf.c:666
#, fuzzy, c-format
msgid "cannot write section data"
msgstr "セクションデータを割り当てられません: %s"
-#: src/readelf.c:611 src/readelf.c:628 src/readelf.c:657
+#: src/readelf.c:672 src/readelf.c:689 src/readelf.c:718
#, c-format
msgid "error while closing Elf descriptor: %s"
msgstr "Elf 記述子を閉じている時にエラー: %s"
-#: src/readelf.c:618
+#: src/readelf.c:679
#, fuzzy, c-format
msgid "error while rewinding file descriptor"
msgstr "Elf 記述子を閉じている時にエラー: %s"
-#: src/readelf.c:652
+#: src/readelf.c:713
#, c-format
msgid "'%s' is not an archive, cannot print archive index"
msgstr "'%s' はアーカイブではなく、アーカイブ索引を印刷できません"
-#: src/readelf.c:751
-#, fuzzy, c-format
-msgid "No such section '%s' in '%s'"
-msgstr "セクション [%Zu] '%s' からデータが得られません: %s"
-
-#: src/readelf.c:778
+#: src/readelf.c:817
#, c-format
msgid "cannot stat input file"
msgstr "入力ファイルを stat できません"
-#: src/readelf.c:780
+#: src/readelf.c:819
#, c-format
msgid "input file is empty"
msgstr "入力ファイルが空です"
-#: src/readelf.c:782
+#: src/readelf.c:821
#, c-format
msgid "failed reading '%s': %s"
msgstr "'%s' の読込みに失敗: %s"
-#: src/readelf.c:837
+#: src/readelf.c:850
+#, fuzzy, c-format
+msgid "No such section '%s' in '%s'"
+msgstr "セクション [%Zu] '%s' からデータが得られません: %s"
+
+#: src/readelf.c:910
#, c-format
msgid "cannot read ELF header: %s"
msgstr "ELF ヘッダーが読めません: %s"
-#: src/readelf.c:845
+#: src/readelf.c:918
#, c-format
msgid "cannot create EBL handle"
msgstr "EBL ヘッダーを生成できません"
-#: src/readelf.c:858
+#: src/readelf.c:931
#, fuzzy, c-format
msgid "cannot determine number of program headers: %s"
msgstr "セクション数を決定できません: %s"
-#: src/readelf.c:948
+#: src/readelf.c:1021
msgid "NONE (None)"
msgstr "なし (なし)"
-#: src/readelf.c:949
+#: src/readelf.c:1022
msgid "REL (Relocatable file)"
msgstr "REL (リロケータブルファイル)"
-#: src/readelf.c:950
+#: src/readelf.c:1023
msgid "EXEC (Executable file)"
msgstr "(EXEC (実行ファイル)"
-#: src/readelf.c:951
+#: src/readelf.c:1024
msgid "DYN (Shared object file)"
msgstr "DYN (共用オブジェクトファイル)"
-#: src/readelf.c:952
+#: src/readelf.c:1025
msgid "CORE (Core file)"
msgstr "CORE (コアファイル)"
-#: src/readelf.c:957
+#: src/readelf.c:1030
#, c-format
msgid "OS Specific: (%x)\n"
msgstr "OS 固有: (%x)\n"
-#: src/readelf.c:959
+#. && e_type <= ET_HIPROC always true
+#: src/readelf.c:1032
#, c-format
msgid "Processor Specific: (%x)\n"
msgstr "プロセッサー固有: (%x)\n"
-#: src/readelf.c:969
+#: src/readelf.c:1042
msgid ""
"ELF Header:\n"
" Magic: "
@@ -4496,7 +3975,7 @@
"ELF ヘッダー:\n"
" マジック: "
-#: src/readelf.c:973
+#: src/readelf.c:1046
#, c-format
msgid ""
"\n"
@@ -4505,117 +3984,118 @@
"\n"
" クラス: %s\n"
-#: src/readelf.c:978
+#: src/readelf.c:1051
#, c-format
msgid " Data: %s\n"
msgstr " データ: %s\n"
-#: src/readelf.c:984
+#: src/readelf.c:1057
#, c-format
msgid " Ident Version: %hhd %s\n"
msgstr " 識別バージョン: %hhd %s\n"
-#: src/readelf.c:986 src/readelf.c:1003
+#: src/readelf.c:1059 src/readelf.c:1076
msgid "(current)"
msgstr "(現在)"
-#: src/readelf.c:990
+#: src/readelf.c:1063
#, c-format
msgid " OS/ABI: %s\n"
msgstr " OS/ABI: %s\n"
-#: src/readelf.c:993
+#: src/readelf.c:1066
#, c-format
msgid " ABI Version: %hhd\n"
msgstr " ABI バージョン: %hhd\n"
-#: src/readelf.c:996
+#: src/readelf.c:1069
msgid " Type: "
msgstr " タイプ: "
-#: src/readelf.c:999
+#: src/readelf.c:1072
#, c-format
msgid " Machine: %s\n"
msgstr " マシン : %s\n"
-#: src/readelf.c:1001
+#: src/readelf.c:1074
#, c-format
msgid " Version: %d %s\n"
msgstr " バージョン: %d %s\n"
-#: src/readelf.c:1005
+#: src/readelf.c:1078
#, c-format
msgid " Entry point address: %#<PRIx64>\n"
msgstr " 入口点アドレス : %#<PRIx64>\n"
-#: src/readelf.c:1008
+#: src/readelf.c:1081
#, c-format
msgid " Start of program headers: %<PRId64> %s\n"
msgstr " プログラムヘッダーの開始: %<PRId64> %s\n"
-#: src/readelf.c:1009 src/readelf.c:1012
+#: src/readelf.c:1082 src/readelf.c:1085
msgid "(bytes into file)"
msgstr "(ファイルへのバイト数)"
-#: src/readelf.c:1011
+#: src/readelf.c:1084
#, c-format
msgid " Start of section headers: %<PRId64> %s\n"
msgstr " セクションヘッダーの開始: %<PRId64> %s\n"
-#: src/readelf.c:1014
+#: src/readelf.c:1087
#, c-format
msgid " Flags: %s\n"
msgstr " フラグ: %s\n"
-#: src/readelf.c:1017
+#: src/readelf.c:1090
#, c-format
msgid " Size of this header: %<PRId16> %s\n"
msgstr " このヘッダーの大きさ: %<PRId16> %s\n"
-#: src/readelf.c:1018 src/readelf.c:1021 src/readelf.c:1038
+#: src/readelf.c:1091 src/readelf.c:1094 src/readelf.c:1111
msgid "(bytes)"
msgstr "(バイト)"
-#: src/readelf.c:1020
+#: src/readelf.c:1093
#, c-format
msgid " Size of program header entries: %<PRId16> %s\n"
msgstr " プログラムヘッダー項目の大きさ:%<PRId16> %s\n"
-#: src/readelf.c:1023
+#: src/readelf.c:1096
#, fuzzy, c-format
msgid " Number of program headers entries: %<PRId16>"
msgstr " プログラムヘッダー項目の数 : %<PRId16>\n"
-#: src/readelf.c:1030
+#: src/readelf.c:1103
#, fuzzy, c-format
msgid " (%<PRIu32> in [0].sh_info)"
msgstr "([0].sh_link の %<PRIu32>)"
-#: src/readelf.c:1033 src/readelf.c:1050 src/readelf.c:1064
+#: src/readelf.c:1106 src/readelf.c:1123 src/readelf.c:1137
msgid " ([0] not available)"
msgstr "([0]は使えません)"
-#: src/readelf.c:1037
+#: src/readelf.c:1110
#, c-format
msgid " Size of section header entries: %<PRId16> %s\n"
msgstr " セクションヘッダー項目の大きさ:%<PRId16> %s\n"
-#: src/readelf.c:1040
+#: src/readelf.c:1113
#, c-format
msgid " Number of section headers entries: %<PRId16>"
msgstr " セクションヘッダー項目の数 : %<PRId16>"
-#: src/readelf.c:1047
+#: src/readelf.c:1120
#, c-format
msgid " (%<PRIu32> in [0].sh_size)"
msgstr " ([0].sh_size の %<PRIu32>)"
-#: src/readelf.c:1060
+#. We managed to get the zeroth section.
+#: src/readelf.c:1133
#, c-format
msgid " (%<PRIu32> in [0].sh_link)"
msgstr "([0].sh_link の %<PRIu32>)"
-#: src/readelf.c:1068
+#: src/readelf.c:1141
#, c-format
msgid ""
" Section header string table index: XINDEX%s\n"
@@ -4624,7 +4104,7 @@
" セクションヘッダー文字列テーブル索引: XINDEX%s\n"
"\n"
-#: src/readelf.c:1072
+#: src/readelf.c:1145
#, c-format
msgid ""
" Section header string table index: %<PRId16>\n"
@@ -4633,7 +4113,7 @@
" セクションヘッダー文字列テーブル索引: %<PRId16>\n"
"\n"
-#: src/readelf.c:1115
+#: src/readelf.c:1188
#, c-format
msgid ""
"There are %d section headers, starting at offset %#<PRIx64>:\n"
@@ -4642,11 +4122,11 @@
"オフセット %2$#<PRIx64> から始まる %1$d 個のセクションヘッダーがあります:\n"
"\n"
-#: src/readelf.c:1125
+#: src/readelf.c:1198
msgid "Section Headers:"
msgstr "セクションヘッダー:"
-#: src/readelf.c:1128
+#: src/readelf.c:1201
msgid ""
"[Nr] Name Type Addr Off Size ES Flags Lk "
"Inf Al"
@@ -4654,7 +4134,7 @@
"[番] 名前 タイプ アドレス オフセ 大きさ ES フラグLk "
"Inf Al"
-#: src/readelf.c:1130
+#: src/readelf.c:1203
msgid ""
"[Nr] Name Type Addr Off Size ES "
"Flags Lk Inf Al"
@@ -4662,35 +4142,35 @@
"[番] 名前 タイプ アドレス オフセ 大きさ ES "
"フラグLk Inf Al"
-#: src/readelf.c:1135
+#: src/readelf.c:1208
msgid " [Compression Size Al]"
msgstr ""
-#: src/readelf.c:1137
+#: src/readelf.c:1210
msgid " [Compression Size Al]"
msgstr ""
-#: src/readelf.c:1213
+#: src/readelf.c:1286
#, fuzzy, c-format
msgid "bad compression header for section %zd: %s"
msgstr "セクションヘッダー文字列セクションを生成できません: %s"
-#: src/readelf.c:1224
+#: src/readelf.c:1297
#, fuzzy, c-format
msgid "bad gnu compressed size for section %zd: %s"
msgstr "セクションからデータを得られません %d: %s"
-#: src/readelf.c:1242
+#: src/readelf.c:1315
msgid "Program Headers:"
msgstr "プログラムヘッダー:"
-#: src/readelf.c:1244
+#: src/readelf.c:1317
msgid ""
" Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align"
msgstr ""
" タイプ オフセ 仮アドレス 物アドレス ファイ量 メモ量 Flg 調整 "
-#: src/readelf.c:1247
+#: src/readelf.c:1320
msgid ""
" Type Offset VirtAddr PhysAddr FileSiz "
"MemSiz Flg Align"
@@ -4698,12 +4178,12 @@
" タイプ オフセ 仮想アドレス 物理アドレス ファイル量メモ"
"量 Flg 調整 "
-#: src/readelf.c:1304
+#: src/readelf.c:1377
#, c-format
msgid "\t[Requesting program interpreter: %s]\n"
msgstr "\t[プログラム割込みを要求: %s]\n"
-#: src/readelf.c:1325
+#: src/readelf.c:1398
msgid ""
"\n"
" Section to Segment mapping:\n"
@@ -4713,12 +4193,12 @@
" セクションからセグメントへのマッビング:\n"
" セグメント セクション..."
-#: src/readelf.c:1336 src/unstrip.c:1950 src/unstrip.c:1992 src/unstrip.c:1999
+#: src/readelf.c:1409 src/unstrip.c:1944 src/unstrip.c:1986 src/unstrip.c:1993
#, c-format
msgid "cannot get program header: %s"
msgstr "プログラムヘッダーを得られません: %s"
-#: src/readelf.c:1479
+#: src/readelf.c:1552
#, c-format
msgid ""
"\n"
@@ -4731,7 +4211,7 @@
"署名 '%3$s' を持つ COMDAT セクショングループ [%1$2zu] '%2$s' には %4$zu 個の"
"項目があります:\n"
-#: src/readelf.c:1484
+#: src/readelf.c:1557
#, c-format
msgid ""
"\n"
@@ -4744,25 +4224,31 @@
"署名 '%3$s' を持つセクショングループ [%1$2zu] '%2$s' には %4$zu 個の項目があ"
"ります:\n"
-#: src/readelf.c:1492
+#: src/readelf.c:1565
msgid "<INVALID SYMBOL>"
msgstr "<不当なシンボル>"
-#: src/readelf.c:1506
+#: src/readelf.c:1579
msgid "<INVALID SECTION>"
msgstr "<不当なセクション>"
-#: src/readelf.c:1529 src/readelf.c:2238 src/readelf.c:3317
+#: src/readelf.c:1602 src/readelf.c:2329 src/readelf.c:3430 src/readelf.c:12294
+#: src/readelf.c:12301 src/readelf.c:12345 src/readelf.c:12352
msgid "Couldn't uncompress section"
msgstr ""
-#: src/readelf.c:1673 src/readelf.c:2306 src/readelf.c:2564 src/readelf.c:2640
-#: src/readelf.c:2944 src/readelf.c:3018 src/readelf.c:4716
+#: src/readelf.c:1607 src/readelf.c:2334 src/readelf.c:3435
+#, fuzzy, c-format
+msgid "cannot get section [%zd] header: %s"
+msgstr "セクションヘッダーを得られません: %s"
+
+#: src/readelf.c:1751 src/readelf.c:2401 src/readelf.c:2659 src/readelf.c:2735
+#: src/readelf.c:3039 src/readelf.c:3113 src/readelf.c:5308
#, fuzzy, c-format
msgid "invalid sh_link value in section %zu"
msgstr "不当な .debug_line セクション"
-#: src/readelf.c:1676
+#: src/readelf.c:1754
#, c-format
msgid ""
"\n"
@@ -4778,36 +4264,36 @@
" アドレス: %#0*<PRIx64> オフセット: %#08<PRIx64> セクションへのリンク: "
"[%2u] '%s'\n"
-#: src/readelf.c:1686
+#: src/readelf.c:1764
msgid " Type Value\n"
msgstr " タイプ 値\n"
-#: src/readelf.c:1710
+#: src/readelf.c:1788
#, c-format
msgid "Shared library: [%s]\n"
msgstr "共用ライブラリー: [%s]\n"
-#: src/readelf.c:1715
+#: src/readelf.c:1793
#, c-format
msgid "Library soname: [%s]\n"
msgstr "ライブラリー so 名: [%s]\n"
-#: src/readelf.c:1720
+#: src/readelf.c:1798
#, c-format
msgid "Library rpath: [%s]\n"
msgstr "ライブラリー rパス: [%s]\n"
-#: src/readelf.c:1725
+#: src/readelf.c:1803
#, c-format
msgid "Library runpath: [%s]\n"
msgstr "ライブラリー run パス: [%s]\n"
-#: src/readelf.c:1745
+#: src/readelf.c:1823
#, c-format
msgid "%<PRId64> (bytes)\n"
msgstr "%<PRId64> (バイト)\n"
-#: src/readelf.c:1858 src/readelf.c:2048
+#: src/readelf.c:1936 src/readelf.c:2126
#, c-format
msgid ""
"\n"
@@ -4816,7 +4302,7 @@
"\n"
"オフセット %#0<PRIx64> に不当なシンボルテーブル\n"
-#: src/readelf.c:1876 src/readelf.c:2066
+#: src/readelf.c:1954 src/readelf.c:2144
#, c-format
msgid ""
"\n"
@@ -4831,7 +4317,13 @@
"オフセット %5$#0<PRIx64> のセクション [%3$2u] '%4$s' 用のリロケーションセク"
"ション [%1$2zu] '%2$s' には %6$d 個の項目があります:\n"
-#: src/readelf.c:1891 src/readelf.c:2081
+#. The .rel.dyn section does not refer to a specific section but
+#. instead of section index zero. Do not try to print a section
+#. name.
+#. The .rela.dyn section does not refer to a specific section but
+#. instead of section index zero. Do not try to print a section
+#. name.
+#: src/readelf.c:1969 src/readelf.c:2159
#, c-format
msgid ""
"\n"
@@ -4844,29 +4336,29 @@
"オフセット %3$#0<PRIx64> のリロケーションセクション [%1$2u] '%2$s' には %4$d "
"個の項目があります:\n"
-#: src/readelf.c:1901
+#: src/readelf.c:1979
msgid " Offset Type Value Name\n"
msgstr " オフセット タイプ 値 名前\n"
-#: src/readelf.c:1903
+#: src/readelf.c:1981
msgid " Offset Type Value Name\n"
msgstr " オフセット タイプ 値 名前\n"
-#: src/readelf.c:1956 src/readelf.c:1967 src/readelf.c:1980 src/readelf.c:2001
-#: src/readelf.c:2013 src/readelf.c:2147 src/readelf.c:2159 src/readelf.c:2173
-#: src/readelf.c:2195 src/readelf.c:2208
+#: src/readelf.c:2034 src/readelf.c:2045 src/readelf.c:2058 src/readelf.c:2079
+#: src/readelf.c:2091 src/readelf.c:2225 src/readelf.c:2237 src/readelf.c:2251
+#: src/readelf.c:2273 src/readelf.c:2286
msgid "<INVALID RELOC>"
msgstr "<不当なRELOC>"
-#: src/readelf.c:2091
+#: src/readelf.c:2169
msgid " Offset Type Value Addend Name\n"
msgstr " オフセット タイプ 値 付加名\n"
-#: src/readelf.c:2093
+#: src/readelf.c:2171
msgid " Offset Type Value Addend Name\n"
msgstr " オフセット タイプ 値 付加名\n"
-#: src/readelf.c:2314
+#: src/readelf.c:2409
#, c-format
msgid ""
"\n"
@@ -4878,39 +4370,39 @@
"\n"
"シンボルテーブル [%2u] '%s' には %u 個の項目があります:\n"
-#: src/readelf.c:2319
+#: src/readelf.c:2414
#, c-format
msgid " %lu local symbol String table: [%2u] '%s'\n"
msgid_plural " %lu local symbols String table: [%2u] '%s'\n"
msgstr[0] " %lu ローカルシンボル文字列テーブル: [%2u] '%s'\n"
-#: src/readelf.c:2327
+#: src/readelf.c:2422
msgid " Num: Value Size Type Bind Vis Ndx Name\n"
msgstr " 数 : 値 大き タイプ Bind Vis Ndx 名前\n"
-#: src/readelf.c:2329
+#: src/readelf.c:2424
msgid " Num: Value Size Type Bind Vis Ndx Name\n"
msgstr " 数 : 値 大き タイプ Bind Vis Ndx 名前\n"
-#: src/readelf.c:2349
+#: src/readelf.c:2444
#, c-format
msgid "%5u: %0*<PRIx64> %6<PRId64> %-7s %-6s %-9s %6s %s"
msgstr "%5u: %0*<PRIx64> %6<PRId64> %-7s %-6s %-9s %6s %s"
-#: src/readelf.c:2437
+#: src/readelf.c:2532
#, c-format
msgid "bad dynamic symbol"
msgstr "不正な動的シンボル"
-#: src/readelf.c:2519
+#: src/readelf.c:2614
msgid "none"
msgstr "なし"
-#: src/readelf.c:2536
+#: src/readelf.c:2631
msgid "| <unknown>"
msgstr "| <不明>"
-#: src/readelf.c:2567
+#: src/readelf.c:2662
#, c-format
msgid ""
"\n"
@@ -4926,17 +4418,17 @@
" アドレス: %#0*<PRIx64> オフセット: %#08<PRIx64> セクションへのリンク: "
"[%2u] '%s'\n"
-#: src/readelf.c:2588
+#: src/readelf.c:2683
#, c-format
msgid " %#06x: Version: %hu File: %s Cnt: %hu\n"
msgstr " %#06x: バージョン: %hu ファイル: %s 数: %hu\n"
-#: src/readelf.c:2601
+#: src/readelf.c:2696
#, c-format
msgid " %#06x: Name: %s Flags: %s Version: %hu\n"
msgstr " %#06x: 名前: %s フラグ: %s バージョン: %hu\n"
-#: src/readelf.c:2644
+#: src/readelf.c:2739
#, c-format
msgid ""
"\n"
@@ -4952,17 +4444,18 @@
" アドレス: %#0*<PRIx64> オフセット: %#08<PRIx64> セクションへのリンク: "
"[%2u] '%s'\n"
-#: src/readelf.c:2672
+#: src/readelf.c:2767
#, c-format
msgid " %#06x: Version: %hd Flags: %s Index: %hd Cnt: %hd Name: %s\n"
msgstr " %#06x: バージョン: %hd フラグ: %s 索引: %hd 数: %hd 名前: %s\n"
-#: src/readelf.c:2687
+#: src/readelf.c:2782
#, c-format
msgid " %#06x: Parent %d: %s\n"
msgstr " %#06x: 親 %d: %s\n"
-#: src/readelf.c:2948
+#. Print the header.
+#: src/readelf.c:3043
#, c-format
msgid ""
"\n"
@@ -4978,15 +4471,15 @@
" アドレス: %#0*<PRIx64> オフセット: %#08<PRIx64> セクションへのリンク: "
"[%2u] '%s'"
-#: src/readelf.c:2976
+#: src/readelf.c:3071
msgid " 0 *local* "
msgstr " 0 *ローカル* "
-#: src/readelf.c:2981
+#: src/readelf.c:3076
msgid " 1 *global* "
msgstr " 1 *グローバル* "
-#: src/readelf.c:3023
+#: src/readelf.c:3118
#, c-format
msgid ""
"\n"
@@ -5004,22 +4497,22 @@
" アドレス: %#0*<PRIx64> オフセット: %#08<PRIx64> セクションへのリンク: "
"[%2u] '%s'\n"
-#: src/readelf.c:3045
+#: src/readelf.c:3140
#, fuzzy, no-c-format
msgid " Length Number % of total Coverage\n"
msgstr " 長さ 数 全体の% 範囲 \n"
-#: src/readelf.c:3047
+#: src/readelf.c:3142
#, c-format
msgid " 0 %6<PRIu32> %5.1f%%\n"
msgstr " 0 %6<PRIu32> %5.1f%%\n"
-#: src/readelf.c:3054
+#: src/readelf.c:3149
#, c-format
msgid "%7d %6<PRIu32> %5.1f%% %5.1f%%\n"
msgstr "%7d %6<PRIu32> %5.1f%% %5.1f%%\n"
-#: src/readelf.c:3067
+#: src/readelf.c:3162
#, fuzzy, c-format
msgid ""
" Average number of tests: successful lookup: %f\n"
@@ -5028,27 +4521,37 @@
" テストの平均数: 検索成功: %f\n"
" 検索失敗: %f\n"
-#: src/readelf.c:3085 src/readelf.c:3140 src/readelf.c:3197
+#: src/readelf.c:3180 src/readelf.c:3244 src/readelf.c:3310
#, c-format
msgid "cannot get data for section %d: %s"
msgstr "セクションからデータを得られません %d: %s"
-#: src/readelf.c:3093
+#: src/readelf.c:3188
#, fuzzy, c-format
msgid "invalid data in sysv.hash section %d"
msgstr "セクション [%zu] '%s' の不当なデータ"
-#: src/readelf.c:3148
+#: src/readelf.c:3217
+#, fuzzy, c-format
+msgid "invalid chain in sysv.hash section %d"
+msgstr "セクション [%zu] '%s' の不当なデータ"
+
+#: src/readelf.c:3252
#, fuzzy, c-format
msgid "invalid data in sysv.hash64 section %d"
msgstr "セクション [%zu] '%s' の不当なデータ"
-#: src/readelf.c:3206
+#: src/readelf.c:3283
+#, fuzzy, c-format
+msgid "invalid chain in sysv.hash64 section %d"
+msgstr "セクション [%zu] '%s' の不当なデータ"
+
+#: src/readelf.c:3319
#, fuzzy, c-format
msgid "invalid data in gnu.hash section %d"
msgstr "セクション [%zu] '%s' の不当なデータ"
-#: src/readelf.c:3273
+#: src/readelf.c:3386
#, c-format
msgid ""
" Symbol Bias: %u\n"
@@ -5058,7 +4561,7 @@
" ビットマスクの大きさ: %zu バイト %<PRIuFAST32>%% ビット設定 第2ハッシュシフ"
"ト: %u\n"
-#: src/readelf.c:3358
+#: src/readelf.c:3475
#, c-format
msgid ""
"\n"
@@ -5071,7 +4574,7 @@
"オフセット %3$#0<PRIx64> のライブラリー一覧セクション [%1$2zu] '%2$s' には "
"%4$d 個の項目があります:\n"
-#: src/readelf.c:3372
+#: src/readelf.c:3489
msgid ""
" Library Time Stamp Checksum Version "
"Flags"
@@ -5079,7 +4582,7 @@
" ライブラリー タイムスタンプ チェックサム バー"
"ジョン フラグ"
-#: src/readelf.c:3422
+#: src/readelf.c:3539
#, c-format
msgid ""
"\n"
@@ -5090,140 +4593,102 @@
"オフセット %4$#0<PRIx64> の %3$<PRIu64> バイトのオブジェクト属性セクション "
"[%1$2zu] '%2$s':\n"
-#: src/readelf.c:3439
+#: src/readelf.c:3556
msgid " Owner Size\n"
msgstr " 所有者 大きさ\n"
-#: src/readelf.c:3468
+#: src/readelf.c:3585
#, c-format
msgid " %-13s %4<PRIu32>\n"
msgstr " %-13s %4<PRIu32>\n"
-#: src/readelf.c:3507
+#. Unknown subsection, print and skip.
+#: src/readelf.c:3624
#, c-format
msgid " %-4u %12<PRIu32>\n"
msgstr " %-4u %12<PRIu32>\n"
-#: src/readelf.c:3512
+#. Tag_File
+#: src/readelf.c:3629
#, c-format
msgid " File: %11<PRIu32>\n"
msgstr " ファイル: %11<PRIu32>\n"
-#: src/readelf.c:3561
+#: src/readelf.c:3678
#, c-format
msgid " %s: %<PRId64>, %s\n"
msgstr " %s: %<PRId64>、%s\n"
-#: src/readelf.c:3564
+#: src/readelf.c:3681
#, c-format
msgid " %s: %<PRId64>\n"
msgstr " %s: %<PRId64>\n"
-#: src/readelf.c:3567
+#: src/readelf.c:3684
#, c-format
msgid " %s: %s\n"
msgstr " %s: %s\n"
-#: src/readelf.c:3577
+#: src/readelf.c:3694
#, c-format
msgid " %u: %<PRId64>\n"
msgstr " %u: %<PRId64>\n"
-#: src/readelf.c:3580
+#: src/readelf.c:3697
#, c-format
msgid " %u: %s\n"
msgstr " %u: %s\n"
-#: src/readelf.c:3625
+#: src/readelf.c:3767
#, c-format
-msgid "%s+%#<PRIx64> <%s+%#<PRIx64>>"
-msgstr "%s+%#<PRIx64> <%s+%#<PRIx64>>"
+msgid "sprintf failure"
+msgstr ""
-#: src/readelf.c:3628
-#, c-format
-msgid "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
-msgstr "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
-
-#: src/readelf.c:3633
-#, c-format
-msgid "%#<PRIx64> <%s+%#<PRIx64>>"
-msgstr "%#<PRIx64> <%s+%#<PRIx64>>"
-
-#: src/readelf.c:3636
-#, c-format
-msgid "%#0*<PRIx64> <%s+%#<PRIx64>>"
-msgstr "%#0*<PRIx64> <%s+%#<PRIx64>>"
-
-#: src/readelf.c:3642
-#, c-format
-msgid "%s+%#<PRIx64> <%s>"
-msgstr "%s+%#<PRIx64> <%s>"
-
-#: src/readelf.c:3645
-#, c-format
-msgid "%s+%#0*<PRIx64> <%s>"
-msgstr "%s+%#0*<PRIx64> <%s>"
-
-#: src/readelf.c:3649
-#, c-format
-msgid "%#<PRIx64> <%s>"
-msgstr "%#<PRIx64> <%s>"
-
-#: src/readelf.c:3652
-#, c-format
-msgid "%#0*<PRIx64> <%s>"
-msgstr "%#0*<PRIx64> <%s>"
-
-#: src/readelf.c:3657
-#, c-format
-msgid "%s+%#<PRIx64>"
-msgstr "%s+%#<PRIx64>"
-
-#: src/readelf.c:3660
-#, c-format
-msgid "%s+%#0*<PRIx64>"
-msgstr "%s+%#0*<PRIx64>"
-
-#: src/readelf.c:4038
+#: src/readelf.c:4249
msgid "empty block"
msgstr "空ブロック"
-#: src/readelf.c:4041
+#: src/readelf.c:4252
#, c-format
msgid "%zu byte block:"
msgstr "%zu バイトのブロック:"
-#: src/readelf.c:4438
-#, c-format
-msgid "%*s[%4<PRIuMAX>] %s <TRUNCATED>\n"
+#: src/readelf.c:4730
+#, fuzzy, c-format
+msgid "%*s[%2<PRIuMAX>] %s <TRUNCATED>\n"
msgstr "%*s[%4<PRIuMAX>] %s <TRUNCATED>\n"
-#: src/readelf.c:4495
+#: src/readelf.c:4794
#, c-format
msgid "%s %#<PRIx64> used with different address sizes"
msgstr ""
-#: src/readelf.c:4502
+#: src/readelf.c:4801
#, c-format
msgid "%s %#<PRIx64> used with different offset sizes"
msgstr ""
-#: src/readelf.c:4509
+#: src/readelf.c:4808
#, c-format
msgid "%s %#<PRIx64> used with different base addresses"
msgstr ""
-#: src/readelf.c:4598
+#: src/readelf.c:4815
+#, c-format
+msgid "%s %#<PRIx64> used with different attribute %s and %s"
+msgstr ""
+
+#: src/readelf.c:4912
#, c-format
msgid " [%6tx] <UNUSED GARBAGE IN REST OF SECTION>\n"
msgstr ""
-#: src/readelf.c:4606
+#: src/readelf.c:4920
#, c-format
msgid " [%6tx] <UNUSED GARBAGE> ... %<PRIu64> bytes ...\n"
msgstr ""
-#: src/readelf.c:4632
+#: src/readelf.c:4998
#, c-format
msgid ""
"\n"
@@ -5234,7 +4699,7 @@
"オフセット %3$#<PRIx64> の DWARF セクション [%1$2zu] '%2$s':\n"
" [ コード]\n"
-#: src/readelf.c:4640
+#: src/readelf.c:5006
#, c-format
msgid ""
"\n"
@@ -5243,30 +4708,74 @@
"\n"
"オフセット %<PRIu64> の略語セクション:\n"
-#: src/readelf.c:4653
+#: src/readelf.c:5019
#, c-format
msgid " *** error while reading abbreviation: %s\n"
msgstr " *** 略語を読んでいる間にエラー: %s\n"
-#: src/readelf.c:4669
+#: src/readelf.c:5035
#, c-format
msgid " [%5u] offset: %<PRId64>, children: %s, tag: %s\n"
msgstr " [%5u] オフセット: %<PRId64>、子: %s、タグ: %s\n"
-#: src/readelf.c:4672
-msgid "yes"
-msgstr "はい"
+#: src/readelf.c:5068 src/readelf.c:5377 src/readelf.c:5541 src/readelf.c:5926
+#: src/readelf.c:6527 src/readelf.c:8168 src/readelf.c:8838 src/readelf.c:9274
+#: src/readelf.c:9518 src/readelf.c:9683 src/readelf.c:10044
+#: src/readelf.c:10102
+#, c-format
+msgid ""
+"\n"
+"DWARF section [%2zu] '%s' at offset %#<PRIx64>:\n"
+msgstr ""
+"\n"
+"オフセット %3$#<PRIx64> の DWARF セクション [%1$2zu] '%2$s':\n"
-#: src/readelf.c:4672
-msgid "no"
-msgstr "いいえ"
+#: src/readelf.c:5081
+#, fuzzy, c-format
+msgid "cannot get .debug_addr section data: %s"
+msgstr "セクションデータを割り当てられません: %s"
-#: src/readelf.c:4706 src/readelf.c:4779
+#: src/readelf.c:5181 src/readelf.c:5205 src/readelf.c:5586 src/readelf.c:8883
+#, fuzzy, c-format
+msgid " Length: %8<PRIu64>\n"
+msgstr " (オフセット: %#<PRIx64>)"
+
+#: src/readelf.c:5183 src/readelf.c:5220 src/readelf.c:5599 src/readelf.c:8896
+#, fuzzy, c-format
+msgid " DWARF version: %8<PRIu16>\n"
+msgstr " %s: %<PRId64>\n"
+
+#: src/readelf.c:5184 src/readelf.c:5229 src/readelf.c:5608 src/readelf.c:8905
+#, fuzzy, c-format
+msgid " Address size: %8<PRIu64>\n"
+msgstr " (終了オフセット: %#<PRIx64>)"
+
+#: src/readelf.c:5186 src/readelf.c:5239 src/readelf.c:5618 src/readelf.c:8915
+#, fuzzy, c-format
+msgid " Segment size: %8<PRIu64>\n"
+msgstr " ファイルを %<PRIu64> に設定する\n"
+
+#: src/readelf.c:5224 src/readelf.c:5603 src/readelf.c:8900 src/readelf.c:10234
+#, fuzzy, c-format
+msgid "Unknown version"
+msgstr "不明なバージョン"
+
+#: src/readelf.c:5234 src/readelf.c:5447 src/readelf.c:5613 src/readelf.c:8910
+#, fuzzy, c-format
+msgid "unsupported address size"
+msgstr "アドレス値ではありません"
+
+#: src/readelf.c:5245 src/readelf.c:5456 src/readelf.c:5623 src/readelf.c:8920
+#, c-format
+msgid "unsupported segment size"
+msgstr ""
+
+#: src/readelf.c:5298 src/readelf.c:5372
#, c-format
msgid "cannot get .debug_aranges content: %s"
msgstr ".debug_aragnes の内容を得られません: %s"
-#: src/readelf.c:4721
+#: src/readelf.c:5313
#, c-format
msgid ""
"\n"
@@ -5279,29 +4788,19 @@
"オフセット %3$#<PRIx64> の DWARF セクション [%1$2zu] '%2$s' には %4$zu 個の項"
"目があります:\n"
-#: src/readelf.c:4752
+#: src/readelf.c:5344
#, c-format
msgid " [%*zu] ???\n"
msgstr " [%*zu] ???\n"
-#: src/readelf.c:4754
+#: src/readelf.c:5346
#, c-format
msgid ""
" [%*zu] start: %0#*<PRIx64>, length: %5<PRIu64>, CU DIE offset: %6<PRId64>\n"
msgstr ""
" [%*zu] 開始: %0#*<PRIx64>、長さ: %5<PRIu64>、CU DIE オフセット: %6<PRId64>\n"
-#: src/readelf.c:4784 src/readelf.c:4938 src/readelf.c:5514 src/readelf.c:6468
-#: src/readelf.c:7000 src/readelf.c:7120 src/readelf.c:7284 src/readelf.c:7709
-#, c-format
-msgid ""
-"\n"
-"DWARF section [%2zu] '%s' at offset %#<PRIx64>:\n"
-msgstr ""
-"\n"
-"オフセット %3$#<PRIx64> の DWARF セクション [%1$2zu] '%2$s':\n"
-
-#: src/readelf.c:4797 src/readelf.c:6494
+#: src/readelf.c:5390 src/readelf.c:8195
#, fuzzy, c-format
msgid ""
"\n"
@@ -5310,113 +4809,154 @@
"\n"
"オフセット %Zu のテーブル:\n"
-#: src/readelf.c:4801 src/readelf.c:5538 src/readelf.c:6505
+#: src/readelf.c:5394 src/readelf.c:5567 src/readelf.c:6551 src/readelf.c:8206
+#: src/readelf.c:8864
#, c-format
msgid "invalid data in section [%zu] '%s'"
msgstr "セクション [%zu] '%s' の不当なデータ"
-#: src/readelf.c:4817
+#: src/readelf.c:5410
#, fuzzy, c-format
msgid ""
"\n"
" Length: %6<PRIu64>\n"
msgstr " (オフセット: %#<PRIx64>)"
-#: src/readelf.c:4829
+#: src/readelf.c:5422
#, fuzzy, c-format
msgid " DWARF version: %6<PRIuFAST16>\n"
msgstr " %s: %<PRId64>\n"
-#: src/readelf.c:4833
+#: src/readelf.c:5426
#, c-format
msgid "unsupported aranges version"
msgstr ""
-#: src/readelf.c:4844
+#: src/readelf.c:5437
#, fuzzy, c-format
msgid " CU offset: %6<PRIx64>\n"
msgstr " (オフセット: %#<PRIx64>)"
-#: src/readelf.c:4850
+#: src/readelf.c:5443
#, fuzzy, c-format
msgid " Address size: %6<PRIu64>\n"
msgstr " (終了オフセット: %#<PRIx64>)"
-#: src/readelf.c:4854
-#, fuzzy, c-format
-msgid "unsupported address size"
-msgstr "アドレス値ではありません"
-
-#: src/readelf.c:4859
+#: src/readelf.c:5452
#, fuzzy, c-format
msgid ""
" Segment size: %6<PRIu64>\n"
"\n"
msgstr " ファイルを %<PRIu64> に設定する\n"
-#: src/readelf.c:4863
-#, c-format
-msgid "unsupported segment size"
-msgstr ""
-
-#: src/readelf.c:4903
-#, fuzzy, c-format
-msgid " %s..%s (%<PRIx64>)\n"
-msgstr " %s: %<PRId64>\n"
-
-#: src/readelf.c:4906
-#, fuzzy, c-format
-msgid " %s..%s\n"
-msgstr " [%6tx] %s..%s\n"
-
-#: src/readelf.c:4915
+#: src/readelf.c:5507
#, c-format
msgid " %zu padding bytes\n"
msgstr ""
-#: src/readelf.c:4933
+#: src/readelf.c:5550
+#, fuzzy, c-format
+msgid "cannot get .debug_rnglists content: %s"
+msgstr ".degub_ranges の内容を得られません: %s"
+
+#: src/readelf.c:5573 src/readelf.c:8870
+#, fuzzy, c-format
+msgid ""
+"Table at Offset 0x%<PRIx64>:\n"
+"\n"
+msgstr " (終了オフセット: %#<PRIx64>)"
+
+#: src/readelf.c:5628 src/readelf.c:8925
+#, fuzzy, c-format
+msgid " Offset entries: %8<PRIu64>\n"
+msgstr " (オフセット: %#<PRIx64>)"
+
+#: src/readelf.c:5644 src/readelf.c:8941
+#, c-format
+msgid " Unknown CU base: "
+msgstr ""
+
+#: src/readelf.c:5646 src/readelf.c:8943
+#, c-format
+msgid " CU [%6<PRIx64>] base: "
+msgstr ""
+
+#: src/readelf.c:5652 src/readelf.c:8949
+#, c-format
+msgid " Not associated with a CU.\n"
+msgstr ""
+
+#: src/readelf.c:5663 src/readelf.c:8960
+#, c-format
+msgid "too many offset entries for unit length"
+msgstr ""
+
+#: src/readelf.c:5667 src/readelf.c:8964
+#, fuzzy, c-format
+msgid " Offsets starting at 0x%<PRIx64>:\n"
+msgstr " 所有者 大きさ\n"
+
+#: src/readelf.c:5719
+#, fuzzy, c-format
+msgid "invalid range list data"
+msgstr "不当なデータ"
+
+#: src/readelf.c:5904 src/readelf.c:9252
+#, c-format
+msgid ""
+" %zu padding bytes\n"
+"\n"
+msgstr ""
+
+#: src/readelf.c:5921
#, c-format
msgid "cannot get .debug_ranges content: %s"
msgstr ".degub_ranges の内容を得られません: %s"
-#: src/readelf.c:4963 src/readelf.c:7027
+#: src/readelf.c:5957 src/readelf.c:9307
+#, c-format
+msgid ""
+"\n"
+" Unknown CU base: "
+msgstr ""
+
+#: src/readelf.c:5959 src/readelf.c:9309
+#, c-format
+msgid ""
+"\n"
+" CU [%6<PRIx64>] base: "
+msgstr ""
+
+#: src/readelf.c:5968 src/readelf.c:9335 src/readelf.c:9361
#, c-format
msgid " [%6tx] <INVALID DATA>\n"
msgstr " [%6tx] <不当なデータ>\n"
-#: src/readelf.c:4985 src/readelf.c:7049
-#, c-format
-msgid " [%6tx] base address %s\n"
+#: src/readelf.c:5989 src/readelf.c:9441
+#, fuzzy, c-format
+msgid ""
+" [%6tx] base address\n"
+" "
msgstr " [%6tx] ベースアドレス %s\n"
-#: src/readelf.c:4992 src/readelf.c:7056
+#: src/readelf.c:5997 src/readelf.c:9449
#, fuzzy, c-format
-msgid " [%6tx] empty list\n"
+msgid " [%6tx] empty list\n"
msgstr ""
"\n"
" [%6tx] ゼロ終端\n"
-#: src/readelf.c:5003
-#, c-format
-msgid " [%6tx] %s..%s\n"
-msgstr " [%6tx] %s..%s\n"
-
-#: src/readelf.c:5005
-#, c-format
-msgid " %s..%s\n"
-msgstr " %s..%s\n"
-
-#: src/readelf.c:5184
+#: src/readelf.c:6252
#, fuzzy
msgid " <INVALID DATA>\n"
msgstr " [%6tx] <不当なデータ>\n"
-#: src/readelf.c:5493
+#: src/readelf.c:6505
#, fuzzy, c-format
msgid "cannot get ELF: %s"
msgstr "次の DIE を得られません: %s"
-#: src/readelf.c:5510
+#: src/readelf.c:6523
#, c-format
msgid ""
"\n"
@@ -5425,7 +4965,7 @@
"\n"
"オフセット %3$#<PRIx64> の フレーム情報呼出しセクション [%1$2zu] '%2$s':\n"
-#: src/readelf.c:5560
+#: src/readelf.c:6573
#, c-format
msgid ""
"\n"
@@ -5434,50 +4974,65 @@
"\n"
" [%6tx] ゼロ終端\n"
-#: src/readelf.c:5653 src/readelf.c:5808
+#: src/readelf.c:6666 src/readelf.c:6820
#, fuzzy, c-format
msgid "invalid augmentation length"
msgstr "不当な拡大エンコード"
-#: src/readelf.c:5668
+#: src/readelf.c:6681
msgid "FDE address encoding: "
msgstr "FDE アドレスエンコード"
-#: src/readelf.c:5674
+#: src/readelf.c:6687
msgid "LSDA pointer encoding: "
msgstr "LSDA ポインターエンコード:"
-#: src/readelf.c:5785
+#: src/readelf.c:6797
#, c-format
msgid " (offset: %#<PRIx64>)"
msgstr " (オフセット: %#<PRIx64>)"
-#: src/readelf.c:5792
+#: src/readelf.c:6804
#, c-format
msgid " (end offset: %#<PRIx64>)"
msgstr " (終了オフセット: %#<PRIx64>)"
-#: src/readelf.c:5829
+#: src/readelf.c:6841
#, c-format
msgid " %-26sLSDA pointer: %#<PRIx64>\n"
msgstr " %-26sLSDA ポインター: %#<PRIx64>\n"
-#: src/readelf.c:5884
-#, c-format
-msgid "cannot get attribute code: %s"
+#: src/readelf.c:6926
+#, fuzzy, c-format
+msgid "DIE [%<PRIx64>] cannot get attribute code: %s"
msgstr "属性コードを得られません: %s"
-#: src/readelf.c:5893
-#, c-format
-msgid "cannot get attribute form: %s"
+#: src/readelf.c:6936
+#, fuzzy, c-format
+msgid "DIE [%<PRIx64>] cannot get attribute form: %s"
msgstr "属性様式を得られません: %s"
-#: src/readelf.c:5908
-#, c-format
-msgid "cannot get attribute value: %s"
+#: src/readelf.c:6958
+#, fuzzy, c-format
+msgid "DIE [%<PRIx64>] cannot get attribute '%s' (%s) value: %s"
msgstr "属性値を得られません: %s"
-#: src/readelf.c:6207
+#: src/readelf.c:7291
+#, fuzzy, c-format
+msgid "invalid file (%<PRId64>): %s"
+msgstr "不当なファイル"
+
+#: src/readelf.c:7295
+#, fuzzy, c-format
+msgid "no srcfiles for CU [%<PRIx64>]"
+msgstr " ファイルを %<PRIu64> に設定する\n"
+
+#: src/readelf.c:7299
+#, fuzzy, c-format
+msgid "couldn't get DWARF CU: %s"
+msgstr "次の DIE を得られません: %s"
+
+#: src/readelf.c:7522
#, c-format
msgid ""
"\n"
@@ -5488,19 +5043,24 @@
"オフセット %3$#<PRIx64> の DWARF セクション [%1$2zu] '%2$s':\n"
" [オフセット]\n"
-#: src/readelf.c:6239
+#: src/readelf.c:7572
+#, fuzzy, c-format
+msgid "cannot get next unit: %s"
+msgstr "次の DIE を得られません: %s"
+
+#: src/readelf.c:7591
#, fuzzy, c-format
msgid ""
" Type unit at offset %<PRIu64>:\n"
" Version: %<PRIu16>, Abbreviation section offset: %<PRIu64>, Address size: "
"%<PRIu8>, Offset size: %<PRIu8>\n"
-" Type signature: %#<PRIx64>, Type offset: %#<PRIx64>\n"
+" Type signature: %#<PRIx64>, Type offset: %#<PRIx64> [%<PRIx64>]\n"
msgstr ""
" オフセット %1$<PRIu64> のコンパイル単位:\n"
" バージョン: %2$<PRIu16>、略語セクションオフセット: %3$<PRIu64>、アドレスの大"
"きさ: %4$<PRIu8>、オフセットの大きさ: %5$<PRIu8>\n"
-#: src/readelf.c:6248
+#: src/readelf.c:7603
#, c-format
msgid ""
" Compilation unit at offset %<PRIu64>:\n"
@@ -5511,35 +5071,50 @@
" バージョン: %2$<PRIu16>、略語セクションオフセット: %3$<PRIu64>、アドレスの大"
"きさ: %4$<PRIu8>、オフセットの大きさ: %5$<PRIu8>\n"
-#: src/readelf.c:6273
+#: src/readelf.c:7613 src/readelf.c:7776
#, c-format
-msgid "cannot get DIE at offset %<PRIu64> in section '%s': %s"
+msgid " Unit type: %s (%<PRIu8>)"
msgstr ""
-"セクション '%2$s' の オフセット %1$<PRIu64> の DIE を得られません: %3$s"
-#: src/readelf.c:6287
+#: src/readelf.c:7640
+#, c-format
+msgid "unknown version (%d) or unit type (%d)"
+msgstr ""
+
+#: src/readelf.c:7669
#, c-format
msgid "cannot get DIE offset: %s"
msgstr "DIE オフセットを得られません: %s"
-#: src/readelf.c:6296
-#, c-format
-msgid "cannot get tag of DIE at offset %<PRIu64> in section '%s': %s"
+#: src/readelf.c:7678
+#, fuzzy, c-format
+msgid "cannot get tag of DIE at offset [%<PRIx64>] in section '%s': %s"
msgstr ""
"セクション '%2$s' 中のオフセット %1$<PRIu64> の DIE のタグを得られません: "
"%3$s"
-#: src/readelf.c:6328
+#: src/readelf.c:7716
#, c-format
msgid "cannot get next DIE: %s\n"
msgstr "次の DIE を得られません: %s\n"
-#: src/readelf.c:6336
+#: src/readelf.c:7724
#, c-format
msgid "cannot get next DIE: %s"
msgstr "次の DIE を得られません: %s"
-#: src/readelf.c:6372
+#: src/readelf.c:7768
+#, fuzzy, c-format
+msgid ""
+" Split compilation unit at offset %<PRIu64>:\n"
+" Version: %<PRIu16>, Abbreviation section offset: %<PRIu64>, Address size: "
+"%<PRIu8>, Offset size: %<PRIu8>\n"
+msgstr ""
+" オフセット %1$<PRIu64> のコンパイル単位:\n"
+" バージョン: %2$<PRIu16>、略語セクションオフセット: %3$<PRIu64>、アドレスの大"
+"きさ: %4$<PRIu8>、オフセットの大きさ: %5$<PRIu8>\n"
+
+#: src/readelf.c:7819
#, fuzzy, c-format
msgid ""
"\n"
@@ -5549,24 +5124,32 @@
"\n"
"オフセット %3$#<PRIx64> の DWARF セクション [%1$2zu] '%2$s':\n"
-#: src/readelf.c:6481
+#: src/readelf.c:8151
+#, fuzzy, c-format
+msgid "unknown form: %s"
+msgstr "不明な様式 %<PRIx64>"
+
+#: src/readelf.c:8182
#, c-format
msgid "cannot get line data section data: %s"
msgstr "ラインデータセクションデータを得られません: %s"
-#: src/readelf.c:6551
+#. Print what we got so far.
+#: src/readelf.c:8284
#, fuzzy, c-format
msgid ""
"\n"
-" Length: %<PRIu64>\n"
-" DWARF version: %<PRIuFAST16>\n"
-" Prologue length: %<PRIu64>\n"
-" Minimum instruction length: %<PRIuFAST8>\n"
-" Maximum operations per instruction: %<PRIuFAST8>\n"
-" Initial value if '%s': %<PRIuFAST8>\n"
-" Line base: %<PRIdFAST8>\n"
-" Line range: %<PRIuFAST8>\n"
-" Opcode base: %<PRIuFAST8>\n"
+" Length: %<PRIu64>\n"
+" DWARF version: %<PRIuFAST16>\n"
+" Prologue length: %<PRIu64>\n"
+" Address size: %zd\n"
+" Segment selector size: %zd\n"
+" Min instruction length: %<PRIuFAST8>\n"
+" Max operations per instruction: %<PRIuFAST8>\n"
+" Initial value if 'is_stmt': %<PRIuFAST8>\n"
+" Line base: %<PRIdFAST8>\n"
+" Line range: %<PRIuFAST8>\n"
+" Opcode base: %<PRIuFAST8>\n"
"\n"
"Opcodes:\n"
msgstr ""
@@ -5582,18 +5165,33 @@
"\n"
"命令コード:\n"
-#: src/readelf.c:6572
+#: src/readelf.c:8306
+#, fuzzy, c-format
+msgid "cannot handle .debug_line version: %u\n"
+msgstr ".degub_ranges の内容を得られません: %s"
+
+#: src/readelf.c:8314
+#, fuzzy, c-format
+msgid "cannot handle address size: %u\n"
+msgstr "アドレス値ではありません"
+
+#: src/readelf.c:8322
+#, fuzzy, c-format
+msgid "cannot handle segment selector size: %u\n"
+msgstr "セクションを得られません: %s"
+
+#: src/readelf.c:8332
#, c-format
msgid "invalid data at offset %tu in section [%zu] '%s'"
msgstr "セクション [%2$zu] '%3$s' 中のオフセット %1$tu に不当なデータ"
-#: src/readelf.c:6587
+#: src/readelf.c:8347
#, c-format
msgid " [%*<PRIuFAST8>] %hhu argument\n"
msgid_plural " [%*<PRIuFAST8>] %hhu arguments\n"
msgstr[0] " [%*<PRIuFAST8>] %hhu パラメーター\n"
-#: src/readelf.c:6595
+#: src/readelf.c:8358
msgid ""
"\n"
"Directory table:"
@@ -5601,17 +5199,29 @@
"\n"
"ディレクトリーテーブル:"
-#: src/readelf.c:6611
+#: src/readelf.c:8364 src/readelf.c:8439
+#, fuzzy, c-format
+msgid " ["
+msgstr " %s: %s\n"
+
+#: src/readelf.c:8433
+#, fuzzy
msgid ""
"\n"
-"File name table:\n"
-" Entry Dir Time Size Name"
+"File name table:"
+msgstr ""
+"\n"
+" 呼出しサイトテーブル:"
+
+#: src/readelf.c:8494
+#, fuzzy
+msgid " Entry Dir Time Size Name"
msgstr ""
"\n"
"ファイル名テーブル:\n"
" Entry Dir 時刻 大きさ 名前"
-#: src/readelf.c:6646
+#: src/readelf.c:8529
msgid ""
"\n"
"Line number statements:"
@@ -5619,215 +5229,218 @@
"\n"
"行 番号 文:"
-#: src/readelf.c:6697
+#: src/readelf.c:8552
#, c-format
msgid "invalid maximum operations per instruction is zero"
msgstr ""
-#: src/readelf.c:6733
+#: src/readelf.c:8586
#, fuzzy, c-format
-msgid " special opcode %u: address+%u = %s, op_index = %u, line%+d = %zu\n"
+msgid " special opcode %u: address+%u = "
msgstr " 特殊命令コード %u: アドレス+%u = %s, 行%+d = %zu\n"
-#: src/readelf.c:6738
+#: src/readelf.c:8590
+#, fuzzy, c-format
+msgid ", op_index = %u, line%+d = %zu\n"
+msgstr " 特殊命令コード %u: アドレス+%u = %s, 行%+d = %zu\n"
+
+#: src/readelf.c:8593
#, c-format
-msgid " special opcode %u: address+%u = %s, line%+d = %zu\n"
-msgstr " 特殊命令コード %u: アドレス+%u = %s, 行%+d = %zu\n"
+msgid ", line%+d = %zu\n"
+msgstr ""
-#: src/readelf.c:6758
+#: src/readelf.c:8611
#, c-format
msgid " extended opcode %u: "
msgstr " 拡張命令コード %u: "
-#: src/readelf.c:6763
+#: src/readelf.c:8616
#, fuzzy
msgid " end of sequence"
msgstr "列の終わり"
-#: src/readelf.c:6782
+#: src/readelf.c:8634
#, fuzzy, c-format
-msgid " set address to %s\n"
+msgid " set address to "
msgstr "アドレスを %s に設定する\n"
-#: src/readelf.c:6809
+#: src/readelf.c:8662
#, fuzzy, c-format
msgid " define new file: dir=%u, mtime=%<PRIu64>, length=%<PRIu64>, name=%s\n"
msgstr ""
"新ファイルを定義する: dir=%u、mtime=%<PRIu64>、長さh=%<PRIu64>、名前=%s\n"
-#: src/readelf.c:6822
+#: src/readelf.c:8675
#, fuzzy, c-format
msgid " set discriminator to %u\n"
msgstr "カラムを %<PRIu64> に設定する\n"
-#: src/readelf.c:6827
+#. Unknown, ignore it.
+#: src/readelf.c:8680
#, fuzzy
msgid " unknown opcode"
msgstr "不明な命令コード"
-#: src/readelf.c:6839
+#. Takes no argument.
+#: src/readelf.c:8692
msgid " copy"
msgstr "複写"
-#: src/readelf.c:6850
+#: src/readelf.c:8701
#, fuzzy, c-format
-msgid " advance address by %u to %s, op_index to %u\n"
+msgid " advance address by %u to "
msgstr "アドレスを %u だけ進めて %s にする\n"
-#: src/readelf.c:6854
-#, fuzzy, c-format
-msgid " advance address by %u to %s\n"
-msgstr "アドレスを %u だけ進めて %s にする\n"
+#: src/readelf.c:8705 src/readelf.c:8761
+#, c-format
+msgid ", op_index to %u"
+msgstr ""
-#: src/readelf.c:6865
+#: src/readelf.c:8715
#, c-format
msgid " advance line by constant %d to %<PRId64>\n"
msgstr "行を定数 %d だけ進めて %<PRId64> にする\n"
-#: src/readelf.c:6873
+#: src/readelf.c:8723
#, c-format
msgid " set file to %<PRIu64>\n"
msgstr " ファイルを %<PRIu64> に設定する\n"
-#: src/readelf.c:6883
+#: src/readelf.c:8733
#, c-format
msgid " set column to %<PRIu64>\n"
msgstr "カラムを %<PRIu64> に設定する\n"
-#: src/readelf.c:6890
+#: src/readelf.c:8740
#, c-format
msgid " set '%s' to %<PRIuFAST8>\n"
msgstr " '%s' を %<PRIuFAST8> に設定する\n"
-#: src/readelf.c:6896
+#. Takes no argument.
+#: src/readelf.c:8746
msgid " set basic block flag"
msgstr "基本ブロックフラグを設定する"
-#: src/readelf.c:6909
+#: src/readelf.c:8757
#, fuzzy, c-format
-msgid " advance address by constant %u to %s, op_index to %u\n"
+msgid " advance address by constant %u to "
msgstr "アドレスを定数 %u だけ済めて %s にする\n"
-#: src/readelf.c:6913
+#: src/readelf.c:8776
#, fuzzy, c-format
-msgid " advance address by constant %u to %s\n"
-msgstr "アドレスを定数 %u だけ済めて %s にする\n"
-
-#: src/readelf.c:6931
-#, fuzzy, c-format
-msgid " advance address by fixed value %u to %s\n"
+msgid " advance address by fixed value %u to \n"
msgstr "アドレスを固定値 %u だけ進めて %s にする\n"
-#: src/readelf.c:6940
+#. Takes no argument.
+#: src/readelf.c:8786
msgid " set prologue end flag"
msgstr "プロローグ終了フラグを設定する"
-#: src/readelf.c:6945
+#. Takes no argument.
+#: src/readelf.c:8791
msgid " set epilogue begin flag"
msgstr "エピローグ開始フラグを設定する"
-#: src/readelf.c:6954
+#: src/readelf.c:8800
#, fuzzy, c-format
msgid " set isa to %u\n"
msgstr " ファイルを %<PRIu64> に設定する\n"
-#: src/readelf.c:6963
+#. This is a new opcode the generator but not we know about.
+#. Read the parameters associated with it but then discard
+#. everything. Read all the parameters for this opcode.
+#: src/readelf.c:8809
#, c-format
msgid " unknown opcode with %<PRIu8> parameter:"
msgid_plural " unknown opcode with %<PRIu8> parameters:"
msgstr[0] " %<PRIu8> 個のパラメーターのある不明な命令コード:"
-#: src/readelf.c:6995
+#: src/readelf.c:8847
+#, fuzzy, c-format
+msgid "cannot get .debug_loclists content: %s"
+msgstr ".debug_loc の内容を得られません: %s"
+
+#: src/readelf.c:9016
+#, fuzzy, c-format
+msgid "invalid loclists data"
+msgstr "不当なデータ"
+
+#: src/readelf.c:9269
#, c-format
msgid "cannot get .debug_loc content: %s"
msgstr ".debug_loc の内容を得られません: %s"
-#: src/readelf.c:7070
-#, c-format
-msgid " [%6tx] %s..%s"
-msgstr " [%6tx] %s..%s"
-
-#: src/readelf.c:7072
-#, c-format
-msgid " %s..%s"
-msgstr " %s..%s"
-
-#: src/readelf.c:7079 src/readelf.c:7967
+#: src/readelf.c:9476 src/readelf.c:10490
#, fuzzy
msgid " <INVALID DATA>\n"
msgstr " [%6tx] <不当なデータ>\n"
-#: src/readelf.c:7131 src/readelf.c:7293
+#: src/readelf.c:9530 src/readelf.c:9693
#, c-format
msgid "cannot get macro information section data: %s"
msgstr "マクロ情報セクションのデータを得られません: %s"
-#: src/readelf.c:7211
+#: src/readelf.c:9610
#, c-format
msgid "%*s*** non-terminated string at end of section"
msgstr "%*s*** 最後のセクションの終端していない文字列"
-#: src/readelf.c:7234
+#: src/readelf.c:9633
#, fuzzy, c-format
msgid "%*s*** missing DW_MACINFO_start_file argument at end of section"
msgstr "%*s*** 最後のセクションの終端していない文字列"
-#: src/readelf.c:7334
+#: src/readelf.c:9734
#, fuzzy, c-format
msgid " Offset: 0x%<PRIx64>\n"
msgstr " 所有者 大きさ\n"
-#: src/readelf.c:7346
+#: src/readelf.c:9746
#, fuzzy, c-format
msgid " Version: %<PRIu16>\n"
msgstr " %s: %<PRId64>\n"
-#: src/readelf.c:7352 src/readelf.c:8086
+#: src/readelf.c:9752 src/readelf.c:10609
#, c-format
msgid " unknown version, cannot parse section\n"
msgstr ""
-#: src/readelf.c:7359
+#: src/readelf.c:9759
#, fuzzy, c-format
msgid " Flag: 0x%<PRIx8>\n"
msgstr " 入口点アドレス : %#<PRIx64>\n"
-#: src/readelf.c:7362
+#: src/readelf.c:9762
#, fuzzy, c-format
msgid " Offset length: %<PRIu8>\n"
msgstr " (オフセット: %#<PRIx64>)"
-#: src/readelf.c:7370
+#: src/readelf.c:9770
#, fuzzy, c-format
msgid " .debug_line offset: 0x%<PRIx64>\n"
msgstr " (終了オフセット: %#<PRIx64>)"
-#: src/readelf.c:7383
+#: src/readelf.c:9795
#, fuzzy, c-format
msgid " extension opcode table, %<PRIu8> items:\n"
msgstr " %<PRIu8> 個のパラメーターのある不明な命令コード:"
-#: src/readelf.c:7390
+#: src/readelf.c:9802
#, c-format
msgid " [%<PRIx8>]"
msgstr ""
-#: src/readelf.c:7402
+#: src/readelf.c:9814
#, fuzzy, c-format
msgid " %<PRIu8> arguments:"
msgstr " [%*<PRIuFAST8>] %hhu パラメーター\n"
-#: src/readelf.c:7430
+#: src/readelf.c:9829
#, c-format
msgid " no arguments."
msgstr ""
-#: src/readelf.c:7667
-#, c-format
-msgid "vendor opcode not verified?"
-msgstr ""
-
-#: src/readelf.c:7695
+#: src/readelf.c:10030
#, c-format
msgid " [%5d] DIE offset: %6<PRId64>, CU DIE offset: %6<PRId64>, name: %s\n"
msgstr ""
@@ -5835,7 +5448,7 @@
# # "オフセット %3$#<PRIx64> の DWARF セクション [%1$2zu] '%2$s':\n"
# # " %4$*s 文字列\n" がエラーになるのは何故? 取り敢えず fuzzy扱い
-#: src/readelf.c:7736
+#: src/readelf.c:10072
#, fuzzy, c-format
msgid ""
"\n"
@@ -5846,12 +5459,37 @@
"オフセット %3$#<PRIx64> の DWARF セクション [%1$2zu] '%2$s':\n"
" %4$*s 文字列\n"
-#: src/readelf.c:7750
-#, c-format
-msgid " *** error while reading strings: %s\n"
+#: src/readelf.c:10087
+#, fuzzy, c-format
+msgid " *** error, missing string terminator\n"
msgstr " *** 文字列の読込み中にエラー: %s\n"
-#: src/readelf.c:7770
+#: src/readelf.c:10115
+#, fuzzy, c-format
+msgid "cannot get .debug_str_offsets section data: %s"
+msgstr ".degub_ranges の内容を得られません: %s"
+
+#: src/readelf.c:10214
+#, fuzzy, c-format
+msgid " Length: %8<PRIu64>\n"
+msgstr " (オフセット: %#<PRIx64>)"
+
+#: src/readelf.c:10216
+#, fuzzy, c-format
+msgid " Offset size: %8<PRIu8>\n"
+msgstr " (オフセット: %#<PRIx64>)"
+
+#: src/readelf.c:10230
+#, fuzzy, c-format
+msgid " DWARF version: %8<PRIu16>\n"
+msgstr " %s: %<PRId64>\n"
+
+#: src/readelf.c:10239
+#, fuzzy, c-format
+msgid " Padding: %8<PRIx16>\n"
+msgstr " (オフセット: %#<PRIx64>)"
+
+#: src/readelf.c:10293
#, c-format
msgid ""
"\n"
@@ -5860,7 +5498,7 @@
"\n"
"呼出しフレーム検索テーブルセクション [%2zu] '.eh_frame_hdr':\n"
-#: src/readelf.c:7872
+#: src/readelf.c:10395
#, c-format
msgid ""
"\n"
@@ -5869,22 +5507,22 @@
"\n"
"例外取扱いテーブルセクション [%2zu] '.gcc_except_table':\n"
-#: src/readelf.c:7895
+#: src/readelf.c:10418
#, c-format
msgid " LPStart encoding: %#x "
msgstr " LPStart コード化: %#x "
-#: src/readelf.c:7907
+#: src/readelf.c:10430
#, c-format
msgid " TType encoding: %#x "
msgstr "TType コード化: %#x "
-#: src/readelf.c:7922
+#: src/readelf.c:10445
#, c-format
msgid " Call site encoding: %#x "
msgstr "呼出しサイトコード化: %#x "
-#: src/readelf.c:7935
+#: src/readelf.c:10458
msgid ""
"\n"
" Call site table:"
@@ -5892,7 +5530,7 @@
"\n"
" 呼出しサイトテーブル:"
-#: src/readelf.c:7949
+#: src/readelf.c:10472
#, c-format
msgid ""
" [%4u] Call site start: %#<PRIx64>\n"
@@ -5905,12 +5543,12 @@
" 離着陸場: %#<PRIx64>\n"
" 行動: %u\n"
-#: src/readelf.c:8022
+#: src/readelf.c:10545
#, c-format
msgid "invalid TType encoding"
msgstr "不当な TType コード化"
-#: src/readelf.c:8048
+#: src/readelf.c:10571
#, fuzzy, c-format
msgid ""
"\n"
@@ -5920,37 +5558,37 @@
"オフセット %3$#<PRIx64> の DWARF セクション [%1$2zu] '%2$s' には %4$zu 個の項"
"目があります:\n"
-#: src/readelf.c:8077
+#: src/readelf.c:10600
#, fuzzy, c-format
msgid " Version: %<PRId32>\n"
msgstr " %s: %<PRId64>\n"
-#: src/readelf.c:8095
+#: src/readelf.c:10618
#, fuzzy, c-format
msgid " CU offset: %#<PRIx32>\n"
msgstr " (オフセット: %#<PRIx64>)"
-#: src/readelf.c:8102
+#: src/readelf.c:10625
#, fuzzy, c-format
msgid " TU offset: %#<PRIx32>\n"
msgstr " (オフセット: %#<PRIx64>)"
-#: src/readelf.c:8109
+#: src/readelf.c:10632
#, fuzzy, c-format
msgid " address offset: %#<PRIx32>\n"
msgstr " (終了オフセット: %#<PRIx64>)"
-#: src/readelf.c:8116
+#: src/readelf.c:10639
#, fuzzy, c-format
msgid " symbol offset: %#<PRIx32>\n"
msgstr " (オフセット: %#<PRIx64>)"
-#: src/readelf.c:8123
+#: src/readelf.c:10646
#, fuzzy, c-format
msgid " constant offset: %#<PRIx32>\n"
msgstr " (終了オフセット: %#<PRIx64>)"
-#: src/readelf.c:8137
+#: src/readelf.c:10660
#, fuzzy, c-format
msgid ""
"\n"
@@ -5960,7 +5598,7 @@
"オフセット %3$#<PRIx64> の DWARF セクション [%1$2zu] '%2$s' には %4$zu 個の項"
"目があります:\n"
-#: src/readelf.c:8162
+#: src/readelf.c:10685
#, fuzzy, c-format
msgid ""
"\n"
@@ -5970,7 +5608,7 @@
"オフセット %3$#<PRIx64> の DWARF セクション [%1$2zu] '%2$s' には %4$zu 個の項"
"目があります:\n"
-#: src/readelf.c:8191
+#: src/readelf.c:10714
#, fuzzy, c-format
msgid ""
"\n"
@@ -5980,7 +5618,7 @@
"オフセット %3$#<PRIx64> の DWARF セクション [%1$2zu] '%2$s' には %4$zu 個の項"
"目があります:\n"
-#: src/readelf.c:8224
+#: src/readelf.c:10746
#, fuzzy, c-format
msgid ""
"\n"
@@ -5989,17 +5627,18 @@
"\n"
"オフセット %#0<PRIx64> に不当なシンボルテーブル\n"
-#: src/readelf.c:8311
+#: src/readelf.c:10884
#, c-format
msgid "cannot get debug context descriptor: %s"
msgstr "デバッグ内容記述子を得られません: %s"
-#: src/readelf.c:8467 src/readelf.c:9089 src/readelf.c:9200 src/readelf.c:9258
+#: src/readelf.c:11247 src/readelf.c:11869 src/readelf.c:11980
+#: src/readelf.c:12038
#, c-format
msgid "cannot convert core note data: %s"
msgstr "コアノートデータの変換ができません: %s"
-#: src/readelf.c:8830
+#: src/readelf.c:11610
#, c-format
msgid ""
"\n"
@@ -6008,21 +5647,21 @@
"\n"
"%*s... < %u 回の繰返し> ..."
-#: src/readelf.c:9337
+#: src/readelf.c:12117
msgid " Owner Data size Type\n"
msgstr " 所有者 データ大きさタイプ\n"
-#: src/readelf.c:9355
+#: src/readelf.c:12135
#, c-format
msgid " %-13.*s %9<PRId32> %s\n"
msgstr " %-13.*s %9<PRId32> %s\n"
-#: src/readelf.c:9405
-#, c-format
-msgid "cannot get content of note section: %s"
+#: src/readelf.c:12185
+#, fuzzy, c-format
+msgid "cannot get content of note: %s"
msgstr "ノートセクションの内容を得られません: %s"
-#: src/readelf.c:9432
+#: src/readelf.c:12212
#, c-format
msgid ""
"\n"
@@ -6032,7 +5671,7 @@
"オフセット %4$#0<PRIx64> の %3$<PRIu64> バイトのノートセクション [%1$2zu] "
"'%2$s':\n"
-#: src/readelf.c:9455
+#: src/readelf.c:12235
#, c-format
msgid ""
"\n"
@@ -6041,7 +5680,7 @@
"\n"
"オフセット %2$#0<PRIx64> の %1$<PRIu64> バイトのノートセグメント:\n"
-#: src/readelf.c:9501
+#: src/readelf.c:12281
#, fuzzy, c-format
msgid ""
"\n"
@@ -6050,12 +5689,12 @@
"\n"
"セクション [%Zu] '%s' にはダンプすべきデータがありません。\n"
-#: src/readelf.c:9518 src/readelf.c:9559
+#: src/readelf.c:12308 src/readelf.c:12359
#, fuzzy, c-format
msgid "cannot get data for section [%zu] '%s': %s"
msgstr "セクション [%Zu] '%s' からデータが得られません: %s"
-#: src/readelf.c:9523
+#: src/readelf.c:12313
#, fuzzy, c-format
msgid ""
"\n"
@@ -6065,7 +5704,7 @@
"オフセット %4$#0<PRIx64> のセクション [%1$Zu] '%2$s' の16進ダン"
"プ、%3$<PRIu64> バイト:\n"
-#: src/readelf.c:9528
+#: src/readelf.c:12318
#, fuzzy, c-format
msgid ""
"\n"
@@ -6076,7 +5715,7 @@
"オフセット %4$#0<PRIx64> のセクション [%1$Zu] '%2$s' の16進ダン"
"プ、%3$<PRIu64> バイト:\n"
-#: src/readelf.c:9542
+#: src/readelf.c:12332
#, fuzzy, c-format
msgid ""
"\n"
@@ -6085,7 +5724,7 @@
"\n"
"セクション [%Zu] '%s' にはダンプすべきデータがありません。\n"
-#: src/readelf.c:9564
+#: src/readelf.c:12364
#, fuzzy, c-format
msgid ""
"\n"
@@ -6095,7 +5734,7 @@
"オフセット %4$#0<PRIx64> 文字列セクション [%1$Zu] '%2$s' には %3$<PRIu64> バ"
"イトあります:\n"
-#: src/readelf.c:9569
+#: src/readelf.c:12369
#, fuzzy, c-format
msgid ""
"\n"
@@ -6106,7 +5745,7 @@
"オフセット %4$#0<PRIx64> 文字列セクション [%1$Zu] '%2$s' には %3$<PRIu64> バ"
"イトあります:\n"
-#: src/readelf.c:9618
+#: src/readelf.c:12418
#, c-format
msgid ""
"\n"
@@ -6115,7 +5754,7 @@
"\n"
"セクション [%lu] がありません"
-#: src/readelf.c:9647
+#: src/readelf.c:12447
#, c-format
msgid ""
"\n"
@@ -6124,12 +5763,12 @@
"\n"
"セクション '%s' がありません"
-#: src/readelf.c:9704
+#: src/readelf.c:12504
#, c-format
msgid "cannot get symbol index of archive '%s': %s"
msgstr "アーカイブのシンボル索引 '%s' を得られません: %s"
-#: src/readelf.c:9707
+#: src/readelf.c:12507
#, c-format
msgid ""
"\n"
@@ -6138,7 +5777,7 @@
"\n"
"アーカイブ '%s' にはシンボル索引がありません\n"
-#: src/readelf.c:9711
+#: src/readelf.c:12511
#, fuzzy, c-format
msgid ""
"\n"
@@ -6147,17 +5786,17 @@
"\n"
"アーカイブ '%s' の索引には %Zu 項目あります:\n"
-#: src/readelf.c:9729
+#: src/readelf.c:12529
#, fuzzy, c-format
msgid "cannot extract member at offset %zu in '%s': %s"
msgstr "'%2$s' の オフセット %1$Zu のメンバーを抽出できません: %3$s"
-#: src/readelf.c:9734
+#: src/readelf.c:12534
#, c-format
msgid "Archive member '%s' contains:\n"
msgstr "アーカイブメンバー '%s' には以下があります:\n"
-#: src/size.c:59
+#: src/size.c:57
msgid ""
"Use the output format FORMAT. FORMAT can be `bsd' or `sysv'. The default "
"is `bsd'"
@@ -6165,180 +5804,182 @@
"出力形式として FORMAT を使ってください。FORMAT は `bsd'か、`sysv' のどちらか"
"です。省略値は `bsd'です"
-#: src/size.c:61
+#: src/size.c:59
msgid "Same as `--format=sysv'"
msgstr "`--format=sysv' と同じ"
-#: src/size.c:62
+#: src/size.c:60
msgid "Same as `--format=bsd'"
msgstr "`--format=bsd' と同じ"
-#: src/size.c:65
+#: src/size.c:63
msgid "Same as `--radix=10'"
msgstr "`--radix=10' と同じ"
-#: src/size.c:66
+#: src/size.c:64
msgid "Same as `--radix=8'"
msgstr "`--radix=8' と同じ"
-#: src/size.c:67
+#: src/size.c:65
msgid "Same as `--radix=16'"
msgstr "`--radix=16' と同じ"
-#: src/size.c:69
+#: src/size.c:67
msgid "Similar to `--format=sysv' output but in one line"
msgstr "`--format=sysv' の出力と似ていますが、1行です"
-#: src/size.c:73
+#: src/size.c:71
msgid "Print size and permission flags for loadable segments"
msgstr "ロード可能セグメントのための印刷の大きさと許可フラグ"
-#: src/size.c:74
+#: src/size.c:72
msgid "Display the total sizes (bsd only)"
msgstr "合計の大きさを表示 (bsd のみ)"
-#: src/size.c:79
+#. Short description of program.
+#: src/size.c:77
msgid "List section sizes of FILEs (a.out by default)."
msgstr "ふぁいる のセクションの大きさの一覧 (省略値は a.out)"
-#: src/size.c:257
+#: src/size.c:241
#, c-format
msgid "Invalid format: %s"
msgstr "不当な形式: %s"
-#: src/size.c:268
+#: src/size.c:252
#, c-format
msgid "Invalid radix: %s"
msgstr "不当な基数: %s"
-#: src/size.c:327
+#: src/size.c:311
#, c-format
msgid "%s: file format not recognized"
msgstr "%s: ファイル形式を認識できません"
-#: src/size.c:433 src/size.c:566
+#: src/size.c:417 src/size.c:550
#, c-format
msgid " (ex %s)"
msgstr " (ex %s)"
-#: src/size.c:591
+#: src/size.c:575
msgid "(TOTALS)\n"
msgstr "(合計)\n"
-#: src/stack.c:488
+#: src/stack.c:483
#, c-format
msgid "-p PID should be a positive process id."
msgstr ""
-#: src/stack.c:494
+#: src/stack.c:489
#, fuzzy, c-format
msgid "Cannot open core file '%s'"
msgstr "アーカイブ '%s' を開くことができません"
-#: src/stack.c:554
+#: src/stack.c:549
#, c-format
msgid "-n MAXFRAMES should be 0 or higher."
msgstr ""
-#: src/stack.c:566
+#: src/stack.c:561
#, c-format
msgid "-e EXEC needs a core given by --core."
msgstr ""
-#: src/stack.c:570
+#: src/stack.c:565
#, c-format
msgid "-1 needs a thread id given by -p."
msgstr ""
-#: src/stack.c:574
+#: src/stack.c:569
#, c-format
msgid "One of -p PID or --core COREFILE should be given."
msgstr ""
-#: src/stack.c:644
+#: src/stack.c:641
#, fuzzy
msgid "Show stack of process PID"
msgstr "検索ツリーを生成できません"
-#: src/stack.c:646
+#: src/stack.c:643
msgid "Show stack found in COREFILE"
msgstr ""
-#: src/stack.c:647
+#: src/stack.c:644
msgid "(optional) EXECUTABLE that produced COREFILE"
msgstr ""
-#: src/stack.c:651
+#: src/stack.c:648
#, fuzzy
msgid "Output selection options:"
msgstr "選択オプションを入力してください:"
-#: src/stack.c:653
+#: src/stack.c:650
#, fuzzy
msgid "Additionally show frame activation"
msgstr "出力選択:"
-#: src/stack.c:655
+#: src/stack.c:652
msgid "Additionally try to lookup DWARF debuginfo name for frame address"
msgstr ""
-#: src/stack.c:658
+#: src/stack.c:655
msgid ""
"Additionally show inlined function frames using DWARF debuginfo if available "
"(implies -d)"
msgstr ""
-#: src/stack.c:660
+#: src/stack.c:657
msgid "Additionally show module file information"
msgstr ""
-#: src/stack.c:662
+#: src/stack.c:659
#, fuzzy
msgid "Additionally show source file information"
msgstr "出力選択:"
-#: src/stack.c:664
+#: src/stack.c:661
msgid ""
"Show all additional information (activation, debugname, inlines, module and "
"source)"
msgstr ""
-#: src/stack.c:666
+#: src/stack.c:663
msgid "Do not resolve address to function symbol name"
msgstr ""
-#: src/stack.c:668
+#: src/stack.c:665
msgid "Show raw function symbol names, do not try to demangle names"
msgstr ""
-#: src/stack.c:670
+#: src/stack.c:667
msgid "Show module build-id, load address and pc offset"
msgstr ""
-#: src/stack.c:672
+#: src/stack.c:669
msgid "Show the backtrace of only one thread"
msgstr ""
-#: src/stack.c:674
+#: src/stack.c:671
msgid "Show at most MAXFRAMES per thread (default 256, use 0 for unlimited)"
msgstr ""
-#: src/stack.c:676
+#: src/stack.c:673
msgid "Show module memory map with build-id, elf and debug files detected"
msgstr ""
-#: src/stack.c:684
+#: src/stack.c:681
msgid ""
-"Print a stack for each thread in a process or core file.\vProgram exits with "
-"return code 0 if all frames were shown without any errors. If some frames "
-"were shown, but there were some non-fatal errors, possibly causing an "
-"incomplete backtrace, the program exits with return code 1. If no frames "
-"could be shown, or a fatal error occured the program exits with return code "
-"2. If the program was invoked with bad or missing arguments it will exit "
-"with return code 64."
+"Print a stack for each thread in a process or core file.\n"
+"\n"
+"Program exits with return code 0 if all frames were shown without any "
+"errors. If some frames were shown, but there were some non-fatal errors, "
+"possibly causing an incomplete backtrace, the program exits with return code "
+"1. If no frames could be shown, or a fatal error occured the program exits "
+"with return code 2. If the program was invoked with bad or missing "
+"arguments it will exit with return code 64."
msgstr ""
-#: src/stack.c:757
+#: src/stack.c:756
#, c-format
msgid "Couldn't show any frames."
msgstr ""
@@ -6373,550 +6014,587 @@
msgid "Alias for --radix=o"
msgstr ""
+#. Short description of program.
#: src/strings.c:84
msgid "Print the strings of printable characters in files."
msgstr ""
-#: src/strings.c:271 src/strings.c:306
+#: src/strings.c:257 src/strings.c:292
#, c-format
msgid "invalid value '%s' for %s parameter"
msgstr ""
-#: src/strings.c:317
+#: src/strings.c:303
#, c-format
msgid "invalid minimum length of matched string size"
msgstr ""
-#: src/strings.c:600
+#: src/strings.c:586
#, c-format
msgid "lseek failed"
msgstr ""
-#: src/strings.c:617 src/strings.c:681
+#: src/strings.c:603 src/strings.c:667
#, c-format
msgid "re-mmap failed"
msgstr ""
-#: src/strings.c:654
+#: src/strings.c:640
#, c-format
msgid "mprotect failed"
msgstr ""
-#: src/strings.c:743
+#: src/strings.c:729
#, c-format
msgid "Skipping section %zd '%s' data outside file"
msgstr ""
-#: src/strip.c:68
+#: src/strip.c:71
msgid "Place stripped output into FILE"
msgstr "はぎ取った出力を ふぁいる に置く"
-#: src/strip.c:69
+#: src/strip.c:72
msgid "Extract the removed sections into FILE"
msgstr "抽出した取り除いたセクションを ふぁいる に置く"
-#: src/strip.c:70
+#: src/strip.c:73
msgid "Embed name FILE instead of -f argument"
msgstr "-f パラメーターの代わりに 名前 ふぁいる を有効にする"
-#: src/strip.c:74
+#: src/strip.c:77
msgid "Remove all debugging symbols"
msgstr "デバッグ用のシンボルを全て取り除く"
-#: src/strip.c:78
+#: src/strip.c:81
msgid "Remove section headers (not recommended)"
msgstr ""
-#: src/strip.c:80
+#: src/strip.c:83
msgid "Copy modified/access timestamps to the output"
msgstr "修正/アクセスタイムスタンプを出力へ複写する"
-#: src/strip.c:82
+#: src/strip.c:85
msgid ""
"Resolve all trivial relocations between debug sections if the removed "
"sections are placed in a debug file (only relevant for ET_REL files, "
"operation is not reversable, needs -f)"
msgstr ""
-#: src/strip.c:84
+#: src/strip.c:87
msgid "Remove .comment section"
msgstr ".comment セクションを取り除く"
-#: src/strip.c:87
-msgid "Relax a few rules to handle slightly broken ELF files"
-msgstr "少し壊れた ELF ファイルを取り扱うためにルールを少し緩和する"
+#: src/strip.c:88
+msgid ""
+"Remove the named section. SECTION is an extended wildcard pattern. May be "
+"given more than once. Only non-allocated sections can be removed."
+msgstr ""
-#: src/strip.c:92
+#: src/strip.c:89
+msgid ""
+"Keep the named section. SECTION is an extended wildcard pattern. May be "
+"given more than once."
+msgstr ""
+
+#. Short description of program.
+#: src/strip.c:96
msgid "Discard symbols from object files."
msgstr "オブジェクトファイルからシンボルを破棄する"
-#: src/strip.c:186
+#: src/strip.c:242
#, c-format
msgid "--reloc-debug-sections used without -f"
msgstr ""
-#: src/strip.c:200
+#: src/strip.c:256
#, c-format
msgid "Only one input file allowed together with '-o' and '-f'"
msgstr "'-o' と '-f' と一緒の場合は入力ファイルは 1 つしか認められません"
-#: src/strip.c:236
+#: src/strip.c:279
#, c-format
msgid "-f option specified twice"
msgstr "-f オプションが 2 回指定されています"
-#: src/strip.c:245
+#: src/strip.c:288
#, c-format
msgid "-F option specified twice"
msgstr "-F オプションが 2 回指定されています"
-#: src/strip.c:254 src/unstrip.c:120
-#, c-format
-msgid "-o option specified twice"
-msgstr "-o オプションが 2 回指定されています"
+#: src/strip.c:347
+#, fuzzy, c-format
+msgid "cannot both keep and remove .comment section"
+msgstr ".comment セクションを取り除く"
-#: src/strip.c:278
-#, c-format
-msgid "-R option supports only .comment section"
-msgstr "-R オプションは .comment セクションのみをサポートします"
-
-#: src/strip.c:320 src/strip.c:344
+#: src/strip.c:372 src/strip.c:396
#, c-format
msgid "cannot stat input file '%s'"
msgstr "入力ファイル '%s' を stat できません"
-#: src/strip.c:334
+#: src/strip.c:386
#, c-format
msgid "while opening '%s'"
msgstr "'%s' を開いている間"
-#: src/strip.c:372
+#: src/strip.c:424
#, c-format
msgid "%s: cannot use -o or -f when stripping archive"
msgstr "%s: アーカイブから抜き出している時は -o や -f は使えません"
-#: src/strip.c:384
+#. We would like to support ar archives, but currently it just
+#. doesn't work at all since we call elf_clone on the members
+#. which doesn't really support ar members.
+#. result = handle_ar (fd, elf, NULL, fname,
+#. preserve_dates ? tv : NULL);
+#.
+#: src/strip.c:436
#, fuzzy, c-format
msgid "%s: no support for stripping archive"
msgstr "%s: アーカイブから抜き出している時は -o や -f は使えません"
-#: src/strip.c:483
+#: src/strip.c:535
#, c-format
msgid "cannot open EBL backend"
msgstr "EBL バックエンドを開けません"
-#: src/strip.c:528
+#: src/strip.c:580
#, fuzzy, c-format
msgid "cannot get number of phdrs"
msgstr "セクション数を決定できません: %s"
-#: src/strip.c:544 src/strip.c:568
+#: src/strip.c:596 src/strip.c:620
#, c-format
msgid "cannot create new file '%s': %s"
msgstr "新しいファイル '%s' を生成できません: %s"
-#: src/strip.c:634
+#: src/strip.c:686
#, c-format
msgid "illformed file '%s'"
msgstr "不適格なファイル '%s'"
-#: src/strip.c:968 src/strip.c:1067
+#: src/strip.c:696
+#, fuzzy, c-format
+msgid "Cannot remove allocated section '%s'"
+msgstr "PLT セクションを割り当てられません: %s"
+
+#: src/strip.c:705
+#, fuzzy, c-format
+msgid "Cannot both keep and remove section '%s'"
+msgstr "0番目のセクションのヘッダーを得られません: %s"
+
+#: src/strip.c:1061 src/strip.c:1160
#, c-format
msgid "while generating output file: %s"
msgstr "出力ファイルを生成している間: %s"
-#: src/strip.c:1033 src/strip.c:2071
+#: src/strip.c:1126 src/strip.c:2208
#, c-format
msgid "%s: error while creating ELF header: %s"
msgstr "%s: ELF ヘッダーを生成している間にエラー: %s"
-#: src/strip.c:1050
+#: src/strip.c:1143
#, c-format
msgid "while preparing output for '%s'"
msgstr "'%s' のための出力を準備している間"
-#: src/strip.c:1108 src/strip.c:1171
+#: src/strip.c:1205 src/strip.c:1268
#, c-format
msgid "while create section header section: %s"
msgstr "セクションヘッダーセクションを生成している間: %s"
-#: src/strip.c:1117
+#: src/strip.c:1214
#, c-format
msgid "cannot allocate section data: %s"
msgstr "セクションデータを割り当てられません: %s"
-#: src/strip.c:1183
+#: src/strip.c:1280
#, c-format
msgid "while create section header string table: %s"
msgstr "セクションヘッダー文字列テーブルを生成中: %s"
-#: src/strip.c:1861
+#: src/strip.c:1287
+#, fuzzy, c-format
+msgid "no memory to create section header string table"
+msgstr "セクションヘッダー文字列テーブルを生成中: %s"
+
+#: src/strip.c:1497
+#, c-format
+msgid "Cannot remove symbol [%zd] from allocated symbol table [%zd]"
+msgstr ""
+
+#: src/strip.c:1994
#, fuzzy, c-format
msgid "bad relocation"
msgstr "リロケーションを表示"
-#: src/strip.c:1982 src/strip.c:2095
+#: src/strip.c:2119 src/strip.c:2232
#, c-format
msgid "while writing '%s': %s"
msgstr "'%s' を書込み中: %s"
-#: src/strip.c:1993
+#: src/strip.c:2130
#, c-format
msgid "while creating '%s'"
msgstr "'%s' を生成中"
-#: src/strip.c:2016
+#: src/strip.c:2153
#, c-format
msgid "while computing checksum for debug information"
msgstr "デバッグ情報のチェックサムを計算中"
-#: src/strip.c:2080
+#: src/strip.c:2217
#, c-format
msgid "%s: error while reading the file: %s"
msgstr "%s: ファイルを読込み中にエラー: %s"
-#: src/strip.c:2120 src/strip.c:2140
+#: src/strip.c:2257 src/strip.c:2277
#, fuzzy, c-format
msgid "while writing '%s'"
msgstr "'%s' を書込み中: %s"
-#: src/strip.c:2177 src/strip.c:2184
+#: src/strip.c:2314 src/strip.c:2321
#, c-format
msgid "error while finishing '%s': %s"
msgstr "'%s' の終了中にエラー: %s"
-#: src/strip.c:2201 src/strip.c:2273
+#: src/strip.c:2338 src/strip.c:2414
#, c-format
msgid "cannot set access and modification date of '%s'"
msgstr "'%s' のアクセスと変更日付を設定できません"
-#: src/unstrip.c:69
+#: src/unstrip.c:70
msgid "Match MODULE against file names, not module names"
msgstr ""
-#: src/unstrip.c:70
+#: src/unstrip.c:71
msgid "Silently skip unfindable files"
msgstr ""
-#: src/unstrip.c:73
+#: src/unstrip.c:74
msgid "Place output into FILE"
msgstr ""
-#: src/unstrip.c:75
+#: src/unstrip.c:76
msgid "Create multiple output files under DIRECTORY"
msgstr ""
-#: src/unstrip.c:76
+#: src/unstrip.c:77
msgid "Use module rather than file names"
msgstr ""
-#: src/unstrip.c:78
+#: src/unstrip.c:79
msgid "Create output for modules that have no separate debug information"
msgstr ""
-#: src/unstrip.c:81
+#: src/unstrip.c:82
msgid "Apply relocations to section contents in ET_REL files"
msgstr ""
-#: src/unstrip.c:83
+#: src/unstrip.c:84
msgid "Only list module and file names, build IDs"
msgstr ""
-#: src/unstrip.c:85
+#: src/unstrip.c:86
msgid "Force combining files even if some ELF headers don't seem to match"
msgstr ""
-#: src/unstrip.c:129
+#: src/unstrip.c:130
#, c-format
msgid "-d option specified twice"
msgstr ""
-#: src/unstrip.c:164
+#: src/unstrip.c:165
#, c-format
msgid "only one of -o or -d allowed"
msgstr ""
-#: src/unstrip.c:173
+#: src/unstrip.c:174
#, c-format
msgid "-n cannot be used with explicit files or -o or -d"
msgstr ""
-#: src/unstrip.c:188
+#: src/unstrip.c:189
#, c-format
msgid "output directory '%s'"
msgstr ""
-#: src/unstrip.c:197
+#: src/unstrip.c:198
#, c-format
msgid "exactly two file arguments are required"
msgstr ""
-#: src/unstrip.c:203
+#: src/unstrip.c:204
#, c-format
msgid "-m, -a, -R, and -i options not allowed with explicit files"
msgstr ""
-#: src/unstrip.c:216
+#: src/unstrip.c:217
#, c-format
msgid "-o or -d is required when using implicit files"
msgstr ""
-#: src/unstrip.c:252
+#: src/unstrip.c:240
#, c-format
msgid "cannot create ELF header: %s"
msgstr ""
-#: src/unstrip.c:257
+#: src/unstrip.c:245
#, c-format
msgid "cannot copy ELF header: %s"
msgstr ""
-#: src/unstrip.c:261 src/unstrip.c:1939 src/unstrip.c:1982
+#: src/unstrip.c:249 src/unstrip.c:1933 src/unstrip.c:1976
#, fuzzy, c-format
msgid "cannot get number of program headers: %s"
msgstr "セクション数を決定できません: %s"
-#: src/unstrip.c:266 src/unstrip.c:1943
+#: src/unstrip.c:254 src/unstrip.c:1937
#, c-format
msgid "cannot create program headers: %s"
msgstr ""
-#: src/unstrip.c:272
+#: src/unstrip.c:260
#, c-format
msgid "cannot copy program header: %s"
msgstr ""
-#: src/unstrip.c:282
+#: src/unstrip.c:270
#, c-format
msgid "cannot copy section header: %s"
msgstr ""
-#: src/unstrip.c:285 src/unstrip.c:1576
+#: src/unstrip.c:273 src/unstrip.c:1568
#, c-format
msgid "cannot get section data: %s"
msgstr ""
-#: src/unstrip.c:287 src/unstrip.c:1578
+#: src/unstrip.c:275 src/unstrip.c:1570
#, c-format
msgid "cannot copy section data: %s"
msgstr ""
-#: src/unstrip.c:311
+#: src/unstrip.c:299
#, c-format
msgid "cannot create directory '%s'"
msgstr ""
-#: src/unstrip.c:383 src/unstrip.c:803 src/unstrip.c:1610
+#: src/unstrip.c:371 src/unstrip.c:791 src/unstrip.c:1602
#, c-format
msgid "cannot get symbol table entry: %s"
msgstr ""
-#: src/unstrip.c:399 src/unstrip.c:620 src/unstrip.c:641 src/unstrip.c:653
-#: src/unstrip.c:1631 src/unstrip.c:1805 src/unstrip.c:1829
+#: src/unstrip.c:387 src/unstrip.c:608 src/unstrip.c:629 src/unstrip.c:641
+#: src/unstrip.c:1623 src/unstrip.c:1799 src/unstrip.c:1823
#, c-format
msgid "cannot update symbol table: %s"
msgstr ""
-#: src/unstrip.c:409
+#: src/unstrip.c:397
#, c-format
msgid "cannot update section header: %s"
msgstr ""
-#: src/unstrip.c:448 src/unstrip.c:459
+#: src/unstrip.c:436 src/unstrip.c:447
#, c-format
msgid "cannot update relocation: %s"
msgstr ""
-#: src/unstrip.c:547
+#: src/unstrip.c:535
#, c-format
msgid "cannot get symbol version: %s"
msgstr ""
-#: src/unstrip.c:560
+#: src/unstrip.c:548
#, c-format
msgid "unexpected section type in [%zu] with sh_link to symtab"
msgstr ""
-#: src/unstrip.c:809
+#: src/unstrip.c:797
#, fuzzy, c-format
msgid "invalid string offset in symbol [%zu]"
msgstr "シンボル %2$sの不正なオフセット %1$zu "
-#: src/unstrip.c:967 src/unstrip.c:1313
+#: src/unstrip.c:955 src/unstrip.c:1305
#, fuzzy, c-format
msgid "cannot read section [%zu] name: %s"
msgstr "セクションデータを割り当てられません: %s"
-#: src/unstrip.c:1008 src/unstrip.c:1027 src/unstrip.c:1062
+#: src/unstrip.c:996 src/unstrip.c:1015 src/unstrip.c:1053
#, c-format
msgid "cannot read '.gnu.prelink_undo' section: %s"
msgstr ""
-#: src/unstrip.c:1048
-#, c-format
-msgid "invalid contents in '%s' section"
-msgstr ""
-
-#: src/unstrip.c:1054
+#: src/unstrip.c:1033
#, c-format
msgid "overflow with shnum = %zu in '%s' section"
msgstr ""
-#: src/unstrip.c:1108 src/unstrip.c:1433
+#: src/unstrip.c:1044
+#, c-format
+msgid "invalid contents in '%s' section"
+msgstr ""
+
+#: src/unstrip.c:1099 src/unstrip.c:1427
#, fuzzy, c-format
msgid "cannot find matching section for [%zu] '%s'"
msgstr "セクション [%zu] '%s' の不当なデータ"
-#: src/unstrip.c:1233 src/unstrip.c:1248 src/unstrip.c:1514 src/unstrip.c:1766
+#: src/unstrip.c:1224 src/unstrip.c:1239 src/unstrip.c:1506 src/unstrip.c:1758
#, c-format
msgid "cannot add section name to string table: %s"
msgstr ""
-#: src/unstrip.c:1257
+#: src/unstrip.c:1248
#, c-format
msgid "cannot update section header string table data: %s"
msgstr ""
-#: src/unstrip.c:1284 src/unstrip.c:1288
+#: src/unstrip.c:1276 src/unstrip.c:1280
#, c-format
msgid "cannot get section header string table section index: %s"
msgstr ""
-#: src/unstrip.c:1292 src/unstrip.c:1296 src/unstrip.c:1529
+#: src/unstrip.c:1284 src/unstrip.c:1288 src/unstrip.c:1521
#, c-format
msgid "cannot get section count: %s"
msgstr ""
-#: src/unstrip.c:1299
+#: src/unstrip.c:1291
#, c-format
msgid "more sections in stripped file than debug file -- arguments reversed?"
msgstr ""
-#: src/unstrip.c:1358 src/unstrip.c:1448
+#: src/unstrip.c:1350 src/unstrip.c:1442
#, c-format
msgid "cannot read section header string table: %s"
msgstr ""
-#: src/unstrip.c:1508
+#: src/unstrip.c:1500
#, c-format
msgid "cannot add new section: %s"
msgstr ""
-#: src/unstrip.c:1618
+#: src/unstrip.c:1610
#, fuzzy, c-format
msgid "symbol [%zu] has invalid section index"
msgstr "不当なセクション索引"
-#: src/unstrip.c:1900
+#: src/unstrip.c:1894
#, fuzzy, c-format
msgid "cannot read section data: %s"
msgstr "セクションデータを割り当てられません: %s"
-#: src/unstrip.c:1921
+#: src/unstrip.c:1915
#, c-format
msgid "cannot get ELF header: %s"
msgstr ""
-#: src/unstrip.c:1953
+#: src/unstrip.c:1923
+#, c-format
+msgid "cannot update ELF header: %s"
+msgstr "ELF ヘッダーを更新できません: %s"
+
+#: src/unstrip.c:1947
#, c-format
msgid "cannot update program header: %s"
msgstr ""
-#: src/unstrip.c:1958 src/unstrip.c:2040
+#: src/unstrip.c:1952 src/unstrip.c:2034
#, c-format
msgid "cannot write output file: %s"
msgstr ""
-#: src/unstrip.c:2009
+#: src/unstrip.c:2003
#, c-format
msgid "DWARF data not adjusted for prelinking bias; consider prelink -u"
msgstr ""
-#: src/unstrip.c:2012
+#: src/unstrip.c:2006
#, c-format
msgid ""
"DWARF data in '%s' not adjusted for prelinking bias; consider prelink -u"
msgstr ""
-#: src/unstrip.c:2031 src/unstrip.c:2082 src/unstrip.c:2094 src/unstrip.c:2180
+#: src/unstrip.c:2025 src/unstrip.c:2076 src/unstrip.c:2088 src/unstrip.c:2174
#, c-format
msgid "cannot create ELF descriptor: %s"
msgstr ""
-#: src/unstrip.c:2073
+#: src/unstrip.c:2067
msgid "WARNING: "
msgstr ""
-#: src/unstrip.c:2075
+#: src/unstrip.c:2069
msgid ", use --force"
msgstr ""
-#: src/unstrip.c:2098
+#: src/unstrip.c:2092
msgid "ELF header identification (e_ident) different"
msgstr ""
-#: src/unstrip.c:2101
+#: src/unstrip.c:2095
msgid "ELF header type (e_type) different"
msgstr ""
-#: src/unstrip.c:2104
+#: src/unstrip.c:2098
msgid "ELF header machine type (e_machine) different"
msgstr ""
-#: src/unstrip.c:2107
+#: src/unstrip.c:2101
msgid "stripped program header (e_phnum) smaller than unstripped"
msgstr ""
-#: src/unstrip.c:2137
+#: src/unstrip.c:2131
#, c-format
msgid "cannot find stripped file for module '%s': %s"
msgstr ""
-#: src/unstrip.c:2141
+#: src/unstrip.c:2135
#, c-format
msgid "cannot open stripped file '%s' for module '%s': %s"
msgstr ""
-#: src/unstrip.c:2156
+#: src/unstrip.c:2150
#, c-format
msgid "cannot find debug file for module '%s': %s"
msgstr ""
-#: src/unstrip.c:2160
+#: src/unstrip.c:2154
#, c-format
msgid "cannot open debug file '%s' for module '%s': %s"
msgstr ""
-#: src/unstrip.c:2173
+#: src/unstrip.c:2167
#, c-format
msgid "module '%s' file '%s' is not stripped"
msgstr ""
-#: src/unstrip.c:2204
+#: src/unstrip.c:2198
#, c-format
msgid "cannot cache section addresses for module '%s': %s"
msgstr ""
-#: src/unstrip.c:2337
+#: src/unstrip.c:2331
#, c-format
msgid "no matching modules found"
msgstr ""
-#: src/unstrip.c:2346
+#: src/unstrip.c:2340
#, c-format
msgid "matched more than one module"
msgstr ""
-#: src/unstrip.c:2390
+#: src/unstrip.c:2384
msgid ""
"STRIPPED-FILE DEBUG-FILE\n"
"[MODULE...]"
msgstr ""
-#: src/unstrip.c:2391
+#: src/unstrip.c:2385
msgid ""
-"Combine stripped files with separate symbols and debug information.\vThe "
-"first form puts the result in DEBUG-FILE if -o was not given.\n"
+"Combine stripped files with separate symbols and debug information.\n"
+"\n"
+"The first form puts the result in DEBUG-FILE if -o was not given.\n"
"\n"
"MODULE arguments give file name patterns matching modules to process.\n"
"With -f these match the file name of the main (stripped) file (slashes are "
@@ -6940,7 +6618,7 @@
"was found, or . if FILE contains the debug information."
msgstr ""
-#: tests/backtrace.c:427
+#: tests/backtrace.c:442
msgid "Run executable"
msgstr ""
@@ -6953,6 +6631,541 @@
msgid "Show instances of inlined functions"
msgstr ""
+#~ msgid "%s+%#<PRIx64> <%s+%#<PRIx64>>"
+#~ msgstr "%s+%#<PRIx64> <%s+%#<PRIx64>>"
+
+#~ msgid "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
+#~ msgstr "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
+
+#~ msgid "%#<PRIx64> <%s+%#<PRIx64>>"
+#~ msgstr "%#<PRIx64> <%s+%#<PRIx64>>"
+
+#~ msgid "%#0*<PRIx64> <%s+%#<PRIx64>>"
+#~ msgstr "%#0*<PRIx64> <%s+%#<PRIx64>>"
+
+#~ msgid "%s+%#<PRIx64> <%s>"
+#~ msgstr "%s+%#<PRIx64> <%s>"
+
+#~ msgid "%s+%#0*<PRIx64> <%s>"
+#~ msgstr "%s+%#0*<PRIx64> <%s>"
+
+#~ msgid "%#<PRIx64> <%s>"
+#~ msgstr "%#<PRIx64> <%s>"
+
+#~ msgid "%#0*<PRIx64> <%s>"
+#~ msgstr "%#0*<PRIx64> <%s>"
+
+#~ msgid "%s+%#<PRIx64>"
+#~ msgstr "%s+%#<PRIx64>"
+
+#~ msgid "%s+%#0*<PRIx64>"
+#~ msgstr "%s+%#0*<PRIx64>"
+
+#, fuzzy
+#~ msgid " %s..%s (%<PRIx64>)\n"
+#~ msgstr " %s: %<PRId64>\n"
+
+#, fuzzy
+#~ msgid " %s..%s\n"
+#~ msgstr " [%6tx] %s..%s\n"
+
+#, fuzzy
+#~ msgid " advance address by %u to %s, op_index to %u\n"
+#~ msgstr "アドレスを %u だけ進めて %s にする\n"
+
+#, fuzzy
+#~ msgid " advance address by constant %u to %s, op_index to %u\n"
+#~ msgstr "アドレスを定数 %u だけ済めて %s にする\n"
+
+#~ msgid " [%6tx] %s..%s\n"
+#~ msgstr " [%6tx] %s..%s\n"
+
+#~ msgid " %s..%s\n"
+#~ msgstr " %s..%s\n"
+
+#~ msgid "cannot get DIE at offset %<PRIu64> in section '%s': %s"
+#~ msgstr ""
+#~ "セクション '%2$s' の オフセット %1$<PRIu64> の DIE を得られません: %3$s"
+
+#~ msgid " [%6tx] %s..%s"
+#~ msgstr " [%6tx] %s..%s"
+
+#~ msgid " %s..%s"
+#~ msgstr " %s..%s"
+
+#~ msgid "-R option supports only .comment section"
+#~ msgstr "-R オプションは .comment セクションのみをサポートします"
+
+#~ msgid "Written by %s.\n"
+#~ msgstr "%s によって書かれました。\n"
+
+#~ msgid "cannot allocate PLTREL section: %s"
+#~ msgstr "PLTREL セクションを割り当てられません: %s"
+
+#~ msgid "cannot allocate GOT section: %s"
+#~ msgstr "GOT セクションを割り当てられません: %s"
+
+#~ msgid "cannot allocate GOTPLT section: %s"
+#~ msgstr "GOTPLT セクションを割り当てられません: %s"
+
+#~ msgid "initial-executable TLS relocation cannot be used "
+#~ msgstr "最初に実行される TLS リロケーションが使用されません "
+
+#~ msgid "Input File Control:"
+#~ msgstr "入力ファイル制御:"
+
+#~ msgid "Include whole archives in the output from now on."
+#~ msgstr "今から出力中の全アーカイブを含める。"
+
+#, fuzzy
+#~ msgid "Stop including the whole archives in the output."
+#~ msgstr "出力中の全アーカイブを含めるのを止める。"
+
+#~ msgid "FILE"
+#~ msgstr "ふぁいる"
+
+#~ msgid "Start a group."
+#~ msgstr "グループの開始。"
+
+#~ msgid "End a group."
+#~ msgstr "グループの終了。"
+
+#~ msgid "PATH"
+#~ msgstr "パス"
+
+#~ msgid "Add PATH to list of directories files are searched in."
+#~ msgstr "ファイルが検索されるディレクトリーの一覧にPATHを追加する。"
+
+#~ msgid "Only set DT_NEEDED for following dynamic libs if actually used"
+#~ msgstr ""
+#~ "実際に使用されるのなら以下のダイナミックライブラリーに DT_NEEDED を設定す"
+#~ "る"
+
+#~ msgid "Always set DT_NEEDED for following dynamic libs"
+#~ msgstr "以下のダイナミックライブラリーに常に DT_NEEDED を設定する"
+
+#~ msgid "Ignore LD_LIBRARY_PATH environment variable."
+#~ msgstr "LD_LIBRARY_PATH 環境変数を無視する。"
+
+#~ msgid "Output File Control:"
+#~ msgstr "出力ファイル制御:"
+
+#~ msgid "Place output in FILE."
+#~ msgstr "出力を ふぁいる に置く。"
+
+#~ msgid "Object is marked to not use default search path at runtime."
+#~ msgstr "オブジェクトは実行時に省略値の検索パスを使わないと記されています。"
+
+#~ msgid "Same as --whole-archive."
+#~ msgstr "--whole-archive と同じ。"
+
+#~ msgid ""
+#~ "Default rules of extracting from archive; weak references are not enough."
+#~ msgstr ""
+#~ "アーカイブから抽出する時の省略値の規則: 弱い参照では十分ではありません。"
+
+#~ msgid "Weak references cause extraction from archive."
+#~ msgstr "弱い参照はアーカイブから抽出します。"
+
+#~ msgid "Allow multiple definitions; first is used."
+#~ msgstr "複数の定義を認めます: 最初を使用します。"
+
+#~ msgid "Disallow/allow undefined symbols in DSOs."
+#~ msgstr "DSO 中の未定義のシンボルを認めない/認める。"
+
+#~ msgid "Object requires immediate handling of $ORIGIN."
+#~ msgstr "オブジェクトには %ORIGIN の直接ハンドルが必要です。"
+
+#~ msgid "Relocation will not be processed lazily."
+#~ msgstr "リロケーションは遅延処理されません。"
+
+#~ msgid "Object cannot be unloaded at runtime."
+#~ msgstr "オプションは実行時にはアンロードできません。"
+
+#~ msgid "Mark object to be initialized first."
+#~ msgstr "オブジェクトは最初に初期化されると記します。"
+
+#~ msgid "Enable/disable lazy-loading flag for following dependencies."
+#~ msgstr "以下の依存性のための遅延ロードを有効/無効にします。"
+
+#~ msgid "Mark object as not loadable with 'dlopen'."
+#~ msgstr "'dlopen' でロードできないと記します。"
+
+#~ msgid "Ignore/record dependencies on unused DSOs."
+#~ msgstr "使用されない DSO の依存性を無視/記録します。"
+
+#~ msgid "Generated DSO will be a system library."
+#~ msgstr "生成された DSO はシステムライブラリーになります。"
+
+#~ msgid "ADDRESS"
+#~ msgstr "アドレス"
+
+#~ msgid "Set entry point address."
+#~ msgstr "入口点アドレスを設定します。"
+
+#~ msgid "Do not link against shared libraries."
+#~ msgstr "共用ライブラリーに対してリンクを設定してはいけません。"
+
+#~ msgid "Prefer linking against shared libraries."
+#~ msgstr "共用ライブラリーに対してリンクを好みます。"
+
+#~ msgid "Export all dynamic symbols."
+#~ msgstr "全ダイナミックシンボルをエクスポートします。"
+
+#~ msgid "Strip all symbols."
+#~ msgstr "全シンボルを取り除きます。"
+
+#~ msgid "Strip debugging symbols."
+#~ msgstr "デバッグシンボルを取り除きます。"
+
+#~ msgid "Assume pagesize for the target system to be SIZE."
+#~ msgstr "ターゲットシステムのページサイズを SIZE と見做します。"
+
+#~ msgid "Set runtime DSO search path."
+#~ msgstr "実行時 DSO 検索パスを設定します。"
+
+#~ msgid "Set link time DSO search path."
+#~ msgstr "リンク時 DSO 検索パスを設定します。"
+
+#~ msgid "Generate dynamic shared object."
+#~ msgstr "動的共用オブジェクトを生成します。"
+
+#~ msgid "Generate relocatable object."
+#~ msgstr "リロケータブルオブジェクトを生成します。"
+
+#~ msgid "Causes symbol not assigned to a version be reduced to local."
+#~ msgstr "バージョンが指定されていないシンボルはローカルに減少します。"
+
+#~ msgid "Remove unused sections."
+#~ msgstr "使用されていないセクションを取り除きます。"
+
+#~ msgid "Don't remove unused sections."
+#~ msgstr "利用されていていセクションを取り除いてはいけません。"
+
+#~ msgid "Set soname of shared object."
+#~ msgstr "共用ライブラリーの so 名を設定します。"
+
+#~ msgid "Set the dynamic linker name."
+#~ msgstr "動的リンカーの名前を設定します。"
+
+#~ msgid "Add/suppress addition indentifying link-editor to .comment section."
+#~ msgstr ""
+#~ ".comment セクションにリンクエディターを識別する追加情報を追加/抑止します。"
+
+#~ msgid "Create .eh_frame_hdr section"
+#~ msgstr ".eh_frame_hdr セクションを生成します"
+
+#~ msgid "Set hash style to sysv, gnu or both."
+#~ msgstr "ハッシュ形式を sysvか、gnu、両方のどれかに設定します。"
+
+#~ msgid "Generate build ID note (md5, sha1 (default), uuid)."
+#~ msgstr "ビルド ID ノート (md5、sh1 (省略値)、uuid) を生成します。"
+
+#~ msgid "Linker Operation Control:"
+#~ msgstr "リンカー操作制御:"
+
+#~ msgid "Verbose messages."
+#~ msgstr "饒舌メッセージ。"
+
+#~ msgid "Trace file opens."
+#~ msgstr "ファイルのオープンを追跡します。"
+
+#~ msgid "Trade speed for less memory usage"
+#~ msgstr "速度と引き換えにメモリー使用量を減らします"
+
+#~ msgid "LEVEL"
+#~ msgstr "れべる"
+
+#~ msgid "Set optimization level to LEVEL."
+#~ msgstr "最適化レベルを れべる に設定します。"
+
+#~ msgid "Use linker script in FILE."
+#~ msgstr "ふぁいる でリンカースクリプトを使用します。"
+
+#~ msgid "Select to get parser debug information"
+#~ msgstr "パーサーのデバッグ情報を得るように選択します"
+
+#~ msgid "Read version information from FILE."
+#~ msgstr "ふぁいる からバージョン情報を読みます。"
+
+#~ msgid "Set emulation to NAME."
+#~ msgstr "エミュレーションを なまえ に設定します。"
+
+#~ msgid "Combine object and archive files."
+#~ msgstr "オブジェクトとアーカイブファイルを一体化します。"
+
+#~ msgid "[FILE]..."
+#~ msgstr "[ふぁいる]..."
+
+#~ msgid "At least one input file needed"
+#~ msgstr "少なくとも 1 つの入力ファイルが必要です"
+
+#~ msgid "error while preparing linking"
+#~ msgstr "リンクの準備中にエラー"
+
+#~ msgid "cannot open linker script '%s'"
+#~ msgstr "リンカースクリプト '%s' を開けません"
+
+#~ msgid "-( without matching -)"
+#~ msgstr "-( 何も一致しない -)"
+
+#~ msgid "only one option of -G and -r is allowed"
+#~ msgstr "-G か -r のどちらかひとつのオプションだけ認められます"
+
+#~ msgid "more than one '-m' parameter"
+#~ msgstr "-m パラメーターが1つを越えています"
+
+#~ msgid "unknown option `-%c %s'"
+#~ msgstr "不明なオプション `%c %s'"
+
+#~ msgid "invalid page size value '%s': ignored"
+#~ msgstr "不当なページサイズ値 '%s': 無視しました"
+
+#~ msgid "invalid hash style '%s'"
+#~ msgstr "不当なハッシュスタイル '%s'"
+
+#~ msgid "invalid build-ID style '%s'"
+#~ msgstr "不当なビルド-ID スタイル '%s'"
+
+#~ msgid "More than one output file name given."
+#~ msgstr "ひとつを越える出力ファイル名が与えられました。"
+
+#~ msgid "Invalid optimization level `%s'"
+#~ msgstr "不当な最適化レベル `%s'"
+
+#~ msgid "nested -( -) groups are not allowed"
+#~ msgstr "ネストされた -( -) グループは認められません"
+
+#~ msgid "-) without matching -("
+#~ msgstr "対応する -( がない -)"
+
+#~ msgid "unknown option '-%c %s'"
+#~ msgstr "不明なオプション '-%c %s'"
+
+#~ msgid "could not find input file to determine output file format"
+#~ msgstr "出力ファイル形式を決定するための入力ファイルが見つかりません"
+
+#~ msgid "try again with an appropriate '-m' parameter"
+#~ msgstr "適切な '-m' パラメーターを付けて再試行してください"
+
+#~ msgid "cannot read version script '%s'"
+#~ msgstr "バージョンスクリプト '%s' を読めません"
+
+#~ msgid "duplicate definition of '%s' in linker script"
+#~ msgstr "リンカースクリプトに '%s' の重複定義"
+
+#~ msgid "cannot create string table"
+#~ msgstr "文字列テーブルを生成できません"
+
+#~ msgid "cannot load ld backend library '%s': %s"
+#~ msgstr "ld バックエンドライブラリー '%s' をロードできません: %s"
+
+#~ msgid "cannot find init function in ld backend library '%s': %s"
+#~ msgstr "ld バックエンドライブラリー '%s' に初期化機能が見つかりません: %s "
+
+#~ msgid "%s listed more than once as input"
+#~ msgstr "入力に %s が 1回を越えて書かれています"
+
+#~ msgid "%s (for -l%s)\n"
+#~ msgstr "%s (-l%s 用)\n"
+
+#~ msgid "%s (for DT_NEEDED %s)\n"
+#~ msgstr "%s (DT_NEEDED %s 用)\n"
+
+#~ msgid "Warning: type of `%s' changed from %s in %s to %s in %s"
+#~ msgstr ""
+#~ "警告: `%1$s' のタイプが %3$s の %2$s から %5$s の %4$s に変更されました"
+
+#~ msgid ""
+#~ "Warning: size of `%s' changed from %<PRIu64> in %s to %<PRIu64> in %s"
+#~ msgstr ""
+#~ "警告: `%1$s の大きさが %3$s の %2$<PRIu64> から %5$s の %4$<PRIu64> に変更"
+#~ "されました"
+
+#~ msgid "(%s+%#<PRIx64>): multiple definition of %s `%s'\n"
+#~ msgstr "(%s+%#<PRIx64>): %s の複数定義 '%s'\n"
+
+#~ msgid "(%s+%#<PRIx64>): first defined here\n"
+#~ msgstr "(%s+%#<PRIx64>): 最初の定義はここ\n"
+
+#~ msgid "%s: cannot get section group data: %s"
+#~ msgstr "%s: セクショングループデータを得られません: %s"
+
+#~ msgid "%s: section '%s' with group flag set does not belong to any group"
+#~ msgstr ""
+#~ "%s: グループフラグが設定されているセクション '%s' はどのグループにも属して"
+#~ "いません"
+
+#~ msgid "%s: section [%2d] '%s' is not in the correct section group"
+#~ msgstr ""
+#~ "%s: セクション [%2d] '%s& は正しいセクショングループに入っていません"
+
+#~ msgid "%s: invalid ELF file (%s:%d)\n"
+#~ msgstr "%s: 不当な ELF ファイル (%s:%d)\n"
+
+#~ msgid "%s: only files of type ET_REL might contain section groups"
+#~ msgstr ""
+#~ "%s: タイプ ET_REL のファイルのみセクショングループを含むことができます"
+
+#~ msgid "%s: cannot determine signature of section group [%2zd] '%s': %s"
+#~ msgstr "%s: セクショングループ [%2zd] '%s' の署名を決定できません: %s"
+
+#~ msgid "%s: cannot get content of section group [%2zd] '%s': %s'"
+#~ msgstr "%s: セクショングループ [%2zd] '%s' の内容を得られません: %s'"
+
+#~ msgid ""
+#~ "%s: group member %zu of section group [%2zd] '%s' has too high index: "
+#~ "%<PRIu32>"
+#~ msgstr ""
+#~ "%1$s: セクショングループ [%3$2zd] '%4$s' のグループメンバー %2$zu は大きす"
+#~ "ぎるインデックスを持っています: %5$<PRIu32>"
+
+#~ msgid "%s: section '%s' has unknown type: %d"
+#~ msgstr "%s: セクション '%s' は不明なタイプを持っています: %d"
+
+#~ msgid "cannot get descriptor for ELF file (%s:%d): %s\n"
+#~ msgstr "ELF ファイル (%s:%d) のための記述子を得られません: %s\n"
+
+#~ msgid "cannot read archive `%s': %s"
+#~ msgstr "アーカイブ `%s' を読めません: %s"
+
+#~ msgid "file of type %s cannot be linked in\n"
+#~ msgstr "%s のファイルタイプがリンクされていません\n"
+
+#~ msgid "%s: input file incompatible with ELF machine type %s\n"
+#~ msgstr "%s: 入力ファイルは ELF マシンタイプ %s と互換性がありません\n"
+
+#~ msgid "%s: cannot get section header string table index: %s\n"
+#~ msgstr ""
+#~ "%s: セクションヘッダー文字列テーブルインデックスを得られません: %s\n"
+
+#~ msgid "cannot use DSO '%s' when generating relocatable object file"
+#~ msgstr "リロケータブルオブジェクトファイル生成時に DSO '%s' を使えません"
+
+#~ msgid "input file '%s' ignored"
+#~ msgstr "入力ファイル '%s' を無視しました"
+
+#~ msgid "undefined symbol `%s' in %s"
+#~ msgstr "%2$s 中に未定義のシンボル `%1$s'"
+
+#~ msgid "cannot create ELF descriptor for output file: %s"
+#~ msgstr "出力ファイル用の ELF 記述子を生成できません: %s"
+
+#~ msgid "could not create ELF header for output file: %s"
+#~ msgstr "出力ファイル用の ELF ヘッダーを生成できませんでした: %s"
+
+#~ msgid "cannot create section for output file: %s"
+#~ msgstr "出力ファイル用のセクションを生成できません: %s"
+
+#~ msgid "address computation expression contains variable '%s'"
+#~ msgstr "アドレス計算式が変数 '%s' を含んでいます"
+
+#~ msgid ""
+#~ "argument '%<PRIuMAX>' of ALIGN in address computation expression is no "
+#~ "power of two"
+#~ msgstr ""
+#~ "アドレス計算式中の ALIGN のパラメーター %<PRIuMAX> が 2 の累乗ではありませ"
+#~ "ん"
+
+#~ msgid "cannot find entry symbol '%s': defaulting to %#0*<PRIx64>"
+#~ msgstr ""
+#~ "エントリーシンボル '%s' が見つかりません: デフォルトの %#0*<PRIx64> にしま"
+#~ "す"
+
+#~ msgid "no entry symbol specified: defaulting to %#0*<PRIx64>"
+#~ msgstr ""
+#~ "エントリーシンボルが指定されていません: デフォルトの %#0*<PRIx64> にします"
+
+#~ msgid "cannot create GNU hash table section for output file: %s"
+#~ msgstr "出力ファイル用の GNU ハッシュテーブルセクションを生成できません: %s"
+
+#~ msgid "cannot create hash table section for output file: %s"
+#~ msgstr "出力ファイル用のハッシュテーブルセクションを生成できません: %s"
+
+#~ msgid "cannot create build ID section: %s"
+#~ msgstr "ビルド ID セクションを生成できません: %s"
+
+#~ msgid "cannot convert section data to file format: %s"
+#~ msgstr "セクションデータをファイル形式に変換できません: %s"
+
+#~ msgid "cannot convert section data to memory format: %s"
+#~ msgstr "セクションデータをメモリー形式に変換できません: %s"
+
+#~ msgid "cannot read enough data for UUID"
+#~ msgstr "UUID に十分なデータを読めません"
+
+#~ msgid "cannot create symbol table for output file: %s"
+#~ msgstr "出力ファイル用のシンボルテーブルを生成できません: %s"
+
+#~ msgid "section index too large in dynamic symbol table"
+#~ msgstr "動的シンボルテーブルのセクションインデックスが大きすぎます"
+
+#~ msgid "cannot create versioning section: %s"
+#~ msgstr "バージョニングセクションを生成できません: %s"
+
+#~ msgid "cannot create dynamic symbol table for output file: %s"
+#~ msgstr "出力ファイル用の動的シンボルテーブルを生成できません: %s"
+
+#~ msgid "cannot create versioning data: %s"
+#~ msgstr "バージョニングデータを生成できません: %s"
+
+#~ msgid "cannot create section header string section: %s"
+#~ msgstr "セクションヘッダー文字列セクションを生成できません: %s"
+
+#~ msgid "cannot create section header string section"
+#~ msgstr "セクションヘッダー文字列セクションを生成できません"
+
+#~ msgid "cannot create program header: %s"
+#~ msgstr "プログラムヘッダーを生成できません: %s"
+
+#~ msgid "while determining file layout: %s"
+#~ msgstr "ファイルレイアウトを決定中: %s"
+
+#~ msgid "internal error: non-nobits section follows nobits section"
+#~ msgstr "内部エラー: 非 nobits セクションが nobits セクションに続きます"
+
+#~ msgid "linker backend didn't specify function to relocate section"
+#~ msgstr ""
+#~ "リンカーバックエンドがセクションをリロケートするための機能を指定していませ"
+#~ "ん"
+
+#~ msgid "while writing output file: %s"
+#~ msgstr "出力ファイルに書込み中: %s"
+
+#~ msgid "while finishing output file: %s"
+#~ msgstr "出力ファイルの仕上げ中: %s"
+
+#~ msgid "cannot stat output file"
+#~ msgstr "出力ファイルを stat できません"
+
+#~ msgid "WARNING: temporary output file overwritten before linking finished"
+#~ msgstr "警告: リンクを仕上げる前に一時出力ファイルが上書きされました"
+
+#~ msgid "no machine specific '%s' implementation"
+#~ msgstr "マシン固有の '%s' 実装はありません"
+
+#~ msgid "mode for segment invalid\n"
+#~ msgstr "セグメント用のモードが不当です\n"
+
+#~ msgid "while reading version script '%s': %s at line %d"
+#~ msgstr "バージョンスクリプト '%1$s' 読込み中: %3$d 行目の %2$s"
+
+#~ msgid "while reading linker script '%s': %s at line %d"
+#~ msgstr "リンカースクリプト '%1$s' 読込み中: %3$d 行目の %2$s"
+
+#, fuzzy
+#~ msgid ""
+#~ "symbol '%s' is declared both local and global for unnamed version '%s'"
+#~ msgstr "名前なしバージョン用のローカルとグローバルで宣言されたシンボル '%s'"
+
+#, fuzzy
+#~ msgid "symbol '%s' is declared both local and global for version '%s'"
+#~ msgstr ""
+#~ "バージョン '%2$s' 用のローカルとグローバルで宣言されたシンボル '%1$s'"
+
+#~ msgid "default visibility set as local and global"
+#~ msgstr "ローカルとグローバルに設定されたデフォルトの可視性"
+
#, fuzzy
#~ msgid "cannot attach to core"
#~ msgstr "検索ツリーを生成できません"
@@ -6969,10 +7182,6 @@
#~ msgid "unknown user attribute %hx"
#~ msgstr "不明な利用者属性 %hx"
-#, fuzzy
-#~ msgid "unknown form %#<PRIx64>"
-#~ msgstr "不明な様式 %<PRIx64>"
-
#~ msgid ""
#~ "\n"
#~ "\n"
diff --git a/po/nl.po b/po/nl.po
index fa60868..ff3e5d5 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -5640,7 +5640,7 @@
#: src/unstrip.c:2248
msgid ""
-"Combine stripped files with separate symbols and debug information.\vThe "
+"Combine stripped files with separate symbols and debug information.\n\nThe "
"first form puts the result in DEBUG-FILE if -o was not given.\n"
"\n"
"MODULE arguments give file name patterns matching modules to process.\n"
diff --git a/po/pl.po b/po/pl.po
index 66c4f59..5bb1550 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -1,13 +1,15 @@
-# translation of pl.po to Polish
+# Polish translation for elfutils.
+# Copyright © 2003-2016 the elfutils authors.
+# This file is distributed under the same license as the elfutils package.
# Jakub Bogusz <qboosh@pld-linux.org>, 2003-2007.
# Piotr Drąg <piotrdrag@gmail.com>, 2010-2016.
#
msgid ""
msgstr ""
"Project-Id-Version: elfutils\n"
-"Report-Msgid-Bugs-To: http://bugzilla.redhat.com/\n"
-"POT-Creation-Date: 2016-01-11 08:48+0100\n"
-"PO-Revision-Date: 2016-01-07 15:44+0100\n"
+"Report-Msgid-Bugs-To: https://sourceware.org/bugzilla/\n"
+"POT-Creation-Date: 2018-06-29 20:47+0200\n"
+"PO-Revision-Date: 2016-12-29 17:48+0100\n"
"Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
"Language-Team: Polish <trans-pl@lists.fedoraproject.org>\n"
"Language: pl\n"
@@ -39,29 +41,41 @@
" • „never”, „no”, „none”\n"
" • „auto”, „tty”, „if-tty”\n"
-#: lib/color.c:190 src/objdump.c:738
+#: lib/color.c:190 src/objdump.c:727
#, c-format
msgid "cannot allocate memory"
msgstr "nie można przydzielić pamięci"
-#: lib/xmalloc.c:53 lib/xmalloc.c:66 lib/xmalloc.c:78 src/readelf.c:3282
-#: src/readelf.c:3669 src/readelf.c:8416 src/unstrip.c:2233 src/unstrip.c:2438
+#: lib/printversion.c:40
+#, c-format
+msgid ""
+"Copyright (C) %s The elfutils developers <%s>.\n"
+"This is free software; see the source for copying conditions. There is NO\n"
+"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
+msgstr ""
+"Copyright © %s programiści projektu elfutils <%s>.\n"
+"Niniejszy program jest wolnym oprogramowaniem; proszę zobaczyć kod źródłowy\n"
+"w celu poznania warunków kopiowania. Niniejszy program rozprowadzany jest\n"
+"BEZ JAKIEJKOLWIEK GWARANCJI, nawet domyślnej gwarancji PRZYDATNOŚCI\n"
+"HANDLOWEJ albo PRZYDATNOŚCI DO OKREŚLONYCH ZASTOSOWAŃ.\n"
+
+#: lib/xmalloc.c:53 lib/xmalloc.c:66 lib/xmalloc.c:78 src/readelf.c:3395
+#: src/readelf.c:11196 src/unstrip.c:2227 src/unstrip.c:2433
#, c-format
msgid "memory exhausted"
msgstr "pamięć wyczerpana"
-#: libasm/asm_error.c:65 libdw/dwarf_error.c:58 libdwfl/libdwflP.h:53
+#: libasm/asm_error.c:65 libdw/dwarf_error.c:57 libdwfl/libdwflP.h:50
#: libelf/elf_error.c:60
msgid "no error"
msgstr "brak błędu"
-#: libasm/asm_error.c:66 libdw/dwarf_error.c:68 libdwfl/libdwflP.h:55
+#: libasm/asm_error.c:66 libdw/dwarf_error.c:67 libdwfl/libdwflP.h:52
#: libelf/elf_error.c:91
msgid "out of memory"
msgstr "brak pamięci"
-#: libasm/asm_error.c:67 src/ldgeneric.c:2677
-#, c-format
+#: libasm/asm_error.c:67
msgid "cannot create output file"
msgstr "nie można utworzyć pliku wyjściowego"
@@ -73,8 +87,7 @@
msgid "cannot change mode of output file"
msgstr "nie można zmienić trybu pliku wyjściowego"
-#: libasm/asm_error.c:70 src/ldgeneric.c:6990
-#, c-format
+#: libasm/asm_error.c:70
msgid "cannot rename output file"
msgstr "nie można zmienić nazwy pliku wyjściowego"
@@ -94,373 +107,415 @@
msgid "no backend support available"
msgstr "brak dostępnej obsługi zaplecza"
-#: libasm/asm_error.c:83 libdw/dwarf_error.c:59 libdwfl/libdwflP.h:54
+#: libasm/asm_error.c:83 libdw/dwarf_error.c:58 libdwfl/libdwflP.h:51
#: libelf/elf_error.c:63
msgid "unknown error"
msgstr "nieznany błąd"
-#: libdw/dwarf_error.c:60
+#: libdw/dwarf_error.c:59
msgid "invalid access"
msgstr "nieprawidłowy dostęp"
-#: libdw/dwarf_error.c:61
+#: libdw/dwarf_error.c:60
msgid "no regular file"
msgstr "nie jest zwykłym plikiem"
-#: libdw/dwarf_error.c:62
+#: libdw/dwarf_error.c:61
msgid "I/O error"
msgstr "błąd wejścia/wyjścia"
-#: libdw/dwarf_error.c:63
+#: libdw/dwarf_error.c:62
msgid "invalid ELF file"
msgstr "nieprawidłowy plik ELF"
-#: libdw/dwarf_error.c:64
+#: libdw/dwarf_error.c:63
msgid "no DWARF information"
msgstr "brak informacji DWARF"
-#: libdw/dwarf_error.c:65
+#: libdw/dwarf_error.c:64
msgid "cannot decompress DWARF"
msgstr "nie można dekompresować DWARF"
-#: libdw/dwarf_error.c:66
+#: libdw/dwarf_error.c:65
msgid "no ELF file"
msgstr "brak pliku ELF"
-#: libdw/dwarf_error.c:67
+#: libdw/dwarf_error.c:66
msgid "cannot get ELF header"
msgstr "nie można uzyskać nagłówka ELF"
-#: libdw/dwarf_error.c:69
+#: libdw/dwarf_error.c:68
msgid "not implemented"
msgstr "niezaimplementowane"
-#: libdw/dwarf_error.c:70 libelf/elf_error.c:107 libelf/elf_error.c:155
+#: libdw/dwarf_error.c:69 libelf/elf_error.c:111 libelf/elf_error.c:159
msgid "invalid command"
msgstr "nieprawidłowe polecenie"
-#: libdw/dwarf_error.c:71
+#: libdw/dwarf_error.c:70
msgid "invalid version"
msgstr "nieprawidłowa wersja"
-#: libdw/dwarf_error.c:72
+#: libdw/dwarf_error.c:71
msgid "invalid file"
msgstr "nieprawidłowy plik"
-#: libdw/dwarf_error.c:73
+#: libdw/dwarf_error.c:72
msgid "no entries found"
msgstr "nie odnaleziono wpisów"
-#: libdw/dwarf_error.c:74
+#: libdw/dwarf_error.c:73
msgid "invalid DWARF"
msgstr "nieprawidłowy DWARF"
-#: libdw/dwarf_error.c:75
+#: libdw/dwarf_error.c:74
msgid "no string data"
-msgstr "brak danych w postaci ciągu"
+msgstr "brak danych w postaci ciągu"
+
+#: libdw/dwarf_error.c:75
+#, fuzzy
+msgid ".debug_str section missing"
+msgstr "brak sekcji .debug_ranges"
#: libdw/dwarf_error.c:76
+#, fuzzy
+msgid ".debug_line_str section missing"
+msgstr "brak sekcji .debug_line"
+
+#: libdw/dwarf_error.c:77
+#, fuzzy
+msgid ".debug_str_offsets section missing"
+msgstr "brak sekcji .debug_ranges"
+
+#: libdw/dwarf_error.c:78
msgid "no address value"
msgstr "brak wartości adresu"
-#: libdw/dwarf_error.c:77
+#: libdw/dwarf_error.c:79
msgid "no constant value"
msgstr "brak wartości stałej"
-#: libdw/dwarf_error.c:78
+#: libdw/dwarf_error.c:80
msgid "no reference value"
msgstr "brak wartości odwołania"
-#: libdw/dwarf_error.c:79
+#: libdw/dwarf_error.c:81
msgid "invalid reference value"
msgstr "nieprawidłowa wartość odwołania"
-#: libdw/dwarf_error.c:80
+#: libdw/dwarf_error.c:82
msgid ".debug_line section missing"
msgstr "brak sekcji .debug_line"
-#: libdw/dwarf_error.c:81
+#: libdw/dwarf_error.c:83
msgid "invalid .debug_line section"
msgstr "nieprawidłowa sekcja .debug_line"
-#: libdw/dwarf_error.c:82
+#: libdw/dwarf_error.c:84
msgid "debug information too big"
msgstr "informacje debugowania są za duże"
-#: libdw/dwarf_error.c:83
+#: libdw/dwarf_error.c:85
msgid "invalid DWARF version"
msgstr "nieprawidłowa wersja DWARF"
-#: libdw/dwarf_error.c:84
+#: libdw/dwarf_error.c:86
msgid "invalid directory index"
msgstr "nieprawidłowy indeks katalogu"
-#: libdw/dwarf_error.c:85 libdwfl/libdwflP.h:74
+#: libdw/dwarf_error.c:87 libdwfl/libdwflP.h:71
msgid "address out of range"
msgstr "adres jest spoza zakresu"
-#: libdw/dwarf_error.c:86
-msgid "no location list value"
+#: libdw/dwarf_error.c:88
+#, fuzzy
+msgid ".debug_loc section missing"
+msgstr "brak sekcji .debug_line"
+
+#: libdw/dwarf_error.c:89
+#, fuzzy
+msgid ".debug_loclists section missing"
+msgstr "brak sekcji .debug_line"
+
+#: libdw/dwarf_error.c:90
+#, fuzzy
+msgid "not a location list value"
msgstr "brak wartości listy położeń"
-#: libdw/dwarf_error.c:87
+#: libdw/dwarf_error.c:91
msgid "no block data"
msgstr "brak danych blokowych"
-#: libdw/dwarf_error.c:88
+#: libdw/dwarf_error.c:92
msgid "invalid line index"
msgstr "nieprawidłowy indeks wiersza"
-#: libdw/dwarf_error.c:89
+#: libdw/dwarf_error.c:93
msgid "invalid address range index"
msgstr "nieprawidłowy indeks zakresu adresów"
-#: libdw/dwarf_error.c:90 libdwfl/libdwflP.h:75
+#: libdw/dwarf_error.c:94 libdwfl/libdwflP.h:72
msgid "no matching address range"
msgstr "brak pasującego zakresu adresów"
-#: libdw/dwarf_error.c:91
+#: libdw/dwarf_error.c:95
msgid "no flag value"
msgstr "brak wartości flagi"
-#: libdw/dwarf_error.c:92 libelf/elf_error.c:232
+#: libdw/dwarf_error.c:96 libelf/elf_error.c:236
msgid "invalid offset"
msgstr "nieprawidłowy offset"
-#: libdw/dwarf_error.c:93
+#: libdw/dwarf_error.c:97
msgid ".debug_ranges section missing"
msgstr "brak sekcji .debug_ranges"
-#: libdw/dwarf_error.c:94
+#: libdw/dwarf_error.c:98
+#, fuzzy
+msgid ".debug_rnglists section missing"
+msgstr "brak sekcji .debug_ranges"
+
+#: libdw/dwarf_error.c:99
msgid "invalid CFI section"
msgstr "nieprawidłowa wersja CFI"
-#: libdw/dwarf_error.c:95
+#: libdw/dwarf_error.c:100
msgid "no alternative debug link found"
msgstr "nie odnaleziono alternatywnego dowiązania debugowania"
-#: libdw/dwarf_error.c:96
+#: libdw/dwarf_error.c:101
msgid "invalid opcode"
msgstr "nieprawidłowa instrukcja"
-#: libdw/dwarf_error.c:97
+#: libdw/dwarf_error.c:102
msgid "not a CU (unit) DIE"
msgstr "nie jest CU (jednostką) DIE"
-#: libdwfl/argp-std.c:46 src/stack.c:642 src/unstrip.c:2380
+#: libdw/dwarf_error.c:103
+#, fuzzy
+msgid "unknown language code"
+msgstr " nieznana instrukcja"
+
+#: libdw/dwarf_error.c:104
+#, fuzzy
+msgid ".debug_addr section missing"
+msgstr "brak sekcji .debug_ranges"
+
+#: libdwfl/argp-std.c:50 src/stack.c:639 src/unstrip.c:2374
msgid "Input selection options:"
msgstr "Opcje wyboru wejścia:"
-#: libdwfl/argp-std.c:47
-msgid "Find addresses in FILE"
-msgstr "Wyszukuje adresy w PLIKU"
-
-#: libdwfl/argp-std.c:49
-msgid "Find addresses from signatures found in COREFILE"
-msgstr "Wyszukuje adresy z podpisów odnalezionych w PLIKU_CORE"
-
#: libdwfl/argp-std.c:51
-msgid "Find addresses in files mapped into process PID"
-msgstr "Wyszukuje adresy w plikach zmapowanych do PID procesów"
+msgid "Find addresses in FILE"
+msgstr "Wyszukuje adresy w PLIKU"
#: libdwfl/argp-std.c:53
+msgid "Find addresses from signatures found in COREFILE"
+msgstr "Wyszukuje adresy z podpisów odnalezionych w PLIKU_CORE"
+
+#: libdwfl/argp-std.c:55
+msgid "Find addresses in files mapped into process PID"
+msgstr "Wyszukuje adresy w plikach zmapowanych do PID procesów"
+
+#: libdwfl/argp-std.c:57
msgid ""
"Find addresses in files mapped as read from FILE in Linux /proc/PID/maps "
"format"
msgstr ""
-"Wyszukuje adresy w plikach zmapowanych jako odczyt z PLIKU w formacie /proc/"
+"Wyszukuje adresy w plikach zmapowanych jako odczyt z PLIKU w formacie /proc/"
"PID/maps systemu Linux"
-#: libdwfl/argp-std.c:55
+#: libdwfl/argp-std.c:59
msgid "Find addresses in the running kernel"
-msgstr "Wyszukuje adresy w uruchomionych jądrze"
+msgstr "Wyszukuje adresy w uruchomionych jądrze"
-#: libdwfl/argp-std.c:57
+#: libdwfl/argp-std.c:61
msgid "Kernel with all modules"
msgstr "Jądro ze wszystkimi modułami"
-#: libdwfl/argp-std.c:59 src/stack.c:649
+#: libdwfl/argp-std.c:63 src/stack.c:646
msgid "Search path for separate debuginfo files"
msgstr "Wyszukuje ścieżkę dla oddzielnych plików debuginfo"
-#: libdwfl/argp-std.c:157
+#: libdwfl/argp-std.c:164
msgid "only one of -e, -p, -k, -K, or --core allowed"
-msgstr "dopuszczalna jest tylko jedna z opcji -e, -p, -k, -K lub --core"
+msgstr "dopuszczalna jest tylko jedna z opcji -e, -p, -k, -K lub --core"
-#: libdwfl/argp-std.c:230
+#: libdwfl/argp-std.c:237
msgid "cannot load kernel symbols"
msgstr "nie można wczytać symboli jądra"
-#: libdwfl/argp-std.c:234
+#. Non-fatal to have no modules since we do have the kernel.
+#: libdwfl/argp-std.c:241
msgid "cannot find kernel modules"
msgstr "nie można odnaleźć modułów jądra"
-#: libdwfl/argp-std.c:251
+#: libdwfl/argp-std.c:258
msgid "cannot find kernel or modules"
msgstr "nie można odnaleźć jądra lub modułów"
-#: libdwfl/argp-std.c:290
+#: libdwfl/argp-std.c:297
#, c-format
msgid "cannot read ELF core file: %s"
msgstr "nie można odczytać pliku core ELF: %s"
-#: libdwfl/argp-std.c:313
+#: libdwfl/argp-std.c:320
msgid "Not enough memory"
msgstr "Za mało pamięci"
-#: libdwfl/argp-std.c:323
+#: libdwfl/argp-std.c:330
msgid "No modules recognized in core file"
-msgstr "Nie rozpoznano żadnych modułów w pliku core"
+msgstr "Nie rozpoznano żadnych modułów w pliku core"
-#: libdwfl/libdwflP.h:56
+#: libdwfl/libdwflP.h:53
msgid "See errno"
msgstr "Proszę zobaczyć errno"
-#: libdwfl/libdwflP.h:57
+#: libdwfl/libdwflP.h:54
msgid "See elf_errno"
msgstr "Proszę zobaczyć elf_errno"
-#: libdwfl/libdwflP.h:58
+#: libdwfl/libdwflP.h:55
msgid "See dwarf_errno"
msgstr "Proszę zobaczyć dwarf_errno"
-#: libdwfl/libdwflP.h:59
+#: libdwfl/libdwflP.h:56
msgid "See ebl_errno (XXX missing)"
msgstr "Proszę zobaczyć ebl_errno (brak XXX)"
-#: libdwfl/libdwflP.h:60
+#: libdwfl/libdwflP.h:57
msgid "gzip decompression failed"
msgstr "dekompresja gzip się nie powiodła"
-#: libdwfl/libdwflP.h:61
+#: libdwfl/libdwflP.h:58
msgid "bzip2 decompression failed"
msgstr "dekompresja bzip2 się nie powiodła"
-#: libdwfl/libdwflP.h:62
+#: libdwfl/libdwflP.h:59
msgid "LZMA decompression failed"
msgstr "dekompresja LZMA się nie powiodła"
-#: libdwfl/libdwflP.h:63
+#: libdwfl/libdwflP.h:60
msgid "no support library found for machine"
msgstr "nie odnaleziono biblioteki obsługi dla komputera"
-#: libdwfl/libdwflP.h:64
+#: libdwfl/libdwflP.h:61
msgid "Callbacks missing for ET_REL file"
msgstr "Brak wywołań zwrotnych dla pliku ET_REL"
-#: libdwfl/libdwflP.h:65
+#: libdwfl/libdwflP.h:62
msgid "Unsupported relocation type"
msgstr "Nieobsługiwany typ relokacji"
-#: libdwfl/libdwflP.h:66
+#: libdwfl/libdwflP.h:63
msgid "r_offset is bogus"
msgstr "r_offset jest fałszywe"
-#: libdwfl/libdwflP.h:67 libelf/elf_error.c:111 libelf/elf_error.c:171
+#: libdwfl/libdwflP.h:64 libelf/elf_error.c:115 libelf/elf_error.c:175
msgid "offset out of range"
msgstr "offset spoza zakresu"
-#: libdwfl/libdwflP.h:68
+#: libdwfl/libdwflP.h:65
msgid "relocation refers to undefined symbol"
msgstr "relokacja odnosi się do nieokreślonego symbolu"
-#: libdwfl/libdwflP.h:69
+#: libdwfl/libdwflP.h:66
msgid "Callback returned failure"
msgstr "Wywołanie zwrotne zwróciło niepowodzenie"
-#: libdwfl/libdwflP.h:70
+#: libdwfl/libdwflP.h:67
msgid "No DWARF information found"
msgstr "Nie odnaleziono informacji DWARF"
-#: libdwfl/libdwflP.h:71
+#: libdwfl/libdwflP.h:68
msgid "No symbol table found"
msgstr "Nie odnaleziono tabeli symboli"
-#: libdwfl/libdwflP.h:72
+#: libdwfl/libdwflP.h:69
msgid "No ELF program headers"
msgstr "Brak nagłówków programu ELF"
-#: libdwfl/libdwflP.h:73
+#: libdwfl/libdwflP.h:70
msgid "address range overlaps an existing module"
-msgstr "zakres adresów pokrywa się z istniejącym modułem"
+msgstr "zakres adresów pokrywa się z istniejącym modułem"
-#: libdwfl/libdwflP.h:76
+#: libdwfl/libdwflP.h:73
msgid "image truncated"
msgstr "skrócono obraz"
-#: libdwfl/libdwflP.h:77
+#: libdwfl/libdwflP.h:74
msgid "ELF file opened"
msgstr "otwarto plik ELF"
-#: libdwfl/libdwflP.h:78
+#: libdwfl/libdwflP.h:75
msgid "not a valid ELF file"
msgstr "nie jest prawidłowym plikiem ELF"
-#: libdwfl/libdwflP.h:79
+#: libdwfl/libdwflP.h:76
msgid "cannot handle DWARF type description"
msgstr "nie można obsłużyć opisu typu DWARF"
-#: libdwfl/libdwflP.h:80
+#: libdwfl/libdwflP.h:77
msgid "ELF file does not match build ID"
-msgstr "plik ELF nie posiada pasującego identyfikatora kopii"
+msgstr "plik ELF nie ma pasującego identyfikatora kopii"
-#: libdwfl/libdwflP.h:81
+#: libdwfl/libdwflP.h:78
msgid "corrupt .gnu.prelink_undo section data"
msgstr "uszkodzone dane sekcji .gnu.prelink_undo"
-#: libdwfl/libdwflP.h:82
+#: libdwfl/libdwflP.h:79
msgid "Internal error due to ebl"
-msgstr "Wewnętrzny błąd z powodu ebl"
+msgstr "Wewnętrzny błąd z powodu ebl"
-#: libdwfl/libdwflP.h:83
+#: libdwfl/libdwflP.h:80
msgid "Missing data in core file"
-msgstr "Brak danych w pliku core"
+msgstr "Brak danych w pliku core"
-#: libdwfl/libdwflP.h:84
+#: libdwfl/libdwflP.h:81
msgid "Invalid register"
msgstr "Nieprawidłowy rejestr"
-#: libdwfl/libdwflP.h:85
+#: libdwfl/libdwflP.h:82
msgid "Error reading process memory"
msgstr "Błąd podczas odczytywania pamięci procesu"
-#: libdwfl/libdwflP.h:86
+#: libdwfl/libdwflP.h:83
msgid "Couldn't find architecture of any ELF"
msgstr "Nie można odnaleźć architektury żadnego ELF"
-#: libdwfl/libdwflP.h:87
+#: libdwfl/libdwflP.h:84
msgid "Error parsing /proc filesystem"
msgstr "Błąd podczas przetwarzania systemu plików /proc"
-#: libdwfl/libdwflP.h:88
+#: libdwfl/libdwflP.h:85
msgid "Invalid DWARF"
msgstr "Nieprawidłowy DWARF"
-#: libdwfl/libdwflP.h:89
+#: libdwfl/libdwflP.h:86
msgid "Unsupported DWARF"
msgstr "Nieobsługiwany DWARF"
-#: libdwfl/libdwflP.h:90
+#: libdwfl/libdwflP.h:87
msgid "Unable to find more threads"
msgstr "Nie można odnaleźć więcej wątków"
-#: libdwfl/libdwflP.h:91
+#: libdwfl/libdwflP.h:88
msgid "Dwfl already has attached state"
-msgstr "Dwfl już posiada załączony stan"
+msgstr "Dwfl już ma załączony stan"
-#: libdwfl/libdwflP.h:92
+#: libdwfl/libdwflP.h:89
msgid "Dwfl has no attached state"
-msgstr "Dwfl nie posiada załączonego stanu"
+msgstr "Dwfl nie ma załączonego stanu"
-#: libdwfl/libdwflP.h:93
+#: libdwfl/libdwflP.h:90
msgid "Unwinding not supported for this architecture"
msgstr "Odwijanie nie jest obsługiwane dla tej architektury"
-#: libdwfl/libdwflP.h:94
+#: libdwfl/libdwflP.h:91
msgid "Invalid argument"
msgstr "Nieprawidłowy parametr"
-#: libdwfl/libdwflP.h:95
+#: libdwfl/libdwflP.h:92
msgid "Not an ET_CORE ELF file"
msgstr "Nie jest plikiem ELF ET_CORE"
@@ -468,14 +523,14 @@
msgid "No backend"
msgstr "Brak zaplecza"
-#: libebl/eblcorenotetypename.c:98 libebl/eblobjecttypename.c:53
-#: libebl/eblobjnotetypename.c:69 libebl/eblosabiname.c:73
-#: libebl/eblsectionname.c:83 libebl/eblsectiontypename.c:115
-#: libebl/eblsegmenttypename.c:79
+#: libebl/eblcorenotetypename.c:100 libebl/eblobjnotetypename.c:76
+#: libebl/eblobjnotetypename.c:83 libebl/eblobjnotetypename.c:102
+#: libebl/eblosabiname.c:73 libebl/eblsectionname.c:83
+#: libebl/eblsectiontypename.c:115 libebl/eblsegmenttypename.c:79
msgid "<unknown>"
msgstr "<nieznany>"
-#: libebl/ebldynamictagname.c:101
+#: libebl/ebldynamictagname.c:103
#, c-format
msgid "<unknown>: %#<PRIx64>"
msgstr "<nieznany>: %#<PRIx64>"
@@ -525,6 +580,7 @@
msgid " Build ID: "
msgstr " Identyfikator kopii: "
+#. A non-null terminated version string.
#: libebl/eblobjnote.c:152
#, c-format
msgid " Linker version: %.*s\n"
@@ -564,7 +620,7 @@
msgid "invalid size of destination operand"
msgstr "nieprawidłowy rozmiar operanda docelowego"
-#: libelf/elf_error.c:87 src/readelf.c:5473
+#: libelf/elf_error.c:87 src/readelf.c:6107
#, c-format
msgid "invalid encoding"
msgstr "nieprawidłowe kodowanie"
@@ -574,147 +630,152 @@
msgstr "nieprawidłowy deskryptor pliku"
#: libelf/elf_error.c:99
+#, fuzzy
+msgid "invalid ELF file data"
+msgstr "nieprawidłowy plik ELF"
+
+#: libelf/elf_error.c:103
msgid "invalid operation"
msgstr "nieprawidłowe działanie"
-#: libelf/elf_error.c:103
+#: libelf/elf_error.c:107
msgid "ELF version not set"
msgstr "wersja ELF nie została ustawiona"
-#: libelf/elf_error.c:115
-msgid "invalid fmag field in archive header"
-msgstr "nieprawidłowe pole fmag w nagłówku archiwum"
-
#: libelf/elf_error.c:119
+msgid "invalid fmag field in archive header"
+msgstr "nieprawidłowe pole fmag w nagłówku archiwum"
+
+#: libelf/elf_error.c:123
msgid "invalid archive file"
msgstr "nieprawidłowy plik archiwum"
-#: libelf/elf_error.c:123
+#: libelf/elf_error.c:127
msgid "descriptor is not for an archive"
msgstr "deskryptor nie jest dla archiwum"
-#: libelf/elf_error.c:127
+#: libelf/elf_error.c:131
msgid "no index available"
msgstr "brak dostępnego indeksu"
-#: libelf/elf_error.c:131
-msgid "cannot read data from file"
-msgstr "nie można odczytać danych z pliku"
-
#: libelf/elf_error.c:135
+msgid "cannot read data from file"
+msgstr "nie można odczytać danych z pliku"
+
+#: libelf/elf_error.c:139
msgid "cannot write data to file"
msgstr "nie można zapisać danych do pliku"
-#: libelf/elf_error.c:139
+#: libelf/elf_error.c:143
msgid "invalid binary class"
msgstr "nieprawidłowa klasa pliku binarnego"
-#: libelf/elf_error.c:143
+#: libelf/elf_error.c:147
msgid "invalid section index"
msgstr "nieprawidłowy indeks sekcji"
-#: libelf/elf_error.c:147
+#: libelf/elf_error.c:151
msgid "invalid operand"
msgstr "nieprawidłowy operand"
-#: libelf/elf_error.c:151
+#: libelf/elf_error.c:155
msgid "invalid section"
msgstr "nieprawidłowa sekcja"
-#: libelf/elf_error.c:159
+#: libelf/elf_error.c:163
msgid "executable header not created first"
msgstr "nie utworzono najpierw nagłówka pliku wykonywalnego"
-#: libelf/elf_error.c:163
+#: libelf/elf_error.c:167
msgid "file descriptor disabled"
msgstr "deskryptor pliku jest wyłączony"
-#: libelf/elf_error.c:167
+#: libelf/elf_error.c:171
msgid "archive/member file descriptor mismatch"
msgstr "deskryptory archiwum/elementu nie zgadzają się"
-#: libelf/elf_error.c:175
+#: libelf/elf_error.c:179
msgid "cannot manipulate null section"
msgstr "nie można zmieniać pustej sekcji"
-#: libelf/elf_error.c:179
+#: libelf/elf_error.c:183
msgid "data/scn mismatch"
msgstr "dane/scn nie zgadzają się"
-#: libelf/elf_error.c:183
+#: libelf/elf_error.c:187
msgid "invalid section header"
msgstr "nieprawidłowy nagłówek sekcji"
-#: libelf/elf_error.c:187 src/readelf.c:7342 src/readelf.c:7790
-#: src/readelf.c:7891 src/readelf.c:8072
+#: libelf/elf_error.c:191 src/readelf.c:9742 src/readelf.c:10313
+#: src/readelf.c:10414 src/readelf.c:10595
#, c-format
msgid "invalid data"
msgstr "nieprawidłowe dane"
-#: libelf/elf_error.c:191
+#: libelf/elf_error.c:195
msgid "unknown data encoding"
msgstr "nieznane kodowanie danych"
-#: libelf/elf_error.c:195
+#: libelf/elf_error.c:199
msgid "section `sh_size' too small for data"
msgstr "sekcja „sh_size” jest za mała dla danych"
-#: libelf/elf_error.c:199
+#: libelf/elf_error.c:203
msgid "invalid section alignment"
msgstr "nieprawidłowe wyrównanie sekcji"
-#: libelf/elf_error.c:203
+#: libelf/elf_error.c:207
msgid "invalid section entry size"
msgstr "nieprawidłowy rozmiar wpisu sekcji"
-#: libelf/elf_error.c:207
+#: libelf/elf_error.c:211
msgid "update() for write on read-only file"
msgstr "update() dla zapisu pliku tylko do odczytu"
-#: libelf/elf_error.c:211
+#: libelf/elf_error.c:215
msgid "no such file"
msgstr "nie ma takiego pliku"
-#: libelf/elf_error.c:215
+#: libelf/elf_error.c:219
msgid "only relocatable files can contain section groups"
msgstr "tylko relokowalne pliki mogą zawierać grupy sekcji"
-#: libelf/elf_error.c:220
+#: libelf/elf_error.c:224
msgid ""
"program header only allowed in executables, shared objects, and core files"
msgstr ""
-"tylko pliki wykonywalne, obiektów współdzielone i pliki core mogą mieć "
+"tylko pliki wykonywalne, obiektów współdzielone i pliki core mogą mieć "
"nagłówki programu"
-#: libelf/elf_error.c:227
+#: libelf/elf_error.c:231
msgid "file has no program header"
-msgstr "plik nie posiada nagłówków programu"
+msgstr "plik nie ma nagłówków programu"
-#: libelf/elf_error.c:237
+#: libelf/elf_error.c:241
msgid "invalid section type"
msgstr "nieprawidłowy typ sekcji"
-#: libelf/elf_error.c:242
+#: libelf/elf_error.c:246
msgid "invalid section flags"
msgstr "nieprawidłowe flagi sekcji"
-#: libelf/elf_error.c:247
+#: libelf/elf_error.c:251
msgid "section does not contain compressed data"
msgstr "sekcja nie zawiera skompresowanych danych"
-#: libelf/elf_error.c:252
+#: libelf/elf_error.c:256
msgid "section contains compressed data"
msgstr "sekcja zawiera skompresowane dane"
-#: libelf/elf_error.c:257
+#: libelf/elf_error.c:261
msgid "unknown compression type"
msgstr "nieznany typ kompresji"
-#: libelf/elf_error.c:262
+#: libelf/elf_error.c:266
msgid "cannot compress data"
msgstr "nie można kompresować danych"
-#: libelf/elf_error.c:267
+#: libelf/elf_error.c:271
msgid "cannot decompress data"
msgstr "nie można dekompresować danych"
@@ -752,7 +813,7 @@
#: src/addr2line.c:69
msgid "Also show symbol and the section names"
-msgstr "Wyświetla także nazwy symboli i sekcji"
+msgstr "Wyświetla także nazwy symboli i sekcji"
#: src/addr2line.c:70
msgid "Also show line table flags"
@@ -769,68 +830,46 @@
#: src/addr2line.c:75
msgid "Show demangled symbols (ARG is always ignored)"
msgstr ""
-"Wyświetla symbole z usuniętym dekorowaniem (PARAMETR jest zawsze ignorowany)"
+"Wyświetla symbole z usuniętym dekorowaniem (PARAMETR jest zawsze ignorowany)"
#: src/addr2line.c:77
msgid "Print all information on one line, and indent inlines"
-msgstr "Wyświetla wszystkie informacje w jednym wierszy i wyrównuje wstawki"
+msgstr "Wyświetla wszystkie informacje w jednym wierszy i wyrównuje wstawki"
-#: src/addr2line.c:79 src/elfcmp.c:72 src/findtextrel.c:67 src/nm.c:100
+#: src/addr2line.c:79 src/elfcmp.c:71 src/findtextrel.c:66 src/nm.c:101
#: src/strings.c:79
msgid "Miscellaneous:"
msgstr "Różne:"
+#. Short description of program.
#: src/addr2line.c:87
msgid ""
"Locate source files and line information for ADDRs (in a.out by default)."
msgstr ""
-"Odnajdywanie plików źródłowych i informacji o wierszu dla ADRESU (domyślne w "
-"a.out)."
+"Odnajdywanie plików źródłowych i informacji o wierszu dla ADRESU (domyślne "
+"w a.out)."
+#. Strings for arguments in help texts.
#: src/addr2line.c:91
msgid "[ADDR...]"
msgstr "[ADRES…]"
-#: src/addr2line.c:216 src/ar.c:285 src/elfcmp.c:672 src/elflint.c:235
-#: src/findtextrel.c:162 src/ld.c:943 src/nm.c:262 src/objdump.c:177
-#: src/ranlib.c:124 src/readelf.c:509 src/size.c:207 src/strings.c:230
-#: src/strip.c:218 src/unstrip.c:232
-#, c-format
-msgid ""
-"Copyright (C) %s Red Hat, Inc.\n"
-"This is free software; see the source for copying conditions. There is NO\n"
-"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
-msgstr ""
-"Copyright © %s Red Hat, Inc.\n"
-"Niniejszy program jest wolnym oprogramowaniem; proszę zobaczyć kod źródłowy\n"
-"w celu poznania warunków kopiowania. Niniejszy program rozprowadzany jest\n"
-"BEZ JAKIEJKOLWIEK GWARANCJI, nawet domyślnej gwarancji PRZYDATNOŚCI\n"
-"HANDLOWEJ albo PRZYDATNOŚCI DO OKREŚLONYCH ZASTOSOWAŃ.\n"
-
-#: src/addr2line.c:221 src/ar.c:290 src/elfcmp.c:677 src/elflint.c:240
-#: src/findtextrel.c:167 src/ld.c:948 src/nm.c:267 src/objdump.c:182
-#: src/ranlib.c:129 src/readelf.c:514 src/size.c:212 src/strings.c:235
-#: src/strip.c:223 src/unstrip.c:237
-#, c-format
-msgid "Written by %s.\n"
-msgstr "Napisane przez %s.\n"
-
-#: src/addr2line.c:533
+#: src/addr2line.c:520
#, c-format
msgid "Section syntax requires exactly one module"
msgstr "Składnia sekcji wymaga dokładnie jednego modułu"
-#: src/addr2line.c:556
+#: src/addr2line.c:543
#, c-format
msgid "offset %#<PRIxMAX> lies outside section '%s'"
msgstr "offset %#<PRIxMAX> leży poza sekcją „%s”"
-#: src/addr2line.c:645
+#: src/addr2line.c:633
#, c-format
msgid "cannot find symbol '%s'"
msgstr "nie można odnaleźć symbolu „%s”"
-#: src/addr2line.c:650
+#: src/addr2line.c:638
#, c-format
msgid "offset %#<PRIxMAX> lies outside contents of '%s'"
msgstr "offset %#<PRIxMAX> leży poza zawartością „%s”"
@@ -841,15 +880,15 @@
#: src/ar.c:69
msgid "Delete files from archive."
-msgstr "Usuwa pliki z archiwum."
+msgstr "Usuwa pliki z archiwum."
#: src/ar.c:70
msgid "Move files in archive."
-msgstr "Przenosi pliki w archiwum."
+msgstr "Przenosi pliki w archiwum."
#: src/ar.c:71
msgid "Print files in archive."
-msgstr "Wyświetla pliki w archiwum."
+msgstr "Wyświetla pliki w archiwum."
#: src/ar.c:72
msgid "Quick append files to archive."
@@ -857,7 +896,7 @@
#: src/ar.c:74
msgid "Replace existing or insert new file into archive."
-msgstr "Zastępuje istniejący lub umieszcza nowy plik w archiwum."
+msgstr "Zastępuje istniejący lub umieszcza nowy plik w archiwum."
#: src/ar.c:75
msgid "Display content of archive."
@@ -865,7 +904,7 @@
#: src/ar.c:76
msgid "Extract files from archive."
-msgstr "Wypakowuje pliki z archiwum."
+msgstr "Wypakowuje pliki z archiwum."
#: src/ar.c:78
msgid "Command Modifiers:"
@@ -917,12 +956,14 @@
#: src/ar.c:93
msgid "Update only older files in archive."
-msgstr "Aktualizuje tylko starsze pliki w archiwum."
+msgstr "Aktualizuje tylko starsze pliki w archiwum."
+#. Short description of program.
#: src/ar.c:99
msgid "Create, modify, and extract from archives."
-msgstr "Tworzenie, modyfikowanie i wypakowywanie archiwów."
+msgstr "Tworzenie, modyfikowanie i wypakowywanie archiwów."
+#. Strings for arguments in help texts.
#: src/ar.c:102
msgid "[MEMBER] [COUNT] ARCHIVE [FILE...]"
msgstr "[ELEMENT] [LICZNIK] ARCHIWUM [PLIK…]"
@@ -930,17 +971,17 @@
#: src/ar.c:181
#, c-format
msgid "'a', 'b', and 'i' are only allowed with the 'm' and 'r' options"
-msgstr "„a”, „b” i „i” są dozwolone tylko z opcjami „m” i „r”"
+msgstr "„a”, „b” i „i” są dozwolone tylko z opcjami „m” i „r”"
#: src/ar.c:186
#, c-format
msgid "MEMBER parameter required for 'a', 'b', and 'i' modifiers"
-msgstr "parametr ELEMENT jest wymagany dla modyfikatorów „a”, „b” i „i”"
+msgstr "parametr ELEMENT jest wymagany dla modyfikatorów „a”, „b” i „i”"
#: src/ar.c:202
#, c-format
msgid "'N' is only meaningful with the 'x' and 'd' options"
-msgstr "„N” ma znaczenie tylko z opcjami „x” i „d”"
+msgstr "„N” ma znaczenie tylko z opcjami „x” i „d”"
#: src/ar.c:207
#, c-format
@@ -955,7 +996,7 @@
#: src/ar.c:226
#, c-format
msgid "'%c' is only meaningful with the 'x' option"
-msgstr "„%c” ma znaczenie tylko z opcją „x”"
+msgstr "„%c” ma znaczenie tylko z opcją „x”"
#: src/ar.c:232
#, c-format
@@ -967,250 +1008,278 @@
msgid "command option required"
msgstr "wymagana jest opcja polecenia"
-#: src/ar.c:310
+#: src/ar.c:296
#, c-format
msgid "More than one operation specified"
msgstr "Podano więcej niż jedno działanie"
-#: src/ar.c:404
+#: src/ar.c:390
#, c-format
msgid "cannot open archive '%s'"
msgstr "nie można otworzyć archiwum „%s”"
-#: src/ar.c:414
+#: src/ar.c:400
#, c-format
msgid "cannot open archive '%s': %s"
msgstr "nie można otworzyć archiwum „%s”: %s"
-#: src/ar.c:418
+#: src/ar.c:404
#, c-format
msgid "%s: not an archive file"
msgstr "%s: nie jest plikiem archiwum"
-#: src/ar.c:422
+#: src/ar.c:408
#, c-format
msgid "cannot stat archive '%s'"
msgstr "nie można wykonać stat na archiwum „%s”"
-#: src/ar.c:434
+#: src/ar.c:420
#, c-format
msgid "no entry %s in archive\n"
-msgstr "brak wpisu %s w archiwum\n"
+msgstr "brak wpisu %s w archiwum\n"
-#: src/ar.c:487 src/ar.c:929 src/ar.c:1129
+#: src/ar.c:473 src/ar.c:918 src/ar.c:1122
#, c-format
msgid "cannot create hash table"
msgstr "nie można utworzyć tabeli mieszającej"
-#: src/ar.c:494 src/ar.c:936 src/ar.c:1138
+#: src/ar.c:480 src/ar.c:925 src/ar.c:1131
#, c-format
msgid "cannot insert into hash table"
-msgstr "nie można umieścić w tabeli mieszającej"
+msgstr "nie można umieścić w tabeli mieszającej"
-#: src/ar.c:502 src/ranlib.c:164
+#: src/ar.c:488 src/ranlib.c:149
#, c-format
msgid "cannot stat '%s'"
msgstr "nie można wykonać stat na „%s”"
-#: src/ar.c:598
+#: src/ar.c:584
#, c-format
msgid "cannot read content of %s: %s"
msgstr "nie można odczytać zawartości %s: %s"
-#: src/ar.c:641
+#: src/ar.c:627
#, c-format
msgid "cannot open %.*s"
msgstr "nie można otworzyć %.*s"
-#: src/ar.c:663
+#: src/ar.c:649
#, c-format
msgid "failed to write %s"
msgstr "zapisanie %s się nie powiodło"
-#: src/ar.c:675
+#: src/ar.c:661
#, c-format
msgid "cannot change mode of %s"
msgstr "nie można zmienić trybu %s"
-#: src/ar.c:691
+#: src/ar.c:677
#, c-format
msgid "cannot change modification time of %s"
msgstr "nie można zmienić czasu modyfikacji %s"
-#: src/ar.c:737
+#: src/ar.c:723
#, c-format
msgid "cannot rename temporary file to %.*s"
msgstr "nie można zmienić nazwy pliku tymczasowego na %.*s"
-#: src/ar.c:773 src/ar.c:1021 src/ar.c:1420 src/ranlib.c:238
+#: src/ar.c:759 src/ar.c:1010 src/ar.c:1411 src/ranlib.c:223
#, c-format
msgid "cannot create new file"
msgstr "nie można utworzyć nowego pliku"
-#: src/ar.c:1220
+#: src/ar.c:1213
#, c-format
msgid "position member %s not found"
msgstr "nie odnaleziono położenia elementu %s"
-#: src/ar.c:1230
+#: src/ar.c:1223
#, c-format
msgid "%s: no entry %s in archive!\n"
-msgstr "%s: brak wpisu %s w archiwum.\n"
+msgstr "%s: brak wpisu %s w archiwum.\n"
-#: src/ar.c:1259 src/ldgeneric.c:509 src/objdump.c:253
+#: src/ar.c:1252 src/objdump.c:242
#, c-format
msgid "cannot open %s"
msgstr "nie można otworzyć %s"
-#: src/ar.c:1264
+#: src/ar.c:1257
#, c-format
msgid "cannot stat %s"
msgstr "nie można wykonać stat na %s"
-#: src/ar.c:1270
+#: src/ar.c:1263
#, c-format
msgid "%s is no regular file"
msgstr "%s nie jest zwykłym plikiem"
-#: src/ar.c:1283
+#: src/ar.c:1276
#, c-format
msgid "cannot get ELF descriptor for %s: %s\n"
msgstr "nie można uzyskać deskryptora ELF dla %s: %s\n"
-#: src/ar.c:1303
+#: src/ar.c:1296
#, c-format
msgid "cannot read %s: %s"
msgstr "nie można odczytać %s: %s"
+#: src/ar.c:1471
+#, fuzzy, c-format
+msgid "cannot represent ar_date"
+msgstr "nie można dekompresować danych"
+
+#: src/ar.c:1477
+#, fuzzy, c-format
+msgid "cannot represent ar_uid"
+msgstr "nie można dekompresować danych"
+
+#: src/ar.c:1483
+#, fuzzy, c-format
+msgid "cannot represent ar_gid"
+msgstr "nie można dekompresować danych"
+
+#: src/ar.c:1489
+#, fuzzy, c-format
+msgid "cannot represent ar_mode"
+msgstr "nie można uzyskać nazwy sekcji"
+
+#: src/ar.c:1495
+#, fuzzy, c-format
+msgid "cannot represent ar_size"
+msgstr "nie można otworzyć %s"
+
#: src/arlib-argp.c:32
msgid "Use zero for uid, gid, and date in archive members."
-msgstr "Używa zero jako UID, GID i datę w elementach archiwum."
+msgstr "Używa zero jako UID, GID i datę w elementach archiwum."
#: src/arlib-argp.c:34
msgid "Use actual uid, gid, and date in archive members."
-msgstr "Używa prawdziwe UID, GID i datę w elementach archiwum."
+msgstr "Używa prawdziwe UID, GID i datę w elementach archiwum."
#: src/arlib-argp.c:65
#, c-format
msgid "%s (default)"
msgstr "%s (domyślnie)"
-#: src/arlib.c:209
+#. The archive is too big.
+#: src/arlib.c:213
#, c-format
msgid "the archive '%s' is too large"
msgstr "archiwum „%s” jest za duże"
-#: src/arlib.c:222
+#: src/arlib.c:226
#, c-format
msgid "cannot read ELF header of %s(%s): %s"
msgstr "nie można odczytać nagłówka ELF %s(%s): %s"
-#: src/elfcmp.c:62
+#: src/elfcmp.c:61
msgid "Control options:"
msgstr "Opcje sterujące:"
-#: src/elfcmp.c:64
+#: src/elfcmp.c:63
msgid "Output all differences, not just the first"
msgstr "Wyświetlanie wszystkich różnic, nie tylko pierwszej"
-#: src/elfcmp.c:65
+#: src/elfcmp.c:64
msgid ""
"Control treatment of gaps in loadable segments [ignore|match] (default: "
"ignore)"
msgstr ""
-"Sterowanie traktowaniem luk w segmentach wczytywalnych [ignore|match] "
+"Sterowanie traktowaniem luk w segmentach wczytywalnych [ignore|match] "
"(domyślne: ignore)"
-#: src/elfcmp.c:67
+#: src/elfcmp.c:66
msgid "Ignore permutation of buckets in SHT_HASH section"
-msgstr "Ignorowanie permutacji kubełków w sekcji SHT_HASH"
+msgstr "Ignorowanie permutacji kubełków w sekcji SHT_HASH"
+
+#: src/elfcmp.c:68
+msgid "Ignore differences in build ID"
+msgstr "Ignorowanie różnic w identyfikatorze kopii"
#: src/elfcmp.c:69
-msgid "Ignore differences in build ID"
-msgstr "Ignorowanie różnic w identyfikatorze kopii"
-
-#: src/elfcmp.c:70
msgid "Output nothing; yield exit status only"
msgstr "Bez wypisywania; przekazanie tylko kodu wyjścia"
-#: src/elfcmp.c:77
+#. Short description of program.
+#: src/elfcmp.c:76
msgid "Compare relevant parts of two ELF files for equality."
msgstr "Porównywanie odpowiednich części dwóch plików ELF pod kątem równości."
-#: src/elfcmp.c:81
+#. Strings for arguments in help texts.
+#: src/elfcmp.c:80
msgid "FILE1 FILE2"
msgstr "PLIK1 PLIK2"
-#: src/elfcmp.c:143
+#: src/elfcmp.c:142
msgid "Invalid number of parameters.\n"
msgstr "Nieprawidłowa liczba parametrów.\n"
-#: src/elfcmp.c:174 src/elfcmp.c:179
+#: src/elfcmp.c:173 src/elfcmp.c:178
#, c-format
msgid "cannot get ELF header of '%s': %s"
msgstr "nie można uzyskać nagłówka ELF „%s”: %s"
-#: src/elfcmp.c:205
+#: src/elfcmp.c:204
#, c-format
msgid "%s %s diff: ELF header"
msgstr "%s %s różnią się: nagłówek ELF"
-#: src/elfcmp.c:212 src/elfcmp.c:215
+#: src/elfcmp.c:211 src/elfcmp.c:214
#, c-format
msgid "cannot get section count of '%s': %s"
msgstr "nie można uzyskać licznika sekcji „%s”: %s"
-#: src/elfcmp.c:220
+#: src/elfcmp.c:219
#, c-format
msgid "%s %s diff: section count"
msgstr "%s %s różnią się: licznik sekcji"
-#: src/elfcmp.c:227 src/elfcmp.c:230
+#: src/elfcmp.c:226 src/elfcmp.c:229
#, c-format
msgid "cannot get program header count of '%s': %s"
msgstr "nie można uzyskać licznika nagłówka programu „%s”: %s"
-#: src/elfcmp.c:235
+#: src/elfcmp.c:234
#, c-format
msgid "%s %s diff: program header count"
msgstr "%s %s różnią się: licznik nagłówka programu"
-#: src/elfcmp.c:293
+#: src/elfcmp.c:292
#, c-format
msgid "%s %s differ: section [%zu], [%zu] name"
msgstr "%s %s różnią się: nazwa sekcji [%zu], [%zu]"
-#: src/elfcmp.c:316
+#: src/elfcmp.c:315
#, c-format
msgid "%s %s differ: section [%zu] '%s' header"
msgstr "%s %s różnią się: nagłówek sekcji [%zu] „%s”"
-#: src/elfcmp.c:324 src/elfcmp.c:330
+#: src/elfcmp.c:323 src/elfcmp.c:329
#, c-format
msgid "cannot get content of section %zu in '%s': %s"
-msgstr "nie można uzyskać zawartości sekcji %zu w „%s”: %s"
+msgstr "nie można uzyskać zawartości sekcji %zu w „%s”: %s"
-#: src/elfcmp.c:339
+#: src/elfcmp.c:338
#, c-format
msgid "symbol table [%zu] in '%s' has zero sh_entsize"
-msgstr "tabela symboli [%zu] w „%s” posiada zerowe sh_entsize"
+msgstr "tabela symboli [%zu] w „%s” ma zerowe sh_entsize"
-#: src/elfcmp.c:351 src/elfcmp.c:357
+#: src/elfcmp.c:350 src/elfcmp.c:356
#, c-format
msgid "cannot get symbol in '%s': %s"
-msgstr "nie można uzyskać symbolu w „%s”: %s"
+msgstr "nie można uzyskać symbolu w „%s”: %s"
-#: src/elfcmp.c:379
+#: src/elfcmp.c:378
#, c-format
msgid "%s %s differ: symbol table [%zu]"
msgstr "%s %s różnią się: tabela symboli [%zu]"
-#: src/elfcmp.c:382
+#: src/elfcmp.c:381
#, c-format
msgid "%s %s differ: symbol table [%zu,%zu]"
msgstr "%s %s różnią się: tabela symboli [%zu,%zu]"
-#: src/elfcmp.c:428 src/elfcmp.c:497
+#: src/elfcmp.c:428 src/elfcmp.c:498
#, c-format
msgid "%s %s differ: section [%zu] '%s' number of notes"
msgstr "%s %s różnią się: liczba notatek sekcji [%zu] „%s”"
@@ -1218,113 +1287,185 @@
#: src/elfcmp.c:436
#, c-format
msgid "cannot read note section [%zu] '%s' in '%s': %s"
-msgstr "nie można odczytać notatki sekcji [%zu] „%s” w „%s”: %s"
+msgstr "nie można odczytać notatki sekcji [%zu] „%s” w „%s”: %s"
-#: src/elfcmp.c:446
+#: src/elfcmp.c:447
#, c-format
msgid "%s %s differ: section [%zu] '%s' note name"
msgstr "%s %s różnią się: nazwa notatki sekcji [%zu] „%s”"
-#: src/elfcmp.c:454
+#: src/elfcmp.c:455
#, c-format
msgid "%s %s differ: section [%zu] '%s' note '%s' type"
msgstr "%s %s różnią się: sekcja [%zu] „%s” notatka „%s” typ"
-#: src/elfcmp.c:469
+#: src/elfcmp.c:470
#, c-format
msgid "%s %s differ: build ID length"
msgstr "%s %s różnią się: długość identyfikatora kopii"
-#: src/elfcmp.c:477
+#: src/elfcmp.c:478
#, c-format
msgid "%s %s differ: build ID content"
msgstr "%s %s różnią się: zawartość identyfikatora kopii"
-#: src/elfcmp.c:486
+#: src/elfcmp.c:487
#, c-format
msgid "%s %s differ: section [%zu] '%s' note '%s' content"
msgstr "%s %s różnią się: sekcja [%zu] „%s” notatka „%s” zawartość"
-#: src/elfcmp.c:527
+#: src/elfcmp.c:528
#, c-format
msgid "%s %s differ: section [%zu] '%s' content"
msgstr "%s %s różnią się: zawartość sekcji [%zu] „%s”"
-#: src/elfcmp.c:531
+#: src/elfcmp.c:532
#, c-format
msgid "%s %s differ: section [%zu,%zu] '%s' content"
msgstr "%s %s różnią się: zawartość sekcji [%zu,%zu] „%s”"
-#: src/elfcmp.c:546
+#: src/elfcmp.c:547
#, c-format
msgid "%s %s differ: unequal amount of important sections"
msgstr "%s %s różnią się: różna liczba ważnych sekcji"
-#: src/elfcmp.c:579 src/elfcmp.c:584
+#: src/elfcmp.c:580 src/elfcmp.c:585
#, c-format
msgid "cannot load data of '%s': %s"
-msgstr "nie można wczytać danych z „%s”: %s"
+msgstr "nie można wczytać danych z „%s”: %s"
-#: src/elfcmp.c:603 src/elfcmp.c:609
+#: src/elfcmp.c:604 src/elfcmp.c:610
#, c-format
msgid "cannot get program header entry %d of '%s': %s"
-msgstr "nie można uzyskać wpisu nagłówka programu %d z „%s”: %s"
+msgstr "nie można uzyskać wpisu nagłówka programu %d z „%s”: %s"
-#: src/elfcmp.c:615
+#: src/elfcmp.c:616
#, c-format
msgid "%s %s differ: program header %d"
msgstr "%s %s różnią się: nagłówek programu %d"
-#: src/elfcmp.c:639
+#: src/elfcmp.c:640
#, c-format
msgid "%s %s differ: gap"
msgstr "%s %s różnią się: luka"
-#: src/elfcmp.c:704
+#: src/elfcmp.c:691
#, c-format
msgid "Invalid value '%s' for --gaps parameter."
msgstr "Nieprawidłowa wartość „%s” dla parametru --gaps."
-#: src/elfcmp.c:732 src/findtextrel.c:221 src/ldgeneric.c:1757
-#: src/ldgeneric.c:4247 src/nm.c:378 src/ranlib.c:157 src/size.c:289
-#: src/strings.c:186 src/strip.c:466 src/strip.c:503 src/unstrip.c:2029
-#: src/unstrip.c:2058
+#: src/elfcmp.c:719 src/findtextrel.c:206 src/nm.c:365 src/ranlib.c:142
+#: src/size.c:273 src/strings.c:186 src/strip.c:518 src/strip.c:555
+#: src/unstrip.c:2023 src/unstrip.c:2052
#, c-format
msgid "cannot open '%s'"
msgstr "nie można otworzyć „%s”"
-#: src/elfcmp.c:736 src/findtextrel.c:228 src/ranlib.c:174
+#: src/elfcmp.c:723 src/findtextrel.c:213 src/ranlib.c:159
#, c-format
msgid "cannot create ELF descriptor for '%s': %s"
msgstr "nie można utworzyć deskryptora ELF dla „%s”: %s"
-#: src/elfcmp.c:741
+#: src/elfcmp.c:728
#, c-format
msgid "cannot create EBL descriptor for '%s'"
msgstr "nie można utworzyć deskryptora EBL dla „%s”"
-#: src/elfcmp.c:759 src/findtextrel.c:409
+#: src/elfcmp.c:746 src/findtextrel.c:394
#, c-format
msgid "cannot get section header of section %zu: %s"
msgstr "nie można uzyskać nagłówka sekcji dla sekcji %zu: %s"
-#: src/elfcmp.c:769
+#: src/elfcmp.c:756
#, c-format
msgid "cannot get content of section %zu: %s"
msgstr "nie można uzyskać zawartości sekcji %zu: %s"
-#: src/elfcmp.c:779 src/elfcmp.c:793
+#: src/elfcmp.c:766 src/elfcmp.c:780
#, c-format
msgid "cannot get relocation: %s"
msgstr "nie można uzyskać relokacji: %s"
+#: src/elfcompress.c:115 src/strip.c:297 src/unstrip.c:121
+#, c-format
+msgid "-o option specified twice"
+msgstr "Opcję -o podano dwukrotnie"
+
+#: src/elfcompress.c:122
+#, c-format
+msgid "-t option specified twice"
+msgstr "Opcję -t podano dwukrotnie"
+
+#: src/elfcompress.c:131
+#, c-format
+msgid "unknown compression type '%s'"
+msgstr "nieznany typ kompresji „%s”"
+
+#. We need at least one input file.
+#: src/elfcompress.c:143 src/elfcompress.c:1305
+#, c-format
+msgid "No input file given"
+msgstr "Nie podano pliku wejściowego"
+
+#: src/elfcompress.c:149 src/elfcompress.c:1310
+#, c-format
+msgid "Only one input file allowed together with '-o'"
+msgstr "Tylko jeden plik wejściowy jest dozwolony z „-o”"
+
+#: src/elfcompress.c:1267
+msgid "Place (de)compressed output into FILE"
+msgstr "Umieszcza zdekompresowane wyjście w PLIKU"
+
+#: src/elfcompress.c:1270
+msgid ""
+"What type of compression to apply. TYPE can be 'none' (decompress), "
+"'zlib' (ELF ZLIB compression, the default, 'zlib-gabi' is an alias) or 'zlib-"
+"gnu' (.zdebug GNU style compression, 'gnu' is an alias)"
+msgstr ""
+"Typ stosowanej kompresji. TYP może wynosić „none” (dekompresja), "
+"„zlib” (kompresja zlib ELF, domyślna, „zlib-gabi” to alias) lub „zlib-"
+"gnu” (kompresja .zdebug w stylu GNU, „gnu” to alias)"
+
+#: src/elfcompress.c:1273
+msgid ""
+"SECTION name to (de)compress, SECTION is an extended wildcard pattern "
+"(defaults to '.?(z)debug*')"
+msgstr ""
+"Nazwa SEKCJI do (de)kompresowania, SEKCJA jest rozszerzonym wzorem "
+"(domyślnie „.?(z)debug*”)"
+
+#: src/elfcompress.c:1276
+msgid "Print a message for each section being (de)compressed"
+msgstr "Wyświetla komunikat dla każdej (de)kompresowanej sekcji"
+
+#: src/elfcompress.c:1279
+msgid "Force compression of section even if it would become larger"
+msgstr "Wymusza kompresję sekcji nawet, jeśli spowodowałoby to jej zwiększenie"
+
+#: src/elfcompress.c:1282 src/strip.c:91
+msgid "Relax a few rules to handle slightly broken ELF files"
+msgstr "Łagodzi kilka reguł, aby obsłużyć lekko uszkodzone pliki ELF"
+
+#: src/elfcompress.c:1285
+msgid "Be silent when a section cannot be compressed"
+msgstr "Bez zgłaszania, kiedy nie można zdekompresować sekcji"
+
+#. Strings for arguments in help texts.
+#: src/elfcompress.c:1294 src/elflint.c:78 src/readelf.c:154
+msgid "FILE..."
+msgstr "PLIK…"
+
+#: src/elfcompress.c:1295
+msgid "Compress or decompress sections in an ELF file."
+msgstr "Kompresuje lub dekompresuje sekcje w pliku ELF."
+
#: src/elflint.c:64
msgid "Be extremely strict, flag level 2 features."
msgstr "Bardzo ścisłe sprawdzanie, cechy poziomu 2 flag."
#: src/elflint.c:65
msgid "Do not print anything if successful"
-msgstr "Nie wypisywanie niczego w przypadku powodzenia"
+msgstr "Nie wypisywanie niczego w przypadku powodzenia"
#: src/elflint.c:66
msgid "Binary is a separate debuginfo file"
@@ -1336,18 +1477,15 @@
"certain ways"
msgstr ""
"Plik binarny został utworzony przez program GNU ld, przez co jest uszkodzony "
-"w pewien sposób"
+"w pewien sposób"
+#. Short description of program.
#: src/elflint.c:74
msgid "Pedantic checking of ELF files compliance with gABI/psABI spec."
msgstr ""
"Szczegółowe sprawdzanie zgodności plików ELF ze specyfikacją gABI/psABI."
-#: src/elflint.c:78 src/readelf.c:126
-msgid "FILE..."
-msgstr "PLIK…"
-
-#: src/elflint.c:155 src/readelf.c:298
+#: src/elflint.c:155 src/readelf.c:347
#, c-format
msgid "cannot open input file"
msgstr "nie można otworzyć pliku wejściowego"
@@ -1366,159 +1504,170 @@
msgid "No errors"
msgstr "Brak błędów"
-#: src/elflint.c:219 src/readelf.c:474
+#: src/elflint.c:220 src/readelf.c:546
msgid "Missing file name.\n"
msgstr "Brak nazwy pliku.\n"
-#: src/elflint.c:298
+#: src/elflint.c:285
#, c-format
msgid " error while freeing sub-ELF descriptor: %s\n"
msgstr " błąd podczas zwalniania deskryptora pod-ELF: %s\n"
-#: src/elflint.c:306
+#. We cannot do anything.
+#: src/elflint.c:293
#, c-format
msgid "Not an ELF file - it has the wrong magic bytes at the start\n"
-msgstr "To nie jest plik ELF — posiada błędne bajty magiczne na początku\n"
+msgstr "To nie jest plik ELF — ma błędne bajty magiczne na początku\n"
-#: src/elflint.c:371
+#: src/elflint.c:358
#, c-format
msgid "e_ident[%d] == %d is no known class\n"
msgstr "e_ident[%d] == %d nie jest znaną klasą\n"
-#: src/elflint.c:376
+#: src/elflint.c:363
#, c-format
msgid "e_ident[%d] == %d is no known data encoding\n"
msgstr "e_ident[%d] == %d nie jest znanym kodowaniem danych\n"
-#: src/elflint.c:380
+#: src/elflint.c:367
#, c-format
msgid "unknown ELF header version number e_ident[%d] == %d\n"
msgstr "nieznany numer wersji nagłówka ELF e_ident[%d] == %d\n"
-#: src/elflint.c:386
+#: src/elflint.c:375
#, c-format
msgid "unsupported OS ABI e_ident[%d] == '%s'\n"
msgstr "nieobsługiwane ABI systemu operacyjnego e_ident[%d] == „%s”\n"
-#: src/elflint.c:392
-#, c-format
-msgid "unsupport ABI version e_ident[%d] == %d\n"
+#: src/elflint.c:381
+#, fuzzy, c-format
+msgid "unsupported ABI version e_ident[%d] == %d\n"
msgstr "nieobsługiwana wersja ABI e_ident[%d] == %d\n"
-#: src/elflint.c:397
+#: src/elflint.c:386
#, c-format
msgid "e_ident[%zu] is not zero\n"
msgstr "e_ident[%zu] nie wynosi zero\n"
-#: src/elflint.c:402
+#: src/elflint.c:391
#, c-format
msgid "unknown object file type %d\n"
msgstr "nieznany typ pliku obiektu %d\n"
-#: src/elflint.c:409
+#: src/elflint.c:398
#, c-format
msgid "unknown machine type %d\n"
msgstr "nieznany typ komputera %d\n"
-#: src/elflint.c:413
+#: src/elflint.c:402
#, c-format
msgid "unknown object file version\n"
msgstr "nieznana wersja pliku obiektu\n"
-#: src/elflint.c:419
+#: src/elflint.c:408
#, c-format
msgid "invalid program header offset\n"
msgstr "nieprawidłowy offset nagłówka programu\n"
-#: src/elflint.c:421
+#: src/elflint.c:410
#, c-format
msgid "executables and DSOs cannot have zero program header offset\n"
msgstr ""
-"pliki wykonywalne i DSO nie mogą mieć zerowego offsetu nagłówka programu\n"
+"pliki wykonywalne i DSO nie mogą mieć zerowego offsetu nagłówka programu\n"
-#: src/elflint.c:425
+#: src/elflint.c:414
#, c-format
msgid "invalid number of program header entries\n"
msgstr "nieprawidłowa liczba wpisów nagłówka programu\n"
-#: src/elflint.c:433
+#: src/elflint.c:422
#, c-format
msgid "invalid section header table offset\n"
msgstr "nieprawidłowy offset tabeli nagłówków sekcji\n"
-#: src/elflint.c:436
+#: src/elflint.c:425
#, c-format
msgid "section header table must be present\n"
msgstr "tabela nagłówków sekcji musi istnieć\n"
-#: src/elflint.c:450
+#: src/elflint.c:439
#, c-format
msgid "invalid number of section header table entries\n"
msgstr "nieprawidłowa liczba wpisów tabeli nagłówków sekcji\n"
-#: src/elflint.c:467
+#: src/elflint.c:456
#, c-format
msgid "invalid section header index\n"
msgstr "nieprawidłowy indeks nagłówka sekcji\n"
-#: src/elflint.c:481
+#: src/elflint.c:474
+#, c-format
+msgid "Can only check %u headers, shnum was %u\n"
+msgstr ""
+
+#: src/elflint.c:488
#, c-format
msgid "invalid number of program header table entries\n"
msgstr "nieprawidłowa liczba wpisów tabeli nagłówka programu\n"
-#: src/elflint.c:490
+#: src/elflint.c:505
+#, c-format
+msgid "Can only check %u headers, phnum was %u\n"
+msgstr ""
+
+#: src/elflint.c:510
#, c-format
msgid "invalid machine flags: %s\n"
msgstr "nieprawidłowe flagi komputera: %s\n"
-#: src/elflint.c:497 src/elflint.c:514
+#: src/elflint.c:517 src/elflint.c:534
#, c-format
msgid "invalid ELF header size: %hd\n"
msgstr "nieprawidłowy rozmiar nagłówka ELF: %hd\n"
-#: src/elflint.c:500 src/elflint.c:517
+#: src/elflint.c:520 src/elflint.c:537
#, c-format
msgid "invalid program header size: %hd\n"
msgstr "nieprawidłowa rozmiar nagłówka programu: %hd\n"
-#: src/elflint.c:503 src/elflint.c:520
+#: src/elflint.c:523 src/elflint.c:540
#, c-format
msgid "invalid program header position or size\n"
msgstr "nieprawidłowe położenie lub rozmiar nagłówka programu\n"
-#: src/elflint.c:506 src/elflint.c:523
+#: src/elflint.c:526 src/elflint.c:543
#, c-format
msgid "invalid section header size: %hd\n"
msgstr "nieprawidłowy rozmiar nagłówka sekcji: %hd\n"
-#: src/elflint.c:509 src/elflint.c:526
+#: src/elflint.c:529 src/elflint.c:546
#, c-format
msgid "invalid section header position or size\n"
msgstr "nieprawidłowe położenie lub rozmiar nagłówka sekcji\n"
-#: src/elflint.c:571
+#: src/elflint.c:591
#, c-format
msgid ""
"section [%2d] '%s': section with SHF_GROUP flag set not part of a section "
"group\n"
msgstr ""
-"sekcja [%2d] „%s”: sekcja z flagą SHF_GROUP nie jest częścią grupy sekcji\n"
+"sekcja [%2d] „%s”: sekcja z flagą SHF_GROUP nie jest częścią grupy sekcji\n"
-#: src/elflint.c:575
+#: src/elflint.c:595
#, c-format
msgid ""
"section [%2d] '%s': section group [%2zu] '%s' does not precede group member\n"
msgstr ""
"sekcja [%2d] „%s”: grupa sekcji [%2zu] „%s” nie poprzedza elementu grupy\n"
-#: src/elflint.c:591 src/elflint.c:1475 src/elflint.c:1526 src/elflint.c:1632
-#: src/elflint.c:1968 src/elflint.c:2284 src/elflint.c:2898 src/elflint.c:3061
-#: src/elflint.c:3209 src/elflint.c:3399 src/elflint.c:4366
+#: src/elflint.c:611 src/elflint.c:1495 src/elflint.c:1546 src/elflint.c:1652
+#: src/elflint.c:1988 src/elflint.c:2311 src/elflint.c:2930 src/elflint.c:3093
+#: src/elflint.c:3241 src/elflint.c:3431 src/elflint.c:4399
#, c-format
msgid "section [%2d] '%s': cannot get section data\n"
msgstr "sekcja [%2d] „%s”: nie można uzyskać danych sekcji\n"
-#: src/elflint.c:604 src/elflint.c:1639
+#: src/elflint.c:624 src/elflint.c:1659
#, c-format
msgid ""
"section [%2d] '%s': referenced as string table for section [%2d] '%s' but "
@@ -1527,7 +1676,7 @@
"sekcja [%2d] „%s”: użyta jako tabela ciągów dla sekcji [%2d] „%s”, ale nie "
"jest typu SHT_STRTAB\n"
-#: src/elflint.c:627
+#: src/elflint.c:647
#, c-format
msgid ""
"section [%2d] '%s': symbol table cannot have more than one extended index "
@@ -1536,119 +1685,120 @@
"sekcja [%2d] „%s”: tabela symboli nie może mieć więcej niż jednej "
"rozszerzonej sekcji indeksów\n"
-#: src/elflint.c:639
+#: src/elflint.c:659
#, c-format
msgid "section [%2u] '%s': entry size is does not match ElfXX_Sym\n"
-msgstr "sekcja [%2u] „%s”: rozmiar wpisu nie zgadza się z ElfXX_Sym\n"
+msgstr "sekcja [%2u] „%s”: rozmiar wpisu nie zgadza się z ElfXX_Sym\n"
-#: src/elflint.c:648
+#: src/elflint.c:668
#, c-format
msgid "section [%2d] '%s': cannot get symbol %d: %s\n"
msgstr "sekcja [%2d] „%s”: nie można uzyskać symbolu %d: %s\n"
-#: src/elflint.c:653 src/elflint.c:656 src/elflint.c:659 src/elflint.c:662
-#: src/elflint.c:665 src/elflint.c:668
+#: src/elflint.c:673 src/elflint.c:676 src/elflint.c:679 src/elflint.c:682
+#: src/elflint.c:685 src/elflint.c:688
#, c-format
msgid "section [%2d] '%s': '%s' in zeroth entry not zero\n"
-msgstr "sekcja [%2d] „%s”: „%s” w zerowym wpisie nie jest zerem\n"
+msgstr "sekcja [%2d] „%s”: „%s” w zerowym wpisie nie jest zerem\n"
-#: src/elflint.c:671
+#: src/elflint.c:691
#, c-format
msgid "section [%2d] '%s': XINDEX for zeroth entry not zero\n"
msgstr "sekcja [%2d] „%s”: XINDEX dla zerowego wpisu nie jest zerem\n"
-#: src/elflint.c:681
+#: src/elflint.c:701
#, c-format
msgid "section [%2d] '%s': cannot get symbol %zu: %s\n"
msgstr "sekcja [%2d] „%s”: nie można uzyskać symbolu %zu: %s\n"
-#: src/elflint.c:690
+#: src/elflint.c:710
#, c-format
msgid "section [%2d] '%s': symbol %zu: invalid name value\n"
msgstr "sekcja [%2d] „%s”: symbol %zu: nieprawidłowa wartość nazwy\n"
-#: src/elflint.c:705
+#: src/elflint.c:725
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: too large section index but no extended "
"section index section\n"
msgstr ""
-"sekcja [%2d] „%s”: symbol %zu: za duży indeks sekcji, ale nie posiada sekcji "
+"sekcja [%2d] „%s”: symbol %zu: za duży indeks sekcji, ale nie ma sekcji "
"rozszerzonych indeksów sekcji\n"
-#: src/elflint.c:711
+#: src/elflint.c:731
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: XINDEX used for index which would fit in "
"st_shndx (%<PRIu32>)\n"
msgstr ""
"sekcja [%2d] „%s”: symbol %zu: XINDEX użyty dla indeksu, który zmieściłby "
-"się w st_shndx (%<PRIu32>)\n"
+"się w st_shndx (%<PRIu32>)\n"
-#: src/elflint.c:723
+#. || sym->st_shndx > SHN_HIRESERVE always false
+#: src/elflint.c:743
#, c-format
msgid "section [%2d] '%s': symbol %zu: invalid section index\n"
msgstr "sekcja [%2d] „%s”: symbol %zu: nieprawidłowy indeks sekcji\n"
-#: src/elflint.c:731
+#: src/elflint.c:751
#, c-format
msgid "section [%2d] '%s': symbol %zu: unknown type\n"
msgstr "sekcja [%2d] „%s”: symbol %zu: nieznany typ\n"
-#: src/elflint.c:737
+#: src/elflint.c:757
#, c-format
msgid "section [%2d] '%s': symbol %zu: unknown symbol binding\n"
msgstr "sekcja [%2d] „%s”: symbol %zu: nieznane dowiązanie symbolu\n"
-#: src/elflint.c:742
+#: src/elflint.c:762
#, c-format
msgid "section [%2d] '%s': symbol %zu: unique symbol not of object type\n"
msgstr ""
"sekcja [%2d] „%s”: symbol %zu: unikalny symbol nie jest typem obiektu\n"
-#: src/elflint.c:750
+#: src/elflint.c:770
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: COMMON only allowed in relocatable files\n"
msgstr ""
-"sekcja [%2d] „%s”: symbol %zu: COMMON jest dozwolone tylko w plikach "
+"sekcja [%2d] „%s”: symbol %zu: COMMON jest dozwolone tylko w plikach "
"relokowalnych\n"
-#: src/elflint.c:754
+#: src/elflint.c:774
#, c-format
msgid "section [%2d] '%s': symbol %zu: local COMMON symbols are nonsense\n"
msgstr "sekcja [%2d] „%s”: symbol %zu: lokalne symbole COMMON to nonsens\n"
-#: src/elflint.c:758
+#: src/elflint.c:778
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: function in COMMON section is nonsense\n"
-msgstr "sekcja [%2d] „%s”: symbol %zu: funkcja w sekcji COMMON to nonsens\n"
+msgstr "sekcja [%2d] „%s”: symbol %zu: funkcja w sekcji COMMON to nonsens\n"
-#: src/elflint.c:809
+#: src/elflint.c:829
#, c-format
msgid "section [%2d] '%s': symbol %zu: st_value out of bounds\n"
msgstr "sekcja [%2d] „%s”: symbol %zu: st_value spoza zakresu\n"
-#: src/elflint.c:815 src/elflint.c:840 src/elflint.c:889
+#: src/elflint.c:835 src/elflint.c:860 src/elflint.c:909
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu does not fit completely in referenced section "
"[%2d] '%s'\n"
msgstr ""
-"sekcja [%2d] „%s”: symbol %zu nie mieści się w całości we wskazywanej sekcji "
+"sekcja [%2d] „%s”: symbol %zu nie mieści się w całości we wskazywanej sekcji "
"[%2d] „%s”\n"
-#: src/elflint.c:824
+#: src/elflint.c:844
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: referenced section [%2d] '%s' does not have "
"SHF_TLS flag set\n"
msgstr ""
-"sekcja [%2d] „%s”: symbol %zu: wskazywana sekcja [%2d] „%s” nie posiada "
+"sekcja [%2d] „%s”: symbol %zu: wskazywana sekcja [%2d] „%s” nie ma "
"ustawionej flagi SHF_TLS\n"
-#: src/elflint.c:834 src/elflint.c:882
+#: src/elflint.c:854 src/elflint.c:902
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: st_value out of bounds of referenced section "
@@ -1657,7 +1807,7 @@
"sekcja [%2d] „%s”: symbol %zu: st_value spoza zakresu wskazywanej sekcji "
"[%2d] „%s”\n"
-#: src/elflint.c:861
+#: src/elflint.c:881
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: TLS symbol but no TLS program header entry\n"
@@ -1665,7 +1815,7 @@
"sekcja [%2d] „%s”: symbol %zu: symbol TLS, ale brak wpisu TLS nagłówka "
"programu\n"
-#: src/elflint.c:867
+#: src/elflint.c:887
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: TLS symbol but couldn't get TLS program "
@@ -1674,7 +1824,7 @@
"sekcja [%2d] „%s”: symbol %zu: symbol TLS, ale nie można uzyskać wpisu TLS "
"nagłówka programu\n"
-#: src/elflint.c:875
+#: src/elflint.c:895
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: st_value short of referenced section [%2d] "
@@ -1682,30 +1832,30 @@
msgstr ""
"sekcja [%2d] „%s”: symbol %zu: st_value pomija wskazywaną sekcję [%2d] „%s”\n"
-#: src/elflint.c:902
+#: src/elflint.c:922
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: local symbol outside range described in "
"sh_info\n"
msgstr ""
-"sekcja [%2d] „%s”: symbol %zu: lokalny symbol spoza zakresu określonego w "
-"sh_info\n"
+"sekcja [%2d] „%s”: symbol %zu: lokalny symbol spoza zakresu określonego "
+"w sh_info\n"
-#: src/elflint.c:909
+#: src/elflint.c:929
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: non-local symbol outside range described in "
"sh_info\n"
msgstr ""
-"sekcja [%2d] „%s”: symbol %zu: nielokalny symbol spoza zakresu określonego w "
-"sh_info\n"
+"sekcja [%2d] „%s”: symbol %zu: nielokalny symbol spoza zakresu określonego "
+"w sh_info\n"
-#: src/elflint.c:916
+#: src/elflint.c:936
#, c-format
msgid "section [%2d] '%s': symbol %zu: non-local section symbol\n"
msgstr "sekcja [%2d] „%s”: symbol %zu: nielokalny symbol sekcji\n"
-#: src/elflint.c:966
+#: src/elflint.c:986
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to bad section "
@@ -1714,7 +1864,7 @@
"sekcja [%2d] „%s”: symbol _GLOBAL_OFFSET_TABLE_ odnosi się do błędnej sekcji "
"[%2d]\n"
-#: src/elflint.c:973
+#: src/elflint.c:993
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to section [%2d] "
@@ -1723,7 +1873,10 @@
"sekcja [%2d] „%s”: symbol _GLOBAL_OFFSET_TABLE_ odnosi się do sekcji [%2d] "
"„%s”\n"
-#: src/elflint.c:989
+#. This test is more strict than the psABIs which
+#. usually allow the symbol to be in the middle of
+#. the .got section, allowing negative offsets.
+#: src/elflint.c:1009
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol value %#<PRIx64> does not "
@@ -1732,7 +1885,7 @@
"sekcja [%2d] „%s”: wartość symbolu _GLOBAL_OFFSET_TABLE_ %#<PRIx64> nie "
"pasuje do adresu sekcji %s %#<PRIx64>\n"
-#: src/elflint.c:996
+#: src/elflint.c:1016
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol size %<PRIu64> does not "
@@ -1741,7 +1894,7 @@
"sekcja [%2d] „%s”: rozmiar symbolu _GLOBAL_OFFSET_TABLE_ %<PRIu64> nie "
"pasuje do rozmiaru sekcji %s %<PRIu64>\n"
-#: src/elflint.c:1004
+#: src/elflint.c:1024
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol present, but no .got "
@@ -1750,7 +1903,7 @@
"sekcja [%2d] „%s”: symbol _GLOBAL_OFFSET_TABLE_ istnieje, ale brak sekcji ."
"got\n"
-#: src/elflint.c:1020
+#: src/elflint.c:1040
#, c-format
msgid ""
"section [%2d] '%s': _DYNAMIC_ symbol value %#<PRIx64> does not match dynamic "
@@ -1759,7 +1912,7 @@
"sekcja [%2d] „%s”: wartość symbolu _DYNAMIC_ %#<PRIx64> nie pasuje do adresu "
"segmentu dynamicznego %#<PRIx64>\n"
-#: src/elflint.c:1027
+#: src/elflint.c:1047
#, c-format
msgid ""
"section [%2d] '%s': _DYNAMIC symbol size %<PRIu64> does not match dynamic "
@@ -1768,36 +1921,36 @@
"sekcja [%2d] „%s”: rozmiar symbolu _DYNAMIC_ %<PRIu64> nie pasuje do "
"rozmiaru segmentu dynamicznego %<PRIu64>\n"
-#: src/elflint.c:1040
+#: src/elflint.c:1060
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: symbol in dynamic symbol table with non-"
"default visibility\n"
msgstr ""
-"sekcja [%2d] „%s”: symbol %zu: symbol w dynamicznej tabeli symboli z "
-"niedomyślną widocznością\n"
+"sekcja [%2d] „%s”: symbol %zu: symbol w dynamicznej tabeli symboli "
+"z niedomyślną widocznością\n"
-#: src/elflint.c:1044
+#: src/elflint.c:1064
#, c-format
msgid "section [%2d] '%s': symbol %zu: unknown bit set in st_other\n"
-msgstr "sekcja [%2d] „%s”: symbol %zu: ustawiono nieznany bit w st_other\n"
+msgstr "sekcja [%2d] „%s”: symbol %zu: ustawiono nieznany bit w st_other\n"
-#: src/elflint.c:1082
+#: src/elflint.c:1102
#, c-format
msgid "section [%2d] '%s': cannot get section data.\n"
msgstr "sekcja [%2d] „%s”: nie można uzyskać danych sekcji.\n"
-#: src/elflint.c:1098
+#: src/elflint.c:1118
#, c-format
msgid "section [%2d] '%s': DT_RELCOUNT used for this RELA section\n"
msgstr "sekcja [%2d] „%s”: DT_RELCOUNT użyte dla tej sekcji RELA\n"
-#: src/elflint.c:1109 src/elflint.c:1162
+#: src/elflint.c:1129 src/elflint.c:1182
#, c-format
msgid "section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"
msgstr "sekcja [%2d] „%s”: DT_RELCOUNT %d za duże dla tej sekcji\n"
-#: src/elflint.c:1134 src/elflint.c:1187
+#: src/elflint.c:1154 src/elflint.c:1207
#, c-format
msgid ""
"section [%2d] '%s': relative relocations after index %d as specified by "
@@ -1806,7 +1959,7 @@
"sekcja [%2d] „%s”: relokacje względne po indeksie %d podanym przez "
"DT_RELCOUNT\n"
-#: src/elflint.c:1140 src/elflint.c:1193
+#: src/elflint.c:1160 src/elflint.c:1213
#, c-format
msgid ""
"section [%2d] '%s': non-relative relocation at index %zu; DT_RELCOUNT "
@@ -1815,51 +1968,50 @@
"sekcja [%2d] „%s”: relokacja bezwzględna pod indeksem %zu; DT_RELCOUNT podał "
"%d relokacji względnych\n"
-#: src/elflint.c:1152
+#: src/elflint.c:1172
#, c-format
msgid "section [%2d] '%s': DT_RELACOUNT used for this REL section\n"
msgstr "sekcja [%2d] „%s”: DT_RELACOUNT użyte dla tej sekcji REL\n"
-#: src/elflint.c:1235
+#: src/elflint.c:1255
#, c-format
msgid "section [%2d] '%s': invalid destination section index\n"
msgstr "sekcja [%2d] „%s”: nieprawidłowy indeks sekcji docelowej\n"
-#: src/elflint.c:1247
+#: src/elflint.c:1267
#, c-format
msgid "section [%2d] '%s': invalid destination section type\n"
msgstr "sekcja [%2d] „%s”: nieprawidłowy typ sekcji docelowej\n"
-#: src/elflint.c:1255
+#: src/elflint.c:1275
#, c-format
msgid "section [%2d] '%s': sh_info should be zero\n"
msgstr "sekcja [%2d] „%s”: sh_info powinno wynosić zero\n"
-#: src/elflint.c:1263
+#: src/elflint.c:1283
#, c-format
msgid ""
"section [%2d] '%s': no relocations for merge-able string sections possible\n"
msgstr ""
"sekcja [%2d] „%s”: relokacje dla sekcji złączalnych ciągów są niemożliwe\n"
-#: src/elflint.c:1271
+#: src/elflint.c:1291
#, c-format
msgid "section [%2d] '%s': section entry size does not match ElfXX_Rela\n"
-msgstr "sekcja [%2d] „%s”: rozmiar wpisu sekcji nie zgadza się z ElfXX_Rela\n"
+msgstr "sekcja [%2d] „%s”: rozmiar wpisu sekcji nie zgadza się z ElfXX_Rela\n"
-#: src/elflint.c:1331
+#: src/elflint.c:1351
#, c-format
msgid "text relocation flag set but there is no read-only segment\n"
msgstr ""
-"flaga relokacji tekstu jest ustawiona, ale nie posiada segmentu tylko do "
-"odczytu\n"
+"flaga relokacji tekstu jest ustawiona, ale nie ma segmentu tylko do odczytu\n"
-#: src/elflint.c:1358
+#: src/elflint.c:1378
#, c-format
msgid "section [%2d] '%s': relocation %zu: invalid type\n"
msgstr "sekcja [%2d] „%s”: relokacja %zu: nieprawidłowy typ\n"
-#: src/elflint.c:1366
+#: src/elflint.c:1386
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: relocation type invalid for the file "
@@ -1868,26 +2020,26 @@
"sekcja [%2d] „%s”: relokacja %zu: typ relokacji nieprawidłowy dla tego typu "
"pliku\n"
-#: src/elflint.c:1374
+#: src/elflint.c:1394
#, c-format
msgid "section [%2d] '%s': relocation %zu: invalid symbol index\n"
msgstr "sekcja [%2d] „%s”: relokacja %zu: nieprawidłowy indeks symbolu\n"
-#: src/elflint.c:1392
+#: src/elflint.c:1412
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: only symbol '_GLOBAL_OFFSET_TABLE_' can "
"be used with %s\n"
msgstr ""
-"sekcja [%2d] „%s”: relokacja %zu: z %s można użyć tylko symbolu "
+"sekcja [%2d] „%s”: relokacja %zu: z %s można użyć tylko symbolu "
"„_GLOBAL_OFFSET_TABLE_”\n"
-#: src/elflint.c:1409
+#: src/elflint.c:1429
#, c-format
msgid "section [%2d] '%s': relocation %zu: offset out of bounds\n"
msgstr "sekcja [%2d] „%s”: relokacja %zu: offset spoza zakresu\n"
-#: src/elflint.c:1424
+#: src/elflint.c:1444
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: copy relocation against symbol of type "
@@ -1895,7 +2047,7 @@
msgstr ""
"sekcja [%2d] „%s”: relokacja %zu: relokacja kopii względem symbolu typu %s\n"
-#: src/elflint.c:1445
+#: src/elflint.c:1465
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: read-only section modified but text "
@@ -1904,23 +2056,23 @@
"sekcja [%2d] „%s”: relokacja %zu: sekcja tylko do odczytu została "
"zmodyfikowana, ale nie ustawiono flagi relokacji tekstu\n"
-#: src/elflint.c:1460
+#: src/elflint.c:1480
#, c-format
msgid "section [%2d] '%s': relocations are against loaded and unloaded data\n"
msgstr ""
-"sekcja [%2d] „%s”: relokacje względem wczytanych i niewczytanych danych\n"
+"sekcja [%2d] „%s”: relokacje względem wczytanych i niewczytanych danych\n"
-#: src/elflint.c:1500 src/elflint.c:1551
+#: src/elflint.c:1520 src/elflint.c:1571
#, c-format
msgid "section [%2d] '%s': cannot get relocation %zu: %s\n"
msgstr "sekcja [%2d] „%s”: nie można uzyskać relokacji %zu: %s\n"
-#: src/elflint.c:1627
+#: src/elflint.c:1647
#, c-format
msgid "more than one dynamic section present\n"
msgstr "obecna jest więcej niż jedna sekcja dynamiczna\n"
-#: src/elflint.c:1645
+#: src/elflint.c:1665
#, c-format
msgid ""
"section [%2d]: referenced as string table for section [%2d] '%s' but section "
@@ -1929,43 +2081,43 @@
"sekcja [%2d]: wskazane jako tabela ciągów dla sekcji [%2d] „%s”, ale wartość "
"dowiązania sekcji jest nieprawidłowa\n"
-#: src/elflint.c:1653
+#: src/elflint.c:1673
#, c-format
msgid "section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"
-msgstr "sekcja [%2d] „%s”: rozmiar wpisu sekcji nie zgadza się z ElfXX_Dyn\n"
+msgstr "sekcja [%2d] „%s”: rozmiar wpisu sekcji nie zgadza się z ElfXX_Dyn\n"
-#: src/elflint.c:1658 src/elflint.c:1947
+#: src/elflint.c:1678 src/elflint.c:1967
#, c-format
msgid "section [%2d] '%s': sh_info not zero\n"
msgstr "sekcja [%2d] „%s”: sh_info nie wynosi zero\n"
-#: src/elflint.c:1668
+#: src/elflint.c:1688
#, c-format
msgid "section [%2d] '%s': cannot get dynamic section entry %zu: %s\n"
msgstr ""
"sekcja [%2d] „%s”: nie można uzyskać wpisu %zu sekcji dynamicznej: %s\n"
-#: src/elflint.c:1676
+#: src/elflint.c:1696
#, c-format
msgid "section [%2d] '%s': non-DT_NULL entries follow DT_NULL entry\n"
msgstr "sekcja [%2d] „%s”: wpisy nie-DT_NULL występują po wpisie DT_NULL\n"
-#: src/elflint.c:1683
+#: src/elflint.c:1703
#, c-format
msgid "section [%2d] '%s': entry %zu: unknown tag\n"
msgstr "sekcja [%2d] „%s”: wpis %zu: nieznany znacznik\n"
-#: src/elflint.c:1694
+#: src/elflint.c:1714
#, c-format
msgid "section [%2d] '%s': entry %zu: more than one entry with tag %s\n"
msgstr "sekcja [%2d] „%s”: wpis %zu: więcej niż jeden wpis ze znacznikiem %s\n"
-#: src/elflint.c:1704
+#: src/elflint.c:1724
#, c-format
msgid "section [%2d] '%s': entry %zu: level 2 tag %s used\n"
msgstr "sekcja [%2d] „%s”: wpis %zu: użyto znacznika %s poziomu 2\n"
-#: src/elflint.c:1722
+#: src/elflint.c:1742
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: DT_PLTREL value must be DT_REL or DT_RELA\n"
@@ -1973,7 +2125,7 @@
"sekcja [%2d] „%s”: wpis %zu: wartość DT_PLTREL musi wynosić DT_REL lub "
"DT_RELA\n"
-#: src/elflint.c:1735
+#: src/elflint.c:1755
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: pointer does not match address of section "
@@ -1982,64 +2134,64 @@
"sekcja [%2d] „%s”: wpis %zu: wskaźnik nie pasuje do adresu sekcji [%2d] „%s” "
"wskazywanej przez sh_link\n"
-#: src/elflint.c:1778
+#: src/elflint.c:1798
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: %s value must point into loaded segment\n"
msgstr ""
"sekcja [%2d] „%s”: wpis %zu: wartość %s musi wskazywać na wczytany segment\n"
-#: src/elflint.c:1793
+#: src/elflint.c:1813
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: %s value must be valid offset in section "
"[%2d] '%s'\n"
msgstr ""
-"sekcja [%2d] „%s”: wpis %zu: wartość %s musi być prawidłowym offsetem w "
-"sekcji [%2d] „%s”\n"
+"sekcja [%2d] „%s”: wpis %zu: wartość %s musi być prawidłowym offsetem "
+"w sekcji [%2d] „%s”\n"
-#: src/elflint.c:1813 src/elflint.c:1841
+#: src/elflint.c:1833 src/elflint.c:1861
#, c-format
msgid "section [%2d] '%s': contains %s entry but not %s\n"
msgstr "sekcja [%2d] „%s”: zawiera wpis %s, ale nie %s\n"
-#: src/elflint.c:1825
+#: src/elflint.c:1845
#, c-format
msgid "section [%2d] '%s': mandatory tag %s not present\n"
msgstr "sekcja [%2d] „%s”: brak obowiązkowego znacznika %s\n"
-#: src/elflint.c:1834
+#: src/elflint.c:1854
#, c-format
msgid "section [%2d] '%s': no hash section present\n"
msgstr "sekcja [%2d] „%s”: brak sekcji skrótów\n"
-#: src/elflint.c:1849 src/elflint.c:1856
+#: src/elflint.c:1869 src/elflint.c:1876
#, c-format
msgid "section [%2d] '%s': not all of %s, %s, and %s are present\n"
-msgstr "sekcja [%2d] „%s”: nie wszystkie z %s, %s i %s są obecne\n"
+msgstr "sekcja [%2d] „%s”: nie wszystkie z %s, %s i %s są obecne\n"
-#: src/elflint.c:1866 src/elflint.c:1870
+#: src/elflint.c:1886 src/elflint.c:1890
#, c-format
msgid "section [%2d] '%s': %s tag missing in DSO marked during prelinking\n"
msgstr ""
-"sekcja [%2d] „%s”: brak znacznika %s w DSO oznaczonym podczas wstępnej "
+"sekcja [%2d] „%s”: brak znacznika %s w DSO oznaczonym podczas wstępnej "
"konsolidacji\n"
-#: src/elflint.c:1876
+#: src/elflint.c:1896
#, c-format
msgid "section [%2d] '%s': non-DSO file marked as dependency during prelink\n"
msgstr ""
"sekcja [%2d] „%s”: plik nie-DSO oznaczony jako zależność podczas wstępnej "
"konsolidacji\n"
-#: src/elflint.c:1887 src/elflint.c:1891 src/elflint.c:1895 src/elflint.c:1899
+#: src/elflint.c:1907 src/elflint.c:1911 src/elflint.c:1915 src/elflint.c:1919
#, c-format
msgid "section [%2d] '%s': %s tag missing in prelinked executable\n"
msgstr ""
"sekcja [%2d] „%s”: brak znacznika %s we wstępnie konsolidowanym pliku "
"wykonywalnym\n"
-#: src/elflint.c:1911
+#: src/elflint.c:1931
#, c-format
msgid ""
"section [%2d] '%s': only relocatable files can have extended section index\n"
@@ -2047,7 +2199,7 @@
"sekcja [%2d] „%s”: tylko pliki relokowalne mogą mieć rozszerzoną sekcję "
"indeksów\n"
-#: src/elflint.c:1921
+#: src/elflint.c:1941
#, c-format
msgid ""
"section [%2d] '%s': extended section index section not for symbol table\n"
@@ -2055,57 +2207,57 @@
"sekcja [%2d] „%s”: sekcja rozszerzonych indeksów sekcji nie dla tabeli "
"symboli\n"
-#: src/elflint.c:1925
+#: src/elflint.c:1945
#, c-format
msgid "section [%2d] '%s': sh_link extended section index [%2d] is invalid\n"
msgstr ""
"sekcja [%2d] „%s”: rozszerzony indeks sekcji sh_link [%2d] jest "
"nieprawidłowy\n"
-#: src/elflint.c:1930
+#: src/elflint.c:1950
#, c-format
msgid "cannot get data for symbol section\n"
msgstr "nie można uzyskać danych dla sekcji symboli\n"
-#: src/elflint.c:1933
+#: src/elflint.c:1953
#, c-format
msgid "section [%2d] '%s': entry size does not match Elf32_Word\n"
-msgstr "sekcja [%2d] „%s”: rozmiar wpisu nie zgadza się z Elf32_Word\n"
+msgstr "sekcja [%2d] „%s”: rozmiar wpisu nie zgadza się z Elf32_Word\n"
-#: src/elflint.c:1942
+#: src/elflint.c:1962
#, c-format
msgid "section [%2d] '%s': extended index table too small for symbol table\n"
msgstr ""
"sekcja [%2d] „%s”: tabela rozszerzonych indeksów jest za mała dla tabeli "
"symboli\n"
-#: src/elflint.c:1957
+#: src/elflint.c:1977
#, c-format
msgid ""
"section [%2d] '%s': extended section index in section [%2zu] '%s' refers to "
"same symbol table\n"
msgstr ""
-"sekcja [%2d] „%s”: rozszerzony indeks sekcji w sekcji [%2zu] „%s” odwołuje "
+"sekcja [%2d] „%s”: rozszerzony indeks sekcji w sekcji [%2zu] „%s” odwołuje "
"się do tej samej tabeli symboli\n"
-#: src/elflint.c:1974
+#: src/elflint.c:1995
#, c-format
msgid "symbol 0 should have zero extended section index\n"
msgstr "symbol 0 powinien mieć zerowy rozszerzony indeks sekcji\n"
-#: src/elflint.c:1986
+#: src/elflint.c:2007
#, c-format
msgid "cannot get data for symbol %zu\n"
msgstr "nie można uzyskać danych dla symbolu %zu\n"
-#: src/elflint.c:1991
+#: src/elflint.c:2012
#, c-format
msgid "extended section index is %<PRIu32> but symbol index is not XINDEX\n"
msgstr ""
"rozszerzony indeks sekcji wynosi %<PRIu32>, ale indeks symbolu nie wynosi "
"XINDEX\n"
-#: src/elflint.c:2007 src/elflint.c:2058
+#: src/elflint.c:2029 src/elflint.c:2083
#, c-format
msgid ""
"section [%2d] '%s': hash table section is too small (is %ld, expected %ld)\n"
@@ -2113,43 +2265,43 @@
"sekcja [%2d] „%s”: sekcja tabeli mieszającej jest za mała (%ld, oczekiwano "
"%ld)\n"
-#: src/elflint.c:2019 src/elflint.c:2070
+#: src/elflint.c:2043 src/elflint.c:2097
#, c-format
msgid "section [%2d] '%s': chain array too large\n"
msgstr "sekcja [%2d] „%s”: tabela łańcuchowa jest za duża\n"
-#: src/elflint.c:2033 src/elflint.c:2084
+#: src/elflint.c:2057 src/elflint.c:2111
#, c-format
msgid "section [%2d] '%s': hash bucket reference %zu out of bounds\n"
msgstr ""
"sekcja [%2d] „%s”: odwołanie do kubełka skrótu %zu jest spoza zakresu\n"
-#: src/elflint.c:2043
+#: src/elflint.c:2067
#, c-format
msgid "section [%2d] '%s': hash chain reference %zu out of bounds\n"
msgstr ""
"sekcja [%2d] „%s”: odwołanie do łańcucha skrótu %zu jest spoza zakresu\n"
-#: src/elflint.c:2094
+#: src/elflint.c:2121
#, c-format
msgid "section [%2d] '%s': hash chain reference %<PRIu64> out of bounds\n"
msgstr ""
"sekcja [%2d] „%s”: odwołanie do łańcucha skrótu %<PRIu64> jest spoza "
"zakresu\n"
-#: src/elflint.c:2107
+#: src/elflint.c:2134
#, c-format
msgid "section [%2d] '%s': not enough data\n"
msgstr "sekcja [%2d] „%s”: brak wystarczającej ilości danych\n"
-#: src/elflint.c:2119
+#: src/elflint.c:2146
#, c-format
msgid "section [%2d] '%s': bitmask size zero or not power of 2: %u\n"
msgstr ""
"sekcja [%2d] „%s”: rozmiar maski bitowej wynosi zero lub nie jest potęgą 2: "
"%u\n"
-#: src/elflint.c:2135
+#: src/elflint.c:2162
#, c-format
msgid ""
"section [%2d] '%s': hash table section is too small (is %ld, expected at "
@@ -2158,13 +2310,13 @@
"sekcja [%2d] „%s”: sekcja tabeli mieszającej jest za mała (wynosi %ld, "
"oczekiwano co najmniej %ld)\n"
-#: src/elflint.c:2144
+#: src/elflint.c:2171
#, c-format
msgid "section [%2d] '%s': 2nd hash function shift too big: %u\n"
msgstr ""
"sekcja [%2d] „%s”: drugie przesunięcie funkcji mieszającej jest za duże: %u\n"
-#: src/elflint.c:2178
+#: src/elflint.c:2205
#, c-format
msgid ""
"section [%2d] '%s': hash chain for bucket %zu lower than symbol index bias\n"
@@ -2172,110 +2324,110 @@
"sekcja [%2d] „%s”: łańcuch mieszający dla kubełka %zu jest mniejszy niż "
"przesunięcie indeksu symboli\n"
-#: src/elflint.c:2199
+#: src/elflint.c:2226
#, c-format
msgid ""
"section [%2d] '%s': symbol %u referenced in chain for bucket %zu is "
"undefined\n"
msgstr ""
-"sekcja [%2d] „%s”: symbol %u wskazywany w łańcuchu dla kubełka %zu jest "
+"sekcja [%2d] „%s”: symbol %u wskazywany w łańcuchu dla kubełka %zu jest "
"nieokreślony\n"
-#: src/elflint.c:2212
+#: src/elflint.c:2239
#, c-format
msgid ""
"section [%2d] '%s': hash value for symbol %u in chain for bucket %zu wrong\n"
msgstr ""
-"sekcja [%2d] „%s”: wartość skrótu dla symbolu %u w łańcuchu dla kubełka %zu "
+"sekcja [%2d] „%s”: wartość skrótu dla symbolu %u w łańcuchu dla kubełka %zu "
"jest błędna\n"
-#: src/elflint.c:2221
+#: src/elflint.c:2248
#, c-format
msgid ""
"section [%2d] '%s': mask index for symbol %u in chain for bucket %zu wrong\n"
msgstr ""
-"sekcja [%2d] „%s”: indeks maski dla symbolu %u w łańcuchu dla kubełka %zu "
+"sekcja [%2d] „%s”: indeks maski dla symbolu %u w łańcuchu dla kubełka %zu "
"jest błędny\n"
-#: src/elflint.c:2251
+#: src/elflint.c:2278
#, c-format
msgid "section [%2d] '%s': hash chain for bucket %zu out of bounds\n"
msgstr "sekcja [%2d] „%s”: łańcuch skrótu dla kubełka %zu jest spoza zakresu\n"
-#: src/elflint.c:2256
+#: src/elflint.c:2283
#, c-format
msgid ""
"section [%2d] '%s': symbol reference in chain for bucket %zu out of bounds\n"
msgstr ""
-"sekcja [%2d] „%s”: odwołanie do symbolu w łańcuchu dla kubełka %zu jest "
+"sekcja [%2d] „%s”: odwołanie do symbolu w łańcuchu dla kubełka %zu jest "
"spoza zakresu\n"
-#: src/elflint.c:2262
+#: src/elflint.c:2289
#, c-format
msgid "section [%2d] '%s': bitmask does not match names in the hash table\n"
msgstr ""
-"sekcja [%2d] „%s”: maska bitowa nie pasuje do nazw w tabeli mieszającej\n"
+"sekcja [%2d] „%s”: maska bitowa nie pasuje do nazw w tabeli mieszającej\n"
-#: src/elflint.c:2275
+#: src/elflint.c:2302
#, c-format
msgid "section [%2d] '%s': relocatable files cannot have hash tables\n"
msgstr ""
-"sekcja [%2d] „%s”: pliki relokowalne nie mogą posiadać tabeli mieszających\n"
+"sekcja [%2d] „%s”: pliki relokowalne nie mogą mieć tabeli mieszających\n"
-#: src/elflint.c:2293
+#: src/elflint.c:2320
#, c-format
msgid "section [%2d] '%s': hash table not for dynamic symbol table\n"
msgstr ""
"sekcja [%2d] „%s”: tabela mieszająca nie dla tabeli dynamicznych symboli\n"
-#: src/elflint.c:2297
+#: src/elflint.c:2324
#, c-format
msgid "section [%2d] '%s': invalid sh_link symbol table section index [%2d]\n"
msgstr ""
"sekcja [%2d] „%s”: nieprawidłowy indeks sekcji tabeli symboli sh_link [%2d]\n"
-#: src/elflint.c:2305
+#: src/elflint.c:2334
#, c-format
msgid "section [%2d] '%s': hash table entry size incorrect\n"
msgstr "sekcja [%2d] „%s”: niepoprawny rozmiar wpisu tabeli mieszającej\n"
-#: src/elflint.c:2310
+#: src/elflint.c:2339
#, c-format
msgid "section [%2d] '%s': not marked to be allocated\n"
msgstr "sekcja [%2d] „%s”: nieoznaczona do przydzielenia\n"
-#: src/elflint.c:2315
+#: src/elflint.c:2344
#, c-format
msgid ""
"section [%2d] '%s': hash table has not even room for initial administrative "
"entries\n"
msgstr ""
-"sekcja [%2d] „%s”: tabela mieszająca nie posiada miejsca nawet na początkowe "
+"sekcja [%2d] „%s”: tabela mieszająca nie ma miejsca nawet na początkowe "
"wpisy administracyjne\n"
-#: src/elflint.c:2364
+#: src/elflint.c:2393
#, c-format
msgid "sh_link in hash sections [%2zu] '%s' and [%2zu] '%s' not identical\n"
msgstr ""
-"sh_link w sekcjach skrótu [%2zu] „%s” i [%2zu] „%s” nie są identyczne\n"
+"sh_link w sekcjach skrótu [%2zu] „%s” i [%2zu] „%s” nie są identyczne\n"
-#: src/elflint.c:2388 src/elflint.c:2453 src/elflint.c:2488
+#: src/elflint.c:2417 src/elflint.c:2482 src/elflint.c:2517
#, c-format
msgid "hash section [%2zu] '%s' does not contain enough data\n"
msgstr ""
"sekcja mieszania [%2zu] „%s” nie zawiera wystarczającej ilości danych\n"
-#: src/elflint.c:2409
+#: src/elflint.c:2438
#, c-format
msgid "hash section [%2zu] '%s' has zero bit mask words\n"
-msgstr "sekcja mieszania [%2zu] „%s” posiada zerowe słowa maski bitów\n"
+msgstr "sekcja mieszania [%2zu] „%s” ma zerowe słowa maski bitów\n"
-#: src/elflint.c:2420 src/elflint.c:2464 src/elflint.c:2501
+#: src/elflint.c:2449 src/elflint.c:2493 src/elflint.c:2530
#, c-format
msgid "hash section [%2zu] '%s' uses too much data\n"
msgstr "sekcja mieszania [%2zu] „%s” używa za dużo danych\n"
-#: src/elflint.c:2435
+#: src/elflint.c:2464
#, c-format
msgid ""
"hash section [%2zu] '%s' invalid symbol index %<PRIu32> (max_nsyms: "
@@ -2284,137 +2436,137 @@
"sekcja mieszająca [%2zu] „%s” nieprawidłowy indeks symboli %<PRIu32> "
"(max_nsyms: %<PRIu32>, nentries: %<PRIu32>\n"
-#: src/elflint.c:2522
+#: src/elflint.c:2551
#, c-format
msgid "hash section [%2zu] '%s' invalid sh_entsize\n"
msgstr "sekcja mieszania [%2zu] „%s” nieprawidłowe sh_entsize\n"
-#: src/elflint.c:2532 src/elflint.c:2536
+#: src/elflint.c:2561 src/elflint.c:2565
#, c-format
msgid "section [%2zu] '%s': reference to symbol index 0\n"
-msgstr "sekcja [%2zu] „%s”: odwołanie do symbolu o indeksie 0\n"
+msgstr "sekcja [%2zu] „%s”: odwołanie do symbolu o indeksie 0\n"
-#: src/elflint.c:2543
+#: src/elflint.c:2572
#, c-format
msgid ""
"symbol %d referenced in new hash table in [%2zu] '%s' but not in old hash "
"table in [%2zu] '%s'\n"
msgstr ""
-"symbol %d wymieniony w nowej tabeli mieszającej w [%2zu] „%s”, ale nie w "
-"poprzedniej tabeli mieszającej [%2zu] „%s”\n"
+"symbol %d wymieniony w nowej tabeli mieszającej w [%2zu] „%s”, ale nie "
+"w poprzedniej tabeli mieszającej [%2zu] „%s”\n"
-#: src/elflint.c:2555
+#: src/elflint.c:2584
#, c-format
msgid ""
"symbol %d referenced in old hash table in [%2zu] '%s' but not in new hash "
"table in [%2zu] '%s'\n"
msgstr ""
-"symbol %d wymieniony w poprzedniej tabeli mieszającej w [%2zu] „%s”, ale nie "
-"w nowej tabeli mieszającej w [%2zu] „%s”\n"
+"symbol %d wymieniony w poprzedniej tabeli mieszającej w [%2zu] „%s”, ale nie "
+"w nowej tabeli mieszającej w [%2zu] „%s”\n"
-#: src/elflint.c:2571
+#: src/elflint.c:2600
#, c-format
msgid "section [%2d] '%s': nonzero sh_%s for NULL section\n"
msgstr "sekcja [%2d] „%s”: niezerowe sh_%s dla sekcji NULL\n"
-#: src/elflint.c:2591
+#: src/elflint.c:2620
#, c-format
msgid ""
"section [%2d] '%s': section groups only allowed in relocatable object files\n"
msgstr ""
-"sekcja [%2d] „%s”: w plikach obiektów relokowalnych dozwolone są tylko grupy "
+"sekcja [%2d] „%s”: w plikach obiektów relokowalnych dozwolone są tylko grupy "
"sekcji\n"
-#: src/elflint.c:2602
+#: src/elflint.c:2631
#, c-format
msgid "section [%2d] '%s': cannot get symbol table: %s\n"
msgstr "sekcja [%2d] „%s”: nie można uzyskać tabeli symboli: %s\n"
-#: src/elflint.c:2607
+#: src/elflint.c:2636
#, c-format
msgid "section [%2d] '%s': section reference in sh_link is no symbol table\n"
msgstr ""
-"sekcja [%2d] „%s”: odwołanie do sekcji w sh_link nie posiada tabeli symboli\n"
+"sekcja [%2d] „%s”: odwołanie do sekcji w sh_link nie ma tabeli symboli\n"
-#: src/elflint.c:2613
+#: src/elflint.c:2642
#, c-format
msgid "section [%2d] '%s': invalid symbol index in sh_info\n"
-msgstr "sekcja [%2d] „%s”: nieprawidłowy indeks symbolu w sh_info\n"
+msgstr "sekcja [%2d] „%s”: nieprawidłowy indeks symbolu w sh_info\n"
-#: src/elflint.c:2618
+#: src/elflint.c:2647
#, c-format
msgid "section [%2d] '%s': sh_flags not zero\n"
msgstr "sekcja [%2d] „%s”: niezerowe sh_flags\n"
-#: src/elflint.c:2625
+#: src/elflint.c:2654
#, c-format
msgid "section [%2d] '%s': cannot get symbol for signature\n"
msgstr "sekcja [%2d] „%s”: nie można uzyskać symbolu dla podpisu\n"
-#: src/elflint.c:2629
+#: src/elflint.c:2658
#, c-format
msgid "section [%2d] '%s': cannot get symbol name for signature\n"
msgstr "sekcja [%2d] „%s”: nie można uzyskać nazwy symbolu dla podpisu\n"
-#: src/elflint.c:2634
+#: src/elflint.c:2663
#, c-format
msgid "section [%2d] '%s': signature symbol cannot be empty string\n"
msgstr "sekcja [%2d] „%s”: symbol podpisu nie można być pustym ciągiem\n"
-#: src/elflint.c:2640
+#: src/elflint.c:2669
#, c-format
msgid "section [%2d] '%s': sh_flags not set correctly\n"
msgstr "sekcja [%2d] „%s”: sh_flags nie ustawione poprawnie\n"
-#: src/elflint.c:2646
+#: src/elflint.c:2675
#, c-format
msgid "section [%2d] '%s': cannot get data: %s\n"
msgstr "sekcja [%2d] „%s”: nie można uzyskać danych: %s\n"
-#: src/elflint.c:2655
+#: src/elflint.c:2684
#, c-format
msgid "section [%2d] '%s': section size not multiple of sizeof(Elf32_Word)\n"
msgstr ""
"sekcja [%2d] „%s”: rozmiar sekcji nie jest wielokrotnością "
"sizeof(Elf32_Word)\n"
-#: src/elflint.c:2660
+#: src/elflint.c:2690
#, c-format
msgid "section [%2d] '%s': section group without flags word\n"
msgstr "sekcja [%2d] „%s”: grupa sekcji bez słowa flag\n"
-#: src/elflint.c:2666
+#: src/elflint.c:2698
#, c-format
msgid "section [%2d] '%s': section group without member\n"
msgstr "sekcja [%2d] „%s”: grupa sekcji bez elementów\n"
-#: src/elflint.c:2670
+#: src/elflint.c:2702
#, c-format
msgid "section [%2d] '%s': section group with only one member\n"
-msgstr "sekcja [%2d] „%s”: grupa sekcji z tylko jednym elementem\n"
+msgstr "sekcja [%2d] „%s”: grupa sekcji z tylko jednym elementem\n"
-#: src/elflint.c:2681
+#: src/elflint.c:2713
#, c-format
msgid "section [%2d] '%s': unknown section group flags\n"
msgstr "sekcja [%2d] „%s”: nieznane flagi grupy sekcji\n"
-#: src/elflint.c:2693
+#: src/elflint.c:2725
#, c-format
msgid "section [%2d] '%s': section index %zu out of range\n"
msgstr "sekcja [%2d] „%s”: indeks sekcji %zu jest spoza zakresu\n"
-#: src/elflint.c:2702
+#: src/elflint.c:2734
#, c-format
msgid "section [%2d] '%s': cannot get section header for element %zu: %s\n"
msgstr ""
"sekcja [%2d] „%s”: nie można uzyskać nagłówka sekcji dla elementu %zu: %s\n"
-#: src/elflint.c:2709
+#: src/elflint.c:2741
#, c-format
msgid "section [%2d] '%s': section group contains another group [%2d] '%s'\n"
msgstr "sekcja [%2d] „%s”: grupa sekcji zawiera inną grupę [%2d] „%s”\n"
-#: src/elflint.c:2715
+#: src/elflint.c:2747
#, c-format
msgid ""
"section [%2d] '%s': element %zu references section [%2d] '%s' without "
@@ -2423,305 +2575,299 @@
"sekcja [%2d] „%s”: element %zu odwołuje się do sekcji [%2d] „%s” bez flagi "
"SHF_GROUP\n"
-#: src/elflint.c:2722
+#: src/elflint.c:2754
#, c-format
msgid "section [%2d] '%s' is contained in more than one section group\n"
-msgstr "sekcja [%2d] „%s” jest zawarta w więcej niż jednej grupie sekcji\n"
+msgstr "sekcja [%2d] „%s” jest zawarta w więcej niż jednej grupie sekcji\n"
-#: src/elflint.c:2912
+#: src/elflint.c:2944
#, c-format
msgid ""
"section [%2d] '%s' refers in sh_link to section [%2d] '%s' which is no "
"dynamic symbol table\n"
msgstr ""
-"sekcja [%2d] „%s” odwołuje się w sh_link do sekcji [%2d] „%s”, która nie "
+"sekcja [%2d] „%s” odwołuje się w sh_link do sekcji [%2d] „%s”, która nie "
"jest tabelą symboli dynamicznych\n"
-#: src/elflint.c:2924
+#: src/elflint.c:2956
#, c-format
msgid ""
"section [%2d] '%s' has different number of entries than symbol table [%2d] "
"'%s'\n"
msgstr ""
-"sekcja [%2d] „%s” posiada inną liczbę wpisów niż tabela symboli [%2d] „%s”\n"
+"sekcja [%2d] „%s” ma inną liczbę wpisów niż tabela symboli [%2d] „%s”\n"
-#: src/elflint.c:2940
+#: src/elflint.c:2972
#, c-format
msgid "section [%2d] '%s': symbol %d: cannot read version data\n"
msgstr "sekcja [%2d] „%s”: symbol %d: nie można odczytać danych wersji\n"
-#: src/elflint.c:2956
+#: src/elflint.c:2988
#, c-format
msgid "section [%2d] '%s': symbol %d: local symbol with global scope\n"
-msgstr "sekcja [%2d] „%s”: symbol %d: symbol lokalny z zakresem globalnym\n"
+msgstr "sekcja [%2d] „%s”: symbol %d: symbol lokalny z zakresem globalnym\n"
-#: src/elflint.c:2964
+#: src/elflint.c:2996
#, c-format
msgid "section [%2d] '%s': symbol %d: local symbol with version\n"
-msgstr "sekcja [%2d] „%s”: symbol %d: symbol lokalny z wersją\n"
+msgstr "sekcja [%2d] „%s”: symbol %d: symbol lokalny z wersją\n"
-#: src/elflint.c:2978
+#: src/elflint.c:3010
#, c-format
msgid "section [%2d] '%s': symbol %d: invalid version index %d\n"
msgstr "sekcja [%2d] „%s”: symbol %d: nieprawidłowy indeks wersji %d\n"
-#: src/elflint.c:2983
+#: src/elflint.c:3015
#, c-format
msgid ""
"section [%2d] '%s': symbol %d: version index %d is for defined version\n"
msgstr ""
"sekcja [%2d] „%s”: symbol %d: indeks wersji %d jest dla wersji określonej\n"
-#: src/elflint.c:2993
+#: src/elflint.c:3025
#, c-format
msgid ""
"section [%2d] '%s': symbol %d: version index %d is for requested version\n"
msgstr ""
"sekcja [%2d] „%s”: symbol %d: indeks wersji %d jest dla wersji żądanej\n"
-#: src/elflint.c:3046
+#: src/elflint.c:3078
#, c-format
msgid "more than one version reference section present\n"
msgstr "obecna jest więcej niż jedna sekcja odniesienia wersji\n"
-#: src/elflint.c:3054 src/elflint.c:3201
+#: src/elflint.c:3086 src/elflint.c:3233
#, c-format
msgid "section [%2d] '%s': sh_link does not link to string table\n"
-msgstr "sekcja [%2d] „%s”: sh_link nie łączy się z tabelą ciągów\n"
+msgstr "sekcja [%2d] „%s”: sh_link nie łączy się z tabelą ciągów\n"
-#: src/elflint.c:3079 src/elflint.c:3255
+#: src/elflint.c:3111 src/elflint.c:3287
#, c-format
msgid "section [%2d] '%s': entry %d has wrong version %d\n"
-msgstr "sekcja [%2d] „%s”: wpis %d posiada błędną wersję %d\n"
+msgstr "sekcja [%2d] „%s”: wpis %d ma błędną wersję %d\n"
-#: src/elflint.c:3086 src/elflint.c:3262
+#: src/elflint.c:3118 src/elflint.c:3294
#, c-format
msgid "section [%2d] '%s': entry %d has wrong offset of auxiliary data\n"
-msgstr ""
-"sekcja [%2d] „%s”: wpis %d posiada błędny offset dla danych dodatkowych\n"
+msgstr "sekcja [%2d] „%s”: wpis %d ma błędny offset dla danych dodatkowych\n"
-#: src/elflint.c:3096
+#: src/elflint.c:3128
#, c-format
msgid "section [%2d] '%s': entry %d has invalid file reference\n"
-msgstr "sekcja [%2d] „%s”: symbol %d posiada błędne odniesienie do pliku\n"
+msgstr "sekcja [%2d] „%s”: symbol %d ma błędne odniesienie do pliku\n"
-#: src/elflint.c:3104
+#: src/elflint.c:3136
#, c-format
msgid "section [%2d] '%s': entry %d references unknown dependency\n"
msgstr "sekcja [%2d] „%s”: wpis %d odnosi się do nieznanej zależności\n"
-#: src/elflint.c:3116
+#: src/elflint.c:3148
#, c-format
msgid "section [%2d] '%s': auxiliary entry %d of entry %d has unknown flag\n"
-msgstr ""
-"sekcja [%2d] „%s”: wpis dodatkowy %d do wpisu %d posiada nieznaną flagę\n"
+msgstr "sekcja [%2d] „%s”: wpis dodatkowy %d do wpisu %d ma nieznaną flagę\n"
-#: src/elflint.c:3124
+#: src/elflint.c:3156
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has invalid name "
"reference\n"
msgstr ""
-"sekcja [%2d] „%s”: wpis dodatkowy %d do wpisu %d posiada nieprawidłowe "
+"sekcja [%2d] „%s”: wpis dodatkowy %d do wpisu %d ma nieprawidłowe "
"odniesienie do nazwy\n"
-#: src/elflint.c:3133
+#: src/elflint.c:3165
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has wrong hash value: "
"%#x, expected %#x\n"
msgstr ""
-"sekcja [%2d] „%s”: wpis dodatkowy %d do wpisu %d posiada błędną wartość "
-"skrótu: %#x, oczekiwano %#x\n"
+"sekcja [%2d] „%s”: wpis dodatkowy %d do wpisu %d ma błędną wartość skrótu: "
+"%#x, oczekiwano %#x\n"
-#: src/elflint.c:3142
+#: src/elflint.c:3174
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has duplicate version "
"name '%s'\n"
msgstr ""
-"sekcja [%2d] „%s”: wpis dodatkowy %d do wpisu %d posiada powtórzoną nazwę "
-"wersji „%s”\n"
+"sekcja [%2d] „%s”: wpis dodatkowy %d do wpisu %d ma powtórzoną nazwę wersji "
+"„%s”\n"
-#: src/elflint.c:3153
+#: src/elflint.c:3185
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has wrong next field\n"
msgstr ""
-"sekcja [%2d] „%s”: wpis dodatkowy %d do wpisu %d posiada błędne następne "
-"pole\n"
+"sekcja [%2d] „%s”: wpis dodatkowy %d do wpisu %d ma błędne następne pole\n"
-#: src/elflint.c:3170 src/elflint.c:3346
+#: src/elflint.c:3202 src/elflint.c:3378
#, c-format
msgid "section [%2d] '%s': entry %d has invalid offset to next entry\n"
-msgstr "sekcja [%2d] „%s”: wpis %d posiada błędny offset do następnego wpisu\n"
+msgstr "sekcja [%2d] „%s”: wpis %d ma błędny offset do następnego wpisu\n"
-#: src/elflint.c:3178 src/elflint.c:3354
+#: src/elflint.c:3210 src/elflint.c:3386
#, c-format
msgid ""
"section [%2d] '%s': entry %d has zero offset to next entry, but sh_info says "
"there are more entries\n"
msgstr ""
-"sekcja [%2d] „%s”: wpis %d posiada zerowy offset do następnego wpisu, ale "
-"sh_info zawiera informacje o więcej wpisów\n"
+"sekcja [%2d] „%s”: wpis %d ma zerowy offset do następnego wpisu, ale sh_info "
+"zawiera informacje o większej liczbie wpisów\n"
-#: src/elflint.c:3193
+#: src/elflint.c:3225
#, c-format
msgid "more than one version definition section present\n"
msgstr "obecna jest więcej niż jedna sekcja definicji wersji\n"
-#: src/elflint.c:3240
+#: src/elflint.c:3272
#, c-format
msgid "section [%2d] '%s': more than one BASE definition\n"
msgstr "sekcja [%2d] „%s”: jest więcej niż jedna definicja BASE\n"
-#: src/elflint.c:3244
+#: src/elflint.c:3276
#, c-format
msgid "section [%2d] '%s': BASE definition must have index VER_NDX_GLOBAL\n"
-msgstr ""
-"sekcja [%2d] „%s”: definicja BASE musi posiadać indeks VER_NDX_GLOBAL\n"
+msgstr "sekcja [%2d] „%s”: definicja BASE musi mieć indeks VER_NDX_GLOBAL\n"
-#: src/elflint.c:3250
+#: src/elflint.c:3282
#, c-format
msgid "section [%2d] '%s': entry %d has unknown flag\n"
-msgstr "sekcja [%2d] „%s”: wpis %d posiada nieznaną flagę\n"
+msgstr "sekcja [%2d] „%s”: wpis %d ma nieznaną flagę\n"
-#: src/elflint.c:3277
+#: src/elflint.c:3309
#, c-format
msgid "section [%2d] '%s': entry %d has invalid name reference\n"
-msgstr ""
-"sekcja [%2d] „%s”: wpis %d posiada nieprawidłowe odniesienie do nazwy\n"
+msgstr "sekcja [%2d] „%s”: wpis %d ma nieprawidłowe odniesienie do nazwy\n"
-#: src/elflint.c:3284
+#: src/elflint.c:3316
#, c-format
msgid "section [%2d] '%s': entry %d has wrong hash value: %#x, expected %#x\n"
msgstr ""
-"sekcja [%2d] „%s”: wpis %d posiada błędną wartość skrótu: %#x, oczekiwano "
-"%#x\n"
+"sekcja [%2d] „%s”: wpis %d ma błędną wartość skrótu: %#x, oczekiwano %#x\n"
-#: src/elflint.c:3292
+#: src/elflint.c:3324
#, c-format
msgid "section [%2d] '%s': entry %d has duplicate version name '%s'\n"
-msgstr "sekcja [%2d] „%s”: wpis %d posiada powtórzoną nazwę wersji „%s”\n"
+msgstr "sekcja [%2d] „%s”: wpis %d ma powtórzoną nazwę wersji „%s”\n"
-#: src/elflint.c:3312
+#: src/elflint.c:3344
#, c-format
msgid ""
"section [%2d] '%s': entry %d has invalid name reference in auxiliary data\n"
msgstr ""
-"sekcja [%2d] „%s”: wpis %d posiada nieprawidłowe odniesienie do nazwy w "
-"danych dodatkowych\n"
+"sekcja [%2d] „%s”: wpis %d ma nieprawidłowe odniesienie do nazwy w danych "
+"dodatkowych\n"
-#: src/elflint.c:3329
+#: src/elflint.c:3361
#, c-format
msgid "section [%2d] '%s': entry %d has wrong next field in auxiliary data\n"
msgstr ""
-"sekcja [%2d] „%s”: wpis %d posiada błędne następne pole w danych "
-"dodatkowych\n"
+"sekcja [%2d] „%s”: wpis %d ma błędne następne pole w danych dodatkowych\n"
-#: src/elflint.c:3362
+#: src/elflint.c:3394
#, c-format
msgid "section [%2d] '%s': no BASE definition\n"
msgstr "sekcja [%2d] „%s”: brak definicji BASE\n"
-#: src/elflint.c:3378
+#: src/elflint.c:3410
#, c-format
msgid "section [%2d] '%s': unknown parent version '%s'\n"
msgstr "sekcja [%2d] „%s”: nieznana wersja rodzica „%s”\n"
-#: src/elflint.c:3391
+#: src/elflint.c:3423
#, c-format
msgid "section [%2d] '%s': empty object attributes section\n"
msgstr "sekcja [%2d] „%s”: pusta sekcja atrybutów obiektu\n"
-#: src/elflint.c:3412
+#: src/elflint.c:3444
#, c-format
msgid "section [%2d] '%s': unrecognized attribute format\n"
msgstr "sekcja [%2d] „%s”: nierozpoznany format atrybutu\n"
-#: src/elflint.c:3428
+#: src/elflint.c:3460
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: zero length field in attribute section\n"
msgstr ""
-"sekcja [%2d] „%s”: offset %zu: pole o zerowej długości w sekcji atrybutów\n"
+"sekcja [%2d] „%s”: offset %zu: pole o zerowej długości w sekcji atrybutów\n"
-#: src/elflint.c:3437
+#: src/elflint.c:3469
#, c-format
msgid "section [%2d] '%s': offset %zu: invalid length in attribute section\n"
msgstr ""
-"sekcja [%2d] „%s”: offset %zu: nieprawidłowa długość w sekcji atrybutów\n"
+"sekcja [%2d] „%s”: offset %zu: nieprawidłowa długość w sekcji atrybutów\n"
-#: src/elflint.c:3449
+#: src/elflint.c:3481
#, c-format
msgid "section [%2d] '%s': offset %zu: unterminated vendor name string\n"
msgstr "sekcja [%2d] „%s”: offset %zu: niezakończony ciąg nazwy producenta\n"
-#: src/elflint.c:3466
+#: src/elflint.c:3498
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: endless ULEB128 in attribute subsection tag\n"
msgstr ""
-"sekcja [%2d] „%s”: offset %zu: niekończące się ULEB128 w znaczniku podsekcji "
+"sekcja [%2d] „%s”: offset %zu: niekończące się ULEB128 w znaczniku podsekcji "
"atrybutów\n"
-#: src/elflint.c:3475
+#: src/elflint.c:3507
#, c-format
msgid "section [%2d] '%s': offset %zu: truncated attribute section\n"
msgstr "sekcja [%2d] „%s”: offset %zu: skrócona sekcja atrybutów\n"
-#: src/elflint.c:3484
+#: src/elflint.c:3516
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: zero length field in attribute subsection\n"
msgstr ""
-"sekcja [%2d] „%s”: offset %zu: zerowej długości pole w podsekcji atrybutów\n"
+"sekcja [%2d] „%s”: offset %zu: zerowej długości pole w podsekcji atrybutów\n"
-#: src/elflint.c:3499
+#: src/elflint.c:3531
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: invalid length in attribute subsection\n"
msgstr ""
-"sekcja [%2d] „%s”: offset %zu: nieprawidłowa długość w podsekcji atrybutów\n"
+"sekcja [%2d] „%s”: offset %zu: nieprawidłowa długość w podsekcji atrybutów\n"
-#: src/elflint.c:3510
+#. Tag_File
+#: src/elflint.c:3542
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: attribute subsection has unexpected tag %u\n"
msgstr ""
-"sekcja [%2d] „%s”: offset %zu: podsekcja atrybutów posiada nieoczekiwany "
-"znacznik %u\n"
+"sekcja [%2d] „%s”: offset %zu: podsekcja atrybutów ma nieoczekiwany znacznik "
+"%u\n"
-#: src/elflint.c:3528
+#: src/elflint.c:3560
#, c-format
msgid "section [%2d] '%s': offset %zu: endless ULEB128 in attribute tag\n"
msgstr ""
-"sekcja [%2d] „%s”: offset %zu: niekończące się ULEB128 w znaczniku atrybutu\n"
+"sekcja [%2d] „%s”: offset %zu: niekończące się ULEB128 w znaczniku atrybutu\n"
-#: src/elflint.c:3539
+#: src/elflint.c:3571
#, c-format
msgid "section [%2d] '%s': offset %zu: unterminated string in attribute\n"
-msgstr "sekcja [%2d] „%s”: offset %zu: niezakończony ciąg w atrybucie\n"
+msgstr "sekcja [%2d] „%s”: offset %zu: niezakończony ciąg w atrybucie\n"
-#: src/elflint.c:3552
+#: src/elflint.c:3584
#, c-format
msgid "section [%2d] '%s': offset %zu: unrecognized attribute tag %u\n"
msgstr "sekcja [%2d] „%s”: offset %zu: nierozpoznany znacznik atrybutu %u\n"
-#: src/elflint.c:3556
+#: src/elflint.c:3588
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: unrecognized %s attribute value %<PRIu64>\n"
msgstr ""
-"sekcja [%2d] „%s”: offset %zu: atrybut %s posiada nierozpoznaną wartość "
+"sekcja [%2d] „%s”: offset %zu: atrybut %s ma nierozpoznaną wartość "
"%<PRIu64>\n"
-#: src/elflint.c:3566
+#: src/elflint.c:3598
#, c-format
msgid "section [%2d] '%s': offset %zu: vendor '%s' unknown\n"
msgstr "sekcja [%2d] „%s”: offset %zu: producent „%s” jest nieznany\n"
-#: src/elflint.c:3572
+#: src/elflint.c:3604
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: extra bytes after last attribute section\n"
@@ -2729,276 +2875,273 @@
"sekcja [%2d] „%s”: offset %zu: dodatkowe bajty po ostatniej sekcji "
"atrybutów\n"
-#: src/elflint.c:3661
+#: src/elflint.c:3693
#, c-format
msgid "cannot get section header of zeroth section\n"
msgstr "nie można uzyskać nagłówka sekcji zerowej\n"
-#: src/elflint.c:3665
+#: src/elflint.c:3697
#, c-format
msgid "zeroth section has nonzero name\n"
-msgstr "sekcja zerowa posiada niezerową nazwę\n"
+msgstr "sekcja zerowa ma niezerową nazwę\n"
-#: src/elflint.c:3667
+#: src/elflint.c:3699
#, c-format
msgid "zeroth section has nonzero type\n"
-msgstr "sekcja zerowa posiada niezerowy typ\n"
+msgstr "sekcja zerowa ma niezerowy typ\n"
-#: src/elflint.c:3669
+#: src/elflint.c:3701
#, c-format
msgid "zeroth section has nonzero flags\n"
-msgstr "sekcja zerowa posiada niezerowe flagi\n"
+msgstr "sekcja zerowa ma niezerowe flagi\n"
-#: src/elflint.c:3671
+#: src/elflint.c:3703
#, c-format
msgid "zeroth section has nonzero address\n"
-msgstr "sekcja zerowa posiada niezerowy adres\n"
+msgstr "sekcja zerowa ma niezerowy adres\n"
-#: src/elflint.c:3673
+#: src/elflint.c:3705
#, c-format
msgid "zeroth section has nonzero offset\n"
-msgstr "sekcja zerowa posiada niezerowy offset\n"
+msgstr "sekcja zerowa ma niezerowy offset\n"
-#: src/elflint.c:3675
+#: src/elflint.c:3707
#, c-format
msgid "zeroth section has nonzero align value\n"
-msgstr "sekcja zerowa posiada niezerową wartość wyrównania\n"
+msgstr "sekcja zerowa ma niezerową wartość wyrównania\n"
-#: src/elflint.c:3677
+#: src/elflint.c:3709
#, c-format
msgid "zeroth section has nonzero entry size value\n"
-msgstr "sekcja zerowa posiada niezerową wartość rozmiaru wpisu\n"
+msgstr "sekcja zerowa ma niezerową wartość rozmiaru wpisu\n"
-#: src/elflint.c:3680
+#: src/elflint.c:3712
#, c-format
msgid ""
"zeroth section has nonzero size value while ELF header has nonzero shnum "
"value\n"
msgstr ""
-"sekcja zerowa posiada niezerową wartość rozmiaru, a nagłówek ELF posiada "
-"niezerową wartość shnum\n"
+"sekcja zerowa ma niezerową wartość rozmiaru, a nagłówek ELF ma niezerową "
+"wartość shnum\n"
-#: src/elflint.c:3684
+#: src/elflint.c:3716
#, c-format
msgid ""
"zeroth section has nonzero link value while ELF header does not signal "
"overflow in shstrndx\n"
msgstr ""
-"sekcja zerowa posiada niezerową wartość dowiązań, a nagłówek ELF nie "
-"wskazuje przepełnienia w shstrndx\n"
+"sekcja zerowa ma niezerową wartość dowiązań, a nagłówek ELF nie wskazuje "
+"przepełnienia w shstrndx\n"
-#: src/elflint.c:3688
+#: src/elflint.c:3720
#, c-format
msgid ""
"zeroth section has nonzero link value while ELF header does not signal "
"overflow in phnum\n"
msgstr ""
-"sekcja zerowa posiada niezerową wartość dowiązań, a nagłówek ELF nie "
-"wskazuje przepełnienia w phnum\n"
+"sekcja zerowa ma niezerową wartość dowiązań, a nagłówek ELF nie wskazuje "
+"przepełnienia w phnum\n"
-#: src/elflint.c:3706
+#: src/elflint.c:3738
#, c-format
msgid "cannot get section header for section [%2zu] '%s': %s\n"
msgstr "nie można uzyskać nagłówka sekcji dla sekcji [%2zu] „%s”: %s\n"
-#: src/elflint.c:3715
+#: src/elflint.c:3747
#, c-format
msgid "section [%2zu]: invalid name\n"
msgstr "sekcja [%2zu]: nieprawidłowa nazwa\n"
-#: src/elflint.c:3742
+#: src/elflint.c:3774
#, c-format
msgid "section [%2d] '%s' has wrong type: expected %s, is %s\n"
-msgstr "sekcja [%2d] „%s” posiada błędny typ: oczekiwano %s, jest %s\n"
+msgstr "sekcja [%2d] „%s” ma błędny typ: oczekiwano %s, jest %s\n"
-#: src/elflint.c:3760
+#: src/elflint.c:3792
#, c-format
msgid "section [%2zu] '%s' has wrong flags: expected %s, is %s\n"
-msgstr "sekcja [%2zu] „%s” posiada błędne flagi: oczekiwano %s, jest %s\n"
+msgstr "sekcja [%2zu] „%s” ma błędne flagi: oczekiwano %s, jest %s\n"
-#: src/elflint.c:3778
+#: src/elflint.c:3810
#, c-format
msgid ""
"section [%2zu] '%s' has wrong flags: expected %s and possibly %s, is %s\n"
msgstr ""
-"sekcja [%2zu] „%s” posiada błędne flagi: oczekiwano %s i być może %s, jest "
-"%s\n"
+"sekcja [%2zu] „%s” ma błędne flagi: oczekiwano %s i być może %s, jest %s\n"
-#: src/elflint.c:3796
+#: src/elflint.c:3828
#, c-format
msgid "section [%2zu] '%s' present in object file\n"
-msgstr "sekcja [%2zu] „%s” jest obecna w pliku obiektu\n"
+msgstr "sekcja [%2zu] „%s” jest obecna w pliku obiektu\n"
-#: src/elflint.c:3802 src/elflint.c:3834
+#: src/elflint.c:3834 src/elflint.c:3866
#, c-format
msgid ""
"section [%2zu] '%s' has SHF_ALLOC flag set but there is no loadable segment\n"
msgstr ""
-"sekcja [%2zu] „%s” posiada flagę SHF_ALLOC, ale nie posiada segmentu "
-"wczytywalnego\n"
+"sekcja [%2zu] „%s” ma flagę SHF_ALLOC, ale nie ma segmentu wczytywalnego\n"
-#: src/elflint.c:3807 src/elflint.c:3839
+#: src/elflint.c:3839 src/elflint.c:3871
#, c-format
msgid ""
"section [%2zu] '%s' has SHF_ALLOC flag not set but there are loadable "
"segments\n"
msgstr ""
-"sekcja [%2zu] „%s” nie posiada flagi SHF_ALLOC, ale są segmenty wczytywalne\n"
+"sekcja [%2zu] „%s” nie ma flagi SHF_ALLOC, ale są segmenty wczytywalne\n"
-#: src/elflint.c:3815
+#: src/elflint.c:3847
#, c-format
msgid ""
"section [%2zu] '%s' is extension section index table in non-object file\n"
msgstr ""
-"sekcja [%2zu] „%s” jest tabelą indeksów sekcji rozszerzeń w pliku "
+"sekcja [%2zu] „%s” jest tabelą indeksów sekcji rozszerzeń w pliku "
"nieobiektowym\n"
-#: src/elflint.c:3858
+#: src/elflint.c:3890
#, c-format
msgid "section [%2zu] '%s': size not multiple of entry size\n"
msgstr "sekcja [%2zu] „%s”: rozmiar nie jest wielokrotnością rozmiaru wpisu\n"
-#: src/elflint.c:3863
+#: src/elflint.c:3895
#, c-format
msgid "cannot get section header\n"
msgstr "nie można uzyskać nagłówka sekcji\n"
-#: src/elflint.c:3873
+#: src/elflint.c:3905
#, c-format
msgid "section [%2zu] '%s' has unsupported type %d\n"
-msgstr "sekcja [%2zu] „%s” posiada nieobsługiwany typ %d\n"
+msgstr "sekcja [%2zu] „%s” ma nieobsługiwany typ %d\n"
-#: src/elflint.c:3888
+#: src/elflint.c:3920
#, c-format
msgid ""
"section [%2zu] '%s' contains invalid processor-specific flag(s) %#<PRIx64>\n"
msgstr ""
-"sekcja [%2zu] „%s” zawiera nieprawidłowe flagi specyficzne dla procesora "
+"sekcja [%2zu] „%s” zawiera nieprawidłowe flagi dla konkretnego procesora "
"%#<PRIx64>\n"
-#: src/elflint.c:3895
+#: src/elflint.c:3927
#, c-format
msgid "section [%2zu] '%s' contains unknown flag(s) %#<PRIx64>\n"
msgstr "sekcja [%2zu] „%s” zawiera nieznane flagi %#<PRIx64>\n"
-#: src/elflint.c:3903
+#: src/elflint.c:3935
#, c-format
msgid "section [%2zu] '%s': thread-local data sections address not zero\n"
msgstr ""
"sekcja [%2zu] „%s”: adres sekcji danych lokalnych dla wątków nie jest zerem\n"
-#: src/elflint.c:3913
+#: src/elflint.c:3945
#, c-format
msgid "section [%2zu] '%s': allocated section cannot be compressed\n"
msgstr "sekcja [%2zu] „%s”: nie można skompresować przydzielonej sekcji\n"
-#: src/elflint.c:3918
+#: src/elflint.c:3950
#, c-format
msgid "section [%2zu] '%s': nobits section cannot be compressed\n"
msgstr "sekcja [%2zu] „%s”: nie można skompresować sekcji „nobits”\n"
-#: src/elflint.c:3924
+#: src/elflint.c:3956
#, c-format
msgid ""
"section [%2zu] '%s': compressed section with no compression header: %s\n"
msgstr "sekcja [%2zu] „%s”: skompresowana sekcja bez nagłówka kompresji: %s\n"
-#: src/elflint.c:3930
+#: src/elflint.c:3962
#, c-format
msgid "section [%2zu] '%s': invalid section reference in link value\n"
msgstr ""
-"sekcja [%2zu] „%s”: nieprawidłowe odwołanie do sekcji w wartości dowiązania\n"
+"sekcja [%2zu] „%s”: nieprawidłowe odwołanie do sekcji w wartości dowiązania\n"
-#: src/elflint.c:3935
+#: src/elflint.c:3967
#, c-format
msgid "section [%2zu] '%s': invalid section reference in info value\n"
msgstr ""
-"sekcja [%2zu] „%s”: nieprawidłowe odwołanie do sekcji w wartości "
+"sekcja [%2zu] „%s”: nieprawidłowe odwołanie do sekcji w wartości "
"informacyjnej\n"
-#: src/elflint.c:3942
+#: src/elflint.c:3974
#, c-format
msgid "section [%2zu] '%s': strings flag set without merge flag\n"
msgstr "sekcja [%2zu] „%s”: flaga ciągów jest ustawiona bez flagi merge\n"
-#: src/elflint.c:3947
+#: src/elflint.c:3979
#, c-format
msgid "section [%2zu] '%s': merge flag set but entry size is zero\n"
msgstr ""
"sekcja [%2zu] „%s”: flaga merge jest ustawiona, ale rozmiar wpisu jest "
"zerowy\n"
-#: src/elflint.c:3965
+#: src/elflint.c:3998
#, c-format
msgid "section [%2zu] '%s' has unexpected type %d for an executable section\n"
-msgstr ""
-"sekcja [%2zu] „%s” posiada nieoczekiwany typ %d dla sekcji wykonywalnej\n"
+msgstr "sekcja [%2zu] „%s” ma nieoczekiwany typ %d dla sekcji wykonywalnej\n"
-#: src/elflint.c:3974
+#: src/elflint.c:4007
#, c-format
msgid "section [%2zu] '%s' must be of type NOBITS in debuginfo files\n"
-msgstr "sekcja [%2zu] „%s” musi być typu NOBITS w plikach debuginfo\n"
+msgstr "sekcja [%2zu] „%s” musi być typu NOBITS w plikach debuginfo\n"
-#: src/elflint.c:3981
+#: src/elflint.c:4014
#, c-format
msgid "section [%2zu] '%s' is both executable and writable\n"
-msgstr "sekcja [%2zu] „%s” jest wykonywalne i zapisywalne\n"
+msgstr "sekcja [%2zu] „%s” jest wykonywalne i zapisywalne\n"
-#: src/elflint.c:4012
+#: src/elflint.c:4045
#, c-format
msgid ""
"section [%2zu] '%s' not fully contained in segment of program header entry "
"%d\n"
msgstr ""
-"sekcja [%2zu] „%s” nie jest w całości zawarta w segmencie wpisu %d nagłówka "
+"sekcja [%2zu] „%s” nie jest w całości zawarta w segmencie wpisu %d nagłówka "
"programu\n"
-#: src/elflint.c:4022
+#: src/elflint.c:4055
#, c-format
msgid ""
"section [%2zu] '%s' has type NOBITS but is read from the file in segment of "
"program header entry %d\n"
msgstr ""
-"sekcja [%2zu] „%s” posiada typ NOBITS, a jest odczytywana z pliku w "
-"segmencie wpisu %d nagłówka programu\n"
+"sekcja [%2zu] „%s” ma typ NOBITS, a jest odczytywana z pliku w segmencie "
+"wpisu %d nagłówka programu\n"
-#: src/elflint.c:4048
+#: src/elflint.c:4081
#, c-format
msgid ""
"section [%2zu] '%s' has type NOBITS but is read from the file in segment of "
"program header entry %d and file contents is non-zero\n"
msgstr ""
-"sekcja [%2zu] „%s” posiada typ NOBITS, ale jest odczytywana z pliku w "
-"segmencie wpisu %d nagłówka programu, a zawartość pliku jest niezerowa\n"
+"sekcja [%2zu] „%s” ma typ NOBITS, ale jest odczytywana z pliku w segmencie "
+"wpisu %d nagłówka programu, a zawartość pliku jest niezerowa\n"
-#: src/elflint.c:4059
+#: src/elflint.c:4092
#, c-format
msgid ""
"section [%2zu] '%s' has not type NOBITS but is not read from the file in "
"segment of program header entry %d\n"
msgstr ""
-"sekcja [%2zu] „%s” nie posiada typu NOBITS, a nie jest odczytywana z pliku w "
-"segmencie wpisu %d nagłówka programu\n"
+"sekcja [%2zu] „%s” nie ma typu NOBITS, a nie jest odczytywana z pliku "
+"w segmencie wpisu %d nagłówka programu\n"
-#: src/elflint.c:4070
+#: src/elflint.c:4103
#, c-format
msgid "section [%2zu] '%s' is executable in nonexecutable segment %d\n"
-msgstr "sekcja [%2zu] „%s” jest wykonywalne w segmencie niewykonywalnym %d\n"
+msgstr "sekcja [%2zu] „%s” jest wykonywalne w segmencie niewykonywalnym %d\n"
-#: src/elflint.c:4080
+#: src/elflint.c:4113
#, c-format
msgid "section [%2zu] '%s' is writable in unwritable segment %d\n"
-msgstr "sekcja [%2zu] „%s” jest zapisywalne w niezapisywalnym segmencie %d\n"
+msgstr "sekcja [%2zu] „%s” jest zapisywalne w niezapisywalnym segmencie %d\n"
-#: src/elflint.c:4090
+#: src/elflint.c:4123
#, c-format
msgid ""
"section [%2zu] '%s': alloc flag set but section not in any loaded segment\n"
msgstr ""
-"sekcja [%2zu] „%s”: posiada flagę alloc, ale sekcja nie jest w żadnym "
-"segmencie wczytywalnym\n"
+"sekcja [%2zu] „%s”: ma flagę alloc, ale sekcja nie jest w żadnym segmencie "
+"wczytywalnym\n"
-#: src/elflint.c:4096
+#: src/elflint.c:4129
#, c-format
msgid ""
"section [%2zu] '%s': ELF header says this is the section header string table "
@@ -3007,25 +3150,25 @@
"sekcja [%2zu] „%s”: według nagłówka ELF to jest tabela ciągów nagłówków "
"sekcji, ale typ nie jest SHT_TYPE\n"
-#: src/elflint.c:4104
+#: src/elflint.c:4137
#, c-format
msgid ""
"section [%2zu] '%s': relocatable files cannot have dynamic symbol tables\n"
msgstr ""
-"sekcja [%2zu] „%s”: pliki relokowalne nie mogą posiadać tabeli symboli "
+"sekcja [%2zu] „%s”: pliki relokowalne nie mogą mieć tabeli symboli "
"dynamicznych\n"
-#: src/elflint.c:4155
+#: src/elflint.c:4188
#, c-format
msgid "more than one version symbol table present\n"
msgstr "obecna jest więcej niż jedna tabela symboli wersji\n"
-#: src/elflint.c:4178
+#: src/elflint.c:4211
#, c-format
msgid "INTERP program header entry but no .interp section\n"
-msgstr "jest wpis nagłówka programu INTERP, ale nie posiada sekcji .interp\n"
+msgstr "jest wpis nagłówka programu INTERP, ale nie ma sekcji .interp\n"
-#: src/elflint.c:4189
+#: src/elflint.c:4222
#, c-format
msgid ""
"loadable segment [%u] is executable but contains no executable sections\n"
@@ -3033,14 +3176,14 @@
"wczytywalny segment [%u] jest wykonywalny, ale nie zawiera wykonywalnych "
"sekcji\n"
-#: src/elflint.c:4195
+#: src/elflint.c:4228
#, c-format
msgid "loadable segment [%u] is writable but contains no writable sections\n"
msgstr ""
"wczytywalny segment [%u] jest zapisywalny, ale nie zawiera zapisywalnych "
"sekcji\n"
-#: src/elflint.c:4206
+#: src/elflint.c:4239
#, c-format
msgid ""
"no .gnu.versym section present but .gnu.versym_d or .gnu.versym_r section "
@@ -3049,23 +3192,23 @@
"brak sekcji .gnu.versym, ale istnieje sekcja .gnu.versym_d lub .gnu."
"versym_r\n"
-#: src/elflint.c:4219
+#: src/elflint.c:4252
#, c-format
msgid "duplicate version index %d\n"
msgstr "powtórzony indeks wersji %d\n"
-#: src/elflint.c:4233
+#: src/elflint.c:4266
#, c-format
msgid ".gnu.versym section present without .gnu.versym_d or .gnu.versym_r\n"
msgstr "sekcja .gnu.versym istnieje bez .gnu.versym_d lub .gnu.versym_r\n"
-#: src/elflint.c:4282
+#: src/elflint.c:4315
#, c-format
msgid "phdr[%d]: unknown core file note type %<PRIu32> at offset %<PRIu64>\n"
msgstr ""
"phdr[%d]: nieznany typ notatki pliku core %<PRIu32> pod offsetem %<PRIu64>\n"
-#: src/elflint.c:4286
+#: src/elflint.c:4319
#, c-format
msgid ""
"section [%2d] '%s': unknown core file note type %<PRIu32> at offset %zu\n"
@@ -3073,13 +3216,13 @@
"sekcja [%2d]: „%s”: nieznany typ notatki pliku core %<PRIu32> pod offsetem "
"%zu\n"
-#: src/elflint.c:4309
+#: src/elflint.c:4342
#, c-format
msgid "phdr[%d]: unknown object file note type %<PRIu32> at offset %zu\n"
msgstr ""
"phdr[%d]: nieznany typ notatki pliku obiektu %<PRIu32> pod offsetem %zu\n"
-#: src/elflint.c:4313
+#: src/elflint.c:4346
#, c-format
msgid ""
"section [%2d] '%s': unknown object file note type %<PRIu32> at offset %zu\n"
@@ -3087,1063 +3230,346 @@
"sekcja [%2d] „%s”: nieznany typ notatki pliku obiektu %<PRIu32> pod offsetem "
"%zu\n"
-#: src/elflint.c:4330
+#: src/elflint.c:4363
#, c-format
msgid "phdr[%d]: no note entries defined for the type of file\n"
msgstr "phdr[%d]: brak określonych wpisów notatek dla typu pliku\n"
-#: src/elflint.c:4349
+#: src/elflint.c:4382
#, c-format
msgid "phdr[%d]: cannot get content of note section: %s\n"
msgstr "phdr[%d]: nie można uzyskać zawartości sekcji notatki: %s\n"
-#: src/elflint.c:4352
+#: src/elflint.c:4385
#, c-format
msgid "phdr[%d]: extra %<PRIu64> bytes after last note\n"
msgstr "phdr[%d]: dodatkowe %<PRIu64> bajtów po ostatniej notatce\n"
-#: src/elflint.c:4373
+#: src/elflint.c:4406
#, c-format
msgid "section [%2d] '%s': no note entries defined for the type of file\n"
msgstr "sekcja [%2d] „%s”: brak określonych wpisów notatek dla typu pliku\n"
-#: src/elflint.c:4380
+#: src/elflint.c:4413
#, c-format
msgid "section [%2d] '%s': cannot get content of note section\n"
msgstr "sekcja [%2d] „%s”: nie można uzyskać zawartości sekcji notatek\n"
-#: src/elflint.c:4383
+#: src/elflint.c:4416
#, c-format
msgid "section [%2d] '%s': extra %<PRIu64> bytes after last note\n"
msgstr "sekcja [%2d] „%s”: dodatkowe %<PRIu64> bajtów po ostatniej notatce\n"
-#: src/elflint.c:4401
+#: src/elflint.c:4434
#, c-format
msgid ""
"only executables, shared objects, and core files can have program headers\n"
msgstr ""
-"tylko pliki wykonywalne, obiekty współdzielone i pliki core mogą posiadać "
+"tylko pliki wykonywalne, obiekty współdzielone i pliki core mogą mieć "
"nagłówki programu\n"
-#: src/elflint.c:4416
+#: src/elflint.c:4449
#, c-format
msgid "cannot get program header entry %d: %s\n"
msgstr "nie można uzyskać wpisu nagłówka programu %d: %s\n"
-#: src/elflint.c:4425
+#: src/elflint.c:4458
#, c-format
msgid "program header entry %d: unknown program header entry type %#<PRIx64>\n"
msgstr ""
"wpis nagłówka programu %d: nieznany typ wpisu nagłówka programu %#<PRIx64>\n"
-#: src/elflint.c:4436
+#: src/elflint.c:4469
#, c-format
msgid "more than one INTERP entry in program header\n"
-msgstr "więcej niż jeden wpis INTERP w nagłówku programu\n"
+msgstr "więcej niż jeden wpis INTERP w nagłówku programu\n"
-#: src/elflint.c:4444
+#: src/elflint.c:4477
#, c-format
msgid "more than one TLS entry in program header\n"
-msgstr "więcej niż jeden wpis TLS w nagłówku programu\n"
+msgstr "więcej niż jeden wpis TLS w nagłówku programu\n"
-#: src/elflint.c:4451
+#: src/elflint.c:4484
#, c-format
msgid "static executable cannot have dynamic sections\n"
-msgstr "statyczny plik wykonywalny nie może posiadać sekcji dynamicznych\n"
+msgstr "statyczny plik wykonywalny nie może mieć sekcji dynamicznych\n"
-#: src/elflint.c:4465
+#: src/elflint.c:4498
#, c-format
msgid "dynamic section reference in program header has wrong offset\n"
-msgstr ""
-"odniesienie sekcji dynamicznej w nagłówku programu posiada błędny offset\n"
+msgstr "odniesienie sekcji dynamicznej w nagłówku programu ma błędny offset\n"
-#: src/elflint.c:4468
+#: src/elflint.c:4501
#, c-format
msgid "dynamic section size mismatch in program and section header\n"
-msgstr "różne rozmiary sekcji dynamicznej w nagłówku programu i sekcji\n"
+msgstr "różne rozmiary sekcji dynamicznej w nagłówku programu i sekcji\n"
-#: src/elflint.c:4478
+#: src/elflint.c:4511
#, c-format
msgid "more than one GNU_RELRO entry in program header\n"
-msgstr "więcej niż jeden wpis GNU_RELRO w nagłówku programu\n"
+msgstr "więcej niż jeden wpis GNU_RELRO w nagłówku programu\n"
-#: src/elflint.c:4499
+#: src/elflint.c:4532
#, c-format
msgid "loadable segment GNU_RELRO applies to is not writable\n"
msgstr "wczytywalny segment wskazywany przez GNU_RELRO nie jest zapisywalny\n"
-#: src/elflint.c:4510
+#: src/elflint.c:4543
#, c-format
msgid "loadable segment [%u] flags do not match GNU_RELRO [%u] flags\n"
msgstr "flagi wczytywalnego segmentu [%u] nie pasują do flag GNU_RELRO [%u]\n"
-#: src/elflint.c:4517
+#: src/elflint.c:4550
#, c-format
msgid ""
"GNU_RELRO [%u] flags are not a subset of the loadable segment [%u] flags\n"
msgstr ""
"flagi GNU_RELRO [%u] nie są podzbiorem flag wczytywalnego segmentu [%u]\n"
-#: src/elflint.c:4526 src/elflint.c:4549
+#: src/elflint.c:4559 src/elflint.c:4582
#, c-format
msgid "%s segment not contained in a loaded segment\n"
msgstr "segment %s nie zawiera się we wczytywalnym segmencie\n"
-#: src/elflint.c:4555
+#: src/elflint.c:4588
#, c-format
msgid "program header offset in ELF header and PHDR entry do not match"
msgstr ""
-"offsety nagłówka programu w nagłówku ELF i wpisie PHDR nie zgadzają się"
+"offsety nagłówka programu w nagłówku ELF i wpisie PHDR nie zgadzają się"
-#: src/elflint.c:4580
+#: src/elflint.c:4613
#, c-format
msgid "call frame search table reference in program header has wrong offset\n"
msgstr ""
-"odniesienie tabeli wyszukiwania ramki wywołania w nagłówku programu posiada "
+"odniesienie tabeli wyszukiwania ramki wywołania w nagłówku programu ma "
"błędny offset\n"
-#: src/elflint.c:4583
+#: src/elflint.c:4616
#, c-format
msgid "call frame search table size mismatch in program and section header\n"
msgstr ""
-"różne rozmiary tabel wyszukiwania ramki wywołania w nagłówku programu i "
-"sekcji\n"
+"różne rozmiary tabel wyszukiwania ramki wywołania w nagłówku programu "
+"i sekcji\n"
-#: src/elflint.c:4596
+#: src/elflint.c:4629
#, c-format
msgid "PT_GNU_EH_FRAME present but no .eh_frame_hdr section\n"
msgstr "PT_GNU_EH_FRAME jest obecne, ale brak sekcji .eh_frame_hdr\n"
-#: src/elflint.c:4604
+#: src/elflint.c:4637
#, c-format
msgid "call frame search table must be allocated\n"
msgstr "tabela wyszukiwania ramki wywołania musi być przydzielona\n"
-#: src/elflint.c:4607
+#: src/elflint.c:4640
#, c-format
msgid "section [%2zu] '%s' must be allocated\n"
msgstr "sekcja [%2zu] „%s”: musi być przydzielona\n"
-#: src/elflint.c:4611
+#: src/elflint.c:4644
#, c-format
msgid "call frame search table must not be writable\n"
msgstr "tabela wyszukiwania ramki wywołania nie może być zapisywalna\n"
-#: src/elflint.c:4614
+#: src/elflint.c:4647
#, c-format
msgid "section [%2zu] '%s' must not be writable\n"
msgstr "sekcja [%2zu] „%s” nie może być zapisywalna\n"
-#: src/elflint.c:4619
+#: src/elflint.c:4652
#, c-format
msgid "call frame search table must not be executable\n"
msgstr "tabela wyszukiwania ramki wywołania nie może być wykonywalna\n"
-#: src/elflint.c:4622
+#: src/elflint.c:4655
#, c-format
msgid "section [%2zu] '%s' must not be executable\n"
msgstr "sekcja [%2zu] „%s” nie może być wykonywalna\n"
-#: src/elflint.c:4633
+#: src/elflint.c:4666
#, c-format
msgid "program header entry %d: file size greater than memory size\n"
msgstr "wpis nagłówka programu %d: rozmiar pliku większy niż rozmiar pamięci\n"
-#: src/elflint.c:4640
+#: src/elflint.c:4673
#, c-format
msgid "program header entry %d: alignment not a power of 2\n"
msgstr "wpis nagłówka programu %d: wyrównanie nie jest potęgą 2\n"
-#: src/elflint.c:4643
+#: src/elflint.c:4676
#, c-format
msgid ""
"program header entry %d: file offset and virtual address not module of "
"alignment\n"
msgstr ""
-"wpis nagłówka programu %d: offset w pliku i adres wirtualny nie są "
+"wpis nagłówka programu %d: offset w pliku i adres wirtualny nie są "
"wielokrotnością wyrównania\n"
-#: src/elflint.c:4656
+#: src/elflint.c:4689
#, c-format
msgid ""
"executable/DSO with .eh_frame_hdr section does not have a PT_GNU_EH_FRAME "
"program header entry"
msgstr ""
-"plik wykonywalny/DSO z sekcją .eh_frame_hdr nie posiada wpisu nagłówka "
-"programu PT_GNU_EH_FRAME"
+"plik wykonywalny/DSO z sekcją .eh_frame_hdr nie ma wpisu nagłówka programu "
+"PT_GNU_EH_FRAME"
-#: src/elflint.c:4690
+#: src/elflint.c:4723
#, c-format
msgid "cannot read ELF header: %s\n"
msgstr "nie można odczytać nagłówka ELF: %s\n"
-#: src/elflint.c:4716
+#: src/elflint.c:4749
#, c-format
msgid "text relocation flag set but not needed\n"
msgstr "flaga relokacji tekstu jest ustawiona, ale niepotrzebna\n"
-#: src/findtextrel.c:62
+#: src/findtextrel.c:61
msgid "Input Selection:"
msgstr "Wybór wejścia:"
-#: src/findtextrel.c:63
+#: src/findtextrel.c:62
msgid "Prepend PATH to all file names"
msgstr "Dołącza ŚCIEŻKĘ do wszystkich nazw plików"
-#: src/findtextrel.c:65
+#: src/findtextrel.c:64
msgid "Use PATH as root of debuginfo hierarchy"
msgstr "Używa ŚCIEŻKI jako korzenia dla hierarchii debuginfo"
-#: src/findtextrel.c:72
+#. Short description of program.
+#: src/findtextrel.c:71
msgid "Locate source of text relocations in FILEs (a.out by default)."
-msgstr "Odnajduje źródło relokacji tekstu w PLIKACH (domyślnie a.out)."
+msgstr "Odnajduje źródło relokacji tekstu w PLIKACH (domyślnie a.out)."
-#: src/findtextrel.c:76 src/nm.c:108 src/objdump.c:71 src/size.c:83
-#: src/strings.c:88 src/strip.c:95
+#. Strings for arguments in help texts.
+#: src/findtextrel.c:75 src/nm.c:109 src/objdump.c:72 src/size.c:81
+#: src/strings.c:88 src/strip.c:99
msgid "[FILE...]"
msgstr "[PLIK…]"
-#: src/findtextrel.c:238
+#: src/findtextrel.c:223
#, c-format
msgid "cannot get ELF header '%s': %s"
msgstr "nie można uzyskać nagłówka ELF „%s”: %s"
-#: src/findtextrel.c:249
+#: src/findtextrel.c:234
#, c-format
msgid "'%s' is not a DSO or PIE"
msgstr "„%s” nie jest DSO ani PIE"
-#: src/findtextrel.c:269
+#: src/findtextrel.c:254
#, c-format
msgid "getting get section header of section %zu: %s"
msgstr "uzyskiwanie nagłówka sekcji dla sekcji %zu: %s"
-#: src/findtextrel.c:292
+#: src/findtextrel.c:277
#, c-format
msgid "cannot read dynamic section: %s"
msgstr "nie można odczytać sekcji dynamicznej: %s"
-#: src/findtextrel.c:313
+#: src/findtextrel.c:298
#, c-format
msgid "no text relocations reported in '%s'"
-msgstr "brak relokacji tekstu w „%s”"
+msgstr "brak relokacji tekstu w „%s”"
-#: src/findtextrel.c:325
+#: src/findtextrel.c:310
#, c-format
msgid "while reading ELF file"
msgstr "podczas odczytywania pliku ELF"
-#: src/findtextrel.c:329
+#: src/findtextrel.c:314
#, c-format
msgid "cannot get program header count: %s"
msgstr "nie można uzyskać liczby nagłówków programu: %s"
-#: src/findtextrel.c:340 src/findtextrel.c:357
+#: src/findtextrel.c:325 src/findtextrel.c:342
#, c-format
msgid "cannot get program header index at offset %zd: %s"
msgstr "nie można uzyskać indeksu nagłówka programu pod offsetem %zd: %s"
-#: src/findtextrel.c:421
+#: src/findtextrel.c:406
#, c-format
msgid "cannot get symbol table section %zu in '%s': %s"
-msgstr "nie można uzyskać sekcji tabeli symboli %zu w „%s”: %s"
+msgstr "nie można uzyskać sekcji tabeli symboli %zu w „%s”: %s"
-#: src/findtextrel.c:441 src/findtextrel.c:464
+#: src/findtextrel.c:426 src/findtextrel.c:449
#, c-format
msgid "cannot get relocation at index %d in section %zu in '%s': %s"
-msgstr "nie można uzyskać relokacji pod indeksem %d w sekcji %zu w „%s”: %s"
+msgstr "nie można uzyskać relokacji pod indeksem %d w sekcji %zu w „%s”: %s"
-#: src/findtextrel.c:530
+#: src/findtextrel.c:515
#, c-format
msgid "%s not compiled with -fpic/-fPIC\n"
-msgstr "%s nie został skompilowany z -fpic/-fPIC\n"
+msgstr "%s nie został skompilowany z -fpic/-fPIC\n"
-#: src/findtextrel.c:583
+#: src/findtextrel.c:568
#, c-format
msgid ""
"the file containing the function '%s' is not compiled with -fpic/-fPIC\n"
-msgstr "plik zawierający funkcję „%s” nie został skompilowany z -fpic/-fPIC\n"
+msgstr "plik zawierający funkcję „%s” nie został skompilowany z -fpic/-fPIC\n"
-#: src/findtextrel.c:590 src/findtextrel.c:610
+#: src/findtextrel.c:575 src/findtextrel.c:595
#, c-format
msgid ""
"the file containing the function '%s' might not be compiled with -fpic/-"
"fPIC\n"
msgstr ""
-"plik zawierający funkcję „%s” mógł nie zostać skompilowany z -fpic/-fPIC\n"
+"plik zawierający funkcję „%s” mógł nie zostać skompilowany z -fpic/-fPIC\n"
-#: src/findtextrel.c:598
+#: src/findtextrel.c:583
#, c-format
msgid ""
"either the file containing the function '%s' or the file containing the "
"function '%s' is not compiled with -fpic/-fPIC\n"
msgstr ""
"plik zawierający funkcję „%s” lub plik zawierający funkcję „%s” nie został "
-"skompilowany z -fpic/-fPIC\n"
+"skompilowany z -fpic/-fPIC\n"
-#: src/findtextrel.c:618
+#: src/findtextrel.c:603
#, c-format
msgid ""
"a relocation modifies memory at offset %llu in a write-protected segment\n"
msgstr ""
-"relokacja modyfikuje pamięć pod offsetem %llu w segmencie zabezpieczonym "
+"relokacja modyfikuje pamięć pod offsetem %llu w segmencie zabezpieczonym "
"przed zapisem\n"
-#: src/i386_ld.c:202
-#, c-format
-msgid "cannot allocate PLT section: %s"
-msgstr "nie można przydzielić sekcji PLT: %s"
-
-#: src/i386_ld.c:224
-#, c-format
-msgid "cannot allocate PLTREL section: %s"
-msgstr "nie można przydzielić sekcji PLTREL: %s"
-
-#: src/i386_ld.c:245
-#, c-format
-msgid "cannot allocate GOT section: %s"
-msgstr "nie można przydzielić sekcji GOT: %s"
-
-#: src/i386_ld.c:266
-#, c-format
-msgid "cannot allocate GOTPLT section: %s"
-msgstr "nie można przydzielić sekcji GOTPLT: %s"
-
-#: src/i386_ld.c:653
-#, c-format
-msgid "initial-executable TLS relocation cannot be used "
-msgstr "początkowo wykonywalna relokacja TLS nie może zostać użyta "
-
-#: src/ld.c:78
-msgid "Input File Control:"
-msgstr "Sterowanie plikiem wejściowym:"
-
-#: src/ld.c:80
-msgid "Include whole archives in the output from now on."
-msgstr "Dołącza całe archiwa w wyjściu od teraz."
-
-#: src/ld.c:82
-msgid "Stop including the whole archives in the output."
-msgstr "Przestaje dołączać całe archiwa w wyjściu."
-
-#: src/ld.c:83 src/ld.c:97 src/ld.c:175
-msgid "FILE"
-msgstr "PLIK"
-
-#: src/ld.c:84
-msgid "Start a group."
-msgstr "Rozpoczyna grupę."
-
-#: src/ld.c:85
-msgid "End a group."
-msgstr "Kończy grupę."
-
-#: src/ld.c:86
-msgid "PATH"
-msgstr "ŚCIEŻKA"
-
-#: src/ld.c:87
-msgid "Add PATH to list of directories files are searched in."
-msgstr "Dodaje ŚCIEŻKĘ do listy katalogów, w których są szukane pliki."
-
-#: src/ld.c:89
-msgid "Only set DT_NEEDED for following dynamic libs if actually used"
-msgstr ""
-"Ustawia DT_NEEDED dla następujących bibliotek dynamicznych tylko, jeśli są "
-"używane"
-
-#: src/ld.c:91
-msgid "Always set DT_NEEDED for following dynamic libs"
-msgstr "Ustawia zawsze DT_NEEDED dla następujących bibliotek dynamicznych"
-
-#: src/ld.c:93
-msgid "Ignore LD_LIBRARY_PATH environment variable."
-msgstr "Ignoruje zmienną środowiskową LD_LIBRARY_PATH."
-
-#: src/ld.c:96
-msgid "Output File Control:"
-msgstr "Sterowanie plikiem wyjściowym:"
-
-#: src/ld.c:97
-msgid "Place output in FILE."
-msgstr "Umieszcza wyjście w PLIKU."
-
-#: src/ld.c:100
-msgid "Object is marked to not use default search path at runtime."
-msgstr "Oznacza obiekt, aby nie używał domyślnej ścieżki przeszukiwań."
-
-#: src/ld.c:102
-msgid "Same as --whole-archive."
-msgstr "To samo, co --whole-archive."
-
-#: src/ld.c:103
-msgid ""
-"Default rules of extracting from archive; weak references are not enough."
-msgstr ""
-"Domyślne reguły wydobywania z archiwum; słabe odwołania nie wystarczają."
-
-#: src/ld.c:107
-msgid "Weak references cause extraction from archive."
-msgstr "Słabe odwołania powodują wydobywanie z archiwum."
-
-#: src/ld.c:109
-msgid "Allow multiple definitions; first is used."
-msgstr "Zezwala na wielokrotne definicje; używana jest pierwsza."
-
-#: src/ld.c:111
-msgid "Disallow/allow undefined symbols in DSOs."
-msgstr "Zabrania/zezwala na nieokreślone symbole w DSO."
-
-#: src/ld.c:114
-msgid "Object requires immediate handling of $ORIGIN."
-msgstr "Obiekt wymaga natychmiastowej obsługi $ORIGIN."
-
-#: src/ld.c:116
-msgid "Relocation will not be processed lazily."
-msgstr "Relokacje nie będą przeprowadzane leniwie."
-
-#: src/ld.c:118
-msgid "Object cannot be unloaded at runtime."
-msgstr "Obiekt nie może być wyładowany w czasie działania."
-
-#: src/ld.c:120
-msgid "Mark object to be initialized first."
-msgstr "Oznacza obiekt, aby był inicjowany jako pierwszy."
-
-#: src/ld.c:122
-msgid "Enable/disable lazy-loading flag for following dependencies."
-msgstr "Włącza/wyłącza flagi leniwego wczytywania dla następnych zależności."
-
-#: src/ld.c:124
-msgid "Mark object as not loadable with 'dlopen'."
-msgstr "Oznacza obiekt jako niewczytywalnego przez „dlopen”."
-
-#: src/ld.c:126
-msgid "Ignore/record dependencies on unused DSOs."
-msgstr "Ignoruje/zapisuje zależności od nieużywanych DSO."
-
-#: src/ld.c:128
-msgid "Generated DSO will be a system library."
-msgstr "Utworzony DSO będzie biblioteką systemową."
-
-#: src/ld.c:129
-msgid "ADDRESS"
-msgstr "ADRES"
-
-#: src/ld.c:129
-msgid "Set entry point address."
-msgstr "Ustawia adres punktu wejściowego."
-
-#: src/ld.c:132
-msgid "Do not link against shared libraries."
-msgstr "Bez konsolidowania z bibliotekami współdzielonymi."
-
-#: src/ld.c:135
-msgid "Prefer linking against shared libraries."
-msgstr "Preferuje konsolidowanie z bibliotekami dzielonymi."
-
-#: src/ld.c:136
-msgid "Export all dynamic symbols."
-msgstr "Eksportuje wszystkie symbole dynamiczne."
-
-#: src/ld.c:137
-msgid "Strip all symbols."
-msgstr "Skraca wszystkie symbole."
-
-#: src/ld.c:138
-msgid "Strip debugging symbols."
-msgstr "Skraca symbole debugowania."
-
-#: src/ld.c:140
-msgid "Assume pagesize for the target system to be SIZE."
-msgstr "Przyjmuje dla systemu docelowego rozmiaru strony ROZMIAR."
-
-#: src/ld.c:142
-msgid "Set runtime DSO search path."
-msgstr "Ustawia ścieżkę poszukiwania DSO w czasie działania."
-
-#: src/ld.c:145
-msgid "Set link time DSO search path."
-msgstr "Ustawia ścieżki poszukiwania DSO w czasie konsolidowania."
-
-#: src/ld.c:146
-msgid "Generate dynamic shared object."
-msgstr "Tworzy dynamiczny obiekt współdzielony."
-
-#: src/ld.c:147
-msgid "Generate relocatable object."
-msgstr "Tworzy obiekt relokowalny."
-
-#: src/ld.c:150
-msgid "Causes symbol not assigned to a version be reduced to local."
-msgstr "Ogranicza zasięg symboli nieprzypisanych do wersji do lokalnego."
-
-#: src/ld.c:151
-msgid "Remove unused sections."
-msgstr "Usuwa nieużywane sekcje."
-
-#: src/ld.c:154
-msgid "Don't remove unused sections."
-msgstr "Bez usuwania nieużywanych sekcji."
-
-#: src/ld.c:155
-msgid "Set soname of shared object."
-msgstr "Ustawia soname obiektu współdzielonego."
-
-#: src/ld.c:156
-msgid "Set the dynamic linker name."
-msgstr "Ustawia nazwę dynamicznego konsolidatora."
-
-#: src/ld.c:159
-msgid "Add/suppress addition indentifying link-editor to .comment section."
-msgstr ""
-"Dodaje/pomija dodanie identyfikacji edytora konsolidacji do sekcji .comment."
-
-#: src/ld.c:162
-msgid "Create .eh_frame_hdr section"
-msgstr "Tworzy sekcję .eh_frame_hdr"
-
-#: src/ld.c:164
-msgid "Set hash style to sysv, gnu or both."
-msgstr "Ustawia styl sum kontrolnych na sysv, gnu lub oba."
-
-#: src/ld.c:166
-msgid "Generate build ID note (md5, sha1 (default), uuid)."
-msgstr "Tworzy wpis identyfikatora kopii (MD5, SHA1 (domyślnie), UUID)."
-
-#: src/ld.c:168
-msgid "Linker Operation Control:"
-msgstr "Sterowanie działaniami konsolidatora:"
-
-#: src/ld.c:169
-msgid "Verbose messages."
-msgstr "Szczegółowe komunikaty."
-
-#: src/ld.c:170
-msgid "Trace file opens."
-msgstr "Śledzi otwarcia plików."
-
-#: src/ld.c:172
-msgid "Trade speed for less memory usage"
-msgstr "Poświęca prędkość na mniejsze zużycie pamięci"
-
-#: src/ld.c:173
-msgid "LEVEL"
-msgstr "POZIOM"
-
-#: src/ld.c:174
-msgid "Set optimization level to LEVEL."
-msgstr "Ustawia poziom optymalizacji na POZIOM."
-
-#: src/ld.c:175
-msgid "Use linker script in FILE."
-msgstr "Używa skryptu konsolidatora z PLIKU."
-
-#: src/ld.c:178
-msgid "Select to get parser debug information"
-msgstr "Wybiera pobranie informacji debugowania parsera"
-
-#: src/ld.c:181
-msgid "Read version information from FILE."
-msgstr "Odczytuje informacje o wersji z PLIKU."
-
-#: src/ld.c:182
-msgid "Set emulation to NAME."
-msgstr "Ustawia emulację na NAZWĘ."
-
-#: src/ld.c:188
-msgid "Combine object and archive files."
-msgstr "Łączy pliki obiektów i archiwów."
-
-#: src/ld.c:191
-msgid "[FILE]..."
-msgstr "[PLIK]…"
-
-#: src/ld.c:319
-#, c-format
-msgid "At least one input file needed"
-msgstr "Wymagany jest co najmniej jeden plik wejściowy"
-
-#: src/ld.c:335
-#, c-format
-msgid "error while preparing linking"
-msgstr "błąd podczas przygotowywania konsolidowania"
-
-#: src/ld.c:342
-#, c-format
-msgid "cannot open linker script '%s'"
-msgstr "nie można otworzyć skryptu konsolidatora „%s”"
-
-#: src/ld.c:383
-#, c-format
-msgid "-( without matching -)"
-msgstr "-( bez pasującego -)"
-
-#: src/ld.c:558 src/ld.c:596
-#, c-format
-msgid "only one option of -G and -r is allowed"
-msgstr "dozwolona jest tylko jedna z opcji -G i -r"
-
-#: src/ld.c:580
-#, c-format
-msgid "more than one '-m' parameter"
-msgstr "podano więcej niż jeden parametr „-m”"
-
-#: src/ld.c:590 src/ld.c:999
-#, c-format
-msgid "unknown option `-%c %s'"
-msgstr "nieznana opcja „-%c %s”"
-
-#: src/ld.c:632
-#, c-format
-msgid "invalid page size value '%s': ignored"
-msgstr "nieprawidłowa wartość rozmiaru strony „%s”: zignorowano"
-
-#: src/ld.c:673
-#, c-format
-msgid "invalid hash style '%s'"
-msgstr "nieprawidłowy styl sum kontrolnych „%s”"
-
-#: src/ld.c:683
-#, c-format
-msgid "invalid build-ID style '%s'"
-msgstr "nieprawidłowy styl identyfikatora kopii „%s”"
-
-#: src/ld.c:771
-#, c-format
-msgid "More than one output file name given."
-msgstr "Podano więcej niż jeden plik wyjściowy."
-
-#: src/ld.c:788
-#, c-format
-msgid "Invalid optimization level `%s'"
-msgstr "Nieprawidłowy poziom optymalizacji „%s”"
-
-#: src/ld.c:836
-#, c-format
-msgid "nested -( -) groups are not allowed"
-msgstr "zagnieżdżone grupy -( -) nie są dozwolone"
-
-#: src/ld.c:855
-#, c-format
-msgid "-) without matching -("
-msgstr "-) bez pasującego -("
-
-#: src/ld.c:1032
-#, c-format
-msgid "unknown option '-%c %s'"
-msgstr "nieznana opcja „-%c %s”"
-
-#: src/ld.c:1138
-#, c-format
-msgid "could not find input file to determine output file format"
-msgstr ""
-"nie można odnaleźć pliku wejściowego, aby określić format pliku wyjściowego"
-
-#: src/ld.c:1140
-#, c-format
-msgid "try again with an appropriate '-m' parameter"
-msgstr "proszę spróbować jeszcze raz z odpowiednim parametrem „-m”"
-
-#: src/ld.c:1434
-#, c-format
-msgid "cannot read version script '%s'"
-msgstr "nie można odczytać skryptu wersji „%s”"
-
-#: src/ld.c:1500 src/ld.c:1539
-#, c-format
-msgid "duplicate definition of '%s' in linker script"
-msgstr "powtórzona definicja „%s” w skrypcie konsolidatora"
-
-#: src/ldgeneric.c:201 src/ldgeneric.c:5141
-#, c-format
-msgid "cannot create string table"
-msgstr "nie można utworzyć tabeli ciągów"
-
-#: src/ldgeneric.c:247
-#, c-format
-msgid "cannot load ld backend library '%s': %s"
-msgstr "nie można odczytać biblioteki zaplecza ld „%s”: %s"
-
-#: src/ldgeneric.c:257
-#, c-format
-msgid "cannot find init function in ld backend library '%s': %s"
-msgstr "nie można odnaleźć funkcji init w bibliotece zaplecza ld „%s”: %s"
-
-#: src/ldgeneric.c:300
-#, c-format
-msgid "%s listed more than once as input"
-msgstr "%s podano więcej niż raz w wejściu"
-
-#: src/ldgeneric.c:414
-#, c-format
-msgid "%s (for -l%s)\n"
-msgstr "%s (dla -l%s)\n"
-
-#: src/ldgeneric.c:415
-#, c-format
-msgid "%s (for DT_NEEDED %s)\n"
-msgstr "%s (dla DT_NEEDED %s)\n"
-
-#: src/ldgeneric.c:563
-#, c-format
-msgid "Warning: type of `%s' changed from %s in %s to %s in %s"
-msgstr "Ostrzeżenie: typ „%s” zmienił się z %s w %s na %s w %s"
-
-#: src/ldgeneric.c:576
-#, c-format
-msgid "Warning: size of `%s' changed from %<PRIu64> in %s to %<PRIu64> in %s"
-msgstr ""
-"Ostrzeżenie: rozmiar „%s” zmienił się z %<PRIu64> w %s na %<PRIu64> w %s"
-
-#: src/ldgeneric.c:651 src/ldgeneric.c:1112 src/readelf.c:536 src/readelf.c:852
-#: src/strip.c:589
-#, c-format
-msgid "cannot determine number of sections: %s"
-msgstr "nie można określić liczby sekcji: %s"
-
-#: src/ldgeneric.c:667
-#, c-format
-msgid "(%s+%#<PRIx64>): multiple definition of %s `%s'\n"
-msgstr "(%s+%#<PRIx64>): wielokrotna definicja %s `%s'\n"
-
-#: src/ldgeneric.c:690
-#, c-format
-msgid "(%s+%#<PRIx64>): first defined here\n"
-msgstr "(%s+%#<PRIx64>): pierwszy raz określono tutaj\n"
-
-#: src/ldgeneric.c:809
-#, c-format
-msgid "%s: cannot get section group data: %s"
-msgstr "%s: nie można uzyskać danych grupy sekcji: %s"
-
-#: src/ldgeneric.c:830
-#, c-format
-msgid "%s: section '%s' with group flag set does not belong to any group"
-msgstr "%s: sekcja „%s” z ustawioną flagą grupy nie należy do żadnej grupy"
-
-#: src/ldgeneric.c:875
-#, c-format
-msgid "%s: section [%2d] '%s' is not in the correct section group"
-msgstr "%s: sekcja [%2d] „%s” nie jest w poprawnej grupie sekcji"
-
-#: src/ldgeneric.c:1146 src/ldgeneric.c:1403 src/ldgeneric.c:1412
-#: src/ldgeneric.c:1471 src/ldgeneric.c:1480 src/ldgeneric.c:1743
-#: src/ldgeneric.c:1995
-#, c-format
-msgid "%s: invalid ELF file (%s:%d)\n"
-msgstr "%s: nieprawidłowy plik ELF (%s:%d)\n"
-
-#: src/ldgeneric.c:1240
-#, c-format
-msgid "%s: only files of type ET_REL might contain section groups"
-msgstr "%s: tylko pliki typu ET_REL mogą zawierać grupy sekcji"
-
-#: src/ldgeneric.c:1292
-#, c-format
-msgid "%s: cannot determine signature of section group [%2zd] '%s': %s"
-msgstr "%s: nie można określić podpisu grupy sekcji [%2zd] „%s”: %s"
-
-#: src/ldgeneric.c:1304
-#, c-format
-msgid "%s: cannot get content of section group [%2zd] '%s': %s'"
-msgstr "%s: nie można uzyskać zawartości grupy sekcji [%2zd] „%s”: %s"
-
-#: src/ldgeneric.c:1318
-#, c-format
-msgid ""
-"%s: group member %zu of section group [%2zd] '%s' has too high index: "
-"%<PRIu32>"
-msgstr ""
-"%s: element grupy %zu grupy sekcji [%2zd] „%s” posiada za wysoki indeks: "
-"%<PRIu32>"
-
-#: src/ldgeneric.c:1340
-#, c-format
-msgid "%s: section '%s' has unknown type: %d"
-msgstr "%s: sekcja „%s” posiada nieznany typ: %d"
-
-#: src/ldgeneric.c:1719
-#, c-format
-msgid "cannot get descriptor for ELF file (%s:%d): %s\n"
-msgstr "nie można uzyskać deskryptora dla pliku ELF (%s:%d): %s\n"
-
-#: src/ldgeneric.c:1889
-#, c-format
-msgid "cannot read archive `%s': %s"
-msgstr "nie można odczytać archiwum „%s”: %s"
-
-#: src/ldgeneric.c:2010
-#, c-format
-msgid "file of type %s cannot be linked in\n"
-msgstr "plik typu %s nie może zostać wkonsolidowany\n"
-
-#: src/ldgeneric.c:2022
-#, c-format
-msgid "%s: input file incompatible with ELF machine type %s\n"
-msgstr "%s: plik wejściowy jest niezgodny z rodzajem komputera ELF %s\n"
-
-#: src/ldgeneric.c:2034
-#, c-format
-msgid "%s: cannot get section header string table index: %s\n"
-msgstr "%s: nie można uzyskać indeksu tabeli ciągów nagłówków sekcji: %s\n"
-
-#: src/ldgeneric.c:2063
-#, c-format
-msgid "cannot use DSO '%s' when generating relocatable object file"
-msgstr "nie można użyć DSO „%s” podczas tworzenia relokowalnego pliku obiektu"
-
-#: src/ldgeneric.c:2148
-#, c-format
-msgid "input file '%s' ignored"
-msgstr "plik wejściowy „%s” został zignorowany"
-
-#: src/ldgeneric.c:2362
-#, c-format
-msgid "undefined symbol `%s' in %s"
-msgstr "nieokreślony symbol „%s” w %s"
-
-#: src/ldgeneric.c:2692
-#, c-format
-msgid "cannot create ELF descriptor for output file: %s"
-msgstr "nie można utworzyć deskryptora ELF dla pliku wyjściowego: %s"
-
-#: src/ldgeneric.c:2699
-#, c-format
-msgid "could not create ELF header for output file: %s"
-msgstr "nie można utworzyć nagłówka ELF dla pliku wyjściowego: %s"
-
-#: src/ldgeneric.c:3214 src/ldgeneric.c:3284 src/ldgeneric.c:3320
-#: src/ldgeneric.c:4447 src/ldgeneric.c:4496 src/ldgeneric.c:4528
-#: src/ldgeneric.c:4763 src/ldgeneric.c:4818 src/ldgeneric.c:5065
-#: src/ldgeneric.c:5121 src/ldgeneric.c:5590 src/ldgeneric.c:5602
-#, c-format
-msgid "cannot create section for output file: %s"
-msgstr "nie można utworzyć sekcji dla pliku wyjściowego: %s"
-
-#: src/ldgeneric.c:3434
-#, c-format
-msgid "address computation expression contains variable '%s'"
-msgstr "wyrażenie obliczenia adresu zawiera zmienną „%s”"
-
-#: src/ldgeneric.c:3479
-#, c-format
-msgid ""
-"argument '%<PRIuMAX>' of ALIGN in address computation expression is no power "
-"of two"
-msgstr ""
-"parametr „%<PRIuMAX>” ALIGN w wyrażeniu obliczenia adresu nie jest potęgą "
-"dwójki"
-
-#: src/ldgeneric.c:3674
-#, c-format
-msgid "cannot find entry symbol '%s': defaulting to %#0*<PRIx64>"
-msgstr ""
-"nie można odnaleźć symbolu wejściowego „%s”: użycie domyślnego %#0*<PRIx64>"
-
-#: src/ldgeneric.c:3680
-#, c-format
-msgid "no entry symbol specified: defaulting to %#0*<PRIx64>"
-msgstr "nie określono symbolu wejściowego: użycie domyślnego %#0*<PRIx64>"
-
-#: src/ldgeneric.c:3910
-#, c-format
-msgid "cannot create GNU hash table section for output file: %s"
-msgstr ""
-"nie można utworzyć sekcji tabeli mieszającej GNU dla pliku wyjściowego: %s"
-
-#: src/ldgeneric.c:4061
-#, c-format
-msgid "cannot create hash table section for output file: %s"
-msgstr "nie można utworzyć sekcji tabeli mieszającej dla pliku wyjściowego: %s"
-
-#: src/ldgeneric.c:4104
-#, c-format
-msgid "cannot create build ID section: %s"
-msgstr "nie można utworzyć sekcji identyfikatora kopii: %s"
-
-#: src/ldgeneric.c:4181
-#, c-format
-msgid "cannot convert section data to file format: %s"
-msgstr "nie można konwertować danych sekcji na format pliku: %s"
-
-#: src/ldgeneric.c:4190
-#, c-format
-msgid "cannot convert section data to memory format: %s"
-msgstr "nie można konwertować danych sekcji na format pamięci: %s"
-
-#: src/ldgeneric.c:4251
-#, c-format
-msgid "cannot read enough data for UUID"
-msgstr "nie można odczytać danych wystarczających dla UUID"
-
-#: src/ldgeneric.c:4348 src/ldgeneric.c:4369 src/ldgeneric.c:4398
-#: src/ldgeneric.c:6051
-#, c-format
-msgid "cannot create symbol table for output file: %s"
-msgstr "nie można utworzyć tabeli symboli dla pliku wyjściowego: %s"
-
-#: src/ldgeneric.c:5290 src/ldgeneric.c:5842
-#, c-format
-msgid "section index too large in dynamic symbol table"
-msgstr "indeks sekcji za duży w tabeli symboli dynamicznych"
-
-#: src/ldgeneric.c:5735
-#, c-format
-msgid "cannot create versioning section: %s"
-msgstr "nie można utworzyć sekcji wersjonowania: %s"
-
-#: src/ldgeneric.c:5808
-#, c-format
-msgid "cannot create dynamic symbol table for output file: %s"
-msgstr ""
-"nie można utworzyć tabeli symboli dynamicznych dla pliku wyjściowego: %s"
-
-#: src/ldgeneric.c:5983
-#, c-format
-msgid "cannot create versioning data: %s"
-msgstr "nie można utworzyć danych wersjonowania: %s"
-
-#: src/ldgeneric.c:6083 src/ldgeneric.c:6096 src/ldgeneric.c:6160
-#: src/ldgeneric.c:6168
-#, c-format
-msgid "cannot create section header string section: %s"
-msgstr "nie można utworzyć sekcji ciągów nagłówków sekcji: %s"
-
-#: src/ldgeneric.c:6090
-#, c-format
-msgid "cannot create section header string section"
-msgstr "nie można utworzyć sekcji ciągów nagłówków sekcji"
-
-#: src/ldgeneric.c:6248
-#, c-format
-msgid "cannot create program header: %s"
-msgstr "nie można utworzyć nagłówka programu: %s"
-
-#: src/ldgeneric.c:6256
-#, c-format
-msgid "while determining file layout: %s"
-msgstr "podczas określania układu pliku: %s"
-
-#: src/ldgeneric.c:6377
-#, c-format
-msgid "internal error: non-nobits section follows nobits section"
-msgstr "błąd wewnętrzny: sekcja nie będąca nobits po sekcji nobits"
-
-#: src/ldgeneric.c:6914
-#, c-format
-msgid "cannot get header of 0th section: %s"
-msgstr "nie można uzyskać nagłówka zerowej sekcji: %s"
-
-#: src/ldgeneric.c:6930 src/unstrip.c:1929
-#, c-format
-msgid "cannot update ELF header: %s"
-msgstr "nie można zaktualizować nagłówka ELF: %s"
-
-#: src/ldgeneric.c:6961
-#, c-format
-msgid "linker backend didn't specify function to relocate section"
-msgstr "zaplecze konsolidatora nie określiło funkcji dla sekcji relokacji"
-
-#: src/ldgeneric.c:6973
-#, c-format
-msgid "while writing output file: %s"
-msgstr "podczas zapisywania pliku wyjściowego: %s"
-
-#: src/ldgeneric.c:6978
-#, c-format
-msgid "while finishing output file: %s"
-msgstr "podczas kończenia pliku wyjściowego: %s"
-
-#: src/ldgeneric.c:6984
-#, c-format
-msgid "cannot stat output file"
-msgstr "nie można wykonać stat na pliku wyjściowym"
-
-#: src/ldgeneric.c:7000
-#, c-format
-msgid "WARNING: temporary output file overwritten before linking finished"
-msgstr ""
-"OSTRZEŻENIE: tymczasowy plik wyjściowy został zastąpiony przed ukończeniem "
-"konsolidowania"
-
-#: src/ldgeneric.c:7053 src/ldgeneric.c:7064 src/ldgeneric.c:7075
-#: src/ldgeneric.c:7086 src/ldgeneric.c:7105 src/ldgeneric.c:7118
-#: src/ldgeneric.c:7130
-#, c-format
-msgid "no machine specific '%s' implementation"
-msgstr "brak implementacji „%s” specyficznej dla maszyny"
-
-#: src/ldscript.y:170
-msgid "mode for segment invalid\n"
-msgstr "nieprawidłowy tryb dla segmentu\n"
-
-#: src/ldscript.y:457
-#, c-format
-msgid "while reading version script '%s': %s at line %d"
-msgstr "podczas odczytywania skryptu wersji „%s”: %s w wierszu %d"
-
-#: src/ldscript.y:458
-#, c-format
-msgid "while reading linker script '%s': %s at line %d"
-msgstr "podczas odczytywania skryptu konsolidatora „%s”: %s w wierszu %d"
-
-#: src/ldscript.y:737
-#, c-format
-msgid "symbol '%s' is declared both local and global for unnamed version '%s'"
-msgstr ""
-"symbol „%s” jest zadeklarowany jednocześnie lokalny i globalny dla "
-"nienazwanej wersji „%s”"
-
-#: src/ldscript.y:739
-#, c-format
-msgid "symbol '%s' is declared both local and global for version '%s'"
-msgstr ""
-"symbol „%s” jest zadeklarowany jednocześnie lokalny i globalny dla wersji "
-"„%s”"
-
-#: src/ldscript.y:759 src/ldscript.y:766
-#, c-format
-msgid "default visibility set as local and global"
-msgstr "domyślna widoczność ustawiona jako lokalna i globalna"
-
-#: src/nm.c:66 src/strip.c:67
+#: src/nm.c:67 src/strip.c:70
msgid "Output selection:"
msgstr "Wybór wyjścia:"
-#: src/nm.c:67
-msgid "Display debugger-only symbols"
-msgstr "Wyświetla symbole wyłącznie debugowowania"
-
#: src/nm.c:68
+msgid "Display debugger-only symbols"
+msgstr "Wyświetla symbole wyłącznie debugowania"
+
+#: src/nm.c:69
msgid "Display only defined symbols"
msgstr "Wyświetla tylko określone symbole"
-#: src/nm.c:71
+#: src/nm.c:72
msgid "Display dynamic symbols instead of normal symbols"
msgstr "Wyświetla symbole dynamiczne zamiast zwykłych"
-#: src/nm.c:72
+#: src/nm.c:73
msgid "Display only external symbols"
msgstr "Wyświetla tylko symbole zewnętrzne"
-#: src/nm.c:73
+#: src/nm.c:74
msgid "Display only undefined symbols"
msgstr "Wyświetla tylko nieokreślone symbole"
-#: src/nm.c:75
+#: src/nm.c:76
msgid "Include index for symbols from archive members"
-msgstr "Dołącza indeks dla symboli z elementów archiwum"
+msgstr "Dołącza indeks dla symboli z elementów archiwum"
-#: src/nm.c:77 src/size.c:57
+#: src/nm.c:78 src/size.c:55
msgid "Output format:"
msgstr "Format wyjścia:"
-#: src/nm.c:79
+#: src/nm.c:80
msgid "Print name of the input file before every symbol"
msgstr "Wyświetla nazwę pliku wejściowego przed każdym symbolem"
-#: src/nm.c:82
+#: src/nm.c:83
msgid ""
"Use the output format FORMAT. FORMAT can be `bsd', `sysv' or `posix'. The "
"default is `sysv'"
@@ -4151,71 +3577,73 @@
"Używa FORMATU wyjściowego. Może to być „bsd”, „sysv” lub „posix”. Domyślny "
"jest format „sysv”"
-#: src/nm.c:84
+#: src/nm.c:85
msgid "Same as --format=bsd"
msgstr "To samo, co --format=bsd"
-#: src/nm.c:85
+#: src/nm.c:86
msgid "Same as --format=posix"
msgstr "To samo co, --format=posix"
-#: src/nm.c:86 src/size.c:63
+#: src/nm.c:87 src/size.c:61
msgid "Use RADIX for printing symbol values"
msgstr "Używa BAZY do wypisywania wartości symboli"
-#: src/nm.c:87
+#: src/nm.c:88
msgid "Mark special symbols"
msgstr "Oznacza specjalne symbole"
-#: src/nm.c:89
+#: src/nm.c:90
msgid "Print size of defined symbols"
msgstr "Wyświetla rozmiar określonych symboli"
-#: src/nm.c:91 src/size.c:71 src/strip.c:72 src/unstrip.c:72
+#: src/nm.c:92 src/size.c:69 src/strip.c:75 src/unstrip.c:73
msgid "Output options:"
msgstr "Opcje wyjścia:"
-#: src/nm.c:92
+#: src/nm.c:93
msgid "Sort symbols numerically by address"
msgstr "Porządkuje symbole numerycznie według adresu"
-#: src/nm.c:94
+#: src/nm.c:95
msgid "Do not sort the symbols"
msgstr "Bez porządkowania symboli"
-#: src/nm.c:95
+#: src/nm.c:96
msgid "Reverse the sense of the sort"
msgstr "Odwraca kierunek porządkowania"
-#: src/nm.c:98
+#: src/nm.c:99
msgid "Decode low-level symbol names into source code names"
msgstr "Dekoduje niskopoziomowe nazwy symboli na nazwy kodu źródłowego"
-#: src/nm.c:105
+#. Short description of program.
+#: src/nm.c:106
msgid "List symbols from FILEs (a.out by default)."
-msgstr "Wyświetla listę symboli z PLIKU (domyślnie a.out)."
+msgstr "Wyświetla listę symboli z PLIKU (domyślnie a.out)."
-#: src/nm.c:116 src/objdump.c:79
+#: src/nm.c:117 src/objdump.c:80
msgid "Output formatting"
msgstr "Formatowanie wyjścia"
-#: src/nm.c:140 src/objdump.c:103 src/size.c:108 src/strip.c:127
+#: src/nm.c:141 src/objdump.c:104 src/size.c:106 src/strip.c:131
#, c-format
msgid "%s: INTERNAL ERROR %d (%s): %s"
msgstr "%s: BŁĄD WEWNĘTRZNY %d (%s): %s"
-#: src/nm.c:395 src/nm.c:407 src/size.c:305 src/size.c:314 src/size.c:325
-#: src/strip.c:2280
+#: src/nm.c:382 src/nm.c:394 src/size.c:289 src/size.c:298 src/size.c:309
+#: src/strip.c:2421
#, c-format
msgid "while closing '%s'"
msgstr "podczas zamykania „%s”"
-#: src/nm.c:417 src/objdump.c:292 src/strip.c:391
+#: src/nm.c:404 src/objdump.c:281 src/strip.c:443
#, c-format
msgid "%s: File format not recognized"
msgstr "%s: nie rozpoznano formatu pliku"
-#: src/nm.c:457
+#. Note: 0 is no valid offset.
+#: src/nm.c:444
msgid ""
"\n"
"Archive index:\n"
@@ -4223,42 +3651,44 @@
"\n"
"Indeks archiwum:\n"
-#: src/nm.c:466
+#: src/nm.c:453
#, c-format
msgid "invalid offset %zu for symbol %s"
msgstr "nieprawidłowy offset %zu dla symbolu %s"
-#: src/nm.c:471
+#: src/nm.c:458
#, c-format
msgid "%s in %s\n"
-msgstr "%s w %s\n"
+msgstr "%s w %s\n"
-#: src/nm.c:479
+#: src/nm.c:466
#, c-format
msgid "cannot reset archive offset to beginning"
-msgstr "nie można przywrócić offsetu w archiwum na początek"
+msgstr "nie można przywrócić offsetu w archiwum na początek"
-#: src/nm.c:504 src/objdump.c:340
+#: src/nm.c:491 src/objdump.c:329
#, c-format
msgid "%s%s%s: file format not recognized"
msgstr "%s%s%s: nie rozpoznano formatu pliku"
-#: src/nm.c:719
+#: src/nm.c:706
#, c-format
msgid "cannot create search tree"
msgstr "nie można utworzyć drzewa wyszukiwania"
-#: src/nm.c:760 src/nm.c:1221 src/objdump.c:789 src/readelf.c:545
-#: src/readelf.c:1123 src/readelf.c:1323 src/readelf.c:1471 src/readelf.c:1667
-#: src/readelf.c:1873 src/readelf.c:2063 src/readelf.c:2300 src/readelf.c:2558
-#: src/readelf.c:2634 src/readelf.c:2721 src/readelf.c:3301 src/readelf.c:3347
-#: src/readelf.c:3410 src/readelf.c:8320 src/readelf.c:9420 src/readelf.c:9603
-#: src/readelf.c:9671 src/size.c:413 src/size.c:482 src/strip.c:520
+#: src/nm.c:747 src/nm.c:1208 src/objdump.c:778 src/readelf.c:606
+#: src/readelf.c:1196 src/readelf.c:1396 src/readelf.c:1544 src/readelf.c:1745
+#: src/readelf.c:1951 src/readelf.c:2141 src/readelf.c:2319 src/readelf.c:2395
+#: src/readelf.c:2653 src/readelf.c:2729 src/readelf.c:2816 src/readelf.c:3414
+#: src/readelf.c:3464 src/readelf.c:3527 src/readelf.c:11028
+#: src/readelf.c:12200 src/readelf.c:12403 src/readelf.c:12471 src/size.c:397
+#: src/size.c:466 src/strip.c:572
#, c-format
msgid "cannot get section header string table index"
msgstr "nie można uzyskać indeksu tabeli ciągów nagłówków sekcji"
-#: src/nm.c:787
+#. We always print this prolog.
+#: src/nm.c:774
#, c-format
msgid ""
"\n"
@@ -4268,10 +3698,11 @@
msgstr ""
"\n"
"\n"
-"Symbole z %s:\n"
+"Symbole z %s:\n"
"\n"
-#: src/nm.c:790
+#. The header line.
+#: src/nm.c:777
#, c-format
msgid ""
"%*s%-*s %-*s Class Type %-*s %*s Section\n"
@@ -4280,72 +3711,79 @@
"%*s%-*s %-*s Klasa Typ %-*s %*s Sekcja\n"
"\n"
-#: src/nm.c:1232
+#: src/nm.c:1219
#, c-format
msgid "%s: entry size in section %zd `%s' is not what we expect"
-msgstr "%s: rozmiar wpisu w sekcji %zd „%s” nie jest tym, czego oczekiwano"
+msgstr "%s: rozmiar wpisu w sekcji %zd „%s” nie jest tym, czego oczekiwano"
-#: src/nm.c:1237
+#: src/nm.c:1224
#, c-format
msgid "%s: size of section %zd `%s' is not multiple of entry size"
msgstr "%s: rozmiar sekcji %zd „%s” nie jest wielokrotnością rozmiaru wpisu"
-#: src/nm.c:1537
+#: src/nm.c:1303
+#, c-format
+msgid "%s: entries (%zd) in section %zd `%s' is too large"
+msgstr "%s: wpisy (%zd) w sekcji %zd „%s” są za duże"
+
+#. XXX Add machine specific object file types.
+#: src/nm.c:1529
#, c-format
msgid "%s%s%s%s: Invalid operation"
msgstr "%s%s%s%s: nieprawidłowe działanie"
-#: src/nm.c:1594
+#: src/nm.c:1586
#, c-format
msgid "%s%s%s: no symbols"
msgstr "%s%s%s: brak symboli"
-#: src/objdump.c:52
+#: src/objdump.c:53
msgid "Mode selection:"
msgstr "Wybór trybu:"
-#: src/objdump.c:53
+#: src/objdump.c:54
msgid "Display relocation information."
-msgstr "Wyświetla informacje o relokacji."
+msgstr "Wyświetla informacje o relokacji."
-#: src/objdump.c:55
+#: src/objdump.c:56
msgid "Display the full contents of all sections requested"
msgstr "Wyświetla pełną zawartość żądanych sekcji"
-#: src/objdump.c:57
+#: src/objdump.c:58
msgid "Display assembler code of executable sections"
msgstr "Wyświetla kod asemblera sekcji wykonywalnych"
-#: src/objdump.c:59
+#: src/objdump.c:60
msgid "Output content selection:"
msgstr "Wybór zawartości wyjścia:"
-#: src/objdump.c:61
+#: src/objdump.c:62
msgid "Only display information for section NAME."
-msgstr "Wyświetla tylko informacje o sekcji NAZWA."
+msgstr "Wyświetla tylko informacje o sekcji NAZWA."
-#: src/objdump.c:67
+#. Short description of program.
+#: src/objdump.c:68
msgid "Show information from FILEs (a.out by default)."
-msgstr "Wyświetla informacje z PLIKÓW (domyślnie a.out)."
+msgstr "Wyświetla informacje z PLIKÓW (domyślnie a.out)."
-#: src/objdump.c:232 src/readelf.c:479
+#: src/objdump.c:219 src/readelf.c:551
msgid "No operation specified.\n"
msgstr "Nie podano działania.\n"
-#: src/objdump.c:270 src/objdump.c:282
+#: src/objdump.c:259 src/objdump.c:271
#, c-format
msgid "while close `%s'"
msgstr "podczas zamykania „%s”"
-#: src/objdump.c:375 src/readelf.c:1968 src/readelf.c:2160
+#: src/objdump.c:364 src/readelf.c:2046 src/readelf.c:2238
msgid "INVALID SYMBOL"
msgstr "NIEPRAWIDŁOWY SYMBOL"
-#: src/objdump.c:390 src/readelf.c:2002 src/readelf.c:2196
+#: src/objdump.c:379 src/readelf.c:2080 src/readelf.c:2274
msgid "INVALID SECTION"
msgstr "NIEPRAWIDŁOWA SEKCJA"
-#: src/objdump.c:510
+#: src/objdump.c:499
#, c-format
msgid ""
"\n"
@@ -4356,290 +3794,320 @@
"PISY RELOKACJI DLA [%s]:\n"
"%-*s TYP WARTOŚĆ\n"
-#: src/objdump.c:513
+#: src/objdump.c:502
msgid "OFFSET"
msgstr "OFFSET"
-#: src/objdump.c:578
+#: src/objdump.c:567
#, c-format
msgid "Contents of section %s:\n"
msgstr "Zawartość sekcji %s:\n"
-#: src/objdump.c:699
+#: src/objdump.c:688
#, c-format
msgid "cannot disassemble"
msgstr "nie można deasemblować"
-#: src/ranlib.c:65
+#. Short description of program.
+#: src/ranlib.c:64
msgid "Generate an index to speed access to archives."
-msgstr "Tworzenie indeksu w celu przyspieszenia dostępu do archiwów."
+msgstr "Tworzenie indeksu w celu przyspieszenia dostępu do archiwów."
-#: src/ranlib.c:68
+#. Strings for arguments in help texts.
+#: src/ranlib.c:67
msgid "ARCHIVE"
msgstr "ARCHIWUM"
-#: src/ranlib.c:104
+#: src/ranlib.c:103
#, c-format
msgid "Archive name required"
msgstr "Wymagana jest nazwa archiwum"
-#: src/ranlib.c:182
+#: src/ranlib.c:167
#, c-format
msgid "'%s' is no archive"
msgstr "„%s” nie jest archiwum"
-#: src/ranlib.c:217
+#: src/ranlib.c:202
#, c-format
msgid "error while freeing sub-ELF descriptor: %s"
msgstr "błąd podczas zwalniania deskryptora pod-ELF: %s"
-#: src/readelf.c:72
+#: src/readelf.c:95
msgid "ELF input selection:"
msgstr "Wybór wyjścia ELF:"
-#: src/readelf.c:74
+#: src/readelf.c:97
msgid ""
"Use the named SECTION (default .gnu_debugdata) as (compressed) ELF input data"
msgstr ""
"Używa podanej SEKCJI (domyślnie .gnu_debugdata) jako (skompresowanych) "
"danych wejściowych ELF"
-#: src/readelf.c:76
+#: src/readelf.c:100
+msgid ""
+"Used with -w to find the skeleton Compile Units in FILE associated with the "
+"Split Compile units in a .dwo input file"
+msgstr ""
+
+#: src/readelf.c:102
msgid "ELF output selection:"
msgstr "Wybór wyjścia ELF:"
-#: src/readelf.c:78
+#: src/readelf.c:104
msgid "All these plus -p .strtab -p .dynstr -p .comment"
msgstr "Wszystkie te plus -p .strtab -p .dynstr -p .comment"
-#: src/readelf.c:79
+#: src/readelf.c:105
msgid "Display the dynamic segment"
msgstr "Wyświetla segment dynamiczny"
-#: src/readelf.c:80
+#: src/readelf.c:106
msgid "Display the ELF file header"
msgstr "Wyświetla nagłówek pliku ELF"
-#: src/readelf.c:82
+#: src/readelf.c:108
msgid "Display histogram of bucket list lengths"
msgstr "Wyświetla histogram długości list kubełków"
-#: src/readelf.c:83
+#: src/readelf.c:109
msgid "Display the program headers"
msgstr "Wyświetla nagłówki programu"
-#: src/readelf.c:85
+#: src/readelf.c:111
msgid "Display relocations"
msgstr "Wyświetla relokacje"
-#: src/readelf.c:86
+#: src/readelf.c:112
+#, fuzzy
+msgid "Display the section groups"
+msgstr "Wyświetla nagłówki sekcji"
+
+#: src/readelf.c:113
msgid "Display the sections' headers"
-msgstr "Wyświetla nagłówków sekcji"
+msgstr "Wyświetla nagłówki sekcji"
-#: src/readelf.c:88
-msgid "Display the symbol table"
-msgstr "Wyświetla tabelę symboli"
+#: src/readelf.c:116
+msgid "Display the symbol table sections"
+msgstr "Wyświetla sekcje tabeli symboli"
-#: src/readelf.c:89
+#: src/readelf.c:117
msgid "Display versioning information"
-msgstr "Wyświetla informacje o wersjonowaniu"
+msgstr "Wyświetla informacje o wersji"
-#: src/readelf.c:90
+#: src/readelf.c:118
msgid "Display the ELF notes"
msgstr "Wyświetla notatki ELF"
-#: src/readelf.c:92
+#: src/readelf.c:120
msgid "Display architecture specific information, if any"
-msgstr "Wyświetla informacje specyficzne dla architektury, jeśli są"
+msgstr "Wyświetla informacje dla konkretnej architektury, jeśli są"
-#: src/readelf.c:94
+#: src/readelf.c:122
msgid "Display sections for exception handling"
msgstr "Wyświetla sekcje do obsługi wyjątków"
-#: src/readelf.c:96
+#: src/readelf.c:124
msgid "Additional output selection:"
msgstr "Dodatkowy wybór wyjścia:"
-#: src/readelf.c:98
+#: src/readelf.c:126
+#, fuzzy
msgid ""
-"Display DWARF section content. SECTION can be one of abbrev, aranges, "
-"decodedaranges, frame, gdb_index, info, loc, line, decodedline, ranges, "
-"pubnames, str, macinfo, macro or exception"
+"Display DWARF section content. SECTION can be one of abbrev, addr, aranges, "
+"decodedaranges, frame, gdb_index, info, info+, loc, line, decodedline, "
+"ranges, pubnames, str, macinfo, macro or exception"
msgstr ""
-"Wyświetla zawartość sekcji DWARF. SEKCJA może być jednym z abbrev, aranges, "
+"Wyświetla zawartość sekcji DWARF. SEKCJA może być jednym z abbrev, aranges, "
"decodedaranges, frame, gdb_index, info, loc, line, decodedline, ranges, "
"pubnames, str, macinfo, macro lub exception"
-#: src/readelf.c:102
+#: src/readelf.c:130
msgid "Dump the uninterpreted contents of SECTION, by number or name"
msgstr "Zrzuca niezinterpretowaną zawartość SEKCJI, według liczny lub nazwy"
-#: src/readelf.c:104
+#: src/readelf.c:132
msgid "Print string contents of sections"
msgstr "Wyświetla zawartość ciągów sekcji"
-#: src/readelf.c:107
+#: src/readelf.c:135
msgid "Display the symbol index of an archive"
msgstr "Wyświetla indeks symboli archiwum"
-#: src/readelf.c:109
+#: src/readelf.c:137
msgid "Output control:"
msgstr "Kontrola wyjścia:"
-#: src/readelf.c:111
+#: src/readelf.c:139
msgid "Do not find symbol names for addresses in DWARF data"
-msgstr "Bez odnajdywania nazw symboli dla adresów w danych DWARF"
+msgstr "Bez odnajdywania nazw symboli dla adresów w danych DWARF"
-#: src/readelf.c:113
+#: src/readelf.c:141
msgid ""
"Display just offsets instead of resolving values to addresses in DWARF data"
msgstr ""
-"Wyświetla tylko offsety zamiast rozwiązywania wartości na adresy w danych "
+"Wyświetla tylko offsety zamiast rozwiązywania wartości na adresy w danych "
"DWARF"
-#: src/readelf.c:115
+#: src/readelf.c:143
msgid "Ignored for compatibility (lines always wide)"
msgstr "Ignorowane dla zgodności (wiersze są zawsze szerokie)"
-#: src/readelf.c:117
+#: src/readelf.c:145
msgid ""
"Show compression information for compressed sections (when used with -S); "
"decompress section before dumping data (when used with -p or -x)"
msgstr ""
-"Wyświetla informacje o kompresji dla skompresowanych sekcji (kiedy jest "
-"używane z opcją -S); dekompresuje sekcję przed zrzuceniem danych (kiedy jest "
-"używane z opcją -p lub -x)"
+"Wyświetla informacje o kompresji dla skompresowanych sekcji (kiedy jest "
+"używane z opcją -S); dekompresuje sekcję przed zrzuceniem danych (kiedy jest "
+"używane z opcją -p lub -x)"
-#: src/readelf.c:122
+#. Short description of program.
+#: src/readelf.c:150
msgid "Print information from ELF file in human-readable form."
-msgstr "Wyświetla informacje z pliku ELF w postaci czytelnej dla człowieka."
+msgstr "Wyświetla informacje z pliku ELF w postaci czytelnej dla człowieka."
-#: src/readelf.c:447
+#. Look up once.
+#: src/readelf.c:329
+msgid "yes"
+msgstr "tak"
+
+#: src/readelf.c:330
+msgid "no"
+msgstr "nie"
+
+#: src/readelf.c:519
#, c-format
msgid "Unknown DWARF debug section `%s'.\n"
msgstr "Nieznana sekcja debugowania DWARF „%s”.\n"
-#: src/readelf.c:529 src/readelf.c:640
+#: src/readelf.c:590 src/readelf.c:701
#, c-format
msgid "cannot generate Elf descriptor: %s"
msgstr "nie można utworzyć deskryptora ELF: %s"
-#: src/readelf.c:554 src/readelf.c:1145 src/readelf.c:1347
+#: src/readelf.c:597 src/readelf.c:925 src/strip.c:641
+#, c-format
+msgid "cannot determine number of sections: %s"
+msgstr "nie można określić liczby sekcji: %s"
+
+#: src/readelf.c:615 src/readelf.c:1218 src/readelf.c:1420
#, c-format
msgid "cannot get section: %s"
msgstr "nie można uzyskać sekcji: %s"
-#: src/readelf.c:563 src/readelf.c:1152 src/readelf.c:1355 src/readelf.c:9623
-#: src/unstrip.c:387 src/unstrip.c:418 src/unstrip.c:467 src/unstrip.c:577
-#: src/unstrip.c:594 src/unstrip.c:631 src/unstrip.c:829 src/unstrip.c:1118
-#: src/unstrip.c:1309 src/unstrip.c:1369 src/unstrip.c:1490 src/unstrip.c:1543
-#: src/unstrip.c:1658 src/unstrip.c:1796 src/unstrip.c:1891
+#: src/readelf.c:624 src/readelf.c:1225 src/readelf.c:1428 src/readelf.c:12423
+#: src/unstrip.c:375 src/unstrip.c:406 src/unstrip.c:455 src/unstrip.c:565
+#: src/unstrip.c:582 src/unstrip.c:619 src/unstrip.c:817 src/unstrip.c:1109
+#: src/unstrip.c:1301 src/unstrip.c:1362 src/unstrip.c:1535 src/unstrip.c:1650
+#: src/unstrip.c:1790 src/unstrip.c:1885
#, c-format
msgid "cannot get section header: %s"
msgstr "nie można uzyskać nagłówka sekcji: %s"
-#: src/readelf.c:571
+#: src/readelf.c:632
#, c-format
msgid "cannot get section name"
msgstr "nie można uzyskać nazwy sekcji"
-#: src/readelf.c:580 src/readelf.c:5504 src/readelf.c:7778 src/readelf.c:7880
-#: src/readelf.c:8057
+#: src/readelf.c:641 src/readelf.c:6517 src/readelf.c:10301 src/readelf.c:10403
+#: src/readelf.c:10580
#, c-format
msgid "cannot get %s content: %s"
msgstr "nie można uzyskać zwartości %s: %s"
-#: src/readelf.c:596
+#: src/readelf.c:657
#, c-format
msgid "cannot create temp file '%s'"
msgstr "nie można utworzyć pliku tymczasowego „%s”"
-#: src/readelf.c:605
+#: src/readelf.c:666
#, c-format
msgid "cannot write section data"
msgstr "nie można zapisać danych sekcji"
-#: src/readelf.c:611 src/readelf.c:628 src/readelf.c:657
+#: src/readelf.c:672 src/readelf.c:689 src/readelf.c:718
#, c-format
msgid "error while closing Elf descriptor: %s"
msgstr "błąd podczas zamykania deskryptora ELF: %s"
-#: src/readelf.c:618
+#: src/readelf.c:679
#, c-format
msgid "error while rewinding file descriptor"
msgstr "błąd podczas przewijania deskryptora pliku"
-#: src/readelf.c:652
+#: src/readelf.c:713
#, c-format
msgid "'%s' is not an archive, cannot print archive index"
msgstr "„%s” nie jest archiwum, nie można wyświetlić indeksu archiwum"
-#: src/readelf.c:751
-#, c-format
-msgid "No such section '%s' in '%s'"
-msgstr "Brak sekcji „%s” w „%s”"
-
-#: src/readelf.c:778
+#: src/readelf.c:817
#, c-format
msgid "cannot stat input file"
msgstr "nie można wykonać stat na pliku wejściowym"
-#: src/readelf.c:780
+#: src/readelf.c:819
#, c-format
msgid "input file is empty"
msgstr "plik wejściowy jest pusty"
-#: src/readelf.c:782
+#: src/readelf.c:821
#, c-format
msgid "failed reading '%s': %s"
msgstr "odczytanie „%s” się nie powiodło: %s"
-#: src/readelf.c:837
+#: src/readelf.c:850
+#, c-format
+msgid "No such section '%s' in '%s'"
+msgstr "Brak sekcji „%s” w „%s”"
+
+#: src/readelf.c:910
#, c-format
msgid "cannot read ELF header: %s"
msgstr "nie można odczytać nagłówka ELF: %s"
-#: src/readelf.c:845
+#: src/readelf.c:918
#, c-format
msgid "cannot create EBL handle"
msgstr "nie można utworzyć uchwytu EBL"
-#: src/readelf.c:858
+#: src/readelf.c:931
#, c-format
msgid "cannot determine number of program headers: %s"
msgstr "nie można określić liczby nagłówków programu: %s"
-#: src/readelf.c:948
+#: src/readelf.c:1021
msgid "NONE (None)"
msgstr "NONE (żaden)"
-#: src/readelf.c:949
+#: src/readelf.c:1022
msgid "REL (Relocatable file)"
msgstr "REL (plik relokowalny)"
-#: src/readelf.c:950
+#: src/readelf.c:1023
msgid "EXEC (Executable file)"
msgstr "EXEC (plik wykonywalny)"
-#: src/readelf.c:951
+#: src/readelf.c:1024
msgid "DYN (Shared object file)"
msgstr "DYN (plik obiektu współdzielonego)"
-#: src/readelf.c:952
+#: src/readelf.c:1025
msgid "CORE (Core file)"
msgstr "CORE (plik core)"
-#: src/readelf.c:957
+#: src/readelf.c:1030
#, c-format
msgid "OS Specific: (%x)\n"
msgstr "Zależny od systemu: (%x)\n"
-#: src/readelf.c:959
+#. && e_type <= ET_HIPROC always true
+#: src/readelf.c:1032
#, c-format
msgid "Processor Specific: (%x)\n"
msgstr "Zależny od procesora: (%x)\n"
-#: src/readelf.c:969
+#: src/readelf.c:1042
msgid ""
"ELF Header:\n"
" Magic: "
@@ -4647,7 +4115,7 @@
"Nagłówek ELF:\n"
" Magic: "
-#: src/readelf.c:973
+#: src/readelf.c:1046
#, c-format
msgid ""
"\n"
@@ -4656,117 +4124,118 @@
"\n"
" Klasa: %s\n"
-#: src/readelf.c:978
+#: src/readelf.c:1051
#, c-format
msgid " Data: %s\n"
msgstr " Dane: %s\n"
-#: src/readelf.c:984
+#: src/readelf.c:1057
#, c-format
msgid " Ident Version: %hhd %s\n"
msgstr " Wersja Ident: %hhd %s\n"
-#: src/readelf.c:986 src/readelf.c:1003
+#: src/readelf.c:1059 src/readelf.c:1076
msgid "(current)"
msgstr "(bieżąca)"
-#: src/readelf.c:990
+#: src/readelf.c:1063
#, c-format
msgid " OS/ABI: %s\n"
msgstr " System operacyjny/ABI: %s\n"
-#: src/readelf.c:993
+#: src/readelf.c:1066
#, c-format
msgid " ABI Version: %hhd\n"
msgstr " Wersja ABI: %hhd\n"
-#: src/readelf.c:996
+#: src/readelf.c:1069
msgid " Type: "
msgstr " Typ: "
-#: src/readelf.c:999
+#: src/readelf.c:1072
#, c-format
msgid " Machine: %s\n"
msgstr " Komputer: %s\n"
-#: src/readelf.c:1001
+#: src/readelf.c:1074
#, c-format
msgid " Version: %d %s\n"
msgstr " Wersja: %d %s\n"
-#: src/readelf.c:1005
+#: src/readelf.c:1078
#, c-format
msgid " Entry point address: %#<PRIx64>\n"
msgstr " Adres punktu wejściowego: %#<PRIx64>\n"
-#: src/readelf.c:1008
+#: src/readelf.c:1081
#, c-format
msgid " Start of program headers: %<PRId64> %s\n"
msgstr " Początek nagłówków programu: %<PRId64> %s\n"
-#: src/readelf.c:1009 src/readelf.c:1012
+#: src/readelf.c:1082 src/readelf.c:1085
msgid "(bytes into file)"
-msgstr "(bajtów w pliku)"
+msgstr "(bajtów w pliku)"
-#: src/readelf.c:1011
+#: src/readelf.c:1084
#, c-format
msgid " Start of section headers: %<PRId64> %s\n"
msgstr " Początek nagłówków sekcji: %<PRId64> %s\n"
-#: src/readelf.c:1014
+#: src/readelf.c:1087
#, c-format
msgid " Flags: %s\n"
msgstr " Flagi: %s\n"
-#: src/readelf.c:1017
+#: src/readelf.c:1090
#, c-format
msgid " Size of this header: %<PRId16> %s\n"
msgstr " Rozmiar tego nagłówka: %<PRId16> %s\n"
-#: src/readelf.c:1018 src/readelf.c:1021 src/readelf.c:1038
+#: src/readelf.c:1091 src/readelf.c:1094 src/readelf.c:1111
msgid "(bytes)"
msgstr "(bajtów)"
-#: src/readelf.c:1020
+#: src/readelf.c:1093
#, c-format
msgid " Size of program header entries: %<PRId16> %s\n"
msgstr " Rozmiar wpisów nagłówka programu: %<PRId16> %s\n"
-#: src/readelf.c:1023
+#: src/readelf.c:1096
#, c-format
msgid " Number of program headers entries: %<PRId16>"
msgstr " Liczba wpisów nagłówków programu: %<PRId16>"
-#: src/readelf.c:1030
+#: src/readelf.c:1103
#, c-format
msgid " (%<PRIu32> in [0].sh_info)"
-msgstr " (%<PRIu32> w [0].sh_info)"
+msgstr " (%<PRIu32> w [0].sh_info)"
-#: src/readelf.c:1033 src/readelf.c:1050 src/readelf.c:1064
+#: src/readelf.c:1106 src/readelf.c:1123 src/readelf.c:1137
msgid " ([0] not available)"
msgstr " ([0] niedostępny)"
-#: src/readelf.c:1037
+#: src/readelf.c:1110
#, c-format
msgid " Size of section header entries: %<PRId16> %s\n"
msgstr " Rozmiar wpisów nagłówka sekcji: %<PRId16> %s\n"
-#: src/readelf.c:1040
+#: src/readelf.c:1113
#, c-format
msgid " Number of section headers entries: %<PRId16>"
msgstr " Liczba wpisów nagłówków sekcji: %<PRId16>"
-#: src/readelf.c:1047
+#: src/readelf.c:1120
#, c-format
msgid " (%<PRIu32> in [0].sh_size)"
-msgstr " (%<PRIu32> w [0].sh_size)"
+msgstr " (%<PRIu32> w [0].sh_size)"
-#: src/readelf.c:1060
+#. We managed to get the zeroth section.
+#: src/readelf.c:1133
#, c-format
msgid " (%<PRIu32> in [0].sh_link)"
-msgstr " (%<PRIu32> w [0].sh_link)"
+msgstr " (%<PRIu32> w [0].sh_link)"
-#: src/readelf.c:1068
+#: src/readelf.c:1141
#, c-format
msgid ""
" Section header string table index: XINDEX%s\n"
@@ -4775,7 +4244,7 @@
" Indeks tabeli ciągów nagłówków sekcji: XINDEX%s\n"
"\n"
-#: src/readelf.c:1072
+#: src/readelf.c:1145
#, c-format
msgid ""
" Section header string table index: %<PRId16>\n"
@@ -4784,7 +4253,7 @@
" Indeks tabeli ciągów nagłówków sekcji: %<PRId16>\n"
"\n"
-#: src/readelf.c:1115
+#: src/readelf.c:1188
#, c-format
msgid ""
"There are %d section headers, starting at offset %#<PRIx64>:\n"
@@ -4793,11 +4262,11 @@
"Jest %d nagłówków sekcji, rozpoczynających się od offsetu %#<PRIx64>:\n"
"\n"
-#: src/readelf.c:1125
+#: src/readelf.c:1198
msgid "Section Headers:"
msgstr "Nagłówki sekcji:"
-#: src/readelf.c:1128
+#: src/readelf.c:1201
msgid ""
"[Nr] Name Type Addr Off Size ES Flags Lk "
"Inf Al"
@@ -4805,7 +4274,7 @@
"[Nr] Nazwa Typ Adres Offset Rozm. ES Flagi Lk "
"Inf Al"
-#: src/readelf.c:1130
+#: src/readelf.c:1203
msgid ""
"[Nr] Name Type Addr Off Size ES "
"Flags Lk Inf Al"
@@ -4813,36 +4282,36 @@
"[Nr] Nazwa Typ Adres Offset Rozmiar ES "
"Flagi Lk Inf Al"
-#: src/readelf.c:1135
+#: src/readelf.c:1208
msgid " [Compression Size Al]"
msgstr " [Kompresja Rozmiar Al]"
-#: src/readelf.c:1137
+#: src/readelf.c:1210
msgid " [Compression Size Al]"
msgstr " [Kompresja Rozmiar Al]"
-#: src/readelf.c:1213
+#: src/readelf.c:1286
#, c-format
msgid "bad compression header for section %zd: %s"
msgstr "błędny nagłówek kompresji dla sekcji %zd: %s"
-#: src/readelf.c:1224
+#: src/readelf.c:1297
#, c-format
msgid "bad gnu compressed size for section %zd: %s"
msgstr "błędny rozmiar kompresji gnu dla sekcji %zd: %s"
-#: src/readelf.c:1242
+#: src/readelf.c:1315
msgid "Program Headers:"
msgstr "Nagłówki programu:"
-#: src/readelf.c:1244
+#: src/readelf.c:1317
msgid ""
" Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align"
msgstr ""
" Typ Offset AdresWirt AdresFiz RozmPlik RozmPam Flg "
"Wyrównanie"
-#: src/readelf.c:1247
+#: src/readelf.c:1320
msgid ""
" Type Offset VirtAddr PhysAddr FileSiz "
"MemSiz Flg Align"
@@ -4850,12 +4319,12 @@
" Typ Offset AdresWirtualny AdresFizyczny RozmPlik "
"RozmPam Flg Wyrównanie"
-#: src/readelf.c:1304
+#: src/readelf.c:1377
#, c-format
msgid "\t[Requesting program interpreter: %s]\n"
msgstr "\t[Wywołanie interpretera programu: %s]\n"
-#: src/readelf.c:1325
+#: src/readelf.c:1398
msgid ""
"\n"
" Section to Segment mapping:\n"
@@ -4865,12 +4334,12 @@
" Mapowanie sekcji do segmentów:\n"
" Segment sekcji…"
-#: src/readelf.c:1336 src/unstrip.c:1950 src/unstrip.c:1992 src/unstrip.c:1999
+#: src/readelf.c:1409 src/unstrip.c:1944 src/unstrip.c:1986 src/unstrip.c:1993
#, c-format
msgid "cannot get program header: %s"
msgstr "nie można uzyskać nagłówka programu: %s"
-#: src/readelf.c:1479
+#: src/readelf.c:1552
#, c-format
msgid ""
"\n"
@@ -4880,15 +4349,15 @@
"COMDAT section group [%2zu] '%s' with signature '%s' contains %zu entries:\n"
msgstr[0] ""
"\n"
-"Grupa sekcji COMDAT [%2zu] „%s” z podpisem „%s” zawiera %zu wpis:\n"
+"Grupa sekcji COMDAT [%2zu] „%s” z podpisem „%s” zawiera %zu wpis:\n"
msgstr[1] ""
"\n"
-"Grupa sekcji COMDAT [%2zu] „%s” z podpisem „%s” zawiera %zu wpisy:\n"
+"Grupa sekcji COMDAT [%2zu] „%s” z podpisem „%s” zawiera %zu wpisy:\n"
msgstr[2] ""
"\n"
-"Grupa sekcji COMDAT [%2zu] „%s” z podpisem „%s” zawiera %zu wpisów:\n"
+"Grupa sekcji COMDAT [%2zu] „%s” z podpisem „%s” zawiera %zu wpisów:\n"
-#: src/readelf.c:1484
+#: src/readelf.c:1557
#, c-format
msgid ""
"\n"
@@ -4898,33 +4367,39 @@
"Section group [%2zu] '%s' with signature '%s' contains %zu entries:\n"
msgstr[0] ""
"\n"
-"Grupa sekcji [%2zu] „%s” z podpisem „%s” zawiera %zu wpis:\n"
+"Grupa sekcji [%2zu] „%s” z podpisem „%s” zawiera %zu wpis:\n"
msgstr[1] ""
"\n"
-"Grupa sekcji [%2zu] „%s” z podpisem „%s” zawiera %zu wpisy:\n"
+"Grupa sekcji [%2zu] „%s” z podpisem „%s” zawiera %zu wpisy:\n"
msgstr[2] ""
"\n"
-"Grupa sekcji [%2zu] „%s” z podpisem „%s” zawiera %zu wpisów:\n"
+"Grupa sekcji [%2zu] „%s” z podpisem „%s” zawiera %zu wpisów:\n"
-#: src/readelf.c:1492
+#: src/readelf.c:1565
msgid "<INVALID SYMBOL>"
msgstr "<NIEPRAWIDŁOWY SYMBOL>"
-#: src/readelf.c:1506
+#: src/readelf.c:1579
msgid "<INVALID SECTION>"
msgstr "<NIEPRAWIDŁOWY SEKCJA>"
-#: src/readelf.c:1529 src/readelf.c:2238 src/readelf.c:3317
+#: src/readelf.c:1602 src/readelf.c:2329 src/readelf.c:3430 src/readelf.c:12294
+#: src/readelf.c:12301 src/readelf.c:12345 src/readelf.c:12352
msgid "Couldn't uncompress section"
msgstr "Nie można dekompresować sekcji"
-#: src/readelf.c:1673 src/readelf.c:2306 src/readelf.c:2564 src/readelf.c:2640
-#: src/readelf.c:2944 src/readelf.c:3018 src/readelf.c:4716
+#: src/readelf.c:1607 src/readelf.c:2334 src/readelf.c:3435
+#, c-format
+msgid "cannot get section [%zd] header: %s"
+msgstr "nie można uzyskać nagłówka sekcji [%zd]: %s"
+
+#: src/readelf.c:1751 src/readelf.c:2401 src/readelf.c:2659 src/readelf.c:2735
+#: src/readelf.c:3039 src/readelf.c:3113 src/readelf.c:5308
#, c-format
msgid "invalid sh_link value in section %zu"
-msgstr "nieprawidłowa wartość sh_link w sekcji %zu"
+msgstr "nieprawidłowa wartość sh_link w sekcji %zu"
-#: src/readelf.c:1676
+#: src/readelf.c:1754
#, c-format
msgid ""
"\n"
@@ -4950,36 +4425,36 @@
" Adres: %#0*<PRIx64> Offset: %#08<PRIx64> Dowiązanie do sekcji: [%2u] "
"'%s'\n"
-#: src/readelf.c:1686
+#: src/readelf.c:1764
msgid " Type Value\n"
msgstr " Typ Wartość\n"
-#: src/readelf.c:1710
+#: src/readelf.c:1788
#, c-format
msgid "Shared library: [%s]\n"
msgstr "Biblioteka współdzielona: [%s]\n"
-#: src/readelf.c:1715
+#: src/readelf.c:1793
#, c-format
msgid "Library soname: [%s]\n"
msgstr "soname biblioteki: [%s]\n"
-#: src/readelf.c:1720
+#: src/readelf.c:1798
#, c-format
msgid "Library rpath: [%s]\n"
msgstr "rpath biblioteki: [%s]\n"
-#: src/readelf.c:1725
+#: src/readelf.c:1803
#, c-format
msgid "Library runpath: [%s]\n"
msgstr "runpath biblioteki: [%s]\n"
-#: src/readelf.c:1745
+#: src/readelf.c:1823
#, c-format
msgid "%<PRId64> (bytes)\n"
msgstr "%<PRId64> (bajtów)\n"
-#: src/readelf.c:1858 src/readelf.c:2048
+#: src/readelf.c:1936 src/readelf.c:2126
#, c-format
msgid ""
"\n"
@@ -4988,7 +4463,7 @@
"\n"
"Nieprawidłowa tabela symboli pod offsetem %#0<PRIx64>\n"
-#: src/readelf.c:1876 src/readelf.c:2066
+#: src/readelf.c:1954 src/readelf.c:2144
#, c-format
msgid ""
"\n"
@@ -5011,7 +4486,13 @@
"Sekcja relokacji [%2zu] „%s” dla sekcji [%2u] „%s” pod offsetem %#0<PRIx64> "
"zawiera %d wpisów:\n"
-#: src/readelf.c:1891 src/readelf.c:2081
+#. The .rel.dyn section does not refer to a specific section but
+#. instead of section index zero. Do not try to print a section
+#. name.
+#. The .rela.dyn section does not refer to a specific section but
+#. instead of section index zero. Do not try to print a section
+#. name.
+#: src/readelf.c:1969 src/readelf.c:2159
#, c-format
msgid ""
"\n"
@@ -5029,30 +4510,30 @@
"\n"
"Sekcja relokacji [%2u] „%s” pod offsetem %#0<PRIx64> zawiera %d wpisów:\n"
-#: src/readelf.c:1901
+#: src/readelf.c:1979
msgid " Offset Type Value Name\n"
msgstr " Offset Typ Wartość Nazwa\n"
-#: src/readelf.c:1903
+#: src/readelf.c:1981
msgid " Offset Type Value Name\n"
msgstr " Offset Typ Wartość Nazwa\n"
-#: src/readelf.c:1956 src/readelf.c:1967 src/readelf.c:1980 src/readelf.c:2001
-#: src/readelf.c:2013 src/readelf.c:2147 src/readelf.c:2159 src/readelf.c:2173
-#: src/readelf.c:2195 src/readelf.c:2208
+#: src/readelf.c:2034 src/readelf.c:2045 src/readelf.c:2058 src/readelf.c:2079
+#: src/readelf.c:2091 src/readelf.c:2225 src/readelf.c:2237 src/readelf.c:2251
+#: src/readelf.c:2273 src/readelf.c:2286
msgid "<INVALID RELOC>"
msgstr "<NIEPRAWIDŁOWA RELOKACJA>"
-#: src/readelf.c:2091
+#: src/readelf.c:2169
msgid " Offset Type Value Addend Name\n"
msgstr " Offset Typ Wartość Koniec Nazwa\n"
-#: src/readelf.c:2093
+#: src/readelf.c:2171
msgid " Offset Type Value Addend Name\n"
msgstr ""
" Offset Typ Wartość Koniec Nazwa\n"
-#: src/readelf.c:2314
+#: src/readelf.c:2409
#, c-format
msgid ""
"\n"
@@ -5070,7 +4551,7 @@
"\n"
"Tabela symboli [%2u] „%s” zawiera %u wpisów:\n"
-#: src/readelf.c:2319
+#: src/readelf.c:2414
#, c-format
msgid " %lu local symbol String table: [%2u] '%s'\n"
msgid_plural " %lu local symbols String table: [%2u] '%s'\n"
@@ -5078,33 +4559,33 @@
msgstr[1] " %lu symbole lokalne Tabela ciągów: [%2u] „%s”\n"
msgstr[2] " %lu symboli lokalnych Tabela ciągów: [%2u] „%s”\n"
-#: src/readelf.c:2327
+#: src/readelf.c:2422
msgid " Num: Value Size Type Bind Vis Ndx Name\n"
msgstr " Numer: Wartość Rozm Typ Bind Widoczność Ndx Nazwa\n"
-#: src/readelf.c:2329
+#: src/readelf.c:2424
msgid " Num: Value Size Type Bind Vis Ndx Name\n"
msgstr " Numer: Wartość Rozm Typ Bind Widoczność Ndx Nazwa\n"
-#: src/readelf.c:2349
+#: src/readelf.c:2444
#, c-format
msgid "%5u: %0*<PRIx64> %6<PRId64> %-7s %-6s %-9s %6s %s"
msgstr "%5u: %0*<PRIx64> %6<PRId64> %-7s %-6s %-9s %6s %s"
-#: src/readelf.c:2437
+#: src/readelf.c:2532
#, c-format
msgid "bad dynamic symbol"
msgstr "błędny symbol dynamiczny"
-#: src/readelf.c:2519
+#: src/readelf.c:2614
msgid "none"
msgstr "brak"
-#: src/readelf.c:2536
+#: src/readelf.c:2631
msgid "| <unknown>"
msgstr "| <nieznany>"
-#: src/readelf.c:2567
+#: src/readelf.c:2662
#, c-format
msgid ""
"\n"
@@ -5130,17 +4611,17 @@
" Adres: %#0*<PRIx64> Offset: %#08<PRIx64> Dowiązanie do sekcji: [%2u] "
"„%s”\n"
-#: src/readelf.c:2588
+#: src/readelf.c:2683
#, c-format
msgid " %#06x: Version: %hu File: %s Cnt: %hu\n"
msgstr " %#06x: Wersja: %hu Plik: %s Licznik: %hu\n"
-#: src/readelf.c:2601
+#: src/readelf.c:2696
#, c-format
msgid " %#06x: Name: %s Flags: %s Version: %hu\n"
msgstr " %#06x: Nazwa: %s Flagi: %s Wersja: %hu\n"
-#: src/readelf.c:2644
+#: src/readelf.c:2739
#, c-format
msgid ""
"\n"
@@ -5166,18 +4647,19 @@
" Adres: %#0*<PRIx64> Offset: %#08<PRIx64> Dowiązanie do sekcji: [%2u] "
"„%s”\n"
-#: src/readelf.c:2672
+#: src/readelf.c:2767
#, c-format
msgid " %#06x: Version: %hd Flags: %s Index: %hd Cnt: %hd Name: %s\n"
msgstr ""
" %#06x: Wersja: %hd Flagi: %s Indeks: %hd Licznik: %hd Nazwa: %s\n"
-#: src/readelf.c:2687
+#: src/readelf.c:2782
#, c-format
msgid " %#06x: Parent %d: %s\n"
msgstr " %#06x: Rodzic %d: %s\n"
-#: src/readelf.c:2948
+#. Print the header.
+#: src/readelf.c:3043
#, c-format
msgid ""
"\n"
@@ -5200,15 +4682,15 @@
"Sekcja symboli wersji [%2u] „%s” zawiera %d wpisów:\n"
" Adres: %#0*<PRIx64> Offset: %#08<PRIx64> Dowiązanie do sekcji: [%2u] „%s”"
-#: src/readelf.c:2976
+#: src/readelf.c:3071
msgid " 0 *local* "
msgstr " 0 *lokalny* "
-#: src/readelf.c:2981
+#: src/readelf.c:3076
msgid " 1 *global* "
msgstr " 1 *globalny* "
-#: src/readelf.c:3023
+#: src/readelf.c:3118
#, c-format
msgid ""
"\n"
@@ -5222,39 +4704,39 @@
" Addr: %#0*<PRIx64> Offset: %#08<PRIx64> Link to section: [%2u] '%s'\n"
msgstr[0] ""
"\n"
-"Histogram dla długości listy kubełków w sekcji [%2u] „%s” (w sumie %d "
+"Histogram dla długości listy kubełków w sekcji [%2u] „%s” (w sumie %d "
"kubełek):\n"
" Adres: %#0*<PRIx64> Offset: %#08<PRIx64> Dowiązanie do sekcji: [%2u] "
"„%s”\n"
msgstr[1] ""
"\n"
-"Histogram dla długości listy kubełków w sekcji [%2u] „%s” (w sumie %d "
+"Histogram dla długości listy kubełków w sekcji [%2u] „%s” (w sumie %d "
"kubełki):\n"
" Adres: %#0*<PRIx64> Offset: %#08<PRIx64> Dowiązanie do sekcji: [%2u] "
"„%s”\n"
msgstr[2] ""
"\n"
-"Histogram dla długości listy kubełków w sekcji [%2u] „%s” (w sumie %d "
+"Histogram dla długości listy kubełków w sekcji [%2u] „%s” (w sumie %d "
"kubełków):\n"
" Adres: %#0*<PRIx64> Offset: %#08<PRIx64> Dowiązanie do sekcji: [%2u] "
"„%s”\n"
-#: src/readelf.c:3045
+#: src/readelf.c:3140
#, no-c-format
msgid " Length Number % of total Coverage\n"
msgstr " Długość Liczba % całości Pokrycie\n"
-#: src/readelf.c:3047
+#: src/readelf.c:3142
#, c-format
msgid " 0 %6<PRIu32> %5.1f%%\n"
msgstr " 0 %6<PRIu32> %5.1f%%\n"
-#: src/readelf.c:3054
+#: src/readelf.c:3149
#, c-format
msgid "%7d %6<PRIu32> %5.1f%% %5.1f%%\n"
msgstr "%7d %6<PRIu32> %5.1f%% %5.1f%%\n"
-#: src/readelf.c:3067
+#: src/readelf.c:3162
#, c-format
msgid ""
" Average number of tests: successful lookup: %f\n"
@@ -5263,27 +4745,37 @@
" Średnia liczba testów: udane wyszukania: %f\n"
"\t\t\t nieudane wyszukania: %f\n"
-#: src/readelf.c:3085 src/readelf.c:3140 src/readelf.c:3197
+#: src/readelf.c:3180 src/readelf.c:3244 src/readelf.c:3310
#, c-format
msgid "cannot get data for section %d: %s"
msgstr "nie można uzyskać danych dla sekcji %d: %s"
-#: src/readelf.c:3093
+#: src/readelf.c:3188
#, c-format
msgid "invalid data in sysv.hash section %d"
-msgstr "nieprawidłowe dane w sekcji sysv.hash %d"
+msgstr "nieprawidłowe dane w sekcji sysv.hash %d"
-#: src/readelf.c:3148
+#: src/readelf.c:3217
+#, fuzzy, c-format
+msgid "invalid chain in sysv.hash section %d"
+msgstr "nieprawidłowe dane w sekcji sysv.hash %d"
+
+#: src/readelf.c:3252
#, c-format
msgid "invalid data in sysv.hash64 section %d"
-msgstr "nieprawidłowe dane w sekcji sysv.hash64 %d"
+msgstr "nieprawidłowe dane w sekcji sysv.hash64 %d"
-#: src/readelf.c:3206
+#: src/readelf.c:3283
+#, fuzzy, c-format
+msgid "invalid chain in sysv.hash64 section %d"
+msgstr "nieprawidłowe dane w sekcji sysv.hash64 %d"
+
+#: src/readelf.c:3319
#, c-format
msgid "invalid data in gnu.hash section %d"
-msgstr "nieprawidłowe dane w sekcji gnu.hash %d"
+msgstr "nieprawidłowe dane w sekcji gnu.hash %d"
-#: src/readelf.c:3273
+#: src/readelf.c:3386
#, c-format
msgid ""
" Symbol Bias: %u\n"
@@ -5293,7 +4785,7 @@
" Rozmiar maski bitowej: %zu bajtów %<PRIuFAST32>%% bitów ustawionych "
"drugie przesunięcie skrótu: %u\n"
-#: src/readelf.c:3358
+#: src/readelf.c:3475
#, c-format
msgid ""
"\n"
@@ -5314,7 +4806,7 @@
"Sekcja listy bibliotek [%2zu] „%s” pod offsetem %#0<PRIx64> zawiera %d "
"wpisów:\n"
-#: src/readelf.c:3372
+#: src/readelf.c:3489
msgid ""
" Library Time Stamp Checksum Version "
"Flags"
@@ -5322,7 +4814,7 @@
" Biblioteka Oznaczenie czasu Suma k. Wersja "
"Flagi"
-#: src/readelf.c:3422
+#: src/readelf.c:3539
#, c-format
msgid ""
"\n"
@@ -5333,140 +4825,102 @@
"Sekcja atrybutów obiektu [%2zu] „%s” %<PRIu64> bajtów pod offsetem "
"%#0<PRIx64>:\n"
-#: src/readelf.c:3439
+#: src/readelf.c:3556
msgid " Owner Size\n"
msgstr " Właściciel Rozmiar\n"
-#: src/readelf.c:3468
+#: src/readelf.c:3585
#, c-format
msgid " %-13s %4<PRIu32>\n"
msgstr " %-13s %4<PRIu32>\n"
-#: src/readelf.c:3507
+#. Unknown subsection, print and skip.
+#: src/readelf.c:3624
#, c-format
msgid " %-4u %12<PRIu32>\n"
msgstr " %-4u %12<PRIu32>\n"
-#: src/readelf.c:3512
+#. Tag_File
+#: src/readelf.c:3629
#, c-format
msgid " File: %11<PRIu32>\n"
msgstr " Plik: %11<PRIu32>\n"
-#: src/readelf.c:3561
+#: src/readelf.c:3678
#, c-format
msgid " %s: %<PRId64>, %s\n"
msgstr " %s: %<PRId64>, %s\n"
-#: src/readelf.c:3564
+#: src/readelf.c:3681
#, c-format
msgid " %s: %<PRId64>\n"
msgstr " %s: %<PRId64>\n"
-#: src/readelf.c:3567
+#: src/readelf.c:3684
#, c-format
msgid " %s: %s\n"
msgstr " %s: %s\n"
-#: src/readelf.c:3577
+#: src/readelf.c:3694
#, c-format
msgid " %u: %<PRId64>\n"
msgstr " %u: %<PRId64>\n"
-#: src/readelf.c:3580
+#: src/readelf.c:3697
#, c-format
msgid " %u: %s\n"
msgstr " %u: %s\n"
-#: src/readelf.c:3625
-#, c-format
-msgid "%s+%#<PRIx64> <%s+%#<PRIx64>>"
-msgstr "%s+%#<PRIx64> <%s+%#<PRIx64>>"
+#: src/readelf.c:3767
+#, fuzzy, c-format
+msgid "sprintf failure"
+msgstr "mprotect się nie powiodło"
-#: src/readelf.c:3628
-#, c-format
-msgid "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
-msgstr "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
-
-#: src/readelf.c:3633
-#, c-format
-msgid "%#<PRIx64> <%s+%#<PRIx64>>"
-msgstr "%#<PRIx64> <%s+%#<PRIx64>>"
-
-#: src/readelf.c:3636
-#, c-format
-msgid "%#0*<PRIx64> <%s+%#<PRIx64>>"
-msgstr "%#0*<PRIx64> <%s+%#<PRIx64>>"
-
-#: src/readelf.c:3642
-#, c-format
-msgid "%s+%#<PRIx64> <%s>"
-msgstr "%s+%#<PRIx64> <%s>"
-
-#: src/readelf.c:3645
-#, c-format
-msgid "%s+%#0*<PRIx64> <%s>"
-msgstr "%s+%#0*<PRIx64> <%s>"
-
-#: src/readelf.c:3649
-#, c-format
-msgid "%#<PRIx64> <%s>"
-msgstr "%#<PRIx64> <%s>"
-
-#: src/readelf.c:3652
-#, c-format
-msgid "%#0*<PRIx64> <%s>"
-msgstr "%#0*<PRIx64> <%s>"
-
-#: src/readelf.c:3657
-#, c-format
-msgid "%s+%#<PRIx64>"
-msgstr "%s+%#<PRIx64>"
-
-#: src/readelf.c:3660
-#, c-format
-msgid "%s+%#0*<PRIx64>"
-msgstr "%s+%#0*<PRIx64>"
-
-#: src/readelf.c:4038
+#: src/readelf.c:4249
msgid "empty block"
msgstr "pusty blok"
-#: src/readelf.c:4041
+#: src/readelf.c:4252
#, c-format
msgid "%zu byte block:"
msgstr "%zu bajtowy blok:"
-#: src/readelf.c:4438
-#, c-format
-msgid "%*s[%4<PRIuMAX>] %s <TRUNCATED>\n"
+#: src/readelf.c:4730
+#, fuzzy, c-format
+msgid "%*s[%2<PRIuMAX>] %s <TRUNCATED>\n"
msgstr "%*s[%4<PRIuMAX>] %s <SKRÓCONE>\n"
-#: src/readelf.c:4495
+#: src/readelf.c:4794
#, c-format
msgid "%s %#<PRIx64> used with different address sizes"
-msgstr "%s %#<PRIx64> zostało użyte z różnymi rozmiarami adresu"
+msgstr "%s %#<PRIx64> zostało użyte z różnymi rozmiarami adresu"
-#: src/readelf.c:4502
+#: src/readelf.c:4801
#, c-format
msgid "%s %#<PRIx64> used with different offset sizes"
-msgstr "%s %#<PRIx64> zostało użyte z różnymi rozmiarami offsetu"
+msgstr "%s %#<PRIx64> zostało użyte z różnymi rozmiarami offsetu"
-#: src/readelf.c:4509
+#: src/readelf.c:4808
#, c-format
msgid "%s %#<PRIx64> used with different base addresses"
-msgstr "%s %#<PRIx64> zostało użyte z różnymi adresami podstawowymi"
+msgstr "%s %#<PRIx64> zostało użyte z różnymi adresami podstawowymi"
-#: src/readelf.c:4598
+#: src/readelf.c:4815
+#, fuzzy, c-format
+msgid "%s %#<PRIx64> used with different attribute %s and %s"
+msgstr "%s %#<PRIx64> zostało użyte z różnymi rozmiarami adresu"
+
+#: src/readelf.c:4912
#, c-format
msgid " [%6tx] <UNUSED GARBAGE IN REST OF SECTION>\n"
-msgstr " [%6tx] <NIEUŻYWANE ŚMIECIE W RESZCIE SEKCJI>\n"
+msgstr " [%6tx] <NIEUŻYWANE ŚMIECIE W RESZCIE SEKCJI>\n"
-#: src/readelf.c:4606
+#: src/readelf.c:4920
#, c-format
msgid " [%6tx] <UNUSED GARBAGE> ... %<PRIu64> bytes ...\n"
msgstr " [%6tx] <NIEUŻYWANE ŚMIECIE>… %<PRIu64> bajtów…\n"
-#: src/readelf.c:4632
+#: src/readelf.c:4998
#, c-format
msgid ""
"\n"
@@ -5477,7 +4931,7 @@
"Sekcja DWARF [%2zu] „%s” pod offsetem %#<PRIx64>:\n"
" [ Kod]\n"
-#: src/readelf.c:4640
+#: src/readelf.c:5006
#, c-format
msgid ""
"\n"
@@ -5486,30 +4940,78 @@
"\n"
"Sekcja skrótów pod offsetem %<PRIu64>:\n"
-#: src/readelf.c:4653
+#: src/readelf.c:5019
#, c-format
msgid " *** error while reading abbreviation: %s\n"
msgstr " *** błąd podczas odczytywania skrótu: %s\n"
-#: src/readelf.c:4669
+#: src/readelf.c:5035
#, c-format
msgid " [%5u] offset: %<PRId64>, children: %s, tag: %s\n"
msgstr " [%5u] offset: %<PRId64>, potomek: %s, znacznik: %s\n"
-#: src/readelf.c:4672
-msgid "yes"
-msgstr "tak"
+#: src/readelf.c:5068 src/readelf.c:5377 src/readelf.c:5541 src/readelf.c:5926
+#: src/readelf.c:6527 src/readelf.c:8168 src/readelf.c:8838 src/readelf.c:9274
+#: src/readelf.c:9518 src/readelf.c:9683 src/readelf.c:10044
+#: src/readelf.c:10102
+#, c-format
+msgid ""
+"\n"
+"DWARF section [%2zu] '%s' at offset %#<PRIx64>:\n"
+msgstr ""
+"\n"
+"Sekcja DWARF [%2zu] „%s” pod offsetem %#<PRIx64>:\n"
-#: src/readelf.c:4672
-msgid "no"
-msgstr "nie"
+#: src/readelf.c:5081
+#, fuzzy, c-format
+msgid "cannot get .debug_addr section data: %s"
+msgstr "nie można uzyskać danych sekcji: %s"
-#: src/readelf.c:4706 src/readelf.c:4779
+#: src/readelf.c:5181 src/readelf.c:5205 src/readelf.c:5586 src/readelf.c:8883
+#, fuzzy, c-format
+msgid " Length: %8<PRIu64>\n"
+msgstr ""
+"\n"
+" Długość: %6<PRIu64>\n"
+
+#: src/readelf.c:5183 src/readelf.c:5220 src/readelf.c:5599 src/readelf.c:8896
+#, fuzzy, c-format
+msgid " DWARF version: %8<PRIu16>\n"
+msgstr " Wersja DWARF: %6<PRIuFAST16>\n"
+
+#: src/readelf.c:5184 src/readelf.c:5229 src/readelf.c:5608 src/readelf.c:8905
+#, fuzzy, c-format
+msgid " Address size: %8<PRIu64>\n"
+msgstr " Offset adresu: %6<PRIu64>\n"
+
+#: src/readelf.c:5186 src/readelf.c:5239 src/readelf.c:5618 src/readelf.c:8915
+#, fuzzy, c-format
+msgid " Segment size: %8<PRIu64>\n"
+msgstr ""
+" Rozmiar segmentu: %6<PRIu64>\n"
+"\n"
+
+#: src/readelf.c:5224 src/readelf.c:5603 src/readelf.c:8900 src/readelf.c:10234
+#, fuzzy, c-format
+msgid "Unknown version"
+msgstr "nieznana wersja"
+
+#: src/readelf.c:5234 src/readelf.c:5447 src/readelf.c:5613 src/readelf.c:8910
+#, c-format
+msgid "unsupported address size"
+msgstr "nieobsługiwany rozmiar adresu"
+
+#: src/readelf.c:5245 src/readelf.c:5456 src/readelf.c:5623 src/readelf.c:8920
+#, c-format
+msgid "unsupported segment size"
+msgstr "nieobsługiwany rozmiar segmentu"
+
+#: src/readelf.c:5298 src/readelf.c:5372
#, c-format
msgid "cannot get .debug_aranges content: %s"
msgstr "nie można uzyskać zawartości .debug_aranges: %s"
-#: src/readelf.c:4721
+#: src/readelf.c:5313
#, c-format
msgid ""
"\n"
@@ -5527,12 +5029,12 @@
"\n"
"Sekcja DWARF [%2zu] „%s” pod offsetem %#<PRIx64> zawiera %zu wpisów:\n"
-#: src/readelf.c:4752
+#: src/readelf.c:5344
#, c-format
msgid " [%*zu] ???\n"
msgstr " [%*zu] ???\n"
-#: src/readelf.c:4754
+#: src/readelf.c:5346
#, c-format
msgid ""
" [%*zu] start: %0#*<PRIx64>, length: %5<PRIu64>, CU DIE offset: %6<PRId64>\n"
@@ -5540,17 +5042,7 @@
" [%*zu] początek: %0#*<PRIx64>, długość: %5<PRIu64>, offset CU DIE: "
"%6<PRId64>\n"
-#: src/readelf.c:4784 src/readelf.c:4938 src/readelf.c:5514 src/readelf.c:6468
-#: src/readelf.c:7000 src/readelf.c:7120 src/readelf.c:7284 src/readelf.c:7709
-#, c-format
-msgid ""
-"\n"
-"DWARF section [%2zu] '%s' at offset %#<PRIx64>:\n"
-msgstr ""
-"\n"
-"Sekcja DWARF [%2zu] „%s” pod offsetem %#<PRIx64>:\n"
-
-#: src/readelf.c:4797 src/readelf.c:6494
+#: src/readelf.c:5390 src/readelf.c:8195
#, c-format
msgid ""
"\n"
@@ -5559,12 +5051,13 @@
"\n"
"Tabela pod offsetem %zu:\n"
-#: src/readelf.c:4801 src/readelf.c:5538 src/readelf.c:6505
+#: src/readelf.c:5394 src/readelf.c:5567 src/readelf.c:6551 src/readelf.c:8206
+#: src/readelf.c:8864
#, c-format
msgid "invalid data in section [%zu] '%s'"
-msgstr "nieprawidłowe dane w sekcji [%zu] „%s”"
+msgstr "nieprawidłowe dane w sekcji [%zu] „%s”"
-#: src/readelf.c:4817
+#: src/readelf.c:5410
#, c-format
msgid ""
"\n"
@@ -5573,32 +5066,27 @@
"\n"
" Długość: %6<PRIu64>\n"
-#: src/readelf.c:4829
+#: src/readelf.c:5422
#, c-format
msgid " DWARF version: %6<PRIuFAST16>\n"
msgstr " Wersja DWARF: %6<PRIuFAST16>\n"
-#: src/readelf.c:4833
+#: src/readelf.c:5426
#, c-format
msgid "unsupported aranges version"
msgstr "nieobsługiwana wersja aranges"
-#: src/readelf.c:4844
+#: src/readelf.c:5437
#, c-format
msgid " CU offset: %6<PRIx64>\n"
msgstr " Offset CU: %6<PRIx64>\n"
-#: src/readelf.c:4850
+#: src/readelf.c:5443
#, c-format
msgid " Address size: %6<PRIu64>\n"
msgstr " Offset adresu: %6<PRIu64>\n"
-#: src/readelf.c:4854
-#, c-format
-msgid "unsupported address size"
-msgstr "nieobsługiwany rozmiar adresu"
-
-#: src/readelf.c:4859
+#: src/readelf.c:5452
#, c-format
msgid ""
" Segment size: %6<PRIu64>\n"
@@ -5607,75 +5095,120 @@
" Rozmiar segmentu: %6<PRIu64>\n"
"\n"
-#: src/readelf.c:4863
-#, c-format
-msgid "unsupported segment size"
-msgstr "nieobsługiwany rozmiar segmentu"
-
-#: src/readelf.c:4903
-#, c-format
-msgid " %s..%s (%<PRIx64>)\n"
-msgstr " %s..%s (%<PRIx64>)\n"
-
-#: src/readelf.c:4906
-#, c-format
-msgid " %s..%s\n"
-msgstr " %s..%s\n"
-
-#: src/readelf.c:4915
+#: src/readelf.c:5507
#, c-format
msgid " %zu padding bytes\n"
msgstr " bajty wypełnienia: %zu\n"
-#: src/readelf.c:4933
+#: src/readelf.c:5550
+#, fuzzy, c-format
+msgid "cannot get .debug_rnglists content: %s"
+msgstr "nie można uzyskać zawartości .debug_ranges: %s"
+
+#: src/readelf.c:5573 src/readelf.c:8870
+#, fuzzy, c-format
+msgid ""
+"Table at Offset 0x%<PRIx64>:\n"
+"\n"
+msgstr " Offset .debug_line: 0x%<PRIx64>\n"
+
+#: src/readelf.c:5628 src/readelf.c:8925
+#, fuzzy, c-format
+msgid " Offset entries: %8<PRIu64>\n"
+msgstr " Długość offsetu: %<PRIu8>\n"
+
+#: src/readelf.c:5644 src/readelf.c:8941
+#, c-format
+msgid " Unknown CU base: "
+msgstr ""
+
+#: src/readelf.c:5646 src/readelf.c:8943
+#, c-format
+msgid " CU [%6<PRIx64>] base: "
+msgstr ""
+
+#: src/readelf.c:5652 src/readelf.c:8949
+#, c-format
+msgid " Not associated with a CU.\n"
+msgstr ""
+
+#: src/readelf.c:5663 src/readelf.c:8960
+#, c-format
+msgid "too many offset entries for unit length"
+msgstr ""
+
+#: src/readelf.c:5667 src/readelf.c:8964
+#, fuzzy, c-format
+msgid " Offsets starting at 0x%<PRIx64>:\n"
+msgstr " Offset: 0x%<PRIx64>\n"
+
+#: src/readelf.c:5719
+#, fuzzy, c-format
+msgid "invalid range list data"
+msgstr "nieprawidłowe dane"
+
+#: src/readelf.c:5904 src/readelf.c:9252
+#, fuzzy, c-format
+msgid ""
+" %zu padding bytes\n"
+"\n"
+msgstr " bajty wypełnienia: %zu\n"
+
+#: src/readelf.c:5921
#, c-format
msgid "cannot get .debug_ranges content: %s"
msgstr "nie można uzyskać zawartości .debug_ranges: %s"
-#: src/readelf.c:4963 src/readelf.c:7027
+#: src/readelf.c:5957 src/readelf.c:9307
+#, c-format
+msgid ""
+"\n"
+" Unknown CU base: "
+msgstr ""
+
+#: src/readelf.c:5959 src/readelf.c:9309
+#, c-format
+msgid ""
+"\n"
+" CU [%6<PRIx64>] base: "
+msgstr ""
+
+#: src/readelf.c:5968 src/readelf.c:9335 src/readelf.c:9361
#, c-format
msgid " [%6tx] <INVALID DATA>\n"
msgstr " [%6tx] <NIEPRAWIDŁOWE DANE>\n"
-#: src/readelf.c:4985 src/readelf.c:7049
-#, c-format
-msgid " [%6tx] base address %s\n"
+#: src/readelf.c:5989 src/readelf.c:9441
+#, fuzzy, c-format
+msgid ""
+" [%6tx] base address\n"
+" "
msgstr " [%6tx] adres podstawowy %s\n"
-#: src/readelf.c:4992 src/readelf.c:7056
-#, c-format
-msgid " [%6tx] empty list\n"
+#: src/readelf.c:5997 src/readelf.c:9449
+#, fuzzy, c-format
+msgid " [%6tx] empty list\n"
msgstr " [%6tx] pusta lista\n"
-#: src/readelf.c:5003
-#, c-format
-msgid " [%6tx] %s..%s\n"
-msgstr " [%6tx] %s…%s\n"
-
-#: src/readelf.c:5005
-#, c-format
-msgid " %s..%s\n"
-msgstr " %s…%s\n"
-
-#: src/readelf.c:5184
+#: src/readelf.c:6252
msgid " <INVALID DATA>\n"
msgstr " <NIEPRAWIDŁOWE DANE>\n"
-#: src/readelf.c:5493
+#: src/readelf.c:6505
#, c-format
msgid "cannot get ELF: %s"
msgstr "nie można uzyskać ELF: %s"
-#: src/readelf.c:5510
+#: src/readelf.c:6523
#, c-format
msgid ""
"\n"
"Call frame information section [%2zu] '%s' at offset %#<PRIx64>:\n"
msgstr ""
"\n"
-"Sekcja informacji o ramce wywołania [%2zu] „%s” pod offsetem %#<PRIx64>:\n"
+"Sekcja informacji o ramce wywołania [%2zu] „%s” pod offsetem %#<PRIx64>:\n"
-#: src/readelf.c:5560
+#: src/readelf.c:6573
#, c-format
msgid ""
"\n"
@@ -5684,50 +5217,65 @@
"\n"
" [%6tx] Zerowy koniec\n"
-#: src/readelf.c:5653 src/readelf.c:5808
+#: src/readelf.c:6666 src/readelf.c:6820
#, c-format
msgid "invalid augmentation length"
msgstr "nieprawidłowa długość powiększenia"
-#: src/readelf.c:5668
+#: src/readelf.c:6681
msgid "FDE address encoding: "
msgstr "Kodowanie adresu FDE: "
-#: src/readelf.c:5674
+#: src/readelf.c:6687
msgid "LSDA pointer encoding: "
msgstr "Kodowanie wskaźnika LSDA: "
-#: src/readelf.c:5785
+#: src/readelf.c:6797
#, c-format
msgid " (offset: %#<PRIx64>)"
msgstr " (offset: %#<PRIx64>)"
-#: src/readelf.c:5792
+#: src/readelf.c:6804
#, c-format
msgid " (end offset: %#<PRIx64>)"
msgstr " (kończący offset: %#<PRIx64>)"
-#: src/readelf.c:5829
+#: src/readelf.c:6841
#, c-format
msgid " %-26sLSDA pointer: %#<PRIx64>\n"
msgstr " %-26sWskaźnik LSDA: %#<PRIx64>\n"
-#: src/readelf.c:5884
-#, c-format
-msgid "cannot get attribute code: %s"
+#: src/readelf.c:6926
+#, fuzzy, c-format
+msgid "DIE [%<PRIx64>] cannot get attribute code: %s"
msgstr "nie można uzyskać kodu atrybutu: %s"
-#: src/readelf.c:5893
-#, c-format
-msgid "cannot get attribute form: %s"
+#: src/readelf.c:6936
+#, fuzzy, c-format
+msgid "DIE [%<PRIx64>] cannot get attribute form: %s"
msgstr "nie można uzyskać formy atrybutu: %s"
-#: src/readelf.c:5908
-#, c-format
-msgid "cannot get attribute value: %s"
+#: src/readelf.c:6958
+#, fuzzy, c-format
+msgid "DIE [%<PRIx64>] cannot get attribute '%s' (%s) value: %s"
msgstr "nie można uzyskać wartości atrybutu: %s"
-#: src/readelf.c:6207
+#: src/readelf.c:7291
+#, fuzzy, c-format
+msgid "invalid file (%<PRId64>): %s"
+msgstr "nieprawidłowy plik"
+
+#: src/readelf.c:7295
+#, fuzzy, c-format
+msgid "no srcfiles for CU [%<PRIx64>]"
+msgstr " ustawienie pliku na %<PRIu64>\n"
+
+#: src/readelf.c:7299
+#, fuzzy, c-format
+msgid "couldn't get DWARF CU: %s"
+msgstr "nie można uzyskać ELF: %s"
+
+#: src/readelf.c:7522
#, c-format
msgid ""
"\n"
@@ -5738,20 +5286,25 @@
"Sekcja DWARF [%2zu] „%s” pod offsetem %#<PRIx64>:\n"
" [Offset]\n"
-#: src/readelf.c:6239
-#, c-format
+#: src/readelf.c:7572
+#, fuzzy, c-format
+msgid "cannot get next unit: %s"
+msgstr "nie można uzyskać następnego DIE: %s"
+
+#: src/readelf.c:7591
+#, fuzzy, c-format
msgid ""
" Type unit at offset %<PRIu64>:\n"
" Version: %<PRIu16>, Abbreviation section offset: %<PRIu64>, Address size: "
"%<PRIu8>, Offset size: %<PRIu8>\n"
-" Type signature: %#<PRIx64>, Type offset: %#<PRIx64>\n"
+" Type signature: %#<PRIx64>, Type offset: %#<PRIx64> [%<PRIx64>]\n"
msgstr ""
" Jednostka typu pod offsetem %<PRIu64>:\n"
" Wersja: %<PRIu16>, offset sekcji skrótów: %<PRIu64>, rozmiar adresu: "
"%<PRIu8>, rozmiar offsetu: %<PRIu8>\n"
" Podpis typu: %#<PRIx64>, offset typu: %#<PRIx64>\n"
-#: src/readelf.c:6248
+#: src/readelf.c:7603
#, c-format
msgid ""
" Compilation unit at offset %<PRIu64>:\n"
@@ -5762,33 +5315,49 @@
" Wersja: %<PRIu16>, offset sekcji skrótów: %<PRIu64>, rozmiar adresu: "
"%<PRIu8>, rozmiar offsetu: %<PRIu8>\n"
-#: src/readelf.c:6273
+#: src/readelf.c:7613 src/readelf.c:7776
#, c-format
-msgid "cannot get DIE at offset %<PRIu64> in section '%s': %s"
-msgstr "nie można uzyskać DIE pod offsetem %<PRIu64> w sekcji „%s”: %s"
+msgid " Unit type: %s (%<PRIu8>)"
+msgstr ""
-#: src/readelf.c:6287
+#: src/readelf.c:7640
+#, c-format
+msgid "unknown version (%d) or unit type (%d)"
+msgstr ""
+
+#: src/readelf.c:7669
#, c-format
msgid "cannot get DIE offset: %s"
msgstr "nie można uzyskać offsetu DIE: %s"
-#: src/readelf.c:6296
-#, c-format
-msgid "cannot get tag of DIE at offset %<PRIu64> in section '%s': %s"
+#: src/readelf.c:7678
+#, fuzzy, c-format
+msgid "cannot get tag of DIE at offset [%<PRIx64>] in section '%s': %s"
msgstr ""
-"nie można uzyskać znacznika DIE pod offsetem %<PRIu64> w sekcji „%s”: %s"
+"nie można uzyskać znacznika DIE pod offsetem %<PRIu64> w sekcji „%s”: %s"
-#: src/readelf.c:6328
+#: src/readelf.c:7716
#, c-format
msgid "cannot get next DIE: %s\n"
msgstr "nie można uzyskać następnego DIE: %s\n"
-#: src/readelf.c:6336
+#: src/readelf.c:7724
#, c-format
msgid "cannot get next DIE: %s"
msgstr "nie można uzyskać następnego DIE: %s"
-#: src/readelf.c:6372
+#: src/readelf.c:7768
+#, fuzzy, c-format
+msgid ""
+" Split compilation unit at offset %<PRIu64>:\n"
+" Version: %<PRIu16>, Abbreviation section offset: %<PRIu64>, Address size: "
+"%<PRIu8>, Offset size: %<PRIu8>\n"
+msgstr ""
+" Jednostka kompilacji pod offsetem %<PRIu64>:\n"
+" Wersja: %<PRIu16>, offset sekcji skrótów: %<PRIu64>, rozmiar adresu: "
+"%<PRIu8>, rozmiar offsetu: %<PRIu8>\n"
+
+#: src/readelf.c:7819
#, c-format
msgid ""
"\n"
@@ -5799,24 +5368,32 @@
"Sekcja DWARF [%2zu] „%s” pod offsetem %#<PRIx64>:\n"
"\n"
-#: src/readelf.c:6481
+#: src/readelf.c:8151
+#, fuzzy, c-format
+msgid "unknown form: %s"
+msgstr "nieznany błąd"
+
+#: src/readelf.c:8182
#, c-format
msgid "cannot get line data section data: %s"
msgstr "nie można uzyskać danych sekcji danych wiersza: %s"
-#: src/readelf.c:6551
-#, c-format
+#. Print what we got so far.
+#: src/readelf.c:8284
+#, fuzzy, c-format
msgid ""
"\n"
-" Length: %<PRIu64>\n"
-" DWARF version: %<PRIuFAST16>\n"
-" Prologue length: %<PRIu64>\n"
-" Minimum instruction length: %<PRIuFAST8>\n"
-" Maximum operations per instruction: %<PRIuFAST8>\n"
-" Initial value if '%s': %<PRIuFAST8>\n"
-" Line base: %<PRIdFAST8>\n"
-" Line range: %<PRIuFAST8>\n"
-" Opcode base: %<PRIuFAST8>\n"
+" Length: %<PRIu64>\n"
+" DWARF version: %<PRIuFAST16>\n"
+" Prologue length: %<PRIu64>\n"
+" Address size: %zd\n"
+" Segment selector size: %zd\n"
+" Min instruction length: %<PRIuFAST8>\n"
+" Max operations per instruction: %<PRIuFAST8>\n"
+" Initial value if 'is_stmt': %<PRIuFAST8>\n"
+" Line base: %<PRIdFAST8>\n"
+" Line range: %<PRIuFAST8>\n"
+" Opcode base: %<PRIuFAST8>\n"
"\n"
"Opcodes:\n"
msgstr ""
@@ -5833,12 +5410,27 @@
"\n"
"Instrukcje:\n"
-#: src/readelf.c:6572
+#: src/readelf.c:8306
+#, fuzzy, c-format
+msgid "cannot handle .debug_line version: %u\n"
+msgstr "nie można uzyskać wersji symbolu: %s"
+
+#: src/readelf.c:8314
+#, fuzzy, c-format
+msgid "cannot handle address size: %u\n"
+msgstr "nieobsługiwany rozmiar adresu"
+
+#: src/readelf.c:8322
+#, fuzzy, c-format
+msgid "cannot handle segment selector size: %u\n"
+msgstr "nie można uzyskać sekcji: %s"
+
+#: src/readelf.c:8332
#, c-format
msgid "invalid data at offset %tu in section [%zu] '%s'"
-msgstr "nieprawidłowe dane pod offsetem %tu w sekcji [%zu] „%s”"
+msgstr "nieprawidłowe dane pod offsetem %tu w sekcji [%zu] „%s”"
-#: src/readelf.c:6587
+#: src/readelf.c:8347
#, c-format
msgid " [%*<PRIuFAST8>] %hhu argument\n"
msgid_plural " [%*<PRIuFAST8>] %hhu arguments\n"
@@ -5846,7 +5438,7 @@
msgstr[1] " [%*<PRIuFAST8>] %hhu parametry\n"
msgstr[2] " [%*<PRIuFAST8>] %hhu parametrów\n"
-#: src/readelf.c:6595
+#: src/readelf.c:8358
msgid ""
"\n"
"Directory table:"
@@ -5854,17 +5446,29 @@
"\n"
"Tabela katalogu:"
-#: src/readelf.c:6611
+#: src/readelf.c:8364 src/readelf.c:8439
+#, fuzzy, c-format
+msgid " ["
+msgstr " PC: "
+
+#: src/readelf.c:8433
+#, fuzzy
msgid ""
"\n"
-"File name table:\n"
-" Entry Dir Time Size Name"
+"File name table:"
+msgstr ""
+"\n"
+" Tabela strony wywołania:"
+
+#: src/readelf.c:8494
+#, fuzzy
+msgid " Entry Dir Time Size Name"
msgstr ""
"\n"
"Tabela nazw plików:\n"
" Wpis Kat Czas Rozmiar Nazwa"
-#: src/readelf.c:6646
+#: src/readelf.c:8529
msgid ""
"\n"
"Line number statements:"
@@ -5872,221 +5476,224 @@
"\n"
"Instrukcje numerów wierszy:"
-#: src/readelf.c:6697
+#: src/readelf.c:8552
#, c-format
msgid "invalid maximum operations per instruction is zero"
msgstr "nieprawidłowe maksimum operacji na instrukcję wynosi zero"
-#: src/readelf.c:6733
-#, c-format
-msgid " special opcode %u: address+%u = %s, op_index = %u, line%+d = %zu\n"
+#: src/readelf.c:8586
+#, fuzzy, c-format
+msgid " special opcode %u: address+%u = "
+msgstr " instrukcja specjalna %u: adres+%u = %s, wiersz%+d = %zu\n"
+
+#: src/readelf.c:8590
+#, fuzzy, c-format
+msgid ", op_index = %u, line%+d = %zu\n"
msgstr ""
" instrukcja specjalna %u: adres+%u = %s, op_index = %u, wiersz%+d = %zu\n"
-#: src/readelf.c:6738
+#: src/readelf.c:8593
#, c-format
-msgid " special opcode %u: address+%u = %s, line%+d = %zu\n"
-msgstr " instrukcja specjalna %u: adres+%u = %s, wiersz%+d = %zu\n"
+msgid ", line%+d = %zu\n"
+msgstr ""
-#: src/readelf.c:6758
+#: src/readelf.c:8611
#, c-format
msgid " extended opcode %u: "
msgstr " instrukcja rozszerzona %u: "
-#: src/readelf.c:6763
+#: src/readelf.c:8616
msgid " end of sequence"
msgstr " koniec sekwencji"
-#: src/readelf.c:6782
-#, c-format
-msgid " set address to %s\n"
+#: src/readelf.c:8634
+#, fuzzy, c-format
+msgid " set address to "
msgstr " ustawienie adresu na %s\n"
-#: src/readelf.c:6809
+#: src/readelf.c:8662
#, c-format
msgid " define new file: dir=%u, mtime=%<PRIu64>, length=%<PRIu64>, name=%s\n"
msgstr ""
" definicja nowego pliku: dir=%u, mtime=%<PRIu64>, długość=%<PRIu64>, nazwa="
"%s\n"
-#: src/readelf.c:6822
+#: src/readelf.c:8675
#, c-format
msgid " set discriminator to %u\n"
msgstr " ustawienie dyskryminatora na %u\n"
-#: src/readelf.c:6827
+#. Unknown, ignore it.
+#: src/readelf.c:8680
msgid " unknown opcode"
msgstr " nieznana instrukcja"
-#: src/readelf.c:6839
+#. Takes no argument.
+#: src/readelf.c:8692
msgid " copy"
msgstr " kopiowanie"
-#: src/readelf.c:6850
-#, c-format
-msgid " advance address by %u to %s, op_index to %u\n"
-msgstr " zwiększenie adresu o %u do %s, op_index do %u\n"
+#: src/readelf.c:8701
+#, fuzzy, c-format
+msgid " advance address by %u to "
+msgstr " zwiększenie adresu o %u do %s\n"
-#: src/readelf.c:6854
+#: src/readelf.c:8705 src/readelf.c:8761
#, c-format
-msgid " advance address by %u to %s\n"
-msgstr " zwiększenie adresu o %u do %s\n"
+msgid ", op_index to %u"
+msgstr ""
-#: src/readelf.c:6865
+#: src/readelf.c:8715
#, c-format
msgid " advance line by constant %d to %<PRId64>\n"
-msgstr " zwiększenie wiersza o stałą %d do %<PRId64>\n"
+msgstr " zwiększenie wiersza o stałą %d do %<PRId64>\n"
-#: src/readelf.c:6873
+#: src/readelf.c:8723
#, c-format
msgid " set file to %<PRIu64>\n"
msgstr " ustawienie pliku na %<PRIu64>\n"
-#: src/readelf.c:6883
+#: src/readelf.c:8733
#, c-format
msgid " set column to %<PRIu64>\n"
msgstr " ustawienie kolumny na %<PRIu64>\n"
-#: src/readelf.c:6890
+#: src/readelf.c:8740
#, c-format
msgid " set '%s' to %<PRIuFAST8>\n"
msgstr " ustawienie „%s” na %<PRIuFAST8>\n"
-#: src/readelf.c:6896
+#. Takes no argument.
+#: src/readelf.c:8746
msgid " set basic block flag"
msgstr " ustawienie podstawowej flagi bloku"
-#: src/readelf.c:6909
-#, c-format
-msgid " advance address by constant %u to %s, op_index to %u\n"
-msgstr " zwiększenie adresu o stałą %u do %s, op_index do %u\n"
+#: src/readelf.c:8757
+#, fuzzy, c-format
+msgid " advance address by constant %u to "
+msgstr " zwiększenie adresu o stałą %u do %s\n"
-#: src/readelf.c:6913
-#, c-format
-msgid " advance address by constant %u to %s\n"
-msgstr " zwiększenie adresu o stałą %u do %s\n"
+#: src/readelf.c:8776
+#, fuzzy, c-format
+msgid " advance address by fixed value %u to \n"
+msgstr " zwiększenie adresu o stałą wartość %u do %s\n"
-#: src/readelf.c:6931
-#, c-format
-msgid " advance address by fixed value %u to %s\n"
-msgstr " zwiększenie adresu o stałą wartość %u do %s\n"
-
-#: src/readelf.c:6940
+#. Takes no argument.
+#: src/readelf.c:8786
msgid " set prologue end flag"
msgstr " ustawienie flagi końca prologu"
-#: src/readelf.c:6945
+#. Takes no argument.
+#: src/readelf.c:8791
msgid " set epilogue begin flag"
msgstr " ustawienie flagi początku epilogu"
-#: src/readelf.c:6954
+#: src/readelf.c:8800
#, c-format
msgid " set isa to %u\n"
msgstr " ustawienie isa na %u\n"
-#: src/readelf.c:6963
+#. This is a new opcode the generator but not we know about.
+#. Read the parameters associated with it but then discard
+#. everything. Read all the parameters for this opcode.
+#: src/readelf.c:8809
#, c-format
msgid " unknown opcode with %<PRIu8> parameter:"
msgid_plural " unknown opcode with %<PRIu8> parameters:"
-msgstr[0] " nieznana instrukcja z %<PRIu8> parametrem:"
-msgstr[1] " nieznana instrukcja z %<PRIu8> parametrami:"
-msgstr[2] " nieznana instrukcja z %<PRIu8> parametrami:"
+msgstr[0] " nieznana instrukcja z %<PRIu8> parametrem:"
+msgstr[1] " nieznana instrukcja z %<PRIu8> parametrami:"
+msgstr[2] " nieznana instrukcja z %<PRIu8> parametrami:"
-#: src/readelf.c:6995
+#: src/readelf.c:8847
+#, fuzzy, c-format
+msgid "cannot get .debug_loclists content: %s"
+msgstr "nie można uzyskać zawartości .debug_log: %s"
+
+#: src/readelf.c:9016
+#, fuzzy, c-format
+msgid "invalid loclists data"
+msgstr "nieprawidłowe dane"
+
+#: src/readelf.c:9269
#, c-format
msgid "cannot get .debug_loc content: %s"
msgstr "nie można uzyskać zawartości .debug_log: %s"
-#: src/readelf.c:7070
-#, c-format
-msgid " [%6tx] %s..%s"
-msgstr " [%6tx] %s…%s"
-
-#: src/readelf.c:7072
-#, c-format
-msgid " %s..%s"
-msgstr " %s…%s"
-
-#: src/readelf.c:7079 src/readelf.c:7967
+#: src/readelf.c:9476 src/readelf.c:10490
msgid " <INVALID DATA>\n"
msgstr " <NIEPRAWIDŁOWE DANE>\n"
-#: src/readelf.c:7131 src/readelf.c:7293
+#: src/readelf.c:9530 src/readelf.c:9693
#, c-format
msgid "cannot get macro information section data: %s"
-msgstr "nie można uzyskać danych sekcji informacji o makrach: %s"
+msgstr "nie można uzyskać danych sekcji informacji o makrach: %s"
-#: src/readelf.c:7211
+#: src/readelf.c:9610
#, c-format
msgid "%*s*** non-terminated string at end of section"
msgstr "%*s*** niezakończony ciąg na końcu sekcji"
-#: src/readelf.c:7234
+#: src/readelf.c:9633
#, c-format
msgid "%*s*** missing DW_MACINFO_start_file argument at end of section"
msgstr "%*s*** brak parametru DW_MACINFO_start_file na końcu sekcji"
-#: src/readelf.c:7334
+#: src/readelf.c:9734
#, c-format
msgid " Offset: 0x%<PRIx64>\n"
msgstr " Offset: 0x%<PRIx64>\n"
-#: src/readelf.c:7346
+#: src/readelf.c:9746
#, c-format
msgid " Version: %<PRIu16>\n"
msgstr " Wersja: %<PRIu16>\n"
-#: src/readelf.c:7352 src/readelf.c:8086
+#: src/readelf.c:9752 src/readelf.c:10609
#, c-format
msgid " unknown version, cannot parse section\n"
msgstr " nieznana wersja, nie można przetworzyć sekcji\n"
-#: src/readelf.c:7359
+#: src/readelf.c:9759
#, c-format
msgid " Flag: 0x%<PRIx8>\n"
msgstr " Flaga: 0x%<PRIx8>\n"
-#: src/readelf.c:7362
+#: src/readelf.c:9762
#, c-format
msgid " Offset length: %<PRIu8>\n"
msgstr " Długość offsetu: %<PRIu8>\n"
-#: src/readelf.c:7370
+#: src/readelf.c:9770
#, c-format
msgid " .debug_line offset: 0x%<PRIx64>\n"
msgstr " Offset .debug_line: 0x%<PRIx64>\n"
-#: src/readelf.c:7383
+#: src/readelf.c:9795
#, c-format
msgid " extension opcode table, %<PRIu8> items:\n"
-msgstr " tablica instrukcji rozszerzenia, %<PRIu8> elementów:\n"
+msgstr " tabela instrukcji rozszerzenia, %<PRIu8> elementów:\n"
-#: src/readelf.c:7390
+#: src/readelf.c:9802
#, c-format
msgid " [%<PRIx8>]"
msgstr " [%<PRIx8>]"
-#: src/readelf.c:7402
+#: src/readelf.c:9814
#, c-format
msgid " %<PRIu8> arguments:"
msgstr " Parametry %<PRIu8>:"
-#: src/readelf.c:7430
+#: src/readelf.c:9829
#, c-format
msgid " no arguments."
msgstr " brak parametrów."
-#: src/readelf.c:7667
-#, c-format
-msgid "vendor opcode not verified?"
-msgstr "instrukcja producenta nie została sprawdzona?"
-
-#: src/readelf.c:7695
+#: src/readelf.c:10030
#, c-format
msgid " [%5d] DIE offset: %6<PRId64>, CU DIE offset: %6<PRId64>, name: %s\n"
msgstr " [%5d] offset DIE: %6<PRId64>, offset CU DIE: %6<PRId64>, nazwa: %s\n"
-#: src/readelf.c:7736
+#: src/readelf.c:10072
#, c-format
msgid ""
"\n"
@@ -6097,12 +5704,41 @@
"Sekcja DWARF [%2zu] „%s” pod offsetem %#<PRIx64>:\n"
" %*s Ciąg\n"
-#: src/readelf.c:7750
-#, c-format
-msgid " *** error while reading strings: %s\n"
+#: src/readelf.c:10087
+#, fuzzy, c-format
+msgid " *** error, missing string terminator\n"
msgstr " *** błąd podczas odczytywania ciągów: %s\n"
-#: src/readelf.c:7770
+#: src/readelf.c:10115
+#, fuzzy, c-format
+msgid "cannot get .debug_str_offsets section data: %s"
+msgstr "nie można uzyskać danych sekcji: %s"
+
+#: src/readelf.c:10214
+#, fuzzy, c-format
+msgid " Length: %8<PRIu64>\n"
+msgstr ""
+"\n"
+" Długość: %6<PRIu64>\n"
+
+#: src/readelf.c:10216
+#, fuzzy, c-format
+msgid " Offset size: %8<PRIu8>\n"
+msgstr " Długość offsetu: %<PRIu8>\n"
+
+#: src/readelf.c:10230
+#, fuzzy, c-format
+msgid " DWARF version: %8<PRIu16>\n"
+msgstr " Wersja DWARF: %6<PRIuFAST16>\n"
+
+#: src/readelf.c:10239
+#, fuzzy, c-format
+msgid " Padding: %8<PRIx16>\n"
+msgstr ""
+"\n"
+" Długość: %6<PRIu64>\n"
+
+#: src/readelf.c:10293
#, c-format
msgid ""
"\n"
@@ -6111,7 +5747,7 @@
"\n"
"Sekcja tabeli wyszukiwania ramki wywołania [%2zu] „.eh_frame_hdr”:\n"
-#: src/readelf.c:7872
+#: src/readelf.c:10395
#, c-format
msgid ""
"\n"
@@ -6120,22 +5756,22 @@
"\n"
"Sekcja tabeli obsługiwania wyjątków [%2zu] „.gcc_except_table”:\n"
-#: src/readelf.c:7895
+#: src/readelf.c:10418
#, c-format
msgid " LPStart encoding: %#x "
msgstr " Kodowanie LPStart: %#x "
-#: src/readelf.c:7907
+#: src/readelf.c:10430
#, c-format
msgid " TType encoding: %#x "
msgstr " Kodowanie TType: %#x "
-#: src/readelf.c:7922
+#: src/readelf.c:10445
#, c-format
msgid " Call site encoding: %#x "
msgstr " Kodowanie strony wywołania: %#x "
-#: src/readelf.c:7935
+#: src/readelf.c:10458
msgid ""
"\n"
" Call site table:"
@@ -6143,7 +5779,7 @@
"\n"
" Tabela strony wywołania:"
-#: src/readelf.c:7949
+#: src/readelf.c:10472
#, c-format
msgid ""
" [%4u] Call site start: %#<PRIx64>\n"
@@ -6156,12 +5792,12 @@
" Lądowisko: %#<PRIx64>\n"
" Działanie: %u\n"
-#: src/readelf.c:8022
+#: src/readelf.c:10545
#, c-format
msgid "invalid TType encoding"
msgstr "nieprawidłowe kodowanie TType"
-#: src/readelf.c:8048
+#: src/readelf.c:10571
#, c-format
msgid ""
"\n"
@@ -6170,37 +5806,37 @@
"\n"
"Sekcja GDB [%2zu] „%s” pod offsetem %#<PRIx64> zawiera %<PRId64> bajtów:\n"
-#: src/readelf.c:8077
+#: src/readelf.c:10600
#, c-format
msgid " Version: %<PRId32>\n"
msgstr " Wersja: %<PRId32>\n"
-#: src/readelf.c:8095
+#: src/readelf.c:10618
#, c-format
msgid " CU offset: %#<PRIx32>\n"
msgstr " offset CU: %#<PRIx32>\n"
-#: src/readelf.c:8102
+#: src/readelf.c:10625
#, c-format
msgid " TU offset: %#<PRIx32>\n"
msgstr " offset TU: %#<PRIx32>\n"
-#: src/readelf.c:8109
+#: src/readelf.c:10632
#, c-format
msgid " address offset: %#<PRIx32>\n"
msgstr " offset adresu: %#<PRIx32>\n"
-#: src/readelf.c:8116
+#: src/readelf.c:10639
#, c-format
msgid " symbol offset: %#<PRIx32>\n"
msgstr " offset symbolu: %#<PRIx32>\n"
-#: src/readelf.c:8123
+#: src/readelf.c:10646
#, c-format
msgid " constant offset: %#<PRIx32>\n"
msgstr " offset stałej: %#<PRIx32>\n"
-#: src/readelf.c:8137
+#: src/readelf.c:10660
#, c-format
msgid ""
"\n"
@@ -6209,7 +5845,7 @@
"\n"
" Lista CU pod offsetem %#<PRIx32> zawiera %zu wpisów:\n"
-#: src/readelf.c:8162
+#: src/readelf.c:10685
#, c-format
msgid ""
"\n"
@@ -6218,7 +5854,7 @@
"\n"
" Lista TU pod offsetem %#<PRIx32> zawiera %zu wpisów:\n"
-#: src/readelf.c:8191
+#: src/readelf.c:10714
#, c-format
msgid ""
"\n"
@@ -6227,7 +5863,7 @@
"\n"
" Lista adresów pod offsetem %#<PRIx32> zawiera %zu wpisów:\n"
-#: src/readelf.c:8224
+#: src/readelf.c:10746
#, c-format
msgid ""
"\n"
@@ -6236,17 +5872,18 @@
"\n"
" Tabela symboli pod offsetem %#<PRIx32> zawiera %zu gniazd:\n"
-#: src/readelf.c:8311
+#: src/readelf.c:10884
#, c-format
msgid "cannot get debug context descriptor: %s"
msgstr "nie można uzyskać deskryptora kontekstu debugowania: %s"
-#: src/readelf.c:8467 src/readelf.c:9089 src/readelf.c:9200 src/readelf.c:9258
+#: src/readelf.c:11247 src/readelf.c:11869 src/readelf.c:11980
+#: src/readelf.c:12038
#, c-format
msgid "cannot convert core note data: %s"
msgstr "nie można konwertować danych notatki core: %s"
-#: src/readelf.c:8830
+#: src/readelf.c:11610
#, c-format
msgid ""
"\n"
@@ -6255,54 +5892,54 @@
"\n"
"%*s… <powtarza się jeszcze %u razy>…"
-#: src/readelf.c:9337
+#: src/readelf.c:12117
msgid " Owner Data size Type\n"
msgstr " Właściciel Rozmiar danych Typ\n"
-#: src/readelf.c:9355
+#: src/readelf.c:12135
#, c-format
msgid " %-13.*s %9<PRId32> %s\n"
msgstr " %-13.*s %9<PRId32> %s\n"
-#: src/readelf.c:9405
-#, c-format
-msgid "cannot get content of note section: %s"
+#: src/readelf.c:12185
+#, fuzzy, c-format
+msgid "cannot get content of note: %s"
msgstr "nie można uzyskać zawartości sekcji notatki: %s"
-#: src/readelf.c:9432
+#: src/readelf.c:12212
#, c-format
msgid ""
"\n"
"Note section [%2zu] '%s' of %<PRIu64> bytes at offset %#0<PRIx64>:\n"
msgstr ""
"\n"
-"Segment notatki [%2zu] „%s” o długości %<PRIu64> bajtów pod offsetem "
+"Segment notatki [%2zu] „%s” o długości %<PRIu64> bajtów pod offsetem "
"%#0<PRIx64>:\n"
-#: src/readelf.c:9455
+#: src/readelf.c:12235
#, c-format
msgid ""
"\n"
"Note segment of %<PRIu64> bytes at offset %#0<PRIx64>:\n"
msgstr ""
"\n"
-"Segment notatki o długości %<PRIu64> bajtów pod offsetem %#0<PRIx64>:\n"
+"Segment notatki o długości %<PRIu64> bajtów pod offsetem %#0<PRIx64>:\n"
-#: src/readelf.c:9501
+#: src/readelf.c:12281
#, c-format
msgid ""
"\n"
"Section [%zu] '%s' has no data to dump.\n"
msgstr ""
"\n"
-"Sekcja [%zu] „%s” nie posiada danych do zrzucenia.\n"
+"Sekcja [%zu] „%s” nie ma danych do zrzucenia.\n"
-#: src/readelf.c:9518 src/readelf.c:9559
+#: src/readelf.c:12308 src/readelf.c:12359
#, c-format
msgid "cannot get data for section [%zu] '%s': %s"
msgstr "nie można uzyskać danych dla sekcji [%zu] „%s”: %s"
-#: src/readelf.c:9523
+#: src/readelf.c:12313
#, c-format
msgid ""
"\n"
@@ -6312,7 +5949,7 @@
"Segment zrzutu szesnastkowego [%zu] „%s”, %<PRIu64> bajtów pod offsetem "
"%#0<PRIx64>:\n"
-#: src/readelf.c:9528
+#: src/readelf.c:12318
#, c-format
msgid ""
"\n"
@@ -6323,16 +5960,16 @@
"Zrzut szesnastkowy sekcji [%zu] „%s”, %<PRIu64> bajtów (%zd "
"nieskompresowanych) pod offsetem %#0<PRIx64>:\n"
-#: src/readelf.c:9542
+#: src/readelf.c:12332
#, c-format
msgid ""
"\n"
"Section [%zu] '%s' has no strings to dump.\n"
msgstr ""
"\n"
-"Sekcja [%zu] „%s” nie posiada ciągów do zrzucenia.\n"
+"Sekcja [%zu] „%s” nie ma ciągów do zrzucenia.\n"
-#: src/readelf.c:9564
+#: src/readelf.c:12364
#, c-format
msgid ""
"\n"
@@ -6341,7 +5978,7 @@
"\n"
"Sekcja ciągów [%zu] „%s” zawiera %<PRIu64> bajtów pod offsetem %#0<PRIx64>:\n"
-#: src/readelf.c:9569
+#: src/readelf.c:12369
#, c-format
msgid ""
"\n"
@@ -6352,7 +5989,7 @@
"Sekcja ciągów [%zu] „%s” zawiera %<PRIu64> bajtów (%zd nieskompresowanych) "
"pod offsetem %#0<PRIx64>:\n"
-#: src/readelf.c:9618
+#: src/readelf.c:12418
#, c-format
msgid ""
"\n"
@@ -6361,7 +5998,7 @@
"\n"
"sekcja [%lu] nie istnieje"
-#: src/readelf.c:9647
+#: src/readelf.c:12447
#, c-format
msgid ""
"\n"
@@ -6370,161 +6007,162 @@
"\n"
"sekcja „%s” nie istnieje"
-#: src/readelf.c:9704
+#: src/readelf.c:12504
#, c-format
msgid "cannot get symbol index of archive '%s': %s"
msgstr "nie można uzyskać indeksu symboli archiwum „%s”: %s"
-#: src/readelf.c:9707
+#: src/readelf.c:12507
#, c-format
msgid ""
"\n"
"Archive '%s' has no symbol index\n"
msgstr ""
"\n"
-"Archiwum „%s” nie posiada indeksu symboli\n"
+"Archiwum „%s” nie ma indeksu symboli\n"
-#: src/readelf.c:9711
+#: src/readelf.c:12511
#, c-format
msgid ""
"\n"
"Index of archive '%s' has %zu entries:\n"
msgstr ""
"\n"
-"Indeks archiwum „%s” posiada %zu wpisów:\n"
+"Indeks archiwum „%s” ma %zu wpisów:\n"
-#: src/readelf.c:9729
+#: src/readelf.c:12529
#, c-format
msgid "cannot extract member at offset %zu in '%s': %s"
-msgstr "nie można wydobyć elementów pod offsetem %zu w „%s”: %s"
+msgstr "nie można wydobyć elementów pod offsetem %zu w „%s”: %s"
-#: src/readelf.c:9734
+#: src/readelf.c:12534
#, c-format
msgid "Archive member '%s' contains:\n"
msgstr "Element archiwum „%s” zawiera:\n"
-#: src/size.c:59
+#: src/size.c:57
msgid ""
"Use the output format FORMAT. FORMAT can be `bsd' or `sysv'. The default "
"is `bsd'"
msgstr ""
"Używa FORMATU wyjścia. Może to być „bsd” lub „sysv”. Domyślny jest „bsd”"
-#: src/size.c:61
+#: src/size.c:59
msgid "Same as `--format=sysv'"
msgstr "To samo, co „--format=sysv”"
-#: src/size.c:62
+#: src/size.c:60
msgid "Same as `--format=bsd'"
msgstr "To samo, co „--format=bsd”"
-#: src/size.c:65
+#: src/size.c:63
msgid "Same as `--radix=10'"
msgstr "To samo, co „--radix=10”"
-#: src/size.c:66
+#: src/size.c:64
msgid "Same as `--radix=8'"
msgstr "To samo, co „--radix=8”"
-#: src/size.c:67
+#: src/size.c:65
msgid "Same as `--radix=16'"
msgstr "To samo, co „--radix=16”"
-#: src/size.c:69
+#: src/size.c:67
msgid "Similar to `--format=sysv' output but in one line"
-msgstr "Podobne do wyjścia „--format=sysv”, ale w jednym wierszu"
+msgstr "Podobne do wyjścia „--format=sysv”, ale w jednym wierszu"
-#: src/size.c:73
+#: src/size.c:71
msgid "Print size and permission flags for loadable segments"
-msgstr "Wyświetla rozmiar i flagi uprawnień dla segmentów wczytywalnych"
+msgstr "Wyświetla rozmiar i flagi uprawnień dla segmentów wczytywalnych"
-#: src/size.c:74
+#: src/size.c:72
msgid "Display the total sizes (bsd only)"
msgstr "Wyświetla całkowite rozmiary (tylko bsd)"
-#: src/size.c:79
+#. Short description of program.
+#: src/size.c:77
msgid "List section sizes of FILEs (a.out by default)."
msgstr "Wyświetla listę rozmiarów sekcji PLIKU (domyślnie a.out)."
-#: src/size.c:257
+#: src/size.c:241
#, c-format
msgid "Invalid format: %s"
msgstr "Nieprawidłowy format: %s"
-#: src/size.c:268
+#: src/size.c:252
#, c-format
msgid "Invalid radix: %s"
msgstr "Nieprawidłowa baza: %s"
-#: src/size.c:327
+#: src/size.c:311
#, c-format
msgid "%s: file format not recognized"
msgstr "%s: nie rozpoznano formatu pliku"
-#: src/size.c:433 src/size.c:566
+#: src/size.c:417 src/size.c:550
#, c-format
msgid " (ex %s)"
msgstr " (ex %s)"
-#: src/size.c:591
+#: src/size.c:575
msgid "(TOTALS)\n"
msgstr "(CAŁKOWITE)\n"
-#: src/stack.c:488
+#: src/stack.c:483
#, c-format
msgid "-p PID should be a positive process id."
msgstr "-p PID powinien być dodatnim identyfikatorem procesu."
-#: src/stack.c:494
+#: src/stack.c:489
#, c-format
msgid "Cannot open core file '%s'"
msgstr "Nie można otworzyć pliku core „%s”"
-#: src/stack.c:554
+#: src/stack.c:549
#, c-format
msgid "-n MAXFRAMES should be 0 or higher."
msgstr "-n MAKSYMALNA_LICZBA_RAMEK powinna wynosić 0 lub więcej."
-#: src/stack.c:566
+#: src/stack.c:561
#, c-format
msgid "-e EXEC needs a core given by --core."
msgstr "-e PLIK_WYKONYWALNY wymaga pliku core podanego za pomocą opcji --core."
-#: src/stack.c:570
+#: src/stack.c:565
#, c-format
msgid "-1 needs a thread id given by -p."
msgstr "-1 wymaga identyfikatora wątku podanego za pomocą opcji -p."
-#: src/stack.c:574
+#: src/stack.c:569
#, c-format
msgid "One of -p PID or --core COREFILE should be given."
-msgstr "Tylko jedna z opcji -p PID lub --core PLIK_CORE powinna zostać podana."
+msgstr "Tylko jedna z opcji -p PID lub --core PLIK_CORE powinna zostać podana."
-#: src/stack.c:644
+#: src/stack.c:641
msgid "Show stack of process PID"
msgstr "Wyświetla stos numeru PID procesu"
-#: src/stack.c:646
+#: src/stack.c:643
msgid "Show stack found in COREFILE"
-msgstr "Wyświetla stos odnaleziony w PLIKU_CORE"
+msgstr "Wyświetla stos odnaleziony w PLIKU_CORE"
-#: src/stack.c:647
+#: src/stack.c:644
msgid "(optional) EXECUTABLE that produced COREFILE"
msgstr "(opcjonalnie) PLIK_WYKONYWALNY, który utworzył PLIK_CORE"
-#: src/stack.c:651
+#: src/stack.c:648
msgid "Output selection options:"
msgstr "Opcje wyboru wyjścia:"
-#: src/stack.c:653
+#: src/stack.c:650
msgid "Additionally show frame activation"
msgstr "Dodatkowo wyświetla aktywację ramki"
-#: src/stack.c:655
+#: src/stack.c:652
msgid "Additionally try to lookup DWARF debuginfo name for frame address"
msgstr "Dodatkowo próbuje wyszukać nazwy debuginfo DWARF dla adresu ramki"
-#: src/stack.c:658
+#: src/stack.c:655
msgid ""
"Additionally show inlined function frames using DWARF debuginfo if available "
"(implies -d)"
@@ -6532,71 +6170,74 @@
"Dodatkowo wyświetla wstawione ramki używając debuginfo DWARF, jeśli jest "
"dostępne (zakłada opcję -d)"
-#: src/stack.c:660
+#: src/stack.c:657
msgid "Additionally show module file information"
-msgstr "Dodatkowo wyświetla informacje o pliku modułu"
+msgstr "Dodatkowo wyświetla informacje o pliku modułu"
-#: src/stack.c:662
+#: src/stack.c:659
msgid "Additionally show source file information"
-msgstr "Dodatkowo wyświetla informacje o pliku źródłowym"
+msgstr "Dodatkowo wyświetla informacje o pliku źródłowym"
-#: src/stack.c:664
+#: src/stack.c:661
msgid ""
"Show all additional information (activation, debugname, inlines, module and "
"source)"
msgstr ""
"Wyświetla wszystkie dodatkowe informacje (aktywację, nazwę debugowania, "
-"wstawki, moduł i źródło)"
+"wstawki, moduł i źródło)"
-#: src/stack.c:666
+#: src/stack.c:663
msgid "Do not resolve address to function symbol name"
msgstr "Nie rozwiązuje nazw symboli adresów do funkcji"
-#: src/stack.c:668
+#: src/stack.c:665
msgid "Show raw function symbol names, do not try to demangle names"
msgstr ""
-"Wyświetla surowe nazwy symboli funkcji, nie próbuje usuwać dekoracji z nazw"
+"Wyświetla surowe nazwy symboli funkcji, nie próbuje usuwać dekoracji z nazw"
-#: src/stack.c:670
+#: src/stack.c:667
msgid "Show module build-id, load address and pc offset"
-msgstr "Wyświetla identyfikator kopii modułu, wczytuje adres i offset pc"
+msgstr "Wyświetla identyfikator kopii modułu, wczytuje adres i offset pc"
-#: src/stack.c:672
+#: src/stack.c:669
msgid "Show the backtrace of only one thread"
msgstr "Wyświetla wyjątek, jeśli jest tylko jeden wątek"
-#: src/stack.c:674
+#: src/stack.c:671
msgid "Show at most MAXFRAMES per thread (default 256, use 0 for unlimited)"
msgstr ""
"Wyświetla najwyżej MAKSYMALNĄ_LICZBĘ_KLATEK na wątek (domyślnie 256, 0 "
"oznacza brak ograniczenia)"
-#: src/stack.c:676
+#: src/stack.c:673
msgid "Show module memory map with build-id, elf and debug files detected"
msgstr ""
-"Wyświetla mapę pamięci modułu z identyfikatorem kopii, wykryte pliki elf i "
-"debug"
+"Wyświetla mapę pamięci modułu z identyfikatorem kopii, wykryte pliki elf "
+"i debug"
-#: src/stack.c:684
+#: src/stack.c:681
+#, fuzzy
msgid ""
-"Print a stack for each thread in a process or core file.\vProgram exits with "
-"return code 0 if all frames were shown without any errors. If some frames "
-"were shown, but there were some non-fatal errors, possibly causing an "
-"incomplete backtrace, the program exits with return code 1. If no frames "
-"could be shown, or a fatal error occured the program exits with return code "
-"2. If the program was invoked with bad or missing arguments it will exit "
-"with return code 64."
+"Print a stack for each thread in a process or core file.\n"
+"\n"
+"Program exits with return code 0 if all frames were shown without any "
+"errors. If some frames were shown, but there were some non-fatal errors, "
+"possibly causing an incomplete backtrace, the program exits with return code "
+"1. If no frames could be shown, or a fatal error occured the program exits "
+"with return code 2. If the program was invoked with bad or missing "
+"arguments it will exit with return code 64."
msgstr ""
-"Wyświetla stos dla każdego wątku w procesie lub pliku core.\vProgram kończy "
-"działanie z kodem zwrotnym 0, jeśli wszystkie ramki zostały wyświetlone bez "
-"żadnych błędów. Jeśli niektóre ramki zostały wyświetlone, ale wystąpiły "
-"niekrytyczne błędy, które mogą spowodować niepełny wyjątek, to program "
-"kończy działanie z kodem zwrotnym 1. Jeśli żadne ramki nie mogły zostać "
-"wyświetlone lub wystąpił krytyczny błąd, to program kończy działanie z kodem "
-"zwrotnym 2. Jeśli program został wywołany za pomocą błędnych lub brakujących "
-"parametrów, to zakończy on działanie z kodem zwrotnym 64."
+"Wyświetla stos dla każdego wątku w procesie lub pliku core.\n"
+"\n"
+"Program kończy działanie z kodem zwrotnym 0, jeśli wszystkie ramki zostały "
+"wyświetlone bez żadnych błędów. Jeśli niektóre ramki zostały wyświetlone, "
+"ale wystąpiły niekrytyczne błędy, które mogą spowodować niepełny wyjątek, to "
+"program kończy działanie z kodem zwrotnym 1. Jeśli żadne ramki nie mogły "
+"zostać wyświetlone lub wystąpił krytyczny błąd, to program kończy działanie "
+"z kodem zwrotnym 2. Jeśli program został wywołany za pomocą błędnych lub "
+"brakujących parametrów, to zakończy on działanie z kodem zwrotnym 64."
-#: src/stack.c:757
+#: src/stack.c:756
#, c-format
msgid "Couldn't show any frames."
msgstr "Nie można wyświetlić żadnych ramek."
@@ -6612,14 +6253,15 @@
#: src/strings.c:69
msgid "Only NUL-terminated sequences of MIN-LEN characters or more are printed"
msgstr ""
-"Wyświetlane są tylko zakończone NUL sekwencje o MIN-LEN lub więcej znaków"
+"Wyświetlane są tylko zakończone NUL sekwencje o MIN-LEN lub większej liczbie "
+"znaków"
#: src/strings.c:70
msgid ""
"Select character size and endianess: s = 7-bit, S = 8-bit, {b,l} = 16-bit, "
"{B,L} = 32-bit"
msgstr ""
-"Wybór rozmiaru i kolejności znaków: s = 7 bitów, S = 8 bitów, {b,l} = 16 "
+"Wybór rozmiaru i kolejności znaków: s = 7 bitów, S = 8 bitów, {b,l} = 16 "
"bitów, {B,L} = 32 bity"
#: src/strings.c:74
@@ -6628,560 +6270,595 @@
#: src/strings.c:76
msgid "Print location of the string in base 8, 10, or 16 respectively."
-msgstr "Wyświetla położenie ciągu z podstawą odpowiednio 8, 10 lub 16."
+msgstr "Wyświetla położenie ciągu z podstawą odpowiednio 8, 10 lub 16."
#: src/strings.c:77
msgid "Alias for --radix=o"
msgstr "Alias dla --radix=o"
+#. Short description of program.
#: src/strings.c:84
msgid "Print the strings of printable characters in files."
-msgstr "Wyświetla ciągi znaków drukowalnych w plikach."
+msgstr "Wyświetla ciągi znaków drukowalnych w plikach."
-#: src/strings.c:271 src/strings.c:306
+#: src/strings.c:257 src/strings.c:292
#, c-format
msgid "invalid value '%s' for %s parameter"
msgstr "nieprawidłowa wartość „%s” dla parametru %s"
-#: src/strings.c:317
+#: src/strings.c:303
#, c-format
msgid "invalid minimum length of matched string size"
msgstr "nieprawidłowa minimalna długość dopasowanego rozmiaru ciągu"
-#: src/strings.c:600
+#: src/strings.c:586
#, c-format
msgid "lseek failed"
msgstr "lseek się nie powiodło"
-#: src/strings.c:617 src/strings.c:681
+#: src/strings.c:603 src/strings.c:667
#, c-format
msgid "re-mmap failed"
msgstr "ponowne mmap się nie powiodło"
-#: src/strings.c:654
+#: src/strings.c:640
#, c-format
msgid "mprotect failed"
msgstr "mprotect się nie powiodło"
-#: src/strings.c:743
+#: src/strings.c:729
#, c-format
msgid "Skipping section %zd '%s' data outside file"
msgstr "Pomijanie sekcji %zd „%s” dane poza plikiem"
-#: src/strip.c:68
+#: src/strip.c:71
msgid "Place stripped output into FILE"
-msgstr "Umieszcza okrojone wyjście w PLIKU"
+msgstr "Umieszcza okrojone wyjście w PLIKU"
-#: src/strip.c:69
+#: src/strip.c:72
msgid "Extract the removed sections into FILE"
msgstr "Wydobywa usunięte sekcje do PLIKU"
-#: src/strip.c:70
+#: src/strip.c:73
msgid "Embed name FILE instead of -f argument"
msgstr "Osadza nazwę PLIKU zamiast parametru -f"
-#: src/strip.c:74
+#: src/strip.c:77
msgid "Remove all debugging symbols"
msgstr "Usuwa wszystkie symbole debugowania"
-#: src/strip.c:78
+#: src/strip.c:81
msgid "Remove section headers (not recommended)"
msgstr "Usuwa nagłówki sekcji (niezalecane)"
-#: src/strip.c:80
+#: src/strip.c:83
msgid "Copy modified/access timestamps to the output"
msgstr "Kopiuje czasy modyfikacji/dostępu do wyjścia"
-#: src/strip.c:82
+#: src/strip.c:85
msgid ""
"Resolve all trivial relocations between debug sections if the removed "
"sections are placed in a debug file (only relevant for ET_REL files, "
"operation is not reversable, needs -f)"
msgstr ""
"Rozwiązuje wszystkie proste relokacje między sekcjami debugowania, jeśli "
-"usunięte sekcje zostały umieszczone w pliku debugowania (ma znaczenie tylko "
+"usunięte sekcje zostały umieszczone w pliku debugowania (ma znaczenie tylko "
"dla plików ET_REL, działanie jest nieodwracalne, wymaga użycia opcji -f)"
-#: src/strip.c:84
+#: src/strip.c:87
msgid "Remove .comment section"
msgstr "Usuwa sekcję .comment"
-#: src/strip.c:87
-msgid "Relax a few rules to handle slightly broken ELF files"
-msgstr "Łagodzi kilka reguł, aby obsłużyć lekko uszkodzone pliki ELF"
+#: src/strip.c:88
+msgid ""
+"Remove the named section. SECTION is an extended wildcard pattern. May be "
+"given more than once. Only non-allocated sections can be removed."
+msgstr ""
-#: src/strip.c:92
+#: src/strip.c:89
+msgid ""
+"Keep the named section. SECTION is an extended wildcard pattern. May be "
+"given more than once."
+msgstr ""
+
+#. Short description of program.
+#: src/strip.c:96
msgid "Discard symbols from object files."
-msgstr "Odrzuca symbole z plików obiektów."
+msgstr "Odrzuca symbole z plików obiektów."
-#: src/strip.c:186
+#: src/strip.c:242
#, c-format
msgid "--reloc-debug-sections used without -f"
msgstr "Użyto --reloc-debug-sections bez opcji -f"
-#: src/strip.c:200
+#: src/strip.c:256
#, c-format
msgid "Only one input file allowed together with '-o' and '-f'"
-msgstr "Tylko jeden plik wejściowy jest dozwolony z „-o” i „-f”"
+msgstr "Tylko jeden plik wejściowy jest dozwolony z „-o” i „-f”"
-#: src/strip.c:236
+#: src/strip.c:279
#, c-format
msgid "-f option specified twice"
msgstr "Opcję -f podano dwukrotnie"
-#: src/strip.c:245
+#: src/strip.c:288
#, c-format
msgid "-F option specified twice"
msgstr "Opcję -F podano dwukrotnie"
-#: src/strip.c:254 src/unstrip.c:120
-#, c-format
-msgid "-o option specified twice"
-msgstr "Opcję -o podano dwukrotnie"
+#: src/strip.c:347
+#, fuzzy, c-format
+msgid "cannot both keep and remove .comment section"
+msgstr "Usuwa sekcję .comment"
-#: src/strip.c:278
-#, c-format
-msgid "-R option supports only .comment section"
-msgstr "Opcja -R obsługuje tylko sekcję .comment"
-
-#: src/strip.c:320 src/strip.c:344
+#: src/strip.c:372 src/strip.c:396
#, c-format
msgid "cannot stat input file '%s'"
msgstr "nie można wykonać stat na pliku wejściowym „%s”"
-#: src/strip.c:334
+#: src/strip.c:386
#, c-format
msgid "while opening '%s'"
msgstr "podczas otwierania „%s”"
-#: src/strip.c:372
+#: src/strip.c:424
#, c-format
msgid "%s: cannot use -o or -f when stripping archive"
msgstr "%s: nie można używać -o lub -f podczas okrajania archiwum"
-#: src/strip.c:384
+#. We would like to support ar archives, but currently it just
+#. doesn't work at all since we call elf_clone on the members
+#. which doesn't really support ar members.
+#. result = handle_ar (fd, elf, NULL, fname,
+#. preserve_dates ? tv : NULL);
+#.
+#: src/strip.c:436
#, c-format
msgid "%s: no support for stripping archive"
msgstr "%s: brak obsługi okrajania archiwum"
-#: src/strip.c:483
+#: src/strip.c:535
#, c-format
msgid "cannot open EBL backend"
msgstr "nie można otworzyć zaplecza EBL"
-#: src/strip.c:528
+#: src/strip.c:580
#, c-format
msgid "cannot get number of phdrs"
msgstr "nie można uzyskać liczby phdr"
-#: src/strip.c:544 src/strip.c:568
+#: src/strip.c:596 src/strip.c:620
#, c-format
msgid "cannot create new file '%s': %s"
msgstr "nie można utworzyć nowego pliku „%s”: %s"
-#: src/strip.c:634
+#: src/strip.c:686
#, c-format
msgid "illformed file '%s'"
-msgstr "plik „%s” posiada błędny format"
+msgstr "plik „%s” ma błędny format"
-#: src/strip.c:968 src/strip.c:1067
+#: src/strip.c:696
+#, fuzzy, c-format
+msgid "Cannot remove allocated section '%s'"
+msgstr "nie można przydzielić danych sekcji: %s"
+
+#: src/strip.c:705
+#, fuzzy, c-format
+msgid "Cannot both keep and remove section '%s'"
+msgstr "nie można dodać nowej sekcji: %s"
+
+#: src/strip.c:1061 src/strip.c:1160
#, c-format
msgid "while generating output file: %s"
msgstr "podczas tworzenia pliku wyjściowego: %s"
-#: src/strip.c:1033 src/strip.c:2071
+#: src/strip.c:1126 src/strip.c:2208
#, c-format
msgid "%s: error while creating ELF header: %s"
msgstr "%s: błąd podczas tworzenia nagłówka ELF: %s"
-#: src/strip.c:1050
+#: src/strip.c:1143
#, c-format
msgid "while preparing output for '%s'"
msgstr "podczas przygotowywania wyjścia dla „%s”"
-#: src/strip.c:1108 src/strip.c:1171
+#: src/strip.c:1205 src/strip.c:1268
#, c-format
msgid "while create section header section: %s"
msgstr "podczas tworzenia sekcji nagłówka sekcji: %s"
-#: src/strip.c:1117
+#: src/strip.c:1214
#, c-format
msgid "cannot allocate section data: %s"
msgstr "nie można przydzielić danych sekcji: %s"
-#: src/strip.c:1183
+#: src/strip.c:1280
#, c-format
msgid "while create section header string table: %s"
msgstr "podczas tworzenia tabeli ciągów nagłówka sekcji: %s"
-#: src/strip.c:1861
+#: src/strip.c:1287
+#, c-format
+msgid "no memory to create section header string table"
+msgstr "brak pamięci do utworzenia tabeli ciągów nagłówka sekcji"
+
+#: src/strip.c:1497
+#, c-format
+msgid "Cannot remove symbol [%zd] from allocated symbol table [%zd]"
+msgstr "Nie można usunąć symbolu [%zd] z przydzielonej tabeli symboli [%zd]"
+
+#: src/strip.c:1994
#, c-format
msgid "bad relocation"
msgstr "błędna relokacja"
-#: src/strip.c:1982 src/strip.c:2095
+#: src/strip.c:2119 src/strip.c:2232
#, c-format
msgid "while writing '%s': %s"
msgstr "podczas zapisywania „%s”: %s"
-#: src/strip.c:1993
+#: src/strip.c:2130
#, c-format
msgid "while creating '%s'"
msgstr "podczas tworzenia „%s”"
-#: src/strip.c:2016
+#: src/strip.c:2153
#, c-format
msgid "while computing checksum for debug information"
msgstr "podczas obliczania sumy kontrolnej dla informacji debugowania"
-#: src/strip.c:2080
+#: src/strip.c:2217
#, c-format
msgid "%s: error while reading the file: %s"
msgstr "%s: błąd podczas odczytywania pliku: %s"
-#: src/strip.c:2120 src/strip.c:2140
+#: src/strip.c:2257 src/strip.c:2277
#, c-format
msgid "while writing '%s'"
msgstr "podczas zapisywania „%s”"
-#: src/strip.c:2177 src/strip.c:2184
+#: src/strip.c:2314 src/strip.c:2321
#, c-format
msgid "error while finishing '%s': %s"
msgstr "błąd podczas kończenia „%s”: %s"
-#: src/strip.c:2201 src/strip.c:2273
+#: src/strip.c:2338 src/strip.c:2414
#, c-format
msgid "cannot set access and modification date of '%s'"
-msgstr "nie można ustawić czasu dostępu i modyfikacji „%s”"
-
-#: src/unstrip.c:69
-msgid "Match MODULE against file names, not module names"
-msgstr "Dopasowuje MODUŁY do nazw plików, a nie nazwy modułów"
+msgstr "nie można ustawić czasu dostępu i modyfikacji „%s”"
#: src/unstrip.c:70
+msgid "Match MODULE against file names, not module names"
+msgstr "Dopasowuje MODUŁY do nazw plików, a nie nazwy modułów"
+
+#: src/unstrip.c:71
msgid "Silently skip unfindable files"
msgstr "Pomija nieodnalezione pliki bez zgłaszania tego"
-#: src/unstrip.c:73
+#: src/unstrip.c:74
msgid "Place output into FILE"
-msgstr "Umieszcza wyjście w PLIKU"
-
-#: src/unstrip.c:75
-msgid "Create multiple output files under DIRECTORY"
-msgstr "Tworzy wiele plików wyjściowych w KATALOGU"
+msgstr "Umieszcza wyjście w PLIKU"
#: src/unstrip.c:76
+msgid "Create multiple output files under DIRECTORY"
+msgstr "Tworzy wiele plików wyjściowych w KATALOGU"
+
+#: src/unstrip.c:77
msgid "Use module rather than file names"
msgstr "Używa nazw modułów zamiast nazw plików"
-#: src/unstrip.c:78
+#: src/unstrip.c:79
msgid "Create output for modules that have no separate debug information"
msgstr ""
-"Tworzy wyjście dla modułów nieposiadających oddzielnych informacji "
-"debugowania"
+"Tworzy wyjście dla modułów niemających oddzielnych informacji debugowania"
-#: src/unstrip.c:81
+#: src/unstrip.c:82
msgid "Apply relocations to section contents in ET_REL files"
-msgstr "Zastosowuje relokacje do zawartości sekcji w plikach ET_REL"
+msgstr "Zastosowuje relokacje do zawartości sekcji w plikach ET_REL"
-#: src/unstrip.c:83
+#: src/unstrip.c:84
msgid "Only list module and file names, build IDs"
-msgstr "Wyświetla tylko nazwy modułów i plików, identyfikatory kopii"
+msgstr "Wyświetla tylko nazwy modułów i plików, identyfikatory kopii"
-#: src/unstrip.c:85
+#: src/unstrip.c:86
msgid "Force combining files even if some ELF headers don't seem to match"
msgstr ""
"Wymusza łączenie plików nawet, jeśli niektóre nagłówki ELF się nie zgadzają"
-#: src/unstrip.c:129
+#: src/unstrip.c:130
#, c-format
msgid "-d option specified twice"
msgstr "opcję -d podano dwukrotnie"
-#: src/unstrip.c:164
+#: src/unstrip.c:165
#, c-format
msgid "only one of -o or -d allowed"
-msgstr "dozwolona jest tylko jedna z opcji -o lub -d"
+msgstr "dozwolona jest tylko jedna z opcji -o lub -d"
-#: src/unstrip.c:173
+#: src/unstrip.c:174
#, c-format
msgid "-n cannot be used with explicit files or -o or -d"
-msgstr "opcja -n nie może być używana z jawnymi plikami albo z opcją -o lub -d"
+msgstr "opcja -n nie może być używana z jawnymi plikami albo z opcją -o lub -d"
-#: src/unstrip.c:188
+#: src/unstrip.c:189
#, c-format
msgid "output directory '%s'"
msgstr "katalog wyjściowy „%s”"
-#: src/unstrip.c:197
+#: src/unstrip.c:198
#, c-format
msgid "exactly two file arguments are required"
msgstr "wymagane są dokładnie dwa parametry plików"
-#: src/unstrip.c:203
+#: src/unstrip.c:204
#, c-format
msgid "-m, -a, -R, and -i options not allowed with explicit files"
-msgstr "opcje -m, -a, -R oraz -i nie są dozwolone z jawnymi plikami"
+msgstr "opcje -m, -a, -R oraz -i nie są dozwolone z jawnymi plikami"
-#: src/unstrip.c:216
+#: src/unstrip.c:217
#, c-format
msgid "-o or -d is required when using implicit files"
msgstr "opcja -o lub -d jest wymagana podczas używania ukrytych plików"
-#: src/unstrip.c:252
+#: src/unstrip.c:240
#, c-format
msgid "cannot create ELF header: %s"
msgstr "nie można utworzyć nagłówka ELF: %s"
-#: src/unstrip.c:257
+#: src/unstrip.c:245
#, c-format
msgid "cannot copy ELF header: %s"
msgstr "nie można skopiować nagłówka ELF: %s"
-#: src/unstrip.c:261 src/unstrip.c:1939 src/unstrip.c:1982
+#: src/unstrip.c:249 src/unstrip.c:1933 src/unstrip.c:1976
#, c-format
msgid "cannot get number of program headers: %s"
msgstr "nie można uzyskać liczby nagłówków programu: %s"
-#: src/unstrip.c:266 src/unstrip.c:1943
+#: src/unstrip.c:254 src/unstrip.c:1937
#, c-format
msgid "cannot create program headers: %s"
msgstr "nie można utworzyć nagłówków programu: %s"
-#: src/unstrip.c:272
+#: src/unstrip.c:260
#, c-format
msgid "cannot copy program header: %s"
msgstr "nie można skopiować nagłówka programu: %s"
-#: src/unstrip.c:282
+#: src/unstrip.c:270
#, c-format
msgid "cannot copy section header: %s"
msgstr "nie można skopiować nagłówka sekcji: %s"
-#: src/unstrip.c:285 src/unstrip.c:1576
+#: src/unstrip.c:273 src/unstrip.c:1568
#, c-format
msgid "cannot get section data: %s"
msgstr "nie można uzyskać danych sekcji: %s"
-#: src/unstrip.c:287 src/unstrip.c:1578
+#: src/unstrip.c:275 src/unstrip.c:1570
#, c-format
msgid "cannot copy section data: %s"
msgstr "nie można skopiować danych sekcji: %s"
-#: src/unstrip.c:311
+#: src/unstrip.c:299
#, c-format
msgid "cannot create directory '%s'"
msgstr "nie można utworzyć katalogu „%s”"
-#: src/unstrip.c:383 src/unstrip.c:803 src/unstrip.c:1610
+#: src/unstrip.c:371 src/unstrip.c:791 src/unstrip.c:1602
#, c-format
msgid "cannot get symbol table entry: %s"
msgstr "nie można uzyskać wpisu tabeli symboli: %s"
-#: src/unstrip.c:399 src/unstrip.c:620 src/unstrip.c:641 src/unstrip.c:653
-#: src/unstrip.c:1631 src/unstrip.c:1805 src/unstrip.c:1829
+#: src/unstrip.c:387 src/unstrip.c:608 src/unstrip.c:629 src/unstrip.c:641
+#: src/unstrip.c:1623 src/unstrip.c:1799 src/unstrip.c:1823
#, c-format
msgid "cannot update symbol table: %s"
msgstr "nie można zaktualizować tabeli symboli: %s"
-#: src/unstrip.c:409
+#: src/unstrip.c:397
#, c-format
msgid "cannot update section header: %s"
msgstr "nie można zaktualizować nagłówka sekcji: %s"
-#: src/unstrip.c:448 src/unstrip.c:459
+#: src/unstrip.c:436 src/unstrip.c:447
#, c-format
msgid "cannot update relocation: %s"
msgstr "nie można zaktualizować relokacji: %s"
-#: src/unstrip.c:547
+#: src/unstrip.c:535
#, c-format
msgid "cannot get symbol version: %s"
msgstr "nie można uzyskać wersji symbolu: %s"
-#: src/unstrip.c:560
+#: src/unstrip.c:548
#, c-format
msgid "unexpected section type in [%zu] with sh_link to symtab"
-msgstr "nieoczekiwany typ sekcji w [%zu] z sh_link do tabeli symboli"
+msgstr "nieoczekiwany typ sekcji w [%zu] z sh_link do tabeli symboli"
-#: src/unstrip.c:809
+#: src/unstrip.c:797
#, c-format
msgid "invalid string offset in symbol [%zu]"
-msgstr "nieprawidłowy offset ciągu w symbolu [%zu]"
+msgstr "nieprawidłowy offset ciągu w symbolu [%zu]"
-#: src/unstrip.c:967 src/unstrip.c:1313
+#: src/unstrip.c:955 src/unstrip.c:1305
#, c-format
msgid "cannot read section [%zu] name: %s"
msgstr "nie można odczytać nazwy sekcji [%zu]: %s"
-#: src/unstrip.c:1008 src/unstrip.c:1027 src/unstrip.c:1062
+#: src/unstrip.c:996 src/unstrip.c:1015 src/unstrip.c:1053
#, c-format
msgid "cannot read '.gnu.prelink_undo' section: %s"
msgstr "nie można odczytać sekcji „.gnu.prelink_undo”: %s"
-#: src/unstrip.c:1048
-#, c-format
-msgid "invalid contents in '%s' section"
-msgstr "nieprawidłowa zawartość w sekcji „%s”"
-
-#: src/unstrip.c:1054
+#: src/unstrip.c:1033
#, c-format
msgid "overflow with shnum = %zu in '%s' section"
-msgstr "przepełnienie z shnum = %zu w sekcji „%s”"
+msgstr "przepełnienie z shnum = %zu w sekcji „%s”"
-#: src/unstrip.c:1108 src/unstrip.c:1433
+#: src/unstrip.c:1044
+#, c-format
+msgid "invalid contents in '%s' section"
+msgstr "nieprawidłowa zawartość w sekcji „%s”"
+
+#: src/unstrip.c:1099 src/unstrip.c:1427
#, c-format
msgid "cannot find matching section for [%zu] '%s'"
msgstr "nie można odnaleźć pasującej sekcji dla [%zu] „%s”"
-#: src/unstrip.c:1233 src/unstrip.c:1248 src/unstrip.c:1514 src/unstrip.c:1766
+#: src/unstrip.c:1224 src/unstrip.c:1239 src/unstrip.c:1506 src/unstrip.c:1758
#, c-format
msgid "cannot add section name to string table: %s"
msgstr "nie można nazwy sekcji do tabeli ciągów: %s"
-#: src/unstrip.c:1257
+#: src/unstrip.c:1248
#, c-format
msgid "cannot update section header string table data: %s"
msgstr "nie można zaktualizować danych tabeli ciągów nagłówków sekcji: %s"
-#: src/unstrip.c:1284 src/unstrip.c:1288
+#: src/unstrip.c:1276 src/unstrip.c:1280
#, c-format
msgid "cannot get section header string table section index: %s"
msgstr "nie można uzyskać indeksu sekcji tabeli ciągów nagłówków sekcji: %s"
-#: src/unstrip.c:1292 src/unstrip.c:1296 src/unstrip.c:1529
+#: src/unstrip.c:1284 src/unstrip.c:1288 src/unstrip.c:1521
#, c-format
msgid "cannot get section count: %s"
msgstr "nie można uzyskać licznika sekcji: %s"
-#: src/unstrip.c:1299
+#: src/unstrip.c:1291
#, c-format
msgid "more sections in stripped file than debug file -- arguments reversed?"
msgstr ""
-"więcej sekcji w okrojonym pliku niż w pliku debugowania — odwrócono "
+"więcej sekcji w okrojonym pliku niż w pliku debugowania — odwrócono "
"parametry?"
-#: src/unstrip.c:1358 src/unstrip.c:1448
+#: src/unstrip.c:1350 src/unstrip.c:1442
#, c-format
msgid "cannot read section header string table: %s"
msgstr "nie można odczytać tabeli ciągów nagłówków sekcji: %s"
-#: src/unstrip.c:1508
+#: src/unstrip.c:1500
#, c-format
msgid "cannot add new section: %s"
msgstr "nie można dodać nowej sekcji: %s"
-#: src/unstrip.c:1618
+#: src/unstrip.c:1610
#, c-format
msgid "symbol [%zu] has invalid section index"
-msgstr "symbol [%zu] posiada nieprawidłowy indeks sekcji"
+msgstr "symbol [%zu] ma nieprawidłowy indeks sekcji"
-#: src/unstrip.c:1900
+#: src/unstrip.c:1894
#, c-format
msgid "cannot read section data: %s"
msgstr "nie można odczytać danych sekcji: %s"
-#: src/unstrip.c:1921
+#: src/unstrip.c:1915
#, c-format
msgid "cannot get ELF header: %s"
msgstr "nie można uzyskać nagłówka ELF: %s"
-#: src/unstrip.c:1953
+#: src/unstrip.c:1923
+#, c-format
+msgid "cannot update ELF header: %s"
+msgstr "nie można zaktualizować nagłówka ELF: %s"
+
+#: src/unstrip.c:1947
#, c-format
msgid "cannot update program header: %s"
msgstr "nie można zaktualizować nagłówka programu: %s"
-#: src/unstrip.c:1958 src/unstrip.c:2040
+#: src/unstrip.c:1952 src/unstrip.c:2034
#, c-format
msgid "cannot write output file: %s"
msgstr "nie można zapisać pliku wyjściowego: %s"
-#: src/unstrip.c:2009
+#: src/unstrip.c:2003
#, c-format
msgid "DWARF data not adjusted for prelinking bias; consider prelink -u"
msgstr ""
"Dane DWARF nie zostały dostosowane do przesunięcia wczesnego konsolidowania; "
"proszę rozważyć polecenie prelink -u"
-#: src/unstrip.c:2012
+#: src/unstrip.c:2006
#, c-format
msgid ""
"DWARF data in '%s' not adjusted for prelinking bias; consider prelink -u"
msgstr ""
-"Dane DWARF w „%s” nie zostały dostosowane do przesunięcia wczesnego "
+"Dane DWARF w „%s” nie zostały dostosowane do przesunięcia wczesnego "
"konsolidowania; proszę rozważyć polecenie prelink -u"
-#: src/unstrip.c:2031 src/unstrip.c:2082 src/unstrip.c:2094 src/unstrip.c:2180
+#: src/unstrip.c:2025 src/unstrip.c:2076 src/unstrip.c:2088 src/unstrip.c:2174
#, c-format
msgid "cannot create ELF descriptor: %s"
msgstr "nie można utworzyć deskryptora ELF: %s"
-#: src/unstrip.c:2073
+#: src/unstrip.c:2067
msgid "WARNING: "
msgstr "OSTRZEŻENIE: "
-#: src/unstrip.c:2075
+#: src/unstrip.c:2069
msgid ", use --force"
msgstr ", należy użyć opcji --force"
-#: src/unstrip.c:2098
+#: src/unstrip.c:2092
msgid "ELF header identification (e_ident) different"
msgstr "Różna identyfikacja nagłówka ELF (e_ident)"
-#: src/unstrip.c:2101
+#: src/unstrip.c:2095
msgid "ELF header type (e_type) different"
msgstr "Różne typy nagłówka ELF (e_type)"
-#: src/unstrip.c:2104
+#: src/unstrip.c:2098
msgid "ELF header machine type (e_machine) different"
msgstr "Różne typy maszyny nagłówka ELF (e_machine)"
-#: src/unstrip.c:2107
+#: src/unstrip.c:2101
msgid "stripped program header (e_phnum) smaller than unstripped"
msgstr "okrojony nagłówek programu (e_phnum) jest mniejszy niż nieokrojony"
-#: src/unstrip.c:2137
+#: src/unstrip.c:2131
#, c-format
msgid "cannot find stripped file for module '%s': %s"
msgstr "nie można odnaleźć okrojonego pliku dla modułu „%s”: %s"
-#: src/unstrip.c:2141
+#: src/unstrip.c:2135
#, c-format
msgid "cannot open stripped file '%s' for module '%s': %s"
msgstr "nie można otworzyć okrojonego pliku „%s” dla modułu „%s”: %s"
-#: src/unstrip.c:2156
+#: src/unstrip.c:2150
#, c-format
msgid "cannot find debug file for module '%s': %s"
msgstr "nie można odnaleźć pliku debugowania dla modułu „%s”: %s"
-#: src/unstrip.c:2160
+#: src/unstrip.c:2154
#, c-format
msgid "cannot open debug file '%s' for module '%s': %s"
msgstr "nie można otworzyć pliku debugowania „%s” dla modułu „%s”: %s"
-#: src/unstrip.c:2173
+#: src/unstrip.c:2167
#, c-format
msgid "module '%s' file '%s' is not stripped"
msgstr "moduł „%s” pliku „%s” nie został okrojony"
-#: src/unstrip.c:2204
+#: src/unstrip.c:2198
#, c-format
msgid "cannot cache section addresses for module '%s': %s"
msgstr ""
"nie można utworzyć pamięci podręcznej adresów sekcji dla modułu „%s”: %s"
-#: src/unstrip.c:2337
+#: src/unstrip.c:2331
#, c-format
msgid "no matching modules found"
msgstr "nie odnaleziono pasujących modułów"
-#: src/unstrip.c:2346
+#: src/unstrip.c:2340
#, c-format
msgid "matched more than one module"
msgstr "pasuje więcej niż jeden moduł"
-#: src/unstrip.c:2390
+#: src/unstrip.c:2384
msgid ""
"STRIPPED-FILE DEBUG-FILE\n"
"[MODULE...]"
@@ -7189,10 +6866,12 @@
"OKROJONY-PLIK PLIK-DEBUGOWANIA\n"
"[MODUŁ…]"
-#: src/unstrip.c:2391
+#: src/unstrip.c:2385
+#, fuzzy
msgid ""
-"Combine stripped files with separate symbols and debug information.\vThe "
-"first form puts the result in DEBUG-FILE if -o was not given.\n"
+"Combine stripped files with separate symbols and debug information.\n"
+"\n"
+"The first form puts the result in DEBUG-FILE if -o was not given.\n"
"\n"
"MODULE arguments give file name patterns matching modules to process.\n"
"With -f these match the file name of the main (stripped) file (slashes are "
@@ -7215,34 +6894,35 @@
"file. DEBUGFILE is the separate debuginfo file name, or - if no debuginfo "
"was found, or . if FILE contains the debug information."
msgstr ""
-"Łączy okrojone pliki z oddzielnymi symbolami i informacjami debugowania."
-"\vPierwsza forma umieszcza wynik w PLIKU-DEBUGOWANIA, jeśli nie podano opcji "
-"-o.\n"
+"Łączy okrojone pliki z oddzielnymi symbolami i informacjami debugowania.\n"
+"\n"
+"Pierwsza forma umieszcza wynik w PLIKU-DEBUGOWANIA, jeśli nie podano opcji -"
+"o.\n"
"\n"
"Parametr MODUŁ podaje wzorce nazw plików dopasowujące moduły do procesów.\n"
"Za pomocą opcji -f dopasowuje nazwę głównego (okrojonego) pliku (ukośniki "
-"nigdy nie są specjalne), w innym przypadku dopasowują proste nazwy modułów. "
+"nigdy nie są specjalne), w innym przypadku dopasowują proste nazwy modułów. "
"Jeśli nie podano parametrów, przetwarza wszystkie odnalezione moduły.\n"
"\n"
-"Wiele modułów zostaje zapisanych do plików w KATALOGU-WYJŚCIOWYM, tworząc "
-"podkatalogi, jeśli są wymagane. Używając opcji -m te pliki posiadają proste "
-"nazwy modułów, w innym przypadku posiadają nazwy głównego pliku uzupełnione "
-"katalogiem w KATALOGU-WYJŚCIOWYM.\n"
+"Wiele modułów zostaje zapisanych do plików w KATALOGU-WYJŚCIOWYM, tworząc "
+"podkatalogi, jeśli są wymagane. Używając opcji -m te pliki mające proste "
+"nazwy modułów, w innym przypadku mają nazwy głównego pliku uzupełnione "
+"katalogiem w KATALOGU-WYJŚCIOWYM.\n"
"\n"
-"Używając opcji -n żadne pliki nie zostają zapisane, a jeden wiersz do "
+"Używając opcji -n żadne pliki nie zostają zapisane, a jeden wiersz do "
"standardowego wyjścia dla każdego modułu:\n"
"\tPOCZĄTEK+ROZMIAR IDENTYFIKATOR-KOPII PLIK PLIK-DEBUGOWANIA NAZWA-MODUŁU\n"
-"POCZĄTEK i ROZMIAR są liczbami szesnastkowymi podającymi zakres adresów "
+"POCZĄTEK i ROZMIAR są liczbami szesnastkowymi podającymi zakres adresów "
"modułu. IDENTYFIKATOR-KOPII jest liczbą szesnastkową dla bitów "
"identyfikatora kopii lub „-”, jeśli identyfikator jest nieznany; liczba "
"szesnastkowa może być uzupełniona @0xADRES podającym adres, gdzie znajduje "
"się identyfikator, jeśli jest to wiadome. PLIK jest nazwą pliku "
"odnalezionego dla modułu lub „-”, jeśli go nie odnaleziono lub „.”, jeśli "
-"obraz ELF jest dostępny, ale nie z żadnego nazwanego pliku. PLIK-DEBUGOWANIA "
+"obraz ELF jest dostępny, ale nie z żadnego nazwanego pliku. PLIK-DEBUGOWANIA "
"jest nazwą oddzielnego pliku debuginfo lub „-”, jeśli nie odnaleziono "
"debuginfo lub „.”, jeśli PLIK zawiera informacje debugowania."
-#: tests/backtrace.c:427
+#: tests/backtrace.c:442
msgid "Run executable"
msgstr "Uruchamia plik wykonywalny"
@@ -7253,3 +6933,66 @@
#: tests/dwflmodtest.c:214
msgid "Show instances of inlined functions"
msgstr "Wyświetla wystąpienia wstawionych funkcji"
+
+#~ msgid "%s+%#<PRIx64> <%s+%#<PRIx64>>"
+#~ msgstr "%s+%#<PRIx64> <%s+%#<PRIx64>>"
+
+#~ msgid "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
+#~ msgstr "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
+
+#~ msgid "%#<PRIx64> <%s+%#<PRIx64>>"
+#~ msgstr "%#<PRIx64> <%s+%#<PRIx64>>"
+
+#~ msgid "%#0*<PRIx64> <%s+%#<PRIx64>>"
+#~ msgstr "%#0*<PRIx64> <%s+%#<PRIx64>>"
+
+#~ msgid "%s+%#<PRIx64> <%s>"
+#~ msgstr "%s+%#<PRIx64> <%s>"
+
+#~ msgid "%s+%#0*<PRIx64> <%s>"
+#~ msgstr "%s+%#0*<PRIx64> <%s>"
+
+#~ msgid "%#<PRIx64> <%s>"
+#~ msgstr "%#<PRIx64> <%s>"
+
+#~ msgid "%#0*<PRIx64> <%s>"
+#~ msgstr "%#0*<PRIx64> <%s>"
+
+#~ msgid "%s+%#<PRIx64>"
+#~ msgstr "%s+%#<PRIx64>"
+
+#~ msgid "%s+%#0*<PRIx64>"
+#~ msgstr "%s+%#0*<PRIx64>"
+
+#~ msgid " %s..%s (%<PRIx64>)\n"
+#~ msgstr " %s..%s (%<PRIx64>)\n"
+
+#~ msgid " %s..%s\n"
+#~ msgstr " %s..%s\n"
+
+#~ msgid " advance address by %u to %s, op_index to %u\n"
+#~ msgstr " zwiększenie adresu o %u do %s, op_index do %u\n"
+
+#~ msgid " advance address by constant %u to %s, op_index to %u\n"
+#~ msgstr " zwiększenie adresu o stałą %u do %s, op_index do %u\n"
+
+#~ msgid " [%6tx] %s..%s\n"
+#~ msgstr " [%6tx] %s…%s\n"
+
+#~ msgid " %s..%s\n"
+#~ msgstr " %s…%s\n"
+
+#~ msgid "cannot get DIE at offset %<PRIu64> in section '%s': %s"
+#~ msgstr "nie można uzyskać DIE pod offsetem %<PRIu64> w sekcji „%s”: %s"
+
+#~ msgid " [%6tx] %s..%s"
+#~ msgstr " [%6tx] %s…%s"
+
+#~ msgid " %s..%s"
+#~ msgstr " %s…%s"
+
+#~ msgid "vendor opcode not verified?"
+#~ msgstr "instrukcja producenta nie została sprawdzona?"
+
+#~ msgid "-R option supports only .comment section"
+#~ msgstr "Opcja -R obsługuje tylko sekcję .comment"
diff --git a/po/ru.po b/po/ru.po
index 1040653..99505d6 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -5639,7 +5639,7 @@
#: src/unstrip.c:2248
msgid ""
-"Combine stripped files with separate symbols and debug information.\vThe "
+"Combine stripped files with separate symbols and debug information.\n\nThe "
"first form puts the result in DEBUG-FILE if -o was not given.\n"
"\n"
"MODULE arguments give file name patterns matching modules to process.\n"
diff --git a/po/uk.po b/po/uk.po
index 7e875e2..a8dcb20 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -6,8 +6,8 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
-"Report-Msgid-Bugs-To: http://bugzilla.redhat.com/\n"
-"POT-Creation-Date: 2016-01-11 08:48+0100\n"
+"Report-Msgid-Bugs-To: https://sourceware.org/bugzilla/\n"
+"POT-Creation-Date: 2018-06-29 20:47+0200\n"
"PO-Revision-Date: 2015-09-26 16:41+0300\n"
"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n"
"Language-Team: Ukrainian <kde-i18n-uk@kde.org>\n"
@@ -41,29 +41,40 @@
" - «never», «no», «none»\n"
" - «auto», «tty», «if-tty»\n"
-#: lib/color.c:190 src/objdump.c:738
+#: lib/color.c:190 src/objdump.c:727
#, c-format
msgid "cannot allocate memory"
msgstr "не вдалося розподілити пам’ять"
-#: lib/xmalloc.c:53 lib/xmalloc.c:66 lib/xmalloc.c:78 src/readelf.c:3282
-#: src/readelf.c:3669 src/readelf.c:8416 src/unstrip.c:2233 src/unstrip.c:2438
+#: lib/printversion.c:40
+#, fuzzy, c-format
+msgid ""
+"Copyright (C) %s The elfutils developers <%s>.\n"
+"This is free software; see the source for copying conditions. There is NO\n"
+"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
+msgstr ""
+"© Red Hat, Inc., %s\n"
+"Це програмне забезпечення є вільним, умови копіювання викладено у його "
+"початкових кодах. Умовами ліцензування програми НЕ передбачено жодних "
+"гарантій, зокрема гарантій працездатності або придатності для певної мети.\n"
+
+#: lib/xmalloc.c:53 lib/xmalloc.c:66 lib/xmalloc.c:78 src/readelf.c:3395
+#: src/readelf.c:11196 src/unstrip.c:2227 src/unstrip.c:2433
#, c-format
msgid "memory exhausted"
msgstr "пам’ять вичерпано"
-#: libasm/asm_error.c:65 libdw/dwarf_error.c:58 libdwfl/libdwflP.h:53
+#: libasm/asm_error.c:65 libdw/dwarf_error.c:57 libdwfl/libdwflP.h:50
#: libelf/elf_error.c:60
msgid "no error"
msgstr "без помилок"
-#: libasm/asm_error.c:66 libdw/dwarf_error.c:68 libdwfl/libdwflP.h:55
+#: libasm/asm_error.c:66 libdw/dwarf_error.c:67 libdwfl/libdwflP.h:52
#: libelf/elf_error.c:91
msgid "out of memory"
msgstr "нестача пам'яті"
-#: libasm/asm_error.c:67 src/ldgeneric.c:2677
-#, c-format
+#: libasm/asm_error.c:67
msgid "cannot create output file"
msgstr "не вдалося створити файл виводу даних"
@@ -75,8 +86,7 @@
msgid "cannot change mode of output file"
msgstr "не вдалося змінити права доступу до файла виводу даних"
-#: libasm/asm_error.c:70 src/ldgeneric.c:6990
-#, c-format
+#: libasm/asm_error.c:70
msgid "cannot rename output file"
msgstr "не вдалося перейменувати файл виводу даних"
@@ -96,176 +106,217 @@
msgid "no backend support available"
msgstr "підтримки серверів не передбачено"
-#: libasm/asm_error.c:83 libdw/dwarf_error.c:59 libdwfl/libdwflP.h:54
+#: libasm/asm_error.c:83 libdw/dwarf_error.c:58 libdwfl/libdwflP.h:51
#: libelf/elf_error.c:63
msgid "unknown error"
msgstr "невідома помилка"
-#: libdw/dwarf_error.c:60
+#: libdw/dwarf_error.c:59
msgid "invalid access"
msgstr "некоректний доступ"
-#: libdw/dwarf_error.c:61
+#: libdw/dwarf_error.c:60
msgid "no regular file"
msgstr "не є звичайним файлом"
-#: libdw/dwarf_error.c:62
+#: libdw/dwarf_error.c:61
msgid "I/O error"
msgstr "помилка вводу/виводу"
-#: libdw/dwarf_error.c:63
+#: libdw/dwarf_error.c:62
msgid "invalid ELF file"
msgstr "некоректний файл ELF"
-#: libdw/dwarf_error.c:64
+#: libdw/dwarf_error.c:63
msgid "no DWARF information"
msgstr "немає відомостей DWARF"
-#: libdw/dwarf_error.c:65
+#: libdw/dwarf_error.c:64
msgid "cannot decompress DWARF"
msgstr "не вдалося розпакувати DWARF"
-#: libdw/dwarf_error.c:66
+#: libdw/dwarf_error.c:65
msgid "no ELF file"
msgstr "немає файла ELF"
-#: libdw/dwarf_error.c:67
+#: libdw/dwarf_error.c:66
msgid "cannot get ELF header"
msgstr "не вдалося отримати заголовок ELF"
-#: libdw/dwarf_error.c:69
+#: libdw/dwarf_error.c:68
msgid "not implemented"
msgstr "не реалізовано"
-#: libdw/dwarf_error.c:70 libelf/elf_error.c:107 libelf/elf_error.c:155
+#: libdw/dwarf_error.c:69 libelf/elf_error.c:111 libelf/elf_error.c:159
msgid "invalid command"
msgstr "некоректна команда"
-#: libdw/dwarf_error.c:71
+#: libdw/dwarf_error.c:70
msgid "invalid version"
msgstr "некоректна версія"
-#: libdw/dwarf_error.c:72
+#: libdw/dwarf_error.c:71
msgid "invalid file"
msgstr "некоректний файл"
-#: libdw/dwarf_error.c:73
+#: libdw/dwarf_error.c:72
msgid "no entries found"
msgstr "запис не знайдено"
-#: libdw/dwarf_error.c:74
+#: libdw/dwarf_error.c:73
msgid "invalid DWARF"
msgstr "некоректний запис DWARF"
-#: libdw/dwarf_error.c:75
+#: libdw/dwarf_error.c:74
msgid "no string data"
msgstr "немає рядкових даних"
+#: libdw/dwarf_error.c:75
+#, fuzzy
+msgid ".debug_str section missing"
+msgstr "немає розділу .debug_ranges"
+
#: libdw/dwarf_error.c:76
+#, fuzzy
+msgid ".debug_line_str section missing"
+msgstr "немає розділу .debug_line"
+
+#: libdw/dwarf_error.c:77
+#, fuzzy
+msgid ".debug_str_offsets section missing"
+msgstr "немає розділу .debug_ranges"
+
+#: libdw/dwarf_error.c:78
msgid "no address value"
msgstr "немає значення адреси"
-#: libdw/dwarf_error.c:77
+#: libdw/dwarf_error.c:79
msgid "no constant value"
msgstr "немає значення сталої"
-#: libdw/dwarf_error.c:78
+#: libdw/dwarf_error.c:80
msgid "no reference value"
msgstr "немає значення для порівняння"
-#: libdw/dwarf_error.c:79
+#: libdw/dwarf_error.c:81
msgid "invalid reference value"
msgstr "некоректне значення для порівняння"
-#: libdw/dwarf_error.c:80
+#: libdw/dwarf_error.c:82
msgid ".debug_line section missing"
msgstr "немає розділу .debug_line"
-#: libdw/dwarf_error.c:81
+#: libdw/dwarf_error.c:83
msgid "invalid .debug_line section"
msgstr "некоректний розділ .debug_line"
-#: libdw/dwarf_error.c:82
+#: libdw/dwarf_error.c:84
msgid "debug information too big"
msgstr "занадто великі відомості для діагностики"
-#: libdw/dwarf_error.c:83
+#: libdw/dwarf_error.c:85
msgid "invalid DWARF version"
msgstr "некоректна версія DWARF"
-#: libdw/dwarf_error.c:84
+#: libdw/dwarf_error.c:86
msgid "invalid directory index"
msgstr "некоректний покажчик каталогу"
-#: libdw/dwarf_error.c:85 libdwfl/libdwflP.h:74
+#: libdw/dwarf_error.c:87 libdwfl/libdwflP.h:71
msgid "address out of range"
msgstr "некоректна адреса"
-#: libdw/dwarf_error.c:86
-msgid "no location list value"
+#: libdw/dwarf_error.c:88
+#, fuzzy
+msgid ".debug_loc section missing"
+msgstr "немає розділу .debug_line"
+
+#: libdw/dwarf_error.c:89
+#, fuzzy
+msgid ".debug_loclists section missing"
+msgstr "немає розділу .debug_line"
+
+#: libdw/dwarf_error.c:90
+#, fuzzy
+msgid "not a location list value"
msgstr "немає значення списку адрес"
-#: libdw/dwarf_error.c:87
+#: libdw/dwarf_error.c:91
msgid "no block data"
msgstr "немає блокових даних"
-#: libdw/dwarf_error.c:88
+#: libdw/dwarf_error.c:92
msgid "invalid line index"
msgstr "некоректний номер рядка"
-#: libdw/dwarf_error.c:89
+#: libdw/dwarf_error.c:93
msgid "invalid address range index"
msgstr "некоректний індекс діапазону адрес"
-#: libdw/dwarf_error.c:90 libdwfl/libdwflP.h:75
+#: libdw/dwarf_error.c:94 libdwfl/libdwflP.h:72
msgid "no matching address range"
msgstr "не виявлено відповідного діапазону адрес"
-#: libdw/dwarf_error.c:91
+#: libdw/dwarf_error.c:95
msgid "no flag value"
msgstr "немає значення прапорця"
-#: libdw/dwarf_error.c:92 libelf/elf_error.c:232
+#: libdw/dwarf_error.c:96 libelf/elf_error.c:236
msgid "invalid offset"
msgstr "некоректне значення зміщення"
-#: libdw/dwarf_error.c:93
+#: libdw/dwarf_error.c:97
msgid ".debug_ranges section missing"
msgstr "немає розділу .debug_ranges"
-#: libdw/dwarf_error.c:94
+#: libdw/dwarf_error.c:98
+#, fuzzy
+msgid ".debug_rnglists section missing"
+msgstr "немає розділу .debug_ranges"
+
+#: libdw/dwarf_error.c:99
msgid "invalid CFI section"
msgstr "некоректний розділ CFI"
-#: libdw/dwarf_error.c:95
+#: libdw/dwarf_error.c:100
msgid "no alternative debug link found"
msgstr "альтернативного діагностичного посилання не знайдено"
-#: libdw/dwarf_error.c:96
+#: libdw/dwarf_error.c:101
msgid "invalid opcode"
msgstr "некоректний код операції"
-#: libdw/dwarf_error.c:97
+#: libdw/dwarf_error.c:102
msgid "not a CU (unit) DIE"
msgstr "не є DIE CU (модуля)"
-#: libdwfl/argp-std.c:46 src/stack.c:642 src/unstrip.c:2380
+#: libdw/dwarf_error.c:103
+#, fuzzy
+msgid "unknown language code"
+msgstr " невідомий код операції"
+
+#: libdw/dwarf_error.c:104
+#, fuzzy
+msgid ".debug_addr section missing"
+msgstr "немає розділу .debug_ranges"
+
+#: libdwfl/argp-std.c:50 src/stack.c:639 src/unstrip.c:2374
msgid "Input selection options:"
msgstr "Вибір параметрів виведення даних:"
-#: libdwfl/argp-std.c:47
+#: libdwfl/argp-std.c:51
msgid "Find addresses in FILE"
msgstr "Знайти адреси у ФАЙЛІ"
-#: libdwfl/argp-std.c:49
+#: libdwfl/argp-std.c:53
msgid "Find addresses from signatures found in COREFILE"
msgstr "Знайти адреси за сигнатурами з файла COREFILE"
-#: libdwfl/argp-std.c:51
+#: libdwfl/argp-std.c:55
msgid "Find addresses in files mapped into process PID"
msgstr "Знайти адреси у файлах, відображених на процес з PID"
-#: libdwfl/argp-std.c:53
+#: libdwfl/argp-std.c:57
msgid ""
"Find addresses in files mapped as read from FILE in Linux /proc/PID/maps "
"format"
@@ -273,198 +324,199 @@
"Знайти адреси у файлах, відображених як read за ФАЙЛОМ у форматі /proc/PID/"
"maps Linux"
-#: libdwfl/argp-std.c:55
+#: libdwfl/argp-std.c:59
msgid "Find addresses in the running kernel"
msgstr "Знайти адреси у запущеному ядрі"
-#: libdwfl/argp-std.c:57
+#: libdwfl/argp-std.c:61
msgid "Kernel with all modules"
msgstr "Ядро з усіма модулями"
-#: libdwfl/argp-std.c:59 src/stack.c:649
+#: libdwfl/argp-std.c:63 src/stack.c:646
msgid "Search path for separate debuginfo files"
msgstr "Шукати у вказаному каталозі окремі файли debuginfo"
-#: libdwfl/argp-std.c:157
+#: libdwfl/argp-std.c:164
msgid "only one of -e, -p, -k, -K, or --core allowed"
msgstr ""
"можна використовувати лише один за параметрів: -e, -p, -k, -K або --core"
-#: libdwfl/argp-std.c:230
+#: libdwfl/argp-std.c:237
msgid "cannot load kernel symbols"
msgstr "не вдалося завантажити символи ядра"
-#: libdwfl/argp-std.c:234
+#. Non-fatal to have no modules since we do have the kernel.
+#: libdwfl/argp-std.c:241
msgid "cannot find kernel modules"
msgstr "не вдалося виявити модулі ядра"
-#: libdwfl/argp-std.c:251
+#: libdwfl/argp-std.c:258
msgid "cannot find kernel or modules"
msgstr "не вдалося виявити ядро або модулі"
-#: libdwfl/argp-std.c:290
+#: libdwfl/argp-std.c:297
#, c-format
msgid "cannot read ELF core file: %s"
msgstr "не вдалося прочитати файл core ELF: %s"
-#: libdwfl/argp-std.c:313
+#: libdwfl/argp-std.c:320
#, fuzzy
msgid "Not enough memory"
msgstr "нестача пам'яті"
-#: libdwfl/argp-std.c:323
+#: libdwfl/argp-std.c:330
msgid "No modules recognized in core file"
msgstr "Не вдалося виявити модулі у файлі core"
-#: libdwfl/libdwflP.h:56
+#: libdwfl/libdwflP.h:53
msgid "See errno"
msgstr "Див. errno"
-#: libdwfl/libdwflP.h:57
+#: libdwfl/libdwflP.h:54
msgid "See elf_errno"
msgstr "Див. elf_errno"
-#: libdwfl/libdwflP.h:58
+#: libdwfl/libdwflP.h:55
msgid "See dwarf_errno"
msgstr "Див. dwarf_errno"
-#: libdwfl/libdwflP.h:59
+#: libdwfl/libdwflP.h:56
msgid "See ebl_errno (XXX missing)"
msgstr "Див. ebl_errno (не виявлено XXX)"
-#: libdwfl/libdwflP.h:60
+#: libdwfl/libdwflP.h:57
msgid "gzip decompression failed"
msgstr "Помилка під час спроби видобування з gzip"
-#: libdwfl/libdwflP.h:61
+#: libdwfl/libdwflP.h:58
msgid "bzip2 decompression failed"
msgstr "Помилка під час спроби видобування з bzip2"
-#: libdwfl/libdwflP.h:62
+#: libdwfl/libdwflP.h:59
msgid "LZMA decompression failed"
msgstr "Помилка під час спроби видобування з LZMA"
-#: libdwfl/libdwflP.h:63
+#: libdwfl/libdwflP.h:60
msgid "no support library found for machine"
msgstr "у системі не виявлено бібліотеки підтримки"
-#: libdwfl/libdwflP.h:64
+#: libdwfl/libdwflP.h:61
msgid "Callbacks missing for ET_REL file"
msgstr "Немає зворотних викликів для файла ET_REL"
-#: libdwfl/libdwflP.h:65
+#: libdwfl/libdwflP.h:62
msgid "Unsupported relocation type"
msgstr "Непідтримуваний тип пересування"
-#: libdwfl/libdwflP.h:66
+#: libdwfl/libdwflP.h:63
msgid "r_offset is bogus"
msgstr "r_offset є фіктивним"
-#: libdwfl/libdwflP.h:67 libelf/elf_error.c:111 libelf/elf_error.c:171
+#: libdwfl/libdwflP.h:64 libelf/elf_error.c:115 libelf/elf_error.c:175
msgid "offset out of range"
msgstr "перевищення можливого зміщення"
-#: libdwfl/libdwflP.h:68
+#: libdwfl/libdwflP.h:65
msgid "relocation refers to undefined symbol"
msgstr "пересування посилається на невизначений символ."
-#: libdwfl/libdwflP.h:69
+#: libdwfl/libdwflP.h:66
msgid "Callback returned failure"
msgstr "Зворотним викликом повернуто помилку"
-#: libdwfl/libdwflP.h:70
+#: libdwfl/libdwflP.h:67
msgid "No DWARF information found"
msgstr "Не виявлено відомостей DWARF"
-#: libdwfl/libdwflP.h:71
+#: libdwfl/libdwflP.h:68
msgid "No symbol table found"
msgstr "Не виявлено таблиці символів"
-#: libdwfl/libdwflP.h:72
+#: libdwfl/libdwflP.h:69
msgid "No ELF program headers"
msgstr "Немає заголовків програми ELF"
-#: libdwfl/libdwflP.h:73
+#: libdwfl/libdwflP.h:70
msgid "address range overlaps an existing module"
msgstr "діапазон адрес перекриває існуючий модуль"
-#: libdwfl/libdwflP.h:76
+#: libdwfl/libdwflP.h:73
msgid "image truncated"
msgstr "образ обрізано"
-#: libdwfl/libdwflP.h:77
+#: libdwfl/libdwflP.h:74
msgid "ELF file opened"
msgstr "Відкритий файл ELF"
-#: libdwfl/libdwflP.h:78
+#: libdwfl/libdwflP.h:75
msgid "not a valid ELF file"
msgstr "не є коректним файлом ELF"
-#: libdwfl/libdwflP.h:79
+#: libdwfl/libdwflP.h:76
msgid "cannot handle DWARF type description"
msgstr "не вдалося обробити опис типу DWARF"
-#: libdwfl/libdwflP.h:80
+#: libdwfl/libdwflP.h:77
msgid "ELF file does not match build ID"
msgstr "Файл ELF не відповідає ідентифікатору збирання"
-#: libdwfl/libdwflP.h:81
+#: libdwfl/libdwflP.h:78
msgid "corrupt .gnu.prelink_undo section data"
msgstr "дані розділу «.gnu.prelink_undo» пошкоджено"
-#: libdwfl/libdwflP.h:82
+#: libdwfl/libdwflP.h:79
msgid "Internal error due to ebl"
msgstr "Внутрішня помилка через ebl"
-#: libdwfl/libdwflP.h:83
+#: libdwfl/libdwflP.h:80
msgid "Missing data in core file"
msgstr "У файлі ядра не вистачає даних"
-#: libdwfl/libdwflP.h:84
+#: libdwfl/libdwflP.h:81
msgid "Invalid register"
msgstr "Некоректний регістр"
-#: libdwfl/libdwflP.h:85
+#: libdwfl/libdwflP.h:82
msgid "Error reading process memory"
msgstr "Помилка під час спроби читання пам’яті процесу"
-#: libdwfl/libdwflP.h:86
+#: libdwfl/libdwflP.h:83
msgid "Couldn't find architecture of any ELF"
msgstr "Не вдалося знайти хоч якусь архітектуру ELF"
-#: libdwfl/libdwflP.h:87
+#: libdwfl/libdwflP.h:84
msgid "Error parsing /proc filesystem"
msgstr "Помилка під час спроби обробки файлової системи /proc"
-#: libdwfl/libdwflP.h:88
+#: libdwfl/libdwflP.h:85
msgid "Invalid DWARF"
msgstr "Некоректний запис DWARF"
-#: libdwfl/libdwflP.h:89
+#: libdwfl/libdwflP.h:86
msgid "Unsupported DWARF"
msgstr "Непідтримуваний запис DWARF"
-#: libdwfl/libdwflP.h:90
+#: libdwfl/libdwflP.h:87
msgid "Unable to find more threads"
msgstr "Не вдалося знайти додаткові потоки"
-#: libdwfl/libdwflP.h:91
+#: libdwfl/libdwflP.h:88
msgid "Dwfl already has attached state"
msgstr "Dwfl уже перебуває у стані долучення до процесу"
-#: libdwfl/libdwflP.h:92
+#: libdwfl/libdwflP.h:89
msgid "Dwfl has no attached state"
msgstr "Dwfl не перебуває у стані долучення до процесу"
-#: libdwfl/libdwflP.h:93
+#: libdwfl/libdwflP.h:90
msgid "Unwinding not supported for this architecture"
msgstr "Для цієї архітектури розгортання не передбачено"
-#: libdwfl/libdwflP.h:94
+#: libdwfl/libdwflP.h:91
msgid "Invalid argument"
msgstr "Некоректний аргумент"
-#: libdwfl/libdwflP.h:95
+#: libdwfl/libdwflP.h:92
msgid "Not an ET_CORE ELF file"
msgstr "Не є файлом ET_CORE ELF"
@@ -472,14 +524,14 @@
msgid "No backend"
msgstr "Немає сервера"
-#: libebl/eblcorenotetypename.c:98 libebl/eblobjecttypename.c:53
-#: libebl/eblobjnotetypename.c:69 libebl/eblosabiname.c:73
-#: libebl/eblsectionname.c:83 libebl/eblsectiontypename.c:115
-#: libebl/eblsegmenttypename.c:79
+#: libebl/eblcorenotetypename.c:100 libebl/eblobjnotetypename.c:76
+#: libebl/eblobjnotetypename.c:83 libebl/eblobjnotetypename.c:102
+#: libebl/eblosabiname.c:73 libebl/eblsectionname.c:83
+#: libebl/eblsectiontypename.c:115 libebl/eblsegmenttypename.c:79
msgid "<unknown>"
msgstr "<невідомо>"
-#: libebl/ebldynamictagname.c:101
+#: libebl/ebldynamictagname.c:103
#, c-format
msgid "<unknown>: %#<PRIx64>"
msgstr "<невідомо>: %#<PRIx64>"
@@ -529,6 +581,7 @@
msgid " Build ID: "
msgstr " Ід. збирання: "
+#. A non-null terminated version string.
#: libebl/eblobjnote.c:152
#, c-format
msgid " Linker version: %.*s\n"
@@ -568,7 +621,7 @@
msgid "invalid size of destination operand"
msgstr "некоректна розмірність вихідного параметра"
-#: libelf/elf_error.c:87 src/readelf.c:5473
+#: libelf/elf_error.c:87 src/readelf.c:6107
#, c-format
msgid "invalid encoding"
msgstr "некоректне кодування"
@@ -578,152 +631,157 @@
msgstr "некоректний дескриптор файла"
#: libelf/elf_error.c:99
+#, fuzzy
+msgid "invalid ELF file data"
+msgstr "некоректний файл ELF"
+
+#: libelf/elf_error.c:103
msgid "invalid operation"
msgstr "недійсна дія"
-#: libelf/elf_error.c:103
+#: libelf/elf_error.c:107
msgid "ELF version not set"
msgstr "версію ELF не вказано"
-#: libelf/elf_error.c:115
+#: libelf/elf_error.c:119
msgid "invalid fmag field in archive header"
msgstr "некоректне поле fmag у заголовку архіву"
-#: libelf/elf_error.c:119
+#: libelf/elf_error.c:123
msgid "invalid archive file"
msgstr "некоректний файл архіву"
-#: libelf/elf_error.c:123
+#: libelf/elf_error.c:127
msgid "descriptor is not for an archive"
msgstr "дескриптор не належить архіву"
-#: libelf/elf_error.c:127
+#: libelf/elf_error.c:131
msgid "no index available"
msgstr "такого номера немає"
-#: libelf/elf_error.c:131
+#: libelf/elf_error.c:135
msgid "cannot read data from file"
msgstr "не вдалося прочитати дані з файла"
-#: libelf/elf_error.c:135
+#: libelf/elf_error.c:139
msgid "cannot write data to file"
msgstr "не вдалося записати дані до файла"
-#: libelf/elf_error.c:139
+#: libelf/elf_error.c:143
msgid "invalid binary class"
msgstr "некоректний бінарний клас"
-#: libelf/elf_error.c:143
+#: libelf/elf_error.c:147
msgid "invalid section index"
msgstr "некоректний номер розділу"
-#: libelf/elf_error.c:147
+#: libelf/elf_error.c:151
msgid "invalid operand"
msgstr "некоректний параметр"
-#: libelf/elf_error.c:151
+#: libelf/elf_error.c:155
msgid "invalid section"
msgstr "некоректний розділ"
-#: libelf/elf_error.c:159
+#: libelf/elf_error.c:163
msgid "executable header not created first"
msgstr "заголовок виконуваного файла не було створено першим"
-#: libelf/elf_error.c:163
+#: libelf/elf_error.c:167
msgid "file descriptor disabled"
msgstr "дескриптор файла вимкнено"
-#: libelf/elf_error.c:167
+#: libelf/elf_error.c:171
msgid "archive/member file descriptor mismatch"
msgstr "невідповідність дескрипторів файлів архіву/елемента"
-#: libelf/elf_error.c:175
+#: libelf/elf_error.c:179
msgid "cannot manipulate null section"
msgstr "не можна оперувати нульовим розділом"
-#: libelf/elf_error.c:179
+#: libelf/elf_error.c:183
msgid "data/scn mismatch"
msgstr "невідповідність полів data/scn"
-#: libelf/elf_error.c:183
+#: libelf/elf_error.c:187
msgid "invalid section header"
msgstr "некоректний заголовок розділу"
-#: libelf/elf_error.c:187 src/readelf.c:7342 src/readelf.c:7790
-#: src/readelf.c:7891 src/readelf.c:8072
+#: libelf/elf_error.c:191 src/readelf.c:9742 src/readelf.c:10313
+#: src/readelf.c:10414 src/readelf.c:10595
#, c-format
msgid "invalid data"
msgstr "некоректні дані"
-#: libelf/elf_error.c:191
+#: libelf/elf_error.c:195
msgid "unknown data encoding"
msgstr "невідоме кодування даних"
-#: libelf/elf_error.c:195
+#: libelf/elf_error.c:199
msgid "section `sh_size' too small for data"
msgstr "розділ «sh_size» є замалим для даних"
-#: libelf/elf_error.c:199
+#: libelf/elf_error.c:203
msgid "invalid section alignment"
msgstr "некоректне вирівнювання розділу"
-#: libelf/elf_error.c:203
+#: libelf/elf_error.c:207
msgid "invalid section entry size"
msgstr "некоректна розмірність запису розділу"
-#: libelf/elf_error.c:207
+#: libelf/elf_error.c:211
msgid "update() for write on read-only file"
msgstr "update() для запису придатного лише для читання файла"
-#: libelf/elf_error.c:211
+#: libelf/elf_error.c:215
msgid "no such file"
msgstr "такого файла не виявлено"
-#: libelf/elf_error.c:215
+#: libelf/elf_error.c:219
msgid "only relocatable files can contain section groups"
msgstr "містити групи розділів можуть лише придатні до пересування файли"
-#: libelf/elf_error.c:220
+#: libelf/elf_error.c:224
msgid ""
"program header only allowed in executables, shared objects, and core files"
msgstr ""
"заголовок програми можна використовувати лише у виконуваних файлах, об’єктах "
"спільного використання та файлах ядра"
-#: libelf/elf_error.c:227
+#: libelf/elf_error.c:231
msgid "file has no program header"
msgstr "у файлі немає заголовка програми"
-#: libelf/elf_error.c:237
+#: libelf/elf_error.c:241
#, fuzzy
msgid "invalid section type"
msgstr "некоректний розділ"
-#: libelf/elf_error.c:242
+#: libelf/elf_error.c:246
#, fuzzy
msgid "invalid section flags"
msgstr "некоректний розділ"
-#: libelf/elf_error.c:247
+#: libelf/elf_error.c:251
#, fuzzy
msgid "section does not contain compressed data"
msgstr "розділ хешу [%2zu] «%s» містить недостатньо даних\n"
-#: libelf/elf_error.c:252
+#: libelf/elf_error.c:256
msgid "section contains compressed data"
msgstr ""
-#: libelf/elf_error.c:257
+#: libelf/elf_error.c:261
#, fuzzy
msgid "unknown compression type"
msgstr "невизначений тип"
-#: libelf/elf_error.c:262
+#: libelf/elf_error.c:266
#, fuzzy
msgid "cannot compress data"
msgstr "не вдалося розпакувати DWARF"
-#: libelf/elf_error.c:267
+#: libelf/elf_error.c:271
#, fuzzy
msgid "cannot decompress data"
msgstr "не вдалося розпакувати DWARF"
@@ -784,59 +842,38 @@
msgid "Print all information on one line, and indent inlines"
msgstr "Вивести усі дані у один рядок і додати відступи до перенесених рядків"
-#: src/addr2line.c:79 src/elfcmp.c:72 src/findtextrel.c:67 src/nm.c:100
+#: src/addr2line.c:79 src/elfcmp.c:71 src/findtextrel.c:66 src/nm.c:101
#: src/strings.c:79
msgid "Miscellaneous:"
msgstr "Інше:"
+#. Short description of program.
#: src/addr2line.c:87
msgid ""
"Locate source files and line information for ADDRs (in a.out by default)."
msgstr "Шукати АДРЕСИ у файлах кодів та даних про рядки (типово, у a.out)."
+#. Strings for arguments in help texts.
#: src/addr2line.c:91
msgid "[ADDR...]"
msgstr "[АДРЕСА...]"
-#: src/addr2line.c:216 src/ar.c:285 src/elfcmp.c:672 src/elflint.c:235
-#: src/findtextrel.c:162 src/ld.c:943 src/nm.c:262 src/objdump.c:177
-#: src/ranlib.c:124 src/readelf.c:509 src/size.c:207 src/strings.c:230
-#: src/strip.c:218 src/unstrip.c:232
-#, c-format
-msgid ""
-"Copyright (C) %s Red Hat, Inc.\n"
-"This is free software; see the source for copying conditions. There is NO\n"
-"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
-msgstr ""
-"© Red Hat, Inc., %s\n"
-"Це програмне забезпечення є вільним, умови копіювання викладено у його "
-"початкових кодах. Умовами ліцензування програми НЕ передбачено жодних "
-"гарантій, зокрема гарантій працездатності або придатності для певної мети.\n"
-
-#: src/addr2line.c:221 src/ar.c:290 src/elfcmp.c:677 src/elflint.c:240
-#: src/findtextrel.c:167 src/ld.c:948 src/nm.c:267 src/objdump.c:182
-#: src/ranlib.c:129 src/readelf.c:514 src/size.c:212 src/strings.c:235
-#: src/strip.c:223 src/unstrip.c:237
-#, c-format
-msgid "Written by %s.\n"
-msgstr "Автор — %s.\n"
-
-#: src/addr2line.c:533
+#: src/addr2line.c:520
#, c-format
msgid "Section syntax requires exactly one module"
msgstr "Синтаксис розділів вимагає точного одного модуля"
-#: src/addr2line.c:556
+#: src/addr2line.c:543
#, c-format
msgid "offset %#<PRIxMAX> lies outside section '%s'"
msgstr "зміщення %#<PRIxMAX> розташовано поза межами розділу «%s»"
-#: src/addr2line.c:645
+#: src/addr2line.c:633
#, c-format
msgid "cannot find symbol '%s'"
msgstr "не вдалося знайти символ «%s»"
-#: src/addr2line.c:650
+#: src/addr2line.c:638
#, c-format
msgid "offset %#<PRIxMAX> lies outside contents of '%s'"
msgstr "зміщення %#<PRIxMAX> розташовано поза межами вмісту «%s»"
@@ -925,10 +962,12 @@
msgid "Update only older files in archive."
msgstr "Оновлювати у архіві лише старіші файли."
+#. Short description of program.
#: src/ar.c:99
msgid "Create, modify, and extract from archives."
msgstr "Створення, зміна архівів і видобування даних з архівів."
+#. Strings for arguments in help texts.
#: src/ar.c:102
msgid "[MEMBER] [COUNT] ARCHIVE [FILE...]"
msgstr "[ЕЛЕМЕНТ] [НОМЕР] АРХІВ [ФАЙЛ...]"
@@ -976,121 +1015,146 @@
msgid "command option required"
msgstr "має бути вказано параметр команди"
-#: src/ar.c:310
+#: src/ar.c:296
#, c-format
msgid "More than one operation specified"
msgstr "Вказано більше за одну дію"
-#: src/ar.c:404
+#: src/ar.c:390
#, c-format
msgid "cannot open archive '%s'"
msgstr "не вдалося відкрити архів «%s»"
-#: src/ar.c:414
+#: src/ar.c:400
#, c-format
msgid "cannot open archive '%s': %s"
msgstr "не вдалося відкрити архів «%s»: %s"
-#: src/ar.c:418
+#: src/ar.c:404
#, c-format
msgid "%s: not an archive file"
msgstr "%s: не є файлом архіву"
-#: src/ar.c:422
+#: src/ar.c:408
#, c-format
msgid "cannot stat archive '%s'"
msgstr "не вдалося отримати дані архіву «%s» за допомогою stat"
-#: src/ar.c:434
+#: src/ar.c:420
#, c-format
msgid "no entry %s in archive\n"
msgstr "у архіві немає запису %s\n"
-#: src/ar.c:487 src/ar.c:929 src/ar.c:1129
+#: src/ar.c:473 src/ar.c:918 src/ar.c:1122
#, c-format
msgid "cannot create hash table"
msgstr "не вдалося створити таблицю хешів"
-#: src/ar.c:494 src/ar.c:936 src/ar.c:1138
+#: src/ar.c:480 src/ar.c:925 src/ar.c:1131
#, c-format
msgid "cannot insert into hash table"
msgstr "не вдалося вставити запис до таблиці хешів"
-#: src/ar.c:502 src/ranlib.c:164
+#: src/ar.c:488 src/ranlib.c:149
#, c-format
msgid "cannot stat '%s'"
msgstr "не вдалося отримати дані з «%s» за допомогою stat"
-#: src/ar.c:598
+#: src/ar.c:584
#, c-format
msgid "cannot read content of %s: %s"
msgstr "не вдалося прочитати вміст з %s: %s"
-#: src/ar.c:641
+#: src/ar.c:627
#, c-format
msgid "cannot open %.*s"
msgstr "не вдалося відкрити %.*s"
-#: src/ar.c:663
+#: src/ar.c:649
#, c-format
msgid "failed to write %s"
msgstr "не вдалося записати %s"
-#: src/ar.c:675
+#: src/ar.c:661
#, c-format
msgid "cannot change mode of %s"
msgstr "не вдалося змінити права доступу до %s"
-#: src/ar.c:691
+#: src/ar.c:677
#, c-format
msgid "cannot change modification time of %s"
msgstr "не вдалося змінити часову мітку зміни %s"
-#: src/ar.c:737
+#: src/ar.c:723
#, c-format
msgid "cannot rename temporary file to %.*s"
msgstr "не вдалося перейменувати файл тимчасових даних на %.*s"
-#: src/ar.c:773 src/ar.c:1021 src/ar.c:1420 src/ranlib.c:238
+#: src/ar.c:759 src/ar.c:1010 src/ar.c:1411 src/ranlib.c:223
#, c-format
msgid "cannot create new file"
msgstr "не вдалося створити файл"
-#: src/ar.c:1220
+#: src/ar.c:1213
#, c-format
msgid "position member %s not found"
msgstr "не виявлено елемента позиції %s"
-#: src/ar.c:1230
+#: src/ar.c:1223
#, c-format
msgid "%s: no entry %s in archive!\n"
msgstr "%s: у архіві немає запису %s!\n"
-#: src/ar.c:1259 src/ldgeneric.c:509 src/objdump.c:253
+#: src/ar.c:1252 src/objdump.c:242
#, c-format
msgid "cannot open %s"
msgstr "не вдалося відкрити %s"
-#: src/ar.c:1264
+#: src/ar.c:1257
#, c-format
msgid "cannot stat %s"
msgstr "не вдалося отримати дані %s за допомогою stat"
-#: src/ar.c:1270
+#: src/ar.c:1263
#, c-format
msgid "%s is no regular file"
msgstr "%s не є звичайним файлом"
-#: src/ar.c:1283
+#: src/ar.c:1276
#, c-format
msgid "cannot get ELF descriptor for %s: %s\n"
msgstr "не вдалося отримати дескриптор ELF для %s: %s\n"
-#: src/ar.c:1303
+#: src/ar.c:1296
#, c-format
msgid "cannot read %s: %s"
msgstr "не вдалося прочитати %s: %s"
+#: src/ar.c:1471
+#, fuzzy, c-format
+msgid "cannot represent ar_date"
+msgstr "не вдалося розпакувати DWARF"
+
+#: src/ar.c:1477
+#, fuzzy, c-format
+msgid "cannot represent ar_uid"
+msgstr "не вдалося розпакувати DWARF"
+
+#: src/ar.c:1483
+#, fuzzy, c-format
+msgid "cannot represent ar_gid"
+msgstr "не вдалося розпакувати DWARF"
+
+#: src/ar.c:1489
+#, fuzzy, c-format
+msgid "cannot represent ar_mode"
+msgstr "не вдалося отримати назву розділу"
+
+#: src/ar.c:1495
+#, fuzzy, c-format
+msgid "cannot represent ar_size"
+msgstr "не вдалося відкрити %s"
+
#: src/arlib-argp.c:32
msgid "Use zero for uid, gid, and date in archive members."
msgstr ""
@@ -1106,25 +1170,26 @@
msgid "%s (default)"
msgstr "%s (типово)"
-#: src/arlib.c:209
+#. The archive is too big.
+#: src/arlib.c:213
#, c-format
msgid "the archive '%s' is too large"
msgstr "розмір архіву «%s» є занадто великим"
-#: src/arlib.c:222
+#: src/arlib.c:226
#, c-format
msgid "cannot read ELF header of %s(%s): %s"
msgstr "не вдалося прочитати заголовок ELF з %s(%s): %s"
-#: src/elfcmp.c:62
+#: src/elfcmp.c:61
msgid "Control options:"
msgstr "Параметри керування:"
-#: src/elfcmp.c:64
+#: src/elfcmp.c:63
msgid "Output all differences, not just the first"
msgstr "Показати всі відмінності, не лише першу з них"
-#: src/elfcmp.c:65
+#: src/elfcmp.c:64
msgid ""
"Control treatment of gaps in loadable segments [ignore|match] (default: "
"ignore)"
@@ -1132,97 +1197,99 @@
"Керування обробкою проміжків у придатних до завантаження сегментах [ignore|"
"match] (типово, ignore)"
-#: src/elfcmp.c:67
+#: src/elfcmp.c:66
msgid "Ignore permutation of buckets in SHT_HASH section"
msgstr "Ігнорувати переставляння блоків у розділі SHT_HASH"
-#: src/elfcmp.c:69
+#: src/elfcmp.c:68
msgid "Ignore differences in build ID"
msgstr "Ігнорувати відмінності у ідентифікаторі збирання"
-#: src/elfcmp.c:70
+#: src/elfcmp.c:69
msgid "Output nothing; yield exit status only"
msgstr "Нічого не виводити; визначити лише стан виходу"
-#: src/elfcmp.c:77
+#. Short description of program.
+#: src/elfcmp.c:76
msgid "Compare relevant parts of two ELF files for equality."
msgstr "Порівнює відповідні частини двох файлів ELF."
-#: src/elfcmp.c:81
+#. Strings for arguments in help texts.
+#: src/elfcmp.c:80
msgid "FILE1 FILE2"
msgstr "ФАЙЛ1 ФАЙЛ2"
-#: src/elfcmp.c:143
+#: src/elfcmp.c:142
msgid "Invalid number of parameters.\n"
msgstr "Некоректна кількість параметрів.\n"
-#: src/elfcmp.c:174 src/elfcmp.c:179
+#: src/elfcmp.c:173 src/elfcmp.c:178
#, c-format
msgid "cannot get ELF header of '%s': %s"
msgstr "не вдалося отримати заголовок ELF «%s»: %s"
-#: src/elfcmp.c:205
+#: src/elfcmp.c:204
#, c-format
msgid "%s %s diff: ELF header"
msgstr "%s %s diff: заголовок ELF"
-#: src/elfcmp.c:212 src/elfcmp.c:215
+#: src/elfcmp.c:211 src/elfcmp.c:214
#, c-format
msgid "cannot get section count of '%s': %s"
msgstr "не вдалося отримати даних щодо кількості розділів «%s»: %s"
-#: src/elfcmp.c:220
+#: src/elfcmp.c:219
#, c-format
msgid "%s %s diff: section count"
msgstr "%s %s diff: кількість розділів"
-#: src/elfcmp.c:227 src/elfcmp.c:230
+#: src/elfcmp.c:226 src/elfcmp.c:229
#, c-format
msgid "cannot get program header count of '%s': %s"
msgstr ""
"не вдалося отримати даних щодо кількості заголовків програми у «%s»: %s"
-#: src/elfcmp.c:235
+#: src/elfcmp.c:234
#, c-format
msgid "%s %s diff: program header count"
msgstr "%s %s diff: кількість заголовків програми"
-#: src/elfcmp.c:293
+#: src/elfcmp.c:292
#, c-format
msgid "%s %s differ: section [%zu], [%zu] name"
msgstr "%s %s diff: розділ [%zu], назва [%zu]"
-#: src/elfcmp.c:316
+#: src/elfcmp.c:315
#, c-format
msgid "%s %s differ: section [%zu] '%s' header"
msgstr "%s %s diff: розділ [%zu] заголовок «%s»"
-#: src/elfcmp.c:324 src/elfcmp.c:330
+#: src/elfcmp.c:323 src/elfcmp.c:329
#, c-format
msgid "cannot get content of section %zu in '%s': %s"
msgstr "не вдалося отримати вміст розділу %zu у «%s»: %s"
-#: src/elfcmp.c:339
+#: src/elfcmp.c:338
#, c-format
msgid "symbol table [%zu] in '%s' has zero sh_entsize"
msgstr "таблиця символів [%zu] у «%s» містить нульове значення sh_entsize"
-#: src/elfcmp.c:351 src/elfcmp.c:357
+#: src/elfcmp.c:350 src/elfcmp.c:356
#, c-format
msgid "cannot get symbol in '%s': %s"
msgstr "не вдалося отримати символ у «%s»: %s"
-#: src/elfcmp.c:379
+#: src/elfcmp.c:378
#, c-format
msgid "%s %s differ: symbol table [%zu]"
msgstr "%s %s diff: таблиця символів [%zu]"
-#: src/elfcmp.c:382
+#: src/elfcmp.c:381
#, c-format
msgid "%s %s differ: symbol table [%zu,%zu]"
msgstr "%s %s diff: таблиця символів [%zu,%zu]"
-#: src/elfcmp.c:428 src/elfcmp.c:497
+#: src/elfcmp.c:428 src/elfcmp.c:498
#, c-format
msgid "%s %s differ: section [%zu] '%s' number of notes"
msgstr "%s %s diff: розділ [%zu] кількість нотаток «%s»"
@@ -1232,104 +1299,176 @@
msgid "cannot read note section [%zu] '%s' in '%s': %s"
msgstr "не вдалося прочитати розділ нотаток [%zu] «%s» у «%s»: %s"
-#: src/elfcmp.c:446
+#: src/elfcmp.c:447
#, c-format
msgid "%s %s differ: section [%zu] '%s' note name"
msgstr "%s %s diff: розділ [%zu] назва нотатки «%s»"
-#: src/elfcmp.c:454
+#: src/elfcmp.c:455
#, c-format
msgid "%s %s differ: section [%zu] '%s' note '%s' type"
msgstr "%s %s diff: розділ [%zu] нотатка «%s» тип «%s»"
-#: src/elfcmp.c:469
+#: src/elfcmp.c:470
#, c-format
msgid "%s %s differ: build ID length"
msgstr "%s %s diff: довжина ідентифікатора збирання"
-#: src/elfcmp.c:477
+#: src/elfcmp.c:478
#, c-format
msgid "%s %s differ: build ID content"
msgstr "%s %s diff: вміст ідентифікатора збирання"
-#: src/elfcmp.c:486
+#: src/elfcmp.c:487
#, c-format
msgid "%s %s differ: section [%zu] '%s' note '%s' content"
msgstr "%s %s diff: розділ [%zu] нотатка «%s» вміст «%s»"
-#: src/elfcmp.c:527
+#: src/elfcmp.c:528
#, c-format
msgid "%s %s differ: section [%zu] '%s' content"
msgstr "%s %s diff: розділ [%zu] «%s», вміст"
-#: src/elfcmp.c:531
+#: src/elfcmp.c:532
#, c-format
msgid "%s %s differ: section [%zu,%zu] '%s' content"
msgstr "%s %s diff: розділ [%zu,%zu] «%s», вміст"
-#: src/elfcmp.c:546
+#: src/elfcmp.c:547
#, c-format
msgid "%s %s differ: unequal amount of important sections"
msgstr "%s %s diff: невідповідність об’ємів важливих розділів"
-#: src/elfcmp.c:579 src/elfcmp.c:584
+#: src/elfcmp.c:580 src/elfcmp.c:585
#, c-format
msgid "cannot load data of '%s': %s"
msgstr "не вдалося завантажити дані «%s»: %s"
-#: src/elfcmp.c:603 src/elfcmp.c:609
+#: src/elfcmp.c:604 src/elfcmp.c:610
#, c-format
msgid "cannot get program header entry %d of '%s': %s"
msgstr "не вдалося отримати запис заголовка програми %d «%s»: %s"
-#: src/elfcmp.c:615
+#: src/elfcmp.c:616
#, c-format
msgid "%s %s differ: program header %d"
msgstr "%s %s diff: заголовок програми %d"
-#: src/elfcmp.c:639
+#: src/elfcmp.c:640
#, c-format
msgid "%s %s differ: gap"
msgstr "%s %s diff: проміжок"
-#: src/elfcmp.c:704
+#: src/elfcmp.c:691
#, c-format
msgid "Invalid value '%s' for --gaps parameter."
msgstr "Некоректне значення «%s» параметра --gaps."
-#: src/elfcmp.c:732 src/findtextrel.c:221 src/ldgeneric.c:1757
-#: src/ldgeneric.c:4247 src/nm.c:378 src/ranlib.c:157 src/size.c:289
-#: src/strings.c:186 src/strip.c:466 src/strip.c:503 src/unstrip.c:2029
-#: src/unstrip.c:2058
+#: src/elfcmp.c:719 src/findtextrel.c:206 src/nm.c:365 src/ranlib.c:142
+#: src/size.c:273 src/strings.c:186 src/strip.c:518 src/strip.c:555
+#: src/unstrip.c:2023 src/unstrip.c:2052
#, c-format
msgid "cannot open '%s'"
msgstr "не вдалося відкрити «%s»"
-#: src/elfcmp.c:736 src/findtextrel.c:228 src/ranlib.c:174
+#: src/elfcmp.c:723 src/findtextrel.c:213 src/ranlib.c:159
#, c-format
msgid "cannot create ELF descriptor for '%s': %s"
msgstr "не вдалося створити дескриптор ELF для «%s»: %s"
-#: src/elfcmp.c:741
+#: src/elfcmp.c:728
#, c-format
msgid "cannot create EBL descriptor for '%s'"
msgstr "не вдалося створити дескриптор EBL для «%s»"
-#: src/elfcmp.c:759 src/findtextrel.c:409
+#: src/elfcmp.c:746 src/findtextrel.c:394
#, c-format
msgid "cannot get section header of section %zu: %s"
msgstr "не вдалося отримати заголовок розділу %zu: %s"
-#: src/elfcmp.c:769
+#: src/elfcmp.c:756
#, c-format
msgid "cannot get content of section %zu: %s"
msgstr "не вдалося отримати вміст розділу %zu: %s"
-#: src/elfcmp.c:779 src/elfcmp.c:793
+#: src/elfcmp.c:766 src/elfcmp.c:780
#, c-format
msgid "cannot get relocation: %s"
msgstr "не вдалося отримати пересування: %s"
+#: src/elfcompress.c:115 src/strip.c:297 src/unstrip.c:121
+#, c-format
+msgid "-o option specified twice"
+msgstr "параметр -o вказано двічі"
+
+#: src/elfcompress.c:122
+#, fuzzy, c-format
+msgid "-t option specified twice"
+msgstr "параметр -f вказано двічі"
+
+#: src/elfcompress.c:131
+#, fuzzy, c-format
+msgid "unknown compression type '%s'"
+msgstr "невизначений тип"
+
+#. We need at least one input file.
+#: src/elfcompress.c:143 src/elfcompress.c:1305
+#, fuzzy, c-format
+msgid "No input file given"
+msgstr "вхідний файл є порожнім"
+
+#: src/elfcompress.c:149 src/elfcompress.c:1310
+#, fuzzy, c-format
+msgid "Only one input file allowed together with '-o'"
+msgstr ""
+"Разом з «-o» або «-f» можна використовувати лише один файл вхідних даних"
+
+#: src/elfcompress.c:1267
+#, fuzzy
+msgid "Place (de)compressed output into FILE"
+msgstr "Вивести дані після вилучення до ФАЙЛа"
+
+#: src/elfcompress.c:1270
+msgid ""
+"What type of compression to apply. TYPE can be 'none' (decompress), "
+"'zlib' (ELF ZLIB compression, the default, 'zlib-gabi' is an alias) or 'zlib-"
+"gnu' (.zdebug GNU style compression, 'gnu' is an alias)"
+msgstr ""
+
+#: src/elfcompress.c:1273
+msgid ""
+"SECTION name to (de)compress, SECTION is an extended wildcard pattern "
+"(defaults to '.?(z)debug*')"
+msgstr ""
+
+#: src/elfcompress.c:1276
+msgid "Print a message for each section being (de)compressed"
+msgstr ""
+
+#: src/elfcompress.c:1279
+msgid "Force compression of section even if it would become larger"
+msgstr ""
+
+#: src/elfcompress.c:1282 src/strip.c:91
+msgid "Relax a few rules to handle slightly broken ELF files"
+msgstr ""
+"Знехтувати декількома правилами для обробки трохи пошкоджених файлів ELF"
+
+#: src/elfcompress.c:1285
+#, fuzzy
+msgid "Be silent when a section cannot be compressed"
+msgstr ""
+"розділ [%2zu] «%s»: адреса розділів локальних даних потоків не є нульовою\n"
+
+#. Strings for arguments in help texts.
+#: src/elfcompress.c:1294 src/elflint.c:78 src/readelf.c:154
+msgid "FILE..."
+msgstr "ФАЙЛ..."
+
+#: src/elfcompress.c:1295
+msgid "Compress or decompress sections in an ELF file."
+msgstr ""
+
#: src/elflint.c:64
msgid "Be extremely strict, flag level 2 features."
msgstr "Висока строгість, увімкнути можливості рівня 2."
@@ -1350,16 +1489,13 @@
"Бінарний файл було створено за допомогою GNU ld, тому він, очевидно, є до "
"певної міри неправильним"
+#. Short description of program.
#: src/elflint.c:74
msgid "Pedantic checking of ELF files compliance with gABI/psABI spec."
msgstr ""
"Педантична перевірка файлів ELF на сумісність зі специфікаціями gABI/psABI."
-#: src/elflint.c:78 src/readelf.c:126
-msgid "FILE..."
-msgstr "ФАЙЛ..."
-
-#: src/elflint.c:155 src/readelf.c:298
+#: src/elflint.c:155 src/readelf.c:347
#, c-format
msgid "cannot open input file"
msgstr "не вдалося відкрити вхідний файл."
@@ -1378,138 +1514,149 @@
msgid "No errors"
msgstr "Без помилок"
-#: src/elflint.c:219 src/readelf.c:474
+#: src/elflint.c:220 src/readelf.c:546
msgid "Missing file name.\n"
msgstr "Не вказано назви файла.\n"
-#: src/elflint.c:298
+#: src/elflint.c:285
#, c-format
msgid " error while freeing sub-ELF descriptor: %s\n"
msgstr " помилка під час спроби вивільнення дескриптора суб-ELF: %s\n"
-#: src/elflint.c:306
+#. We cannot do anything.
+#: src/elflint.c:293
#, c-format
msgid "Not an ELF file - it has the wrong magic bytes at the start\n"
msgstr "Не є файлом ELF. Виявлено помилкові магічні байти на початку файла\n"
-#: src/elflint.c:371
+#: src/elflint.c:358
#, c-format
msgid "e_ident[%d] == %d is no known class\n"
msgstr "e_ident[%d] == %d не є відомим класом\n"
-#: src/elflint.c:376
+#: src/elflint.c:363
#, c-format
msgid "e_ident[%d] == %d is no known data encoding\n"
msgstr "e_ident[%d] == %d не є відомим кодуванням даних\n"
-#: src/elflint.c:380
+#: src/elflint.c:367
#, c-format
msgid "unknown ELF header version number e_ident[%d] == %d\n"
msgstr "невідомий номер версії заголовка ELF e_ident[%d] == %d\n"
-#: src/elflint.c:386
+#: src/elflint.c:375
#, c-format
msgid "unsupported OS ABI e_ident[%d] == '%s'\n"
msgstr "непідтримуване ABI ОС e_ident[%d] == «%s»\n"
-#: src/elflint.c:392
-#, c-format
-msgid "unsupport ABI version e_ident[%d] == %d\n"
+#: src/elflint.c:381
+#, fuzzy, c-format
+msgid "unsupported ABI version e_ident[%d] == %d\n"
msgstr "непідтримувана версія ABI e_ident[%d] == %d\n"
-#: src/elflint.c:397
+#: src/elflint.c:386
#, c-format
msgid "e_ident[%zu] is not zero\n"
msgstr "e_ident[%zu] не дорівнює нулеві\n"
-#: src/elflint.c:402
+#: src/elflint.c:391
#, c-format
msgid "unknown object file type %d\n"
msgstr "невідомий тип об’єктних файлів %d\n"
-#: src/elflint.c:409
+#: src/elflint.c:398
#, c-format
msgid "unknown machine type %d\n"
msgstr "невідомий тип архітектури %d\n"
-#: src/elflint.c:413
+#: src/elflint.c:402
#, c-format
msgid "unknown object file version\n"
msgstr "невідома версія об’єктних файлів\n"
-#: src/elflint.c:419
+#: src/elflint.c:408
#, c-format
msgid "invalid program header offset\n"
msgstr "некоректне зміщення заголовка програми\n"
-#: src/elflint.c:421
+#: src/elflint.c:410
#, c-format
msgid "executables and DSOs cannot have zero program header offset\n"
msgstr ""
"виконувані файли і DSO не можуть містити заголовка програми з нульовим "
"зміщенням\n"
-#: src/elflint.c:425
+#: src/elflint.c:414
#, c-format
msgid "invalid number of program header entries\n"
msgstr "некоректна кількість записів заголовків програми\n"
-#: src/elflint.c:433
+#: src/elflint.c:422
#, c-format
msgid "invalid section header table offset\n"
msgstr "некоректне зміщення таблиці заголовків розділів\n"
-#: src/elflint.c:436
+#: src/elflint.c:425
#, c-format
msgid "section header table must be present\n"
msgstr "має бути вказано таблицю заголовків розділів\n"
-#: src/elflint.c:450
+#: src/elflint.c:439
#, c-format
msgid "invalid number of section header table entries\n"
msgstr "некоректна кількість записів таблиці заголовків розділів\n"
-#: src/elflint.c:467
+#: src/elflint.c:456
#, c-format
msgid "invalid section header index\n"
msgstr "некоректний індекс заголовка розділу\n"
-#: src/elflint.c:481
+#: src/elflint.c:474
+#, c-format
+msgid "Can only check %u headers, shnum was %u\n"
+msgstr ""
+
+#: src/elflint.c:488
#, c-format
msgid "invalid number of program header table entries\n"
msgstr "некоректна кількість записів таблиці заголовків програми\n"
-#: src/elflint.c:490
+#: src/elflint.c:505
+#, c-format
+msgid "Can only check %u headers, phnum was %u\n"
+msgstr ""
+
+#: src/elflint.c:510
#, c-format
msgid "invalid machine flags: %s\n"
msgstr "некоректні прапорці архітектури: %s\n"
-#: src/elflint.c:497 src/elflint.c:514
+#: src/elflint.c:517 src/elflint.c:534
#, c-format
msgid "invalid ELF header size: %hd\n"
msgstr "некоректний розмір заголовка ELF: %hd\n"
-#: src/elflint.c:500 src/elflint.c:517
+#: src/elflint.c:520 src/elflint.c:537
#, c-format
msgid "invalid program header size: %hd\n"
msgstr "некоректний розмір заголовка програми: %hd\n"
-#: src/elflint.c:503 src/elflint.c:520
+#: src/elflint.c:523 src/elflint.c:540
#, c-format
msgid "invalid program header position or size\n"
msgstr "некоректне розташування або розмір заголовка програми\n"
-#: src/elflint.c:506 src/elflint.c:523
+#: src/elflint.c:526 src/elflint.c:543
#, c-format
msgid "invalid section header size: %hd\n"
msgstr "некоректний розмір заголовка розділу: %hd\n"
-#: src/elflint.c:509 src/elflint.c:526
+#: src/elflint.c:529 src/elflint.c:546
#, c-format
msgid "invalid section header position or size\n"
msgstr "некоректне розташування або розмір заголовка розділу\n"
-#: src/elflint.c:571
+#: src/elflint.c:591
#, c-format
msgid ""
"section [%2d] '%s': section with SHF_GROUP flag set not part of a section "
@@ -1518,7 +1665,7 @@
"розділ [%2d] «%s»: розділ з встановленим прапорцем SHF_GROUP не є частиною "
"групи розділів\n"
-#: src/elflint.c:575
+#: src/elflint.c:595
#, c-format
msgid ""
"section [%2d] '%s': section group [%2zu] '%s' does not precede group member\n"
@@ -1526,14 +1673,14 @@
"розділ [%2d] «%s»: групу розділів [%2zu] «%s» мало бути визначено до розділу-"
"елемента цієї групи\n"
-#: src/elflint.c:591 src/elflint.c:1475 src/elflint.c:1526 src/elflint.c:1632
-#: src/elflint.c:1968 src/elflint.c:2284 src/elflint.c:2898 src/elflint.c:3061
-#: src/elflint.c:3209 src/elflint.c:3399 src/elflint.c:4366
+#: src/elflint.c:611 src/elflint.c:1495 src/elflint.c:1546 src/elflint.c:1652
+#: src/elflint.c:1988 src/elflint.c:2311 src/elflint.c:2930 src/elflint.c:3093
+#: src/elflint.c:3241 src/elflint.c:3431 src/elflint.c:4399
#, c-format
msgid "section [%2d] '%s': cannot get section data\n"
msgstr "розділ [%2d] «%s»: не вдалося отримати дані розділу\n"
-#: src/elflint.c:604 src/elflint.c:1639
+#: src/elflint.c:624 src/elflint.c:1659
#, c-format
msgid ""
"section [%2d] '%s': referenced as string table for section [%2d] '%s' but "
@@ -1542,7 +1689,7 @@
"розділ [%2d] «%s»: надано посилання на таблицю рядків розділу [%2d] «%s», "
"але типом даних не є SHT_STRTAB\n"
-#: src/elflint.c:627
+#: src/elflint.c:647
#, c-format
msgid ""
"section [%2d] '%s': symbol table cannot have more than one extended index "
@@ -1551,38 +1698,38 @@
"розділ [%2d] «%s»: у таблиці символів не може бути більше одного розширеного "
"розділу покажчика\n"
-#: src/elflint.c:639
+#: src/elflint.c:659
#, c-format
msgid "section [%2u] '%s': entry size is does not match ElfXX_Sym\n"
msgstr "розділ [%2u] «%s»: розмірність запису не відповідає ElfXX_Sym\n"
-#: src/elflint.c:648
+#: src/elflint.c:668
#, c-format
msgid "section [%2d] '%s': cannot get symbol %d: %s\n"
msgstr "розділ [%2d] «%s»: не вдалося отримати символ %d: %s\n"
-#: src/elflint.c:653 src/elflint.c:656 src/elflint.c:659 src/elflint.c:662
-#: src/elflint.c:665 src/elflint.c:668
+#: src/elflint.c:673 src/elflint.c:676 src/elflint.c:679 src/elflint.c:682
+#: src/elflint.c:685 src/elflint.c:688
#, c-format
msgid "section [%2d] '%s': '%s' in zeroth entry not zero\n"
msgstr "розділ [%2d] «%s»: «%s» у нульовому записі не є нулем\n"
-#: src/elflint.c:671
+#: src/elflint.c:691
#, c-format
msgid "section [%2d] '%s': XINDEX for zeroth entry not zero\n"
msgstr "розділ [%2d] «%s»: XINDEX для нульового запису не є нулем\n"
-#: src/elflint.c:681
+#: src/elflint.c:701
#, c-format
msgid "section [%2d] '%s': cannot get symbol %zu: %s\n"
msgstr "розділ [%2d] «%s»: не вдалося отримати символ %zu: %s\n"
-#: src/elflint.c:690
+#: src/elflint.c:710
#, c-format
msgid "section [%2d] '%s': symbol %zu: invalid name value\n"
msgstr "розділ [%2d] «%s»: символ %zu: некоректне значення назви\n"
-#: src/elflint.c:705
+#: src/elflint.c:725
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: too large section index but no extended "
@@ -1591,7 +1738,7 @@
"розділ [%2d] «%s»: символ %zu: занадто великий покажчик розділу за умови, що "
"не визначено розділу розширеного покажчика розділів\n"
-#: src/elflint.c:711
+#: src/elflint.c:731
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: XINDEX used for index which would fit in "
@@ -1600,29 +1747,30 @@
"розділ [%2d] «%s»: символ %zu: XINDEX використано для індексування, яке не "
"відповідає st_shndx (%<PRIu32>)\n"
-#: src/elflint.c:723
+#. || sym->st_shndx > SHN_HIRESERVE always false
+#: src/elflint.c:743
#, c-format
msgid "section [%2d] '%s': symbol %zu: invalid section index\n"
msgstr "розділ [%2d] «%s»: символ %zu: некоректний індекс розділу\n"
-#: src/elflint.c:731
+#: src/elflint.c:751
#, c-format
msgid "section [%2d] '%s': symbol %zu: unknown type\n"
msgstr "розділ [%2d] «%s»: символ %zu: невідомий тип\n"
-#: src/elflint.c:737
+#: src/elflint.c:757
#, c-format
msgid "section [%2d] '%s': symbol %zu: unknown symbol binding\n"
msgstr "розділ [%2d] «%s»: символ %zu: невідома прив’язка символу\n"
-#: src/elflint.c:742
+#: src/elflint.c:762
#, c-format
msgid "section [%2d] '%s': symbol %zu: unique symbol not of object type\n"
msgstr ""
"розділ [%2d] «%s»: символ %zu: унікальний символ, що не належить до типу "
"об’єктів\n"
-#: src/elflint.c:750
+#: src/elflint.c:770
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: COMMON only allowed in relocatable files\n"
@@ -1630,14 +1778,14 @@
"розділ [%2d] «%s»: символ %zu: COMMON можна використовувати лише у файлах, "
"придатних до пересування\n"
-#: src/elflint.c:754
+#: src/elflint.c:774
#, c-format
msgid "section [%2d] '%s': symbol %zu: local COMMON symbols are nonsense\n"
msgstr ""
"розділ [%2d] «%s»: символ %zu: використання локальних символів COMMON "
"позбавлене сенсу\n"
-#: src/elflint.c:758
+#: src/elflint.c:778
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: function in COMMON section is nonsense\n"
@@ -1645,13 +1793,13 @@
"розділ [%2d] «%s»: символ %zu: використання функції у розділі COMMON "
"позбавлене сенсу\n"
-#: src/elflint.c:809
+#: src/elflint.c:829
#, c-format
msgid "section [%2d] '%s': symbol %zu: st_value out of bounds\n"
msgstr ""
"розділ [%2d] «%s»: символ %zu: значення st_value поза можливим діапазоном\n"
-#: src/elflint.c:815 src/elflint.c:840 src/elflint.c:889
+#: src/elflint.c:835 src/elflint.c:860 src/elflint.c:909
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu does not fit completely in referenced section "
@@ -1660,7 +1808,7 @@
"розділ [%2d] «%s»: символ %zu не повністю відповідає розділу, на який "
"посилається, [%2d] «%s»\n"
-#: src/elflint.c:824
+#: src/elflint.c:844
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: referenced section [%2d] '%s' does not have "
@@ -1669,7 +1817,7 @@
"розділ [%2d] «%s»: символ %zu: для розділу посилання [%2d] «%s» не "
"встановлено прапорець SHF_TLS\n"
-#: src/elflint.c:834 src/elflint.c:882
+#: src/elflint.c:854 src/elflint.c:902
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: st_value out of bounds of referenced section "
@@ -1678,14 +1826,14 @@
"розділ [%2d] «%s»: символ %zu: значення st_value поза межами розділу "
"посилання, [%2d] «%s»\n"
-#: src/elflint.c:861
+#: src/elflint.c:881
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: TLS symbol but no TLS program header entry\n"
msgstr ""
"розділ [%2d] «%s»: символ %zu: символ TLS без запису заголовка програми TLS\n"
-#: src/elflint.c:867
+#: src/elflint.c:887
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: TLS symbol but couldn't get TLS program "
@@ -1694,7 +1842,7 @@
"розділ [%2d] «%s»: символ %zu: маємо символ TLS, але не вдалося отримати "
"запис заголовка програми TLS\n"
-#: src/elflint.c:875
+#: src/elflint.c:895
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: st_value short of referenced section [%2d] "
@@ -1703,7 +1851,7 @@
"розділ [%2d] «%s»: символ %zu: значення st_value перед розділом посилання, "
"[%2d] «%s»\n"
-#: src/elflint.c:902
+#: src/elflint.c:922
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: local symbol outside range described in "
@@ -1712,7 +1860,7 @@
"розділ [%2d] «%s»: символ %zu: у sh_info описано локальний символ поза "
"діапазоном\n"
-#: src/elflint.c:909
+#: src/elflint.c:929
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: non-local symbol outside range described in "
@@ -1721,12 +1869,12 @@
"розділ [%2d] «%s»: символ %zu: у sh_info описано нелокальний символ поза "
"діапазоном\n"
-#: src/elflint.c:916
+#: src/elflint.c:936
#, c-format
msgid "section [%2d] '%s': symbol %zu: non-local section symbol\n"
msgstr "розділ [%2d] «%s»: символ %zu: нелокальний символ розділу\n"
-#: src/elflint.c:966
+#: src/elflint.c:986
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to bad section "
@@ -1735,7 +1883,7 @@
"розділ [%2d] «%s»: символ _GLOBAL_OFFSET_TABLE_ посилається на помилковий "
"розділ, [%2d]\n"
-#: src/elflint.c:973
+#: src/elflint.c:993
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to section [%2d] "
@@ -1744,7 +1892,10 @@
"розділ [%2d] «%s»: символ _GLOBAL_OFFSET_TABLE_ посилається на розділ [%2d] "
"'%s'\n"
-#: src/elflint.c:989
+#. This test is more strict than the psABIs which
+#. usually allow the symbol to be in the middle of
+#. the .got section, allowing negative offsets.
+#: src/elflint.c:1009
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol value %#<PRIx64> does not "
@@ -1753,7 +1904,7 @@
"розділ [%2d] «%s»: значення символу _GLOBAL_OFFSET_TABLE_ %#<PRIx64> не "
"відповідає адресі розділу %s %#<PRIx64>\n"
-#: src/elflint.c:996
+#: src/elflint.c:1016
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol size %<PRIu64> does not "
@@ -1762,7 +1913,7 @@
"розділ [%2d] «%s»: розмір символу _GLOBAL_OFFSET_TABLE_ %<PRIu64> не "
"відповідає розміру розділу %s %<PRIu64>\n"
-#: src/elflint.c:1004
+#: src/elflint.c:1024
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol present, but no .got "
@@ -1771,7 +1922,7 @@
"розділ [%2d] «%s»: виявлено символ _GLOBAL_OFFSET_TABLE_, але не виявлено "
"розділу .got\n"
-#: src/elflint.c:1020
+#: src/elflint.c:1040
#, c-format
msgid ""
"section [%2d] '%s': _DYNAMIC_ symbol value %#<PRIx64> does not match dynamic "
@@ -1780,7 +1931,7 @@
"розділ [%2d] «%s»: значення символу _DYNAMIC_ %#<PRIx64> не відповідає "
"адресі динамічного сегмента %#<PRIx64>\n"
-#: src/elflint.c:1027
+#: src/elflint.c:1047
#, c-format
msgid ""
"section [%2d] '%s': _DYNAMIC symbol size %<PRIu64> does not match dynamic "
@@ -1789,7 +1940,7 @@
"розділ [%2d] «%s»: розмір символу _DYNAMIC %<PRIu64> не відповідає розміру "
"динамічного сегмента %<PRIu64>\n"
-#: src/elflint.c:1040
+#: src/elflint.c:1060
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: symbol in dynamic symbol table with non-"
@@ -1798,29 +1949,29 @@
"розділ [%2d] «%s»: символ %zu: символ у динамічній таблиці символів з "
"нетиповою видимістю\n"
-#: src/elflint.c:1044
+#: src/elflint.c:1064
#, c-format
msgid "section [%2d] '%s': symbol %zu: unknown bit set in st_other\n"
msgstr "розділ [%2d] «%s»: символ %zu: невідомий набір бітів у st_other\n"
-#: src/elflint.c:1082
+#: src/elflint.c:1102
#, c-format
msgid "section [%2d] '%s': cannot get section data.\n"
msgstr "розділ [%2d] «%s»: не вдалося отримати дані розділу.\n"
-#: src/elflint.c:1098
+#: src/elflint.c:1118
#, c-format
msgid "section [%2d] '%s': DT_RELCOUNT used for this RELA section\n"
msgstr "розділ [%2d] «%s»: для цього розділу RELA використано DT_RELCOUNT\n"
-#: src/elflint.c:1109 src/elflint.c:1162
+#: src/elflint.c:1129 src/elflint.c:1182
#, c-format
msgid "section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"
msgstr ""
"розділ [%2d] «%s»: значення DT_RELCOUNT %d є занадто високим для цього "
"розділу\n"
-#: src/elflint.c:1134 src/elflint.c:1187
+#: src/elflint.c:1154 src/elflint.c:1207
#, c-format
msgid ""
"section [%2d] '%s': relative relocations after index %d as specified by "
@@ -1829,7 +1980,7 @@
"розділ [%2d] «%s»: відносні пересування після позиції %d, вказаної за "
"допомогою DT_RELCOUNT\n"
-#: src/elflint.c:1140 src/elflint.c:1193
+#: src/elflint.c:1160 src/elflint.c:1213
#, c-format
msgid ""
"section [%2d] '%s': non-relative relocation at index %zu; DT_RELCOUNT "
@@ -1838,52 +1989,52 @@
"розділ [%2d] «%s»: безвідносне пересування на позиції %zu; DT_RELCOUNT "
"визначено %d відносних пересування\n"
-#: src/elflint.c:1152
+#: src/elflint.c:1172
#, c-format
msgid "section [%2d] '%s': DT_RELACOUNT used for this REL section\n"
msgstr "розділ [%2d] «%s»: для цього розділу REL використано DT_RELACOUNT\n"
-#: src/elflint.c:1235
+#: src/elflint.c:1255
#, c-format
msgid "section [%2d] '%s': invalid destination section index\n"
msgstr "розділ [%2d] «%s»: некоректний індекс розділу призначення\n"
-#: src/elflint.c:1247
+#: src/elflint.c:1267
#, c-format
msgid "section [%2d] '%s': invalid destination section type\n"
msgstr "розділ [%2d] «%s»: некоректний тип розділу призначення\n"
-#: src/elflint.c:1255
+#: src/elflint.c:1275
#, c-format
msgid "section [%2d] '%s': sh_info should be zero\n"
msgstr "розділ [%2d] «%s»: sh_info має бути нульовим\n"
-#: src/elflint.c:1263
+#: src/elflint.c:1283
#, fuzzy, c-format
msgid ""
"section [%2d] '%s': no relocations for merge-able string sections possible\n"
msgstr ""
"розділ [%2d] «%s»: пересування у придатних до об’єднання розділах неможливе\n"
-#: src/elflint.c:1271
+#: src/elflint.c:1291
#, c-format
msgid "section [%2d] '%s': section entry size does not match ElfXX_Rela\n"
msgstr ""
"розділ [%2d] «%s»: розмірність запису розділу не відповідає ElfXX_Rela\n"
-#: src/elflint.c:1331
+#: src/elflint.c:1351
#, c-format
msgid "text relocation flag set but there is no read-only segment\n"
msgstr ""
"встановлено прапорець пересування тексту, але сегмент придатний лише до "
"читання\n"
-#: src/elflint.c:1358
+#: src/elflint.c:1378
#, c-format
msgid "section [%2d] '%s': relocation %zu: invalid type\n"
msgstr "розділ [%2d] «%s»: пересування %zu: некоректний тип\n"
-#: src/elflint.c:1366
+#: src/elflint.c:1386
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: relocation type invalid for the file "
@@ -1892,12 +2043,12 @@
"розділ [%2d] «%s»: пересування %zu: некоректний тип пересування для типу "
"файла\n"
-#: src/elflint.c:1374
+#: src/elflint.c:1394
#, c-format
msgid "section [%2d] '%s': relocation %zu: invalid symbol index\n"
msgstr "розділ [%2d] «%s»: пересування %zu: некоректний індекс символу\n"
-#: src/elflint.c:1392
+#: src/elflint.c:1412
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: only symbol '_GLOBAL_OFFSET_TABLE_' can "
@@ -1906,12 +2057,12 @@
"розділ [%2d] «%s»: пересування %zu: з %s можна використовувати лише символ "
"«_GLOBAL_OFFSET_TABLE_»\n"
-#: src/elflint.c:1409
+#: src/elflint.c:1429
#, c-format
msgid "section [%2d] '%s': relocation %zu: offset out of bounds\n"
msgstr "розділ [%2d] «%s»: пересування %zu: зміщення за межі діапазону\n"
-#: src/elflint.c:1424
+#: src/elflint.c:1444
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: copy relocation against symbol of type "
@@ -1920,7 +2071,7 @@
"розділ [%2d] «%s»: пересування %zu: пересування копіювання для символу типу "
"%s\n"
-#: src/elflint.c:1445
+#: src/elflint.c:1465
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: read-only section modified but text "
@@ -1929,22 +2080,22 @@
"розділ [%2d] «%s»: пересування %zu: змінено придатний лише для читання "
"розділ, але не встановлено прапорець пересування тексту\n"
-#: src/elflint.c:1460
+#: src/elflint.c:1480
#, c-format
msgid "section [%2d] '%s': relocations are against loaded and unloaded data\n"
msgstr "розділ [%2d] «%s»: пересування завантажених і незавантажених даних\n"
-#: src/elflint.c:1500 src/elflint.c:1551
+#: src/elflint.c:1520 src/elflint.c:1571
#, c-format
msgid "section [%2d] '%s': cannot get relocation %zu: %s\n"
msgstr "розділ [%2d] «%s»: не вдалося отримати зміщення %zu: %s\n"
-#: src/elflint.c:1627
+#: src/elflint.c:1647
#, c-format
msgid "more than one dynamic section present\n"
msgstr "вказано більше одного динамічного розділу\n"
-#: src/elflint.c:1645
+#: src/elflint.c:1665
#, c-format
msgid ""
"section [%2d]: referenced as string table for section [%2d] '%s' but section "
@@ -1953,46 +2104,46 @@
"розділ [%2d]: надано посилання на таблицю рядків розділу [%2d] «%s», але "
"значення посилання на розділ є некоректним\n"
-#: src/elflint.c:1653
+#: src/elflint.c:1673
#, c-format
msgid "section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"
msgstr ""
"розділ [%2d] «%s»: розмірність запису розділу не відповідає ElfXX_Dyn\n"
-#: src/elflint.c:1658 src/elflint.c:1947
+#: src/elflint.c:1678 src/elflint.c:1967
#, c-format
msgid "section [%2d] '%s': sh_info not zero\n"
msgstr "розділ [%2d] «%s»: sh_info не є нульовим\n"
-#: src/elflint.c:1668
+#: src/elflint.c:1688
#, c-format
msgid "section [%2d] '%s': cannot get dynamic section entry %zu: %s\n"
msgstr ""
"розділ [%2d] «%s»: не вдалося отримати запис динамічного розділу %zu: %s\n"
-#: src/elflint.c:1676
+#: src/elflint.c:1696
#, c-format
msgid "section [%2d] '%s': non-DT_NULL entries follow DT_NULL entry\n"
msgstr ""
"розділ [%2d] «%s»: за записом DT_NULL вказано записи, що не належать до "
"DT_NULL\n"
-#: src/elflint.c:1683
+#: src/elflint.c:1703
#, c-format
msgid "section [%2d] '%s': entry %zu: unknown tag\n"
msgstr "розділ [%2d] «%s»: запис %zu: невідома мітка\n"
-#: src/elflint.c:1694
+#: src/elflint.c:1714
#, c-format
msgid "section [%2d] '%s': entry %zu: more than one entry with tag %s\n"
msgstr "розділ [%2d] «%s»: запис %zu: декілька записів з міткою %s\n"
-#: src/elflint.c:1704
+#: src/elflint.c:1724
#, c-format
msgid "section [%2d] '%s': entry %zu: level 2 tag %s used\n"
msgstr "розділ [%2d] «%s»: запис %zu: використано мітку рівня 2 %s\n"
-#: src/elflint.c:1722
+#: src/elflint.c:1742
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: DT_PLTREL value must be DT_REL or DT_RELA\n"
@@ -2000,7 +2151,7 @@
"розділ [%2d] «%s»: запис %zu: значенням DT_PLTREL має бути DT_REL або "
"DT_RELA\n"
-#: src/elflint.c:1735
+#: src/elflint.c:1755
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: pointer does not match address of section "
@@ -2009,7 +2160,7 @@
"розділ [%2d] «%s»: розділ %zu: вказівник не відповідає адресі розділу [%2d] "
"«%s», на яку посилається sh_link\n"
-#: src/elflint.c:1778
+#: src/elflint.c:1798
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: %s value must point into loaded segment\n"
@@ -2017,7 +2168,7 @@
"розділ [%2d] «%s»: запис %zu: значення %s має вказувати на завантажений "
"сегмент\n"
-#: src/elflint.c:1793
+#: src/elflint.c:1813
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: %s value must be valid offset in section "
@@ -2026,48 +2177,48 @@
"розділ [%2d] «%s»: запис %zu: значенням %s має бути коректне зміщення у "
"розділі [%2d] «%s»\n"
-#: src/elflint.c:1813 src/elflint.c:1841
+#: src/elflint.c:1833 src/elflint.c:1861
#, c-format
msgid "section [%2d] '%s': contains %s entry but not %s\n"
msgstr "розділ [%2d] «%s»: містить запис %s, але не %s\n"
-#: src/elflint.c:1825
+#: src/elflint.c:1845
#, c-format
msgid "section [%2d] '%s': mandatory tag %s not present\n"
msgstr "розділ [%2d] «%s»: немає обов’язкової мітки %s\n"
-#: src/elflint.c:1834
+#: src/elflint.c:1854
#, c-format
msgid "section [%2d] '%s': no hash section present\n"
msgstr "розділ [%2d] «%s»: не виявлено розділу хешів\n"
-#: src/elflint.c:1849 src/elflint.c:1856
+#: src/elflint.c:1869 src/elflint.c:1876
#, c-format
msgid "section [%2d] '%s': not all of %s, %s, and %s are present\n"
msgstr "розділ [%2d] «%s»: вказано не всі зі значень %s, %s і %s\n"
-#: src/elflint.c:1866 src/elflint.c:1870
+#: src/elflint.c:1886 src/elflint.c:1890
#, c-format
msgid "section [%2d] '%s': %s tag missing in DSO marked during prelinking\n"
msgstr ""
"розділ [%2d] «%s»: у DSO, позначеному на кроці попереднього компонування, "
"немає мітки %s\n"
-#: src/elflint.c:1876
+#: src/elflint.c:1896
#, c-format
msgid "section [%2d] '%s': non-DSO file marked as dependency during prelink\n"
msgstr ""
"розділ [%2d] «%s»: під час попереднього компонування як залежність позначено "
"файл, який не є файлом DSO\n"
-#: src/elflint.c:1887 src/elflint.c:1891 src/elflint.c:1895 src/elflint.c:1899
+#: src/elflint.c:1907 src/elflint.c:1911 src/elflint.c:1915 src/elflint.c:1919
#, c-format
msgid "section [%2d] '%s': %s tag missing in prelinked executable\n"
msgstr ""
"розділ [%2d] «%s»: у попередньо скомпонованому виконуваному файлі не "
"міститься мітки %s\n"
-#: src/elflint.c:1911
+#: src/elflint.c:1931
#, c-format
msgid ""
"section [%2d] '%s': only relocatable files can have extended section index\n"
@@ -2075,7 +2226,7 @@
"розділ [%2d] «%s»: розширений розділ покажчика можуть мати лише файли, "
"придатні до пересування\n"
-#: src/elflint.c:1921
+#: src/elflint.c:1941
#, c-format
msgid ""
"section [%2d] '%s': extended section index section not for symbol table\n"
@@ -2083,29 +2234,29 @@
"розділ [%2d] «%s»: розділ розширеного покажчика розділів не призначено для "
"таблиць символів\n"
-#: src/elflint.c:1925
+#: src/elflint.c:1945
#, c-format
msgid "section [%2d] '%s': sh_link extended section index [%2d] is invalid\n"
msgstr ""
"розділ [%2d] «%s»: індекс розширеного розділу sh_link [%2d] є некоректним\n"
-#: src/elflint.c:1930
+#: src/elflint.c:1950
#, c-format
msgid "cannot get data for symbol section\n"
msgstr "не вдалося отримати дані для розділу символів\n"
-#: src/elflint.c:1933
+#: src/elflint.c:1953
#, c-format
msgid "section [%2d] '%s': entry size does not match Elf32_Word\n"
msgstr "розділ [%2d] «%s»: розмірність запису не відповідає Elf32_Word\n"
-#: src/elflint.c:1942
+#: src/elflint.c:1962
#, c-format
msgid "section [%2d] '%s': extended index table too small for symbol table\n"
msgstr ""
"розділ [%2d] «%s»: розширена таблиця покажчика замала для таблиці символів\n"
-#: src/elflint.c:1957
+#: src/elflint.c:1977
#, c-format
msgid ""
"section [%2d] '%s': extended section index in section [%2zu] '%s' refers to "
@@ -2114,24 +2265,24 @@
"розділ [%2d] «%s»: розширений покажчик розділів у розділі [%2zu] «%s» "
"посилається на ту саму таблицю розділів\n"
-#: src/elflint.c:1974
+#: src/elflint.c:1995
#, c-format
msgid "symbol 0 should have zero extended section index\n"
msgstr "символу 0 має відповідати нульовий індекс розширеного розділу\n"
-#: src/elflint.c:1986
+#: src/elflint.c:2007
#, c-format
msgid "cannot get data for symbol %zu\n"
msgstr "не вдалося отримати дані для символу %zu\n"
-#: src/elflint.c:1991
+#: src/elflint.c:2012
#, c-format
msgid "extended section index is %<PRIu32> but symbol index is not XINDEX\n"
msgstr ""
"індекс розширеного розділу дорівнює %<PRIu32>, але індекс символу не є "
"XINDEX\n"
-#: src/elflint.c:2007 src/elflint.c:2058
+#: src/elflint.c:2029 src/elflint.c:2083
#, c-format
msgid ""
"section [%2d] '%s': hash table section is too small (is %ld, expected %ld)\n"
@@ -2139,43 +2290,43 @@
"розділ [%2d] «%s»: розділ таблиці хешів занадто малий (розмір %ld, мало бути "
"— %ld)\n"
-#: src/elflint.c:2019 src/elflint.c:2070
+#: src/elflint.c:2043 src/elflint.c:2097
#, c-format
msgid "section [%2d] '%s': chain array too large\n"
msgstr "розділ [%2d] «%s»: масив ланцюжка занадто великий\n"
-#: src/elflint.c:2033 src/elflint.c:2084
+#: src/elflint.c:2057 src/elflint.c:2111
#, c-format
msgid "section [%2d] '%s': hash bucket reference %zu out of bounds\n"
msgstr ""
"розділ [%2d] «%s»: посилання на хеш блоку %zu лежить поза межами діапазону\n"
-#: src/elflint.c:2043
+#: src/elflint.c:2067
#, c-format
msgid "section [%2d] '%s': hash chain reference %zu out of bounds\n"
msgstr ""
"розділ [%2d] «%s»: посилання ланцюжка хешів %zu лежить поза межами "
"діапазону\n"
-#: src/elflint.c:2094
+#: src/elflint.c:2121
#, c-format
msgid "section [%2d] '%s': hash chain reference %<PRIu64> out of bounds\n"
msgstr ""
"розділ [%2d] «%s»: посилання ланцюжка хешів %<PRIu64> лежить поза межами "
"діапазону\n"
-#: src/elflint.c:2107
+#: src/elflint.c:2134
#, c-format
msgid "section [%2d] '%s': not enough data\n"
msgstr "розділ [%2d] «%s»: недостатньо даних\n"
-#: src/elflint.c:2119
+#: src/elflint.c:2146
#, c-format
msgid "section [%2d] '%s': bitmask size zero or not power of 2: %u\n"
msgstr ""
"розділ [%2d] «%s»: розмір бітової маски є нульовим або не є степенем 2: %u\n"
-#: src/elflint.c:2135
+#: src/elflint.c:2162
#, c-format
msgid ""
"section [%2d] '%s': hash table section is too small (is %ld, expected at "
@@ -2184,12 +2335,12 @@
"розділ [%2d] «%s»: розділ таблиці хешів є надто малим (маємо %ld, мало бути "
"принаймні %ld)\n"
-#: src/elflint.c:2144
+#: src/elflint.c:2171
#, c-format
msgid "section [%2d] '%s': 2nd hash function shift too big: %u\n"
msgstr "розділ [%2d] «%s»: зсув 2-ої функції хешування занадто великий: %u\n"
-#: src/elflint.c:2178
+#: src/elflint.c:2205
#, c-format
msgid ""
"section [%2d] '%s': hash chain for bucket %zu lower than symbol index bias\n"
@@ -2197,7 +2348,7 @@
"розділ [%2d] '%s': ланцюжок хешів для блоку %zu розташовано нижче за позицію "
"відхилення індексу символу\n"
-#: src/elflint.c:2199
+#: src/elflint.c:2226
#, c-format
msgid ""
"section [%2d] '%s': symbol %u referenced in chain for bucket %zu is "
@@ -2206,7 +2357,7 @@
"розділ [%2d] «%s»: символ %u, на який посилається ланцюжок у блоці %zu не "
"визначено\n"
-#: src/elflint.c:2212
+#: src/elflint.c:2239
#, c-format
msgid ""
"section [%2d] '%s': hash value for symbol %u in chain for bucket %zu wrong\n"
@@ -2214,7 +2365,7 @@
"розділ [%2d] «%s»: значення хешу для символу %u у ланцюжку для блоку %zu є "
"помилковим\n"
-#: src/elflint.c:2221
+#: src/elflint.c:2248
#, c-format
msgid ""
"section [%2d] '%s': mask index for symbol %u in chain for bucket %zu wrong\n"
@@ -2222,14 +2373,14 @@
"розділ [%2d] «%s»: індекс маски для символу %u у ланцюжку для блоку %zu є "
"помилковим\n"
-#: src/elflint.c:2251
+#: src/elflint.c:2278
#, c-format
msgid "section [%2d] '%s': hash chain for bucket %zu out of bounds\n"
msgstr ""
"розділ [%2d] «%s»: ланцюжок хешів для блоку %zu лежить поза межами "
"діапазону\n"
-#: src/elflint.c:2256
+#: src/elflint.c:2283
#, c-format
msgid ""
"section [%2d] '%s': symbol reference in chain for bucket %zu out of bounds\n"
@@ -2237,43 +2388,43 @@
"розділ [%2d] «%s»: посилання на символ у ланцюжку для блоку %zu лежить поза "
"межами діапазону\n"
-#: src/elflint.c:2262
+#: src/elflint.c:2289
#, c-format
msgid "section [%2d] '%s': bitmask does not match names in the hash table\n"
msgstr "розділ [%2d] «%s»: бітова маска не відповідає назвам у таблиці хешів\n"
-#: src/elflint.c:2275
+#: src/elflint.c:2302
#, c-format
msgid "section [%2d] '%s': relocatable files cannot have hash tables\n"
msgstr ""
"розділ [%2d] «%s»: придатні до пересування файли не можуть містити таблиць "
"хешів\n"
-#: src/elflint.c:2293
+#: src/elflint.c:2320
#, c-format
msgid "section [%2d] '%s': hash table not for dynamic symbol table\n"
msgstr ""
"розділ [%2d] «%s»: таблицю хешів не призначено для зберігання таблиці "
"динамічних символів\n"
-#: src/elflint.c:2297
+#: src/elflint.c:2324
#, c-format
msgid "section [%2d] '%s': invalid sh_link symbol table section index [%2d]\n"
msgstr ""
"розділ [%2d] «%s»: некоректний індекс розділу таблиці символів sh_link "
"[%2d]\n"
-#: src/elflint.c:2305
+#: src/elflint.c:2334
#, c-format
msgid "section [%2d] '%s': hash table entry size incorrect\n"
msgstr "розділ [%2d] «%s»: розмірність запису таблиці хешів є некоректною\n"
-#: src/elflint.c:2310
+#: src/elflint.c:2339
#, c-format
msgid "section [%2d] '%s': not marked to be allocated\n"
msgstr "розділ [%2d] «%s»: не позначено для пересування\n"
-#: src/elflint.c:2315
+#: src/elflint.c:2344
#, c-format
msgid ""
"section [%2d] '%s': hash table has not even room for initial administrative "
@@ -2282,27 +2433,27 @@
"розділ [%2d] «%s»: у таблиці хешів виявлено незвичайне розташування "
"початкових адміністративних записів\n"
-#: src/elflint.c:2364
+#: src/elflint.c:2393
#, c-format
msgid "sh_link in hash sections [%2zu] '%s' and [%2zu] '%s' not identical\n"
msgstr "sh_link у розділах хешів [%2zu] «%s» і [%2zu] «%s» не збігаються\n"
-#: src/elflint.c:2388 src/elflint.c:2453 src/elflint.c:2488
+#: src/elflint.c:2417 src/elflint.c:2482 src/elflint.c:2517
#, c-format
msgid "hash section [%2zu] '%s' does not contain enough data\n"
msgstr "розділ хешу [%2zu] «%s» містить недостатньо даних\n"
-#: src/elflint.c:2409
+#: src/elflint.c:2438
#, c-format
msgid "hash section [%2zu] '%s' has zero bit mask words\n"
msgstr "розділ хешу [%2zu] «%s» містить нульові слова бітової маски\n"
-#: src/elflint.c:2420 src/elflint.c:2464 src/elflint.c:2501
+#: src/elflint.c:2449 src/elflint.c:2493 src/elflint.c:2530
#, c-format
msgid "hash section [%2zu] '%s' uses too much data\n"
msgstr "розділ хешу [%2zu] «%s» використовує надто багато даних\n"
-#: src/elflint.c:2435
+#: src/elflint.c:2464
#, c-format
msgid ""
"hash section [%2zu] '%s' invalid symbol index %<PRIu32> (max_nsyms: "
@@ -2311,17 +2462,17 @@
"розділ хешу [%2zu] «%s» некоректний індекс символу %<PRIu32> (макс. к-ть "
"символів: %<PRIu32>, кількість записів: %<PRIu32>\n"
-#: src/elflint.c:2522
+#: src/elflint.c:2551
#, c-format
msgid "hash section [%2zu] '%s' invalid sh_entsize\n"
msgstr "розділ хешу [%2zu] «%s» некоректне значення sh_entsize\n"
-#: src/elflint.c:2532 src/elflint.c:2536
+#: src/elflint.c:2561 src/elflint.c:2565
#, c-format
msgid "section [%2zu] '%s': reference to symbol index 0\n"
msgstr "розділ [%2zu] «%s»: посилання на індекс символів 0\n"
-#: src/elflint.c:2543
+#: src/elflint.c:2572
#, c-format
msgid ""
"symbol %d referenced in new hash table in [%2zu] '%s' but not in old hash "
@@ -2330,7 +2481,7 @@
"виявлено посилання на символ %d у новій таблиці хешів у [%2zu] «%s», але "
"його немає у старій таблиці хешів у [%2zu] «%s»\n"
-#: src/elflint.c:2555
+#: src/elflint.c:2584
#, c-format
msgid ""
"symbol %d referenced in old hash table in [%2zu] '%s' but not in new hash "
@@ -2339,12 +2490,12 @@
"виявлено посилання на символ %d у старій таблиці хешів у [%2zu] «%s», але "
"його немає у новій таблиці хешів у [%2zu] «%s»\n"
-#: src/elflint.c:2571
+#: src/elflint.c:2600
#, c-format
msgid "section [%2d] '%s': nonzero sh_%s for NULL section\n"
msgstr "розділ [%2d] «%s»: ненульове значення sh_%s для розділу NULL\n"
-#: src/elflint.c:2591
+#: src/elflint.c:2620
#, c-format
msgid ""
"section [%2d] '%s': section groups only allowed in relocatable object files\n"
@@ -2352,95 +2503,95 @@
"розділ [%2d] «%s»: групи розділів передбачено лише для придатних до "
"пересування об’єктних файлах\n"
-#: src/elflint.c:2602
+#: src/elflint.c:2631
#, c-format
msgid "section [%2d] '%s': cannot get symbol table: %s\n"
msgstr "розділ [%2d] «%s»: не вдалося отримати таблицю символів: %s\n"
-#: src/elflint.c:2607
+#: src/elflint.c:2636
#, c-format
msgid "section [%2d] '%s': section reference in sh_link is no symbol table\n"
msgstr ""
"розділ [%2d] «%s»: посилання на розділ у sh_link не має таблиці символів\n"
-#: src/elflint.c:2613
+#: src/elflint.c:2642
#, c-format
msgid "section [%2d] '%s': invalid symbol index in sh_info\n"
msgstr "розділ [%2d] «%s»: некоректний індекс символу у sh_info\n"
-#: src/elflint.c:2618
+#: src/elflint.c:2647
#, c-format
msgid "section [%2d] '%s': sh_flags not zero\n"
msgstr "розділ [%2d] «%s»: sh_flags не є нульовим\n"
-#: src/elflint.c:2625
+#: src/elflint.c:2654
#, c-format
msgid "section [%2d] '%s': cannot get symbol for signature\n"
msgstr "розділ [%2d] «%s»: не вдалося отримати символ для підпису\n"
-#: src/elflint.c:2629
+#: src/elflint.c:2658
#, c-format
msgid "section [%2d] '%s': cannot get symbol name for signature\n"
msgstr "розділ [%2d] «%s»: не вдалося отримати назву символу для підпису\n"
-#: src/elflint.c:2634
+#: src/elflint.c:2663
#, c-format
msgid "section [%2d] '%s': signature symbol cannot be empty string\n"
msgstr "розділ [%2d] «%s»: символ підпису не може бути порожнім рядком\n"
-#: src/elflint.c:2640
+#: src/elflint.c:2669
#, c-format
msgid "section [%2d] '%s': sh_flags not set correctly\n"
msgstr "розділ [%2d] «%s»: для sh_flags встановлено помилкове значення\n"
-#: src/elflint.c:2646
+#: src/elflint.c:2675
#, c-format
msgid "section [%2d] '%s': cannot get data: %s\n"
msgstr "розділ [%2d] «%s»: не вдалося отримати дані: %s\n"
-#: src/elflint.c:2655
+#: src/elflint.c:2684
#, c-format
msgid "section [%2d] '%s': section size not multiple of sizeof(Elf32_Word)\n"
msgstr "розділ [%2d] «%s»: розмір розділу не є кратним до sizeof(Elf32_Word)\n"
-#: src/elflint.c:2660
+#: src/elflint.c:2690
#, c-format
msgid "section [%2d] '%s': section group without flags word\n"
msgstr "розділ [%2d] «%s»: група розділів без значення типу word прапорців\n"
-#: src/elflint.c:2666
+#: src/elflint.c:2698
#, c-format
msgid "section [%2d] '%s': section group without member\n"
msgstr "розділ [%2d] «%s»: група розділів без елементів\n"
-#: src/elflint.c:2670
+#: src/elflint.c:2702
#, c-format
msgid "section [%2d] '%s': section group with only one member\n"
msgstr "розділ [%2d] «%s»: група розділів, що містить лише один елемент\n"
-#: src/elflint.c:2681
+#: src/elflint.c:2713
#, c-format
msgid "section [%2d] '%s': unknown section group flags\n"
msgstr "розділ [%2d] «%s»: невідомі прапорці групи розділів\n"
-#: src/elflint.c:2693
+#: src/elflint.c:2725
#, c-format
msgid "section [%2d] '%s': section index %zu out of range\n"
msgstr "розділ [%2d] «%s»: індекс розділу %zu поза межами діапазону\n"
-#: src/elflint.c:2702
+#: src/elflint.c:2734
#, c-format
msgid "section [%2d] '%s': cannot get section header for element %zu: %s\n"
msgstr ""
"розділ [%2d] «%s»: не вдалося отримати заголовок розділу для елемента %zu: "
"%s\n"
-#: src/elflint.c:2709
+#: src/elflint.c:2741
#, c-format
msgid "section [%2d] '%s': section group contains another group [%2d] '%s'\n"
msgstr "розділ [%2d] «%s»: група розділів містить іншу групу [%2d] «%s»\n"
-#: src/elflint.c:2715
+#: src/elflint.c:2747
#, c-format
msgid ""
"section [%2d] '%s': element %zu references section [%2d] '%s' without "
@@ -2449,12 +2600,12 @@
"розділ [%2d] «%s»: елемент %zu посилається на розділ [%2d] «%s» без "
"встановленого прапорця SHF_GROUP\n"
-#: src/elflint.c:2722
+#: src/elflint.c:2754
#, c-format
msgid "section [%2d] '%s' is contained in more than one section group\n"
msgstr "розділ [%2d] «%s» міститься у більше ніж одній групі розділів\n"
-#: src/elflint.c:2912
+#: src/elflint.c:2944
#, c-format
msgid ""
"section [%2d] '%s' refers in sh_link to section [%2d] '%s' which is no "
@@ -2463,7 +2614,7 @@
"розділ [%2d] «%s» посилається у sh_link на розділ [%2d] «%s», який не має "
"динамічної таблиці символів\n"
-#: src/elflint.c:2924
+#: src/elflint.c:2956
#, c-format
msgid ""
"section [%2d] '%s' has different number of entries than symbol table [%2d] "
@@ -2472,28 +2623,28 @@
"кількість записів у розділі [%2d] «%s» відрізняється від кількості у таблиці "
"символів [%2d] «%s»\n"
-#: src/elflint.c:2940
+#: src/elflint.c:2972
#, c-format
msgid "section [%2d] '%s': symbol %d: cannot read version data\n"
msgstr "розділ [%2d] «%s»: символ %d: не вдалося прочитати дані щодо версії\n"
-#: src/elflint.c:2956
+#: src/elflint.c:2988
#, c-format
msgid "section [%2d] '%s': symbol %d: local symbol with global scope\n"
msgstr ""
"розділ [%2d] «%s»: символ %d: локальний символ у загальному контексті\n"
-#: src/elflint.c:2964
+#: src/elflint.c:2996
#, c-format
msgid "section [%2d] '%s': symbol %d: local symbol with version\n"
msgstr "розділ [%2d] «%s»: символ %d: локальний символ з версією\n"
-#: src/elflint.c:2978
+#: src/elflint.c:3010
#, c-format
msgid "section [%2d] '%s': symbol %d: invalid version index %d\n"
msgstr "розділ [%2d] «%s»: символ %d: некоректний індекс версії %d\n"
-#: src/elflint.c:2983
+#: src/elflint.c:3015
#, c-format
msgid ""
"section [%2d] '%s': symbol %d: version index %d is for defined version\n"
@@ -2501,7 +2652,7 @@
"розділ [%2d] «%s»: символ %d: індекси версії %d призначено до визначеної "
"версії\n"
-#: src/elflint.c:2993
+#: src/elflint.c:3025
#, c-format
msgid ""
"section [%2d] '%s': symbol %d: version index %d is for requested version\n"
@@ -2509,45 +2660,45 @@
"розділ [%2d] «%s»: символ %d: індекс версії %d призначено для версії, на яку "
"надійшов запит\n"
-#: src/elflint.c:3046
+#: src/elflint.c:3078
#, c-format
msgid "more than one version reference section present\n"
msgstr "виявлено більше за один розділ посилань на версії\n"
-#: src/elflint.c:3054 src/elflint.c:3201
+#: src/elflint.c:3086 src/elflint.c:3233
#, c-format
msgid "section [%2d] '%s': sh_link does not link to string table\n"
msgstr "розділ [%2d] «%s»: sh_link не посилається на таблицю рядків\n"
-#: src/elflint.c:3079 src/elflint.c:3255
+#: src/elflint.c:3111 src/elflint.c:3287
#, c-format
msgid "section [%2d] '%s': entry %d has wrong version %d\n"
msgstr "розділ [%2d] «%s»: запис %d має помилкову версію %d\n"
-#: src/elflint.c:3086 src/elflint.c:3262
+#: src/elflint.c:3118 src/elflint.c:3294
#, c-format
msgid "section [%2d] '%s': entry %d has wrong offset of auxiliary data\n"
msgstr ""
"розділ [%2d] «%s»: запис %d містить помилкове зміщення у допоміжних даних\n"
-#: src/elflint.c:3096
+#: src/elflint.c:3128
#, c-format
msgid "section [%2d] '%s': entry %d has invalid file reference\n"
msgstr "розділ [%2d] «%s»: запис %d містить некоректне посилання на файл\n"
-#: src/elflint.c:3104
+#: src/elflint.c:3136
#, c-format
msgid "section [%2d] '%s': entry %d references unknown dependency\n"
msgstr "розділ [%2d] «%s»: запис %d посилається на невідому залежність\n"
-#: src/elflint.c:3116
+#: src/elflint.c:3148
#, c-format
msgid "section [%2d] '%s': auxiliary entry %d of entry %d has unknown flag\n"
msgstr ""
"розділ [%2d] «%s»: допоміжний запис %d запису %d позначено невідомим "
"прапорцем\n"
-#: src/elflint.c:3124
+#: src/elflint.c:3156
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has invalid name "
@@ -2556,7 +2707,7 @@
"розділ [%2d] «%s»: допоміжний запис %d запису %d містить некоректне "
"посилання на назву\n"
-#: src/elflint.c:3133
+#: src/elflint.c:3165
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has wrong hash value: "
@@ -2565,7 +2716,7 @@
"розділ [%2d] «%s»: допоміжний запис %d запису %d має помилкове значення "
"хешу: %#x, мало бути %#x\n"
-#: src/elflint.c:3142
+#: src/elflint.c:3174
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has duplicate version "
@@ -2574,7 +2725,7 @@
"розділ [%2d] «%s»: допоміжний запис %d запису %d містить дублікати назви "
"версії «%s»\n"
-#: src/elflint.c:3153
+#: src/elflint.c:3185
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has wrong next field\n"
@@ -2582,13 +2733,13 @@
"розділ [%2d] «%s»: допоміжний запис %d запису %d має помилкове наступне "
"поле\n"
-#: src/elflint.c:3170 src/elflint.c:3346
+#: src/elflint.c:3202 src/elflint.c:3378
#, c-format
msgid "section [%2d] '%s': entry %d has invalid offset to next entry\n"
msgstr ""
"розділ [%2d] «%s»: запис %d має некоректне зміщення щодо наступного запису\n"
-#: src/elflint.c:3178 src/elflint.c:3354
+#: src/elflint.c:3210 src/elflint.c:3386
#, c-format
msgid ""
"section [%2d] '%s': entry %d has zero offset to next entry, but sh_info says "
@@ -2597,44 +2748,44 @@
"розділ [%2d] «%s»: запис %d має нульове зміщення щодо наступного запису, але "
"за sh_info можна зрозуміти, що записів більше\n"
-#: src/elflint.c:3193
+#: src/elflint.c:3225
#, c-format
msgid "more than one version definition section present\n"
msgstr "виявлено більше за один розділ визначення версій\n"
-#: src/elflint.c:3240
+#: src/elflint.c:3272
#, c-format
msgid "section [%2d] '%s': more than one BASE definition\n"
msgstr "розділ [%2d] «%s»: повторне визначення BASE\n"
-#: src/elflint.c:3244
+#: src/elflint.c:3276
#, c-format
msgid "section [%2d] '%s': BASE definition must have index VER_NDX_GLOBAL\n"
msgstr ""
"розділ [%2d] «%s»: визначення BASE повинно мати індекс VER_NDX_GLOBAL\n"
-#: src/elflint.c:3250
+#: src/elflint.c:3282
#, c-format
msgid "section [%2d] '%s': entry %d has unknown flag\n"
msgstr "розділ [%2d] «%s»: невідомий прапорець запису %d\n"
-#: src/elflint.c:3277
+#: src/elflint.c:3309
#, c-format
msgid "section [%2d] '%s': entry %d has invalid name reference\n"
msgstr "розділ [%2d] «%s»: запис %d містить некоректне посилання на назву\n"
-#: src/elflint.c:3284
+#: src/elflint.c:3316
#, c-format
msgid "section [%2d] '%s': entry %d has wrong hash value: %#x, expected %#x\n"
msgstr ""
"розділ [%2d] «%s»: запис %d має помилкове значення хешу: %#x, мало бути %#x\n"
-#: src/elflint.c:3292
+#: src/elflint.c:3324
#, c-format
msgid "section [%2d] '%s': entry %d has duplicate version name '%s'\n"
msgstr "розділ [%2d] «%s»: запис %d містить дублікати назви версії «%s»\n"
-#: src/elflint.c:3312
+#: src/elflint.c:3344
#, c-format
msgid ""
"section [%2d] '%s': entry %d has invalid name reference in auxiliary data\n"
@@ -2642,53 +2793,53 @@
"розділ [%2d] «%s»: запис %d містить некоректне посилання на назву у "
"допоміжних даних\n"
-#: src/elflint.c:3329
+#: src/elflint.c:3361
#, c-format
msgid "section [%2d] '%s': entry %d has wrong next field in auxiliary data\n"
msgstr ""
"розділ [%2d] «%s»: у допоміжних даних запису %d міститься помилкове поле "
"наступного запису\n"
-#: src/elflint.c:3362
+#: src/elflint.c:3394
#, c-format
msgid "section [%2d] '%s': no BASE definition\n"
msgstr "розділ [%2d] «%s»: немає визначення BASE\n"
-#: src/elflint.c:3378
+#: src/elflint.c:3410
#, c-format
msgid "section [%2d] '%s': unknown parent version '%s'\n"
msgstr "розділ [%2d] «%s»: невідома основна версія «%s»\n"
-#: src/elflint.c:3391
+#: src/elflint.c:3423
#, c-format
msgid "section [%2d] '%s': empty object attributes section\n"
msgstr "розділ [%2d] «%s»: порожній розділ атрибутів об’єкта\n"
-#: src/elflint.c:3412
+#: src/elflint.c:3444
#, c-format
msgid "section [%2d] '%s': unrecognized attribute format\n"
msgstr "розділ [%2d] «%s»: не вдалося визначити формат атрибутів\n"
-#: src/elflint.c:3428
+#: src/elflint.c:3460
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: zero length field in attribute section\n"
msgstr ""
"розділ [%2d] «%s»: зміщення %zu: поле нульового розміру у розділі атрибутів\n"
-#: src/elflint.c:3437
+#: src/elflint.c:3469
#, c-format
msgid "section [%2d] '%s': offset %zu: invalid length in attribute section\n"
msgstr ""
"розділ [%2d] «%s»: зміщення %zu: некоректна довжина у розділі атрибутів\n"
-#: src/elflint.c:3449
+#: src/elflint.c:3481
#, c-format
msgid "section [%2d] '%s': offset %zu: unterminated vendor name string\n"
msgstr ""
"розділ [%2d] «%s»: зміщення %zu: незавершений рядок назви постачальника\n"
-#: src/elflint.c:3466
+#: src/elflint.c:3498
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: endless ULEB128 in attribute subsection tag\n"
@@ -2696,12 +2847,12 @@
"розділ [%2d] «%s»: зміщення %zu: незавершене поле ULEB128 у тезі підрозділу "
"атрибутів\n"
-#: src/elflint.c:3475
+#: src/elflint.c:3507
#, c-format
msgid "section [%2d] '%s': offset %zu: truncated attribute section\n"
msgstr "розділ [%2d] «%s»: зміщення %zu: обрізаний розділ атрибутів\n"
-#: src/elflint.c:3484
+#: src/elflint.c:3516
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: zero length field in attribute subsection\n"
@@ -2709,14 +2860,15 @@
"розділ [%2d] «%s»: зміщення %zu: поле нульового розміру у підрозділі "
"атрибутів\n"
-#: src/elflint.c:3499
+#: src/elflint.c:3531
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: invalid length in attribute subsection\n"
msgstr ""
"розділ [%2d] «%s»: зміщення %zu: некоректна довжина у підрозділі атрибутів\n"
-#: src/elflint.c:3510
+#. Tag_File
+#: src/elflint.c:3542
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: attribute subsection has unexpected tag %u\n"
@@ -2724,35 +2876,35 @@
"розділ [%2d] «%s»: зміщення %zu: підрозділ атрибутів містить неочікуваний "
"теґ %u\n"
-#: src/elflint.c:3528
+#: src/elflint.c:3560
#, c-format
msgid "section [%2d] '%s': offset %zu: endless ULEB128 in attribute tag\n"
msgstr ""
"розділ [%2d] «%s»: зміщення %zu: незавершене поле ULEB128 у тезі атрибуту\n"
-#: src/elflint.c:3539
+#: src/elflint.c:3571
#, c-format
msgid "section [%2d] '%s': offset %zu: unterminated string in attribute\n"
msgstr "розділ [%2d] «%s»: зміщення %zu: незавершений рядок у атрибуті\n"
-#: src/elflint.c:3552
+#: src/elflint.c:3584
#, c-format
msgid "section [%2d] '%s': offset %zu: unrecognized attribute tag %u\n"
msgstr "розділ [%2d] «%s»: зміщення %zu: незавершений теґ атрибуту %u\n"
-#: src/elflint.c:3556
+#: src/elflint.c:3588
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: unrecognized %s attribute value %<PRIu64>\n"
msgstr ""
"розділ [%2d] «%s»: зміщення %zu: невідоме значення %s атрибуту %<PRIu64>\n"
-#: src/elflint.c:3566
+#: src/elflint.c:3598
#, c-format
msgid "section [%2d] '%s': offset %zu: vendor '%s' unknown\n"
msgstr "розділ [%2d] «%s»: зміщення %zu: невідомий постачальник «%s»\n"
-#: src/elflint.c:3572
+#: src/elflint.c:3604
#, c-format
msgid ""
"section [%2d] '%s': offset %zu: extra bytes after last attribute section\n"
@@ -2760,47 +2912,47 @@
"розділ [%2d] «%s»: зміщення %zu: зайві байти після останнього розділу "
"атрибутів\n"
-#: src/elflint.c:3661
+#: src/elflint.c:3693
#, c-format
msgid "cannot get section header of zeroth section\n"
msgstr "не вдалося отримати заголовок нульового розділу\n"
-#: src/elflint.c:3665
+#: src/elflint.c:3697
#, c-format
msgid "zeroth section has nonzero name\n"
msgstr "нульовий розділ має ненульову назву\n"
-#: src/elflint.c:3667
+#: src/elflint.c:3699
#, c-format
msgid "zeroth section has nonzero type\n"
msgstr "нульовий розділ має ненульовий тип\n"
-#: src/elflint.c:3669
+#: src/elflint.c:3701
#, c-format
msgid "zeroth section has nonzero flags\n"
msgstr "нульовий розділ має ненульові прапорці\n"
-#: src/elflint.c:3671
+#: src/elflint.c:3703
#, c-format
msgid "zeroth section has nonzero address\n"
msgstr "нульовий розділ має ненульову адресу\n"
-#: src/elflint.c:3673
+#: src/elflint.c:3705
#, c-format
msgid "zeroth section has nonzero offset\n"
msgstr "нульовий розділ має ненульове зміщення\n"
-#: src/elflint.c:3675
+#: src/elflint.c:3707
#, c-format
msgid "zeroth section has nonzero align value\n"
msgstr "нульовий розділ має ненульове значення вирівнювання\n"
-#: src/elflint.c:3677
+#: src/elflint.c:3709
#, c-format
msgid "zeroth section has nonzero entry size value\n"
msgstr "нульовий розділ має ненульове значення розміру запису\n"
-#: src/elflint.c:3680
+#: src/elflint.c:3712
#, c-format
msgid ""
"zeroth section has nonzero size value while ELF header has nonzero shnum "
@@ -2809,7 +2961,7 @@
"нульовий розділ має ненульове значення розміру, хоча заголовок ELF ман "
"ненульове значення shnum\n"
-#: src/elflint.c:3684
+#: src/elflint.c:3716
#, c-format
msgid ""
"zeroth section has nonzero link value while ELF header does not signal "
@@ -2818,7 +2970,7 @@
"нульовий розділ має ненульове значення компонування, хоча у заголовку ELF "
"немає сигналу переповнення у shstrndx\n"
-#: src/elflint.c:3688
+#: src/elflint.c:3720
#, c-format
msgid ""
"zeroth section has nonzero link value while ELF header does not signal "
@@ -2827,28 +2979,28 @@
"нульовий розділ має ненульове значення компонування, хоча у заголовку ELF "
"немає сигналу переповнення у phnum\n"
-#: src/elflint.c:3706
+#: src/elflint.c:3738
#, c-format
msgid "cannot get section header for section [%2zu] '%s': %s\n"
msgstr "не вдалося отримати заголовок розділу [%2zu] «%s»: %s\n"
-#: src/elflint.c:3715
+#: src/elflint.c:3747
#, c-format
msgid "section [%2zu]: invalid name\n"
msgstr "розділ [%2zu]: некоректна назва\n"
-#: src/elflint.c:3742
+#: src/elflint.c:3774
#, c-format
msgid "section [%2d] '%s' has wrong type: expected %s, is %s\n"
msgstr ""
"розділ [%2d] «%s» належить до помилкового типу: мав бути %s, маємо %s\n"
-#: src/elflint.c:3760
+#: src/elflint.c:3792
#, c-format
msgid "section [%2zu] '%s' has wrong flags: expected %s, is %s\n"
msgstr "розділ [%2zu] «%s» має помилкові прапорці: мало бути %s, маємо %s\n"
-#: src/elflint.c:3778
+#: src/elflint.c:3810
#, c-format
msgid ""
"section [%2zu] '%s' has wrong flags: expected %s and possibly %s, is %s\n"
@@ -2856,12 +3008,12 @@
"розділ [%2zu] «%s» має помилкові прапорці: мало бути %s, можливо, %s, але "
"маємо %s\n"
-#: src/elflint.c:3796
+#: src/elflint.c:3828
#, c-format
msgid "section [%2zu] '%s' present in object file\n"
msgstr "у об’єктному файлі виявлено розділ [%2zu] «%s»\n"
-#: src/elflint.c:3802 src/elflint.c:3834
+#: src/elflint.c:3834 src/elflint.c:3866
#, c-format
msgid ""
"section [%2zu] '%s' has SHF_ALLOC flag set but there is no loadable segment\n"
@@ -2869,7 +3021,7 @@
"у розділ [%2zu] «%s» встановлено прапорець SHF_ALLOC, але немає придатного "
"до завантаження сегмента\n"
-#: src/elflint.c:3807 src/elflint.c:3839
+#: src/elflint.c:3839 src/elflint.c:3871
#, c-format
msgid ""
"section [%2zu] '%s' has SHF_ALLOC flag not set but there are loadable "
@@ -2878,7 +3030,7 @@
"у розділі [%2zu] «%s» не встановлено прапорець SHF_ALLOC, але є придатні до "
"завантаження сегменти\n"
-#: src/elflint.c:3815
+#: src/elflint.c:3847
#, c-format
msgid ""
"section [%2zu] '%s' is extension section index table in non-object file\n"
@@ -2886,22 +3038,22 @@
"розділ [%2zu] «%s» є таблицею-покажчиком розділу розширень у файлі, який не "
"є об’єктним\n"
-#: src/elflint.c:3858
+#: src/elflint.c:3890
#, c-format
msgid "section [%2zu] '%s': size not multiple of entry size\n"
msgstr "розділ [%2zu] «%s»: розмір не є кратним до розміру запису\n"
-#: src/elflint.c:3863
+#: src/elflint.c:3895
#, c-format
msgid "cannot get section header\n"
msgstr "не вдалося отримати заголовок розділу\n"
-#: src/elflint.c:3873
+#: src/elflint.c:3905
#, c-format
msgid "section [%2zu] '%s' has unsupported type %d\n"
msgstr "розділ [%2zu] «%s» належить до непідтримуваного типу %d\n"
-#: src/elflint.c:3888
+#: src/elflint.c:3920
#, c-format
msgid ""
"section [%2zu] '%s' contains invalid processor-specific flag(s) %#<PRIx64>\n"
@@ -2909,74 +3061,74 @@
"розділ [%2zu] «%s» містить некоректні специфічні для процесора прапорці "
"%#<PRIx64>\n"
-#: src/elflint.c:3895
+#: src/elflint.c:3927
#, c-format
msgid "section [%2zu] '%s' contains unknown flag(s) %#<PRIx64>\n"
msgstr "розділ [%2zu] «%s» містить невідомі прапорці %#<PRIx64>\n"
-#: src/elflint.c:3903
+#: src/elflint.c:3935
#, c-format
msgid "section [%2zu] '%s': thread-local data sections address not zero\n"
msgstr ""
"розділ [%2zu] «%s»: адреса розділів локальних даних потоків не є нульовою\n"
-#: src/elflint.c:3913
+#: src/elflint.c:3945
#, fuzzy, c-format
msgid "section [%2zu] '%s': allocated section cannot be compressed\n"
msgstr ""
"розділ [%2zu] «%s»: адреса розділів локальних даних потоків не є нульовою\n"
-#: src/elflint.c:3918
+#: src/elflint.c:3950
#, fuzzy, c-format
msgid "section [%2zu] '%s': nobits section cannot be compressed\n"
msgstr "розділ [%2d] «%s»: не виявлено розділу хешів\n"
-#: src/elflint.c:3924
+#: src/elflint.c:3956
#, fuzzy, c-format
msgid ""
"section [%2zu] '%s': compressed section with no compression header: %s\n"
msgstr "розділ [%2d] «%s»: група розділів, що містить лише один елемент\n"
-#: src/elflint.c:3930
+#: src/elflint.c:3962
#, c-format
msgid "section [%2zu] '%s': invalid section reference in link value\n"
msgstr ""
"розділ [%2zu] «%s»: некоректне посилання на розділ у значенні компонування\n"
-#: src/elflint.c:3935
+#: src/elflint.c:3967
#, c-format
msgid "section [%2zu] '%s': invalid section reference in info value\n"
msgstr ""
"розділ [%2zu] «%s»: некоректне посилання на розділ у значенні відомостей\n"
-#: src/elflint.c:3942
+#: src/elflint.c:3974
#, c-format
msgid "section [%2zu] '%s': strings flag set without merge flag\n"
msgstr "розділ [%2zu] «%s»: встановлено прапорець strings без прапорця merge\n"
-#: src/elflint.c:3947
+#: src/elflint.c:3979
#, c-format
msgid "section [%2zu] '%s': merge flag set but entry size is zero\n"
msgstr ""
"розділ [%2zu] «%s»: встановлено прапорець merge, але розмір запису є "
"нульовим\n"
-#: src/elflint.c:3965
+#: src/elflint.c:3998
#, c-format
msgid "section [%2zu] '%s' has unexpected type %d for an executable section\n"
msgstr "розділ [%2zu] «%s» має неочікуваний тип %d для виконуваного розділу\n"
-#: src/elflint.c:3974
+#: src/elflint.c:4007
#, fuzzy, c-format
msgid "section [%2zu] '%s' must be of type NOBITS in debuginfo files\n"
msgstr "розділ [%2zu] «%s» не повинен бути придатним до запису\n"
-#: src/elflint.c:3981
+#: src/elflint.c:4014
#, c-format
msgid "section [%2zu] '%s' is both executable and writable\n"
msgstr "розділ [%2zu] «%s» є одночасно виконуваним і придатним до запису\n"
-#: src/elflint.c:4012
+#: src/elflint.c:4045
#, c-format
msgid ""
"section [%2zu] '%s' not fully contained in segment of program header entry "
@@ -2985,7 +3137,7 @@
"розділ [%2zu] «%s» не повністю міститься у сегменті запису заголовка "
"програми %d\n"
-#: src/elflint.c:4022
+#: src/elflint.c:4055
#, c-format
msgid ""
"section [%2zu] '%s' has type NOBITS but is read from the file in segment of "
@@ -2994,7 +3146,7 @@
"розділ [%2zu] «%s» належить до типу NOBITS, але його читання виконується з "
"файла у сегментів запису заголовка програми %d\n"
-#: src/elflint.c:4048
+#: src/elflint.c:4081
#, c-format
msgid ""
"section [%2zu] '%s' has type NOBITS but is read from the file in segment of "
@@ -3003,7 +3155,7 @@
"розділ [%2zu] «%s» належить до типу NOBITS, але його читання виконується з "
"файла у сегментів запису заголовка програми %d, а вміст файла є ненульовим\n"
-#: src/elflint.c:4059
+#: src/elflint.c:4092
#, c-format
msgid ""
"section [%2zu] '%s' has not type NOBITS but is not read from the file in "
@@ -3012,19 +3164,19 @@
"розділ [%2zu] «%s» не належить до типу NOBITS, але його читання не "
"виконується з файла у сегментів запису заголовка програми %d\n"
-#: src/elflint.c:4070
+#: src/elflint.c:4103
#, c-format
msgid "section [%2zu] '%s' is executable in nonexecutable segment %d\n"
msgstr "розділ [%2zu] «%s» є виконуваним у невиконуваному сегменті %d\n"
-#: src/elflint.c:4080
+#: src/elflint.c:4113
#, c-format
msgid "section [%2zu] '%s' is writable in unwritable segment %d\n"
msgstr ""
"розділ [%2zu] «%s» є придатним до запису у непридатному до запису сегменті "
"%d\n"
-#: src/elflint.c:4090
+#: src/elflint.c:4123
#, c-format
msgid ""
"section [%2zu] '%s': alloc flag set but section not in any loaded segment\n"
@@ -3032,7 +3184,7 @@
"розділ [%2zu] «%s»: встановлено прапорець alloc, але розділ не перебуває у "
"жодному завантаженому сегменті\n"
-#: src/elflint.c:4096
+#: src/elflint.c:4129
#, c-format
msgid ""
"section [%2zu] '%s': ELF header says this is the section header string table "
@@ -3041,7 +3193,7 @@
"розділ [%2zu] «%s»: заголовок ELF повідомляє про те, що це таблиця рядків "
"заголовка розділу, але ця таблиця не належить до типу SHT_TYPE\n"
-#: src/elflint.c:4104
+#: src/elflint.c:4137
#, c-format
msgid ""
"section [%2zu] '%s': relocatable files cannot have dynamic symbol tables\n"
@@ -3049,17 +3201,17 @@
"розділ [%2zu] «%s»: придатні до пересування файли не можуть містити "
"динамічних таблиць символів\n"
-#: src/elflint.c:4155
+#: src/elflint.c:4188
#, c-format
msgid "more than one version symbol table present\n"
msgstr "виявлено більше за одну таблицю символів версій\n"
-#: src/elflint.c:4178
+#: src/elflint.c:4211
#, c-format
msgid "INTERP program header entry but no .interp section\n"
msgstr "існує запис заголовка програми INTERP, але не розділ .interp\n"
-#: src/elflint.c:4189
+#: src/elflint.c:4222
#, c-format
msgid ""
"loadable segment [%u] is executable but contains no executable sections\n"
@@ -3067,14 +3219,14 @@
"придатний до завантаження сегмент [%u] є виконуваним, але не містить "
"виконуваних розділів\n"
-#: src/elflint.c:4195
+#: src/elflint.c:4228
#, c-format
msgid "loadable segment [%u] is writable but contains no writable sections\n"
msgstr ""
"придатний до завантаження розділ [%u] є придатним до запису, але не містить "
"придатних до запису розділів\n"
-#: src/elflint.c:4206
+#: src/elflint.c:4239
#, c-format
msgid ""
"no .gnu.versym section present but .gnu.versym_d or .gnu.versym_r section "
@@ -3083,24 +3235,24 @@
"немає розділу .gnu.versym, хоча існує розділ .gnu.versym_d або .gnu."
"versym_r\n"
-#: src/elflint.c:4219
+#: src/elflint.c:4252
#, c-format
msgid "duplicate version index %d\n"
msgstr "дублікат індексу версії %d\n"
-#: src/elflint.c:4233
+#: src/elflint.c:4266
#, c-format
msgid ".gnu.versym section present without .gnu.versym_d or .gnu.versym_r\n"
msgstr ""
"існує розділ .gnu.versym, але немає розділу .gnu.versym_d або .gnu.versym_r\n"
-#: src/elflint.c:4282
+#: src/elflint.c:4315
#, c-format
msgid "phdr[%d]: unknown core file note type %<PRIu32> at offset %<PRIu64>\n"
msgstr ""
"phdr[%d]: невідомий тип нотатки файла core %<PRIu32> за зміщенням %<PRIu64>\n"
-#: src/elflint.c:4286
+#: src/elflint.c:4319
#, c-format
msgid ""
"section [%2d] '%s': unknown core file note type %<PRIu32> at offset %zu\n"
@@ -3108,13 +3260,13 @@
"розділ [%2d] «%s»: невідомий тип нотатки файла core %<PRIu32> за зміщенням "
"%zu\n"
-#: src/elflint.c:4309
+#: src/elflint.c:4342
#, c-format
msgid "phdr[%d]: unknown object file note type %<PRIu32> at offset %zu\n"
msgstr ""
"phdr[%d]: невідомий тип нотатки об’єктного файла %<PRIu32> за зміщенням %zu\n"
-#: src/elflint.c:4313
+#: src/elflint.c:4346
#, c-format
msgid ""
"section [%2d] '%s': unknown object file note type %<PRIu32> at offset %zu\n"
@@ -3122,39 +3274,39 @@
"розділ [%2d] «%s»: невідомий тип нотатки об’єктного файла %<PRIu32> за "
"зміщенням %zu\n"
-#: src/elflint.c:4330
+#: src/elflint.c:4363
#, c-format
msgid "phdr[%d]: no note entries defined for the type of file\n"
msgstr "phdr[%d]: для цього типу файлів не визначено записів нотаток\n"
-#: src/elflint.c:4349
+#: src/elflint.c:4382
#, c-format
msgid "phdr[%d]: cannot get content of note section: %s\n"
msgstr "phdr[%d]: не вдалося отримати вміст розділу нотаток: %s\n"
-#: src/elflint.c:4352
+#: src/elflint.c:4385
#, c-format
msgid "phdr[%d]: extra %<PRIu64> bytes after last note\n"
msgstr "phdr[%d]: зайві %<PRIu64> байтів після останнього запису нотатки\n"
-#: src/elflint.c:4373
+#: src/elflint.c:4406
#, c-format
msgid "section [%2d] '%s': no note entries defined for the type of file\n"
msgstr ""
"розділ [%2d] «%s»: для цього типу файлів не визначено записів нотаток\n"
-#: src/elflint.c:4380
+#: src/elflint.c:4413
#, c-format
msgid "section [%2d] '%s': cannot get content of note section\n"
msgstr "розділ [%2d] «%s»: не вдалося отримати вміст розділу нотаток\n"
-#: src/elflint.c:4383
+#: src/elflint.c:4416
#, c-format
msgid "section [%2d] '%s': extra %<PRIu64> bytes after last note\n"
msgstr ""
"розділ [%2d] «%s»: додаткові %<PRIu64> байтів після останньої нотатки\n"
-#: src/elflint.c:4401
+#: src/elflint.c:4434
#, c-format
msgid ""
"only executables, shared objects, and core files can have program headers\n"
@@ -3162,141 +3314,141 @@
"заголовки програм можуть бути лише у виконуваних файлів, об’єктних файлів "
"спільного використання або файлів core\n"
-#: src/elflint.c:4416
+#: src/elflint.c:4449
#, c-format
msgid "cannot get program header entry %d: %s\n"
msgstr "не вдалося отримати запис заголовка програми %d: %s\n"
-#: src/elflint.c:4425
+#: src/elflint.c:4458
#, c-format
msgid "program header entry %d: unknown program header entry type %#<PRIx64>\n"
msgstr ""
"запис заголовка програми %d: невідомий тип запису заголовка програми "
"%#<PRIx64>\n"
-#: src/elflint.c:4436
+#: src/elflint.c:4469
#, c-format
msgid "more than one INTERP entry in program header\n"
msgstr "більше за один запис INTERP у заголовку програми\n"
-#: src/elflint.c:4444
+#: src/elflint.c:4477
#, c-format
msgid "more than one TLS entry in program header\n"
msgstr "більше за один запис TLS у заголовку програми\n"
-#: src/elflint.c:4451
+#: src/elflint.c:4484
#, c-format
msgid "static executable cannot have dynamic sections\n"
msgstr "у статичному виконуваному файлі не може бути динамічних розділів\n"
-#: src/elflint.c:4465
+#: src/elflint.c:4498
#, c-format
msgid "dynamic section reference in program header has wrong offset\n"
msgstr ""
"посилання на динамічний розділ у заголовку програми має помилкове зміщення\n"
-#: src/elflint.c:4468
+#: src/elflint.c:4501
#, c-format
msgid "dynamic section size mismatch in program and section header\n"
msgstr ""
"розміри динамічного розділу у заголовку програми та у заголовку розділу не "
"збігаються\n"
-#: src/elflint.c:4478
+#: src/elflint.c:4511
#, c-format
msgid "more than one GNU_RELRO entry in program header\n"
msgstr "більше за один запис GNU_RELRO у заголовку програми\n"
-#: src/elflint.c:4499
+#: src/elflint.c:4532
#, c-format
msgid "loadable segment GNU_RELRO applies to is not writable\n"
msgstr ""
"придатний до завантаження сегмент, до якого звертається GNU_RELRO, "
"непридатний до запису\n"
-#: src/elflint.c:4510
+#: src/elflint.c:4543
#, c-format
msgid "loadable segment [%u] flags do not match GNU_RELRO [%u] flags\n"
msgstr ""
"прапорці придатного до завантаження сегмента [%u] не відповідають прапорцям "
"GNU_RELRO [%u]\n"
-#: src/elflint.c:4517
+#: src/elflint.c:4550
#, c-format
msgid ""
"GNU_RELRO [%u] flags are not a subset of the loadable segment [%u] flags\n"
msgstr ""
-#: src/elflint.c:4526 src/elflint.c:4549
+#: src/elflint.c:4559 src/elflint.c:4582
#, c-format
msgid "%s segment not contained in a loaded segment\n"
msgstr "сегмент %s не міститься у завантаженому сегменті\n"
-#: src/elflint.c:4555
+#: src/elflint.c:4588
#, c-format
msgid "program header offset in ELF header and PHDR entry do not match"
msgstr "зміщення заголовка програми у заголовку ELF і запис PHDR не збігаються"
-#: src/elflint.c:4580
+#: src/elflint.c:4613
#, c-format
msgid "call frame search table reference in program header has wrong offset\n"
msgstr ""
"посилання на таблицю вікон викликів у заголовку програми має помилкове "
"зміщення\n"
-#: src/elflint.c:4583
+#: src/elflint.c:4616
#, c-format
msgid "call frame search table size mismatch in program and section header\n"
msgstr ""
"розміри таблиці пошуку вікон виклику у заголовку програми та у заголовку "
"розділу не збігаються\n"
-#: src/elflint.c:4596
+#: src/elflint.c:4629
#, c-format
msgid "PT_GNU_EH_FRAME present but no .eh_frame_hdr section\n"
msgstr "існує PT_GNU_EH_FRAME, хоча немає розділу .eh_frame_hdr\n"
-#: src/elflint.c:4604
+#: src/elflint.c:4637
#, c-format
msgid "call frame search table must be allocated\n"
msgstr "таблицю пошуку вікон викликів має бути розміщено у пам’яті\n"
-#: src/elflint.c:4607
+#: src/elflint.c:4640
#, c-format
msgid "section [%2zu] '%s' must be allocated\n"
msgstr "розділ [%2zu] «%s» має бути розміщено у пам’яті\n"
-#: src/elflint.c:4611
+#: src/elflint.c:4644
#, c-format
msgid "call frame search table must not be writable\n"
msgstr "таблиця пошуку вікон викликів не повинна бути придатною до запису\n"
-#: src/elflint.c:4614
+#: src/elflint.c:4647
#, c-format
msgid "section [%2zu] '%s' must not be writable\n"
msgstr "розділ [%2zu] «%s» не повинен бути придатним до запису\n"
-#: src/elflint.c:4619
+#: src/elflint.c:4652
#, c-format
msgid "call frame search table must not be executable\n"
msgstr "таблиця пошуку вікон викликів не повинна бути придатною до виконання\n"
-#: src/elflint.c:4622
+#: src/elflint.c:4655
#, c-format
msgid "section [%2zu] '%s' must not be executable\n"
msgstr "розділ [%2zu] «%s» не повинен бути придатним до виконання\n"
-#: src/elflint.c:4633
+#: src/elflint.c:4666
#, c-format
msgid "program header entry %d: file size greater than memory size\n"
msgstr "запис заголовка програми %d: розмір файла перевищує об’єм пам’яті\n"
-#: src/elflint.c:4640
+#: src/elflint.c:4673
#, c-format
msgid "program header entry %d: alignment not a power of 2\n"
msgstr "запис заголовка програми %d: значення вирівнювання не є степенем 2\n"
-#: src/elflint.c:4643
+#: src/elflint.c:4676
#, c-format
msgid ""
"program header entry %d: file offset and virtual address not module of "
@@ -3305,7 +3457,7 @@
"запис заголовка програми %d: зміщення у файлі і віртуальна адреса не "
"співвідносяться з вирівнюванням\n"
-#: src/elflint.c:4656
+#: src/elflint.c:4689
#, c-format
msgid ""
"executable/DSO with .eh_frame_hdr section does not have a PT_GNU_EH_FRAME "
@@ -3314,102 +3466,104 @@
"виконуваний модуль/DSO з розділом .eh_frame_hdr не містить запису заголовка "
"програми PT_GNU_EH_FRAME"
-#: src/elflint.c:4690
+#: src/elflint.c:4723
#, c-format
msgid "cannot read ELF header: %s\n"
msgstr "не вдалося прочитати заголовок ELF: %s\n"
-#: src/elflint.c:4716
+#: src/elflint.c:4749
#, c-format
msgid "text relocation flag set but not needed\n"
msgstr ""
"встановлено прапорець пересування тексту, але такий прапорець не потрібен\n"
-#: src/findtextrel.c:62
+#: src/findtextrel.c:61
msgid "Input Selection:"
msgstr "Вибір параметрів виводу даних:"
-#: src/findtextrel.c:63
+#: src/findtextrel.c:62
msgid "Prepend PATH to all file names"
msgstr "Додавати ШЛЯХ до всіх назв файлів"
-#: src/findtextrel.c:65
+#: src/findtextrel.c:64
msgid "Use PATH as root of debuginfo hierarchy"
msgstr "Використовувати ШЛЯХ як кореневий каталог для ієрархії debuginfo"
-#: src/findtextrel.c:72
+#. Short description of program.
+#: src/findtextrel.c:71
msgid "Locate source of text relocations in FILEs (a.out by default)."
msgstr "Шукає джерело пересуваного тексту у ФАЙЛАХ (типово, a.out)."
-#: src/findtextrel.c:76 src/nm.c:108 src/objdump.c:71 src/size.c:83
-#: src/strings.c:88 src/strip.c:95
+#. Strings for arguments in help texts.
+#: src/findtextrel.c:75 src/nm.c:109 src/objdump.c:72 src/size.c:81
+#: src/strings.c:88 src/strip.c:99
msgid "[FILE...]"
msgstr "[ФАЙЛ...]"
-#: src/findtextrel.c:238
+#: src/findtextrel.c:223
#, c-format
msgid "cannot get ELF header '%s': %s"
msgstr "не вдалося отримати заголовок ELF «%s»: %s"
-#: src/findtextrel.c:249
+#: src/findtextrel.c:234
#, c-format
msgid "'%s' is not a DSO or PIE"
msgstr "«%s» не є DSO або PIE"
-#: src/findtextrel.c:269
+#: src/findtextrel.c:254
#, c-format
msgid "getting get section header of section %zu: %s"
msgstr "отримання заголовка розділу get розділу %zu: %s"
-#: src/findtextrel.c:292
+#: src/findtextrel.c:277
#, c-format
msgid "cannot read dynamic section: %s"
msgstr "не вдалося прочитати динамічний розділ: %s"
-#: src/findtextrel.c:313
+#: src/findtextrel.c:298
#, c-format
msgid "no text relocations reported in '%s'"
msgstr "у «%s» не виявлено пересувань тексту"
-#: src/findtextrel.c:325
+#: src/findtextrel.c:310
#, c-format
msgid "while reading ELF file"
msgstr "під час спроби читання файла ELF"
-#: src/findtextrel.c:329
+#: src/findtextrel.c:314
#, c-format
msgid "cannot get program header count: %s"
msgstr "не вдалося отримати кількість заголовків програми: %s"
-#: src/findtextrel.c:340 src/findtextrel.c:357
+#: src/findtextrel.c:325 src/findtextrel.c:342
#, c-format
msgid "cannot get program header index at offset %zd: %s"
msgstr "не вдалося отримати індекс заголовка програми за зміщенням %zd: %s"
-#: src/findtextrel.c:421
+#: src/findtextrel.c:406
#, c-format
msgid "cannot get symbol table section %zu in '%s': %s"
msgstr "не вдалося отримати таблицю символів розділу %zu у «%s»: %s"
-#: src/findtextrel.c:441 src/findtextrel.c:464
+#: src/findtextrel.c:426 src/findtextrel.c:449
#, c-format
msgid "cannot get relocation at index %d in section %zu in '%s': %s"
msgstr ""
"не вдалося отримати пересування за індексом %d у розділі %zu у «%s»: %s"
-#: src/findtextrel.c:530
+#: src/findtextrel.c:515
#, c-format
msgid "%s not compiled with -fpic/-fPIC\n"
msgstr "%s не зібрано з -fpic/-fPIC\n"
-#: src/findtextrel.c:583
+#: src/findtextrel.c:568
#, c-format
msgid ""
"the file containing the function '%s' is not compiled with -fpic/-fPIC\n"
msgstr ""
"файл, що містить функцію «%s», не було зібрано з параметрами -fpic/-fPIC\n"
-#: src/findtextrel.c:590 src/findtextrel.c:610
+#: src/findtextrel.c:575 src/findtextrel.c:595
#, c-format
msgid ""
"the file containing the function '%s' might not be compiled with -fpic/-"
@@ -3418,7 +3572,7 @@
"файл, що містить функцію «%s», ймовірно, не було зібрано з параметрами -"
"fpic/-fPIC\n"
-#: src/findtextrel.c:598
+#: src/findtextrel.c:583
#, c-format
msgid ""
"either the file containing the function '%s' or the file containing the "
@@ -3427,7 +3581,7 @@
"файл, що містить функцію «%s», або файл, що містить функцію «%s», зібрано "
"без параметрів -fpic/-fPIC\n"
-#: src/findtextrel.c:618
+#: src/findtextrel.c:603
#, c-format
msgid ""
"a relocation modifies memory at offset %llu in a write-protected segment\n"
@@ -3435,771 +3589,43 @@
"пересування призводить до зміни запису пам’яті за зміщенням %llu у "
"захищеному від запису сегменті\n"
-#: src/i386_ld.c:202
-#, c-format
-msgid "cannot allocate PLT section: %s"
-msgstr "не вдалося розмістити PLT-розділ: %s"
-
-#: src/i386_ld.c:224
-#, c-format
-msgid "cannot allocate PLTREL section: %s"
-msgstr "не вдалося розмістити розділ PLTREL: %s"
-
-#: src/i386_ld.c:245
-#, c-format
-msgid "cannot allocate GOT section: %s"
-msgstr "не вдалося розмістити розділ GOT: %s"
-
-#: src/i386_ld.c:266
-#, c-format
-msgid "cannot allocate GOTPLT section: %s"
-msgstr "не вдалося розмістити розділ GOTPLT: %s"
-
-#: src/i386_ld.c:653
-#, c-format
-msgid "initial-executable TLS relocation cannot be used "
-msgstr ""
-"не можна використовувати пересування TLS у початковому виконуваному файлі"
-
-#: src/ld.c:78
-msgid "Input File Control:"
-msgstr "Керування файлом вхідних даних:"
-
-#: src/ld.c:80
-msgid "Include whole archives in the output from now on."
-msgstr "Відтепер включати цілі архіви до виведених даних."
-
-#: src/ld.c:82
-msgid "Stop including the whole archives in the output."
-msgstr "Припинити включення цілих архівів до вихідних даних."
-
-#: src/ld.c:83 src/ld.c:97 src/ld.c:175
-msgid "FILE"
-msgstr "ФАЙЛ"
-
-#: src/ld.c:84
-msgid "Start a group."
-msgstr "Почати групу."
-
-#: src/ld.c:85
-msgid "End a group."
-msgstr "Завершити групу."
-
-#: src/ld.c:86
-msgid "PATH"
-msgstr "ШЛЯХ"
-
-#: src/ld.c:87
-msgid "Add PATH to list of directories files are searched in."
-msgstr "Додати ШЛЯХ до списку каталогів, у яких слід шукати файли."
-
-#: src/ld.c:89
-msgid "Only set DT_NEEDED for following dynamic libs if actually used"
-msgstr ""
-"Встановлювати DT_NEEDED лише для наступних динамічних бібліотек, якщо він "
-"справді використовується"
-
-#: src/ld.c:91
-msgid "Always set DT_NEEDED for following dynamic libs"
-msgstr "Завжди встановлювати DT_NEEDED для наступних динамічних бібліотек"
-
-#: src/ld.c:93
-msgid "Ignore LD_LIBRARY_PATH environment variable."
-msgstr "Ігнорувати змінну середовища LD_LIBRARY_PATH."
-
-#: src/ld.c:96
-msgid "Output File Control:"
-msgstr "Керування файлом виведених даних:"
-
-#: src/ld.c:97
-msgid "Place output in FILE."
-msgstr "Вивести дані до ФАЙЛА."
-
-#: src/ld.c:100
-msgid "Object is marked to not use default search path at runtime."
-msgstr ""
-"Об’єкт позначено, як таких, який не використовує типовий шлях пошуку під час "
-"запуску."
-
-#: src/ld.c:102
-msgid "Same as --whole-archive."
-msgstr "Те саме, що --whole-archive."
-
-#: src/ld.c:103
-msgid ""
-"Default rules of extracting from archive; weak references are not enough."
-msgstr "Типові правила видобування з архівів; слабкого посилання недостатньо."
-
-#: src/ld.c:107
-msgid "Weak references cause extraction from archive."
-msgstr "Слабкі посилання спричиняють видобування з архіву."
-
-#: src/ld.c:109
-msgid "Allow multiple definitions; first is used."
-msgstr "Дозволити декілька визначень. Використовуватиметься лише перше."
-
-#: src/ld.c:111
-msgid "Disallow/allow undefined symbols in DSOs."
-msgstr "Заборонити/Дозволити невизначені символи у DSO."
-
-#: src/ld.c:114
-msgid "Object requires immediate handling of $ORIGIN."
-msgstr "Об’єкт вимагає негайної обробки $ORIGIN."
-
-#: src/ld.c:116
-msgid "Relocation will not be processed lazily."
-msgstr "Переміщення не буде оброблятися у лінивому режимі."
-
-#: src/ld.c:118
-msgid "Object cannot be unloaded at runtime."
-msgstr "Об’єкт не можна вивантажувати під час запуску."
-
-#: src/ld.c:120
-msgid "Mark object to be initialized first."
-msgstr "Позначити об’єкт, як такий, що потребує ініціалізації."
-
-#: src/ld.c:122
-msgid "Enable/disable lazy-loading flag for following dependencies."
-msgstr ""
-"Увімкнути/Вимкнути прапорець лінивого завантаження для наведених нижче "
-"залежностей."
-
-#: src/ld.c:124
-msgid "Mark object as not loadable with 'dlopen'."
-msgstr ""
-"Позначити об’єкт, як непридатний для завантаження за допомогою «dlopen»."
-
-#: src/ld.c:126
-msgid "Ignore/record dependencies on unused DSOs."
-msgstr "Ігнорувати/Записувати залежності невикористаних DSO."
-
-#: src/ld.c:128
-msgid "Generated DSO will be a system library."
-msgstr "Створена DSO буде системною бібліотекою."
-
-#: src/ld.c:129
-msgid "ADDRESS"
-msgstr "АДРЕСА"
-
-#: src/ld.c:129
-msgid "Set entry point address."
-msgstr "Встановити адресу точки входу."
-
-#: src/ld.c:132
-msgid "Do not link against shared libraries."
-msgstr "Не компонувати з бібліотеками спільного використання."
-
-#: src/ld.c:135
-msgid "Prefer linking against shared libraries."
-msgstr "Надавати перевагу компонуванню з бібліотеками спільного використання."
-
-#: src/ld.c:136
-msgid "Export all dynamic symbols."
-msgstr "Експортувати всі динамічні символи."
-
-#: src/ld.c:137
-msgid "Strip all symbols."
-msgstr "Вилучити всі символи."
-
-#: src/ld.c:138
-msgid "Strip debugging symbols."
-msgstr "Вилучити символи зневаджування."
-
-#: src/ld.c:140
-msgid "Assume pagesize for the target system to be SIZE."
-msgstr ""
-"Вважати розмір сторінки для системи призначення рівним значенню РОЗМІР."
-
-#: src/ld.c:142
-msgid "Set runtime DSO search path."
-msgstr "Встановити шлях пошуку DSO під час запуску."
-
-#: src/ld.c:145
-msgid "Set link time DSO search path."
-msgstr "Встановити шлях пошуку DSO під час компонування."
-
-#: src/ld.c:146
-msgid "Generate dynamic shared object."
-msgstr "Створити динамічний об’єкт спільного використання."
-
-#: src/ld.c:147
-msgid "Generate relocatable object."
-msgstr "Створити придатний для пересування об’єкт."
-
-#: src/ld.c:150
-msgid "Causes symbol not assigned to a version be reduced to local."
-msgstr ""
-"Спричиняє перетворення символів, не прив’язаних до версії, на локальні."
-
-#: src/ld.c:151
-msgid "Remove unused sections."
-msgstr "Вилучити невикористані розділи."
-
-#: src/ld.c:154
-msgid "Don't remove unused sections."
-msgstr "Не вилучати невикористані розділи."
-
-#: src/ld.c:155
-msgid "Set soname of shared object."
-msgstr "Встановити soname об’єкта спільного використання."
-
-#: src/ld.c:156
-msgid "Set the dynamic linker name."
-msgstr "Встановити назву динамічного компонувальника."
-
-#: src/ld.c:159
-msgid "Add/suppress addition indentifying link-editor to .comment section."
-msgstr ""
-"Додати/Придушити додавання ідентифікації редактора компонування до розділу ."
-"comment."
-
-#: src/ld.c:162
-msgid "Create .eh_frame_hdr section"
-msgstr "Створити розділ .eh_frame_hdr"
-
-#: src/ld.c:164
-msgid "Set hash style to sysv, gnu or both."
-msgstr "Встановити формат хешування у значення sysv, gnu або both."
-
-#: src/ld.c:166
-msgid "Generate build ID note (md5, sha1 (default), uuid)."
-msgstr "Створити запису ідентифікатора збирання (md5, sha1 (типовий), uuid)."
-
-#: src/ld.c:168
-msgid "Linker Operation Control:"
-msgstr "Керування роботою компонувальника:"
-
-#: src/ld.c:169
-msgid "Verbose messages."
-msgstr "Докладні повідомлення."
-
-#: src/ld.c:170
-msgid "Trace file opens."
-msgstr "Спостерігати за відкриттями файлів."
-
-#: src/ld.c:172
-msgid "Trade speed for less memory usage"
-msgstr "Зменшити споживання пам’яті за рахунок швидкості"
-
-#: src/ld.c:173
-msgid "LEVEL"
-msgstr "РІВЕНЬ"
-
-#: src/ld.c:174
-msgid "Set optimization level to LEVEL."
-msgstr "Встановити рівень оптимізації РІВЕНЬ."
-
-#: src/ld.c:175
-msgid "Use linker script in FILE."
-msgstr "Використати скрипт компонування у ФАЙЛі."
-
-#: src/ld.c:178
-msgid "Select to get parser debug information"
-msgstr "Позначте, щоб отримати діагностичні дані обробника"
-
-#: src/ld.c:181
-msgid "Read version information from FILE."
-msgstr "Прочитати відомості щодо версії з ФАЙЛа."
-
-#: src/ld.c:182
-msgid "Set emulation to NAME."
-msgstr "Встановити режим емуляції на основі НАЗВИ."
-
-#: src/ld.c:188
-msgid "Combine object and archive files."
-msgstr "Комбінує об’єктні файли і файли архівів."
-
-#: src/ld.c:191
-msgid "[FILE]..."
-msgstr "[ФАЙЛ]..."
-
-#: src/ld.c:319
-#, c-format
-msgid "At least one input file needed"
-msgstr "Потрібен принаймні один файл вхідних даних"
-
-#: src/ld.c:335
-#, c-format
-msgid "error while preparing linking"
-msgstr "помилка під час приготування до компонування"
-
-#: src/ld.c:342
-#, c-format
-msgid "cannot open linker script '%s'"
-msgstr "не вдалося відкрити скрипт компонування «%s»"
-
-#: src/ld.c:383
-#, c-format
-msgid "-( without matching -)"
-msgstr "-( без відповідника -)"
-
-#: src/ld.c:558 src/ld.c:596
-#, c-format
-msgid "only one option of -G and -r is allowed"
-msgstr "можна використовувати лише один з параметрів -G або -r"
-
-#: src/ld.c:580
-#, c-format
-msgid "more than one '-m' parameter"
-msgstr "декілька параметрів «-m»"
-
-#: src/ld.c:590 src/ld.c:999
-#, c-format
-msgid "unknown option `-%c %s'"
-msgstr "невідомий параметр «-%c %s»"
-
-#: src/ld.c:632
-#, c-format
-msgid "invalid page size value '%s': ignored"
-msgstr "некоректне значення розміру сторінки «%s»: проігноровано"
-
-#: src/ld.c:673
-#, c-format
-msgid "invalid hash style '%s'"
-msgstr "некоректний формат хешування «%s»"
-
-#: src/ld.c:683
-#, c-format
-msgid "invalid build-ID style '%s'"
-msgstr "некоректний формат ідентифікатора збирання «%s»"
-
-#: src/ld.c:771
-#, c-format
-msgid "More than one output file name given."
-msgstr "Вказано декілька назв файлів виведення даних."
-
-#: src/ld.c:788
-#, c-format
-msgid "Invalid optimization level `%s'"
-msgstr "Некоректний рівень оптимізації «%s»"
-
-#: src/ld.c:836
-#, c-format
-msgid "nested -( -) groups are not allowed"
-msgstr "підтримки вкладених груп -( -) не передбачено"
-
-#: src/ld.c:855
-#, c-format
-msgid "-) without matching -("
-msgstr "-) без відповідника -("
-
-#: src/ld.c:1032
-#, c-format
-msgid "unknown option '-%c %s'"
-msgstr "невідомий параметр «-%c %s»"
-
-#: src/ld.c:1138
-#, c-format
-msgid "could not find input file to determine output file format"
-msgstr ""
-"не вдалося виявити файл вхідних даних для визначення формату файла вихідних "
-"даних"
-
-#: src/ld.c:1140
-#, c-format
-msgid "try again with an appropriate '-m' parameter"
-msgstr "повторіть спробу з належним параметром «-m»"
-
-#: src/ld.c:1434
-#, c-format
-msgid "cannot read version script '%s'"
-msgstr "не вдалося прочитати скрипт версій «%s»"
-
-#: src/ld.c:1500 src/ld.c:1539
-#, c-format
-msgid "duplicate definition of '%s' in linker script"
-msgstr "повторне визначення «%s» у скрипті компонування"
-
-#: src/ldgeneric.c:201 src/ldgeneric.c:5141
-#, c-format
-msgid "cannot create string table"
-msgstr "не вдалося створити таблицю рядків"
-
-#: src/ldgeneric.c:247
-#, c-format
-msgid "cannot load ld backend library '%s': %s"
-msgstr "не вдалося завантажити бібліотеку сервера ld «%s»: %s"
-
-#: src/ldgeneric.c:257
-#, c-format
-msgid "cannot find init function in ld backend library '%s': %s"
-msgstr "не вдалося виявити функцію init у бібліотеці сервера ld «%s»: %s"
-
-#: src/ldgeneric.c:300
-#, c-format
-msgid "%s listed more than once as input"
-msgstr "%s вказано декілька разів як джерело даних"
-
-#: src/ldgeneric.c:414
-#, c-format
-msgid "%s (for -l%s)\n"
-msgstr "%s (для -l%s)\n"
-
-#: src/ldgeneric.c:415
-#, c-format
-msgid "%s (for DT_NEEDED %s)\n"
-msgstr "%s (для DT_NEEDED %s)\n"
-
-#: src/ldgeneric.c:563
-#, c-format
-msgid "Warning: type of `%s' changed from %s in %s to %s in %s"
-msgstr "Попередження: тип «%s» змінився з %s у %s на %s у %s"
-
-#: src/ldgeneric.c:576
-#, c-format
-msgid "Warning: size of `%s' changed from %<PRIu64> in %s to %<PRIu64> in %s"
-msgstr "Попередження: розмір «%s» змінено з %<PRIu64> у %s на %<PRIu64> у %s"
-
-#: src/ldgeneric.c:651 src/ldgeneric.c:1112 src/readelf.c:536 src/readelf.c:852
-#: src/strip.c:589
-#, c-format
-msgid "cannot determine number of sections: %s"
-msgstr "не вдалося визначити кількість розділів: %s"
-
-#: src/ldgeneric.c:667
-#, c-format
-msgid "(%s+%#<PRIx64>): multiple definition of %s `%s'\n"
-msgstr "(%s+%#<PRIx64>): повторне визначення %s «%s»\n"
-
-#: src/ldgeneric.c:690
-#, c-format
-msgid "(%s+%#<PRIx64>): first defined here\n"
-msgstr "(%s+%#<PRIx64>): вперше визначено тут\n"
-
-#: src/ldgeneric.c:809
-#, c-format
-msgid "%s: cannot get section group data: %s"
-msgstr "%s: не вдалося отримати дані групи розділів: %s"
-
-#: src/ldgeneric.c:830
-#, c-format
-msgid "%s: section '%s' with group flag set does not belong to any group"
-msgstr ""
-"%s: розділ «%s» з встановленим прапорцем групи не належить жодній групі"
-
-#: src/ldgeneric.c:875
-#, c-format
-msgid "%s: section [%2d] '%s' is not in the correct section group"
-msgstr "%s: розділ [%2d] «%s» не належить до відповідної групи розділів"
-
-#: src/ldgeneric.c:1146 src/ldgeneric.c:1403 src/ldgeneric.c:1412
-#: src/ldgeneric.c:1471 src/ldgeneric.c:1480 src/ldgeneric.c:1743
-#: src/ldgeneric.c:1995
-#, c-format
-msgid "%s: invalid ELF file (%s:%d)\n"
-msgstr "%s: некоректний файл ELF (%s:%d)\n"
-
-#: src/ldgeneric.c:1240
-#, c-format
-msgid "%s: only files of type ET_REL might contain section groups"
-msgstr "%s: групи розділів можуть містити лише файли типу ET_REL"
-
-#: src/ldgeneric.c:1292
-#, c-format
-msgid "%s: cannot determine signature of section group [%2zd] '%s': %s"
-msgstr "%s: не вдалося визначити підпис групи розділів [%2zd] «%s»: %s"
-
-#: src/ldgeneric.c:1304
-#, c-format
-msgid "%s: cannot get content of section group [%2zd] '%s': %s'"
-msgstr "%s: не вдалося отримати вміст групи розділів [%2zd] «%s»: %s'"
-
-#: src/ldgeneric.c:1318
-#, c-format
-msgid ""
-"%s: group member %zu of section group [%2zd] '%s' has too high index: "
-"%<PRIu32>"
-msgstr ""
-"%s: елемент групи %zu групи розділів [%2zd] «%s» має надто високий індекс: "
-"%<PRIu32>"
-
-#: src/ldgeneric.c:1340
-#, c-format
-msgid "%s: section '%s' has unknown type: %d"
-msgstr "%s: розділ «%s» належить до невідомого типу: %d"
-
-#: src/ldgeneric.c:1719
-#, c-format
-msgid "cannot get descriptor for ELF file (%s:%d): %s\n"
-msgstr "не вдалося отримати дескриптор файла ELF (%s:%d): %s\n"
-
-#: src/ldgeneric.c:1889
-#, c-format
-msgid "cannot read archive `%s': %s"
-msgstr "не вдалося прочитати архів «%s»: %s"
-
-#: src/ldgeneric.c:2010
-#, c-format
-msgid "file of type %s cannot be linked in\n"
-msgstr "файл типу %s не можна скомпонувати у\n"
-
-#: src/ldgeneric.c:2022
-#, c-format
-msgid "%s: input file incompatible with ELF machine type %s\n"
-msgstr "%s: файл вхідних даних несумісний з типом архітектури ELF %s\n"
-
-#: src/ldgeneric.c:2034
-#, c-format
-msgid "%s: cannot get section header string table index: %s\n"
-msgstr ""
-"%s: не вдалося отримати покажчик таблиці рядків заголовка розділу: %s\n"
-
-#: src/ldgeneric.c:2063
-#, c-format
-msgid "cannot use DSO '%s' when generating relocatable object file"
-msgstr ""
-"не вдалося використати DSO «%s» під час створення придатного до пересування "
-"об’єктного файла"
-
-#: src/ldgeneric.c:2148
-#, c-format
-msgid "input file '%s' ignored"
-msgstr "файл вхідних даних «%s» проігноровано"
-
-#: src/ldgeneric.c:2362
-#, c-format
-msgid "undefined symbol `%s' in %s"
-msgstr "невизначений символ «%s» у %s"
-
-#: src/ldgeneric.c:2692
-#, c-format
-msgid "cannot create ELF descriptor for output file: %s"
-msgstr "не вдалося створити дескриптор ELF для файла вихідних даних: %s"
-
-#: src/ldgeneric.c:2699
-#, c-format
-msgid "could not create ELF header for output file: %s"
-msgstr "не вдалося створити заголовок ELF для файла виведених даних: %s"
-
-#: src/ldgeneric.c:3214 src/ldgeneric.c:3284 src/ldgeneric.c:3320
-#: src/ldgeneric.c:4447 src/ldgeneric.c:4496 src/ldgeneric.c:4528
-#: src/ldgeneric.c:4763 src/ldgeneric.c:4818 src/ldgeneric.c:5065
-#: src/ldgeneric.c:5121 src/ldgeneric.c:5590 src/ldgeneric.c:5602
-#, c-format
-msgid "cannot create section for output file: %s"
-msgstr "не вдалося створити розділ для файла вихідних даних: %s"
-
-#: src/ldgeneric.c:3434
-#, c-format
-msgid "address computation expression contains variable '%s'"
-msgstr "вираз обчислення адреси містить змінну «%s»"
-
-#: src/ldgeneric.c:3479
-#, c-format
-msgid ""
-"argument '%<PRIuMAX>' of ALIGN in address computation expression is no power "
-"of two"
-msgstr ""
-"значення «%<PRIuMAX>» ALIGN у виразі обчислення адреси не є степенем двійки"
-
-#: src/ldgeneric.c:3674
-#, c-format
-msgid "cannot find entry symbol '%s': defaulting to %#0*<PRIx64>"
-msgstr ""
-"не вдалося знайти символ запису «%s»: встановлено типове значення "
-"%#0*<PRIx64>"
-
-#: src/ldgeneric.c:3680
-#, c-format
-msgid "no entry symbol specified: defaulting to %#0*<PRIx64>"
-msgstr "не вказано символу запису: встановлено типове значення %#0*<PRIx64>"
-
-#: src/ldgeneric.c:3910
-#, c-format
-msgid "cannot create GNU hash table section for output file: %s"
-msgstr ""
-"не вдалося створити розділ таблиці хешів GNU для файла вихідних даних: %s"
-
-#: src/ldgeneric.c:4061
-#, c-format
-msgid "cannot create hash table section for output file: %s"
-msgstr "не вдалося створити розділ таблиці хешів для файла вихідних даних: %s"
-
-#: src/ldgeneric.c:4104
-#, c-format
-msgid "cannot create build ID section: %s"
-msgstr "не вдалося створити розділу ідентифікатора збирання: %s"
-
-#: src/ldgeneric.c:4181
-#, c-format
-msgid "cannot convert section data to file format: %s"
-msgstr "не вдалося перетворити дані розділу у формат файла: %s"
-
-#: src/ldgeneric.c:4190
-#, c-format
-msgid "cannot convert section data to memory format: %s"
-msgstr "не вдалося перетворити дані розділу у формат вмісту пам’яті: %s"
-
-#: src/ldgeneric.c:4251
-#, c-format
-msgid "cannot read enough data for UUID"
-msgstr "не вдалося прочитати достатньо даних для встановлення UUID"
-
-#: src/ldgeneric.c:4348 src/ldgeneric.c:4369 src/ldgeneric.c:4398
-#: src/ldgeneric.c:6051
-#, c-format
-msgid "cannot create symbol table for output file: %s"
-msgstr "не вдалося створити таблицю символів для файла вихідних даних: %s"
-
-#: src/ldgeneric.c:5290 src/ldgeneric.c:5842
-#, c-format
-msgid "section index too large in dynamic symbol table"
-msgstr "у таблиці динамічних символів покажчик є занадто великим"
-
-#: src/ldgeneric.c:5735
-#, c-format
-msgid "cannot create versioning section: %s"
-msgstr "не вдалося створити розділ версій: %s"
-
-#: src/ldgeneric.c:5808
-#, c-format
-msgid "cannot create dynamic symbol table for output file: %s"
-msgstr ""
-"не вдалося створити динамічну таблицю символів для файла вихідних даних: %s"
-
-#: src/ldgeneric.c:5983
-#, c-format
-msgid "cannot create versioning data: %s"
-msgstr "не вдалося створити даних версії: %s"
-
-#: src/ldgeneric.c:6083 src/ldgeneric.c:6096 src/ldgeneric.c:6160
-#: src/ldgeneric.c:6168
-#, c-format
-msgid "cannot create section header string section: %s"
-msgstr "не вдалося створити розділ рядків заголовка розділу: %s"
-
-#: src/ldgeneric.c:6090
-#, c-format
-msgid "cannot create section header string section"
-msgstr "не вдалося створити розділ рядків заголовка розділу"
-
-#: src/ldgeneric.c:6248
-#, c-format
-msgid "cannot create program header: %s"
-msgstr "не вдалося створити заголовок програми: %s"
-
-#: src/ldgeneric.c:6256
-#, c-format
-msgid "while determining file layout: %s"
-msgstr "під час визначення компонування файла: %s"
-
-#: src/ldgeneric.c:6377
-#, c-format
-msgid "internal error: non-nobits section follows nobits section"
-msgstr "внутрішня помилка: небезбітовий розділ слідом за безбітовим розділом"
-
-#: src/ldgeneric.c:6914
-#, c-format
-msgid "cannot get header of 0th section: %s"
-msgstr "не вдалося отримати заголовок 0-го розділу: %s"
-
-#: src/ldgeneric.c:6930 src/unstrip.c:1929
-#, c-format
-msgid "cannot update ELF header: %s"
-msgstr "не вдалося оновити заголовок ELF: %s"
-
-#: src/ldgeneric.c:6961
-#, c-format
-msgid "linker backend didn't specify function to relocate section"
-msgstr "у сервері компонування не визначено функції для розділу пересування"
-
-#: src/ldgeneric.c:6973
-#, c-format
-msgid "while writing output file: %s"
-msgstr "під час запису файла вихідних даних: %s"
-
-#: src/ldgeneric.c:6978
-#, c-format
-msgid "while finishing output file: %s"
-msgstr "під час закриття файла вихідних даних: %s"
-
-#: src/ldgeneric.c:6984
-#, c-format
-msgid "cannot stat output file"
-msgstr "не вдалося обробити stat файл виводу даних"
-
-#: src/ldgeneric.c:7000
-#, c-format
-msgid "WARNING: temporary output file overwritten before linking finished"
-msgstr ""
-"ПОПЕРЕДЖЕННЯ: файл тимчасового виводу даних було перезаписано до завершення "
-"компонування"
-
-#: src/ldgeneric.c:7053 src/ldgeneric.c:7064 src/ldgeneric.c:7075
-#: src/ldgeneric.c:7086 src/ldgeneric.c:7105 src/ldgeneric.c:7118
-#: src/ldgeneric.c:7130
-#, c-format
-msgid "no machine specific '%s' implementation"
-msgstr "не специфічна для архітектури реалізація «%s»"
-
-#: src/ldscript.y:170
-msgid "mode for segment invalid\n"
-msgstr "режим сегмента є некоректним\n"
-
-#: src/ldscript.y:457
-#, c-format
-msgid "while reading version script '%s': %s at line %d"
-msgstr "під час читання скрипту версій «%s»: %s у рядку %d"
-
-#: src/ldscript.y:458
-#, c-format
-msgid "while reading linker script '%s': %s at line %d"
-msgstr "під час читання скрипту компонування «%s»: %s у рядку %d"
-
-#: src/ldscript.y:737
-#, c-format
-msgid "symbol '%s' is declared both local and global for unnamed version '%s'"
-msgstr ""
-"символ «%s» оголошено локально і на загальному рівні для версії без назви "
-"«%s»"
-
-#: src/ldscript.y:739
-#, c-format
-msgid "symbol '%s' is declared both local and global for version '%s'"
-msgstr "символ «%s» оголошено локально і на загальному рівні для версії «%s»"
-
-#: src/ldscript.y:759 src/ldscript.y:766
-#, c-format
-msgid "default visibility set as local and global"
-msgstr "типову видимість визначено як локальну і загальну"
-
-#: src/nm.c:66 src/strip.c:67
+#: src/nm.c:67 src/strip.c:70
msgid "Output selection:"
msgstr "Вибір виводу:"
-#: src/nm.c:67
+#: src/nm.c:68
msgid "Display debugger-only symbols"
msgstr "Показувати лише діагностичні символи"
-#: src/nm.c:68
+#: src/nm.c:69
msgid "Display only defined symbols"
msgstr "Показувати лише визначені символи"
-#: src/nm.c:71
+#: src/nm.c:72
msgid "Display dynamic symbols instead of normal symbols"
msgstr "Показувати динамічні символи замість звичайних символів"
-#: src/nm.c:72
+#: src/nm.c:73
msgid "Display only external symbols"
msgstr "Показувати лише зовнішні символи"
-#: src/nm.c:73
+#: src/nm.c:74
msgid "Display only undefined symbols"
msgstr "Показувати лише невизначені символи"
-#: src/nm.c:75
+#: src/nm.c:76
msgid "Include index for symbols from archive members"
msgstr "Включити покажчик для символів з елементів архіву"
-#: src/nm.c:77 src/size.c:57
+#: src/nm.c:78 src/size.c:55
msgid "Output format:"
msgstr "Формат виводу:"
-#: src/nm.c:79
+#: src/nm.c:80
msgid "Print name of the input file before every symbol"
msgstr "Виводити перед кожним символом назву вхідного файла"
-#: src/nm.c:82
+#: src/nm.c:83
msgid ""
"Use the output format FORMAT. FORMAT can be `bsd', `sysv' or `posix'. The "
"default is `sysv'"
@@ -4207,71 +3633,73 @@
"Використовувати формат виводу ФОРМАТ. ФОРМАТом може бути «bsd», «sysv» або "
"«posix». Типовим форматом є «sysv»"
-#: src/nm.c:84
+#: src/nm.c:85
msgid "Same as --format=bsd"
msgstr "Те саме, що і --format=bsd"
-#: src/nm.c:85
+#: src/nm.c:86
msgid "Same as --format=posix"
msgstr "Те саме, що і --format=posix"
-#: src/nm.c:86 src/size.c:63
+#: src/nm.c:87 src/size.c:61
msgid "Use RADIX for printing symbol values"
msgstr "Використовувати ОСНОВУ числення для виводу символьних значень"
-#: src/nm.c:87
+#: src/nm.c:88
msgid "Mark special symbols"
msgstr "Позначати спеціальні символи"
-#: src/nm.c:89
+#: src/nm.c:90
msgid "Print size of defined symbols"
msgstr "Вивести розмір визначених символів"
-#: src/nm.c:91 src/size.c:71 src/strip.c:72 src/unstrip.c:72
+#: src/nm.c:92 src/size.c:69 src/strip.c:75 src/unstrip.c:73
msgid "Output options:"
msgstr "Параметри виводу:"
-#: src/nm.c:92
+#: src/nm.c:93
msgid "Sort symbols numerically by address"
msgstr "Числове впорядкування символів за адресою"
-#: src/nm.c:94
+#: src/nm.c:95
msgid "Do not sort the symbols"
msgstr "Не впорядковувати символи"
-#: src/nm.c:95
+#: src/nm.c:96
msgid "Reverse the sense of the sort"
msgstr "Змінити порядок на протилежний"
-#: src/nm.c:98
+#: src/nm.c:99
msgid "Decode low-level symbol names into source code names"
msgstr "Визначати за низькорівневими назвами символів назви у початковому коді"
-#: src/nm.c:105
+#. Short description of program.
+#: src/nm.c:106
msgid "List symbols from FILEs (a.out by default)."
msgstr "Показати список символів з ФАЙЛів (типово з a.out)."
-#: src/nm.c:116 src/objdump.c:79
+#: src/nm.c:117 src/objdump.c:80
msgid "Output formatting"
msgstr "Форматування виводу"
-#: src/nm.c:140 src/objdump.c:103 src/size.c:108 src/strip.c:127
+#: src/nm.c:141 src/objdump.c:104 src/size.c:106 src/strip.c:131
#, c-format
msgid "%s: INTERNAL ERROR %d (%s): %s"
msgstr "%s: ВНУТРІШНЯ ПОМИЛКА %d (%s): %s"
-#: src/nm.c:395 src/nm.c:407 src/size.c:305 src/size.c:314 src/size.c:325
-#: src/strip.c:2280
+#: src/nm.c:382 src/nm.c:394 src/size.c:289 src/size.c:298 src/size.c:309
+#: src/strip.c:2421
#, c-format
msgid "while closing '%s'"
msgstr "під час закриття «%s»"
-#: src/nm.c:417 src/objdump.c:292 src/strip.c:391
+#: src/nm.c:404 src/objdump.c:281 src/strip.c:443
#, c-format
msgid "%s: File format not recognized"
msgstr "%s: не вдалося розпізнати формат файла"
-#: src/nm.c:457
+#. Note: 0 is no valid offset.
+#: src/nm.c:444
msgid ""
"\n"
"Archive index:\n"
@@ -4279,42 +3707,44 @@
"\n"
"Покажчик архіву:\n"
-#: src/nm.c:466
+#: src/nm.c:453
#, c-format
msgid "invalid offset %zu for symbol %s"
msgstr "некоректне зміщення %zu для символу %s"
-#: src/nm.c:471
+#: src/nm.c:458
#, c-format
msgid "%s in %s\n"
msgstr "%s у %s\n"
-#: src/nm.c:479
+#: src/nm.c:466
#, c-format
msgid "cannot reset archive offset to beginning"
msgstr "не вдалося відновити зміщення початку архіву"
-#: src/nm.c:504 src/objdump.c:340
+#: src/nm.c:491 src/objdump.c:329
#, c-format
msgid "%s%s%s: file format not recognized"
msgstr "%s%s%s: не вдалося розпізнати формат файла"
-#: src/nm.c:719
+#: src/nm.c:706
#, c-format
msgid "cannot create search tree"
msgstr "не вдалося створити дерево пошуку"
-#: src/nm.c:760 src/nm.c:1221 src/objdump.c:789 src/readelf.c:545
-#: src/readelf.c:1123 src/readelf.c:1323 src/readelf.c:1471 src/readelf.c:1667
-#: src/readelf.c:1873 src/readelf.c:2063 src/readelf.c:2300 src/readelf.c:2558
-#: src/readelf.c:2634 src/readelf.c:2721 src/readelf.c:3301 src/readelf.c:3347
-#: src/readelf.c:3410 src/readelf.c:8320 src/readelf.c:9420 src/readelf.c:9603
-#: src/readelf.c:9671 src/size.c:413 src/size.c:482 src/strip.c:520
+#: src/nm.c:747 src/nm.c:1208 src/objdump.c:778 src/readelf.c:606
+#: src/readelf.c:1196 src/readelf.c:1396 src/readelf.c:1544 src/readelf.c:1745
+#: src/readelf.c:1951 src/readelf.c:2141 src/readelf.c:2319 src/readelf.c:2395
+#: src/readelf.c:2653 src/readelf.c:2729 src/readelf.c:2816 src/readelf.c:3414
+#: src/readelf.c:3464 src/readelf.c:3527 src/readelf.c:11028
+#: src/readelf.c:12200 src/readelf.c:12403 src/readelf.c:12471 src/size.c:397
+#: src/size.c:466 src/strip.c:572
#, c-format
msgid "cannot get section header string table index"
msgstr "не вдалося визначити індекс заголовка розділу у таблиці рядків"
-#: src/nm.c:787
+#. We always print this prolog.
+#: src/nm.c:774
#, c-format
msgid ""
"\n"
@@ -4327,7 +3757,8 @@
"Символи з %s:\n"
"\n"
-#: src/nm.c:790
+#. The header line.
+#: src/nm.c:777
#, c-format
msgid ""
"%*s%-*s %-*s Class Type %-*s %*s Section\n"
@@ -4336,72 +3767,79 @@
"%*s%-*s %-*s Клас Тип %-*s %*s Розділ\n"
"\n"
-#: src/nm.c:1232
+#: src/nm.c:1219
#, c-format
msgid "%s: entry size in section %zd `%s' is not what we expect"
msgstr "%s: розмір запису у розділі %zd «%s» не є очікуваним"
-#: src/nm.c:1237
+#: src/nm.c:1224
#, c-format
msgid "%s: size of section %zd `%s' is not multiple of entry size"
msgstr "%s: розмір розділу %zd «%s» не є кратним до розміру запису"
-#: src/nm.c:1537
+#: src/nm.c:1303
+#, fuzzy, c-format
+msgid "%s: entries (%zd) in section %zd `%s' is too large"
+msgstr "%s: розмір запису у розділі %zd «%s» не є очікуваним"
+
+#. XXX Add machine specific object file types.
+#: src/nm.c:1529
#, c-format
msgid "%s%s%s%s: Invalid operation"
msgstr "%s%s%s%s: некоректна дія"
-#: src/nm.c:1594
+#: src/nm.c:1586
#, c-format
msgid "%s%s%s: no symbols"
msgstr "%s%s%s: немає символів"
-#: src/objdump.c:52
+#: src/objdump.c:53
msgid "Mode selection:"
msgstr "Вибір режиму:"
-#: src/objdump.c:53
+#: src/objdump.c:54
msgid "Display relocation information."
msgstr "Показати інформацію про пересування."
-#: src/objdump.c:55
+#: src/objdump.c:56
msgid "Display the full contents of all sections requested"
msgstr "Показати весь вміст всіх вказаних розділів"
-#: src/objdump.c:57
+#: src/objdump.c:58
msgid "Display assembler code of executable sections"
msgstr "Показати код асемблера виконуваних розділів"
-#: src/objdump.c:59
+#: src/objdump.c:60
msgid "Output content selection:"
msgstr "Вибір виведених даних:"
-#: src/objdump.c:61
+#: src/objdump.c:62
msgid "Only display information for section NAME."
msgstr "Показати інформацію лише з розділу НАЗВА."
-#: src/objdump.c:67
+#. Short description of program.
+#: src/objdump.c:68
msgid "Show information from FILEs (a.out by default)."
msgstr "Показати інформацію з ФАЙЛів (типово a.out)."
-#: src/objdump.c:232 src/readelf.c:479
+#: src/objdump.c:219 src/readelf.c:551
msgid "No operation specified.\n"
msgstr "Не вказано дії.\n"
-#: src/objdump.c:270 src/objdump.c:282
+#: src/objdump.c:259 src/objdump.c:271
#, c-format
msgid "while close `%s'"
msgstr "під час закриття «%s»"
-#: src/objdump.c:375 src/readelf.c:1968 src/readelf.c:2160
+#: src/objdump.c:364 src/readelf.c:2046 src/readelf.c:2238
msgid "INVALID SYMBOL"
msgstr "НЕКОРЕКТНИЙ СИМВОЛ"
-#: src/objdump.c:390 src/readelf.c:2002 src/readelf.c:2196
+#: src/objdump.c:379 src/readelf.c:2080 src/readelf.c:2274
msgid "INVALID SECTION"
msgstr "НЕКОРЕКТНИЙ РОЗДІЛ"
-#: src/objdump.c:510
+#: src/objdump.c:499
#, c-format
msgid ""
"\n"
@@ -4412,287 +3850,318 @@
"ЗАПИСИ ПЕРЕМІЩЕННЯ ДЛЯ [%s]:\n"
"%-*s ТИП ЗНАЧЕННЯ\n"
-#: src/objdump.c:513
+#: src/objdump.c:502
msgid "OFFSET"
msgstr "ЗМІЩЕННЯ"
-#: src/objdump.c:578
+#: src/objdump.c:567
#, c-format
msgid "Contents of section %s:\n"
msgstr "Вміст розділу %s:\n"
-#: src/objdump.c:699
+#: src/objdump.c:688
#, c-format
msgid "cannot disassemble"
msgstr "не вдалося дизасемблювати"
-#: src/ranlib.c:65
+#. Short description of program.
+#: src/ranlib.c:64
msgid "Generate an index to speed access to archives."
msgstr "Створювати покажчик для пришвидшення доступу до архівів."
-#: src/ranlib.c:68
+#. Strings for arguments in help texts.
+#: src/ranlib.c:67
msgid "ARCHIVE"
msgstr "АРХІВ"
-#: src/ranlib.c:104
+#: src/ranlib.c:103
#, c-format
msgid "Archive name required"
msgstr "Слід вказати назву архіву"
-#: src/ranlib.c:182
+#: src/ranlib.c:167
#, c-format
msgid "'%s' is no archive"
msgstr "«%s» не є архівом"
-#: src/ranlib.c:217
+#: src/ranlib.c:202
#, c-format
msgid "error while freeing sub-ELF descriptor: %s"
msgstr "помилка під час спроби вивільнення дескриптора під-ELF: %s"
-#: src/readelf.c:72
+#: src/readelf.c:95
msgid "ELF input selection:"
msgstr "Вибір вихідних даних ELF:"
-#: src/readelf.c:74
+#: src/readelf.c:97
msgid ""
"Use the named SECTION (default .gnu_debugdata) as (compressed) ELF input data"
msgstr ""
"Використовувати вказаний за іменем РОЗДІЛ (типово .gnu_debugdata) як "
"(стиснені) вхідні дані ELF"
-#: src/readelf.c:76
+#: src/readelf.c:100
+msgid ""
+"Used with -w to find the skeleton Compile Units in FILE associated with the "
+"Split Compile units in a .dwo input file"
+msgstr ""
+
+#: src/readelf.c:102
msgid "ELF output selection:"
msgstr "Вибір виводу ELF:"
-#: src/readelf.c:78
+#: src/readelf.c:104
msgid "All these plus -p .strtab -p .dynstr -p .comment"
msgstr "Все це плюс -p .strtab -p .dynstr -p .comment"
-#: src/readelf.c:79
+#: src/readelf.c:105
msgid "Display the dynamic segment"
msgstr "Показувати динамічний сегмент"
-#: src/readelf.c:80
+#: src/readelf.c:106
msgid "Display the ELF file header"
msgstr "Показувати заголовок файла ELF"
-#: src/readelf.c:82
+#: src/readelf.c:108
msgid "Display histogram of bucket list lengths"
msgstr "Показати гістограму довжин списку блоків"
-#: src/readelf.c:83
+#: src/readelf.c:109
msgid "Display the program headers"
msgstr "Показувати заголовки програми"
-#: src/readelf.c:85
+#: src/readelf.c:111
msgid "Display relocations"
msgstr "Показувати пересування"
-#: src/readelf.c:86
+#: src/readelf.c:112
+#, fuzzy
+msgid "Display the section groups"
+msgstr "Показувати заголовки розділів"
+
+#: src/readelf.c:113
msgid "Display the sections' headers"
msgstr "Показувати заголовки розділів"
-#: src/readelf.c:88
-msgid "Display the symbol table"
+#: src/readelf.c:116
+#, fuzzy
+msgid "Display the symbol table sections"
msgstr "Показувати таблицю символів"
-#: src/readelf.c:89
+#: src/readelf.c:117
msgid "Display versioning information"
msgstr "Показувати відомості щодо версії"
-#: src/readelf.c:90
+#: src/readelf.c:118
msgid "Display the ELF notes"
msgstr "Показувати нотатки ELF"
-#: src/readelf.c:92
+#: src/readelf.c:120
msgid "Display architecture specific information, if any"
msgstr "Показувати специфічні для архітектури дані, якщо такі буде виявлено"
-#: src/readelf.c:94
+#: src/readelf.c:122
msgid "Display sections for exception handling"
msgstr "Показувати розділи для обробки виключень"
-#: src/readelf.c:96
+#: src/readelf.c:124
msgid "Additional output selection:"
msgstr "Додатковий вибір виводу:"
-#: src/readelf.c:98
+#: src/readelf.c:126
+#, fuzzy
msgid ""
-"Display DWARF section content. SECTION can be one of abbrev, aranges, "
-"decodedaranges, frame, gdb_index, info, loc, line, decodedline, ranges, "
-"pubnames, str, macinfo, macro or exception"
+"Display DWARF section content. SECTION can be one of abbrev, addr, aranges, "
+"decodedaranges, frame, gdb_index, info, info+, loc, line, decodedline, "
+"ranges, pubnames, str, macinfo, macro or exception"
msgstr ""
"Показати вміст розділу DWARF. Значенням РОЗДІЛ може бути abbrev, aranges, "
"decodedaranges, frame, gdb_index, info, loc, line, decodedline, ranges, "
"pubnames, str, macinfo, macro або exception"
-#: src/readelf.c:102
+#: src/readelf.c:130
msgid "Dump the uninterpreted contents of SECTION, by number or name"
msgstr ""
"Створити дамп даних РОЗДІЛ, які не вдалося інтерпретувати, за номером або "
"назвами"
-#: src/readelf.c:104
+#: src/readelf.c:132
msgid "Print string contents of sections"
msgstr "Виводити вміст рядків розділів"
-#: src/readelf.c:107
+#: src/readelf.c:135
msgid "Display the symbol index of an archive"
msgstr "Показувати покажчик символів архіву"
-#: src/readelf.c:109
+#: src/readelf.c:137
msgid "Output control:"
msgstr "Керування виводом:"
-#: src/readelf.c:111
+#: src/readelf.c:139
msgid "Do not find symbol names for addresses in DWARF data"
msgstr "Не шукати назви символів для адрес у даних DWARF"
-#: src/readelf.c:113
+#: src/readelf.c:141
msgid ""
"Display just offsets instead of resolving values to addresses in DWARF data"
msgstr "Показати лише зміщення, а не визначені значення адреси у даних DWARF"
-#: src/readelf.c:115
+#: src/readelf.c:143
msgid "Ignored for compatibility (lines always wide)"
msgstr "Ігнорується з міркувань сумісності (рядки завжди широкі)"
-#: src/readelf.c:117
+#: src/readelf.c:145
msgid ""
"Show compression information for compressed sections (when used with -S); "
"decompress section before dumping data (when used with -p or -x)"
msgstr ""
-#: src/readelf.c:122
+#. Short description of program.
+#: src/readelf.c:150
msgid "Print information from ELF file in human-readable form."
msgstr "Виводити відомості з файла ELF у придатному для читання форматі."
-#: src/readelf.c:447
+#. Look up once.
+#: src/readelf.c:329
+msgid "yes"
+msgstr "так"
+
+#: src/readelf.c:330
+msgid "no"
+msgstr "ні"
+
+#: src/readelf.c:519
#, c-format
msgid "Unknown DWARF debug section `%s'.\n"
msgstr "Невідомий діагностичний розділ DWARF «%s».\n"
-#: src/readelf.c:529 src/readelf.c:640
+#: src/readelf.c:590 src/readelf.c:701
#, c-format
msgid "cannot generate Elf descriptor: %s"
msgstr "не вдалося створити дескриптор Elf: %s"
-#: src/readelf.c:554 src/readelf.c:1145 src/readelf.c:1347
+#: src/readelf.c:597 src/readelf.c:925 src/strip.c:641
+#, c-format
+msgid "cannot determine number of sections: %s"
+msgstr "не вдалося визначити кількість розділів: %s"
+
+#: src/readelf.c:615 src/readelf.c:1218 src/readelf.c:1420
#, c-format
msgid "cannot get section: %s"
msgstr "не вдалося отримати розділ: %s"
-#: src/readelf.c:563 src/readelf.c:1152 src/readelf.c:1355 src/readelf.c:9623
-#: src/unstrip.c:387 src/unstrip.c:418 src/unstrip.c:467 src/unstrip.c:577
-#: src/unstrip.c:594 src/unstrip.c:631 src/unstrip.c:829 src/unstrip.c:1118
-#: src/unstrip.c:1309 src/unstrip.c:1369 src/unstrip.c:1490 src/unstrip.c:1543
-#: src/unstrip.c:1658 src/unstrip.c:1796 src/unstrip.c:1891
+#: src/readelf.c:624 src/readelf.c:1225 src/readelf.c:1428 src/readelf.c:12423
+#: src/unstrip.c:375 src/unstrip.c:406 src/unstrip.c:455 src/unstrip.c:565
+#: src/unstrip.c:582 src/unstrip.c:619 src/unstrip.c:817 src/unstrip.c:1109
+#: src/unstrip.c:1301 src/unstrip.c:1362 src/unstrip.c:1535 src/unstrip.c:1650
+#: src/unstrip.c:1790 src/unstrip.c:1885
#, c-format
msgid "cannot get section header: %s"
msgstr "не вдалося отримати заголовок розділу: %s"
-#: src/readelf.c:571
+#: src/readelf.c:632
#, c-format
msgid "cannot get section name"
msgstr "не вдалося отримати назву розділу"
-#: src/readelf.c:580 src/readelf.c:5504 src/readelf.c:7778 src/readelf.c:7880
-#: src/readelf.c:8057
+#: src/readelf.c:641 src/readelf.c:6517 src/readelf.c:10301 src/readelf.c:10403
+#: src/readelf.c:10580
#, c-format
msgid "cannot get %s content: %s"
msgstr "не вдалося отримати дані %s: %s"
-#: src/readelf.c:596
+#: src/readelf.c:657
#, c-format
msgid "cannot create temp file '%s'"
msgstr "не вдалося створити файл тимчасових даних «%s»"
-#: src/readelf.c:605
+#: src/readelf.c:666
#, c-format
msgid "cannot write section data"
msgstr "не вдалося записати дані розділу"
-#: src/readelf.c:611 src/readelf.c:628 src/readelf.c:657
+#: src/readelf.c:672 src/readelf.c:689 src/readelf.c:718
#, c-format
msgid "error while closing Elf descriptor: %s"
msgstr "помилка під час спроби закриття дескриптора Elf: %s"
-#: src/readelf.c:618
+#: src/readelf.c:679
#, c-format
msgid "error while rewinding file descriptor"
msgstr "помилка під час повернення до початкового значення дескриптора файла"
-#: src/readelf.c:652
+#: src/readelf.c:713
#, c-format
msgid "'%s' is not an archive, cannot print archive index"
msgstr "«%s» не є архівом, виведення покажчика архіву неможливе"
-#: src/readelf.c:751
-#, c-format
-msgid "No such section '%s' in '%s'"
-msgstr "У «%2$s» немає розділу «%1$s»"
-
-#: src/readelf.c:778
+#: src/readelf.c:817
#, c-format
msgid "cannot stat input file"
msgstr "не вдалося отримати дані з вхідного файла за допомогою stat"
-#: src/readelf.c:780
+#: src/readelf.c:819
#, c-format
msgid "input file is empty"
msgstr "вхідний файл є порожнім"
-#: src/readelf.c:782
+#: src/readelf.c:821
#, c-format
msgid "failed reading '%s': %s"
msgstr "не вдалося прочитати «%s»: %s"
-#: src/readelf.c:837
+#: src/readelf.c:850
+#, c-format
+msgid "No such section '%s' in '%s'"
+msgstr "У «%2$s» немає розділу «%1$s»"
+
+#: src/readelf.c:910
#, c-format
msgid "cannot read ELF header: %s"
msgstr "не вдалося прочитати заголовок ELF: %s"
-#: src/readelf.c:845
+#: src/readelf.c:918
#, c-format
msgid "cannot create EBL handle"
msgstr "не вдалося створити дескриптор EBL"
-#: src/readelf.c:858
+#: src/readelf.c:931
#, c-format
msgid "cannot determine number of program headers: %s"
msgstr "не вдалося визначити кількість заголовків програми: %s"
-#: src/readelf.c:948
+#: src/readelf.c:1021
msgid "NONE (None)"
msgstr "NONE (Немає)"
-#: src/readelf.c:949
+#: src/readelf.c:1022
msgid "REL (Relocatable file)"
msgstr "REL (Придатний до пересування файл)"
-#: src/readelf.c:950
+#: src/readelf.c:1023
msgid "EXEC (Executable file)"
msgstr "EXEC (Виконуваний файл)"
-#: src/readelf.c:951
+#: src/readelf.c:1024
msgid "DYN (Shared object file)"
msgstr "DYN (Файл об’єктів спільного використання)"
-#: src/readelf.c:952
+#: src/readelf.c:1025
msgid "CORE (Core file)"
msgstr "CORE (Файл ядра)"
-#: src/readelf.c:957
+#: src/readelf.c:1030
#, c-format
msgid "OS Specific: (%x)\n"
msgstr "ОС-специфічне: (%x)\n"
-#: src/readelf.c:959
+#. && e_type <= ET_HIPROC always true
+#: src/readelf.c:1032
#, c-format
msgid "Processor Specific: (%x)\n"
msgstr "Специфічне для процесора: (%x)\n"
-#: src/readelf.c:969
+#: src/readelf.c:1042
msgid ""
"ELF Header:\n"
" Magic: "
@@ -4700,7 +4169,7 @@
"Заголовок ELF:\n"
" Magic: "
-#: src/readelf.c:973
+#: src/readelf.c:1046
#, c-format
msgid ""
"\n"
@@ -4709,117 +4178,118 @@
"\n"
" Клас: %s\n"
-#: src/readelf.c:978
+#: src/readelf.c:1051
#, c-format
msgid " Data: %s\n"
msgstr " Дані: %s\n"
-#: src/readelf.c:984
+#: src/readelf.c:1057
#, c-format
msgid " Ident Version: %hhd %s\n"
msgstr " Версія Ident: %hhd %s\n"
-#: src/readelf.c:986 src/readelf.c:1003
+#: src/readelf.c:1059 src/readelf.c:1076
msgid "(current)"
msgstr "(поточний)"
-#: src/readelf.c:990
+#: src/readelf.c:1063
#, c-format
msgid " OS/ABI: %s\n"
msgstr " ОС/ABI: %s\n"
-#: src/readelf.c:993
+#: src/readelf.c:1066
#, c-format
msgid " ABI Version: %hhd\n"
msgstr " Версія ABI: %hhd\n"
-#: src/readelf.c:996
+#: src/readelf.c:1069
msgid " Type: "
msgstr " Тип: "
-#: src/readelf.c:999
+#: src/readelf.c:1072
#, c-format
msgid " Machine: %s\n"
msgstr " Архітектура: %s\n"
-#: src/readelf.c:1001
+#: src/readelf.c:1074
#, c-format
msgid " Version: %d %s\n"
msgstr " Версія: %d %s\n"
-#: src/readelf.c:1005
+#: src/readelf.c:1078
#, c-format
msgid " Entry point address: %#<PRIx64>\n"
msgstr " Адреса вхідної точки: %#<PRIx64>\n"
-#: src/readelf.c:1008
+#: src/readelf.c:1081
#, c-format
msgid " Start of program headers: %<PRId64> %s\n"
msgstr " Початок заголовків програм: %<PRId64> %s\n"
-#: src/readelf.c:1009 src/readelf.c:1012
+#: src/readelf.c:1082 src/readelf.c:1085
msgid "(bytes into file)"
msgstr "(байтів у файл)"
-#: src/readelf.c:1011
+#: src/readelf.c:1084
#, c-format
msgid " Start of section headers: %<PRId64> %s\n"
msgstr " Початок заголовків розділів: %<PRId64> %s\n"
-#: src/readelf.c:1014
+#: src/readelf.c:1087
#, c-format
msgid " Flags: %s\n"
msgstr " Прапорці: %s\n"
-#: src/readelf.c:1017
+#: src/readelf.c:1090
#, c-format
msgid " Size of this header: %<PRId16> %s\n"
msgstr " Розмір цього заголовка: %<PRId16> %s\n"
-#: src/readelf.c:1018 src/readelf.c:1021 src/readelf.c:1038
+#: src/readelf.c:1091 src/readelf.c:1094 src/readelf.c:1111
msgid "(bytes)"
msgstr "(байтів)"
-#: src/readelf.c:1020
+#: src/readelf.c:1093
#, c-format
msgid " Size of program header entries: %<PRId16> %s\n"
msgstr " Розмір записів заголовка програми: %<PRId16> %s\n"
-#: src/readelf.c:1023
+#: src/readelf.c:1096
#, c-format
msgid " Number of program headers entries: %<PRId16>"
msgstr " Кількість записів заголовків програми: %<PRId16>"
-#: src/readelf.c:1030
+#: src/readelf.c:1103
#, c-format
msgid " (%<PRIu32> in [0].sh_info)"
msgstr " (%<PRIu32> у [0].sh_info)"
-#: src/readelf.c:1033 src/readelf.c:1050 src/readelf.c:1064
+#: src/readelf.c:1106 src/readelf.c:1123 src/readelf.c:1137
msgid " ([0] not available)"
msgstr " ([0] недоступний)"
-#: src/readelf.c:1037
+#: src/readelf.c:1110
#, c-format
msgid " Size of section header entries: %<PRId16> %s\n"
msgstr " Розмір записів заголовків розділів: %<PRId16> %s\n"
-#: src/readelf.c:1040
+#: src/readelf.c:1113
#, c-format
msgid " Number of section headers entries: %<PRId16>"
msgstr " Кількість записів заголовків розділів: %<PRId16>"
-#: src/readelf.c:1047
+#: src/readelf.c:1120
#, c-format
msgid " (%<PRIu32> in [0].sh_size)"
msgstr " (%<PRIu32> у [0].sh_size)"
-#: src/readelf.c:1060
+#. We managed to get the zeroth section.
+#: src/readelf.c:1133
#, c-format
msgid " (%<PRIu32> in [0].sh_link)"
msgstr " (%<PRIu32> у [0].sh_link)"
-#: src/readelf.c:1068
+#: src/readelf.c:1141
#, c-format
msgid ""
" Section header string table index: XINDEX%s\n"
@@ -4828,7 +4298,7 @@
" Індекс заголовка розділу у таблиці рядків: XINDEX%s\n"
"\n"
-#: src/readelf.c:1072
+#: src/readelf.c:1145
#, c-format
msgid ""
" Section header string table index: %<PRId16>\n"
@@ -4837,7 +4307,7 @@
" Індекс заголовка розділу у таблиці рядків: %<PRId16>\n"
"\n"
-#: src/readelf.c:1115
+#: src/readelf.c:1188
#, c-format
msgid ""
"There are %d section headers, starting at offset %#<PRIx64>:\n"
@@ -4846,11 +4316,11 @@
"Виявлено %d заголовків розділів, зміщення початку — %#<PRIx64>:\n"
"\n"
-#: src/readelf.c:1125
+#: src/readelf.c:1198
msgid "Section Headers:"
msgstr "Заголовки розділів:"
-#: src/readelf.c:1128
+#: src/readelf.c:1201
msgid ""
"[Nr] Name Type Addr Off Size ES Flags Lk "
"Inf Al"
@@ -4858,7 +4328,7 @@
"[№ ] Назва Тип Адр Змі Розмір ES Прап Lk "
"Інф Al"
-#: src/readelf.c:1130
+#: src/readelf.c:1203
msgid ""
"[Nr] Name Type Addr Off Size ES "
"Flags Lk Inf Al"
@@ -4866,35 +4336,35 @@
"[№ ] Назва Тип Адр Змі Розмір ES "
"Прап Lk Інф Al"
-#: src/readelf.c:1135
+#: src/readelf.c:1208
msgid " [Compression Size Al]"
msgstr ""
-#: src/readelf.c:1137
+#: src/readelf.c:1210
msgid " [Compression Size Al]"
msgstr ""
-#: src/readelf.c:1213
+#: src/readelf.c:1286
#, fuzzy, c-format
msgid "bad compression header for section %zd: %s"
msgstr "не вдалося отримати заголовок розділу %zu: %s"
-#: src/readelf.c:1224
+#: src/readelf.c:1297
#, fuzzy, c-format
msgid "bad gnu compressed size for section %zd: %s"
msgstr "не вдалося отримати дані для розділу %d: %s"
-#: src/readelf.c:1242
+#: src/readelf.c:1315
msgid "Program Headers:"
msgstr "Заголовки програми:"
-#: src/readelf.c:1244
+#: src/readelf.c:1317
msgid ""
" Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align"
msgstr ""
" Тип Зміщен ВіртАдр ФізАдр РозмФайл РозмПам Пра Вирів"
-#: src/readelf.c:1247
+#: src/readelf.c:1320
msgid ""
" Type Offset VirtAddr PhysAddr FileSiz "
"MemSiz Flg Align"
@@ -4902,12 +4372,12 @@
" Тип Зміщен ВіртАдр ФізАдр "
"РозмФайлРозмПам Пра Вирів"
-#: src/readelf.c:1304
+#: src/readelf.c:1377
#, c-format
msgid "\t[Requesting program interpreter: %s]\n"
msgstr "\t[Запит щодо інтерпретатора програми: %s]\n"
-#: src/readelf.c:1325
+#: src/readelf.c:1398
msgid ""
"\n"
" Section to Segment mapping:\n"
@@ -4917,12 +4387,12 @@
" Відображення розділів на сегмент:\n"
" Розділи сегмента..."
-#: src/readelf.c:1336 src/unstrip.c:1950 src/unstrip.c:1992 src/unstrip.c:1999
+#: src/readelf.c:1409 src/unstrip.c:1944 src/unstrip.c:1986 src/unstrip.c:1993
#, c-format
msgid "cannot get program header: %s"
msgstr "не вдалося отримати заголовок програми: %s"
-#: src/readelf.c:1479
+#: src/readelf.c:1552
#, c-format
msgid ""
"\n"
@@ -4940,7 +4410,7 @@
"\n"
"Група розділів COMDAT [%2zu] «%s» з підписом «%s» містить %zu записів:\n"
-#: src/readelf.c:1484
+#: src/readelf.c:1557
#, c-format
msgid ""
"\n"
@@ -4958,25 +4428,31 @@
"\n"
"Група розділів [%2zu] «%s» з підписом «%s» містить %zu записів:\n"
-#: src/readelf.c:1492
+#: src/readelf.c:1565
msgid "<INVALID SYMBOL>"
msgstr "<НЕКОРЕКТНИЙ СИМВОЛ>"
-#: src/readelf.c:1506
+#: src/readelf.c:1579
msgid "<INVALID SECTION>"
msgstr "<НЕКОРЕКТНИЙ РОЗДІЛ>"
-#: src/readelf.c:1529 src/readelf.c:2238 src/readelf.c:3317
+#: src/readelf.c:1602 src/readelf.c:2329 src/readelf.c:3430 src/readelf.c:12294
+#: src/readelf.c:12301 src/readelf.c:12345 src/readelf.c:12352
msgid "Couldn't uncompress section"
msgstr ""
-#: src/readelf.c:1673 src/readelf.c:2306 src/readelf.c:2564 src/readelf.c:2640
-#: src/readelf.c:2944 src/readelf.c:3018 src/readelf.c:4716
+#: src/readelf.c:1607 src/readelf.c:2334 src/readelf.c:3435
+#, fuzzy, c-format
+msgid "cannot get section [%zd] header: %s"
+msgstr "не вдалося отримати заголовок розділу: %s"
+
+#: src/readelf.c:1751 src/readelf.c:2401 src/readelf.c:2659 src/readelf.c:2735
+#: src/readelf.c:3039 src/readelf.c:3113 src/readelf.c:5308
#, c-format
msgid "invalid sh_link value in section %zu"
msgstr "некоректне значення sh_link у розділі %zu"
-#: src/readelf.c:1676
+#: src/readelf.c:1754
#, c-format
msgid ""
"\n"
@@ -4999,36 +4475,36 @@
"Динамічний сегмент містить %lu записів:\n"
" Адр: %#0*<PRIx64> Зміщення: %#08<PRIx64> Пос. на розділ: [%2u] '%s'\n"
-#: src/readelf.c:1686
+#: src/readelf.c:1764
msgid " Type Value\n"
msgstr " Тип Значення\n"
-#: src/readelf.c:1710
+#: src/readelf.c:1788
#, c-format
msgid "Shared library: [%s]\n"
msgstr "Спільна бібліотека: [%s]\n"
-#: src/readelf.c:1715
+#: src/readelf.c:1793
#, c-format
msgid "Library soname: [%s]\n"
msgstr "Назва so бібліотеки: [%s]\n"
-#: src/readelf.c:1720
+#: src/readelf.c:1798
#, c-format
msgid "Library rpath: [%s]\n"
msgstr "Rpath бібліотеки: [%s]\n"
-#: src/readelf.c:1725
+#: src/readelf.c:1803
#, c-format
msgid "Library runpath: [%s]\n"
msgstr "Runpath бібліотеки: [%s]\n"
-#: src/readelf.c:1745
+#: src/readelf.c:1823
#, c-format
msgid "%<PRId64> (bytes)\n"
msgstr "%<PRId64> (байт)\n"
-#: src/readelf.c:1858 src/readelf.c:2048
+#: src/readelf.c:1936 src/readelf.c:2126
#, c-format
msgid ""
"\n"
@@ -5037,7 +4513,7 @@
"\n"
"Некоректна таблиця символів за зміщенням %#0<PRIx64>\n"
-#: src/readelf.c:1876 src/readelf.c:2066
+#: src/readelf.c:1954 src/readelf.c:2144
#, c-format
msgid ""
"\n"
@@ -5060,7 +4536,13 @@
"Розділ пересування [%2zu] «%s» для розділу [%2u] «%s» за зміщенням "
"%#0<PRIx64> містить %d записів:\n"
-#: src/readelf.c:1891 src/readelf.c:2081
+#. The .rel.dyn section does not refer to a specific section but
+#. instead of section index zero. Do not try to print a section
+#. name.
+#. The .rela.dyn section does not refer to a specific section but
+#. instead of section index zero. Do not try to print a section
+#. name.
+#: src/readelf.c:1969 src/readelf.c:2159
#, c-format
msgid ""
"\n"
@@ -5078,30 +4560,30 @@
"\n"
"Розділ пересування [%2u] «%s» за зміщенням %#0<PRIx64> містить %d записів:\n"
-#: src/readelf.c:1901
+#: src/readelf.c:1979
msgid " Offset Type Value Name\n"
msgstr " Зміщення Тип Значення Назва\n"
-#: src/readelf.c:1903
+#: src/readelf.c:1981
msgid " Offset Type Value Name\n"
msgstr " Зміщення Тип Значення Назва\n"
-#: src/readelf.c:1956 src/readelf.c:1967 src/readelf.c:1980 src/readelf.c:2001
-#: src/readelf.c:2013 src/readelf.c:2147 src/readelf.c:2159 src/readelf.c:2173
-#: src/readelf.c:2195 src/readelf.c:2208
+#: src/readelf.c:2034 src/readelf.c:2045 src/readelf.c:2058 src/readelf.c:2079
+#: src/readelf.c:2091 src/readelf.c:2225 src/readelf.c:2237 src/readelf.c:2251
+#: src/readelf.c:2273 src/readelf.c:2286
msgid "<INVALID RELOC>"
msgstr "<НЕКОРЕКТНЕ ПЕРЕМІЩЕННЯ>"
-#: src/readelf.c:2091
+#: src/readelf.c:2169
msgid " Offset Type Value Addend Name\n"
msgstr " Зміщення Тип Значення Назва додатка\n"
-#: src/readelf.c:2093
+#: src/readelf.c:2171
msgid " Offset Type Value Addend Name\n"
msgstr ""
" Зміщення Тип Значення Назва додатка\n"
-#: src/readelf.c:2314
+#: src/readelf.c:2409
#, c-format
msgid ""
"\n"
@@ -5119,7 +4601,7 @@
"\n"
"Таблиця символів [%2u] «%s» містить %u записів:\n"
-#: src/readelf.c:2319
+#: src/readelf.c:2414
#, c-format
msgid " %lu local symbol String table: [%2u] '%s'\n"
msgid_plural " %lu local symbols String table: [%2u] '%s'\n"
@@ -5127,33 +4609,33 @@
msgstr[1] " %lu лок. символи Таблиця символів: [%2u] «%s»\n"
msgstr[2] " %lu лок. символів Таблиця символів: [%2u] «%s»\n"
-#: src/readelf.c:2327
+#: src/readelf.c:2422
msgid " Num: Value Size Type Bind Vis Ndx Name\n"
msgstr " №№ Знач. Роз. Тип Зв’яз Вид. Інд Назва\n"
-#: src/readelf.c:2329
+#: src/readelf.c:2424
msgid " Num: Value Size Type Bind Vis Ndx Name\n"
msgstr " №№ Знач. Роз. Тип Зв’яз Вид. Інд Назва\n"
-#: src/readelf.c:2349
+#: src/readelf.c:2444
#, c-format
msgid "%5u: %0*<PRIx64> %6<PRId64> %-7s %-6s %-9s %6s %s"
msgstr "%5u: %0*<PRIx64> %6<PRId64> %-7s %-6s %-9s %6s %s"
-#: src/readelf.c:2437
+#: src/readelf.c:2532
#, c-format
msgid "bad dynamic symbol"
msgstr "помилковий динамічний символ"
-#: src/readelf.c:2519
+#: src/readelf.c:2614
msgid "none"
msgstr "немає"
-#: src/readelf.c:2536
+#: src/readelf.c:2631
msgid "| <unknown>"
msgstr "| <невідомо>"
-#: src/readelf.c:2567
+#: src/readelf.c:2662
#, c-format
msgid ""
"\n"
@@ -5176,17 +4658,17 @@
"Розділ потреби у версіях [%2u] «%s», що містить %d записів:\n"
" Адр.: %#0*<PRIx64> Зміщ.: %#08<PRIx64> Посилання на розділ: [%2u] «%s»\n"
-#: src/readelf.c:2588
+#: src/readelf.c:2683
#, c-format
msgid " %#06x: Version: %hu File: %s Cnt: %hu\n"
msgstr " %#06x: Версія: %hu Файл: %s Кть: %hu\n"
-#: src/readelf.c:2601
+#: src/readelf.c:2696
#, c-format
msgid " %#06x: Name: %s Flags: %s Version: %hu\n"
msgstr " %#06x: Назва: %s Прап: %s Версія: %hu\n"
-#: src/readelf.c:2644
+#: src/readelf.c:2739
#, c-format
msgid ""
"\n"
@@ -5209,17 +4691,18 @@
"Розділ визначення версії [%2u] «%s», що містить %d записів:\n"
" Адр.: %#0*<PRIx64> Зміщ.: %#08<PRIx64> Посилання на розділ: [%2u] «%s»\n"
-#: src/readelf.c:2672
+#: src/readelf.c:2767
#, c-format
msgid " %#06x: Version: %hd Flags: %s Index: %hd Cnt: %hd Name: %s\n"
msgstr " %#06x: Версія: %hd Прап.: %s Індекс: %hd К-ть: %hd Назва: %s\n"
-#: src/readelf.c:2687
+#: src/readelf.c:2782
#, c-format
msgid " %#06x: Parent %d: %s\n"
msgstr " %#06x: батьківський %d: %s\n"
-#: src/readelf.c:2948
+#. Print the header.
+#: src/readelf.c:3043
#, c-format
msgid ""
"\n"
@@ -5242,15 +4725,15 @@
"Розділ символів версій [%2u] «%s», що містить %d записів:\n"
" Адр.: %#0*<PRIx64> Зміщ.: %#08<PRIx64> Посилання на розділ: [%2u] «%s»"
-#: src/readelf.c:2976
+#: src/readelf.c:3071
msgid " 0 *local* "
msgstr " 0 *локальний* "
-#: src/readelf.c:2981
+#: src/readelf.c:3076
msgid " 1 *global* "
msgstr " 1 *загальний* "
-#: src/readelf.c:3023
+#: src/readelf.c:3118
#, c-format
msgid ""
"\n"
@@ -5278,22 +4761,22 @@
"блоками):\n"
" Адр.: %#0*<PRIx64> Зміщ.: %#08<PRIx64> Посилання на розділ: [%2u] «%s»\n"
-#: src/readelf.c:3045
+#: src/readelf.c:3140
#, no-c-format
msgid " Length Number % of total Coverage\n"
msgstr " Довжина Номер % від загал. Покриття\n"
-#: src/readelf.c:3047
+#: src/readelf.c:3142
#, c-format
msgid " 0 %6<PRIu32> %5.1f%%\n"
msgstr " 0 %6<PRIu32> %5.1f%%\n"
-#: src/readelf.c:3054
+#: src/readelf.c:3149
#, c-format
msgid "%7d %6<PRIu32> %5.1f%% %5.1f%%\n"
msgstr "%7d %6<PRIu32> %5.1f%% %5.1f%%\n"
-#: src/readelf.c:3067
+#: src/readelf.c:3162
#, c-format
msgid ""
" Average number of tests: successful lookup: %f\n"
@@ -5302,27 +4785,37 @@
" Середня кількість тестів: успішний пошук: %f\n"
"\t\t\t неуспішний пошук: %f\n"
-#: src/readelf.c:3085 src/readelf.c:3140 src/readelf.c:3197
+#: src/readelf.c:3180 src/readelf.c:3244 src/readelf.c:3310
#, c-format
msgid "cannot get data for section %d: %s"
msgstr "не вдалося отримати дані для розділу %d: %s"
-#: src/readelf.c:3093
+#: src/readelf.c:3188
#, c-format
msgid "invalid data in sysv.hash section %d"
msgstr "некоректні дані у розділі sysv.hash %d"
-#: src/readelf.c:3148
+#: src/readelf.c:3217
+#, fuzzy, c-format
+msgid "invalid chain in sysv.hash section %d"
+msgstr "некоректні дані у розділі sysv.hash %d"
+
+#: src/readelf.c:3252
#, c-format
msgid "invalid data in sysv.hash64 section %d"
msgstr "некоректні дані у розділі sysv.hash64 %d"
-#: src/readelf.c:3206
+#: src/readelf.c:3283
+#, fuzzy, c-format
+msgid "invalid chain in sysv.hash64 section %d"
+msgstr "некоректні дані у розділі sysv.hash64 %d"
+
+#: src/readelf.c:3319
#, c-format
msgid "invalid data in gnu.hash section %d"
msgstr "некоректні дані у розділі gnu.hash %d"
-#: src/readelf.c:3273
+#: src/readelf.c:3386
#, c-format
msgid ""
" Symbol Bias: %u\n"
@@ -5332,7 +4825,7 @@
" Розмір бітової маски: %zu байтів %<PRIuFAST32>%% встановлених бітів зсув "
"2-го хешу: %u\n"
-#: src/readelf.c:3358
+#: src/readelf.c:3475
#, c-format
msgid ""
"\n"
@@ -5353,7 +4846,7 @@
"Розділ списку бібліотек [%2zu] «%s» за зміщенням %#0<PRIx64> містить %d "
"записів:\n"
-#: src/readelf.c:3372
+#: src/readelf.c:3489
msgid ""
" Library Time Stamp Checksum Version "
"Flags"
@@ -5361,7 +4854,7 @@
" Бібліотека Часовий штамп Версія суми "
"Прапорці"
-#: src/readelf.c:3422
+#: src/readelf.c:3539
#, c-format
msgid ""
"\n"
@@ -5372,140 +4865,102 @@
"Розділ атрибутів об’єктів [%2zu] «%s» з %<PRIu64> байтів за зміщенням "
"%#0<PRIx64>:\n"
-#: src/readelf.c:3439
+#: src/readelf.c:3556
msgid " Owner Size\n"
msgstr " Власник Розмір\n"
-#: src/readelf.c:3468
+#: src/readelf.c:3585
#, c-format
msgid " %-13s %4<PRIu32>\n"
msgstr " %-13s %4<PRIu32>\n"
-#: src/readelf.c:3507
+#. Unknown subsection, print and skip.
+#: src/readelf.c:3624
#, c-format
msgid " %-4u %12<PRIu32>\n"
msgstr " %-4u %12<PRIu32>\n"
-#: src/readelf.c:3512
+#. Tag_File
+#: src/readelf.c:3629
#, c-format
msgid " File: %11<PRIu32>\n"
msgstr " Файл: %11<PRIu32>\n"
-#: src/readelf.c:3561
+#: src/readelf.c:3678
#, c-format
msgid " %s: %<PRId64>, %s\n"
msgstr " %s: %<PRId64>, %s\n"
-#: src/readelf.c:3564
+#: src/readelf.c:3681
#, c-format
msgid " %s: %<PRId64>\n"
msgstr " %s: %<PRId64>\n"
-#: src/readelf.c:3567
+#: src/readelf.c:3684
#, c-format
msgid " %s: %s\n"
msgstr " %s: %s\n"
-#: src/readelf.c:3577
+#: src/readelf.c:3694
#, c-format
msgid " %u: %<PRId64>\n"
msgstr " %u: %<PRId64>\n"
-#: src/readelf.c:3580
+#: src/readelf.c:3697
#, c-format
msgid " %u: %s\n"
msgstr " %u: %s\n"
-#: src/readelf.c:3625
-#, c-format
-msgid "%s+%#<PRIx64> <%s+%#<PRIx64>>"
-msgstr "%s+%#<PRIx64> <%s+%#<PRIx64>>"
+#: src/readelf.c:3767
+#, fuzzy, c-format
+msgid "sprintf failure"
+msgstr "помилка mprotect"
-#: src/readelf.c:3628
-#, c-format
-msgid "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
-msgstr "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
-
-#: src/readelf.c:3633
-#, c-format
-msgid "%#<PRIx64> <%s+%#<PRIx64>>"
-msgstr "%#<PRIx64> <%s+%#<PRIx64>>"
-
-#: src/readelf.c:3636
-#, c-format
-msgid "%#0*<PRIx64> <%s+%#<PRIx64>>"
-msgstr "%#0*<PRIx64> <%s+%#<PRIx64>>"
-
-#: src/readelf.c:3642
-#, c-format
-msgid "%s+%#<PRIx64> <%s>"
-msgstr "%s+%#<PRIx64> <%s>"
-
-#: src/readelf.c:3645
-#, c-format
-msgid "%s+%#0*<PRIx64> <%s>"
-msgstr "%s+%#0*<PRIx64> <%s>"
-
-#: src/readelf.c:3649
-#, c-format
-msgid "%#<PRIx64> <%s>"
-msgstr "%#<PRIx64> <%s>"
-
-#: src/readelf.c:3652
-#, c-format
-msgid "%#0*<PRIx64> <%s>"
-msgstr "%#0*<PRIx64> <%s>"
-
-#: src/readelf.c:3657
-#, c-format
-msgid "%s+%#<PRIx64>"
-msgstr "%s+%#<PRIx64>"
-
-#: src/readelf.c:3660
-#, c-format
-msgid "%s+%#0*<PRIx64>"
-msgstr "%s+%#0*<PRIx64>"
-
-#: src/readelf.c:4038
+#: src/readelf.c:4249
msgid "empty block"
msgstr "порожній блок"
-#: src/readelf.c:4041
+#: src/readelf.c:4252
#, c-format
msgid "%zu byte block:"
msgstr "%zu-байтовий блок:"
-#: src/readelf.c:4438
-#, c-format
-msgid "%*s[%4<PRIuMAX>] %s <TRUNCATED>\n"
+#: src/readelf.c:4730
+#, fuzzy, c-format
+msgid "%*s[%2<PRIuMAX>] %s <TRUNCATED>\n"
msgstr "%*s[%4<PRIuMAX>] %s <ОБРІЗАНО>\n"
-#: src/readelf.c:4495
+#: src/readelf.c:4794
#, c-format
msgid "%s %#<PRIx64> used with different address sizes"
msgstr "%s %#<PRIx64> використано з різними розмірами адрес"
-#: src/readelf.c:4502
+#: src/readelf.c:4801
#, c-format
msgid "%s %#<PRIx64> used with different offset sizes"
msgstr "%s %#<PRIx64> використано з різними розмірами зміщень"
-#: src/readelf.c:4509
+#: src/readelf.c:4808
#, c-format
msgid "%s %#<PRIx64> used with different base addresses"
msgstr "%s %#<PRIx64> використано з різними базовими адресами"
-#: src/readelf.c:4598
+#: src/readelf.c:4815
+#, fuzzy, c-format
+msgid "%s %#<PRIx64> used with different attribute %s and %s"
+msgstr "%s %#<PRIx64> використано з різними розмірами адрес"
+
+#: src/readelf.c:4912
#, c-format
msgid " [%6tx] <UNUSED GARBAGE IN REST OF SECTION>\n"
msgstr " [%6tx] <НЕВИКОРИСТОВУВАНІ ДАНІ У РЕШТІ РОЗДІЛУ>\n"
-#: src/readelf.c:4606
+#: src/readelf.c:4920
#, c-format
msgid " [%6tx] <UNUSED GARBAGE> ... %<PRIu64> bytes ...\n"
msgstr " [%6tx] <НЕВИКОРИСТОВУВАНІ ДАНІ> ... %<PRIu64> байтів ...\n"
-#: src/readelf.c:4632
+#: src/readelf.c:4998
#, c-format
msgid ""
"\n"
@@ -5516,7 +4971,7 @@
"Розділ DWARF [%2zu] «%s» зі зміщенням %#<PRIx64>:\n"
" [ Код]\n"
-#: src/readelf.c:4640
+#: src/readelf.c:5006
#, c-format
msgid ""
"\n"
@@ -5525,30 +4980,78 @@
"\n"
"Розділ скорочень за зміщенням %<PRIu64>:\n"
-#: src/readelf.c:4653
+#: src/readelf.c:5019
#, c-format
msgid " *** error while reading abbreviation: %s\n"
msgstr " *** помилка під час читання скорочення: %s\n"
-#: src/readelf.c:4669
+#: src/readelf.c:5035
#, c-format
msgid " [%5u] offset: %<PRId64>, children: %s, tag: %s\n"
msgstr " [%5u] зміщення: %<PRId64>, дочірній: %s, мітка: %s\n"
-#: src/readelf.c:4672
-msgid "yes"
-msgstr "так"
+#: src/readelf.c:5068 src/readelf.c:5377 src/readelf.c:5541 src/readelf.c:5926
+#: src/readelf.c:6527 src/readelf.c:8168 src/readelf.c:8838 src/readelf.c:9274
+#: src/readelf.c:9518 src/readelf.c:9683 src/readelf.c:10044
+#: src/readelf.c:10102
+#, c-format
+msgid ""
+"\n"
+"DWARF section [%2zu] '%s' at offset %#<PRIx64>:\n"
+msgstr ""
+"\n"
+"Розділ DWARF [%2zu] «%s» зі зміщенням %#<PRIx64>:\n"
-#: src/readelf.c:4672
-msgid "no"
-msgstr "ні"
+#: src/readelf.c:5081
+#, fuzzy, c-format
+msgid "cannot get .debug_addr section data: %s"
+msgstr "не вдалося отримати дані розділу: %s"
-#: src/readelf.c:4706 src/readelf.c:4779
+#: src/readelf.c:5181 src/readelf.c:5205 src/readelf.c:5586 src/readelf.c:8883
+#, fuzzy, c-format
+msgid " Length: %8<PRIu64>\n"
+msgstr ""
+"\n"
+" Довжина: %6<PRIu64>\n"
+
+#: src/readelf.c:5183 src/readelf.c:5220 src/readelf.c:5599 src/readelf.c:8896
+#, fuzzy, c-format
+msgid " DWARF version: %8<PRIu16>\n"
+msgstr " версія DWARF: %6<PRIuFAST16>\n"
+
+#: src/readelf.c:5184 src/readelf.c:5229 src/readelf.c:5608 src/readelf.c:8905
+#, fuzzy, c-format
+msgid " Address size: %8<PRIu64>\n"
+msgstr " Розмір адреси: %6<PRIu64>\n"
+
+#: src/readelf.c:5186 src/readelf.c:5239 src/readelf.c:5618 src/readelf.c:8915
+#, fuzzy, c-format
+msgid " Segment size: %8<PRIu64>\n"
+msgstr ""
+" Розмір сегмента: %6<PRIu64>\n"
+"\n"
+
+#: src/readelf.c:5224 src/readelf.c:5603 src/readelf.c:8900 src/readelf.c:10234
+#, fuzzy, c-format
+msgid "Unknown version"
+msgstr "невідома версія"
+
+#: src/readelf.c:5234 src/readelf.c:5447 src/readelf.c:5613 src/readelf.c:8910
+#, c-format
+msgid "unsupported address size"
+msgstr "непідтримуваний розмір адреси"
+
+#: src/readelf.c:5245 src/readelf.c:5456 src/readelf.c:5623 src/readelf.c:8920
+#, c-format
+msgid "unsupported segment size"
+msgstr "непідтримуваний розмір сегмента"
+
+#: src/readelf.c:5298 src/readelf.c:5372
#, c-format
msgid "cannot get .debug_aranges content: %s"
msgstr "не вдалося отримати дані get .debug_aranges: %s"
-#: src/readelf.c:4721
+#: src/readelf.c:5313
#, c-format
msgid ""
"\n"
@@ -5566,12 +5069,12 @@
"\n"
"Розділ DWARF [%2zu] «%s» за зміщенням %#<PRIx64> містить %zu записів:\n"
-#: src/readelf.c:4752
+#: src/readelf.c:5344
#, c-format
msgid " [%*zu] ???\n"
msgstr " [%*zu] ???\n"
-#: src/readelf.c:4754
+#: src/readelf.c:5346
#, c-format
msgid ""
" [%*zu] start: %0#*<PRIx64>, length: %5<PRIu64>, CU DIE offset: %6<PRId64>\n"
@@ -5579,17 +5082,7 @@
" [%*zu] початок: %0#*<PRIx64>, довжина: %5<PRIu64>, зміщення CU DIE: "
"%6<PRId64>\n"
-#: src/readelf.c:4784 src/readelf.c:4938 src/readelf.c:5514 src/readelf.c:6468
-#: src/readelf.c:7000 src/readelf.c:7120 src/readelf.c:7284 src/readelf.c:7709
-#, c-format
-msgid ""
-"\n"
-"DWARF section [%2zu] '%s' at offset %#<PRIx64>:\n"
-msgstr ""
-"\n"
-"Розділ DWARF [%2zu] «%s» зі зміщенням %#<PRIx64>:\n"
-
-#: src/readelf.c:4797 src/readelf.c:6494
+#: src/readelf.c:5390 src/readelf.c:8195
#, c-format
msgid ""
"\n"
@@ -5598,12 +5091,13 @@
"\n"
"Таблиця за зміщенням %zu:\n"
-#: src/readelf.c:4801 src/readelf.c:5538 src/readelf.c:6505
+#: src/readelf.c:5394 src/readelf.c:5567 src/readelf.c:6551 src/readelf.c:8206
+#: src/readelf.c:8864
#, c-format
msgid "invalid data in section [%zu] '%s'"
msgstr "некоректні дані у розділі [%zu] «%s»"
-#: src/readelf.c:4817
+#: src/readelf.c:5410
#, c-format
msgid ""
"\n"
@@ -5612,32 +5106,27 @@
"\n"
" Довжина: %6<PRIu64>\n"
-#: src/readelf.c:4829
+#: src/readelf.c:5422
#, c-format
msgid " DWARF version: %6<PRIuFAST16>\n"
msgstr " версія DWARF: %6<PRIuFAST16>\n"
-#: src/readelf.c:4833
+#: src/readelf.c:5426
#, c-format
msgid "unsupported aranges version"
msgstr "непідтримувана версія aranges"
-#: src/readelf.c:4844
+#: src/readelf.c:5437
#, c-format
msgid " CU offset: %6<PRIx64>\n"
msgstr " зміщення CU: %6<PRIx64>\n"
-#: src/readelf.c:4850
+#: src/readelf.c:5443
#, c-format
msgid " Address size: %6<PRIu64>\n"
msgstr " Розмір адреси: %6<PRIu64>\n"
-#: src/readelf.c:4854
-#, c-format
-msgid "unsupported address size"
-msgstr "непідтримуваний розмір адреси"
-
-#: src/readelf.c:4859
+#: src/readelf.c:5452
#, c-format
msgid ""
" Segment size: %6<PRIu64>\n"
@@ -5646,66 +5135,111 @@
" Розмір сегмента: %6<PRIu64>\n"
"\n"
-#: src/readelf.c:4863
-#, c-format
-msgid "unsupported segment size"
-msgstr "непідтримуваний розмір сегмента"
-
-#: src/readelf.c:4903
-#, c-format
-msgid " %s..%s (%<PRIx64>)\n"
-msgstr " %s..%s (%<PRIx64>)\n"
-
-#: src/readelf.c:4906
-#, c-format
-msgid " %s..%s\n"
-msgstr " %s..%s\n"
-
-#: src/readelf.c:4915
+#: src/readelf.c:5507
#, c-format
msgid " %zu padding bytes\n"
msgstr " %zu байтів доповнення\n"
-#: src/readelf.c:4933
+#: src/readelf.c:5550
+#, fuzzy, c-format
+msgid "cannot get .debug_rnglists content: %s"
+msgstr "не вдалося отримати дані .debug_ranges: %s"
+
+#: src/readelf.c:5573 src/readelf.c:8870
+#, fuzzy, c-format
+msgid ""
+"Table at Offset 0x%<PRIx64>:\n"
+"\n"
+msgstr " зміщення .debug_line: 0x%<PRIx64>\n"
+
+#: src/readelf.c:5628 src/readelf.c:8925
+#, fuzzy, c-format
+msgid " Offset entries: %8<PRIu64>\n"
+msgstr " Довжина зміщення: %<PRIu8>\n"
+
+#: src/readelf.c:5644 src/readelf.c:8941
+#, c-format
+msgid " Unknown CU base: "
+msgstr ""
+
+#: src/readelf.c:5646 src/readelf.c:8943
+#, c-format
+msgid " CU [%6<PRIx64>] base: "
+msgstr ""
+
+#: src/readelf.c:5652 src/readelf.c:8949
+#, c-format
+msgid " Not associated with a CU.\n"
+msgstr ""
+
+#: src/readelf.c:5663 src/readelf.c:8960
+#, c-format
+msgid "too many offset entries for unit length"
+msgstr ""
+
+#: src/readelf.c:5667 src/readelf.c:8964
+#, fuzzy, c-format
+msgid " Offsets starting at 0x%<PRIx64>:\n"
+msgstr " Зміщення: 0x%<PRIx64>\n"
+
+#: src/readelf.c:5719
+#, fuzzy, c-format
+msgid "invalid range list data"
+msgstr "некоректні дані"
+
+#: src/readelf.c:5904 src/readelf.c:9252
+#, fuzzy, c-format
+msgid ""
+" %zu padding bytes\n"
+"\n"
+msgstr " %zu байтів доповнення\n"
+
+#: src/readelf.c:5921
#, c-format
msgid "cannot get .debug_ranges content: %s"
msgstr "не вдалося отримати дані .debug_ranges: %s"
-#: src/readelf.c:4963 src/readelf.c:7027
+#: src/readelf.c:5957 src/readelf.c:9307
+#, c-format
+msgid ""
+"\n"
+" Unknown CU base: "
+msgstr ""
+
+#: src/readelf.c:5959 src/readelf.c:9309
+#, c-format
+msgid ""
+"\n"
+" CU [%6<PRIx64>] base: "
+msgstr ""
+
+#: src/readelf.c:5968 src/readelf.c:9335 src/readelf.c:9361
#, c-format
msgid " [%6tx] <INVALID DATA>\n"
msgstr " [%6tx] <НЕКОРЕКТНІ ДАНІ>\n"
-#: src/readelf.c:4985 src/readelf.c:7049
-#, c-format
-msgid " [%6tx] base address %s\n"
+#: src/readelf.c:5989 src/readelf.c:9441
+#, fuzzy, c-format
+msgid ""
+" [%6tx] base address\n"
+" "
msgstr " [%6tx] базова адреса %s\n"
-#: src/readelf.c:4992 src/readelf.c:7056
-#, c-format
-msgid " [%6tx] empty list\n"
+#: src/readelf.c:5997 src/readelf.c:9449
+#, fuzzy, c-format
+msgid " [%6tx] empty list\n"
msgstr " [%6tx] порожній список\n"
-#: src/readelf.c:5003
-#, c-format
-msgid " [%6tx] %s..%s\n"
-msgstr " [%6tx] %s..%s\n"
-
-#: src/readelf.c:5005
-#, c-format
-msgid " %s..%s\n"
-msgstr " %s..%s\n"
-
-#: src/readelf.c:5184
+#: src/readelf.c:6252
msgid " <INVALID DATA>\n"
msgstr " <НЕКОРЕКТНІ ДАНІ>\n"
-#: src/readelf.c:5493
+#: src/readelf.c:6505
#, c-format
msgid "cannot get ELF: %s"
msgstr "не вдалося отримати ELF: %s"
-#: src/readelf.c:5510
+#: src/readelf.c:6523
#, c-format
msgid ""
"\n"
@@ -5714,7 +5248,7 @@
"\n"
"Розділ відомостей щодо вікна викликів [%2zu] «%s» за зміщенням %#<PRIx64>:\n"
-#: src/readelf.c:5560
+#: src/readelf.c:6573
#, c-format
msgid ""
"\n"
@@ -5723,50 +5257,65 @@
"\n"
" [%6tx] нульовий переривач\n"
-#: src/readelf.c:5653 src/readelf.c:5808
+#: src/readelf.c:6666 src/readelf.c:6820
#, c-format
msgid "invalid augmentation length"
msgstr "некоректна довжина збільшення"
-#: src/readelf.c:5668
+#: src/readelf.c:6681
msgid "FDE address encoding: "
msgstr "Кодування адреси FDE: "
-#: src/readelf.c:5674
+#: src/readelf.c:6687
msgid "LSDA pointer encoding: "
msgstr "Кодування вказівника LSDA: "
-#: src/readelf.c:5785
+#: src/readelf.c:6797
#, c-format
msgid " (offset: %#<PRIx64>)"
msgstr " (зміщення: %#<PRIx64>)"
-#: src/readelf.c:5792
+#: src/readelf.c:6804
#, c-format
msgid " (end offset: %#<PRIx64>)"
msgstr " (зміщення від кінця: %#<PRIx64>)"
-#: src/readelf.c:5829
+#: src/readelf.c:6841
#, c-format
msgid " %-26sLSDA pointer: %#<PRIx64>\n"
msgstr " %-26sвказівник LSDA: %#<PRIx64>\n"
-#: src/readelf.c:5884
-#, c-format
-msgid "cannot get attribute code: %s"
+#: src/readelf.c:6926
+#, fuzzy, c-format
+msgid "DIE [%<PRIx64>] cannot get attribute code: %s"
msgstr "не вдалося отримати код атрибута: %s"
-#: src/readelf.c:5893
-#, c-format
-msgid "cannot get attribute form: %s"
+#: src/readelf.c:6936
+#, fuzzy, c-format
+msgid "DIE [%<PRIx64>] cannot get attribute form: %s"
msgstr "не вдалося отримати форму атрибута: %s"
-#: src/readelf.c:5908
-#, c-format
-msgid "cannot get attribute value: %s"
+#: src/readelf.c:6958
+#, fuzzy, c-format
+msgid "DIE [%<PRIx64>] cannot get attribute '%s' (%s) value: %s"
msgstr "не вдалося отримати значення атрибута: %s"
-#: src/readelf.c:6207
+#: src/readelf.c:7291
+#, fuzzy, c-format
+msgid "invalid file (%<PRId64>): %s"
+msgstr "некоректний файл"
+
+#: src/readelf.c:7295
+#, fuzzy, c-format
+msgid "no srcfiles for CU [%<PRIx64>]"
+msgstr " встановити файл у %<PRIu64>\n"
+
+#: src/readelf.c:7299
+#, fuzzy, c-format
+msgid "couldn't get DWARF CU: %s"
+msgstr "не вдалося отримати ELF: %s"
+
+#: src/readelf.c:7522
#, c-format
msgid ""
"\n"
@@ -5777,20 +5326,25 @@
"Розділ DWARF [%2zu] «%s» за зміщенням %#<PRIx64>:\n"
" [Зміщення]\n"
-#: src/readelf.c:6239
-#, c-format
+#: src/readelf.c:7572
+#, fuzzy, c-format
+msgid "cannot get next unit: %s"
+msgstr "не вдалося визначити наступний DIE: %s"
+
+#: src/readelf.c:7591
+#, fuzzy, c-format
msgid ""
" Type unit at offset %<PRIu64>:\n"
" Version: %<PRIu16>, Abbreviation section offset: %<PRIu64>, Address size: "
"%<PRIu8>, Offset size: %<PRIu8>\n"
-" Type signature: %#<PRIx64>, Type offset: %#<PRIx64>\n"
+" Type signature: %#<PRIx64>, Type offset: %#<PRIx64> [%<PRIx64>]\n"
msgstr ""
" Модуль типів за зміщенням %<PRIu64>:\n"
" Версія: %<PRIu16>, Зміщення розділу скорочень: %<PRIu64>, Адреса: %<PRIu8>, "
"Зміщення: %<PRIu8>\n"
" Підпис типу: %#<PRIx64>, Зміщення типу: %#<PRIx64>\n"
-#: src/readelf.c:6248
+#: src/readelf.c:7603
#, c-format
msgid ""
" Compilation unit at offset %<PRIu64>:\n"
@@ -5801,33 +5355,49 @@
" Версія: %<PRIu16>, Зміщення розділу скорочень: %<PRIu64>, Адреса: %<PRIu8>, "
"Зміщення: %<PRIu8>\n"
-#: src/readelf.c:6273
+#: src/readelf.c:7613 src/readelf.c:7776
#, c-format
-msgid "cannot get DIE at offset %<PRIu64> in section '%s': %s"
-msgstr "не вдалося отримати DIE за зміщенням %<PRIu64> у розділі «%s»: %s"
+msgid " Unit type: %s (%<PRIu8>)"
+msgstr ""
-#: src/readelf.c:6287
+#: src/readelf.c:7640
+#, c-format
+msgid "unknown version (%d) or unit type (%d)"
+msgstr ""
+
+#: src/readelf.c:7669
#, c-format
msgid "cannot get DIE offset: %s"
msgstr "не вдалося отримати зміщення DIE: %s"
-#: src/readelf.c:6296
-#, c-format
-msgid "cannot get tag of DIE at offset %<PRIu64> in section '%s': %s"
+#: src/readelf.c:7678
+#, fuzzy, c-format
+msgid "cannot get tag of DIE at offset [%<PRIx64>] in section '%s': %s"
msgstr ""
"не вдалося отримати мітку DIE за зміщенням %<PRIu64> у розділі «%s»: %s"
-#: src/readelf.c:6328
+#: src/readelf.c:7716
#, c-format
msgid "cannot get next DIE: %s\n"
msgstr "не вдалося визначити наступний DIE: %s\n"
-#: src/readelf.c:6336
+#: src/readelf.c:7724
#, c-format
msgid "cannot get next DIE: %s"
msgstr "не вдалося визначити наступний DIE: %s"
-#: src/readelf.c:6372
+#: src/readelf.c:7768
+#, fuzzy, c-format
+msgid ""
+" Split compilation unit at offset %<PRIu64>:\n"
+" Version: %<PRIu16>, Abbreviation section offset: %<PRIu64>, Address size: "
+"%<PRIu8>, Offset size: %<PRIu8>\n"
+msgstr ""
+" Модуль компіляції за зміщенням %<PRIu64>:\n"
+" Версія: %<PRIu16>, Зміщення розділу скорочень: %<PRIu64>, Адреса: %<PRIu8>, "
+"Зміщення: %<PRIu8>\n"
+
+#: src/readelf.c:7819
#, c-format
msgid ""
"\n"
@@ -5838,24 +5408,32 @@
"Розділ DWARF [%2zu] «%s» зі зміщенням %#<PRIx64>:\n"
"\n"
-#: src/readelf.c:6481
+#: src/readelf.c:8151
+#, fuzzy, c-format
+msgid "unknown form: %s"
+msgstr "невідома форма %#<PRIx64>"
+
+#: src/readelf.c:8182
#, c-format
msgid "cannot get line data section data: %s"
msgstr "не вдалося отримати дані розділу лінійних даних: %s"
-#: src/readelf.c:6551
-#, c-format
+#. Print what we got so far.
+#: src/readelf.c:8284
+#, fuzzy, c-format
msgid ""
"\n"
-" Length: %<PRIu64>\n"
-" DWARF version: %<PRIuFAST16>\n"
-" Prologue length: %<PRIu64>\n"
-" Minimum instruction length: %<PRIuFAST8>\n"
-" Maximum operations per instruction: %<PRIuFAST8>\n"
-" Initial value if '%s': %<PRIuFAST8>\n"
-" Line base: %<PRIdFAST8>\n"
-" Line range: %<PRIuFAST8>\n"
-" Opcode base: %<PRIuFAST8>\n"
+" Length: %<PRIu64>\n"
+" DWARF version: %<PRIuFAST16>\n"
+" Prologue length: %<PRIu64>\n"
+" Address size: %zd\n"
+" Segment selector size: %zd\n"
+" Min instruction length: %<PRIuFAST8>\n"
+" Max operations per instruction: %<PRIuFAST8>\n"
+" Initial value if 'is_stmt': %<PRIuFAST8>\n"
+" Line base: %<PRIdFAST8>\n"
+" Line range: %<PRIuFAST8>\n"
+" Opcode base: %<PRIuFAST8>\n"
"\n"
"Opcodes:\n"
msgstr ""
@@ -5872,12 +5450,27 @@
"\n"
"Коди операцій:\n"
-#: src/readelf.c:6572
+#: src/readelf.c:8306
+#, fuzzy, c-format
+msgid "cannot handle .debug_line version: %u\n"
+msgstr "не вдалося отримати версію символу: %s"
+
+#: src/readelf.c:8314
+#, fuzzy, c-format
+msgid "cannot handle address size: %u\n"
+msgstr "непідтримуваний розмір адреси"
+
+#: src/readelf.c:8322
+#, fuzzy, c-format
+msgid "cannot handle segment selector size: %u\n"
+msgstr "не вдалося отримати розділ: %s"
+
+#: src/readelf.c:8332
#, c-format
msgid "invalid data at offset %tu in section [%zu] '%s'"
msgstr "некоректні дані зі зміщенням %tu у розділі [%zu] «%s»"
-#: src/readelf.c:6587
+#: src/readelf.c:8347
#, c-format
msgid " [%*<PRIuFAST8>] %hhu argument\n"
msgid_plural " [%*<PRIuFAST8>] %hhu arguments\n"
@@ -5885,7 +5478,7 @@
msgstr[1] " [%*<PRIuFAST8>] %hhu аргументи\n"
msgstr[2] " [%*<PRIuFAST8>] %hhu аргументів\n"
-#: src/readelf.c:6595
+#: src/readelf.c:8358
msgid ""
"\n"
"Directory table:"
@@ -5893,17 +5486,29 @@
"\n"
"Таблиця каталогу:"
-#: src/readelf.c:6611
+#: src/readelf.c:8364 src/readelf.c:8439
+#, fuzzy, c-format
+msgid " ["
+msgstr " PC: "
+
+#: src/readelf.c:8433
+#, fuzzy
msgid ""
"\n"
-"File name table:\n"
-" Entry Dir Time Size Name"
+"File name table:"
+msgstr ""
+"\n"
+" Таблиця місця виклику:"
+
+#: src/readelf.c:8494
+#, fuzzy
+msgid " Entry Dir Time Size Name"
msgstr ""
"\n"
"Таблиця назв файлів:\n"
" Запис Кат Час Розмір Назва"
-#: src/readelf.c:6646
+#: src/readelf.c:8529
msgid ""
"\n"
"Line number statements:"
@@ -5911,120 +5516,128 @@
"\n"
"Оператори номерів рядків:"
-#: src/readelf.c:6697
+#: src/readelf.c:8552
#, c-format
msgid "invalid maximum operations per instruction is zero"
msgstr "некоректну кількість операцій на інструкцію прирівняно до нуля"
-#: src/readelf.c:6733
-#, c-format
-msgid " special opcode %u: address+%u = %s, op_index = %u, line%+d = %zu\n"
+#: src/readelf.c:8586
+#, fuzzy, c-format
+msgid " special opcode %u: address+%u = "
+msgstr " спеціальний код операції %u: адреса+%u = %s, рядок%+d = %zu\n"
+
+#: src/readelf.c:8590
+#, fuzzy, c-format
+msgid ", op_index = %u, line%+d = %zu\n"
msgstr ""
" спеціальний код операції %u: адреса+%u = %s, індекс_оп = %u, рядок%+d = "
"%zu\n"
-#: src/readelf.c:6738
+#: src/readelf.c:8593
#, c-format
-msgid " special opcode %u: address+%u = %s, line%+d = %zu\n"
-msgstr " спеціальний код операції %u: адреса+%u = %s, рядок%+d = %zu\n"
+msgid ", line%+d = %zu\n"
+msgstr ""
-#: src/readelf.c:6758
+#: src/readelf.c:8611
#, c-format
msgid " extended opcode %u: "
msgstr " розширений код операції %u: "
-#: src/readelf.c:6763
+#: src/readelf.c:8616
msgid " end of sequence"
msgstr " кінець послідовності"
-#: src/readelf.c:6782
-#, c-format
-msgid " set address to %s\n"
+#: src/readelf.c:8634
+#, fuzzy, c-format
+msgid " set address to "
msgstr " встановити адресу у значення %s\n"
-#: src/readelf.c:6809
+#: src/readelf.c:8662
#, c-format
msgid " define new file: dir=%u, mtime=%<PRIu64>, length=%<PRIu64>, name=%s\n"
msgstr ""
" визначення нового файла: dir=%u, mtime=%<PRIu64>, довжина=%<PRIu64>, назва="
"%s\n"
-#: src/readelf.c:6822
+#: src/readelf.c:8675
#, c-format
msgid " set discriminator to %u\n"
msgstr " встановити розрізнення для %u\n"
-#: src/readelf.c:6827
+#. Unknown, ignore it.
+#: src/readelf.c:8680
msgid " unknown opcode"
msgstr " невідомий код операції"
-#: src/readelf.c:6839
+#. Takes no argument.
+#: src/readelf.c:8692
msgid " copy"
msgstr " копія"
-#: src/readelf.c:6850
-#, c-format
-msgid " advance address by %u to %s, op_index to %u\n"
-msgstr " збільшення адреси на %u до %s, індекс_оп до %u\n"
-
-#: src/readelf.c:6854
-#, c-format
-msgid " advance address by %u to %s\n"
+#: src/readelf.c:8701
+#, fuzzy, c-format
+msgid " advance address by %u to "
msgstr " збільшення адреси на %u до %s\n"
-#: src/readelf.c:6865
+#: src/readelf.c:8705 src/readelf.c:8761
+#, c-format
+msgid ", op_index to %u"
+msgstr ""
+
+#: src/readelf.c:8715
#, c-format
msgid " advance line by constant %d to %<PRId64>\n"
msgstr " просувати рядок на сталу %d до %<PRId64>\n"
-#: src/readelf.c:6873
+#: src/readelf.c:8723
#, c-format
msgid " set file to %<PRIu64>\n"
msgstr " встановити файл у %<PRIu64>\n"
-#: src/readelf.c:6883
+#: src/readelf.c:8733
#, c-format
msgid " set column to %<PRIu64>\n"
msgstr " встановити значення стовпчика %<PRIu64>\n"
-#: src/readelf.c:6890
+#: src/readelf.c:8740
#, c-format
msgid " set '%s' to %<PRIuFAST8>\n"
msgstr " встановити «%s» у %<PRIuFAST8>\n"
-#: src/readelf.c:6896
+#. Takes no argument.
+#: src/readelf.c:8746
msgid " set basic block flag"
msgstr " встановити прапорець базового блоку"
-#: src/readelf.c:6909
-#, c-format
-msgid " advance address by constant %u to %s, op_index to %u\n"
-msgstr " збільшити адресу на сталу величину %u до %s, індекс_оп до %u\n"
-
-#: src/readelf.c:6913
-#, c-format
-msgid " advance address by constant %u to %s\n"
+#: src/readelf.c:8757
+#, fuzzy, c-format
+msgid " advance address by constant %u to "
msgstr " збільшити адресу на сталу величину %u до %s\n"
-#: src/readelf.c:6931
-#, c-format
-msgid " advance address by fixed value %u to %s\n"
+#: src/readelf.c:8776
+#, fuzzy, c-format
+msgid " advance address by fixed value %u to \n"
msgstr " збільшити адресу на фіксовану величину %u до %s\n"
-#: src/readelf.c:6940
+#. Takes no argument.
+#: src/readelf.c:8786
msgid " set prologue end flag"
msgstr " встановити прапорець кінця вступу"
-#: src/readelf.c:6945
+#. Takes no argument.
+#: src/readelf.c:8791
msgid " set epilogue begin flag"
msgstr " встановити прапорець початку епілогу"
-#: src/readelf.c:6954
+#: src/readelf.c:8800
#, c-format
msgid " set isa to %u\n"
msgstr " встановити isa у %u\n"
-#: src/readelf.c:6963
+#. This is a new opcode the generator but not we know about.
+#. Read the parameters associated with it but then discard
+#. everything. Read all the parameters for this opcode.
+#: src/readelf.c:8809
#, c-format
msgid " unknown opcode with %<PRIu8> parameter:"
msgid_plural " unknown opcode with %<PRIu8> parameters:"
@@ -6032,102 +5645,97 @@
msgstr[1] " невідомий код операції з %<PRIu8> параметрами:"
msgstr[2] " невідомий код операції з %<PRIu8> параметрами:"
-#: src/readelf.c:6995
+#: src/readelf.c:8847
+#, fuzzy, c-format
+msgid "cannot get .debug_loclists content: %s"
+msgstr "не вдалося отримати вміст .debug_loc: %s"
+
+#: src/readelf.c:9016
+#, fuzzy, c-format
+msgid "invalid loclists data"
+msgstr "некоректні дані"
+
+#: src/readelf.c:9269
#, c-format
msgid "cannot get .debug_loc content: %s"
msgstr "не вдалося отримати вміст .debug_loc: %s"
-#: src/readelf.c:7070
-#, c-format
-msgid " [%6tx] %s..%s"
-msgstr " [%6tx] %s..%s"
-
-#: src/readelf.c:7072
-#, c-format
-msgid " %s..%s"
-msgstr " %s..%s"
-
-#: src/readelf.c:7079 src/readelf.c:7967
+#: src/readelf.c:9476 src/readelf.c:10490
msgid " <INVALID DATA>\n"
msgstr " <НЕКОРЕКТНІ ДАНІ>\n"
-#: src/readelf.c:7131 src/readelf.c:7293
+#: src/readelf.c:9530 src/readelf.c:9693
#, c-format
msgid "cannot get macro information section data: %s"
msgstr "не вдалося отримати дані розділу відомостей щодо макросів: %s"
-#: src/readelf.c:7211
+#: src/readelf.c:9610
#, c-format
msgid "%*s*** non-terminated string at end of section"
msgstr "%*s*** незавершений рядок наприкінці розділу"
-#: src/readelf.c:7234
+#: src/readelf.c:9633
#, c-format
msgid "%*s*** missing DW_MACINFO_start_file argument at end of section"
msgstr "%*s*** пропущено аргумент DW_MACINFO_start_file наприкінці розділу"
-#: src/readelf.c:7334
+#: src/readelf.c:9734
#, c-format
msgid " Offset: 0x%<PRIx64>\n"
msgstr " Зміщення: 0x%<PRIx64>\n"
-#: src/readelf.c:7346
+#: src/readelf.c:9746
#, c-format
msgid " Version: %<PRIu16>\n"
msgstr " Версія: %<PRIu16>\n"
-#: src/readelf.c:7352 src/readelf.c:8086
+#: src/readelf.c:9752 src/readelf.c:10609
#, c-format
msgid " unknown version, cannot parse section\n"
msgstr " невідома версія, не вдалося обробити розділ\n"
-#: src/readelf.c:7359
+#: src/readelf.c:9759
#, c-format
msgid " Flag: 0x%<PRIx8>\n"
msgstr " Прапорець: 0x%<PRIx8>\n"
-#: src/readelf.c:7362
+#: src/readelf.c:9762
#, c-format
msgid " Offset length: %<PRIu8>\n"
msgstr " Довжина зміщення: %<PRIu8>\n"
-#: src/readelf.c:7370
+#: src/readelf.c:9770
#, c-format
msgid " .debug_line offset: 0x%<PRIx64>\n"
msgstr " зміщення .debug_line: 0x%<PRIx64>\n"
-#: src/readelf.c:7383
+#: src/readelf.c:9795
#, c-format
msgid " extension opcode table, %<PRIu8> items:\n"
msgstr " таблиця кодів операцій розширень, записів — %<PRIu8>:\n"
-#: src/readelf.c:7390
+#: src/readelf.c:9802
#, c-format
msgid " [%<PRIx8>]"
msgstr " [%<PRIx8>]"
-#: src/readelf.c:7402
+#: src/readelf.c:9814
#, c-format
msgid " %<PRIu8> arguments:"
msgstr " %<PRIu8> аргументів:"
-#: src/readelf.c:7430
+#: src/readelf.c:9829
#, c-format
msgid " no arguments."
msgstr " немає аргументів."
-#: src/readelf.c:7667
-#, c-format
-msgid "vendor opcode not verified?"
-msgstr "код операції постачальника не перевірено?"
-
-#: src/readelf.c:7695
+#: src/readelf.c:10030
#, c-format
msgid " [%5d] DIE offset: %6<PRId64>, CU DIE offset: %6<PRId64>, name: %s\n"
msgstr ""
" [%5d] зміщення DIE: %6<PRId64>, зміщення CU DIE: %6<PRId64>, назва: %s\n"
-#: src/readelf.c:7736
+#: src/readelf.c:10072
#, c-format
msgid ""
"\n"
@@ -6138,12 +5746,41 @@
"Розділ DWARF [%2zu] «%s» зі зміщенням %#<PRIx64>:\n"
" %*s Рядок\n"
-#: src/readelf.c:7750
-#, c-format
-msgid " *** error while reading strings: %s\n"
+#: src/readelf.c:10087
+#, fuzzy, c-format
+msgid " *** error, missing string terminator\n"
msgstr " *** помилка під час читання рядків: %s\n"
-#: src/readelf.c:7770
+#: src/readelf.c:10115
+#, fuzzy, c-format
+msgid "cannot get .debug_str_offsets section data: %s"
+msgstr "не вдалося отримати дані розділу: %s"
+
+#: src/readelf.c:10214
+#, fuzzy, c-format
+msgid " Length: %8<PRIu64>\n"
+msgstr ""
+"\n"
+" Довжина: %6<PRIu64>\n"
+
+#: src/readelf.c:10216
+#, fuzzy, c-format
+msgid " Offset size: %8<PRIu8>\n"
+msgstr " Довжина зміщення: %<PRIu8>\n"
+
+#: src/readelf.c:10230
+#, fuzzy, c-format
+msgid " DWARF version: %8<PRIu16>\n"
+msgstr " версія DWARF: %6<PRIuFAST16>\n"
+
+#: src/readelf.c:10239
+#, fuzzy, c-format
+msgid " Padding: %8<PRIx16>\n"
+msgstr ""
+"\n"
+" Довжина: %6<PRIu64>\n"
+
+#: src/readelf.c:10293
#, c-format
msgid ""
"\n"
@@ -6152,7 +5789,7 @@
"\n"
"Розділ таблиці пошуку вікон виклику [%2zu] '.eh_frame_hdr':\n"
-#: src/readelf.c:7872
+#: src/readelf.c:10395
#, c-format
msgid ""
"\n"
@@ -6161,22 +5798,22 @@
"\n"
"Розділ таблиці обробки виключень [%2zu] '.gcc_except_table':\n"
-#: src/readelf.c:7895
+#: src/readelf.c:10418
#, c-format
msgid " LPStart encoding: %#x "
msgstr " Кодування LPStart: %#x "
-#: src/readelf.c:7907
+#: src/readelf.c:10430
#, c-format
msgid " TType encoding: %#x "
msgstr " Кодування TType: %#x "
-#: src/readelf.c:7922
+#: src/readelf.c:10445
#, c-format
msgid " Call site encoding: %#x "
msgstr " Кодування місця виклику:%#x "
-#: src/readelf.c:7935
+#: src/readelf.c:10458
msgid ""
"\n"
" Call site table:"
@@ -6184,7 +5821,7 @@
"\n"
" Таблиця місця виклику:"
-#: src/readelf.c:7949
+#: src/readelf.c:10472
#, c-format
msgid ""
" [%4u] Call site start: %#<PRIx64>\n"
@@ -6197,12 +5834,12 @@
" Місце застосування: %#<PRIx64>\n"
" Дія: %u\n"
-#: src/readelf.c:8022
+#: src/readelf.c:10545
#, c-format
msgid "invalid TType encoding"
msgstr "некоректне кодування TType"
-#: src/readelf.c:8048
+#: src/readelf.c:10571
#, c-format
msgid ""
"\n"
@@ -6211,37 +5848,37 @@
"\n"
"Розділ GDB [%2zu] «%s» за зміщенням %#<PRIx64> містить %<PRId64> байтів:\n"
-#: src/readelf.c:8077
+#: src/readelf.c:10600
#, c-format
msgid " Version: %<PRId32>\n"
msgstr " Версія: %<PRId32>\n"
-#: src/readelf.c:8095
+#: src/readelf.c:10618
#, c-format
msgid " CU offset: %#<PRIx32>\n"
msgstr " зміщення CU: %#<PRIx32>\n"
-#: src/readelf.c:8102
+#: src/readelf.c:10625
#, c-format
msgid " TU offset: %#<PRIx32>\n"
msgstr " зміщення TU: %#<PRIx32>\n"
-#: src/readelf.c:8109
+#: src/readelf.c:10632
#, c-format
msgid " address offset: %#<PRIx32>\n"
msgstr " зміщення адреси: %#<PRIx32>\n"
-#: src/readelf.c:8116
+#: src/readelf.c:10639
#, c-format
msgid " symbol offset: %#<PRIx32>\n"
msgstr " зміщення символу: %#<PRIx32>\n"
-#: src/readelf.c:8123
+#: src/readelf.c:10646
#, c-format
msgid " constant offset: %#<PRIx32>\n"
msgstr " стале зміщення: %#<PRIx32>\n"
-#: src/readelf.c:8137
+#: src/readelf.c:10660
#, c-format
msgid ""
"\n"
@@ -6250,7 +5887,7 @@
"\n"
" Список CU зі зміщенням %#<PRIx32> містить %zu записів:\n"
-#: src/readelf.c:8162
+#: src/readelf.c:10685
#, c-format
msgid ""
"\n"
@@ -6259,7 +5896,7 @@
"\n"
" Список TU зі зміщенням %#<PRIx32> містить %zu записів:\n"
-#: src/readelf.c:8191
+#: src/readelf.c:10714
#, c-format
msgid ""
"\n"
@@ -6268,7 +5905,7 @@
"\n"
" Список адрес зі зміщенням %#<PRIx32> містить %zu записів:\n"
-#: src/readelf.c:8224
+#: src/readelf.c:10746
#, c-format
msgid ""
"\n"
@@ -6277,17 +5914,18 @@
"\n"
" Таблиця символів за зміщенням %#<PRIx32> містить %zu позицій:\n"
-#: src/readelf.c:8311
+#: src/readelf.c:10884
#, c-format
msgid "cannot get debug context descriptor: %s"
msgstr "не вдалося отримати дескриптор контексту зневаджування: %s"
-#: src/readelf.c:8467 src/readelf.c:9089 src/readelf.c:9200 src/readelf.c:9258
+#: src/readelf.c:11247 src/readelf.c:11869 src/readelf.c:11980
+#: src/readelf.c:12038
#, c-format
msgid "cannot convert core note data: %s"
msgstr "не вдалося перетворити дані запису ядра: %s"
-#: src/readelf.c:8830
+#: src/readelf.c:11610
#, c-format
msgid ""
"\n"
@@ -6296,21 +5934,21 @@
"\n"
"%*s... <повторюється %u разів> ..."
-#: src/readelf.c:9337
+#: src/readelf.c:12117
msgid " Owner Data size Type\n"
msgstr " Власник Розм. даних Тип\n"
-#: src/readelf.c:9355
+#: src/readelf.c:12135
#, c-format
msgid " %-13.*s %9<PRId32> %s\n"
msgstr " %-13.*s %9<PRId32> %s\n"
-#: src/readelf.c:9405
-#, c-format
-msgid "cannot get content of note section: %s"
+#: src/readelf.c:12185
+#, fuzzy, c-format
+msgid "cannot get content of note: %s"
msgstr "не вдалося отримати вміст розділу записів: %s"
-#: src/readelf.c:9432
+#: src/readelf.c:12212
#, c-format
msgid ""
"\n"
@@ -6320,7 +5958,7 @@
"Розділ записів (note) [%2zu] «%s» з %<PRIu64> байтів за зміщенням "
"%#0<PRIx64>:\n"
-#: src/readelf.c:9455
+#: src/readelf.c:12235
#, c-format
msgid ""
"\n"
@@ -6329,7 +5967,7 @@
"\n"
"Сегмент записів з %<PRIu64> байтів за зміщенням %#0<PRIx64>:\n"
-#: src/readelf.c:9501
+#: src/readelf.c:12281
#, c-format
msgid ""
"\n"
@@ -6338,12 +5976,12 @@
"\n"
"У розділі [%zu] «%s» не міститься даних для створення дампу.\n"
-#: src/readelf.c:9518 src/readelf.c:9559
+#: src/readelf.c:12308 src/readelf.c:12359
#, c-format
msgid "cannot get data for section [%zu] '%s': %s"
msgstr "не вдалося отримати дані для розділу [%zu] «%s»: %s"
-#: src/readelf.c:9523
+#: src/readelf.c:12313
#, c-format
msgid ""
"\n"
@@ -6352,7 +5990,7 @@
"\n"
"Шіст. дамп розділу [%zu] «%s», %<PRIu64> байтів за зміщенням %#0<PRIx64>:\n"
-#: src/readelf.c:9528
+#: src/readelf.c:12318
#, fuzzy, c-format
msgid ""
"\n"
@@ -6362,7 +6000,7 @@
"\n"
"Шіст. дамп розділу [%zu] «%s», %<PRIu64> байтів за зміщенням %#0<PRIx64>:\n"
-#: src/readelf.c:9542
+#: src/readelf.c:12332
#, c-format
msgid ""
"\n"
@@ -6371,7 +6009,7 @@
"\n"
"У розділі [%zu] «%s» не міститься рядків для створення дампу.\n"
-#: src/readelf.c:9564
+#: src/readelf.c:12364
#, c-format
msgid ""
"\n"
@@ -6380,7 +6018,7 @@
"\n"
"Розділ рядків [%zu] «%s» містить %<PRIu64> байтів за зміщенням %#0<PRIx64>:\n"
-#: src/readelf.c:9569
+#: src/readelf.c:12369
#, fuzzy, c-format
msgid ""
"\n"
@@ -6390,7 +6028,7 @@
"\n"
"Розділ рядків [%zu] «%s» містить %<PRIu64> байтів за зміщенням %#0<PRIx64>:\n"
-#: src/readelf.c:9618
+#: src/readelf.c:12418
#, c-format
msgid ""
"\n"
@@ -6399,7 +6037,7 @@
"\n"
"розділу [%lu] не існує"
-#: src/readelf.c:9647
+#: src/readelf.c:12447
#, c-format
msgid ""
"\n"
@@ -6408,12 +6046,12 @@
"\n"
"розділу «%s» не існує"
-#: src/readelf.c:9704
+#: src/readelf.c:12504
#, c-format
msgid "cannot get symbol index of archive '%s': %s"
msgstr "не вдалося отримати покажчик символів архіву «%s»: %s"
-#: src/readelf.c:9707
+#: src/readelf.c:12507
#, c-format
msgid ""
"\n"
@@ -6422,7 +6060,7 @@
"\n"
"У архіві «%s» немає покажчика символів\n"
-#: src/readelf.c:9711
+#: src/readelf.c:12511
#, c-format
msgid ""
"\n"
@@ -6431,17 +6069,17 @@
"\n"
"Покажчик архіву «%s» містить %zu записів:\n"
-#: src/readelf.c:9729
+#: src/readelf.c:12529
#, c-format
msgid "cannot extract member at offset %zu in '%s': %s"
msgstr "не вдалося видобути елемент за зміщенням %zu у «%s»: %s"
-#: src/readelf.c:9734
+#: src/readelf.c:12534
#, c-format
msgid "Archive member '%s' contains:\n"
msgstr "Елемент архіву «%s» містить:\n"
-#: src/size.c:59
+#: src/size.c:57
msgid ""
"Use the output format FORMAT. FORMAT can be `bsd' or `sysv'. The default "
"is `bsd'"
@@ -6449,125 +6087,126 @@
"Використовувати формат виводу ФОРМАТ. ФОРМАТом може бути «bsd» або «sysv». "
"Типовим є значення «bsd»"
-#: src/size.c:61
+#: src/size.c:59
msgid "Same as `--format=sysv'"
msgstr "Те саме, що і «--format=sysv»"
-#: src/size.c:62
+#: src/size.c:60
msgid "Same as `--format=bsd'"
msgstr "Те саме, що і «--format=bsd»"
-#: src/size.c:65
+#: src/size.c:63
msgid "Same as `--radix=10'"
msgstr "Те саме, що і «--radix=10»"
-#: src/size.c:66
+#: src/size.c:64
msgid "Same as `--radix=8'"
msgstr "Те саме, що і «--radix=8»"
-#: src/size.c:67
+#: src/size.c:65
msgid "Same as `--radix=16'"
msgstr "Те саме, що і «--radix=16»"
-#: src/size.c:69
+#: src/size.c:67
msgid "Similar to `--format=sysv' output but in one line"
msgstr "Вивід даних у форматі, подібному до «--format=sysv», але у один рядок"
-#: src/size.c:73
+#: src/size.c:71
msgid "Print size and permission flags for loadable segments"
msgstr ""
"Вивести розмір і прапорці прав доступу для придатних до завантаження "
"сегментів"
-#: src/size.c:74
+#: src/size.c:72
msgid "Display the total sizes (bsd only)"
msgstr "Показувати загальні розміри (лише bsd)"
-#: src/size.c:79
+#. Short description of program.
+#: src/size.c:77
msgid "List section sizes of FILEs (a.out by default)."
msgstr "Показати розміри розділів ФАЙЛів (типово a.out)."
-#: src/size.c:257
+#: src/size.c:241
#, c-format
msgid "Invalid format: %s"
msgstr "Некоректний формат: %s"
-#: src/size.c:268
+#: src/size.c:252
#, c-format
msgid "Invalid radix: %s"
msgstr "Некоректна основа числення: %s"
-#: src/size.c:327
+#: src/size.c:311
#, c-format
msgid "%s: file format not recognized"
msgstr "%s: не вдалося розпізнати формат файла"
-#: src/size.c:433 src/size.c:566
+#: src/size.c:417 src/size.c:550
#, c-format
msgid " (ex %s)"
msgstr " (прикл. %s)"
-#: src/size.c:591
+#: src/size.c:575
msgid "(TOTALS)\n"
msgstr "(ЗАГАЛОМ)\n"
-#: src/stack.c:488
+#: src/stack.c:483
#, c-format
msgid "-p PID should be a positive process id."
msgstr "PID у -p PID має бути додатним значенням ідентифікатора процесу."
-#: src/stack.c:494
+#: src/stack.c:489
#, c-format
msgid "Cannot open core file '%s'"
msgstr "Не вдалося відкрити файл дампу ядра «%s»"
-#: src/stack.c:554
+#: src/stack.c:549
#, c-format
msgid "-n MAXFRAMES should be 0 or higher."
msgstr "MAXFRAMES у -n має бути значенням рівним 0 або більшим."
-#: src/stack.c:566
+#: src/stack.c:561
#, c-format
msgid "-e EXEC needs a core given by --core."
msgstr "Для -e EXEC слід вказати ядро за допомогою --core."
-#: src/stack.c:570
+#: src/stack.c:565
#, c-format
msgid "-1 needs a thread id given by -p."
msgstr "-1 слід передати ідентифікатор потоку виконання, заданого -p."
-#: src/stack.c:574
+#: src/stack.c:569
#, c-format
msgid "One of -p PID or --core COREFILE should be given."
msgstr "Слід вказати -p PID або --core COREFILE."
-#: src/stack.c:644
+#: src/stack.c:641
msgid "Show stack of process PID"
msgstr "Вивести стек PID процесу"
-#: src/stack.c:646
+#: src/stack.c:643
msgid "Show stack found in COREFILE"
msgstr "Вивести стек, знайдений у COREFILE"
-#: src/stack.c:647
+#: src/stack.c:644
msgid "(optional) EXECUTABLE that produced COREFILE"
msgstr "(необов’язковий) EXECUTABLE, яким створено COREFILE"
-#: src/stack.c:651
+#: src/stack.c:648
msgid "Output selection options:"
msgstr "Параметри вибору виведених даних:"
-#: src/stack.c:653
+#: src/stack.c:650
msgid "Additionally show frame activation"
msgstr "Додатково вивести активацію вікна"
-#: src/stack.c:655
+#: src/stack.c:652
msgid "Additionally try to lookup DWARF debuginfo name for frame address"
msgstr ""
"Додатково спробувати визначити назву файла даних діагностики DWARF для "
"адреси вікна"
-#: src/stack.c:658
+#: src/stack.c:655
msgid ""
"Additionally show inlined function frames using DWARF debuginfo if available "
"(implies -d)"
@@ -6575,15 +6214,15 @@
"Додатково вивести вікна вбудованих функцій за допомогою даних діагностики "
"DWARF, якщо такі є (використовується і -d)"
-#: src/stack.c:660
+#: src/stack.c:657
msgid "Additionally show module file information"
msgstr "Додатково вивести дані щодо файла модуля"
-#: src/stack.c:662
+#: src/stack.c:659
msgid "Additionally show source file information"
msgstr "Додатково вивести дані щодо файла початкового коду"
-#: src/stack.c:664
+#: src/stack.c:661
msgid ""
"Show all additional information (activation, debugname, inlines, module and "
"source)"
@@ -6591,55 +6230,58 @@
"Вивести усі додаткові дані (активацію, назву у системі діагностики, "
"вбудовані функції, модуль і початковий файл)"
-#: src/stack.c:666
+#: src/stack.c:663
msgid "Do not resolve address to function symbol name"
msgstr "Не розгортати адресу до назви символу функції"
-#: src/stack.c:668
+#: src/stack.c:665
msgid "Show raw function symbol names, do not try to demangle names"
msgstr ""
"Вивести назви символів функцій без обробки, не намагатися розшифрувати назви"
-#: src/stack.c:670
+#: src/stack.c:667
msgid "Show module build-id, load address and pc offset"
msgstr "Виводити ідентифікатор збирання, адресу завантаження та зсув модуля"
-#: src/stack.c:672
+#: src/stack.c:669
msgid "Show the backtrace of only one thread"
msgstr "Виводити зворотне трасування лише одного потоку"
-#: src/stack.c:674
+#: src/stack.c:671
msgid "Show at most MAXFRAMES per thread (default 256, use 0 for unlimited)"
msgstr ""
"Виводити не більше MAXFRAMES на потік виконання (типове значення 256, 0 — не "
"обмежувати)"
-#: src/stack.c:676
+#: src/stack.c:673
msgid "Show module memory map with build-id, elf and debug files detected"
msgstr ""
"Вивести карту пам’яті модуля із виявленими ідентифікатором збирання, elf та "
"файлами діагностичних даних"
-#: src/stack.c:684
+#: src/stack.c:681
+#, fuzzy
msgid ""
-"Print a stack for each thread in a process or core file.\vProgram exits with "
-"return code 0 if all frames were shown without any errors. If some frames "
-"were shown, but there were some non-fatal errors, possibly causing an "
-"incomplete backtrace, the program exits with return code 1. If no frames "
-"could be shown, or a fatal error occured the program exits with return code "
-"2. If the program was invoked with bad or missing arguments it will exit "
-"with return code 64."
+"Print a stack for each thread in a process or core file.\n"
+"\n"
+"Program exits with return code 0 if all frames were shown without any "
+"errors. If some frames were shown, but there were some non-fatal errors, "
+"possibly causing an incomplete backtrace, the program exits with return code "
+"1. If no frames could be shown, or a fatal error occured the program exits "
+"with return code 2. If the program was invoked with bad or missing "
+"arguments it will exit with return code 64."
msgstr ""
-"Вивести стек для кожного потоку у процесі або файлі дампу ядра.\vПрограма "
-"завершує роботу з кодом виходу 0, якщо усі вікна було виведено без помилок. "
-"Якщо деякі вікна було показано, але сталися некритичні помилки, ймовірно "
-"спричинені неповними даними зворотного трасування, програма завершує роботу "
-"з кодом повернення 1. Якщо не вдалося вивести жодного вікна або сталася "
-"критична помилка, програма виходить з кодом повернення 2. Якщо програму було "
-"викликано з помилковими або пропущеними аргументами, програма завершить "
-"роботу з кодом виходу 64."
+"Вивести стек для кожного потоку у процесі або файлі дампу ядра.\n"
+"\n"
+"Програма завершує роботу з кодом виходу 0, якщо усі вікна було виведено без "
+"помилок. Якщо деякі вікна було показано, але сталися некритичні помилки, "
+"ймовірно спричинені неповними даними зворотного трасування, програма "
+"завершує роботу з кодом повернення 1. Якщо не вдалося вивести жодного вікна "
+"або сталася критична помилка, програма виходить з кодом повернення 2. Якщо "
+"програму було викликано з помилковими або пропущеними аргументами, програма "
+"завершить роботу з кодом виходу 64."
-#: src/stack.c:757
+#: src/stack.c:756
#, c-format
msgid "Couldn't show any frames."
msgstr "Не вдалося вивести жодного вікна."
@@ -6678,65 +6320,66 @@
msgid "Alias for --radix=o"
msgstr "Замінник --radix=o"
+#. Short description of program.
#: src/strings.c:84
msgid "Print the strings of printable characters in files."
msgstr "Вивести рядки файлів з символів, придатних для друку."
-#: src/strings.c:271 src/strings.c:306
+#: src/strings.c:257 src/strings.c:292
#, c-format
msgid "invalid value '%s' for %s parameter"
msgstr "некоректне значення «%s» параметра %s"
-#: src/strings.c:317
+#: src/strings.c:303
#, c-format
msgid "invalid minimum length of matched string size"
msgstr "некоректна мінімальна довжина розмірності рядка для порівняння"
-#: src/strings.c:600
+#: src/strings.c:586
#, fuzzy, c-format
msgid "lseek failed"
msgstr "помилка lseek64"
-#: src/strings.c:617 src/strings.c:681
+#: src/strings.c:603 src/strings.c:667
#, c-format
msgid "re-mmap failed"
msgstr "помилка повторного використання mmap"
-#: src/strings.c:654
+#: src/strings.c:640
#, c-format
msgid "mprotect failed"
msgstr "помилка mprotect"
-#: src/strings.c:743
+#: src/strings.c:729
#, c-format
msgid "Skipping section %zd '%s' data outside file"
msgstr "Пропускаємо дані %zd «%s» поза файлом"
-#: src/strip.c:68
+#: src/strip.c:71
msgid "Place stripped output into FILE"
msgstr "Вивести дані після вилучення до ФАЙЛа"
-#: src/strip.c:69
+#: src/strip.c:72
msgid "Extract the removed sections into FILE"
msgstr "Видобути вилучені розділи до ФАЙЛа"
-#: src/strip.c:70
+#: src/strip.c:73
msgid "Embed name FILE instead of -f argument"
msgstr "Вбудувати назву ФАЙЛа замість аргументу -f"
-#: src/strip.c:74
+#: src/strip.c:77
msgid "Remove all debugging symbols"
msgstr "Вилучити всі символи зневаджування"
-#: src/strip.c:78
+#: src/strip.c:81
msgid "Remove section headers (not recommended)"
msgstr "Вилучити заголовки розділів (не рекомендовано)"
-#: src/strip.c:80
+#: src/strip.c:83
msgid "Copy modified/access timestamps to the output"
msgstr "Скопіювати часові позначки зміни/доступу до виведених даних"
-#: src/strip.c:82
+#: src/strip.c:85
msgid ""
"Resolve all trivial relocations between debug sections if the removed "
"sections are placed in a debug file (only relevant for ET_REL files, "
@@ -6746,417 +6389,451 @@
"вилучені розділи було розташовано у діагностичному файлі (стосується лише "
"файлів ET_REL, скасувати дію неможливо, потребує параметра -f)"
-#: src/strip.c:84
+#: src/strip.c:87
msgid "Remove .comment section"
msgstr "Вилучити розділ .comment"
-#: src/strip.c:87
-msgid "Relax a few rules to handle slightly broken ELF files"
+#: src/strip.c:88
+msgid ""
+"Remove the named section. SECTION is an extended wildcard pattern. May be "
+"given more than once. Only non-allocated sections can be removed."
msgstr ""
-"Знехтувати декількома правилами для обробки трохи пошкоджених файлів ELF"
-#: src/strip.c:92
+#: src/strip.c:89
+msgid ""
+"Keep the named section. SECTION is an extended wildcard pattern. May be "
+"given more than once."
+msgstr ""
+
+#. Short description of program.
+#: src/strip.c:96
msgid "Discard symbols from object files."
msgstr "Відкинути символи з об’єктних файлів"
-#: src/strip.c:186
+#: src/strip.c:242
#, c-format
msgid "--reloc-debug-sections used without -f"
msgstr "--reloc-debug-sections використано без -f"
-#: src/strip.c:200
+#: src/strip.c:256
#, c-format
msgid "Only one input file allowed together with '-o' and '-f'"
msgstr ""
"Разом з «-o» або «-f» можна використовувати лише один файл вхідних даних"
-#: src/strip.c:236
+#: src/strip.c:279
#, c-format
msgid "-f option specified twice"
msgstr "параметр -f вказано двічі"
-#: src/strip.c:245
+#: src/strip.c:288
#, c-format
msgid "-F option specified twice"
msgstr "параметр -F вказано двічі"
-#: src/strip.c:254 src/unstrip.c:120
-#, c-format
-msgid "-o option specified twice"
-msgstr "параметр -o вказано двічі"
+#: src/strip.c:347
+#, fuzzy, c-format
+msgid "cannot both keep and remove .comment section"
+msgstr "Вилучити розділ .comment"
-#: src/strip.c:278
-#, c-format
-msgid "-R option supports only .comment section"
-msgstr "Для параметра -R передбачено підтримку лише розділу .comment"
-
-#: src/strip.c:320 src/strip.c:344
+#: src/strip.c:372 src/strip.c:396
#, c-format
msgid "cannot stat input file '%s'"
msgstr "не вдалося отримати дані з вхідного файла «%s» за допомогою stat"
-#: src/strip.c:334
+#: src/strip.c:386
#, c-format
msgid "while opening '%s'"
msgstr "під час спроби відкриття «%s»"
-#: src/strip.c:372
+#: src/strip.c:424
#, c-format
msgid "%s: cannot use -o or -f when stripping archive"
msgstr ""
"%s: не можна використовувати -o або -f під час вилучення додаткового вмісту "
"архіву"
-#: src/strip.c:384
+#. We would like to support ar archives, but currently it just
+#. doesn't work at all since we call elf_clone on the members
+#. which doesn't really support ar members.
+#. result = handle_ar (fd, elf, NULL, fname,
+#. preserve_dates ? tv : NULL);
+#.
+#: src/strip.c:436
#, c-format
msgid "%s: no support for stripping archive"
msgstr "%s: підтримки вилучення додаткового вмісту з архіву не передбачено"
-#: src/strip.c:483
+#: src/strip.c:535
#, c-format
msgid "cannot open EBL backend"
msgstr "не вдалося відкрити канал сервера EBL"
-#: src/strip.c:528
+#: src/strip.c:580
#, c-format
msgid "cannot get number of phdrs"
msgstr "не вдалося отримати кількість phdr"
-#: src/strip.c:544 src/strip.c:568
+#: src/strip.c:596 src/strip.c:620
#, c-format
msgid "cannot create new file '%s': %s"
msgstr "не вдалося створити файл «%s»: %s"
-#: src/strip.c:634
+#: src/strip.c:686
#, c-format
msgid "illformed file '%s'"
msgstr "помилкове форматування файла «%s»"
-#: src/strip.c:968 src/strip.c:1067
+#: src/strip.c:696
+#, fuzzy, c-format
+msgid "Cannot remove allocated section '%s'"
+msgstr "не вдалося розмістити PLT-розділ: %s"
+
+#: src/strip.c:705
+#, fuzzy, c-format
+msgid "Cannot both keep and remove section '%s'"
+msgstr "не вдалося додати новий розділ: %s"
+
+#: src/strip.c:1061 src/strip.c:1160
#, c-format
msgid "while generating output file: %s"
msgstr "під час спроби створення файла з виведеними даними: %s"
-#: src/strip.c:1033 src/strip.c:2071
+#: src/strip.c:1126 src/strip.c:2208
#, c-format
msgid "%s: error while creating ELF header: %s"
msgstr "%s: помилка під час створення заголовка ELF: %s"
-#: src/strip.c:1050
+#: src/strip.c:1143
#, c-format
msgid "while preparing output for '%s'"
msgstr "під час приготування виведених даних для «%s»"
-#: src/strip.c:1108 src/strip.c:1171
+#: src/strip.c:1205 src/strip.c:1268
#, c-format
msgid "while create section header section: %s"
msgstr "під час створення розділу заголовка розділу: %s"
-#: src/strip.c:1117
+#: src/strip.c:1214
#, c-format
msgid "cannot allocate section data: %s"
msgstr "не вдалося розмістити дані розділу: %s"
-#: src/strip.c:1183
+#: src/strip.c:1280
#, c-format
msgid "while create section header string table: %s"
msgstr "під час створення таблиці рядків заголовка розділу: %s"
-#: src/strip.c:1861
+#: src/strip.c:1287
+#, fuzzy, c-format
+msgid "no memory to create section header string table"
+msgstr "під час створення таблиці рядків заголовка розділу: %s"
+
+#: src/strip.c:1497
+#, c-format
+msgid "Cannot remove symbol [%zd] from allocated symbol table [%zd]"
+msgstr ""
+
+#: src/strip.c:1994
#, c-format
msgid "bad relocation"
msgstr "помилкове пересування"
-#: src/strip.c:1982 src/strip.c:2095
+#: src/strip.c:2119 src/strip.c:2232
#, c-format
msgid "while writing '%s': %s"
msgstr "під час запису «%s»: %s"
-#: src/strip.c:1993
+#: src/strip.c:2130
#, c-format
msgid "while creating '%s'"
msgstr "під час спроби створення «%s»"
-#: src/strip.c:2016
+#: src/strip.c:2153
#, c-format
msgid "while computing checksum for debug information"
msgstr "під час обчислення контрольної суми для діагностичних даних"
-#: src/strip.c:2080
+#: src/strip.c:2217
#, c-format
msgid "%s: error while reading the file: %s"
msgstr "%s: помилка під час читання файла: %s"
-#: src/strip.c:2120 src/strip.c:2140
+#: src/strip.c:2257 src/strip.c:2277
#, c-format
msgid "while writing '%s'"
msgstr "під час спроби запису «%s»"
-#: src/strip.c:2177 src/strip.c:2184
+#: src/strip.c:2314 src/strip.c:2321
#, c-format
msgid "error while finishing '%s': %s"
msgstr "помилка під час завершення «%s»: %s"
-#: src/strip.c:2201 src/strip.c:2273
+#: src/strip.c:2338 src/strip.c:2414
#, c-format
msgid "cannot set access and modification date of '%s'"
msgstr "не вдалося встановити права доступу та дату зміни «%s»"
-#: src/unstrip.c:69
+#: src/unstrip.c:70
msgid "Match MODULE against file names, not module names"
msgstr ""
"Встановити відповідність МОДУЛЯ назвам файлів, а не назвам модулів names"
-#: src/unstrip.c:70
+#: src/unstrip.c:71
msgid "Silently skip unfindable files"
msgstr "Пропустити незнайдені файли без додаткових повідомлень"
-#: src/unstrip.c:73
+#: src/unstrip.c:74
msgid "Place output into FILE"
msgstr "Вивести дані у ФАЙЛ"
-#: src/unstrip.c:75
+#: src/unstrip.c:76
msgid "Create multiple output files under DIRECTORY"
msgstr "Створити декілька файлів виведених даних у КАТАЛОЗІ"
-#: src/unstrip.c:76
+#: src/unstrip.c:77
msgid "Use module rather than file names"
msgstr "Використовувати назви модулів, а не файлів"
-#: src/unstrip.c:78
+#: src/unstrip.c:79
msgid "Create output for modules that have no separate debug information"
msgstr ""
"Вивести дані для модулів, які не містять окремих діагностичних відомостей"
-#: src/unstrip.c:81
+#: src/unstrip.c:82
msgid "Apply relocations to section contents in ET_REL files"
msgstr "Застосувати пересування до вмісту розділів у файлах ET_REL"
-#: src/unstrip.c:83
+#: src/unstrip.c:84
msgid "Only list module and file names, build IDs"
msgstr "Вивести лише список назв модулів, файлів, побудувати ідентифікатори"
-#: src/unstrip.c:85
+#: src/unstrip.c:86
msgid "Force combining files even if some ELF headers don't seem to match"
msgstr ""
"Примусово поєднати файли, навіть якщо буде встановлено невідповідність "
"якихось із заголовків ELF"
-#: src/unstrip.c:129
+#: src/unstrip.c:130
#, c-format
msgid "-d option specified twice"
msgstr "параметр -d вказано двічі"
-#: src/unstrip.c:164
+#: src/unstrip.c:165
#, c-format
msgid "only one of -o or -d allowed"
msgstr "можна використовувати лише один з параметрів: -o або -d"
-#: src/unstrip.c:173
+#: src/unstrip.c:174
#, c-format
msgid "-n cannot be used with explicit files or -o or -d"
msgstr ""
"-n не можна використовувати з файлами, заданими явно, або параметрами -o і -d"
-#: src/unstrip.c:188
+#: src/unstrip.c:189
#, c-format
msgid "output directory '%s'"
msgstr "каталог виведення даних «%s»"
-#: src/unstrip.c:197
+#: src/unstrip.c:198
#, c-format
msgid "exactly two file arguments are required"
msgstr "як аргументи має бути вказано точно два файла"
-#: src/unstrip.c:203
+#: src/unstrip.c:204
#, c-format
msgid "-m, -a, -R, and -i options not allowed with explicit files"
msgstr ""
"для файлів, заданих явно, не можна використовувати параметри -m, -a, -R і -i"
-#: src/unstrip.c:216
+#: src/unstrip.c:217
#, c-format
msgid "-o or -d is required when using implicit files"
msgstr ""
"якщо використовуються файли, задані неявно, слід додавати параметр -o або -d"
-#: src/unstrip.c:252
+#: src/unstrip.c:240
#, c-format
msgid "cannot create ELF header: %s"
msgstr "не вдалося створити заголовок ELF: %s"
-#: src/unstrip.c:257
+#: src/unstrip.c:245
#, c-format
msgid "cannot copy ELF header: %s"
msgstr "не вдалося скопіювати заголовок ELF: %s"
-#: src/unstrip.c:261 src/unstrip.c:1939 src/unstrip.c:1982
+#: src/unstrip.c:249 src/unstrip.c:1933 src/unstrip.c:1976
#, c-format
msgid "cannot get number of program headers: %s"
msgstr "не вдалося отримати кількість заголовків програми: %s"
-#: src/unstrip.c:266 src/unstrip.c:1943
+#: src/unstrip.c:254 src/unstrip.c:1937
#, c-format
msgid "cannot create program headers: %s"
msgstr "не вдалося створити заголовки програми: %s"
-#: src/unstrip.c:272
+#: src/unstrip.c:260
#, c-format
msgid "cannot copy program header: %s"
msgstr "не вдалося скопіювати заголовок програми: %s"
-#: src/unstrip.c:282
+#: src/unstrip.c:270
#, c-format
msgid "cannot copy section header: %s"
msgstr "не вдалося скопіювати заголовок розділу: %s"
-#: src/unstrip.c:285 src/unstrip.c:1576
+#: src/unstrip.c:273 src/unstrip.c:1568
#, c-format
msgid "cannot get section data: %s"
msgstr "не вдалося отримати дані розділу: %s"
-#: src/unstrip.c:287 src/unstrip.c:1578
+#: src/unstrip.c:275 src/unstrip.c:1570
#, c-format
msgid "cannot copy section data: %s"
msgstr "не вдалося скопіювати дані розділу: %s"
-#: src/unstrip.c:311
+#: src/unstrip.c:299
#, c-format
msgid "cannot create directory '%s'"
msgstr "не вдалося створити каталог «%s»"
-#: src/unstrip.c:383 src/unstrip.c:803 src/unstrip.c:1610
+#: src/unstrip.c:371 src/unstrip.c:791 src/unstrip.c:1602
#, c-format
msgid "cannot get symbol table entry: %s"
msgstr "не вдалося отримати запис таблиці символів: %s"
-#: src/unstrip.c:399 src/unstrip.c:620 src/unstrip.c:641 src/unstrip.c:653
-#: src/unstrip.c:1631 src/unstrip.c:1805 src/unstrip.c:1829
+#: src/unstrip.c:387 src/unstrip.c:608 src/unstrip.c:629 src/unstrip.c:641
+#: src/unstrip.c:1623 src/unstrip.c:1799 src/unstrip.c:1823
#, c-format
msgid "cannot update symbol table: %s"
msgstr "не вдалося оновити таблицю символів: %s"
-#: src/unstrip.c:409
+#: src/unstrip.c:397
#, c-format
msgid "cannot update section header: %s"
msgstr "не вдалося оновити заголовок розділу: %s"
-#: src/unstrip.c:448 src/unstrip.c:459
+#: src/unstrip.c:436 src/unstrip.c:447
#, c-format
msgid "cannot update relocation: %s"
msgstr "не вдалося оновити пересування: %s"
-#: src/unstrip.c:547
+#: src/unstrip.c:535
#, c-format
msgid "cannot get symbol version: %s"
msgstr "не вдалося отримати версію символу: %s"
-#: src/unstrip.c:560
+#: src/unstrip.c:548
#, c-format
msgid "unexpected section type in [%zu] with sh_link to symtab"
msgstr "неочікуваний тип розділу у [%zu] з посиланням sh_link на symtab"
-#: src/unstrip.c:809
+#: src/unstrip.c:797
#, c-format
msgid "invalid string offset in symbol [%zu]"
msgstr "некоректне зміщення рядка у символі [%zu]"
-#: src/unstrip.c:967 src/unstrip.c:1313
+#: src/unstrip.c:955 src/unstrip.c:1305
#, c-format
msgid "cannot read section [%zu] name: %s"
msgstr "не вдалося прочитати назву розділу [%zu]: %s"
-#: src/unstrip.c:1008 src/unstrip.c:1027 src/unstrip.c:1062
+#: src/unstrip.c:996 src/unstrip.c:1015 src/unstrip.c:1053
#, c-format
msgid "cannot read '.gnu.prelink_undo' section: %s"
msgstr "не вдалося прочитати розділ «.gnu.prelink_undo»: %s"
-#: src/unstrip.c:1048
-#, c-format
-msgid "invalid contents in '%s' section"
-msgstr "некоректний вміст розділу «%s»"
-
-#: src/unstrip.c:1054
+#: src/unstrip.c:1033
#, c-format
msgid "overflow with shnum = %zu in '%s' section"
msgstr ""
-#: src/unstrip.c:1108 src/unstrip.c:1433
+#: src/unstrip.c:1044
+#, c-format
+msgid "invalid contents in '%s' section"
+msgstr "некоректний вміст розділу «%s»"
+
+#: src/unstrip.c:1099 src/unstrip.c:1427
#, c-format
msgid "cannot find matching section for [%zu] '%s'"
msgstr "не вдалося знайти відповідний розділ для [%zu] «%s»"
-#: src/unstrip.c:1233 src/unstrip.c:1248 src/unstrip.c:1514 src/unstrip.c:1766
+#: src/unstrip.c:1224 src/unstrip.c:1239 src/unstrip.c:1506 src/unstrip.c:1758
#, c-format
msgid "cannot add section name to string table: %s"
msgstr "не вдалося додати назву розділу до таблиці рядків: %s"
-#: src/unstrip.c:1257
+#: src/unstrip.c:1248
#, c-format
msgid "cannot update section header string table data: %s"
msgstr "не вдалося оновити дані заголовка розділу у таблиці рядків: %s"
-#: src/unstrip.c:1284 src/unstrip.c:1288
+#: src/unstrip.c:1276 src/unstrip.c:1280
#, c-format
msgid "cannot get section header string table section index: %s"
msgstr ""
"не вдалося визначити індекс розділу заголовка розділу у таблиці рядків: %s"
-#: src/unstrip.c:1292 src/unstrip.c:1296 src/unstrip.c:1529
+#: src/unstrip.c:1284 src/unstrip.c:1288 src/unstrip.c:1521
#, c-format
msgid "cannot get section count: %s"
msgstr "не вдалося отримати кількість розділів: %s"
-#: src/unstrip.c:1299
+#: src/unstrip.c:1291
#, c-format
msgid "more sections in stripped file than debug file -- arguments reversed?"
msgstr ""
"у очищеному файлі більше розділів ніж у файлі з даними для зневаджування — "
"помилковий порядок параметрів?"
-#: src/unstrip.c:1358 src/unstrip.c:1448
+#: src/unstrip.c:1350 src/unstrip.c:1442
#, c-format
msgid "cannot read section header string table: %s"
msgstr "не вдалося прочитати таблицю рядків заголовка розділу: %s"
-#: src/unstrip.c:1508
+#: src/unstrip.c:1500
#, c-format
msgid "cannot add new section: %s"
msgstr "не вдалося додати новий розділ: %s"
-#: src/unstrip.c:1618
+#: src/unstrip.c:1610
#, c-format
msgid "symbol [%zu] has invalid section index"
msgstr "символ [%zu] має некоректний індекс розділу"
-#: src/unstrip.c:1900
+#: src/unstrip.c:1894
#, c-format
msgid "cannot read section data: %s"
msgstr "не вдалося прочитати дані розділу: %s"
-#: src/unstrip.c:1921
+#: src/unstrip.c:1915
#, c-format
msgid "cannot get ELF header: %s"
msgstr "не вдалося отримати заголовок ELF: %s"
-#: src/unstrip.c:1953
+#: src/unstrip.c:1923
+#, c-format
+msgid "cannot update ELF header: %s"
+msgstr "не вдалося оновити заголовок ELF: %s"
+
+#: src/unstrip.c:1947
#, c-format
msgid "cannot update program header: %s"
msgstr "не вдалося оновити заголовок програми: %s"
-#: src/unstrip.c:1958 src/unstrip.c:2040
+#: src/unstrip.c:1952 src/unstrip.c:2034
#, c-format
msgid "cannot write output file: %s"
msgstr "не вдалося записати файл виведених даних: %s"
-#: src/unstrip.c:2009
+#: src/unstrip.c:2003
#, c-format
msgid "DWARF data not adjusted for prelinking bias; consider prelink -u"
msgstr ""
"Дані DWARF не скориговано відповідно до відхилення перед компонуванням; "
"спробуйте виправити це командою prelink -u"
-#: src/unstrip.c:2012
+#: src/unstrip.c:2006
#, c-format
msgid ""
"DWARF data in '%s' not adjusted for prelinking bias; consider prelink -u"
@@ -7164,76 +6841,76 @@
"Дані DWARF у «%s» не скориговано відповідно до відхилення перед "
"компонуванням; спробуйте виправити це командою prelink -u"
-#: src/unstrip.c:2031 src/unstrip.c:2082 src/unstrip.c:2094 src/unstrip.c:2180
+#: src/unstrip.c:2025 src/unstrip.c:2076 src/unstrip.c:2088 src/unstrip.c:2174
#, c-format
msgid "cannot create ELF descriptor: %s"
msgstr "не вдалося створити дескриптор ELF: %s"
-#: src/unstrip.c:2073
+#: src/unstrip.c:2067
msgid "WARNING: "
msgstr "УВАГА: "
-#: src/unstrip.c:2075
+#: src/unstrip.c:2069
msgid ", use --force"
msgstr ", скористайтеся --force"
-#: src/unstrip.c:2098
+#: src/unstrip.c:2092
msgid "ELF header identification (e_ident) different"
msgstr "Різні ідентифікатори заголовків ELF (e_ident)"
-#: src/unstrip.c:2101
+#: src/unstrip.c:2095
msgid "ELF header type (e_type) different"
msgstr "Різні типи заголовків ELF (e_type)"
-#: src/unstrip.c:2104
+#: src/unstrip.c:2098
msgid "ELF header machine type (e_machine) different"
msgstr "Різні типи архітектур заголовків ELF (e_machine)"
-#: src/unstrip.c:2107
+#: src/unstrip.c:2101
msgid "stripped program header (e_phnum) smaller than unstripped"
msgstr "очищений заголовок програми (e_phnum) є меншим за неочищений"
-#: src/unstrip.c:2137
+#: src/unstrip.c:2131
#, c-format
msgid "cannot find stripped file for module '%s': %s"
msgstr "не вдалося знайти очищений файл для модуля «%s»: %s"
-#: src/unstrip.c:2141
+#: src/unstrip.c:2135
#, c-format
msgid "cannot open stripped file '%s' for module '%s': %s"
msgstr "не вдалося відкрити очищений файл «%s» для модуля «%s»: %s"
-#: src/unstrip.c:2156
+#: src/unstrip.c:2150
#, c-format
msgid "cannot find debug file for module '%s': %s"
msgstr "не вдалося знайти файл діагностичних даних для модуля «%s»: %s"
-#: src/unstrip.c:2160
+#: src/unstrip.c:2154
#, c-format
msgid "cannot open debug file '%s' for module '%s': %s"
msgstr "не вдалося відкрити файл діагностичних даних «%s» для модуля «%s»: %s"
-#: src/unstrip.c:2173
+#: src/unstrip.c:2167
#, c-format
msgid "module '%s' file '%s' is not stripped"
msgstr "у модулі «%s» файл «%s» не очищено strip"
-#: src/unstrip.c:2204
+#: src/unstrip.c:2198
#, c-format
msgid "cannot cache section addresses for module '%s': %s"
msgstr "не вдалося кешувати адреси розділів для модуля «%s»: %s"
-#: src/unstrip.c:2337
+#: src/unstrip.c:2331
#, c-format
msgid "no matching modules found"
msgstr "відповідних модулів не виявлено"
-#: src/unstrip.c:2346
+#: src/unstrip.c:2340
#, c-format
msgid "matched more than one module"
msgstr "встановлено відповідність декількох модулів"
-#: src/unstrip.c:2390
+#: src/unstrip.c:2384
msgid ""
"STRIPPED-FILE DEBUG-FILE\n"
"[MODULE...]"
@@ -7241,10 +6918,12 @@
"ОЧИЩЕНИЙ-ФАЙЛ ФАЙЛ-DEBUG\n"
"[МОДУЛЬ...]"
-#: src/unstrip.c:2391
+#: src/unstrip.c:2385
+#, fuzzy
msgid ""
-"Combine stripped files with separate symbols and debug information.\vThe "
-"first form puts the result in DEBUG-FILE if -o was not given.\n"
+"Combine stripped files with separate symbols and debug information.\n"
+"\n"
+"The first form puts the result in DEBUG-FILE if -o was not given.\n"
"\n"
"MODULE arguments give file name patterns matching modules to process.\n"
"With -f these match the file name of the main (stripped) file (slashes are "
@@ -7268,8 +6947,10 @@
"was found, or . if FILE contains the debug information."
msgstr ""
"Комбінувати очищені файли з окремими даними щодо символів та діагностичними "
-"даними.\vЗа використання першої форми команди, результати буде виведено до "
-"ФАЙЛА-DEBUG, якщо не файл виведених даних не вказано параметром -o.\n"
+"даними.\n"
+"\n"
+"За використання першої форми команди, результати буде виведено до ФАЙЛА-"
+"DEBUG, якщо не файл виведених даних не вказано параметром -o.\n"
"\n"
"За допомогою аргументів МОДУЛЬ можна вказати шаблони назв файлів модулів, "
"які слід обробити.\n"
@@ -7297,7 +6978,7 @@
"окремого файла діагностичних даних або «-», якщо файла діагностичних даних "
"не вдалося знайти, і «.», якщо ФАЙЛ сам містить діагностичні дані."
-#: tests/backtrace.c:427
+#: tests/backtrace.c:442
msgid "Run executable"
msgstr "Запустити виконуваний файл"
@@ -7309,6 +6990,555 @@
msgid "Show instances of inlined functions"
msgstr "Вивести екземпляри вбудованих функцій"
+#~ msgid "%s+%#<PRIx64> <%s+%#<PRIx64>>"
+#~ msgstr "%s+%#<PRIx64> <%s+%#<PRIx64>>"
+
+#~ msgid "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
+#~ msgstr "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
+
+#~ msgid "%#<PRIx64> <%s+%#<PRIx64>>"
+#~ msgstr "%#<PRIx64> <%s+%#<PRIx64>>"
+
+#~ msgid "%#0*<PRIx64> <%s+%#<PRIx64>>"
+#~ msgstr "%#0*<PRIx64> <%s+%#<PRIx64>>"
+
+#~ msgid "%s+%#<PRIx64> <%s>"
+#~ msgstr "%s+%#<PRIx64> <%s>"
+
+#~ msgid "%s+%#0*<PRIx64> <%s>"
+#~ msgstr "%s+%#0*<PRIx64> <%s>"
+
+#~ msgid "%#<PRIx64> <%s>"
+#~ msgstr "%#<PRIx64> <%s>"
+
+#~ msgid "%#0*<PRIx64> <%s>"
+#~ msgstr "%#0*<PRIx64> <%s>"
+
+#~ msgid "%s+%#<PRIx64>"
+#~ msgstr "%s+%#<PRIx64>"
+
+#~ msgid "%s+%#0*<PRIx64>"
+#~ msgstr "%s+%#0*<PRIx64>"
+
+#~ msgid " %s..%s (%<PRIx64>)\n"
+#~ msgstr " %s..%s (%<PRIx64>)\n"
+
+#~ msgid " %s..%s\n"
+#~ msgstr " %s..%s\n"
+
+#~ msgid " advance address by %u to %s, op_index to %u\n"
+#~ msgstr " збільшення адреси на %u до %s, індекс_оп до %u\n"
+
+#~ msgid " advance address by constant %u to %s, op_index to %u\n"
+#~ msgstr " збільшити адресу на сталу величину %u до %s, індекс_оп до %u\n"
+
+#~ msgid " [%6tx] %s..%s\n"
+#~ msgstr " [%6tx] %s..%s\n"
+
+#~ msgid " %s..%s\n"
+#~ msgstr " %s..%s\n"
+
+#~ msgid "cannot get DIE at offset %<PRIu64> in section '%s': %s"
+#~ msgstr "не вдалося отримати DIE за зміщенням %<PRIu64> у розділі «%s»: %s"
+
+#~ msgid " [%6tx] %s..%s"
+#~ msgstr " [%6tx] %s..%s"
+
+#~ msgid " %s..%s"
+#~ msgstr " %s..%s"
+
+#~ msgid "vendor opcode not verified?"
+#~ msgstr "код операції постачальника не перевірено?"
+
+#~ msgid "-R option supports only .comment section"
+#~ msgstr "Для параметра -R передбачено підтримку лише розділу .comment"
+
+#~ msgid "Written by %s.\n"
+#~ msgstr "Автор — %s.\n"
+
+#~ msgid "cannot allocate PLTREL section: %s"
+#~ msgstr "не вдалося розмістити розділ PLTREL: %s"
+
+#~ msgid "cannot allocate GOT section: %s"
+#~ msgstr "не вдалося розмістити розділ GOT: %s"
+
+#~ msgid "cannot allocate GOTPLT section: %s"
+#~ msgstr "не вдалося розмістити розділ GOTPLT: %s"
+
+#~ msgid "initial-executable TLS relocation cannot be used "
+#~ msgstr ""
+#~ "не можна використовувати пересування TLS у початковому виконуваному файлі"
+
+#~ msgid "Input File Control:"
+#~ msgstr "Керування файлом вхідних даних:"
+
+#~ msgid "Include whole archives in the output from now on."
+#~ msgstr "Відтепер включати цілі архіви до виведених даних."
+
+#~ msgid "Stop including the whole archives in the output."
+#~ msgstr "Припинити включення цілих архівів до вихідних даних."
+
+#~ msgid "FILE"
+#~ msgstr "ФАЙЛ"
+
+#~ msgid "Start a group."
+#~ msgstr "Почати групу."
+
+#~ msgid "End a group."
+#~ msgstr "Завершити групу."
+
+#~ msgid "PATH"
+#~ msgstr "ШЛЯХ"
+
+#~ msgid "Add PATH to list of directories files are searched in."
+#~ msgstr "Додати ШЛЯХ до списку каталогів, у яких слід шукати файли."
+
+#~ msgid "Only set DT_NEEDED for following dynamic libs if actually used"
+#~ msgstr ""
+#~ "Встановлювати DT_NEEDED лише для наступних динамічних бібліотек, якщо він "
+#~ "справді використовується"
+
+#~ msgid "Always set DT_NEEDED for following dynamic libs"
+#~ msgstr "Завжди встановлювати DT_NEEDED для наступних динамічних бібліотек"
+
+#~ msgid "Ignore LD_LIBRARY_PATH environment variable."
+#~ msgstr "Ігнорувати змінну середовища LD_LIBRARY_PATH."
+
+#~ msgid "Output File Control:"
+#~ msgstr "Керування файлом виведених даних:"
+
+#~ msgid "Place output in FILE."
+#~ msgstr "Вивести дані до ФАЙЛА."
+
+#~ msgid "Object is marked to not use default search path at runtime."
+#~ msgstr ""
+#~ "Об’єкт позначено, як таких, який не використовує типовий шлях пошуку під "
+#~ "час запуску."
+
+#~ msgid "Same as --whole-archive."
+#~ msgstr "Те саме, що --whole-archive."
+
+#~ msgid ""
+#~ "Default rules of extracting from archive; weak references are not enough."
+#~ msgstr ""
+#~ "Типові правила видобування з архівів; слабкого посилання недостатньо."
+
+#~ msgid "Weak references cause extraction from archive."
+#~ msgstr "Слабкі посилання спричиняють видобування з архіву."
+
+#~ msgid "Allow multiple definitions; first is used."
+#~ msgstr "Дозволити декілька визначень. Використовуватиметься лише перше."
+
+#~ msgid "Disallow/allow undefined symbols in DSOs."
+#~ msgstr "Заборонити/Дозволити невизначені символи у DSO."
+
+#~ msgid "Object requires immediate handling of $ORIGIN."
+#~ msgstr "Об’єкт вимагає негайної обробки $ORIGIN."
+
+#~ msgid "Relocation will not be processed lazily."
+#~ msgstr "Переміщення не буде оброблятися у лінивому режимі."
+
+#~ msgid "Object cannot be unloaded at runtime."
+#~ msgstr "Об’єкт не можна вивантажувати під час запуску."
+
+#~ msgid "Mark object to be initialized first."
+#~ msgstr "Позначити об’єкт, як такий, що потребує ініціалізації."
+
+#~ msgid "Enable/disable lazy-loading flag for following dependencies."
+#~ msgstr ""
+#~ "Увімкнути/Вимкнути прапорець лінивого завантаження для наведених нижче "
+#~ "залежностей."
+
+#~ msgid "Mark object as not loadable with 'dlopen'."
+#~ msgstr ""
+#~ "Позначити об’єкт, як непридатний для завантаження за допомогою «dlopen»."
+
+#~ msgid "Ignore/record dependencies on unused DSOs."
+#~ msgstr "Ігнорувати/Записувати залежності невикористаних DSO."
+
+#~ msgid "Generated DSO will be a system library."
+#~ msgstr "Створена DSO буде системною бібліотекою."
+
+#~ msgid "ADDRESS"
+#~ msgstr "АДРЕСА"
+
+#~ msgid "Set entry point address."
+#~ msgstr "Встановити адресу точки входу."
+
+#~ msgid "Do not link against shared libraries."
+#~ msgstr "Не компонувати з бібліотеками спільного використання."
+
+#~ msgid "Prefer linking against shared libraries."
+#~ msgstr ""
+#~ "Надавати перевагу компонуванню з бібліотеками спільного використання."
+
+#~ msgid "Export all dynamic symbols."
+#~ msgstr "Експортувати всі динамічні символи."
+
+#~ msgid "Strip all symbols."
+#~ msgstr "Вилучити всі символи."
+
+#~ msgid "Strip debugging symbols."
+#~ msgstr "Вилучити символи зневаджування."
+
+#~ msgid "Assume pagesize for the target system to be SIZE."
+#~ msgstr ""
+#~ "Вважати розмір сторінки для системи призначення рівним значенню РОЗМІР."
+
+#~ msgid "Set runtime DSO search path."
+#~ msgstr "Встановити шлях пошуку DSO під час запуску."
+
+#~ msgid "Set link time DSO search path."
+#~ msgstr "Встановити шлях пошуку DSO під час компонування."
+
+#~ msgid "Generate dynamic shared object."
+#~ msgstr "Створити динамічний об’єкт спільного використання."
+
+#~ msgid "Generate relocatable object."
+#~ msgstr "Створити придатний для пересування об’єкт."
+
+#~ msgid "Causes symbol not assigned to a version be reduced to local."
+#~ msgstr ""
+#~ "Спричиняє перетворення символів, не прив’язаних до версії, на локальні."
+
+#~ msgid "Remove unused sections."
+#~ msgstr "Вилучити невикористані розділи."
+
+#~ msgid "Don't remove unused sections."
+#~ msgstr "Не вилучати невикористані розділи."
+
+#~ msgid "Set soname of shared object."
+#~ msgstr "Встановити soname об’єкта спільного використання."
+
+#~ msgid "Set the dynamic linker name."
+#~ msgstr "Встановити назву динамічного компонувальника."
+
+#~ msgid "Add/suppress addition indentifying link-editor to .comment section."
+#~ msgstr ""
+#~ "Додати/Придушити додавання ідентифікації редактора компонування до "
+#~ "розділу .comment."
+
+#~ msgid "Create .eh_frame_hdr section"
+#~ msgstr "Створити розділ .eh_frame_hdr"
+
+#~ msgid "Set hash style to sysv, gnu or both."
+#~ msgstr "Встановити формат хешування у значення sysv, gnu або both."
+
+#~ msgid "Generate build ID note (md5, sha1 (default), uuid)."
+#~ msgstr ""
+#~ "Створити запису ідентифікатора збирання (md5, sha1 (типовий), uuid)."
+
+#~ msgid "Linker Operation Control:"
+#~ msgstr "Керування роботою компонувальника:"
+
+#~ msgid "Verbose messages."
+#~ msgstr "Докладні повідомлення."
+
+#~ msgid "Trace file opens."
+#~ msgstr "Спостерігати за відкриттями файлів."
+
+#~ msgid "Trade speed for less memory usage"
+#~ msgstr "Зменшити споживання пам’яті за рахунок швидкості"
+
+#~ msgid "LEVEL"
+#~ msgstr "РІВЕНЬ"
+
+#~ msgid "Set optimization level to LEVEL."
+#~ msgstr "Встановити рівень оптимізації РІВЕНЬ."
+
+#~ msgid "Use linker script in FILE."
+#~ msgstr "Використати скрипт компонування у ФАЙЛі."
+
+#~ msgid "Select to get parser debug information"
+#~ msgstr "Позначте, щоб отримати діагностичні дані обробника"
+
+#~ msgid "Read version information from FILE."
+#~ msgstr "Прочитати відомості щодо версії з ФАЙЛа."
+
+#~ msgid "Set emulation to NAME."
+#~ msgstr "Встановити режим емуляції на основі НАЗВИ."
+
+#~ msgid "Combine object and archive files."
+#~ msgstr "Комбінує об’єктні файли і файли архівів."
+
+#~ msgid "[FILE]..."
+#~ msgstr "[ФАЙЛ]..."
+
+#~ msgid "At least one input file needed"
+#~ msgstr "Потрібен принаймні один файл вхідних даних"
+
+#~ msgid "error while preparing linking"
+#~ msgstr "помилка під час приготування до компонування"
+
+#~ msgid "cannot open linker script '%s'"
+#~ msgstr "не вдалося відкрити скрипт компонування «%s»"
+
+#~ msgid "-( without matching -)"
+#~ msgstr "-( без відповідника -)"
+
+#~ msgid "only one option of -G and -r is allowed"
+#~ msgstr "можна використовувати лише один з параметрів -G або -r"
+
+#~ msgid "more than one '-m' parameter"
+#~ msgstr "декілька параметрів «-m»"
+
+#~ msgid "unknown option `-%c %s'"
+#~ msgstr "невідомий параметр «-%c %s»"
+
+#~ msgid "invalid page size value '%s': ignored"
+#~ msgstr "некоректне значення розміру сторінки «%s»: проігноровано"
+
+#~ msgid "invalid hash style '%s'"
+#~ msgstr "некоректний формат хешування «%s»"
+
+#~ msgid "invalid build-ID style '%s'"
+#~ msgstr "некоректний формат ідентифікатора збирання «%s»"
+
+#~ msgid "More than one output file name given."
+#~ msgstr "Вказано декілька назв файлів виведення даних."
+
+#~ msgid "Invalid optimization level `%s'"
+#~ msgstr "Некоректний рівень оптимізації «%s»"
+
+#~ msgid "nested -( -) groups are not allowed"
+#~ msgstr "підтримки вкладених груп -( -) не передбачено"
+
+#~ msgid "-) without matching -("
+#~ msgstr "-) без відповідника -("
+
+#~ msgid "unknown option '-%c %s'"
+#~ msgstr "невідомий параметр «-%c %s»"
+
+#~ msgid "could not find input file to determine output file format"
+#~ msgstr ""
+#~ "не вдалося виявити файл вхідних даних для визначення формату файла "
+#~ "вихідних даних"
+
+#~ msgid "try again with an appropriate '-m' parameter"
+#~ msgstr "повторіть спробу з належним параметром «-m»"
+
+#~ msgid "cannot read version script '%s'"
+#~ msgstr "не вдалося прочитати скрипт версій «%s»"
+
+#~ msgid "duplicate definition of '%s' in linker script"
+#~ msgstr "повторне визначення «%s» у скрипті компонування"
+
+#~ msgid "cannot create string table"
+#~ msgstr "не вдалося створити таблицю рядків"
+
+#~ msgid "cannot load ld backend library '%s': %s"
+#~ msgstr "не вдалося завантажити бібліотеку сервера ld «%s»: %s"
+
+#~ msgid "cannot find init function in ld backend library '%s': %s"
+#~ msgstr "не вдалося виявити функцію init у бібліотеці сервера ld «%s»: %s"
+
+#~ msgid "%s listed more than once as input"
+#~ msgstr "%s вказано декілька разів як джерело даних"
+
+#~ msgid "%s (for -l%s)\n"
+#~ msgstr "%s (для -l%s)\n"
+
+#~ msgid "%s (for DT_NEEDED %s)\n"
+#~ msgstr "%s (для DT_NEEDED %s)\n"
+
+#~ msgid "Warning: type of `%s' changed from %s in %s to %s in %s"
+#~ msgstr "Попередження: тип «%s» змінився з %s у %s на %s у %s"
+
+#~ msgid ""
+#~ "Warning: size of `%s' changed from %<PRIu64> in %s to %<PRIu64> in %s"
+#~ msgstr ""
+#~ "Попередження: розмір «%s» змінено з %<PRIu64> у %s на %<PRIu64> у %s"
+
+#~ msgid "(%s+%#<PRIx64>): multiple definition of %s `%s'\n"
+#~ msgstr "(%s+%#<PRIx64>): повторне визначення %s «%s»\n"
+
+#~ msgid "(%s+%#<PRIx64>): first defined here\n"
+#~ msgstr "(%s+%#<PRIx64>): вперше визначено тут\n"
+
+#~ msgid "%s: cannot get section group data: %s"
+#~ msgstr "%s: не вдалося отримати дані групи розділів: %s"
+
+#~ msgid "%s: section '%s' with group flag set does not belong to any group"
+#~ msgstr ""
+#~ "%s: розділ «%s» з встановленим прапорцем групи не належить жодній групі"
+
+#~ msgid "%s: section [%2d] '%s' is not in the correct section group"
+#~ msgstr "%s: розділ [%2d] «%s» не належить до відповідної групи розділів"
+
+#~ msgid "%s: invalid ELF file (%s:%d)\n"
+#~ msgstr "%s: некоректний файл ELF (%s:%d)\n"
+
+#~ msgid "%s: only files of type ET_REL might contain section groups"
+#~ msgstr "%s: групи розділів можуть містити лише файли типу ET_REL"
+
+#~ msgid "%s: cannot determine signature of section group [%2zd] '%s': %s"
+#~ msgstr "%s: не вдалося визначити підпис групи розділів [%2zd] «%s»: %s"
+
+#~ msgid "%s: cannot get content of section group [%2zd] '%s': %s'"
+#~ msgstr "%s: не вдалося отримати вміст групи розділів [%2zd] «%s»: %s'"
+
+#~ msgid ""
+#~ "%s: group member %zu of section group [%2zd] '%s' has too high index: "
+#~ "%<PRIu32>"
+#~ msgstr ""
+#~ "%s: елемент групи %zu групи розділів [%2zd] «%s» має надто високий "
+#~ "індекс: %<PRIu32>"
+
+#~ msgid "%s: section '%s' has unknown type: %d"
+#~ msgstr "%s: розділ «%s» належить до невідомого типу: %d"
+
+#~ msgid "cannot get descriptor for ELF file (%s:%d): %s\n"
+#~ msgstr "не вдалося отримати дескриптор файла ELF (%s:%d): %s\n"
+
+#~ msgid "cannot read archive `%s': %s"
+#~ msgstr "не вдалося прочитати архів «%s»: %s"
+
+#~ msgid "file of type %s cannot be linked in\n"
+#~ msgstr "файл типу %s не можна скомпонувати у\n"
+
+#~ msgid "%s: input file incompatible with ELF machine type %s\n"
+#~ msgstr "%s: файл вхідних даних несумісний з типом архітектури ELF %s\n"
+
+#~ msgid "%s: cannot get section header string table index: %s\n"
+#~ msgstr ""
+#~ "%s: не вдалося отримати покажчик таблиці рядків заголовка розділу: %s\n"
+
+#~ msgid "cannot use DSO '%s' when generating relocatable object file"
+#~ msgstr ""
+#~ "не вдалося використати DSO «%s» під час створення придатного до "
+#~ "пересування об’єктного файла"
+
+#~ msgid "input file '%s' ignored"
+#~ msgstr "файл вхідних даних «%s» проігноровано"
+
+#~ msgid "undefined symbol `%s' in %s"
+#~ msgstr "невизначений символ «%s» у %s"
+
+#~ msgid "cannot create ELF descriptor for output file: %s"
+#~ msgstr "не вдалося створити дескриптор ELF для файла вихідних даних: %s"
+
+#~ msgid "could not create ELF header for output file: %s"
+#~ msgstr "не вдалося створити заголовок ELF для файла виведених даних: %s"
+
+#~ msgid "cannot create section for output file: %s"
+#~ msgstr "не вдалося створити розділ для файла вихідних даних: %s"
+
+#~ msgid "address computation expression contains variable '%s'"
+#~ msgstr "вираз обчислення адреси містить змінну «%s»"
+
+#~ msgid ""
+#~ "argument '%<PRIuMAX>' of ALIGN in address computation expression is no "
+#~ "power of two"
+#~ msgstr ""
+#~ "значення «%<PRIuMAX>» ALIGN у виразі обчислення адреси не є степенем "
+#~ "двійки"
+
+#~ msgid "cannot find entry symbol '%s': defaulting to %#0*<PRIx64>"
+#~ msgstr ""
+#~ "не вдалося знайти символ запису «%s»: встановлено типове значення "
+#~ "%#0*<PRIx64>"
+
+#~ msgid "no entry symbol specified: defaulting to %#0*<PRIx64>"
+#~ msgstr "не вказано символу запису: встановлено типове значення %#0*<PRIx64>"
+
+#~ msgid "cannot create GNU hash table section for output file: %s"
+#~ msgstr ""
+#~ "не вдалося створити розділ таблиці хешів GNU для файла вихідних даних: %s"
+
+#~ msgid "cannot create hash table section for output file: %s"
+#~ msgstr ""
+#~ "не вдалося створити розділ таблиці хешів для файла вихідних даних: %s"
+
+#~ msgid "cannot create build ID section: %s"
+#~ msgstr "не вдалося створити розділу ідентифікатора збирання: %s"
+
+#~ msgid "cannot convert section data to file format: %s"
+#~ msgstr "не вдалося перетворити дані розділу у формат файла: %s"
+
+#~ msgid "cannot convert section data to memory format: %s"
+#~ msgstr "не вдалося перетворити дані розділу у формат вмісту пам’яті: %s"
+
+#~ msgid "cannot read enough data for UUID"
+#~ msgstr "не вдалося прочитати достатньо даних для встановлення UUID"
+
+#~ msgid "cannot create symbol table for output file: %s"
+#~ msgstr "не вдалося створити таблицю символів для файла вихідних даних: %s"
+
+#~ msgid "section index too large in dynamic symbol table"
+#~ msgstr "у таблиці динамічних символів покажчик є занадто великим"
+
+#~ msgid "cannot create versioning section: %s"
+#~ msgstr "не вдалося створити розділ версій: %s"
+
+#~ msgid "cannot create dynamic symbol table for output file: %s"
+#~ msgstr ""
+#~ "не вдалося створити динамічну таблицю символів для файла вихідних даних: "
+#~ "%s"
+
+#~ msgid "cannot create versioning data: %s"
+#~ msgstr "не вдалося створити даних версії: %s"
+
+#~ msgid "cannot create section header string section: %s"
+#~ msgstr "не вдалося створити розділ рядків заголовка розділу: %s"
+
+#~ msgid "cannot create section header string section"
+#~ msgstr "не вдалося створити розділ рядків заголовка розділу"
+
+#~ msgid "cannot create program header: %s"
+#~ msgstr "не вдалося створити заголовок програми: %s"
+
+#~ msgid "while determining file layout: %s"
+#~ msgstr "під час визначення компонування файла: %s"
+
+#~ msgid "internal error: non-nobits section follows nobits section"
+#~ msgstr ""
+#~ "внутрішня помилка: небезбітовий розділ слідом за безбітовим розділом"
+
+#~ msgid "cannot get header of 0th section: %s"
+#~ msgstr "не вдалося отримати заголовок 0-го розділу: %s"
+
+#~ msgid "linker backend didn't specify function to relocate section"
+#~ msgstr "у сервері компонування не визначено функції для розділу пересування"
+
+#~ msgid "while writing output file: %s"
+#~ msgstr "під час запису файла вихідних даних: %s"
+
+#~ msgid "while finishing output file: %s"
+#~ msgstr "під час закриття файла вихідних даних: %s"
+
+#~ msgid "cannot stat output file"
+#~ msgstr "не вдалося обробити stat файл виводу даних"
+
+#~ msgid "WARNING: temporary output file overwritten before linking finished"
+#~ msgstr ""
+#~ "ПОПЕРЕДЖЕННЯ: файл тимчасового виводу даних було перезаписано до "
+#~ "завершення компонування"
+
+#~ msgid "no machine specific '%s' implementation"
+#~ msgstr "не специфічна для архітектури реалізація «%s»"
+
+#~ msgid "mode for segment invalid\n"
+#~ msgstr "режим сегмента є некоректним\n"
+
+#~ msgid "while reading version script '%s': %s at line %d"
+#~ msgstr "під час читання скрипту версій «%s»: %s у рядку %d"
+
+#~ msgid "while reading linker script '%s': %s at line %d"
+#~ msgstr "під час читання скрипту компонування «%s»: %s у рядку %d"
+
+#~ msgid ""
+#~ "symbol '%s' is declared both local and global for unnamed version '%s'"
+#~ msgstr ""
+#~ "символ «%s» оголошено локально і на загальному рівні для версії без назви "
+#~ "«%s»"
+
+#~ msgid "symbol '%s' is declared both local and global for version '%s'"
+#~ msgstr ""
+#~ "символ «%s» оголошено локально і на загальному рівні для версії «%s»"
+
+#~ msgid "default visibility set as local and global"
+#~ msgstr "типову видимість визначено як локальну і загальну"
+
#~ msgid "cannot get section header of section %Zu: %s"
#~ msgstr "не вдалося отримати заголовок розділу %Zu: %s"
@@ -7331,9 +7561,6 @@
#~ msgid "unknown user attribute %hx"
#~ msgstr "невідомий атрибут користувача %hx"
-#~ msgid "unknown form %#<PRIx64>"
-#~ msgstr "невідома форма %#<PRIx64>"
-
#~ msgid ""
#~ "\n"
#~ "\n"
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 47515ae..0c6ec56 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -5640,7 +5640,7 @@
#: src/unstrip.c:2248
msgid ""
-"Combine stripped files with separate symbols and debug information.\vThe "
+"Combine stripped files with separate symbols and debug information.\n\nThe "
"first form puts the result in DEBUG-FILE if -o was not given.\n"
"\n"
"MODULE arguments give file name patterns matching modules to process.\n"
diff --git a/src/ChangeLog b/src/ChangeLog
index 707c271..6d962bb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,804 @@
+2018-06-25 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_decoded_line_section): Use dwarf_next_lines
+ instead of dwarf_nextcu.
+ (print_debug_line_section): Don't explicitly lookup CU.
+
+2018-06-15 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (attr_callback): Only print block as expressions if it
+ isn't DW_FORM_data16.
+
+2018-06-12 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_form_data): Check we have 4, not 2, bytes
+ available for DW_FORM_block4.
+
+2018-06-12 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_form_data): Don't increase strreadp after use.
+ Do increase readp for DW_FORM_strx[1234].
+
+2018-06-16 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_loc_section): Make sure next_off doesn't
+ overflow d_buf.
+
+2018-06-13 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (die_type_sign_bytes): New function.
+ (attr_callback): Recognized DW_FORM_implicit_cost as signed. Use
+ die_type_sign_bytes to lookup the signedness and size of const
+ values.
+
+2018-06-11 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_form_data): Don't reuse readp and readendp when
+ reading str_offsets section.
+
+2018-06-10 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_form_data): Don't cast value to ptrdiff_t, cast
+ ptrdiff_t to size_t.
+
+2018-06-08 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_rnglists_section): Calculate max_entries
+ instead of needed bytes to prevent overflowing. Always print
+ max_entries (but not more).
+ (print_debug_loclists_section): Likewise.
+
+2018-06-08 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_line_section): Stop printing directories
+ and files when we are at the end of the unit data.
+
+2018-06-07 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (format_result): Removed.
+ (format_result_size): Removed.
+ (format_dwarf_addr): Renamed to...
+ (print_dwarf_addr): ...this. Simply call printf, don't setup buffer,
+ don't call sprintf.
+ (print_ops): Use print_dwarf_addr instead of format_dwarf_addr.
+ (print_debug_addr_section): Likewise.
+ (print_debug_aranges_section): Likewise.
+ (print_debug_rnglists_section): Likewise.
+ (print_debug_ranges_section): Likewise.
+ (print_debug_frame_section): Likewise.
+ (attr_callback): Likewise.
+ (print_decoded_line_section): Likewise.
+ (print_debug_line_section): Likewise.
+ (print_debug_loclists_section): Likewise.
+ (print_debug_loc_section): Likewise.
+ (print_gdb_index_section): Likewsie.
+
+2018-06-05 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_addr_section): Set unit_length always to
+ (next_unitp - readp) in case we don't have a real header.
+
+2018-06-05 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_loc_section): Set begin to idx when failing
+ to read the start address if DW_LLE_GNU_start_end_entry.
+
+2018-06-05 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (handle_sysv_hash): Don't leak lengths array when
+ detecting an invalid chain.
+ (handle_sysv_hash64): Likewise.
+
+2018-06-05 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_macro_section): Extend vendor array by one
+ to include max DW_MACRO_hi_user opcode.
+
+2018-06-07 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (main): Lookup "no" for no_str.
+ (print_debug_abbrev_section): Use yes_str and no_str.
+ (print_form_data): Likewise.
+
+2018-06-04 Mark Wielaard <mark@klomp.org>
+
+ * readelf (format_result): New static char pointer.
+ (format_result_size): New static size_t.
+ (format_dwarf_addr): Calculate max string size, reuse format_result
+ if possible, otherwise realloc. Use sprintf on result, not asprintf.
+ (print_ops): Don't free format_dwarf_addr, make sure result is
+ printed before calling format_dwarf_addr again.
+ (print_debug_addr_section): Likewise.
+ (print_debug_aranges_section): Likewise.
+ (print_debug_rnglists_section): Likewise.
+ (print_debug_ranges_section): Likewise.
+ (print_debug_frame_section): Likewise.
+ (attr_callback): Likewise.
+ (print_decoded_line_section): Likewise.
+ (print_debug_line_section): Likewise.
+ (print_debug_loclists_section): Likewise.
+ (print_debug_loc_section): Likewise.
+ (print_gdb_index_section): Likewsie.
+
+2018-06-04 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (yes_str): New static char pointer.
+ (no_str): Likewise.
+ (main): Set yes_str and no_str using gettext.
+ (attr_callback): Use yes_str and no_str instead of calling gettext.
+
+2018-06-04 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (main): Call __fsetlocking (stdout, FSETLOCKING_BYCALLER).
+
+2018-05-31 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_units): Print the dwo name and id when
+ unable to find a .dwo file.
+
+2018-05-31 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (enum section_e): Make section_types not an alias of
+ section_info.
+ (section_all): Add section_types.
+ (parse_opt): Add both section_info and section_types for "info"
+ and "info+".
+ (print_debug_units): Don't be silent for debug_types.
+
+2018-05-31 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (attr_callback): Only register section_loc when not
+ looking at a split dwarf from a skeleton.
+
+2018-05-30 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_loc_section): Use correct listptr for
+ locview attribute.
+
+2018-05-31 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_units): Check offset against -1 not ~0ul.
+
+2018-05-29 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_loc_section): Handle GNU DebugFission list
+ entries.
+
+2018-05-29 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug): Record and reset section_info status in
+ implicit_debug_sections and print_debug_sections.
+
+2018-05-28 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_units): Turn "Could not find split compile
+ unit" into an Warning instead of an error.
+
+2018-04-29 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (parse_opt): Request implicit section_info for "str".
+ (known_stroffbases): New static variable.
+ (attr_callbackattr_callback): Handle DW_AT_str_offets_base.
+ (print_debug_str_offsets_section): New function.
+ (print_debug): Handle .debug_str_offsets as section_str. Reset
+ known_stroffbases.
+
+2018-04-27 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (options): Add addr.
+ (enum section_e): Add section_addr.
+ (section_all): Add section_addr.
+ (parse_opt): Parse "addr".
+ (known_addrbases): New static variable.
+ (get_listptr): New function.
+ (print_debug_addr_section): Likewise.
+ (attr_callback): Handle DW_AT_addr_base and DW_AT_GNU_addr_base.
+ (print_debug): Add NEW_SECTION (addr). Reset known_addrbases.
+
+2018-04-07 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (attr_callback): Handle DW_FORM_loclistx and
+ DW_AT_segment.
+
+2018-04-12 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (dwarf_loc_list_encoding_string): New functions.
+ (dwarf_loc_list_encoding_name): Likewise.
+ (known_loclistptr): Renamed and split in two...
+ (known_locsptr): this and ...
+ (known_loclistsptr): this.
+ (listptr_base): Split out...
+ (cudie_base): ...this.
+ (is_split_dwarf): New function.
+ (attr_callback): Handle DW_AT_loclists_base and notice sec_offset
+ in correct list.
+ (print_debug_rnglists_section): Use spit_dwarf_cu_base.
+ (print_debug_loclists_section): New function.
+ (print_debug_loc_section): Use known_locsptr instead of
+ known_loclistptr.
+ (print_debug): Recognize .debug_loclists. Reset known_locsptr and
+ known_loclistsptr.
+
+2018-05-25 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (DWARF_SKELETON): New constant.
+ (do_not_close_dwfl): New bool.
+ (options): Add dwarf-skeleton.
+ (dwarf_skeleton): New static variable.
+ (parse_opt): Handle DWARF_SKELETON, set dwarf_skeleton.
+ (create_dwfl): New function, with code extracted from...
+ (process_file): ...here. Check do_not_close_dwfl.
+ (is_split_darf): New function.
+ (getone_dwflmod): Likewise.
+ (print_debug): Use new functions to find skeleton DWARF file to use
+ when inspecting .dwo split DWARF file.
+
+2018-04-11 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (dwarf_range_list_encoding_string): New function.
+ (dwarf_range_list_encoding_name): Likewise.
+ (known_rnglistptr): New static variable.
+ (listptr_cu): New function.
+ (print_debug_rnglists_section): Likewise.
+ (attr_callback): Call notice_listptr for DW_AT_ranges. Handle
+ DW_AT_rnglists_base. Handle DW_FORM_rnglistx. DW_AT_start_scope
+ can also have a rnglist.
+ (print_debug_units): Do (silently) scan split DWARF also for
+ debug_ranges before DWARF5 to catch all rangelistptrs.
+ (print_debug): Recognize .debug_rnglists. Reset known_rnglistptr.
+
+2018-01-21 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (get_indexed_addr): New function.
+ (print_ops): Handle DW_OP_addrx, DW_OP_GNU_addr_index,
+ DW_OP_constx, DW_OP_GNU_const_index separately and resolve
+ address.
+ (attr_callback): Print index and address for
+ DW_FORM_GNU_addr_index and DW_FORM_addrx[1234].
+
+2018-01-19 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (options): Add info+.
+ (show_split_units): New static boolean defaulting to false.
+ (parse_opt): For all (no arg) --debug-dump set show_split_units
+ to yes. For "info+" enable section_info and show_split_units.
+ (attrcb_args): Add is_split field.
+ (attr_callback): Use is_split to format DIE offsets differently.
+ (print_debug_units): Likewise. Get subdie (type or split) only
+ when needed. When not silent reiterate over split DIEs when
+ found.
+
+2018-05-15 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_units): Print unit type and id for any
+ unit type that has it even when version < 5.
+
+2018-05-14 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_ops): Handle DW_OP_GNU_addr_index and
+ DW_OP_GNU_const_index.
+ (attr_callback): Handle DW_FORM_GNU_addr_index as DW_FORM_addrx.
+ Handle DW_FORM_GNU_str_index as DW_FORM_constx. Add as_hex_id.
+ Handle DW_AT_GNU_dwo_id as_hex_id.
+ (print_form_data): Handle DW_FORM_GNU_str_index as DW_FORM_strx.
+
+2018-05-12 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug): Also recognize .dwo section name variants.
+
+2018-05-15 Dmitry V. Levin <ldv@altlinux.org>
+
+ * elflint.c (check_elf_header): Fix typo in error diagnostics.
+
+2018-05-15 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_form_data): Cast comparisons against offset_len to
+ ptrdiff_t.
+ (print_debug_line_section): Print uint64_t as PRIu64.
+
+2018-05-11 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_macro_section): Use libdw_valid_user_form.
+ Use print_form_data for strx and sup strings.
+
+2018-05-09 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (dwarf_line_content_description_string): New function.
+ (dwarf_line_content_description_name): Likewise.
+ (print_bytes): Likewise.
+ (print_form_data): Likewise. Based on code taken from...
+ (print_debug_macro_section): ...here. Now calls print_form_data
+ and str_offsets_base_off.
+ (print_debug_line_section): Parse DWARF5 header, directory and file
+ name tables.
+
+2018-05-12 Mark Wielaard <mark@klomp.org>
+
+ * addr2line.c (main): Add fflush (stdout) after handle_address ()
+ when reading from stdin.
+
+2018-04-24 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_aranges_section): Try elf_rawdata if no
+ sectiondata.
+ (print_debug_ranges_section): Likewise.
+ (print_debug_frame_section): Likewise.
+ (print_debug_line_section): Likewise. Check for data == NULL.
+ (print_debug_loc_section): Likewise.
+ (print_debug_macinfo_section): Likewise.
+ (print_debug_macro_section): Likewise.
+
+2018-04-28 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug): If .debug_info is needed implicitly by
+ then handle it first before handling any other debug section.
+ (parse_opt): Set implicit_debug_sections to section_info when
+ showing all debug sections.
+
+2018-05-05 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (attr_callback): Handle DW_FORM_ref_sup4 and
+ DW_FORM_ref_sup8 as references.
+
+2018-04-24 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_str_section): Take raw section data. Don't
+ use dwarf_getstring, but determine start and end of string from
+ offset and section data directly.
+ (print_debug): Handle ".debug_line_str" like ".debug_str".
+
+2018-04-19 Andreas Schwab <schwab@suse.de>
+
+ * elflint.c (valid_e_machine): Add EM_RISCV.
+
+2018-04-16 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_line_section). In advance_pc, advance
+ using op_addr_advance, not op_advance.
+
+2018-04-14 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (attr_callback): Only show errors when not silent.
+
+2018-03-23 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (attr_callback): Handle DW_FORM_strx[1234].
+
+2018-03-22 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (attr_callback): Handle DW_FORM_addrx[1234].
+
+2018-03-28 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (handle_sysv_hash): Break bucket chain after nchain
+ entries are found.
+ (handle_sysv_hash64): Likewise.
+
+2018-03-27 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (attr_callback): Print dwarf_dieoffset as %PRIx64,
+ not %zx.
+
+2018-03-20 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (attr_callback): Report error when DW_AT_decl_file or
+ DW_AT_call_file cannot be resolved.
+
+2018-03-06 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_ops): Handle DW_OP_addrx, DW_OP_constx,
+ DW_OP_implicit_pointer, DW_OP_entry_value, DW_OP_const_type,
+ DW_OP_regval_type, DW_OP_deref_type, DW_OP_xderef_type,
+ DW_OP_convert, DW_OP_reinterpret.
+
+2018-03-01 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (struct listptr): Add attr field.
+ (compare_listptr): Warn when two listptrs for the same offset have
+ different attributes.
+ (notice_listptr): Take attr as argument and add it to listptr.
+ (skip_listptr_hole): New attr argument.
+ (next_listptr_offset): New function.
+ (print_debug_ranges_section): Pass NULL attr to skip_listptr_hole.
+ (attr_callback): Handle DW_AT_GNU_locviews. Call notice_listptr with
+ attr.
+ (print_debug_loc_section): Keep track of which attr is associated with
+ a listptr. If the attr is DW_AT_GNU_locview print view pairs till the
+ next listptr offset.
+
+2018-02-09 Mark Wielaard <mark@klomp.org>
+
+ * elflint.c (check_group): Make sure we can read a complete
+ element when iterating over the group.
+
+2018-02-09 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (attr_callback): Handle DW_FORM_data16 as Dwarf_Block.
+
+2018-02-09 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_abbrev_section): Print the value of a
+ DW_FORM_implicit_const using dwarf_getabbrevattr_data.
+ (attr_callback): Handle DW_FORM_implicit_const.
+
+2018-01-30 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (dwarf_unit_string): New function.
+ (dwarf_unit_name): Likewise.
+ (print_debug_units): Use dwarf_get_units and dwarf_cu_die instead
+ of dwarf_next_unit. Print unit type, id and subdie if available.
+
+2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
+
+ * addr2line.c (handle_address): Use FALLTHROUGH macro instead of
+ comment.
+ * elfcompress.c (parse_opt): Likewise.
+ * elflint.c (check_dynamic): Likewise.
+ (check_sections): Likewise.
+ (check_note_data): Likewise.
+ * objdump.c (parse_opt): Likewise.
+ * readelf.c (parse_opt): Likewise.
+ (attr_callback): Likewise.
+ (handle_auxv_note): Likewise.
+ * strings.c (parse_opt): Likewise.
+ * backtrace.c (callback_verify): Likewise.
+
+2018-01-25 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_ranges_section): Initialize cu to last_cu.
+ (print_debug_loc_section): Likewise.
+
+2018-01-01 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (attr_callback): Use dwarf_form_name for unknown forms.
+ (print_debug_macro_section): Print form using dwarf_form_name.
+
+2017-12-28 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_units): Print DIE offset in error message
+ as hex.
+
+2017-12-18 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (handle_notes_data): Don't use EXIT_FAILURE in error.
+ Adjust error message depending on whether or not we got data.
+
+2017-12-07 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_ops): Update data pointer and print arguments
+ to DW_OP_call2 and DW_OP_call4 as DIE offsets.
+
+2017-11-29 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (argp_options): Add "section-groups", 'g'.
+
+2017-11-29 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_loc_section): Print CU base and unresolved
+ addresses. Adjust formatting.
+
+2017-11-29 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_ranges_section): Print CU base and unresolved
+ addresses. Adjust formatting.
+
+2017-11-29 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (attr_callback): Set valuestr to resolved file name
+ for DW_AT_decl_file and DW_AT_call_file.
+
+2017-11-29 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_units): Print abbrev code after DIE tag.
+
+2017-11-29 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_ops): Use only2 space for index. re-indent +5
+ for DW_OP_GNU_entry_value.
+
+2017-11-21 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (attr_callback): Print attribute name and form in error
+ message. If only the value cannot be retrieved/resolved don't abort.
+
+2017-10-03 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (attr_callback): Print DIE offset in error messages.
+
+2017-11-03 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_ops): Handle DW_OP_GNU_variable_value. Print
+ referenced DIE as offset.
+
+2017-09-10 Mark Wielaard <mark@klomp.org>
+
+ * ar.c (do_oper_delete): Remove DEBUG conditional check.
+ (no0print): Return bool. Check snprintf return value.
+ (do_oper_insert): Initialize elf. Remove DEBUG conditional check.
+ Check no0print calls succeed. Explicitly elf_end found elfs.
+ (do_oper_extract): Make sure we don't create an empty variable
+ length array.
+
+2017-09-01 Mark Wielaard <mark@klomp.org>
+
+ * stack.c (main): Replace \v in doc string with \n\n.
+ * unstrip.c (main): Likewise.
+
+2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
+
+ * stack.c: Print pid_t using %lld.
+
+2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
+
+ * readelf.c: Hardcode the signal numbers for non-linux systems.
+
+2017-07-26 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_macro_section): Accept either version 4 or
+ version 5. Use DW_MACRO names instead of DW_MACRO_GNU names. Add
+ minimal support for DW_MACRO_define_sup, DW_MACRO_undef_sup,
+ DW_MACRO_import_sup, DW_MACRO_define_strx and DW_MACRO_undef_strx.
+
+2017-07-26 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (dwarf_defaulted_string): New function.
+ (dwarf_defaulted_name): Likewise.
+ (attr_callback): Use dwarf_defaulted_name to get value of
+ DW_AT_defaulted.
+
+2017-07-20 Mark Wielaard <mark@klomp.org>
+
+ * strip.c (handle_elf): Deal with data marker symbols pointing to
+ debug sections (they can be removed).
+
+2017-07-14 Mark Wielaard <mark@klomp.org>
+
+ * strip (OPT_KEEP_SECTION): New define.
+ (options): Add documentation for remove-section. Add keep-section.
+ (struct section_pattern): New data type.
+ (keep_secs, remove_secs): New globals.
+ (add_pattern, free_sec_patterns, free_patterns, section_name_matches):
+ New functions.
+ (main): Call free_patterns.
+ (parse_opt): Handle 'R' and OPT_KEEP_SECTION. Check remove_comment
+ on ARGP_KEY_SUCCESS.
+ (handle_elf): Handle and sanity check keep_secs and remove_secs.
+
+2017-06-07 Mark Wielaard <mark@klomp.org>
+
+ * strip.c (handle_elf): Introduce new handle_elf boolean. Use it to
+ determine whether to create an output and/or debug file. Remove new
+ output file on error.
+
+2017-06-06 Mark Wielaard <mark@klomp.org>
+
+ * strip.c (handle_elf): Assume e_shstrndx section can be removed.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * readelf.c: Include strings.h.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * unstrip.c: Check shnum for 0 before subtracting from it.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * readelf.c: Replace YESSTR and NOSTR with gettext ("yes") and
+ gettext ("no"), respectively.
+
+2017-04-05 Mark Wielaard <mark@klomp.org>
+
+ * elflint.c (check_elf_header): Decompress all sections.
+
+2017-03-28 Mark Wielaard <mark@klomp.org>
+
+ * elflint (check_group): Don't check if there is no flag word.
+
+2017-03-27 Mark Wielaard <mark@klomp.org>
+
+ * elflint.c (check_elf_header): Sanity check phnum and shnum.
+
+2017-03-27 Mark Wielaard <mark@klomp.org>
+
+ * elflint.c (check_sysv_hash): Return early if section size is
+ too small.
+ (check_sysv_hash64): Likewise.
+ (check_hash): Calculate expect_entsize to check section size.
+
+2017-03-27 Mark Wielaard <mark@klomp.org>
+
+ * elflint.c (check_symtab_shndx): Check data->d_size.
+
+2017-03-24 Mark Wielaard <mjw@redhat.com>
+
+ * elfcmp.c (main): If n_namesz == 0 then the note name data is the
+ empty string.
+ * readelf.c (handle_notes_data): Likewise.
+
+2017-03-24 Mark Wielaard <mjw@redhat.com>
+
+ * readelf.c (handle_gnu_hash): Check inner < max_nsyms before
+ indexing into chain array.
+
+2017-02-16 Ulf Hermann <ulf.hermann@qt.io>
+
+ * addr2line.c: Include printversion.h
+ * ar.c: Likewise.
+ * elflint.c: Likewise.
+ * nm.c: Likewise.
+ * objdump.c: Likewise.
+ * ranlib.c: Likewise.
+ * readelf.c: Likewise.
+ * size.c: Likewise.
+ * stack.c: Likewise.
+ * strings.c: Likewise.
+ * strip.c: Likewise.
+ * elfcmp.c: Include printversion.h, remove system.h include.
+ * elfcompress.c: Likewise.
+ * findtextrel.c: Likewise.
+ * unstrip.c: Likewise.
+
+2017-02-14 Ulf Hermann <ulf.hermann@qt.io>
+
+ * nm.c: Include color.h.
+ * objdump.c: Likewise.
+
+2016-12-24 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (findtextrel_LDADD): Add $(libeu).
+ (addr2line_LDADD): Likewise.
+ (elfcmp_LDADD): Likewise.
+ * addr2line.c (print_version): Removed.
+ * ar.c (print_version): Likewise.
+ * elfcmp.c (print_version): Likewise.
+ * elfcompress.c (print_version): Likewise.
+ * elflint.c (print_version): Likewise.
+ * findtextrel.c (print_version): Likewise.
+ * nm.c (print_version): Likewise.
+ * objdump.c: Likewise.
+ * ranlib.c: Likewise.
+ * readelf.c: Likewise.
+ * size.c: Likewise.
+ * stack.c: Likewise.
+ * strings.c: Likewise.
+ * strip.c: Likewise.
+ * unstrip.c: Likewise.
+
+2016-11-17 Mark Wielaard <mjw@redhat.com>
+
+ * readelf.c (options): Add optional arg SECTION for symbols.
+ (symbol_table_section): New static variable.
+ (parse_opt): Set symbol_table_section on 's'.
+ (print_symtab): Filter on symbol_table_section name is set.
+
+2016-11-10 Mark Wielaard <mjw@redhat.com>
+
+ * ar.c (write_member): Make sure tmpbuf is large enough to contain
+ a starting '/' and ending '\0' char.
+ (do_oper_insert): Likewise.
+ * arlib.c (arlib_finalize): Format tmpbuf as PRId32 decimal.
+
+2016-11-02 Mark Wielaard <mjw@redhat.com>
+
+ * addr2line.c (handle_address): Add fallthrough comment.
+ * elfcompress.c (parse_opt): Adjust fallthrough comment.
+ * elflint.c (parse_opt): Add missing break after 'd' case.
+ (check_sections): Add fallthrough comments.
+ * objdump.c (parse_opt): Add explantion for fallthrough comment.
+
+2016-10-22 Kevin Cernekee <cernekee@chromium.org>
+
+ * unstrip.c: Fix "invalid string offset" error caused by using the
+ unstripped .symtab with the stripped .strtab.
+
+2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+
+ * arlib.c: Remove system.h include, add libeu.h include.
+ * arlib2.c: Remove sys/param.h include.
+ * elfcompress.c: Add libeu.h include.
+ * elflint.c: Remove sys/param.h include, add libeu.h include.
+ * nm.c: Likewise.
+ * objdump.c: Likewise.
+ * ranlib.c: Likewise.
+ * readelf.c: Likewise.
+ * size.c: Remove sys/param.h include.
+ * strings.c: Likewise, add libeu.h include.
+ * strip.c: Likewise.
+ * unstrip.c: Likewise.
+
+2016-10-06 Mark Wielaard <mjw@redhat.com>
+
+ * strip.c (handle_elf): Don't remove real symbols from allocated
+ symbol tables.
+
+2016-08-25 Mark Wielaard <mjw@redhat.com>
+
+ * strip.c (handle_elf): Recompress with ELF_CHF_FORCE.
+
+2016-08-06 Mark Wielaard <mjw@redhat.com>
+
+ * strip.c (handle_elf): Uncompress and recompress relocation target
+ section if necessary.
+
+2016-07-08 Mark Wielaard <mjw@redhat.com>
+
+ * Makefile.am (strip_LDADD): Add libdw.
+ * elfcompress.c (process_file): Use dwelf_strtab functions instead of
+ ebl_strtab.
+ * strip.c (handle_elf): Likewise.
+ * unstrip.c (new_shstrtab): Likewise.
+
+2016-07-06 Mark Wielaard <mjw@redhat.com>
+
+ * elf32-i386.script, i386_ld.c, ld.c, ld.h, ldgeneric.c, ldlex.l,
+ ldscript.y, libld_elf_i386.map, none_ld.c, sectionhash.c,
+ sectionhash.h, symbolhash.c, symbolhash.h, unaligned.h,
+ versionhash.c, versionhash.h, xelf.h: Removed.
+ * Makefile.am (YACC): Removed.
+ (AM_YFLAGS): Removed.
+ (AM_LFLAGS): Removed.
+ (native_ld): Removed.
+ (base_cpu): Removed.
+ (bin_PROGRAMS): Removed ld.
+ (ld_dsos): Removed.
+ (ld_SOURCES): Removed.
+ (noinst_LIBRARIES): Only libar.a.
+ (EXTRA_DIST): Just arlib.h and debugpred.h.
+ (ld_LDADD): Removed.
+ (ld_LDFLAGS): Removed.
+ (ldlex.o): Removed.
+ (ldscript.h): Removed.
+ (libld*): Removed.
+ (CLEANFILES): Just *.gconv.
+ (MAINTAINERCLEANFILES): Removed.
+
+2016-07-06 Mark Wielaard <mjw@redhat.com>
+
+ * unstrip.c (copy_elided_sections): Use unstripped_strent[] from
+ index zero, instead of one.
+
+2016-06-28 Richard Henderson <rth@redhat.com>
+
+ * elflint.c (valid_e_machine): Add EM_BPF.
+
+2016-04-11 David Abdurachmanov <davidlt@cern.ch>
+
+ * elfcmp.c (main): Fix self-comparison error with GCC 6.
+
+2016-03-21 Mark Wielaard <mjw@redhat.com>
+
+ * nm.c (show_symbols): Check for malloc size argument overflow.
+
+2016-02-13 Mark Wielaard <mjw@redhat.com>
+
+ * readelf.c (print_scngrp): Call error when gelf_getshdr fails.
+ (print_symtab): Likewise.
+ (handle_hash): Likewise.
+ (dump_data_section): Print a warning if decompressing fails.
+ (print_string_section): Likewise.
+
+2016-02-13 Mark Wielaard <mjw@redhat.com>
+
+ * elfcompress.c (parse_opt): Don't fallthrough after processing -q.
+
+2016-02-12 Mark Wielaard <mjw@redhat.com>
+
+ * strip.c (handle_elf): Correct elf_assert shndxdata check.
+
+2016-02-09 Mark Wielaard <mjw@redhat.com>
+
+ * readelf.c (read_encoded): Move up.
+ (print_cfa_program): Add encoding argument. Use it for read_encoded
+ when reading DW_CFA_set_loc op.
+ (print_debug_frame_section): Pass fde_encoding to print_cfa_program.
+
+2016-02-09 Mark Wielaard <mjw@redhat.com>
+
+ * elflint.c (compare_hash_gnu_hash): Check hash sh_entsize against
+ sizeof (Elf64_Xword). Correct invalid sh_entsize error message
+ section idx and name.
+
2016-01-13 Mark Wielaard <mjw@redhat.com>
* elflint.c (check_elf_header): Recognize ELFOSABI_FREEBSD.
diff --git a/src/Makefile.am b/src/Makefile.am
index a39df27..2b1c0dc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to create Makefile.in
##
-## Copyright (C) 1996-2014 Red Hat, Inc.
+## Copyright (C) 1996-2014, 2016 Red Hat, Inc.
## This file is part of elfutils.
##
## This file is free software; you can redistribute it and/or modify
@@ -25,46 +25,14 @@
AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw
-YACC = @YACC@ -d
-AM_YFLAGS = -pld
-AM_LFLAGS = -Pld -olex.yy.c
-## Uncomment to enable debugging of linker script parser
-##YYDEBUG = -DYYDEBUG=1
-
-native_ld = @native_ld@
-base_cpu = @base_cpu@
-
-bin_PROGRAMS = readelf nm size strip ld elflint findtextrel addr2line \
+bin_PROGRAMS = readelf nm size strip elflint findtextrel addr2line \
elfcmp objdump ranlib strings ar unstrip stack elfcompress
-
-ld_dsos = libld_elf_i386_pic.a
-if NATIVE_LD
-noinst_LIBRARIES = libld_elf.a libar.a
-native_ld_cflags = -DBASE_ELF_NAME=elf_$(base_cpu)
-else
-noinst_LIBRARIES = libld_elf.a libar.a $(ld_dsos)
-noinst_PROGRAMS = $(ld_dsos:_pic.a=.so)
-endif
-if NEVER
-# We never build this library but we need to get the dependency files
-# of all the linker backends that might be used in a non-generic linker.
-noinst_LIBRARIES += libdummy.a
-libdummy_a_SOURCES = i386_ld.c
-endif
-
-
-ld_SOURCES = ld.c ldgeneric.c ldlex.l ldscript.y symbolhash.c sectionhash.c \
- versionhash.c
+noinst_LIBRARIES = libar.a
libar_a_SOURCES = arlib.c arlib2.c arlib-argp.c
-noinst_HEADERS = ld.h symbolhash.h sectionhash.h versionhash.h \
- ldscript.h xelf.h unaligned.h
-
-EXTRA_DIST = elf32-i386.script libld_elf_i386.map $(ld_modules) arlib.h \
- debugpred.h
-ld_modules = i386_ld.c
+EXTRA_DIST = arlib.h debugpred.h
bin_SCRIPTS = make-debug-archive
EXTRA_DIST += make-debug-archive.in
@@ -86,11 +54,6 @@
demanglelib = -lstdc++
endif
-# XXX While the file is not finished, don't warn about this
-ldgeneric_no_Wunused = yes
-ldgeneric_no_Wstack_usage = yes
-ldlex_no_Wstack_usage = yes
-
# Bad, bad stack usage...
readelf_no_Wstack_usage = yes
nm_no_Wstack_usage = yes
@@ -108,17 +71,11 @@
nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl \
$(demanglelib)
size_LDADD = $(libelf) $(libeu) $(argp_LDADD)
-strip_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
-ld_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
-if NATIVE_LD
-# -ldl is always needed for libebl.
-ld_LDADD += libld_elf.a
-endif
-ld_LDFLAGS = -rdynamic
+strip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) -ldl
elflint_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
-findtextrel_LDADD = $(libdw) $(libelf) $(argp_LDADD)
-addr2line_LDADD = $(libdw) $(libelf) $(argp_LDADD) $(demanglelib)
-elfcmp_LDADD = $(libebl) $(libelf) $(argp_LDADD) -ldl
+findtextrel_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD)
+addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(demanglelib)
+elfcmp_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
objdump_LDADD = $(libasm) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD)
strings_LDADD = $(libelf) $(libeu) $(argp_LDADD)
@@ -127,31 +84,6 @@
stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) -ldl $(demanglelib)
elfcompress_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
-ldlex.o: ldscript.c
-ldlex_no_Werror = yes
-ldscript.h: ldscript.c
-
-if NATIVE_LD
-# Machine-specific linker code.
-libld_elf_a_SOURCES := $(base_cpu)_ld.c
-else
-libld_elf_i386_pic_a_SOURCES =
-am_libld_elf_i386_pic_a_OBJECTS = i386_ld.os
-
-libld_elf_i386_so_SOURCES =
-libld_elf_i386.so: libld_elf_i386_pic.a libld_elf_i386.map
- $(AM_V_CCLD)$(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
- $(libelf) $(libeu) \
- -Wl,--version-script,$(srcdir)/libld_elf_i386.map
- @$(textrel_check)
-endif
-
-# Special rule to make it possible to define libld_elf_a_SOURCES as we do.
-# Otherwise make would complain.
-.deps/none_ld.Po: none_ld.os
- @-:
-
-
installcheck-binPROGRAMS: $(bin_PROGRAMS)
bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \
case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
@@ -168,10 +100,7 @@
done; \
done; rm -f c$${pid}_.???; exit $$bad
-CLEANFILES += none_ld.os $(ld_modules:.c=.os) *.gconv
-
-MAINTAINERCLEANFILES = ldlex.c ldscript.c ldscript.h
-
+CLEANFILES += *.gconv
make-debug-archive: $(srcdir)/make-debug-archive.in
$(AM_V_GEN)UNSTRIP=$(bindir)/`echo unstrip | sed '$(transform)'`; \
diff --git a/src/addr2line.c b/src/addr2line.c
index 0ce854f..5acafa0 100644
--- a/src/addr2line.c
+++ b/src/addr2line.c
@@ -38,10 +38,10 @@
#include <unistd.h>
#include <system.h>
+#include <printversion.h>
/* Name and version of program. */
-static void print_version (FILE *stream, struct argp_state *state);
ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
@@ -187,6 +187,7 @@
buf[chars - 1] = '\0';
result = handle_address (buf, dwfl);
+ fflush (stdout);
}
free (buf);
@@ -208,20 +209,6 @@
}
-/* Print the version information. */
-static void
-print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
-{
- fprintf (stream, "addr2line (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
- fprintf (stream, gettext ("\
-Copyright (C) %s Red Hat, Inc.\n\
-This is free software; see the source for copying conditions. There is NO\n\
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2012");
- fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
-}
-
-
/* Handle program arguments. */
static error_t
parse_opt (int key, char *arg, struct argp_state *state)
@@ -632,6 +619,7 @@
case 1:
addr = 0;
j = i;
+ FALLTHROUGH;
case 2:
if (string[j] != '\0')
break;
diff --git a/src/ar.c b/src/ar.c
index 1320d07..818115b 100644
--- a/src/ar.c
+++ b/src/ar.c
@@ -1,5 +1,5 @@
/* Create, modify, and extract from archives.
- Copyright (C) 2005-2012 Red Hat, Inc.
+ Copyright (C) 2005-2012, 2016, 2017 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2005.
@@ -41,12 +41,12 @@
#include <sys/time.h>
#include <system.h>
+#include <printversion.h>
#include "arlib.h"
/* Name and version of program. */
-static void print_version (FILE *stream, struct argp_state *state);
ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Prototypes for local functions. */
@@ -277,20 +277,6 @@
}
-/* Print the version information. */
-static void
-print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
-{
- fprintf (stream, "ar (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
- fprintf (stream, gettext ("\
-Copyright (C) %s Red Hat, Inc.\n\
-This is free software; see the source for copying conditions. There is NO\n\
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2012");
- fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
-}
-
-
/* Handle program arguments. */
static error_t
parse_opt (int key, char *arg __attribute__ ((unused)),
@@ -456,7 +442,7 @@
do_oper_extract (int oper, const char *arfname, char **argv, int argc,
long int instance)
{
- bool found[argc];
+ bool found[argc > 0 ? argc : 1];
memset (found, '\0', sizeof (found));
size_t name_max = 0;
@@ -853,7 +839,10 @@
off_t end_off, int newfd)
{
struct ar_hdr arhdr;
- char tmpbuf[sizeof (arhdr.ar_name) + 1];
+ /* The ar_name is not actually zero teminated, but we need that for
+ snprintf. Also if the name is too long, then the string starts
+ with '/' plus an index off number (decimal). */
+ char tmpbuf[sizeof (arhdr.ar_name) + 2];
bool changed_header = memb->long_name_off != -1;
if (changed_header)
@@ -1067,13 +1056,11 @@
goto nonew_unlink;
errout:
-#ifdef DEBUG
elf_end (elf);
arlib_fini ();
close (fd);
-#endif
not_found (argc, argv, found);
@@ -1081,12 +1068,18 @@
}
-static void
+/* Prints the given value in the given buffer without a trailing zero char.
+ Returns false if the given value doesn't fit in the given buffer. */
+static bool
no0print (bool ofmt, char *buf, int bufsize, long int val)
{
char tmpbuf[bufsize + 1];
- snprintf (tmpbuf, sizeof (tmpbuf), ofmt ? "%-*lo" : "%-*ld", bufsize, val);
+ int ret = snprintf (tmpbuf, sizeof (tmpbuf), ofmt ? "%-*lo" : "%-*ld",
+ bufsize, val);
+ if (ret >= (int) sizeof (tmpbuf))
+ return false;
memcpy (buf, tmpbuf, bufsize);
+ return true;
}
@@ -1095,7 +1088,7 @@
const char *member)
{
int status = 0;
- Elf *elf;
+ Elf *elf = NULL;
struct stat st;
int fd = open_archive (arfname, O_RDONLY, 0, &elf, &st, oper != oper_move);
@@ -1314,13 +1307,11 @@
if (status != 0)
{
-#ifdef DEBUG
elf_end (elf);
arlib_fini ();
close (fd);
-#endif
return status;
}
@@ -1455,7 +1446,11 @@
/* Create the header. */
struct ar_hdr arhdr;
- char tmpbuf[sizeof (arhdr.ar_name) + 1];
+ /* The ar_name is not actually zero teminated, but we
+ need that for snprintf. Also if the name is too
+ long, then the string starts with '/' plus an index
+ off number (decimal). */
+ char tmpbuf[sizeof (arhdr.ar_name) + 2];
if (all->long_name_off == -1)
{
size_t namelen = strlen (all->name);
@@ -1465,19 +1460,41 @@
}
else
{
- snprintf (tmpbuf, sizeof (arhdr.ar_name) + 1, "/%-*ld",
+ snprintf (tmpbuf, sizeof (tmpbuf), "/%-*ld",
(int) sizeof (arhdr.ar_name), all->long_name_off);
memcpy (arhdr.ar_name, tmpbuf, sizeof (arhdr.ar_name));
}
- no0print (false, arhdr.ar_date, sizeof (arhdr.ar_date),
- all->sec);
- no0print (false, arhdr.ar_uid, sizeof (arhdr.ar_uid), all->uid);
- no0print (false, arhdr.ar_gid, sizeof (arhdr.ar_gid), all->gid);
- no0print (true, arhdr.ar_mode, sizeof (arhdr.ar_mode),
- all->mode);
- no0print (false, arhdr.ar_size, sizeof (arhdr.ar_size),
- all->size);
+ if (! no0print (false, arhdr.ar_date, sizeof (arhdr.ar_date),
+ all->sec))
+ {
+ error (0, errno, gettext ("cannot represent ar_date"));
+ goto nonew_unlink;
+ }
+ if (! no0print (false, arhdr.ar_uid, sizeof (arhdr.ar_uid),
+ all->uid))
+ {
+ error (0, errno, gettext ("cannot represent ar_uid"));
+ goto nonew_unlink;
+ }
+ if (! no0print (false, arhdr.ar_gid, sizeof (arhdr.ar_gid),
+ all->gid))
+ {
+ error (0, errno, gettext ("cannot represent ar_gid"));
+ goto nonew_unlink;
+ }
+ if (! no0print (true, arhdr.ar_mode, sizeof (arhdr.ar_mode),
+ all->mode))
+ {
+ error (0, errno, gettext ("cannot represent ar_mode"));
+ goto nonew_unlink;
+ }
+ if (! no0print (false, arhdr.ar_size, sizeof (arhdr.ar_size),
+ all->size))
+ {
+ error (0, errno, gettext ("cannot represent ar_size"));
+ goto nonew_unlink;
+ }
memcpy (arhdr.ar_fmag, ARFMAG, sizeof (arhdr.ar_fmag));
if (unlikely (write_retry (newfd, &arhdr, sizeof (arhdr))
@@ -1521,13 +1538,15 @@
goto nonew_unlink;
errout:
-#ifdef DEBUG
+ for (int cnt = 0; cnt < argc; ++cnt)
+ elf_end (found[cnt]->elf);
+
elf_end (elf);
arlib_fini ();
- close (fd);
-#endif
+ if (fd != -1)
+ close (fd);
return status;
}
diff --git a/src/arlib.c b/src/arlib.c
index 43a9145..e0839aa 100644
--- a/src/arlib.c
+++ b/src/arlib.c
@@ -1,5 +1,5 @@
/* Functions to handle creation of Linux archives.
- Copyright (C) 2007-2012 Red Hat, Inc.
+ Copyright (C) 2007-2012, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2007.
@@ -23,12 +23,13 @@
#include <assert.h>
#include <error.h>
#include <gelf.h>
+#include <inttypes.h>
#include <libintl.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
-#include <system.h>
+#include <libeu.h>
#include "arlib.h"
@@ -107,6 +108,9 @@
void
arlib_finalize (void)
{
+ /* Note that the size is stored as decimal string in 10 chars,
+ without zero terminator (we add + 1 here only so snprintf can
+ put it at the end, we then don't use it when we memcpy it). */
char tmpbuf[sizeof (((struct ar_hdr *) NULL)->ar_size) + 1];
symtab.longnameslen = obstack_object_size (&symtab.longnamesob);
@@ -121,9 +125,9 @@
symtab.longnames = obstack_finish (&symtab.longnamesob);
- int s = snprintf (tmpbuf, sizeof (tmpbuf), "%-*zu",
+ int s = snprintf (tmpbuf, sizeof (tmpbuf), "%-*" PRIu32 "",
(int) sizeof (((struct ar_hdr *) NULL)->ar_size),
- symtab.longnameslen - sizeof (struct ar_hdr));
+ (uint32_t) (symtab.longnameslen - sizeof (struct ar_hdr)));
memcpy (&((struct ar_hdr *) symtab.longnames)->ar_size, tmpbuf, s);
}
@@ -169,10 +173,10 @@
/* See comment for ar_date above. */
memcpy (&((struct ar_hdr *) symtab.symsoff)->ar_size, tmpbuf,
- snprintf (tmpbuf, sizeof (tmpbuf), "%-*zu",
+ snprintf (tmpbuf, sizeof (tmpbuf), "%-*" PRIu32 "",
(int) sizeof (((struct ar_hdr *) NULL)->ar_size),
- symtab.symsofflen + symtab.symsnamelen
- - sizeof (struct ar_hdr)));
+ (uint32_t) (symtab.symsofflen + symtab.symsnamelen
+ - sizeof (struct ar_hdr))));
}
diff --git a/src/arlib2.c b/src/arlib2.c
index 7998fc6..553fc57 100644
--- a/src/arlib2.c
+++ b/src/arlib2.c
@@ -24,7 +24,6 @@
#include <libintl.h>
#include <limits.h>
#include <string.h>
-#include <sys/param.h>
#include "arlib.h"
diff --git a/src/elf32-i386.script b/src/elf32-i386.script
deleted file mode 100644
index 2083278..0000000
--- a/src/elf32-i386.script
+++ /dev/null
@@ -1,229 +0,0 @@
-ENTRY(_start);
-
-SEARCH_DIR(/lib);
-SEARCH_DIR(/usr/lib);
-SEARCH_DIR(/usr/local/lib);
-SEARCH_DIR(/usr/i686-pc-linux-gnu/lib);
-
-INTERP(/lib/ld-linux.so.2);
-
-PAGESIZE(4k);
-
-SEGMENT [RX]
-{
-#ifdef SHARED
- . = SIZEOF_HEADERS;
-#else
- . = 0x08048000 + SIZEOF_HEADERS;
-#endif
-
- .interp;
- .note.ABI-tag;
- .note.gnu.build-id;
- .hash;
- .gnu.hash;
- .dynsym;
- .dynstr;
- .gnu.version;
- .gnu.version_d;
- .gnu.version_r;
- .rel.dyn;
- .rel.plt;
- .init { KEEP (*(.init)) }
- .plt;
- .text
- {
- *(.text)
- *(.text.*)
- *(.stub)
- *(.gnu.warning)
- *(.gnu.linkonce.t.*)
- }
- .fini { KEEP (*(.fini)) }
- PROVIDE (__etext = .);
- PROVIDE (_etext = .);
- PROVIDE (etext = .);
- .rodata
- {
- *(.rodata)
- *(.rodata.*)
- *(.gnu.linkonce.r.*)
- }
- .rodata1;
- .eh_frame_hdr;
- . = ALIGN(32 / 8);
- PROVIDE (__preinit_array_start = .);
- .preinit_array
- {
- *(.preinit_array)
- }
- PROVIDE (__preinit_array_end = .);
- PROVIDE (__init_array_start = .);
- .init_array
- {
- *(.init_array)
- }
- PROVIDE (__init_array_end = .);
- PROVIDE (__fini_array_start = .);
- .fini_array
- {
- *(.fini_array)
- }
- PROVIDE (__fini_array_end = .);
-}
-
-SEGMENT [RW]
-{
- .sdata2
- {
- *(.sdata2)
- *(.sdata2.*)
- *(.gnu.linkonce.s2.*)
- }
- .sbss2
- {
- *(.sbss2)
- *(.sbss2.*)
- *(.gnu.linkonce.sb2.*)
- }
- /* Adjust the address for the data segment. We want to adjust up to
- the same address within the page on the next page up. */
- . = ALIGN(PAGESIZE) + (. & (PAGESIZE - 1));
- .eh_frame
- {
- KEEP (*(.eh_frame))
- }
- .gcc_except_table;
- .tdata
- {
- *(.tdata)
- *(.tdata.*)
- *(.gnu.linkone.td.*)
- }
- .tbss
- {
- *(.tbss)
- *(.tbss.*)
- *(.gnu.linkone.tb.*)
- *(.tcommon)
- }
- .ctors
- {
- /* gcc uses crtbegin.o to find the start of
- the constructors, so we make sure it is
- first. Because this is a wildcard, it
- doesn't matter if the user does not
- actually link against crtbegin.o; the
- linker won't look for a file to match a
- wildcard. The wildcard also means that it
- doesn't matter which directory crtbegin.o
- is in. */
- KEEP (*crtbegin.o(.ctors))
- /* We don't want to include the .ctor section from
- the crtend.o file until after the sorted ctors.
- The .ctor section from the crtend file contains the
- end of ctors marker and it must be last */
- KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*(.ctors))
- }
- .dtors
- {
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*(.dtors))
- }
- .jcr;
- .dynamic;
- .got;
- .got.plt;
- .data
- {
- *(.data)
- *(.data.*)
- *(.gnu.linkonce.d.*)
- }
- /* We want the small data sections together, so single-instruction offsets
- can access them all, and initialized data all before uninitialized, so
- we can shorten the on-disk segment size. */
- .data1;
- .sdata
- {
- *(.sdata)
- *(.sdata.*)
- *(.gnu.linkonce.s.*)
- }
- _edata = .;
- PROVIDE (edata = .);
- __bss_start = .;
- .sbss
- {
- PROVIDE (__sbss_start = .);
- PROVIDE (___sbss_start = .);
- *(.dynsbss)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.sb.*)
- *(.scommon)
- PROVIDE (__sbss_end = .);
- PROVIDE (___sbss_end = .);
- }
- .bss
- {
- *(.dynbss)
- *(.bss)
- *(.bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- /* Align here to ensure that the .bss section occupies space up to
- _end. Align after .bss to ensure correct alignment even if the
- .bss section disappears because there are no input sections. */
- . = ALIGN(32 / 8);
- }
- . = ALIGN(32 / 8);
- _end = .;
- PROVIDE (end = .);
-}
-
-SEGMENT []
-{
- /* Stabs debugging sections. */
- .stab;
- .stabstr;
- .stab.excl;
- .stab.exclstr;
- .stab.index;
- .stab.indexstr;
- .comment;
- /* DWARF debug sections.
- Symbols in the DWARF debugging sections are relative to the beginning
- of the section so we begin them at 0. */
- /* DWARF 1 */
- .debug;
- .line;
- /* GNU DWARF 1 extensions */
- .debug_srcinfo;
- .debug_sfnames;
- /* DWARF 1.1 and DWARF 2 */
- .debug_aranges;
- .debug_pubnames;
- /* DWARF 2 */
- .debug_info
- {
- *(.debug_info)
- *(.gnu.linkonce.wi.*)
- }
- .debug_abbrev;
- .debug_line;
- .debug_frame;
- .debug_str;
- .debug_loc;
- .debug_macinfo;
- /* SGI/MIPS DWARF 2 extensions */
- .debug_weaknames;
- .debug_funcnames;
- .debug_typenames;
- .debug_varnames;
- /* These must appear regardless of . */
-}
diff --git a/src/elfcmp.c b/src/elfcmp.c
index 852b92f..5046420 100644
--- a/src/elfcmp.c
+++ b/src/elfcmp.c
@@ -33,7 +33,7 @@
#include <string.h>
#include <unistd.h>
-#include <system.h>
+#include <printversion.h>
#include "../libelf/elf-knowledge.h"
#include "../libebl/libeblP.h"
@@ -45,7 +45,6 @@
/* Name and version of program. */
-static void print_version (FILE *stream, struct argp_state *state);
ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
@@ -368,7 +367,7 @@
&& sym1->st_shndx != SHN_UNDEF)
|| sym1->st_info != sym2->st_info
|| sym1->st_other != sym2->st_other
- || sym1->st_shndx != sym1->st_shndx))
+ || sym1->st_shndx != sym2->st_shndx))
{
// XXX Do we want to allow reordered symbol tables?
symtab_mismatch:
@@ -420,7 +419,8 @@
&& (off1 = gelf_getnote (data1, off1, ¬e1,
&name_offset, &desc_offset)) > 0)
{
- const char *name1 = data1->d_buf + name_offset;
+ const char *name1 = (note1.n_namesz == 0
+ ? "" : data1->d_buf + name_offset);
const void *desc1 = data1->d_buf + desc_offset;
if (off2 >= data2->d_size)
{
@@ -436,7 +436,8 @@
error (2, 0, gettext ("\
cannot read note section [%zu] '%s' in '%s': %s"),
elf_ndxscn (scn2), sname2, fname2, elf_errmsg (-1));
- const char *name2 = data2->d_buf + name_offset;
+ const char *name2 = (note2.n_namesz == 0
+ ? "" : data2->d_buf + name_offset);
const void *desc2 = data2->d_buf + desc_offset;
if (note1.n_namesz != note2.n_namesz
@@ -664,20 +665,6 @@
}
-/* Print the version information. */
-static void
-print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
-{
- fprintf (stream, "elfcmp (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
- fprintf (stream, gettext ("\
-Copyright (C) %s Red Hat, Inc.\n\
-This is free software; see the source for copying conditions. There is NO\n\
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2012");
- fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
-}
-
-
/* Handle program arguments. */
static error_t
parse_opt (int key, char *arg,
diff --git a/src/elfcompress.c b/src/elfcompress.c
index 23939db..25378a4 100644
--- a/src/elfcompress.c
+++ b/src/elfcompress.c
@@ -1,5 +1,5 @@
/* Compress or decompress an ELF file.
- Copyright (C) 2015 Red Hat, Inc.
+ Copyright (C) 2015, 2016 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -32,11 +32,12 @@
#include <unistd.h>
#include ELFUTILS_HEADER(elf)
#include ELFUTILS_HEADER(ebl)
+#include ELFUTILS_HEADER(dwelf)
#include <gelf.h>
-#include "system.h"
+#include "libeu.h"
+#include "printversion.h"
/* Name and version of program. */
-static void print_version (FILE *stream, struct argp_state *state);
ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
@@ -53,12 +54,6 @@
#define T_COMPRESS_GNU 3 /* zlib-gnu */
static int type = T_UNSET;
-static void
-print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
-{
- fprintf (stream, "elfcompress (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
-}
-
struct section_pattern
{
char *pattern;
@@ -101,6 +96,7 @@
case 'q':
verbose--;
+ break;
case 'f':
force = true;
@@ -152,7 +148,8 @@
argp_error (state,
N_("Only one input file allowed together with '-o'"));
/* We only use this for checking the number of arguments, we don't
- actually want to consume them, so fallthrough. */
+ actually want to consume them. */
+ FALLTHROUGH;
default:
return ARGP_ERR_UNKNOWN;
}
@@ -264,9 +261,9 @@
char *snamebuf = NULL;
/* String table (and symbol table), if section names need adjusting. */
- struct Ebl_Strtab *names = NULL;
- struct Ebl_Strent **scnstrents = NULL;
- struct Ebl_Strent **symstrents = NULL;
+ Dwelf_Strtab *names = NULL;
+ Dwelf_Strent **scnstrents = NULL;
+ Dwelf_Strent **symstrents = NULL;
char **scnnames = NULL;
/* Section data from names. */
@@ -307,7 +304,7 @@
free (snamebuf);
if (names != NULL)
{
- ebl_strtabfree (names);
+ dwelf_strtab_free (names);
free (scnstrents);
free (symstrents);
free (namesbuf);
@@ -523,14 +520,14 @@
if (adjust_names)
{
- names = ebl_strtabinit (true);
+ names = dwelf_strtab_init (true);
if (names == NULL)
{
error (0, 0, "Not enough memory for new strtab");
return cleanup (-1);
}
scnstrents = xmalloc (shnum
- * sizeof (struct Ebl_Strent *));
+ * sizeof (Dwelf_Strent *));
scnnames = xcalloc (shnum, sizeof (char *));
}
@@ -869,7 +866,7 @@
/* We need to keep a copy of the name till the strtab is done. */
name = scnnames[ndx] = xstrdup (name);
- if ((scnstrents[ndx] = ebl_strtabadd (names, name, 0)) == NULL)
+ if ((scnstrents[ndx] = dwelf_strtab_add (names, name)) == NULL)
{
error (0, 0, "No memory to add section name string table");
return cleanup (-1);
@@ -915,7 +912,7 @@
}
size_t elsize = gelf_fsize (elfnew, ELF_T_SYM, 1, EV_CURRENT);
size_t syms = symd->d_size / elsize;
- symstrents = xmalloc (syms * sizeof (struct Ebl_Strent *));
+ symstrents = xmalloc (syms * sizeof (Dwelf_Strent *));
for (size_t i = 0; i < syms; i++)
{
GElf_Sym sym_mem;
@@ -937,7 +934,7 @@
error (0, 0, "Couldn't get symbol %zd name", i);
return cleanup (-1);
}
- symstrents[i] = ebl_strtabadd (names, symname, 0);
+ symstrents[i] = dwelf_strtab_add (names, symname);
if (symstrents[i] == NULL)
{
error (0, 0, "No memory to add to symbol name");
@@ -969,7 +966,11 @@
error (0, 0, "Couldn't create new section header string table data");
return cleanup (-1);
}
- ebl_strtabfinalize (names, data);
+ if (dwelf_strtab_finalize (names, data) == NULL)
+ {
+ error (0, 0, "Not enough memory to create string table");
+ return cleanup (-1);
+ }
namesbuf = data->d_buf;
GElf_Shdr shdr_mem;
@@ -983,7 +984,7 @@
/* Note that we also might have to compress and possibly set
sh_off below */
- shdr->sh_name = ebl_strtaboffset (scnstrents[shdrstrndx]);
+ shdr->sh_name = dwelf_strent_off (scnstrents[shdrstrndx]);
shdr->sh_type = SHT_STRTAB;
shdr->sh_flags = 0;
shdr->sh_addr = 0;
@@ -1098,7 +1099,7 @@
}
if (adjust_names)
- shdr->sh_name = ebl_strtaboffset (scnstrents[ndx]);
+ shdr->sh_name = dwelf_strent_off (scnstrents[ndx]);
if (gelf_update_shdr (scn, shdr) == 0)
{
@@ -1132,7 +1133,7 @@
if (sym->st_name != 0)
{
- sym->st_name = ebl_strtaboffset (symstrents[i]);
+ sym->st_name = dwelf_strent_off (symstrents[i]);
if (gelf_update_sym (symd, i, sym) == 0)
{
diff --git a/src/elflint.c b/src/elflint.c
index eae7761..0a26d97 100644
--- a/src/elflint.c
+++ b/src/elflint.c
@@ -1,5 +1,5 @@
/* Pedantic checking of ELF files compliance with gABI/psABI spec.
- Copyright (C) 2001-2015 Red Hat, Inc.
+ Copyright (C) 2001-2015, 2017 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2001.
@@ -35,10 +35,11 @@
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
-#include <sys/param.h>
#include <elf-knowledge.h>
+#include <libeu.h>
#include <system.h>
+#include <printversion.h>
#include "../libelf/libelfP.h"
#include "../libelf/common.h"
#include "../libebl/libeblP.h"
@@ -48,7 +49,6 @@
/* Name and version of program. */
-static void print_version (FILE *stream, struct argp_state *state);
ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
@@ -210,6 +210,7 @@
case 'd':
is_debuginfo = true;
+ break;
case ARGP_gnuld:
gnuld = true;
@@ -227,20 +228,6 @@
}
-/* Print the version information. */
-static void
-print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
-{
- fprintf (stream, "elflint (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
- fprintf (stream, gettext ("\
-Copyright (C) %s Red Hat, Inc.\n\
-This is free software; see the source for copying conditions. There is NO\n\
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2012");
- fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
-}
-
-
/* Process one file. */
static void
process_file (int fd, Elf *elf, const char *prefix, const char *suffix,
@@ -344,7 +331,7 @@
EM_CRIS, EM_JAVELIN, EM_FIREPATH, EM_ZSP, EM_MMIX, EM_HUANY, EM_PRISM,
EM_AVR, EM_FR30, EM_D10V, EM_D30V, EM_V850, EM_M32R, EM_MN10300,
EM_MN10200, EM_PJ, EM_OPENRISC, EM_ARC_A5, EM_XTENSA, EM_ALPHA,
- EM_TILEGX, EM_TILEPRO, EM_AARCH64
+ EM_TILEGX, EM_TILEPRO, EM_AARCH64, EM_BPF, EM_RISCV
};
#define nvalid_e_machine \
(sizeof (valid_e_machine) / sizeof (valid_e_machine[0]))
@@ -389,9 +376,9 @@
EI_OSABI,
ebl_osabi_name (ebl, ehdr->e_ident[EI_OSABI], buf, sizeof (buf)));
- /* No ABI versions other than zero supported either. */
+ /* No ABI versions other than zero are supported either. */
if (ehdr->e_ident[EI_ABIVERSION] != 0)
- ERROR (gettext ("unsupport ABI version e_ident[%d] == %d\n"),
+ ERROR (gettext ("unsupported ABI version e_ident[%d] == %d\n"),
EI_ABIVERSION, ehdr->e_ident[EI_ABIVERSION]);
for (cnt = EI_PAD; cnt < EI_NIDENT; ++cnt)
@@ -469,6 +456,24 @@
ERROR (gettext ("invalid section header index\n"));
}
+ /* Check the shdrs actually exist. And uncompress them before
+ further checking. Indexes between sections reference the
+ uncompressed data. */
+ unsigned int scnt;
+ Elf_Scn *scn = NULL;
+ for (scnt = 1; scnt < shnum; ++scnt)
+ {
+ scn = elf_nextscn (ebl->elf, scn);
+ if (scn == NULL)
+ break;
+ /* If the section wasn't compressed this does nothing, but
+ returns an error. We don't care. */
+ elf_compress (scn, 0, 0);
+ }
+ if (scnt < shnum)
+ ERROR (gettext ("Can only check %u headers, shnum was %u\n"), scnt, shnum);
+ shnum = scnt;
+
phnum = ehdr->e_phnum;
if (ehdr->e_phnum == PN_XNUM)
{
@@ -487,6 +492,19 @@
}
}
+ /* Check the phdrs actually exist. */
+ unsigned int pcnt;
+ for (pcnt = 0; pcnt < phnum; ++pcnt)
+ {
+ GElf_Phdr phdr_mem;
+ GElf_Phdr *phdr = gelf_getphdr (ebl->elf, pcnt, &phdr_mem);
+ if (phdr == NULL)
+ break;
+ }
+ if (pcnt < phnum)
+ ERROR (gettext ("Can only check %u headers, phnum was %u\n"), pcnt, phnum);
+ phnum = pcnt;
+
/* Check the e_flags field. */
if (!ebl_machine_flag_check (ebl, ehdr->e_flags))
ERROR (gettext ("invalid machine flags: %s\n"),
@@ -1746,7 +1764,7 @@
if (dyn->d_tag < DT_ADDRRNGLO || dyn->d_tag > DT_ADDRRNGHI)
/* Value is no pointer. */
break;
- /* FALLTHROUGH */
+ FALLTHROUGH;
case DT_AUXILIARY:
case DT_FILTER:
@@ -1972,7 +1990,8 @@
return;
}
- if (*((Elf32_Word *) data->d_buf) != 0)
+ if (data->d_size < sizeof (Elf32_Word)
+ || *((Elf32_Word *) data->d_buf) != 0)
ERROR (gettext ("symbol 0 should have zero extended section index\n"));
for (size_t cnt = 1; cnt < data->d_size / sizeof (Elf32_Word); ++cnt)
@@ -2005,11 +2024,14 @@
Elf32_Word nbucket = ((Elf32_Word *) data->d_buf)[0];
Elf32_Word nchain = ((Elf32_Word *) data->d_buf)[1];
- if (shdr->sh_size < (2 + nbucket + nchain) * shdr->sh_entsize)
- ERROR (gettext ("\
+ if (shdr->sh_size < (2 + nbucket + nchain) * sizeof (Elf32_Word))
+ {
+ ERROR (gettext ("\
section [%2d] '%s': hash table section is too small (is %ld, expected %ld)\n"),
- idx, section_name (ebl, idx), (long int) shdr->sh_size,
- (long int) ((2 + nbucket + nchain) * shdr->sh_entsize));
+ idx, section_name (ebl, idx), (long int) shdr->sh_size,
+ (long int) ((2 + nbucket + nchain) * sizeof (Elf32_Word)));
+ return;
+ }
size_t maxidx = nchain;
@@ -2056,11 +2078,14 @@
Elf64_Xword nbucket = ((Elf64_Xword *) data->d_buf)[0];
Elf64_Xword nchain = ((Elf64_Xword *) data->d_buf)[1];
- if (shdr->sh_size < (2 + nbucket + nchain) * shdr->sh_entsize)
- ERROR (gettext ("\
+ if (shdr->sh_size < (2 + nbucket + nchain) * sizeof (Elf64_Xword))
+ {
+ ERROR (gettext ("\
section [%2d] '%s': hash table section is too small (is %ld, expected %ld)\n"),
- idx, section_name (ebl, idx), (long int) shdr->sh_size,
- (long int) ((2 + nbucket + nchain) * shdr->sh_entsize));
+ idx, section_name (ebl, idx), (long int) shdr->sh_size,
+ (long int) ((2 + nbucket + nchain) * sizeof (Elf64_Xword)));
+ return;
+ }
size_t maxidx = nchain;
@@ -2300,10 +2325,12 @@
section [%2d] '%s': invalid sh_link symbol table section index [%2d]\n"),
idx, section_name (ebl, idx), shdr->sh_link);
- if (shdr->sh_entsize != (tag == SHT_GNU_HASH
+ size_t expect_entsize = (tag == SHT_GNU_HASH
? (gelf_getclass (ebl->elf) == ELFCLASS32
? sizeof (Elf32_Word) : 0)
- : (size_t) ebl_sysvhash_entrysize (ebl)))
+ : (size_t) ebl_sysvhash_entrysize (ebl));
+
+ if (shdr->sh_entsize != expect_entsize)
ERROR (gettext ("\
section [%2d] '%s': hash table entry size incorrect\n"),
idx, section_name (ebl, idx));
@@ -2312,7 +2339,7 @@
ERROR (gettext ("section [%2d] '%s': not marked to be allocated\n"),
idx, section_name (ebl, idx));
- if (shdr->sh_size < (tag == SHT_GNU_HASH ? 4 : 2) * (shdr->sh_entsize ?: 4))
+ if (shdr->sh_size < (tag == SHT_GNU_HASH ? 4 : 2) * (expect_entsize ?: 4))
{
ERROR (gettext ("\
section [%2d] '%s': hash table has not even room for initial administrative entries\n"),
@@ -2482,7 +2509,7 @@
}
}
}
- else if (hash_shdr->sh_entsize == sizeof (Elf64_Word))
+ else if (hash_shdr->sh_entsize == sizeof (Elf64_Xword))
{
const Elf64_Xword *hasharr = (Elf64_Xword *) hash_data->d_buf;
if (hash_data->d_size < 2 * sizeof (Elf32_Word))
@@ -2523,7 +2550,7 @@
{
ERROR (gettext ("\
hash section [%2zu] '%s' invalid sh_entsize\n"),
- gnu_hash_idx, gnu_hash_name);
+ hash_idx, hash_name);
return;
}
@@ -2659,9 +2686,12 @@
idx, section_name (ebl, idx));
if (data->d_size < elsize)
- ERROR (gettext ("\
+ {
+ ERROR (gettext ("\
section [%2d] '%s': section group without flags word\n"),
idx, section_name (ebl, idx));
+ return;
+ }
else if (be_strict)
{
if (data->d_size < 2 * elsize)
@@ -2683,7 +2713,7 @@
ERROR (gettext ("section [%2d] '%s': unknown section group flags\n"),
idx, section_name (ebl, idx));
- for (cnt = elsize; cnt < data->d_size; cnt += elsize)
+ for (cnt = elsize; cnt + elsize <= data->d_size; cnt += elsize)
{
#if ALLOW_UNALIGNED
val = *((Elf32_Word *) ((char *) data->d_buf + cnt));
@@ -3963,6 +3993,7 @@
case SHT_NOBITS:
if (is_debuginfo)
break;
+ FALLTHROUGH;
default:
ERROR (gettext ("\
section [%2zu] '%s' has unexpected type %d for an executable section\n"),
@@ -4106,7 +4137,7 @@
ERROR (gettext ("\
section [%2zu] '%s': relocatable files cannot have dynamic symbol tables\n"),
cnt, section_name (ebl, cnt));
- /* FALLTHROUGH */
+ FALLTHROUGH;
case SHT_SYMTAB:
check_symtab (ebl, ehdr, shdr, cnt);
break;
@@ -4305,7 +4336,7 @@
if (nhdr.n_namesz == sizeof "Linux"
&& !memcmp (data->d_buf + name_offset, "Linux", sizeof "Linux"))
break;
-
+ FALLTHROUGH;
default:
if (shndx == 0)
ERROR (gettext ("\
diff --git a/src/findtextrel.c b/src/findtextrel.c
index e78d7b8..8f1e239 100644
--- a/src/findtextrel.c
+++ b/src/findtextrel.c
@@ -36,7 +36,7 @@
#include <string.h>
#include <unistd.h>
-#include <system.h>
+#include <printversion.h>
struct segments
@@ -47,7 +47,6 @@
/* Name and version of program. */
-static void print_version (FILE *stream, struct argp_state *state);
ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
@@ -154,20 +153,6 @@
}
-/* Print the version information. */
-static void
-print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
-{
- fprintf (stream, "findtextrel (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
- fprintf (stream, gettext ("\
-Copyright (C) %s Red Hat, Inc.\n\
-This is free software; see the source for copying conditions. There is NO\n\
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2012");
- fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
-}
-
-
/* Handle program arguments. */
static error_t
parse_opt (int key, char *arg,
diff --git a/src/i386_ld.c b/src/i386_ld.c
deleted file mode 100644
index d196177..0000000
--- a/src/i386_ld.c
+++ /dev/null
@@ -1,1102 +0,0 @@
-/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008 Red Hat, Inc.
- This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
-
- 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/>. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <assert.h>
-#include <error.h>
-#include <libintl.h>
-#include <stdlib.h>
-#include <string.h>
-
-// XXX For debugging
-#include <stdio.h>
-
-#include <system.h>
-#include "ld.h"
-#include "list.h"
-/* x86 is little endian. */
-#define UNALIGNED_ACCESS_CLASS LITTLE_ENDIAN
-#include "unaligned.h"
-#include "xelf.h"
-
-
-/* The old callbacks. */
-static int (*old_open_outfile) (struct ld_state *, int, int, int);
-
-
-static int
-elf_i386_open_outfile (struct ld_state *statep,
- int machine __attribute__ ((unused)),
- int klass __attribute__ ((unused)),
- int data __attribute__ ((unused)))
-{
- /* This backend only handles 32-bit object files. */
- /* XXX For now just use the generic backend. */
- return old_open_outfile (statep, EM_386, ELFCLASS32, ELFDATA2LSB);
-}
-
-
-/* Process relocations for the output in a relocatable file. This
- only means adjusting offset and symbol indices. */
-static void
-elf_i386_relocate_section (struct ld_state *statep __attribute__ ((unused)),
- Elf_Scn *outscn, struct scninfo *firstp,
- const Elf32_Word *dblindirect)
-{
- struct scninfo *runp;
- Elf_Data *data;
-
- /* Iterate over all the input sections. Appropriate data buffers in the
- output sections were already created. */
- runp = firstp;
- data = NULL;
- do
- {
- Elf_Data *reltgtdata;
- Elf_Data *insymdata;
- Elf_Data *inxndxdata = NULL;
- size_t maxcnt;
- size_t cnt;
- const Elf32_Word *symindirect;
- struct symbol **symref;
- struct usedfiles *file = runp->fileinfo;
- XElf_Shdr *shdr = &SCNINFO_SHDR (runp->shdr);
-
- /* Get the output section data buffer for this input section. */
- data = elf_getdata (outscn, data);
- assert (data != NULL);
-
- /* Get the data for section in the input file this relocation
- section is relocating. Since these buffers are reused in the
- output modifying these buffers has the correct result. */
- reltgtdata = elf_getdata (file->scninfo[shdr->sh_info].scn, NULL);
-
- /* Get the data for the input section symbol table for this
- relocation section. */
- insymdata = elf_getdata (file->scninfo[shdr->sh_link].scn, NULL);
- assert (insymdata != NULL);
-
- /* And the extended section index table. */
- inxndxdata = runp->fileinfo->xndxdata;
-
- /* Number of relocations. */
- maxcnt = shdr->sh_size / shdr->sh_entsize;
-
- /* Array directing local symbol table offsets to output symbol
- table offsets. */
- symindirect = file->symindirect;
-
- /* References to the symbol records. */
- symref = file->symref;
-
- /* Iterate over all the relocations in the section. */
- for (cnt = 0; cnt < maxcnt; ++cnt)
- {
- XElf_Rel_vardef (rel);
- Elf32_Word si;
- XElf_Sym_vardef (sym);
- Elf32_Word xndx;
-
- /* Get the relocation data itself. x86 uses Rel
- relocations. In case we have to handle Rela as well the
- whole loop probably should be duplicated. */
- xelf_getrel (data, cnt, rel);
- assert (rel != NULL);
-
- /* Compute the symbol index in the output file. */
- si = symindirect[XELF_R_SYM (rel->r_info)];
- if (si == 0)
- {
- /* This happens if the symbol is locally undefined or
- superceded by some other definition. */
- assert (symref[XELF_R_SYM (rel->r_info)] != NULL);
- si = symref[XELF_R_SYM (rel->r_info)]->outsymidx;
- }
- /* Take reordering performed to sort the symbol table into
- account. */
- si = dblindirect[si];
-
- /* Get the symbol table entry. */
- xelf_getsymshndx (insymdata, inxndxdata, XELF_R_SYM (rel->r_info),
- sym, xndx);
- if (sym->st_shndx != SHN_XINDEX)
- xndx = sym->st_shndx;
- assert (xndx < SHN_LORESERVE || xndx > SHN_HIRESERVE);
-
- /* We fortunately don't have to do much. The relocations
- mostly get only updates of the offset. Only for a
- relocation referring to a section do we have to do
- something. In this case the reference to the sections
- has no direct equivalent since the part the input section
- contributes need not start at the same offset as in the
- input file. Therefore we have to adjust the addend which
- in the case of Rel relocations is in the target section
- itself. */
- if (XELF_ST_TYPE (sym->st_info) == STT_SECTION)
- {
- /* We expect here only R_386_32 relocations. */
- assert (XELF_R_TYPE (rel->r_info) == R_386_32);
-
- /* Avoid writing to the section memory if this is
- effectively a no-op since it might save a
- copy-on-write operation. */
- Elf32_Word toadd = file->scninfo[xndx].offset;
- if (toadd != 0)
- add_4ubyte_unaligned (reltgtdata->d_buf + rel->r_offset,
- toadd);
- }
-
- /* Adjust the offset for the position of the input section
- content in the output section. */
- rel->r_offset += file->scninfo[shdr->sh_info].offset;
-
- /* And finally adjust the index of the symbol in the output
- symbol table. */
- rel->r_info = XELF_R_INFO (si, XELF_R_TYPE (rel->r_info));
-
- /* Store the result. */
- (void) xelf_update_rel (data, cnt, rel);
- }
-
- runp = runp->next;
- }
- while (runp != firstp);
-}
-
-
-/* Each PLT entry has 16 bytes. We need one entry as overhead for
- the code to set up the call into the runtime relocation. */
-#define PLT_ENTRY_SIZE 16
-
-static void
-elf_i386_initialize_plt (struct ld_state *statep, Elf_Scn *scn)
-{
- Elf_Data *data;
- XElf_Shdr_vardef (shdr);
-
- /* Change the entry size in the section header. */
- xelf_getshdr (scn, shdr);
- assert (shdr != NULL);
- shdr->sh_entsize = PLT_ENTRY_SIZE;
- (void) xelf_update_shdr (scn, shdr);
-
- data = elf_newdata (scn);
- if (data == NULL)
- error (EXIT_FAILURE, 0, gettext ("cannot allocate PLT section: %s"),
- elf_errmsg (-1));
-
- /* We need one special PLT entry (performing the jump to the runtime
- relocation routines) and one for each function we call in a DSO. */
- data->d_size = (1 + statep->nplt) * PLT_ENTRY_SIZE;
- data->d_buf = xcalloc (1, data->d_size);
- assert (data->d_type == ELF_T_BYTE);
- data->d_off = 0;
- data->d_align = 8;
-
- statep->nplt_used = 1;
-}
-
-
-static void
-elf_i386_initialize_pltrel (struct ld_state *statep, Elf_Scn *scn)
-{
- Elf_Data *data;
-
- data = elf_newdata (scn);
- if (data == NULL)
- error (EXIT_FAILURE, 0, gettext ("cannot allocate PLTREL section: %s"),
- elf_errmsg (-1));
-
- /* One relocation per PLT entry. */
- size_t size = statep->nplt * sizeof (Elf32_Rel);
- data->d_buf = xcalloc (1, size);
- data->d_type = ELF_T_REL;
- data->d_size = size;
- data->d_align = 4;
- data->d_off = 0;
-}
-
-
-static void
-elf_i386_initialize_got (struct ld_state *statep, Elf_Scn *scn)
-{
- /* If we come here we better need a GOT. */
- assert (statep->ngot != 0);
-
- Elf_Data *data = elf_newdata (scn);
- if (data == NULL)
- error (EXIT_FAILURE, 0, gettext ("cannot allocate GOT section: %s"),
- elf_errmsg (-1));
-
- /* Just a single word per GOT entry is needed. */
- size_t size = statep->ngot * sizeof (Elf32_Addr);
- data->d_buf = xcalloc (1, size);
- data->d_size = size;
- data->d_type = ELF_T_WORD;
- data->d_off = 0;
- data->d_align = sizeof (Elf32_Addr);
-}
-
-
-static void
-elf_i386_initialize_gotplt (struct ld_state *statep, Elf_Scn *scn)
-{
- /* If we come here we better need a PLT. */
- assert (statep->nplt != 0);
-
- Elf_Data *data = elf_newdata (scn);
- if (data == NULL)
- error (EXIT_FAILURE, 0, gettext ("cannot allocate GOTPLT section: %s"),
- elf_errmsg (-1));
-
- /* We construct the .got.plt section in pieces. Here we only add the data
- structures which are used by the PLT. This includes three reserved
- entries at the beginning (the first will contain a pointer to the
- .dynamic section), and one word for each PLT entry. */
- size_t size = (3 + statep->nplt) * sizeof (Elf32_Addr);
- data->d_buf = xcalloc (1, size);
- data->d_type = ELF_T_WORD;
- data->d_size = size;
- data->d_off = 0;
- data->d_align = sizeof (Elf32_Addr);
-}
-
-
-/* The first entry in an absolute procedure linkage table looks like
- this. See the SVR4 ABI i386 supplement to see how this works. */
-static const unsigned char elf_i386_plt0_entry[PLT_ENTRY_SIZE] =
-{
- 0xff, 0x35, /* pushl contents of address */
- 0, 0, 0, 0, /* replaced with address of .got + 4. */
- 0xff, 0x25, /* jmp indirect */
- 0, 0, 0, 0, /* replaced with address of .got + 8. */
- 0x0f, 0x0b, /* ud2a, to prevent further decoding. */
- 0, 0 /* pad out to 16 bytes. */
-};
-
-/* Type describing the first PLT entry in non-PIC. */
-struct plt0_entry
-{
- /* First a 'push' of the second GOT entry. */
- unsigned char push_instr[2];
- uint32_t gotp4_addr;
- /* Second, a 'jmp indirect' to the third GOT entry. */
- unsigned char jmp_instr[2];
- uint32_t gotp8_addr;
- /* Padding. */
- unsigned char padding[4];
-} __attribute__ ((packed));
-
-/* The first entry in a PIC procedure linkage table look like this. */
-static const unsigned char elf_i386_pic_plt0_entry[PLT_ENTRY_SIZE] =
-{
- 0xff, 0xb3, 4, 0, 0, 0, /* pushl 4(%ebx) */
- 0xff, 0xa3, 8, 0, 0, 0, /* jmp *8(%ebx) */
- 0x0f, 0x0b, /* ud2a, to prevent further decoding. */
- 0, 0 /* pad out to 16 bytes. */
-};
-
-/* Contents of all but the first PLT entry in executable. */
-static const unsigned char elf_i386_plt_entry[PLT_ENTRY_SIZE] =
-{
- 0xff, 0x25, /* jmp indirect */
- 0, 0, 0, 0, /* replaced with address of this symbol in .got. */
- 0x68, /* pushl immediate */
- 0, 0, 0, 0, /* replaced with offset into relocation table. */
- 0xe9, /* jmp relative */
- 0, 0, 0, 0 /* replaced with offset to start of .plt. */
-};
-
-/* Contents of all but the first PLT entry in DSOs. */
-static const unsigned char elf_i386_pic_plt_entry[PLT_ENTRY_SIZE] =
-{
- 0xff, 0xa3, /* jmp *offset(%ebx) */
- 0, 0, 0, 0, /* replaced with offset of this symbol in .got. */
- 0x68, /* pushl immediate */
- 0, 0, 0, 0, /* replaced with offset into relocation table. */
- 0xe9, /* jmp relative */
- 0, 0, 0, 0 /* replaced with offset to start of .plt. */
-};
-
-/* Type describing a PLT entry. */
-struct plt_entry
-{
- /* The first instruction is 'jmp indirect' or 'jmp *offset(%ebs)'. */
- unsigned char jmp_instr[2];
- uint32_t offset_got;
- /* The second instruction is 'push immediate'. */
- unsigned char push_instr;
- uint32_t push_imm;
- /* Finally a 'jmp relative'. */
- unsigned char jmp_instr2;
- uint32_t plt0_offset;
-} __attribute__ ((packed));
-
-
-static void
-elf_i386_finalize_plt (struct ld_state *statep, size_t nsym,
- size_t nsym_local, struct symbol **ndxtosym)
-{
- if (unlikely (statep->nplt + statep->ngot == 0))
- /* Nothing to be done. */
- return;
-
- Elf_Scn *scn;
- XElf_Shdr_vardef (shdr);
- Elf_Data *data;
- const bool build_dso = statep->file_type == dso_file_type;
-
- /* Get the address of the .got.plt section. */
- scn = elf_getscn (statep->outelf, statep->gotpltscnidx);
- xelf_getshdr (scn, shdr);
- data = elf_getdata (scn, NULL);
- assert (shdr != NULL && data != NULL);
- /* The address points to the .got.plt section, not the .got section. */
- Elf32_Addr gotaddr = shdr->sh_addr;
-
- /* Now create the initial values for the .got.plt section. The
- first word contains the address of the .dynamic section. The
- second and third entry are left empty for use by the dynamic
- linker. The following entries are pointers to the instructions
- following the initial jmp instruction in the corresponding PLT
- entry. */
- xelf_getshdr (elf_getscn (statep->outelf, statep->dynamicscnidx), shdr);
- assert (shdr != NULL);
- ((Elf32_Word *) data->d_buf)[0] = shdr->sh_addr;
-
- /* The PLT contains code which a user of a function jumps to. The first
- PLT entry is special, so the first used one has the index 1. */
- scn = elf_getscn (statep->outelf, statep->pltscnidx);
- XElf_Shdr_vardef (pltshdr);
- xelf_getshdr (scn, pltshdr);
- assert (pltshdr != NULL);
-
- Elf_Data *dynsymdata = elf_getdata (elf_getscn (statep->outelf,
- statep->dynsymscnidx), NULL);
- assert (dynsymdata != NULL);
-
- Elf_Data *symdata = NULL;
- if (statep->symscnidx != 0)
- {
- symdata = elf_getdata (elf_getscn (statep->outelf, statep->symscnidx),
- NULL);
- assert (symdata != NULL);
- }
-
- /* Create the .plt section. */
- scn = elf_getscn (statep->outelf, statep->pltscnidx);
- Elf_Data *pltdata = elf_getdata (scn, NULL);
- assert (pltdata != NULL);
-
- /* Also create the .rel.plt section data. It simply means relocations
- addressing the corresponding entry in the .got.plt section. The
- section name is misleading. */
- scn = elf_getscn (statep->outelf, statep->pltrelscnidx);
- xelf_getshdr (scn, shdr);
- Elf_Data *reldata = elf_getdata (scn, NULL);
- assert (shdr != NULL && reldata != NULL);
-
- /* Update the sh_link to point to the section being modified. We
- point it here (correctly) to the .got.plt section. Some linkers
- (e.g., the GNU binutils linker) point to the .plt section. This
- is wrong since the .plt section isn't modified even though the
- name .rel.plt suggests that this is correct. */
- shdr->sh_link = statep->dynsymscnidx;
- shdr->sh_info = statep->gotpltscnidx;
- (void) xelf_update_shdr (scn, shdr);
-
- /* Create the first entry of the .plt section. */
- assert (pltdata->d_size >= PLT_ENTRY_SIZE);
- if (build_dso)
- /* Copy the entry. It's complete, no relocation needed. */
- memcpy (pltdata->d_buf, elf_i386_pic_plt0_entry, PLT_ENTRY_SIZE);
- else
- {
- /* Copy the skeleton. */
- memcpy (pltdata->d_buf, elf_i386_plt0_entry, PLT_ENTRY_SIZE);
-
- /* And fill in the addresses. */
- struct plt0_entry *addr = (struct plt0_entry *) pltdata->d_buf;
- addr->gotp4_addr = target_bswap_32 (gotaddr + 4);
- addr->gotp8_addr = target_bswap_32 (gotaddr + 8);
- }
-
- /* For DSOs we need GOT offsets, otherwise the GOT address. */
- Elf32_Addr gotaddr_off = build_dso ? 0 : gotaddr;
-
- /* Create the remaining entries. */
- const unsigned char *plt_template
- = build_dso ? elf_i386_pic_plt_entry : elf_i386_plt_entry;
-
- for (size_t idx = nsym_local; idx < nsym; ++idx)
- {
- struct symbol *symbol = ndxtosym[idx];
- if (symbol == NULL || symbol->type != STT_FUNC
- || ndxtosym[idx]->outdynsymidx == 0
- // XXX is the following test correct?
- || ! ndxtosym[idx]->in_dso)
- continue;
-
- size_t pltidx = symbol->merge.value;
-
- assert (pltidx > 0);
- assert ((3 + pltidx) * sizeof (Elf32_Word) <= data->d_size);
-
- /* Address in the PLT. */
- Elf32_Addr pltentryaddr = (pltshdr->sh_addr + pltidx * PLT_ENTRY_SIZE);
-
- /* Point the GOT entry at the PLT entry, after the initial jmp. */
- ((Elf32_Word *) data->d_buf)[2 + pltidx] = pltentryaddr + 6;
-
- /* If the symbol is defined, adjust the address. */
- if (((Elf32_Sym *) dynsymdata->d_buf)[ndxtosym[idx]->outdynsymidx].st_shndx != SHN_UNDEF)
- {
- /* The value of the symbol is the address of the corresponding PLT
- entry. Store the address, also for the normal symbol table if
- this is necessary. */
- ((Elf32_Sym *) dynsymdata->d_buf)[pltidx].st_value = pltentryaddr;
-
- if (symdata != NULL)
- {
- assert(nsym - statep->nplt + (pltidx - 1) == idx);
- ((Elf32_Sym *) symdata->d_buf)[nsym - statep->nplt
- + (pltidx - 1)].st_value
- = pltentryaddr;
- }
- }
-
- /* Copy the PLT entry template. */
- assert (pltdata->d_size >= (1 + pltidx) * PLT_ENTRY_SIZE);
- struct plt_entry *addr = (struct plt_entry *) ((char *) pltdata->d_buf
- + (pltidx
- * PLT_ENTRY_SIZE));
- memcpy (addr, plt_template, PLT_ENTRY_SIZE);
-
- /* And once more, fill in the addresses. First the address of
- this symbol in .got. */
- addr->offset_got = target_bswap_32 (gotaddr_off
- + (2 + pltidx) * sizeof (Elf32_Addr));
- /* Offset into relocation table. */
- addr->push_imm = target_bswap_32 ((pltidx - 1) * sizeof (Elf32_Rel));
- /* Offset to start of .plt. */
- addr->plt0_offset = target_bswap_32 (-(1 + pltidx) * PLT_ENTRY_SIZE);
-
-
- XElf_Rel_vardef (rel);
- assert (pltidx * sizeof (Elf32_Rel) <= reldata->d_size);
- xelf_getrel_ptr (reldata, pltidx - 1, rel);
- rel->r_offset = gotaddr + (2 + pltidx) * sizeof (Elf32_Addr);
- /* The symbol table entries for the functions from DSOs are at
- the beginning of the symbol table. */
- rel->r_info = XELF_R_INFO (ndxtosym[idx]->outdynsymidx, R_386_JMP_SLOT);
- (void) xelf_update_rel (reldata, pltidx - 1, rel);
- }
-}
-
-
-static int
-elf_i386_rel_type (struct ld_state *statep __attribute__ ((__unused__)))
-{
- /* ELF/i386 uses REL. */
- return DT_REL;
-}
-
-
-static void
-elf_i386_count_relocations (struct ld_state *statep, struct scninfo *scninfo)
-{
- /* We go through the list of input sections and count those relocations
- which are not handled by the linker. At the same time we have to
- see how many GOT entries we need and how much .bss space is needed
- for copy relocations. */
- Elf_Data *data = elf_getdata (scninfo->scn, NULL);
- XElf_Shdr *shdr = &SCNINFO_SHDR (scninfo->shdr);
- size_t maxcnt = shdr->sh_size / shdr->sh_entsize;
- size_t relsize = 0;
- size_t cnt;
- struct symbol *sym;
-
- assert (shdr->sh_type == SHT_REL);
-
- for (cnt = 0; cnt < maxcnt; ++cnt)
- {
- XElf_Rel_vardef (rel);
-
- xelf_getrel (data, cnt, rel);
- /* XXX Should we complain about failing accesses? */
- if (rel != NULL)
- {
- Elf32_Word r_sym = XELF_R_SYM (rel->r_info);
-
- /* Symbols in COMDAT group sections which are discarded do
- not have to be relocated. */
- if (r_sym >= scninfo->fileinfo->nlocalsymbols
- && unlikely (scninfo->fileinfo->symref[r_sym] == NULL))
- continue;
-
- switch (XELF_R_TYPE (rel->r_info))
- {
- case R_386_GOT32:
- if (! scninfo->fileinfo->symref[r_sym]->defined
- || scninfo->fileinfo->symref[r_sym]->in_dso
- || statep->file_type == dso_file_type)
- {
- relsize += sizeof (Elf32_Rel);
- ++statep->nrel_got;
- }
-
- /* Even if this relocation is not emitted in the output
- file it requires a GOT entry. */
- ++statep->ngot;
-
- /* FALLTHROUGH */
-
- case R_386_GOTOFF:
- case R_386_GOTPC:
- statep->need_got = true;
- break;
-
- case R_386_32:
- case R_386_PC32:
- /* These relocations cause text relocations in DSOs. */
- if (linked_from_dso_p (scninfo, r_sym))
- {
- if (statep->file_type == dso_file_type)
- {
- relsize += sizeof (Elf32_Rel);
- // XXX Do we have to check whether the target
- // XXX section is read-only first?
- statep->dt_flags |= DF_TEXTREL;
- }
- else
- {
- /* Non-function objects from a DSO need to get a
- copy relocation. */
- sym = scninfo->fileinfo->symref[r_sym];
-
- /* Only do this if we have not requested a copy
- relocation already. */
- if (unlikely (sym->type != STT_FUNC) && ! sym->need_copy)
- {
- sym->need_copy = 1;
- ++statep->ncopy;
- relsize += sizeof (Elf32_Rel);
- }
- }
- }
- else if (statep->file_type == dso_file_type
- && XELF_R_TYPE (rel->r_info) == R_386_32)
- relsize += sizeof (Elf32_Rel);
-
- break;
-
- case R_386_PLT32:
- /* We might need a PLT entry. But we cannot say for sure
- here since one of the symbols might turn up being
- defined in the executable (if we create such a thing).
- If a DSO is created we still might use a local
- definition.
-
- If the symbol is not defined and we are not creating
- a statically linked binary, then we need in any case
- a PLT entry. */
- if (! scninfo->fileinfo->symref[r_sym]->defined
- && !statep->statically)
- {
- sym = scninfo->fileinfo->symref[r_sym];
- sym->type = STT_FUNC;
- sym->in_dso = 1;
- sym->defined = 1;
-
- /* Remove from the list of unresolved symbols. */
- --statep->nunresolved;
- if (! sym->weak)
- --statep->nunresolved_nonweak;
- CDBL_LIST_DEL (statep->unresolved, sym);
-
- /* Add to the list of symbols we expect from a DSO. */
- ++statep->nplt;
- ++statep->nfrom_dso;
- CDBL_LIST_ADD_REAR (statep->from_dso, sym);
- }
- break;
-
- case R_386_TLS_LDO_32:
- if (statep->file_type != executable_file_type)
- abort ();
- /* We do not need a relocation in the output file. */
- break;
-
- case R_386_TLS_LE:
- /* We never need a relocation in the output file. */
- break;
-
- case R_386_TLS_IE:
- if (statep->file_type == dso_file_type)
- error (EXIT_FAILURE, 0, gettext ("initial-executable TLS relocation cannot be used "));
- if (!scninfo->fileinfo->symref[r_sym]->defined
- || scninfo->fileinfo->symref[r_sym]->in_dso)
- {
- abort ();
- }
- break;
-
- case R_386_TLS_GD:
- if (statep->file_type != executable_file_type
- || !scninfo->fileinfo->symref[r_sym]->defined
- || scninfo->fileinfo->symref[r_sym]->in_dso)
- {
- abort ();
- }
- break;
-
- case R_386_TLS_GOTIE:
- case R_386_TLS_LDM:
- case R_386_TLS_GD_32:
- case R_386_TLS_GD_PUSH:
- case R_386_TLS_GD_CALL:
- case R_386_TLS_GD_POP:
- case R_386_TLS_LDM_32:
- case R_386_TLS_LDM_PUSH:
- case R_386_TLS_LDM_CALL:
- case R_386_TLS_LDM_POP:
- case R_386_TLS_IE_32:
- case R_386_TLS_LE_32:
- /* XXX */
- abort ();
- break;
-
- case R_386_NONE:
- /* Nothing to be done. */
- break;
-
- /* These relocation should never be generated by an
- assembler. */
- case R_386_COPY:
- case R_386_GLOB_DAT:
- case R_386_JMP_SLOT:
- case R_386_RELATIVE:
- case R_386_TLS_DTPMOD32:
- case R_386_TLS_DTPOFF32:
- case R_386_TLS_TPOFF32:
- /* Unknown relocation. */
- default:
- abort ();
- }
- }
- }
-
- scninfo->relsize = relsize;
-}
-
-
-static void
-elf_i386_create_relocations (struct ld_state *statep,
- const Elf32_Word *dblindirect __attribute__ ((unused)))
-{
- /* Get the address of the got section. */
- Elf_Scn *pltscn = elf_getscn (statep->outelf, statep->pltscnidx);
- Elf32_Shdr *shdr = elf32_getshdr (pltscn);
- assert (shdr != NULL);
- Elf32_Addr pltaddr = shdr->sh_addr;
-
- Elf_Scn *gotscn = elf_getscn (statep->outelf, statep->gotscnidx);
- // XXX Adjust the address, if necessary, for relro
- Elf_Data *gotdata = NULL;
- if (statep->need_got)
- {
- gotdata = elf_getdata (gotscn, NULL);
- assert (gotdata != NULL);
- }
-
- Elf_Scn *gotpltscn = elf_getscn (statep->outelf, statep->gotpltscnidx);
- shdr = elf32_getshdr (gotpltscn);
- assert (shdr != NULL);
- Elf32_Addr gotaddr = shdr->sh_addr;
-
- Elf_Scn *reldynscn = elf_getscn (statep->outelf, statep->reldynscnidx);
- Elf_Data *reldyndata = elf_getdata (reldynscn, NULL);
- assert (reldyndata != NULL);
-
- size_t nreldyn = 0;
- size_t ngotconst = statep->nrel_got;
-
- struct scninfo *first = statep->rellist->next;
- struct scninfo *runp = first;
- do
- {
- XElf_Shdr *rshdr = &SCNINFO_SHDR (runp->shdr);
- Elf_Data *reldata = elf_getdata (runp->scn, NULL);
- int nrels = rshdr->sh_size / rshdr->sh_entsize;
-
- /* We will need the following values a couple of times. Help
- the compiler and improve readability. */
- struct symbol **symref = runp->fileinfo->symref;
- struct scninfo *scninfo = runp->fileinfo->scninfo;
-
- /* This is the offset of the input section we are looking at in
- the output file. */
- XElf_Addr inscnoffset = scninfo[rshdr->sh_info].offset;
-
- /* The target section. We use the data from the input file. */
- Elf_Data *data = elf_getdata (scninfo[rshdr->sh_info].scn, NULL);
-
- /* We cannot handle relocations against merge-able sections. */
- assert ((SCNINFO_SHDR (scninfo[rshdr->sh_link].shdr).sh_flags
- & SHF_MERGE) == 0);
-
- /* Cache the access to the symbol table data. */
- Elf_Data *symdata = elf_getdata (scninfo[rshdr->sh_link].scn, NULL);
-
- for (int cnt = 0; cnt < nrels; ++cnt)
- {
- XElf_Rel_vardef (rel);
- XElf_Rel *rel2;
- xelf_getrel (reldata, cnt, rel);
- assert (rel != NULL);
- XElf_Addr reladdr = inscnoffset + rel->r_offset;
- XElf_Addr value;
-
- size_t idx = XELF_R_SYM (rel->r_info);
- if (idx < runp->fileinfo->nlocalsymbols)
- {
- XElf_Sym_vardef (sym);
- xelf_getsym (symdata, idx, sym);
-
- /* The value only depends on the position of the referenced
- section in the output file and the addend. */
- value = scninfo[sym->st_shndx].offset + sym->st_value;
- }
- else
- {
- if (symref[idx] == NULL)
- /* Symbol in ignored COMDAT group section. */
- continue;
-
- value = symref[idx]->merge.value;
- if (symref[idx]->in_dso)
- {
- /* MERGE.VALUE contains the PLT index. If this is not for
- a function the actual value will be computed later. */
- assert (value != 0 || symref[idx]->type != STT_FUNC);
- value = pltaddr + value * PLT_ENTRY_SIZE;
- }
- }
-
- /* Address of the relocated memory in the data buffer. */
- unsigned char *relloc = (unsigned char *) data->d_buf + rel->r_offset;
-
- uint32_t thisgotidx;
- switch (XELF_R_TYPE (rel->r_info))
- {
- /* These three cases can be handled together since the
- symbol associated with the R_386_GOTPC relocation is
- _GLOBAL_OFFSET_TABLE_ which has a value corresponding
- to the address of the GOT and the address of the PLT
- entry required for R_386_PLT32 is computed above. */
- case R_386_PC32:
- case R_386_GOTPC:
- case R_386_PLT32:
- value -= reladdr;
- /* FALLTHROUGH */
-
- case R_386_32:
- if (linked_from_dso_p (scninfo, idx)
- && statep->file_type != dso_file_type
- && symref[idx]->type != STT_FUNC)
- {
- value = (ld_state.copy_section->offset
- + symref[idx]->merge.value);
-
- if (unlikely (symref[idx]->need_copy))
- {
- /* Add a relocation to initialize the GOT entry. */
- assert (symref[idx]->outdynsymidx != 0);
-#if NATIVE_ELF != 0
- xelf_getrel_ptr (reldyndata, nreldyn, rel2);
-#else
- rel2 = &rel_mem;
-#endif
- rel2->r_offset = value;
- rel2->r_info
- = XELF_R_INFO (symref[idx]->outdynsymidx, R_386_COPY);
- (void) xelf_update_rel (reldyndata, nreldyn, rel2);
- ++nreldyn;
- assert (nreldyn <= statep->nrel_got);
-
- /* Update the symbol table record for the new
- address. */
- Elf32_Word symidx = symref[idx]->outdynsymidx;
- Elf_Scn *symscn = elf_getscn (statep->outelf,
- statep->dynsymscnidx);
- Elf_Data *outsymdata = elf_getdata (symscn, NULL);
- assert (outsymdata != NULL);
- XElf_Sym_vardef (sym);
- xelf_getsym (outsymdata, symidx, sym);
- sym->st_value = value;
- sym->st_shndx = statep->copy_section->outscnndx;
- (void) xelf_update_sym (outsymdata, symidx, sym);
-
- symidx = symref[idx]->outsymidx;
- if (symidx != 0)
- {
- symidx = statep->dblindirect[symidx];
- symscn = elf_getscn (statep->outelf,
- statep->symscnidx);
- outsymdata = elf_getdata (symscn, NULL);
- assert (outsymdata != NULL);
- xelf_getsym (outsymdata, symidx, sym);
- sym->st_value = value;
- sym->st_shndx = statep->copy_section->outscnndx;
- (void) xelf_update_sym (outsymdata, symidx, sym);
- }
-
- /* Remember that we set up the copy relocation. */
- symref[idx]->need_copy = 0;
- }
- }
- else if (statep->file_type == dso_file_type
- && XELF_R_TYPE (rel->r_info) == R_386_32)
- {
-#if NATIVE_ELF != 0
- xelf_getrel_ptr (reldyndata, nreldyn, rel2);
-#else
- rel2 = &rel_mem;
-#endif
- rel2->r_offset = value;
-
- /* For symbols we do not export we generate a relative
- relocation. */
- if (idx < SCNINFO_SHDR (scninfo[rshdr->sh_link].shdr).sh_info
- || symref[idx]->outdynsymidx == 0)
- rel2->r_info = XELF_R_INFO (0, R_386_RELATIVE);
- else
- rel2->r_info
- = XELF_R_INFO (symref[idx]->outdynsymidx, R_386_32);
- (void) xelf_update_rel (reldyndata, nreldyn, rel2);
- ++nreldyn;
- assert (nreldyn <= statep->nrel_got);
-
- value = 0;
- }
- add_4ubyte_unaligned (relloc, value);
- break;
-
- case R_386_GOT32:
- if (! symref[idx]->defined || symref[idx]->in_dso)
- {
- thisgotidx = nreldyn++;
- assert (thisgotidx < statep->nrel_got);
-
- /* Add a relocation to initialize the GOT entry. */
-#if NATIVE_ELF != 0
- xelf_getrel_ptr (reldyndata, thisgotidx, rel2);
-#else
- rel2 = &rel_mem;
-#endif
- rel2->r_offset = gotaddr + ((thisgotidx - statep->ngot)
- * sizeof (Elf32_Addr));
- rel2->r_info
- = XELF_R_INFO (symref[idx]->outdynsymidx, R_386_GLOB_DAT);
- (void) xelf_update_rel (reldyndata, thisgotidx, rel2);
- }
- else if (statep->file_type != dso_file_type)
- {
- thisgotidx = ngotconst++;
- assert (thisgotidx < statep->ngot);
-
- /* We have to use a GOT since the generated code
- requires it but we know the address and therefore
- do not need a relocation. */
- ((uint32_t *) gotdata->d_buf)[thisgotidx] = value;
- }
- else
- {
- thisgotidx = nreldyn++;
- assert (thisgotidx < statep->nrel_got);
-
- // XXX generate a relative relocation.
- abort ();
- }
-
- store_4ubyte_unaligned (relloc,
- (thisgotidx - statep->ngot)
- * sizeof (Elf32_Addr));
- break;
-
- case R_386_GOTOFF:
- add_4ubyte_unaligned (relloc, value - gotaddr);
- break;
-
- case R_386_TLS_LE:
- value = symref[idx]->merge.value - ld_state.tls_tcb;
- store_4ubyte_unaligned (relloc, value);
- break;
-
- case R_386_TLS_IE:
- if (symref[idx]->defined && !symref[idx]->in_dso)
- {
- /* The symbol is defined in the executable.
- Perform the IE->LE optimization.
- There are multiple versions, though.
-
- First version: mov ADDR,REG. */
- if (relloc[-2] == 0x8b
- && ((relloc[-1] & 0xc7) == 0x05))
- {
- relloc[-2] = 0xc7;
- relloc[-1] = 0xc0 | ((relloc[-1] >> 3) & 7);
- store_4ubyte_unaligned (relloc, (symref[idx]->merge.value
- - ld_state.tls_tcb));
- }
- else
- {
- abort ();
- }
- }
- else
- {
- abort ();
- }
- break;
-
- case R_386_TLS_LDO_32:
- value = symref[idx]->merge.value - ld_state.tls_start;
- store_4ubyte_unaligned (relloc, value);
- break;
-
- case R_386_TLS_GD:
- if (ld_state.file_type == executable_file_type)
- {
- if (symref[idx]->defined && !symref[idx]->in_dso)
- {
- /* The symbol is defined in the executable.
- Perform the GD->LE optimization. */
- static const char gd_to_le[] =
- {
- /* mov %gs:0x0,%eax */
- 0x65, 0xa1, 0x00, 0x00, 0x00, 0x00,
- /* sub $OFFSET,%eax */
- 0x81, 0xe8
- };
-#ifndef NDEBUG
- static const char gd_text[] =
- {
- /* lea 0x0(,%ebx,1),%eax */
- 0x8d, 0x04, 0x1d, 0x00, 0x00, 0x00, 0x00,
- /* call ___tls_get_addr */
- 0xe8
- };
- assert (memcmp (relloc - 3, gd_text, sizeof (gd_text))
- == 0);
-#endif
- relloc = mempcpy (relloc - 3, gd_to_le,
- sizeof (gd_to_le));
- value = ld_state.tls_tcb- symref[idx]->merge.value;
- store_4ubyte_unaligned (relloc, value);
-
- /* We have to skip over the next relocation which is
- the matching R_i386_PLT32 for __tls_get_addr. */
- ++cnt;
-#ifndef NDEBUG
- assert (cnt < nrels);
- XElf_Off old_offset = rel->r_offset;
- xelf_getrel (reldata, cnt, rel);
- assert (rel != NULL);
- assert (XELF_R_TYPE (rel->r_info) == R_386_PLT32);
- idx = XELF_R_SYM (rel->r_info);
- assert (strcmp (symref[idx]->name, "___tls_get_addr")
- == 0);
- assert (old_offset + 5 == rel->r_offset);
-#endif
-
- break;
- }
- }
- abort ();
- break;
-
- case R_386_32PLT:
- case R_386_TLS_TPOFF:
- case R_386_TLS_GOTIE:
- case R_386_TLS_LDM:
- case R_386_16:
- case R_386_PC16:
- case R_386_8:
- case R_386_PC8:
- case R_386_TLS_GD_32:
- case R_386_TLS_GD_PUSH:
- case R_386_TLS_GD_CALL:
- case R_386_TLS_GD_POP:
- case R_386_TLS_LDM_32:
- case R_386_TLS_LDM_PUSH:
- case R_386_TLS_LDM_CALL:
- case R_386_TLS_LDM_POP:
- case R_386_TLS_IE_32:
- case R_386_TLS_LE_32:
- // XXX For now fall through
- break;
-
- case R_386_NONE:
- /* Nothing to do. */
- break;
-
- case R_386_COPY:
- case R_386_JMP_SLOT:
- case R_386_RELATIVE:
- case R_386_GLOB_DAT:
- case R_386_TLS_DTPMOD32:
- case R_386_TLS_DTPOFF32:
- case R_386_TLS_TPOFF32:
- default:
- /* Should not happen. */
- abort ();
- }
- }
- }
- while ((runp = runp->next) != first);
-}
-
-
-int
-elf_i386_ld_init (struct ld_state *statep)
-{
- /* We have a few callbacks available. */
- old_open_outfile = statep->callbacks.open_outfile;
- statep->callbacks.open_outfile = elf_i386_open_outfile;
-
- statep->callbacks.relocate_section = elf_i386_relocate_section;
-
- statep->callbacks.initialize_plt = elf_i386_initialize_plt;
- statep->callbacks.initialize_pltrel = elf_i386_initialize_pltrel;
-
- statep->callbacks.initialize_got = elf_i386_initialize_got;
- statep->callbacks.initialize_gotplt = elf_i386_initialize_gotplt;
-
- statep->callbacks.finalize_plt = elf_i386_finalize_plt;
-
- statep->callbacks.rel_type = elf_i386_rel_type;
-
- statep->callbacks.count_relocations = elf_i386_count_relocations;
-
- statep->callbacks.create_relocations = elf_i386_create_relocations;
-
- return 0;
-}
diff --git a/src/ld.c b/src/ld.c
deleted file mode 100644
index 59dccb5..0000000
--- a/src/ld.c
+++ /dev/null
@@ -1,1607 +0,0 @@
-/* Copyright (C) 2001-2010, 2012 Red Hat, Inc.
- This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
-
- 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/>. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <argp.h>
-#include <assert.h>
-#include <error.h>
-#include <fcntl.h>
-#include <libelf.h>
-#include <libintl.h>
-#include <locale.h>
-#include <stdio.h>
-#include <stdio_ext.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <system.h>
-#include "ld.h"
-#include "list.h"
-
-
-/* Name and version of program. */
-static void print_version (FILE *stream, struct argp_state *state);
-ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
-
-/* Bug report address. */
-ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT;
-
-
-/* Values for the various options. */
-enum
- {
- ARGP_whole_archive = 300,
- ARGP_no_whole_archive,
- ARGP_static,
- ARGP_dynamic,
- ARGP_pagesize,
- ARGP_rpath_link,
- ARGP_runpath,
- ARGP_runpath_link,
- ARGP_version_script,
- ARGP_gc_sections,
- ARGP_no_gc_sections,
- ARGP_no_undefined,
- ARGP_conserve,
- ARGP_as_needed,
- ARGP_no_as_needed,
- ARGP_eh_frame_hdr,
- ARGP_hash_style,
- ARGP_build_id,
-#if YYDEBUG
- ARGP_yydebug,
-#endif
- };
-
-
-/* Definitions of arguments for argp functions. */
-static const struct argp_option options[] =
-{
- { NULL, 0, NULL, 0, N_("Input File Control:"), 0 },
- { "whole-archive", ARGP_whole_archive, NULL, 0,
- N_("Include whole archives in the output from now on."), 0 },
- { "no-whole-archive", ARGP_no_whole_archive, NULL, 0,
- N_("Stop including the whole archives in the output."), 0 },
- { NULL, 'l', N_("FILE"), OPTION_HIDDEN, NULL, 0 },
- { "start-group", '(', NULL, 0, N_("Start a group."), 0 },
- { "end-group", ')', NULL, 0, N_("End a group."), 0 },
- { NULL, 'L', N_("PATH"), 0,
- N_("Add PATH to list of directories files are searched in."), 0 },
- { "as-needed", ARGP_as_needed, NULL, 0,
- N_("Only set DT_NEEDED for following dynamic libs if actually used"), 0 },
- { "no-as-needed", ARGP_no_as_needed, NULL, 0,
- N_("Always set DT_NEEDED for following dynamic libs"), 0 },
- { "rpath-link", ARGP_rpath_link, "PATH", OPTION_HIDDEN, NULL, 0 },
- { NULL, 'i', NULL, 0, N_("Ignore LD_LIBRARY_PATH environment variable."),
- 0 },
-
- { NULL, 0, NULL, 0, N_("Output File Control:"), 0 },
- { "output", 'o', N_("FILE"), 0, N_("Place output in FILE."), 0 },
- { NULL, 'z', "KEYWORD", OPTION_HIDDEN, NULL, 0 },
- { "-z nodefaultlib", '\0', NULL, OPTION_DOC,
- N_("Object is marked to not use default search path at runtime."), 0 },
- { "-z allextract", '\0', NULL, OPTION_DOC,
- N_("Same as --whole-archive."), 0 },
- { "-z defaultextract", '\0', NULL, OPTION_DOC, N_("\
-Default rules of extracting from archive; weak references are not enough."),
- 0 },
- { "-z weakextract", '\0', NULL, OPTION_DOC,
- N_("Weak references cause extraction from archive."), 0 },
- { "-z muldefs", '\0', NULL, OPTION_DOC,
- N_("Allow multiple definitions; first is used."), 0 },
- { "-z defs | nodefs", '\0', NULL, OPTION_DOC,
- N_("Disallow/allow undefined symbols in DSOs."), 0 },
- { "no-undefined", ARGP_no_undefined, NULL, OPTION_HIDDEN, NULL, 0 },
- { "-z origin", '\0', NULL, OPTION_DOC,
- N_("Object requires immediate handling of $ORIGIN."), 0 },
- { "-z now", '\0', NULL, OPTION_DOC,
- N_("Relocation will not be processed lazily."), 0 },
- { "-z nodelete", '\0', NULL, OPTION_DOC,
- N_("Object cannot be unloaded at runtime."), 0 },
- { "-z initfirst", '\0', NULL, OPTION_DOC,
- N_("Mark object to be initialized first."), 0 },
- { "-z lazyload | nolazyload", '\0', NULL, OPTION_DOC,
- N_("Enable/disable lazy-loading flag for following dependencies."), 0 },
- { "-z nodlopen", '\0', NULL, OPTION_DOC,
- N_("Mark object as not loadable with 'dlopen'."), 0 },
- { "-z ignore | record", '\0', NULL, OPTION_DOC,
- N_("Ignore/record dependencies on unused DSOs."), 0 },
- { "-z systemlibrary", '\0', NULL, OPTION_DOC,
- N_("Generated DSO will be a system library."), 0 },
- { "entry", 'e', N_("ADDRESS"), 0, N_("Set entry point address."), 0 },
- { "static", ARGP_static, NULL, OPTION_HIDDEN, NULL, 0 },
- { "-B static", ARGP_static, NULL, OPTION_DOC,
- N_("Do not link against shared libraries."), 0 },
- { "dynamic", ARGP_dynamic, NULL, OPTION_HIDDEN, NULL, 0 },
- { "-B dynamic", ARGP_dynamic, NULL, OPTION_DOC,
- N_("Prefer linking against shared libraries."), 0 },
- { "export-dynamic", 'E', NULL, 0, N_("Export all dynamic symbols."), 0 },
- { "strip-all", 's', NULL, 0, N_("Strip all symbols."), 0 },
- { "strip-debug", 'S', NULL, 0, N_("Strip debugging symbols."), 0 },
- { "pagesize", ARGP_pagesize, "SIZE", 0,
- N_("Assume pagesize for the target system to be SIZE."), 0 },
- { "rpath", 'R', "PATH", OPTION_HIDDEN, NULL, 0 },
- { "runpath", ARGP_runpath, "PATH", 0, N_("Set runtime DSO search path."),
- 0 },
- { "runpath-link", ARGP_runpath_link, "PATH", 0,
- N_("Set link time DSO search path."), 0 },
- { "shared", 'G', NULL, 0, N_("Generate dynamic shared object."), 0 },
- { NULL, 'r', NULL, 0L, N_("Generate relocatable object."), 0 },
- { NULL, 'B', "KEYWORD", OPTION_HIDDEN, "", 0 },
- { "-B local", 'B', NULL, OPTION_DOC,
- N_("Causes symbol not assigned to a version be reduced to local."), 0 },
- { "gc-sections", ARGP_gc_sections, NULL, 0, N_("Remove unused sections."),
- 0 },
- { "no-gc-sections", ARGP_no_gc_sections, NULL, 0,
- N_("Don't remove unused sections."), 0 },
- { "soname", 'h', "NAME", 0, N_("Set soname of shared object."), 0 },
- { "dynamic-linker", 'I', "NAME", 0, N_("Set the dynamic linker name."), 0 },
- { NULL, 'Q', "YN", OPTION_HIDDEN, NULL, 0 },
- { "-Q y | n", 'Q', NULL, OPTION_DOC,
- N_("Add/suppress addition indentifying link-editor to .comment section."),
- 0 },
- { "eh-frame-hdr", ARGP_eh_frame_hdr, NULL, 0,
- N_("Create .eh_frame_hdr section"), 0 },
- { "hash-style", ARGP_hash_style, "STYLE", 0,
- N_("Set hash style to sysv, gnu or both."), 0 },
- { "build-id", ARGP_build_id, "STYLE", OPTION_ARG_OPTIONAL,
- N_("Generate build ID note (md5, sha1 (default), uuid)."), 0 },
-
- { NULL, 0, NULL, 0, N_("Linker Operation Control:"), 0 },
- { "verbose", 'v', NULL, 0, N_("Verbose messages."), 0 },
- { "trace", 't', NULL, 0, N_("Trace file opens."), 0 },
- { "conserve-memory", ARGP_conserve, NULL, 0,
- N_("Trade speed for less memory usage"), 0 },
- { NULL, 'O', N_("LEVEL"), OPTION_ARG_OPTIONAL,
- N_("Set optimization level to LEVEL."), 0 },
- { NULL, 'c', N_("FILE"), 0, N_("Use linker script in FILE."), 0 },
-#if YYDEBUG
- { "yydebug", ARGP_yydebug, NULL, 0,
- N_("Select to get parser debug information"), 0 },
-#endif
- { "version-script", ARGP_version_script, "FILE", 0,
- N_("Read version information from FILE."), 0 },
- { "emulation", 'm', "NAME", 0, N_("Set emulation to NAME."), 0 },
-
- { NULL, 0, NULL, 0, NULL, 0 }
-};
-
-/* Short description of program. */
-static const char doc[] = N_("Combine object and archive files.");
-
-/* Strings for arguments in help texts. */
-static const char args_doc[] = N_("[FILE]...");
-
-/* Prototype for option handler. */
-static void replace_args (int argc, char *argv[]);
-static error_t parse_opt_1st (int key, char *arg, struct argp_state *state);
-static error_t parse_opt_2nd (int key, char *arg, struct argp_state *state);
-
-/* Data structure to communicate with argp functions. */
-static struct argp argp_1st =
-{
- options, parse_opt_1st, args_doc, doc, NULL, NULL, NULL
-};
-static struct argp argp_2nd =
-{
- options, parse_opt_2nd, args_doc, doc, NULL, NULL, NULL
-};
-
-
-/* Linker state. This contains all global information. */
-struct ld_state ld_state;
-
-/* List of the input files. */
-static struct file_list
-{
- const char *name;
- struct file_list *next;
-} *input_file_list;
-
-/* If nonzero be verbose. */
-int verbose;
-
-/* If nonzero, trade speed for less memory/address space usage. */
-int conserve_memory;
-
-/* The emulation name to use. */
-static const char *emulation;
-
-/* Keep track of the nesting level. Even though we don't handle nested
- groups we still keep track to improve the error messages. */
-static int group_level;
-
-/* The last file we processed. */
-static struct usedfiles *last_file;
-
-/* The default linker script. */
-/* XXX We'll do this a bit different in the real solution. */
-static const char *linker_script = SRCDIR "/elf32-i386.script";
-
-/* Nonzero if an error occurred while loading the input files. */
-static int error_loading;
-
-
-/* Intermediate storage for the LD_LIBRARY_PATH information from the
- environment. */
-static char *ld_library_path1;
-
-/* Flag used to communicate with the scanner. */
-int ld_scan_version_script;
-
-/* Name of the input file. */
-const char *ldin_fname;
-
-/* Define by parser if required. */
-extern int lddebug;
-
-
-/* Prototypes for local functions. */
-static void parse_z_option (const char *arg);
-static void parse_z_option_2 (const char *arg);
-static void parse_B_option (const char *arg);
-static void parse_B_option_2 (const char *arg);
-static void determine_output_format (void);
-static void load_needed (void);
-static void collect_sections (void);
-static void add_rxxpath (struct pathelement **pathp, const char *str);
-static void gen_rxxpath_data (void);
-static void read_version_script (const char *fname);
-static void create_lscript_symbols (void);
-static void create_special_section_symbol (struct symbol **symp,
- const char *name);
-
-
-int
-main (int argc, char *argv[])
-{
- int remaining;
- int err;
-
- /* Sanity check. We always want to use the LFS functionality. */
- if (sizeof (off_t) != 8)
- abort ();
-
- /* We use no threads here which can interfere with handling a stream. */
- __fsetlocking (stdin, FSETLOCKING_BYCALLER);
- __fsetlocking (stdout, FSETLOCKING_BYCALLER);
- __fsetlocking (stderr, FSETLOCKING_BYCALLER);
-
- /* Set locale. */
- setlocale (LC_ALL, "");
-
- /* Make sure the message catalog can be found. */
- bindtextdomain (PACKAGE_TARNAME, LOCALEDIR);
-
- /* Initialize the message catalog. */
- textdomain (PACKAGE_TARNAME);
-
- /* Before we start tell the ELF library which version we are using. */
- elf_version (EV_CURRENT);
-
- /* The user can use the LD_LIBRARY_PATH environment variable to add
- additional lookup directories. */
- ld_library_path1 = getenv ("LD_LIBRARY_PATH");
-
- /* Initialize the memory handling. */
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
- obstack_init (&ld_state.smem);
-
- /* Recognize old-style parameters for compatibility. */
- replace_args (argc, argv);
-
- /* One quick pass over the parameters which allows us to scan for options
- with global effect which influence the rest of the processing. */
- argp_parse (&argp_1st, argc, argv, ARGP_IN_ORDER, &remaining, NULL);
-
- /* We need at least one input file. */
- if (input_file_list == NULL)
- {
- error (0, 0, gettext ("At least one input file needed"));
- argp_help (&argp_1st, stderr, ARGP_HELP_SEE, "ld");
- exit (EXIT_FAILURE);
- }
-
- /* Determine which ELF backend to use. */
- determine_output_format ();
-
- /* If no hash style was specific default to the oldand slow SysV
- method. */
- if (unlikely (ld_state.hash_style == hash_style_none))
- ld_state.hash_style = hash_style_sysv;
-
- /* Prepare state. */
- err = ld_prepare_state (emulation);
- if (err != 0)
- error (EXIT_FAILURE, 0, gettext ("error while preparing linking"));
-
- /* XXX Read the linker script now. Since we later will have the linker
- script built in we don't go into trouble to make sure we handle GROUP
- statements in the script. This simply must not happen. */
- ldin = fopen (linker_script, "r");
- if (ldin == NULL)
- error (EXIT_FAILURE, errno, gettext ("cannot open linker script '%s'"),
- linker_script);
- /* No need for locking. */
- __fsetlocking (ldin, FSETLOCKING_BYCALLER);
-
- ld_state.srcfiles = NULL;
- ldlineno = 1;
- ld_scan_version_script = 0;
- ldin_fname = linker_script;
- if (ldparse () != 0)
- /* Something went wrong during parsing. */
- exit (EXIT_FAILURE);
- fclose (ldin);
-
- /* We now might have a list of directories to look for libraries in
- named by the linker script. Put them in a different list so that
- they are searched after all paths given by the user on the
- command line. */
- ld_state.default_paths = ld_state.paths;
- ld_state.paths = ld_state.tailpaths = NULL;
-
- /* Get runpath/rpath information in usable form. */
- gen_rxxpath_data ();
-
- /* Parse and process arguments for real. */
- argp_parse (&argp_2nd, argc, argv, ARGP_IN_ORDER, &remaining, NULL);
- /* All options should have been processed by the argp parser. */
- assert (remaining == argc);
-
- /* Process the last file. */
- while (last_file != NULL)
- /* Try to open the file. */
- error_loading |= FILE_PROCESS (-1, last_file, &ld_state, &last_file);
-
- /* Stop if there has been a problem while reading the input files. */
- if (error_loading)
- exit (error_loading);
-
- /* See whether all opened -( were closed. */
- if (group_level > 0)
- {
- error (0, 0, gettext ("-( without matching -)"));
- argp_help (&argp_1st, stderr, ARGP_HELP_SEE, "ld");
- exit (EXIT_FAILURE);
- }
-
- /* When we create a relocatable file we don't have to look for the
- DT_NEEDED DSOs and we also don't test for undefined symbols. */
- if (ld_state.file_type != relocatable_file_type)
- {
- /* At this point we have loaded all the direct dependencies. What
- remains to be done is find the indirect dependencies. These are
- DSOs which are referenced by the DT_NEEDED entries in the DSOs
- which are direct dependencies. We have to transitively find and
- load all these dependencies. */
- load_needed ();
-
- /* At this point all object files and DSOs are read. If there
- are still undefined symbols left they might have to be
- synthesized from the linker script. */
- create_lscript_symbols ();
-
- /* Now that we have loaded all the object files we can determine
- whether we have any non-weak unresolved references left. If
- there are any we stop. If the user used the '-z nodefs' option
- and we are creating a DSO don't perform the tests. */
- if (FLAG_UNRESOLVED (&ld_state) != 0)
- exit (1);
- }
-
- /* Collect information about the relocations which will be carried
- forward into the output. We have to do this here and now since
- we need to know which sections have to be created. */
- if (ld_state.file_type != relocatable_file_type)
- {
- void *p ;
- struct scnhead *h;
-
- p = NULL;
- while ((h = ld_section_tab_iterate (&ld_state.section_tab, &p)) != NULL)
- if (h->type == SHT_REL || h->type == SHT_RELA)
- {
- struct scninfo *runp = h->last;
- do
- {
- /* If we are processing the relocations determine how
- many will be in the output file. Also determine
- how many GOT entries are needed. */
- COUNT_RELOCATIONS (&ld_state, runp);
-
- ld_state.relsize_total += runp->relsize;
- }
- while ((runp = runp->next) != h->last);
- }
- }
-
- /* Not part of the gABI, but part of every psABI: the symbols for the
- GOT section. Add the symbol if necessary. */
- if (ld_state.need_got)
- create_special_section_symbol (&ld_state.got_symbol,
- "_GLOBAL_OFFSET_TABLE_");
- /* Similarly for the _DYNAMIC symbol which points to the dynamic
- section. */
- if (dynamically_linked_p ())
- create_special_section_symbol (&ld_state.dyn_symbol, "_DYNAMIC");
-
- /* We are ready to start working on the output file. Not all
- information has been gather or created yet. This will be done as
- we go. Open the file now. */
- if (OPEN_OUTFILE (&ld_state, EM_NONE, ELFCLASSNONE, ELFDATANONE) != 0)
- exit (1);
-
- /* Create the sections which are generated by the linker and are not
- present in the input file. The output file must already have
- been opened since we need the ELF descriptor to deduce type
- sizes. */
- GENERATE_SECTIONS (&ld_state);
-
- /* At this point we have read all the files and know all the
- sections which have to be linked into the application. We do now
- create an array listing all the sections. We will than pass this
- array to a system specific function which can reorder it at will.
- The functions can also merge sections if this is what is
- wanted. */
- collect_sections ();
-
- /* Create the output sections now. This may requires sorting them
- first. */
- CREATE_SECTIONS (&ld_state);
-
- /* Create the output file data. Appropriate code for the selected
- output file type is called. */
- if (CREATE_OUTFILE (&ld_state) != 0)
- exit (1);
-
- /* Finalize the output file, write the data out. */
- err |= FINALIZE (&ld_state);
-
- /* Return with an non-zero exit status also if any error message has
- been printed. */
- return err | (error_message_count != 0);
-}
-
-
-static void
-replace_args (int argc, char *argv[])
-{
- static const struct
- {
- const char *from;
- const char *to;
- } args[] =
- {
- { "-export-dynamic", "--export-dynamic" },
- { "-dynamic-linker", "--dynamic-linker" },
- { "-static", "--static" },
- };
- const size_t nargs = sizeof (args) / sizeof (args[0]);
-
- for (int i = 1; i < argc; ++i)
- if (argv[i][0] == '-' && islower (argv[i][1]) && argv[i][2] != '\0')
- for (size_t j = 0; j < nargs; ++j)
- if (strcmp (argv[i], args[j].from) == 0)
- {
- argv[i] = (char *) args[j].to;
- break;
- }
-}
-
-
-static int
-valid_hexarg (const char *arg)
-{
- if (strncasecmp (arg, "0x", 2) != 0)
- return 0;
-
- arg += 2;
- do
- {
- if (isxdigit (arg[0]) && isxdigit (arg[1]))
- {
- arg += 2;
- if (arg[0] == '-' || arg[0] == ':')
- ++arg;
- }
- else
- return 0;
- }
- while (*arg != '\0');
-
- return 1;
-}
-
-
-/* Quick scan of the parameter list for options with global effect. */
-static error_t
-parse_opt_1st (int key, char *arg,
- struct argp_state *state __attribute__ ((unused)))
-{
- switch (key)
- {
- case 'B':
- parse_B_option (arg);
- break;
-
- case 'c':
- linker_script = arg;
- break;
-
- case 'E':
- ld_state.export_all_dynamic = true;
- break;
-
- case 'G':
- if (ld_state.file_type != no_file_type)
- error (EXIT_FAILURE, 0,
- gettext ("only one option of -G and -r is allowed"));
- ld_state.file_type = dso_file_type;
-
- /* If we generate a DSO we have to export all symbols. */
- ld_state.export_all_dynamic = true;
- break;
-
- case 'h':
- ld_state.soname = arg;
- break;
-
- case 'i':
- /* Discard the LD_LIBRARY_PATH value we found. */
- ld_library_path1 = NULL;
- break;
-
- case 'I':
- ld_state.interp = arg;
- break;
-
- case 'm':
- if (emulation != NULL)
- error (EXIT_FAILURE, 0, gettext ("more than one '-m' parameter"));
- emulation = arg;
- break;
-
- case 'Q':
- if (arg[1] == '\0' && (arg[0] == 'y' || arg[0] == 'Y'))
- ld_state.add_ld_comment = true;
- else if (arg[1] == '\0' && (arg[0] == 'n' || arg[0] == 'N'))
- ld_state.add_ld_comment = true;
- else
- error (EXIT_FAILURE, 0, gettext ("unknown option `-%c %s'"), 'Q', arg);
- break;
-
- case 'r':
- if (ld_state.file_type != no_file_type)
- error (EXIT_FAILURE, 0,
- gettext ("only one option of -G and -r is allowed"));
- ld_state.file_type = relocatable_file_type;
- break;
-
- case 'S':
- ld_state.strip = strip_debug;
- break;
-
- case 't':
- ld_state.trace_files = true;
- break;
-
- case 'v':
- verbose = 1;
- break;
-
- case 'z':
- /* The SysV linker used 'z' to pass various flags to the linker.
- We follow this. See 'parse_z_option' for the options we
- recognize. */
- parse_z_option (arg);
- break;
-
- case ARGP_pagesize:
- {
- char *endp;
- ld_state.pagesize = strtoul (arg, &endp, 0);
- if (*endp != '\0')
- {
- if (endp[1] == '\0' && tolower (*endp) == 'k')
- ld_state.pagesize *= 1024;
- else if (endp[1] == '\0' && tolower (*endp) == 'm')
- ld_state.pagesize *= 1024 * 1024;
- else
- {
- error (0, 0,
- gettext ("invalid page size value '%s': ignored"),
- arg);
- ld_state.pagesize = 0;
- }
- }
- }
- break;
-
- case 'R':
- add_rxxpath (&ld_state.rpath, arg);
- break;
-
- case ARGP_rpath_link:
- add_rxxpath (&ld_state.rpath_link, arg);
- break;
-
- case ARGP_runpath:
- add_rxxpath (&ld_state.runpath, arg);
- break;
-
- case ARGP_runpath_link:
- add_rxxpath (&ld_state.runpath_link, arg);
- break;
-
- case ARGP_gc_sections:
- case ARGP_no_gc_sections:
- ld_state.gc_sections = key == ARGP_gc_sections;
- break;
-
- case ARGP_eh_frame_hdr:
- ld_state.eh_frame_hdr = true;
- break;
-
- case ARGP_hash_style:
- if (strcmp (arg, "gnu") == 0)
- ld_state.hash_style = hash_style_gnu;
- else if (strcmp (arg, "both") == 0)
- ld_state.hash_style = hash_style_gnu | hash_style_sysv;
- else if (strcmp (arg, "sysv") == 0)
- ld_state.hash_style = hash_style_sysv;
- else
- error (EXIT_FAILURE, 0, gettext ("invalid hash style '%s'"), arg);
- break;
-
- case ARGP_build_id:
- if (arg == NULL)
- ld_state.build_id = "sha1";
- else if (strcmp (arg, "uuid") != 0
- && strcmp (arg, "md5") != 0
- && strcmp (arg, "sha1") != 0
- && !valid_hexarg (arg))
- error (EXIT_FAILURE, 0, gettext ("invalid build-ID style '%s'"), arg);
- else
- ld_state.build_id = arg;
- break;
-
- case 's':
- if (arg == NULL)
- {
- if (ld_state.strip == strip_all)
- ld_state.strip = strip_everything;
- else
- ld_state.strip = strip_all;
- break;
- }
- /* FALLTHROUGH */
-
- case 'e':
- case 'o':
- case 'O':
- case ARGP_whole_archive:
- case ARGP_no_whole_archive:
- case ARGP_as_needed:
- case ARGP_no_as_needed:
- case 'L':
- case '(':
- case ')':
- case 'l':
- case ARGP_static:
- case ARGP_dynamic:
- case ARGP_version_script:
- /* We'll handle these in the second pass. */
- break;
-
- case ARGP_KEY_ARG:
- {
- struct file_list *newp;
-
- newp = (struct file_list *) xmalloc (sizeof (struct file_list));
- newp->name = arg;
-#ifndef NDEBUG
- newp->next = NULL;
-#endif
- CSNGL_LIST_ADD_REAR (input_file_list, newp);
- }
- break;
-
-#if YYDEBUG
- case ARGP_yydebug:
- lddebug = 1;
- break;
-#endif
-
- case ARGP_no_undefined:
- ld_state.nodefs = false;
- break;
-
- case ARGP_conserve:
- conserve_memory = 1;
- break;
-
- default:
- return ARGP_ERR_UNKNOWN;
- }
- return 0;
-}
-
-
-/* Handle program arguments for real. */
-static error_t
-parse_opt_2nd (int key, char *arg,
- struct argp_state *state __attribute__ ((unused)))
-{
- static bool group_start_requested;
- static bool group_end_requested;
-
- switch (key)
- {
- case 'B':
- parse_B_option_2 (arg);
- break;
-
- case 'e':
- ld_state.entry = arg;
- break;
-
- case 'o':
- if (ld_state.outfname != NULL)
- {
- error (0, 0, gettext ("More than one output file name given."));
- see_help:
- argp_help (&argp_2nd, stderr, ARGP_HELP_SEE, "ld");
- exit (EXIT_FAILURE);
- }
- ld_state.outfname = arg;
- break;
-
- case 'O':
- if (arg == NULL)
- ld_state.optlevel = 1;
- else
- {
- char *endp;
- unsigned long int level = strtoul (arg, &endp, 10);
- if (*endp != '\0')
- {
- error (0, 0, gettext ("Invalid optimization level `%s'"), arg);
- goto see_help;
- }
- ld_state.optlevel = level;
- }
- break;
-
- case ARGP_whole_archive:
- ld_state.extract_rule = allextract;
- break;
- case ARGP_no_whole_archive:
- ld_state.extract_rule = defaultextract;
- break;
-
- case ARGP_as_needed:
- ld_state.as_needed = true;
- break;
- case ARGP_no_as_needed:
- ld_state.as_needed = false;
- break;
-
- case ARGP_static:
- case ARGP_dynamic:
- /* Enable/disable use for DSOs. */
- ld_state.statically = key == ARGP_static;
- break;
-
- case 'z':
- /* The SysV linker used 'z' to pass various flags to the linker.
- We follow this. See 'parse_z_option' for the options we
- recognize. */
- parse_z_option_2 (arg);
- break;
-
- case ARGP_version_script:
- read_version_script (arg);
- break;
-
- case 'L':
- /* Add a new search directory. */
- ld_new_searchdir (arg);
- break;
-
- case '(':
- /* Start a link group. We have to be able to determine the object
- file which is named next. Do this by remembering a pointer to
- the pointer which will point to the next object. */
- if (verbose && (group_start_requested || !group_end_requested))
- error (0, 0, gettext ("nested -( -) groups are not allowed"));
-
- /* Increment the nesting level. */
- ++group_level;
-
- /* Record group start. */
- group_start_requested = true;
- group_end_requested = false;
- break;
-
- case ')':
- /* End a link group. If there is no group open this is clearly
- a bug. If there is a group open insert a back reference
- pointer in the record for the last object of the group. If
- there is no new object or just one don't do anything. */
- if (!group_end_requested)
- {
- if (group_level == 0)
- {
- error (0, 0, gettext ("-) without matching -("));
- goto see_help;
- }
- }
- else
- last_file->group_end = true;
-
- if (group_level > 0)
- --group_level;
- break;
-
- case 'l':
- case ARGP_KEY_ARG:
- {
- while (last_file != NULL)
- /* Try to open the file. */
- error_loading |= FILE_PROCESS (-1, last_file, &ld_state, &last_file);
-
- last_file = ld_new_inputfile (arg,
- key == 'l'
- ? archive_file_type
- : relocatable_file_type);
- if (group_start_requested)
- {
- last_file->group_start = true;
-
- group_start_requested = false;
- group_end_requested = true;
- }
- }
- break;
-
- default:
- /* We can catch all other options here. They either have
- already been handled or, if the parameter was not correct,
- the error has been reported. */
- break;
- }
- return 0;
-}
-
-
-/* Load all the DSOs named as dependencies in other DSOs we already
- loaded. */
-static void
-load_needed (void)
-{
- struct usedfiles *first;
- struct usedfiles *runp;
-
- /* XXX There is one problem here: do we allow references from
- regular object files to be satisfied by these implicit
- dependencies? The old linker allows this and several libraries
- depend on this. Solaris' linker does not allow this; it provides
- the user with a comprehensive error message explaining the
- situation.
-
- XXX IMO the old ld behavior is correct since this is also how the
- dynamic linker will work. It will look for unresolved references
- in all loaded DSOs.
-
- XXX Should we add an option to get Solaris compatibility? */
- if (ld_state.needed == NULL)
- return;
-
- runp = first = ld_state.needed->next;
- do
- {
- struct usedfiles *ignore;
- struct usedfiles *next = runp->next;
- int err;
-
- err = FILE_PROCESS (-1, runp, &ld_state, &ignore);
- if (err != 0)
- /* Something went wrong. */
- exit (err);
-
- runp = next;
- }
- while (runp != first);
-}
-
-
-/* Print the version information. */
-static void
-print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
-{
- fprintf (stream, "ld (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
- fprintf (stream, gettext ("\
-Copyright (C) %s Red Hat, Inc.\n\
-This is free software; see the source for copying conditions. There is NO\n\
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2012");
- fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
-}
-
-
-/* There are a lot of -z options, parse them here. Some of them have
- to be parsed in the first pass, others must be handled in the
- second pass. */
-static void
-parse_z_option (const char *arg)
-{
- if (strcmp (arg, "nodefaultlib") == 0
- /* This is only meaningful if we create a DSO. */
- && ld_state.file_type == dso_file_type)
- ld_state.dt_flags_1 |= DF_1_NODEFLIB;
- else if (strcmp (arg, "muldefs") == 0)
- ld_state.muldefs = true;
- else if (strcmp (arg, "nodefs") == 0)
- ld_state.nodefs = true;
- else if (strcmp (arg, "defs") == 0)
- ld_state.nodefs = false;
- else if (strcmp (arg, "now") == 0)
- /* We could also set the DF_1_NOW flag in DT_FLAGS_1 but this isn't
- necessary. */
- ld_state.dt_flags |= DF_BIND_NOW;
- else if (strcmp (arg, "origin") == 0)
- /* We could also set the DF_1_ORIGIN flag in DT_FLAGS_1 but this isn't
- necessary. */
- ld_state.dt_flags |= DF_ORIGIN;
- else if (strcmp (arg, "nodelete") == 0
- /* This is only meaningful if we create a DSO. */
- && ld_state.file_type == dso_file_type)
- ld_state.dt_flags_1 |= DF_1_NODELETE;
- else if (strcmp (arg, "initfirst") == 0)
- ld_state.dt_flags_1 |= DF_1_INITFIRST;
- else if (strcmp (arg, "nodlopen") == 0
- /* This is only meaningful if we create a DSO. */
- && ld_state.file_type == dso_file_type)
- ld_state.dt_flags_1 |= DF_1_NOOPEN;
- else if (strcmp (arg, "systemlibrary") == 0)
- ld_state.is_system_library = true;
- else if (strcmp (arg, "execstack") == 0)
- ld_state.execstack = execstack_true;
- else if (strcmp (arg, "noexecstack") == 0)
- ld_state.execstack = execstack_false_force;
- else if (strcmp (arg, "allextract") != 0
- && strcmp (arg, "defaultextract") != 0
- && strcmp (arg, "weakextract") != 0
- && strcmp (arg, "lazyload") != 0
- && strcmp (arg, "nolazyload") != 0
- && strcmp (arg, "ignore") != 0
- && strcmp (arg, "record") != 0)
- error (0, 0, gettext ("unknown option `-%c %s'"), 'z', arg);
-}
-
-
-static void
-parse_z_option_2 (const char *arg)
-{
- if (strcmp (arg, "allextract") == 0)
- ld_state.extract_rule = allextract;
- else if (strcmp (arg, "defaultextract") == 0)
- ld_state.extract_rule = defaultextract;
- else if (strcmp (arg, "weakextract") == 0)
- ld_state.extract_rule = weakextract;
- else if (strcmp (arg, "lazyload") == 0)
- ld_state.lazyload = true;
- else if (strcmp (arg, "nolazyload") == 0)
- ld_state.lazyload = false;
- else if (strcmp (arg, "ignore") == 0)
- ld_state.as_needed = true;
- else if (strcmp (arg, "record") == 0)
- ld_state.as_needed = false;
-}
-
-
-/* There are a lot of -B options, parse them here. */
-static void
-parse_B_option (const char *arg)
-{
- if (strcmp (arg, "local") == 0)
- ld_state.default_bind_local = true;
- else if (strcmp (arg, "symbolic") != 0
- && strcmp (arg, "static") != 0
- && strcmp (arg, "dynamic") != 0)
- error (0, 0, gettext ("unknown option '-%c %s'"), 'B', arg);
-}
-
-
-/* The same functionality, but called in the second pass over the
- parameters. */
-static void
-parse_B_option_2 (const char *arg)
-{
- if (strcmp (arg, "static") == 0)
- ld_state.statically = true;
- else if (strcmp (arg, "dynamic") == 0)
- ld_state.statically = false;
- else if (strcmp (arg, "symbolic") == 0
- /* This is only meaningful if we create a DSO. */
- && ld_state.file_type == dso_file_type)
- ld_state.dt_flags |= DF_SYMBOLIC;
-}
-
-
-static inline int
-try (int fd, Elf *elf)
-{
- int result = 0;
-
- if (elf == NULL)
- return 0;
-
- if (elf_kind (elf) == ELF_K_ELF)
- {
- /* We have an ELF file. We now can find out
- what the output format should be. */
- XElf_Ehdr_vardef(ehdr);
-
- /* Get the ELF header of the object. */
- xelf_getehdr (elf, ehdr);
- if (ehdr != NULL)
- ld_state.ebl =
- ebl_openbackend_machine (ehdr->e_machine);
-
- result = 1;
- }
- else if (elf_kind (elf) == ELF_K_AR)
- {
- /* Try the archive members. This could
- potentially lead to wrong results if the
- archive contains files for more than one
- architecture. But this is the user's
- problem. */
- Elf *subelf;
- Elf_Cmd cmd = ELF_C_READ_MMAP;
-
- while ((subelf = elf_begin (fd, cmd, elf)) != NULL)
- {
- cmd = elf_next (subelf);
-
- if (try (fd, subelf) != 0)
- break;
- }
- }
-
- elf_end (elf);
-
- return result;
-}
-
-
-static void
-determine_output_format (void)
-{
- /* First change the 'input_file_list' variable in a simple
- single-linked list. */
- struct file_list *last = input_file_list;
- input_file_list = input_file_list->next;
- last->next = NULL;
-
- /* Determine the target configuration which we are supposed to use.
- The user can use the '-m' option to select one. If this is
- missing we are trying to load one file and determine the
- architecture from that. */
- if (emulation != NULL)
- {
- ld_state.ebl = ebl_openbackend_emulation (emulation);
-
- assert (ld_state.ebl != NULL);
- }
- else
- {
- /* Find an ELF input file and let it determine the ELf backend. */
- struct file_list *runp = input_file_list;
-
- while (runp != NULL)
- {
- int fd = open (runp->name, O_RDONLY);
- if (fd != -1)
- {
- if (try (fd, elf_begin (fd, ELF_C_READ_MMAP, NULL)) != 0)
- /* Found a file. */
- break;
- }
-
- runp = runp->next;
- }
-
- if (ld_state.ebl == NULL)
- {
- error (0, 0, gettext ("\
-could not find input file to determine output file format"));
- error (EXIT_FAILURE, 0, gettext ("\
-try again with an appropriate '-m' parameter"));
- }
- }
-
- /* We don't need the list of input files anymore. The second run over
- the parameters will handle them. */
- while (input_file_list != NULL)
- {
- struct file_list *oldp = input_file_list;
- input_file_list = input_file_list->next;
- free (oldp);
- }
-
- /* We also know now what kind of file we are supposed to create. If
- the user hasn't selected anythign we create and executable. */
- if (ld_state.file_type == no_file_type)
- ld_state.file_type = executable_file_type;
-}
-
-/* Add DIR to the list of directories searched for object files and
- libraries. */
-void
-ld_new_searchdir (const char *dir)
-{
- struct pathelement *newpath;
-
- newpath = (struct pathelement *)
- obstack_calloc (&ld_state.smem, sizeof (struct pathelement));
-
- newpath->pname = dir;
-
- /* Enqueue the file. */
- if (ld_state.tailpaths == NULL)
- ld_state.paths = ld_state.tailpaths = newpath->next = newpath;
- else
- {
- ld_state.tailpaths->next = newpath;
- ld_state.tailpaths = newpath;
- newpath->next = ld_state.paths;
- }
-}
-
-
-struct usedfiles *
-ld_new_inputfile (const char *fname, enum file_type type)
-{
- struct usedfiles *newfile = (struct usedfiles *)
- obstack_calloc (&ld_state.smem, sizeof (struct usedfiles));
-
- newfile->soname = newfile->fname = newfile->rfname = fname;
- newfile->file_type = type;
- newfile->extract_rule = ld_state.extract_rule;
- newfile->as_needed = ld_state.as_needed;
- newfile->lazyload = ld_state.lazyload;
- newfile->status = not_opened;
-
- return newfile;
-}
-
-
-/* Create an array listing all the sections. We will than pass this
- array to a system specific function which can reorder it at will.
- The functions can also merge sections if this is what is
- wanted. */
-static void
-collect_sections (void)
-{
- void *p ;
- struct scnhead *h;
- size_t cnt;
-
- /* We have that many sections. At least for now. */
- ld_state.nallsections = ld_state.section_tab.filled;
-
- /* Allocate the array. We allocate one more entry than computed so
- far since we might need a new section for the copy relocations. */
- ld_state.allsections =
- (struct scnhead **) obstack_alloc (&ld_state.smem,
- (ld_state.nallsections + 1)
- * sizeof (struct scnhead *));
-
- /* Fill the array. We rely here on the hash table iterator to
- return the entries in the order they were added. */
- cnt = 0;
- p = NULL;
- while ((h = ld_section_tab_iterate (&ld_state.section_tab, &p)) != NULL)
- {
- struct scninfo *runp;
- bool used = false;
-
- if (h->kind == scn_normal)
- {
- runp = h->last;
- do
- {
- if (h->type == SHT_REL || h->type == SHT_RELA)
- {
- if (runp->used)
- /* This is a relocation section. If the section
- it is relocating is used in the result so must
- the relocation section. */
- runp->used
- = runp->fileinfo->scninfo[SCNINFO_SHDR (runp->shdr).sh_info].used;
- }
-
- /* Accumulate the result. */
- used |= runp->used;
-
- /* Next input section. */
- runp = runp->next;
- }
- while (runp != h->last);
-
- h->used = used;
- }
-
- ld_state.allsections[cnt++] = h;
- }
- ld_state.nusedsections = cnt;
-
- assert (cnt == ld_state.nallsections);
-}
-
-
-/* Add given path to the end of list. */
-static void
-add_rxxpath (struct pathelement **pathp, const char *str)
-{
- struct pathelement *newp;
-
- /* The path elements can in theory be freed after we read all the
- files. But the amount of memory we are talking about is small
- and the cost of free() calls is not neglectable. */
- newp = (struct pathelement *) obstack_alloc (&ld_state.smem, sizeof (*newp));
- newp->pname = str;
- newp->exist = 0;
-#ifndef NDEBUG
- newp->next = NULL;
-#endif
-
- CSNGL_LIST_ADD_REAR (*pathp, newp);
-}
-
-
-/* Convert lists of possibly colon-separated directory lists into lists
- where each entry is for a single directory. */
-static void
-normalize_dirlist (struct pathelement **pathp)
-{
- struct pathelement *firstp = *pathp;
-
- do
- {
- const char *pname = (*pathp)->pname;
- const char *colonp = strchrnul (pname, ':');
-
- if (colonp != NULL)
- {
- struct pathelement *lastp = *pathp;
- struct pathelement *newp;
-
- while (1)
- {
- if (colonp == pname)
- lastp->pname = ".";
- else
- lastp->pname = obstack_strndup (&ld_state.smem, pname,
- colonp - pname);
-
- if (*colonp == '\0')
- break;
- pname = colonp + 1;
-
- newp = (struct pathelement *) obstack_alloc (&ld_state.smem,
- sizeof (*newp));
- newp->next = lastp->next;
- newp->exist = 0;
- lastp = lastp->next = newp;
-
- colonp = strchrnul (pname, ':');
- }
-
- pathp = &lastp->next;
- }
- else
- pathp = &(*pathp)->next;
- }
- while (*pathp != firstp);
-}
-
-
-/* Called after all parameters are parsed to bring the runpath/rpath
- information into a usable form. */
-static void
-gen_rxxpath_data (void)
-{
- char *ld_library_path2;
-
- /* Convert the information in true single-linked lists for easy use.
- At this point we also discard the rpath information if runpath
- information is provided. rpath is deprecated and should not be
- used (or ever be invented for that matter). */
- if (ld_state.rpath != NULL)
- {
- struct pathelement *endp = ld_state.rpath;
- ld_state.rpath = ld_state.rpath->next;
- endp->next = NULL;
- }
- if (ld_state.rpath_link != NULL)
- {
- struct pathelement *endp = ld_state.rpath_link;
- ld_state.rpath_link = ld_state.rpath_link->next;
- endp->next = NULL;
- }
-
- if (ld_state.runpath != NULL)
- {
- struct pathelement *endp = ld_state.runpath;
- ld_state.runpath = ld_state.runpath->next;
- endp->next = NULL;
-
- /* If rpath information is also available discard it.
- XXX Should there be a possibility to avoid this? */
- while (ld_state.rpath != NULL)
- {
- struct pathelement *old = ld_state.rpath;
- ld_state.rpath = ld_state.rpath->next;
- free (old);
- }
- }
- if (ld_state.runpath_link != NULL)
- {
- struct pathelement *endp = ld_state.runpath_link;
- ld_state.runpath_link = ld_state.runpath_link->next;
- endp->next = NULL;
-
- /* If rpath information is also available discard it.
- XXX Should there be a possibility to avoid this? */
- while (ld_state.rpath_link != NULL)
- {
- struct pathelement *old = ld_state.rpath_link;
- ld_state.rpath_link = ld_state.rpath_link->next;
- free (old);
- }
-
- /* The information in the strings in the list can actually be
- directory lists themselves, with entries separated by colons.
- Convert the list now to a list with one list entry for each
- directory. */
- normalize_dirlist (&ld_state.runpath_link);
- }
- else if (ld_state.rpath_link != NULL)
- /* Same as for the runpath_link above. */
- normalize_dirlist (&ld_state.rpath_link);
-
-
- /* As a related task, handle the LD_LIBRARY_PATH value here. First
- we have to possibly split the value found (if it contains a
- semicolon). Then we have to split the value in list of
- directories, i.e., split at the colons. */
- if (ld_library_path1 != NULL)
- {
- ld_library_path2 = strchr (ld_library_path1, ';');
- if (ld_library_path2 == NULL)
- {
- /* If no semicolon is present the directories are looked at
- after the -L parameters (-> ld_library_path2). */
- ld_library_path2 = ld_library_path1;
- ld_library_path1 = NULL;
- }
- else
- {
- /* NUL terminate the first part. */
- *ld_library_path2++ = '\0';
-
- /* Convert the string value in a list. */
- add_rxxpath (&ld_state.ld_library_path1, ld_library_path1);
- normalize_dirlist (&ld_state.ld_library_path1);
- }
-
- add_rxxpath (&ld_state.ld_library_path2, ld_library_path2);
- normalize_dirlist (&ld_state.ld_library_path2);
- }
-}
-
-
-static void
-read_version_script (const char *fname)
-{
- /* Open the file. The name is supposed to be the complete (relative
- or absolute) path. No search along a path will be performed. */
- ldin = fopen (fname, "r");
- if (ldin == NULL)
- error (EXIT_FAILURE, errno, gettext ("cannot read version script '%s'"),
- fname);
- /* No need for locking. */
- __fsetlocking (ldin, FSETLOCKING_BYCALLER);
-
- /* Tell the parser that this is a version script. */
- ld_scan_version_script = 1;
-
- ldlineno = 1;
- ldin_fname = fname;
- if (ldparse () != 0)
- /* Something went wrong during parsing. */
- exit (EXIT_FAILURE);
-
- fclose (ldin);
-}
-
-
-static void
-create_lscript_symbols (void)
-{
- /* Walk through the data from the linker script and generate all the
- symbols which are required to be present and those marked
- with PROVIDE if there is a undefined reference. */
- if (ld_state.output_segments == NULL)
- return;
-
- struct output_segment *segment = ld_state.output_segments->next;
- do
- {
- struct output_rule *orule;
-
- for (orule = segment->output_rules; orule != NULL; orule = orule->next)
- if (orule->tag == output_assignment
- /* The assignments to "." (i.e., the PC) have to be
- ignored here. */
- && strcmp (orule->val.assignment->variable, ".") != 0)
- {
- struct symbol *s = ld_state.unresolved;
-
- /* Check whether the symbol is needed. */
- if (likely (s != NULL))
- {
- struct symbol *first = s;
- const char *providename = orule->val.assignment->variable;
-
- /* Determine whether the provided symbol is still
- undefined. */
- // XXX TODO Loop inside a loop. Gag! Must rewrite. */
- do
- if (strcmp (s->name, providename) == 0)
- {
- /* Not defined but referenced. */
- if (unlikely (!s->defined))
- {
- /* Put on the list of symbols. First remove it from
- whatever list it currently is on. */
- CDBL_LIST_DEL (ld_state.unresolved, s);
- --ld_state.nunresolved;
- goto use_it;
- }
-
- if (unlikely (!orule->val.assignment->provide_flag))
- {
- /* The symbol is already defined and now again
- in the linker script. This is an error. */
- error (0, 0, gettext ("\
-duplicate definition of '%s' in linker script"),
- providename);
- goto next_rule;
- }
- }
- while ((s = s->next) != first);
- }
-
- /* If the symbol only has to be provided if it is needed,
- ignore it here since it is not undefined. */
- if (orule->val.assignment->provide_flag)
- continue;
-
- /* Allocate memory for this new symbol. */
- s = (struct symbol *)
- obstack_calloc (&ld_state.smem, sizeof (struct symbol));
-
- /* Initialize it. */
- s->name = orule->val.assignment->variable;
-
- /* Insert it into the symbol hash table. */
- unsigned long int hval = elf_hash (s->name);
- if (unlikely (ld_symbol_tab_insert (&ld_state.symbol_tab,
- hval, s) != 0))
- {
- /* This means the symbol is defined somewhere else.
- Maybe it comes from a DSO or so. Get the
- definition. */
- free (s);
- struct symbol *old = ld_symbol_tab_find (&ld_state.symbol_tab,
- hval, s);
- assert (old != NULL);
- free (s);
-
- /* If this is a definition from the application itself
- this means a duplicate definition. */
- if (! old->in_dso)
- {
- error (0, 0, gettext ("\
-duplicate definition of '%s' in linker script"),
- s->name);
- goto next_rule;
- }
-
- /* We use the definition from the linker script. */
- s = old;
- }
-
- use_it:
- /* The symbol is (now) defined. */
- s->defined = 1;
- s->type = STT_NOTYPE;
-
- /* Add a reference to the symbol record. We will come
- across it when creating the output file. */
- orule->val.assignment->sym = s;
-
- SNGL_LIST_PUSH (ld_state.lscript_syms, s);
- ++ld_state.nlscript_syms;
-
- next_rule:
- ;
- }
-
- segment = segment->next;
- }
- while (segment != ld_state.output_segments->next);
-}
-
-
-/* Create creation of spection section symbols representing sections in the
- output file. This is done for symbols like _GLOBAL_OFFSET_TABLE_ and
- _DYNAMIC. */
-static void
-create_special_section_symbol (struct symbol **symp, const char *name)
-{
- if (*symp == NULL)
- {
- /* No symbol defined found yet. Create one. */
- struct symbol *newsym = (struct symbol *)
- obstack_calloc (&ld_state.smem, sizeof (*newsym));
-
- newsym->name = name;
- // XXX Should we mark the symbol hidden? They are hardly useful
- // used outside the current object.
-
- /* Add to the symbol table. */
- if (unlikely (ld_symbol_tab_insert (&ld_state.symbol_tab,
- elf_hash (name), newsym) != 0))
- abort ();
-
- *symp = newsym;
- }
- else if ((*symp)->defined)
- /* Cannot happen. We do use this symbol from any input file. */
- abort ();
-
- (*symp)->defined = 1;
- (*symp)->local = 1;
- (*symp)->hidden = 1;
- (*symp)->type = STT_OBJECT;
-
- ++ld_state.nsymtab;
-}
-
-
-#include "debugpred.h"
diff --git a/src/ld.h b/src/ld.h
deleted file mode 100644
index 29f4031..0000000
--- a/src/ld.h
+++ /dev/null
@@ -1,1135 +0,0 @@
-/* Copyright (C) 2001, 2002, 2003, 2005, 2006, 2008, 2009 Red Hat, Inc.
- This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
-
- 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/>. */
-
-#ifndef LD_H
-#define LD_H 1
-
-#include <dlfcn.h>
-#include <obstack.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include "xelf.h"
-
-
-/* Recommended size of the buffer passed to ld_strerror. */
-#define ERRBUFSIZE (512)
-
-/* Character used to introduce version name after symbol. */
-#define VER_CHR '@'
-
-
-/* Methods for handling archives. */
-enum extract_rule
- {
- defaultextract, /* Weak references don't cause archive member to
- be used. */
- weakextract, /* Weak references cause archive member to be
- extracted. */
- allextract /* Extract all archive members regardless of
- references (aka whole-archive). */
- };
-
-
-/* Type of output file. */
-enum file_type
- {
- no_file_type = 0, /* None selected so far. */
- executable_file_type, /* Executable. */
- dso_file_type, /* DSO. */
- dso_needed_file_type, /* DSO introduced by DT_NEEDED. */
- relocatable_file_type, /* Relocatable object file. */
- archive_file_type /* Archive (input only). */
- };
-
-
-struct usedfiles
-{
- /* The next file given at the command line. */
- struct usedfiles *next;
- /* Nonzero if this file is the beginning of a group. */
- bool group_start;
- /* Nonzero if this file is the end of a group. */
- bool group_end;
- /* Pointer to the beginning of the group. It is necessary to
- explain why we cannot simply use the 'next' pointer and have a
- circular single-linked list like in many cases. The problem is
- that the last archive of the group, if it is the last file of the
- group, contains the only existing pointer to the next file we
- have to look at. All files are initially connected via the
- 'next' pointer in a single-linked list. Therefore we cannot
- overwrite this value. It instead will be used once the group is
- handled and we go on processing the rest of the files. */
- struct usedfiles *group_backref;
-
- /* Name/path of the file. */
- const char *fname;
- /* Resolved file name. */
- const char *rfname;
- /* Name used as reference in DT_NEEDED entries. This is normally
- the SONAME. If it is missing it's normally the fname above. */
- const char *soname;
- /* Handle for the SONAME in the string table. */
- struct Ebl_Strent *sonameent;
-
- /* Help to identify duplicates. */
- dev_t dev;
- ino_t ino;
-
- enum
- {
- not_opened,
- opened,
- in_archive,
- closed
- } status;
-
- /* How to extract elements from archives. */
- enum extract_rule extract_rule;
-
- /* Lazy-loading rule. */
- bool lazyload;
-
- /* If this is a DSO the flag indicates whether the file is directly
- used in a reference. */
- bool used;
-
- /* True when file should be added to DT_NEEDED list only when
- directly referenced. */
- bool as_needed;
-
- /* If nonzero this is the archive sequence number which can be used to
- determine whether back refernces from -( -) or GROUP statements
- have to be followed. */
- int archive_seq;
-
- /* Pointer to the record for the archive containing this file. */
- struct usedfiles *archive_file;
-
- /* Type of file. We have to distinguish these types since they
- are searched for differently. */
- enum file_type file_type;
- /* This is the ELF library handle for this file. */
- Elf *elf;
-
- /* The ELF header. */
-#if NATIVE_ELF != 0
- XElf_Ehdr *ehdr;
-# define FILEINFO_EHDR(fi) (*(fi))
-#else
- XElf_Ehdr ehdr;
-# define FILEINFO_EHDR(fi) (fi)
-#endif
-
- /* Index of the section header string table section. We use a
- separate field and not the e_shstrndx field in the ELF header
- since in case of a file with more than 64000 sections the index
- might be stored in the section header of section zero. The
- elf_getshdrstrndx() function can find the value but it is too
- costly to repeat this call over and over. */
- size_t shstrndx;
-
- /* Info about the sections of the file. */
- struct scninfo
- {
- /* Handle for the section. Note that we can store a section
- handle here because the file is not changing. This together
- with the knowledge about the libelf library is enough for us to
- assume the section reference remains valid at all times. */
- Elf_Scn *scn;
- /* Section header. */
-#if NATIVE_ELF != 0
- XElf_Shdr *shdr;
-# define SCNINFO_SHDR(si) (*(si))
-#else
- XElf_Shdr shdr;
-# define SCNINFO_SHDR(si) (si)
-#endif
- /* Offset of this files section in the combined section. */
- XElf_Off offset;
- /* Index of the section in the output file. */
- Elf32_Word outscnndx;
- /* Index of the output section in the 'allsection' array. */
- Elf32_Word allsectionsidx;
- /* True if the section is used. */
- bool used;
- /* True if section is an unused COMDAT section. */
- bool unused_comdat;
- /* True if this is a COMDAT group section. */
- bool comdat_group;
- /* Section group number. This is the index of the SHT_GROUP section. */
- Elf32_Word grpid;
- /* Pointer back to the containing file information structure. */
- struct usedfiles *fileinfo;
- /* List of symbols in this section (set only for merge-able sections
- and group sections). */
- struct symbol *symbols;
- /* Size of relocations in this section. Only used for relocation
- sections. */
- size_t relsize;
- /* Pointer to next section which is put in the given output
- section. */
- struct scninfo *next;
- } *scninfo;
-
- /* List of section group sections. */
- struct scninfo *groups;
-
- /* The symbol table section.
-
- XXX Maybe support for more than one symbol table is needed. */
- Elf_Data *symtabdata;
- /* Extra section index table section. */
- Elf_Data *xndxdata;
- /* Dynamic symbol table section. */
- Elf_Data *dynsymtabdata;
- /* The version number section. */
- Elf_Data *versymdata;
- /* The defined versions. */
- Elf_Data *verdefdata;
- /* Number of versions defined. */
- size_t nverdef;
- /* True if the version with the given index number is used in the
- output. */
- XElf_Versym *verdefused;
- /* How many versions are used. */
- size_t nverdefused;
- /* Handle for name of the version. */
- struct Ebl_Strent **verdefent;
- /* The needed versions. */
- Elf_Data *verneeddata;
- /* String table section associated with the symbol table. */
- Elf32_Word symstridx;
- /* String table section associated with the dynamic symbol table. */
- Elf32_Word dynsymstridx;
- /* Number of entries in the symbol table. */
- size_t nsymtab;
- size_t nlocalsymbols;
- size_t ndynsymtab;
- /* Dynamic section. */
- Elf_Scn *dynscn;
-
- /* Indirection table for the symbols defined here. */
- Elf32_Word *symindirect;
- Elf32_Word *dynsymindirect;
- /* For undefined or common symbols we need a reference to the symbol
- record. */
- struct symbol **symref;
- struct symbol **dynsymref;
-
- /* This is the file descriptor. The value is -1 if the descriptor
- was already closed. This can happen if we needed file descriptors
- to open new files. */
- int fd;
- /* This flag is true if the descriptor was passed to the generic
- functions from somewhere else. This is an implementation detail;
- no machine-specific code must use this flag. */
- bool fd_passed;
-
- /* True if any of the sections is merge-able. */
- bool has_merge_sections;
-};
-
-
-/* Functions to test for the various types of files we handle. */
-static inline int
-ld_file_rel_p (struct usedfiles *file)
-{
- return (elf_kind (file->elf) == ELF_K_ELF
- && FILEINFO_EHDR (file->ehdr).e_type == ET_REL);
-}
-
-static inline int
-ld_file_dso_p (struct usedfiles *file)
-{
- return (elf_kind (file->elf) == ELF_K_ELF
- && FILEINFO_EHDR (file->ehdr).e_type == ET_DYN);
-}
-
-static inline int
-ld_file_ar_p (struct usedfiles *file)
-{
- return elf_kind (file->elf) == ELF_K_AR;
-}
-
-
-struct pathelement
-{
- /* The next path to search. */
- struct pathelement *next;
- /* The path name. */
- const char *pname;
- /* Larger than zero if the directory exists, smaller than zero if not,
- zero if it is not yet known. */
- int exist;
-};
-
-
-/* Forward declaration. */
-struct ld_state;
-
-
-/* Callback functions. */
-struct callbacks
-{
- /* Library names passed to the linker as -lXXX represent files named
- libXXX.YY. The YY part can have different forms, depending on the
- architecture. The generic set is .so and .a (in this order). */
- const char **(*lib_extensions) (struct ld_state *)
- __attribute__ ((__const__));
-#define LIB_EXTENSION(state) \
- DL_CALL_FCT ((state)->callbacks.lib_extensions, (state))
-
- /* Process the given file. If the file is not yet open, open it.
- The first parameter is a file descriptor for the file which can
- be -1 to indicate the file has not yet been found. The second
- parameter describes the file to be opened, the last one is the
- state of the linker which among other information contain the
- paths we look at.*/
- int (*file_process) (int fd, struct usedfiles *, struct ld_state *,
- struct usedfiles **);
-#define FILE_PROCESS(fd, file, state, nextp) \
- DL_CALL_FCT ((state)->callbacks.file_process, (fd, file, state, nextp))
-
- /* Close the given file. */
- int (*file_close) (struct usedfiles *, struct ld_state *);
-#define FILE_CLOSE(file, state) \
- DL_CALL_FCT ((state)->callbacks.file_close, (file, state))
-
- /* Create the output sections now. This requires knowledge about
- all the sections we will need. It may be necessary to sort the
- sections in the order they are supposed to appear in the
- executable. The sorting use many different kinds of information
- to optimize the resulting binary. Important is to respect
- segment boundaries and the needed alignment. The mode of the
- segments will be determined afterwards automatically by the
- output routines. */
- void (*create_sections) (struct ld_state *);
-#define CREATE_SECTIONS(state) \
- DL_CALL_FCT ((state)->callbacks.create_sections, (state))
-
- /* Determine whether we have any non-weak unresolved references left. */
- int (*flag_unresolved) (struct ld_state *);
-#define FLAG_UNRESOLVED(state) \
- DL_CALL_FCT ((state)->callbacks.flag_unresolved, (state))
-
- /* Create the sections which are generated by the linker and are not
- present in the input file. */
- void (*generate_sections) (struct ld_state *);
-#define GENERATE_SECTIONS(state) \
- DL_CALL_FCT ((state)->callbacks.generate_sections, (state))
-
- /* Open the output file. The file name is given or "a.out". We
- create as much of the ELF structure as possible. */
- int (*open_outfile) (struct ld_state *, int, int, int);
-#define OPEN_OUTFILE(state, machine, class, data) \
- DL_CALL_FCT ((state)->callbacks.open_outfile, (state, machine, class, data))
-
- /* Create the data for the output file. */
- int (*create_outfile) (struct ld_state *);
-#define CREATE_OUTFILE(state) \
- DL_CALL_FCT ((state)->callbacks.create_outfile, (state))
-
- /* Process a relocation section. */
- void (*relocate_section) (struct ld_state *, Elf_Scn *, struct scninfo *,
- const Elf32_Word *);
-#define RELOCATE_SECTION(state, outscn, first, dblindirect) \
- DL_CALL_FCT ((state)->callbacks.relocate_section, (state, outscn, first, \
- dblindirect))
-
- /* Allocate a data buffer for the relocations of the given output
- section. */
- void (*count_relocations) (struct ld_state *, struct scninfo *);
-#define COUNT_RELOCATIONS(state, scninfo) \
- DL_CALL_FCT ((state)->callbacks.count_relocations, (state, scninfo))
-
- /* Create relocations for executable or DSO. */
- void (*create_relocations) (struct ld_state *, const Elf32_Word *);
-#define CREATE_RELOCATIONS(state, dlbindirect) \
- DL_CALL_FCT ((state)->callbacks.create_relocations, (state, dblindirect))
-
- /* Finalize the output file. */
- int (*finalize) (struct ld_state *);
-#define FINALIZE(state) \
- DL_CALL_FCT ((state)->callbacks.finalize, (state))
-
- /* Check whether special section number is known. */
- bool (*special_section_number_p) (struct ld_state *, size_t);
-#define SPECIAL_SECTION_NUMBER_P(state, number) \
- DL_CALL_FCT ((state)->callbacks.special_section_number_p, (state, number))
-
- /* Check whether section type is known. */
- bool (*section_type_p) (struct ld_state *, XElf_Word);
-#define SECTION_TYPE_P(state, type) \
- DL_CALL_FCT ((state)->callbacks.section_type_p, (state, type))
-
- /* Return section flags for .dynamic section. */
- XElf_Xword (*dynamic_section_flags) (struct ld_state *);
-#define DYNAMIC_SECTION_FLAGS(state) \
- DL_CALL_FCT ((state)->callbacks.dynamic_section_flags, (state))
-
- /* Create the data structures for the .plt section and initialize it. */
- void (*initialize_plt) (struct ld_state *, Elf_Scn *scn);
-#define INITIALIZE_PLT(state, scn) \
- DL_CALL_FCT ((state)->callbacks.initialize_plt, (state, scn))
-
- /* Create the data structures for the .rel.plt section and initialize it. */
- void (*initialize_pltrel) (struct ld_state *, Elf_Scn *scn);
-#define INITIALIZE_PLTREL(state, scn) \
- DL_CALL_FCT ((state)->callbacks.initialize_pltrel, (state, scn))
-
- /* Finalize the .plt section the what belongs to them. */
- void (*finalize_plt) (struct ld_state *, size_t, size_t, struct symbol **);
-#define FINALIZE_PLT(state, nsym, nsym_dyn, ndxtosym) \
- DL_CALL_FCT ((state)->callbacks.finalize_plt, (state, nsym, nsym_dyn, \
- ndxtosym))
-
- /* Create the data structures for the .got section and initialize it. */
- void (*initialize_got) (struct ld_state *, Elf_Scn *scn);
-#define INITIALIZE_GOT(state, scn) \
- DL_CALL_FCT ((state)->callbacks.initialize_got, (state, scn))
-
- /* Create the data structures for the .got.plt section and initialize it. */
- void (*initialize_gotplt) (struct ld_state *, Elf_Scn *scn);
-#define INITIALIZE_GOTPLT(state, scn) \
- DL_CALL_FCT ((state)->callbacks.initialize_gotplt, (state, scn))
-
- /* Return the tag corresponding to the native relocation type for
- the platform. */
- int (*rel_type) (struct ld_state *);
-#define REL_TYPE(state) \
- DL_CALL_FCT ((state)->callbacks.rel_type, (state))
-};
-
-
-/* Structure for symbol representation. This data structure is used a
- lot, so size is important. */
-struct symbol
-{
- /* Symbol name. */
- const char *name;
- /* Size of the object. */
- XElf_Xword size;
- /* Index of the symbol in the symbol table of the object. */
- size_t symidx;
- /* Index of the symbol in the symbol table of the output file. */
- size_t outsymidx;
-
- /* Description where the symbol is found/needed. */
- size_t scndx;
- struct usedfiles *file;
- /* Index of the symbol table. */
- Elf32_Word symscndx;
-
- /* Index of the symbol in the dynamic symbol table of the output
- file. Note that the value only needs to be 16 bit wide since
- there cannot be more sections in an executable or DSO. */
- unsigned int outdynsymidx:16;
-
- /* Type of the symbol. */
- unsigned int type:4;
- /* Various flags. */
- unsigned int defined:1;
- unsigned int common:1;
- unsigned int weak:1;
- unsigned int added:1;
- unsigned int merged:1;
- unsigned int local:1;
- unsigned int hidden:1;
- /* Nonzero if the symbol is on the from_dso list. */
- unsigned int on_dsolist:1;
- /* Nonzero if symbol needs copy relocation, reset when the
- relocation has been created. */
- unsigned int need_copy:1;
- unsigned int in_dso:1;
-
- union
- {
- /* Pointer to the handle created by the functions which create
- merged section contents. We use 'void *' because there are
- different implementations used. */
- void *handle;
- XElf_Addr value;
- } merge;
-
- /* Pointer to next/previous symbol on whatever list the symbol is. */
- struct symbol *next;
- struct symbol *previous;
- /* Pointer to next symbol of the same section (only set for merge-able
- sections). */
- struct symbol *next_in_scn;
-};
-
-
-/* Get the definition for the symbol table. */
-#include <symbolhash.h>
-
-/* Simple single linked list of file names. */
-struct filename_list
-{
- const char *name;
- struct usedfiles *real;
- struct filename_list *next;
- bool group_start;
- bool group_end;
- bool as_needed;
-};
-
-
-/* Data structure to describe expression in linker script. */
-struct expression
-{
- enum expression_tag
- {
- exp_num,
- exp_sizeof_headers,
- exp_pagesize,
- exp_id,
- exp_mult,
- exp_div,
- exp_mod,
- exp_plus,
- exp_minus,
- exp_and,
- exp_or,
- exp_align
- } tag;
-
- union
- {
- uintmax_t num;
- struct expression *child;
- struct
- {
- struct expression *left;
- struct expression *right;
- } binary;
- const char *str;
- } val;
-};
-
-
-/* Data structure for section name with flags. */
-struct input_section_name
-{
- const char *name;
- bool sort_flag;
-};
-
-/* File name mask with section name. */
-struct filemask_section_name
-{
- const char *filemask;
- const char *excludemask;
- struct input_section_name *section_name;
- bool keep_flag;
-};
-
-/* Data structure for assignments. */
-struct assignment
-{
- const char *variable;
- struct expression *expression;
- struct symbol *sym;
- bool provide_flag;
-};
-
-
-/* Data structure describing input for an output section. */
-struct input_rule
-{
- enum
- {
- input_section,
- input_assignment
- } tag;
-
- union
- {
- struct assignment *assignment;
- struct filemask_section_name *section;
- } val;
-
- struct input_rule *next;
-};
-
-
-/* Data structure to describe output section. */
-struct output_section
-{
- const char *name;
- struct input_rule *input;
- XElf_Addr max_alignment;
- bool ignored;
-};
-
-
-/* Data structure to describe output file format. */
-struct output_rule
-{
- enum
- {
- output_section,
- output_assignment
- } tag;
-
- union
- {
- struct assignment *assignment;
- struct output_section section;
- } val;
-
- struct output_rule *next;
-};
-
-
-/* List of all the segments the linker script describes. */
-struct output_segment
-{
- int mode;
- struct output_rule *output_rules;
- struct output_segment *next;
-
- XElf_Off offset;
- XElf_Addr addr;
- XElf_Xword align;
-};
-
-
-/* List of identifiers. */
-struct id_list
-{
- union
- {
- enum id_type
- {
- id_str, /* Normal string. */
- id_all, /* "*", matches all. */
- id_wild /* Globbing wildcard string. */
- } id_type;
- struct
- {
- bool local;
- const char *versionname;
- } s;
- } u;
- const char *id;
- struct id_list *next;
-};
-
-
-/* Version information. */
-struct version
-{
- struct version *next;
- struct id_list *local_names;
- struct id_list *global_names;
- const char *versionname;
- const char *parentname;
-};
-
-
-/* Head for list of sections. */
-struct scnhead
-{
- /* Name of the sections. */
- const char *name;
-
- /* Accumulated flags for the sections. */
- XElf_Xword flags;
-
- /* Type of the sections. */
- XElf_Word type;
-
- /* Entry size. If there are differencs between the sections with
- the same name this field contains 1. */
- XElf_Word entsize;
-
- /* If non-NULL pointer to group signature. */
- const char *grp_signature;
-
- /* Maximum alignment for all sections. */
- XElf_Word align;
-
- /* Distinguish between normal sections coming from the input file
- and sections generated by the linker. */
- enum scn_kind
- {
- scn_normal, /* Section from the input file(s). */
- scn_dot_interp, /* Generated .interp section. */
- scn_dot_got, /* Generated .got section. */
- scn_dot_gotplt, /* Generated .got.plt section. */
- scn_dot_dynrel, /* Generated .rel.dyn section. */
- scn_dot_dynamic, /* Generated .dynamic section. */
- scn_dot_dynsym, /* Generated .dynsym section. */
- scn_dot_dynstr, /* Generated .dynstr section. */
- scn_dot_hash, /* Generated .hash section. */
- scn_dot_gnu_hash, /* Generated .gnu.hash section. */
- scn_dot_plt, /* Generated .plt section. */
- scn_dot_pltrel, /* Generated .rel.plt section. */
- scn_dot_version, /* Generated .gnu.version section. */
- scn_dot_version_r, /* Generated .gnu.version_r section. */
- scn_dot_note_gnu_build_id /* Generated .note.gnu.build-id section. */
- } kind;
-
- /* True is the section is used in the output. */
- bool used;
-
- /* Total size (only determined this way for relocation sections). */
- size_t relsize;
-
- /* Filled in by the section sorting to indicate which segment the
- section goes in. */
- int segment_nr;
-
- /* Index of the output section. We cannot store the section handle
- directly here since the handle is a pointer in a dynamically
- allocated table which might move if it becomes too small for all
- the sections. Using the index the correct value can be found at
- all times. */
- XElf_Word scnidx;
-
- /* Index of the STT_SECTION entry for this section in the symbol
- table. */
- XElf_Word scnsymidx;
-
- /* Address of the section in the output file. */
- XElf_Addr addr;
-
- /* Handle for the section name in the output file's section header
- string table. */
- struct Ebl_Strent *nameent;
-
- /* Tail of list of symbols for this section. Only set if the
- section is merge-able. */
- struct symbol *symbols;
-
- /* Pointer to last section. */
- struct scninfo *last;
-};
-
-
-/* Define hash table for sections. */
-#include <sectionhash.h>
-
-/* Define hash table for version symbols. */
-#include <versionhash.h>
-
-
-/* State of the linker. */
-struct ld_state
-{
- /* ELF backend library handle. */
- Ebl *ebl;
-
- /* List of all archives participating, in this order. */
- struct usedfiles *archives;
- /* End of the list. */
- struct usedfiles *tailarchives;
- /* If nonzero we are looking for the beginning of a group. */
- bool group_start_requested;
- /* Pointer to the archive starting the group. */
- struct usedfiles *group_start_archive;
-
- /* List of the DSOs we found. */
- struct usedfiles *dsofiles;
- /* Number of DSO files. */
- size_t ndsofiles;
- /* Ultimate list of object files which are linked in. */
- struct usedfiles *relfiles;
-
- /* List the DT_NEEDED DSOs. */
- struct usedfiles *needed;
-
- /* Temporary storage for the parser. */
- struct filename_list *srcfiles;
-
- /* List of all the paths to look at. */
- struct pathelement *paths;
- /* Tail of the list. */
- struct pathelement *tailpaths;
-
- /* User provided paths for lookup of DSOs. */
- struct pathelement *rpath;
- struct pathelement *rpath_link;
- struct pathelement *runpath;
- struct pathelement *runpath_link;
- struct Ebl_Strent *rxxpath_strent;
- int rxxpath_tag;
-
- /* From the environment variable LD_LIBRARY_PATH. */
- struct pathelement *ld_library_path1;
- struct pathelement *ld_library_path2;
-
- /* Name of the output file. */
- const char *outfname;
- /* Name of the temporary file we initially create. */
- const char *tempfname;
- /* File descriptor opened for the output file. */
- int outfd;
- /* The ELF descriptor for the output file. */
- Elf *outelf;
-
- /* Type of output file. */
- enum file_type file_type;
-
- /* Is this a system library or not. */
- bool is_system_library;
-
- /* Page size to be assumed for the binary. */
- size_t pagesize;
-
- /* Name of the interpreter for dynamically linked objects. */
- const char *interp;
- /* Index of the .interp section. */
- Elf32_Word interpscnidx;
-
- /* Optimization level. */
- unsigned long int optlevel;
-
- /* If true static linking is requested. */
- bool statically;
-
- /* If true, add DT_NEEDED entries for following files if they are
- needed. */
- bool as_needed;
-
- /* How to extract elements from archives. */
- enum extract_rule extract_rule;
-
- /* Sequence number of the last archive we used. */
- int last_archive_used;
-
- /* If true print to stdout information about the files we are
- trying to open. */
- bool trace_files;
-
- /* If true multiple definitions are not considered an error; the
- first is used. */
- bool muldefs;
-
- /* If true undefined symbols when building DSOs are not fatal. */
- bool nodefs;
-
- /* If true add line indentifying link-editor to .comment section. */
- bool add_ld_comment;
-
- /* Stripping while linking. */
- enum
- {
- strip_none,
- strip_debug,
- strip_all,
- strip_everything
- } strip;
-
- /* The callback function vector. */
- struct callbacks callbacks;
-
- /* Name of the entry symbol. Can also be a numeric value. */
- const char *entry;
-
- /* The description of the segments in the output file. */
- struct output_segment *output_segments;
-
- /* List of the symbols we created from linker script definitions. */
- struct symbol *lscript_syms;
- size_t nlscript_syms;
-
- /* Table with known symbols. */
- ld_symbol_tab symbol_tab;
-
- /* Table with used sections. */
- ld_section_tab section_tab;
-
- /* The list of sections once we collected them. */
- struct scnhead **allsections;
- size_t nallsections;
- size_t nusedsections;
- size_t nnotesections;
-
- /* Beginning of the list of symbols which are still unresolved. */
- struct symbol *unresolved;
- /* Number of truely unresolved entries in the list. */
- size_t nunresolved;
- /* Number of truely unresolved, non-weak entries in the list. */
- size_t nunresolved_nonweak;
-
- /* List of common symbols. */
- struct symbol *common_syms;
- /* Section for the common symbols. */
- struct scninfo *common_section;
-
- /* List of symbols defined in DSOs and used in a relocatable file.
- DSO symbols not referenced in the relocatable files are not on
- the list. If a symbol is on the list the on_dsolist field in the
- 'struct symbol' is nonzero. */
- struct symbol *from_dso;
- /* Number of entries in from_dso. */
- size_t nfrom_dso;
- /* Number of entries in the dynamic symbol table. */
- size_t ndynsym;
- /* Number of PLT entries from DSO references. */
- size_t nplt;
- /* Number of PLT entries from DSO references. */
- size_t ngot;
- /* Number of copy relocations. */
- size_t ncopy;
- /* Section for copy relocations. */
- struct scninfo *copy_section;
-
- /* Keeping track of the number of symbols in the output file. */
- size_t nsymtab;
- size_t nlocalsymbols;
-
- /* Special symbols. */
- struct symbol *init_symbol;
- struct symbol *fini_symbol;
-
- /* The description of the segments in the output file as described
- in the default linker script. This information will be used in
- addition to the user-provided information. */
- struct output_segment *default_output_segments;
- /* Search paths added by the default linker script. */
- struct pathelement *default_paths;
-
-#ifndef BASE_ELF_NAME
- /* The handle of the ld backend library. */
- void *ldlib;
-#endif
-
- /* String table for the section headers. */
- struct Ebl_Strtab *shstrtab;
-
- /* True if output file should contain symbol table. */
- bool need_symtab;
- /* Symbol table section. */
- Elf32_Word symscnidx;
- /* Extended section table section. */
- Elf32_Word xndxscnidx;
- /* Symbol string table section. */
- Elf32_Word strscnidx;
-
- /* True if output file should contain dynamic symbol table. */
- bool need_dynsym;
- /* Dynamic symbol table section. */
- Elf32_Word dynsymscnidx;
- /* Dynamic symbol string table section. */
- Elf32_Word dynstrscnidx;
- /* Dynamic symbol hash tables. */
- size_t hashscnidx;
- size_t gnuhashscnidx;
-
- /* Procedure linkage table section. */
- Elf32_Word pltscnidx;
- /* Number of entries already in the PLT section. */
- size_t nplt_used;
- /* Relocation for procedure linkage table section. */
- Elf32_Word pltrelscnidx;
-
- /* Global offset table section. */
- Elf32_Word gotscnidx;
- /* And the part of the PLT. */
- Elf32_Word gotpltscnidx;
-
- /* This section will hole all non-PLT relocations. */
- Elf32_Word reldynscnidx;
-
- /* Index of the sections to handle versioning. */
- Elf32_Word versymscnidx;
- Elf32_Word verneedscnidx;
- /* XXX Should the following names be verneed...? */
- /* Number of version definitions in input DSOs used. */
- int nverdefused;
- /* Number of input DSOs using versioning. */
- int nverdeffile;
- /* Index of next version. */
- int nextveridx;
-
- /* TLS segment. */
- bool need_tls;
- XElf_Addr tls_start;
- XElf_Addr tls_tcb;
-
- /* Hash table for version symbol strings. Only strings without
- special characters are hashed here. */
- ld_version_str_tab version_str_tab;
- /* At most one of the following two variables is set to true if either
- global or local symbol binding is selected as the default. */
- bool default_bind_local;
- bool default_bind_global;
-
- /* Execuatable stack selection. */
- enum execstack
- {
- execstack_false = 0,
- execstack_true,
- execstack_false_force
- } execstack;
-
- /* True if only used sections are used. */
- bool gc_sections;
-
- /* Array to determine final index of symbol. */
- Elf32_Word *dblindirect;
-
- /* Section group handling. */
- struct scngroup
- {
- Elf32_Word outscnidx;
- int nscns;
- struct member
- {
- struct scnhead *scn;
- struct member *next;
- } *member;
- struct Ebl_Strent *nameent;
- struct symbol *symbol;
- struct scngroup *next;
- } *groups;
-
- /* True if the output file needs a .got section. */
- bool need_got;
- /* Number of relocations for GOT section caused. */
- size_t nrel_got;
-
- /* Number of entries needed in the .dynamic section. */
- int ndynamic;
- /* To keep track of added entries. */
- int ndynamic_filled;
- /* Index for the dynamic section. */
- Elf32_Word dynamicscnidx;
-
- /* Flags set in the DT_FLAGS word. */
- Elf32_Word dt_flags;
- /* Flags set in the DT_FLAGS_1 word. */
- Elf32_Word dt_flags_1;
- /* Flags set in the DT_FEATURE_1 word. */
- Elf32_Word dt_feature_1;
-
- /* Lazy-loading state for dependencies. */
- bool lazyload;
-
- /* True if an .eh_frame_hdr section should be generated. */
- bool eh_frame_hdr;
-
- /* What hash style to generate. */
- enum
- {
- hash_style_none = 0,
- hash_style_sysv = 1,
-#define GENERATE_SYSV_HASH ((ld_state.hash_style & hash_style_sysv) != 0)
- hash_style_gnu = 2
-#define GENERATE_GNU_HASH ((ld_state.hash_style & hash_style_gnu) != 0)
- }
- hash_style;
-
-
- /* True if in executables all global symbols should be exported in
- the dynamic symbol table. */
- bool export_all_dynamic;
-
- /* Build-ID style. NULL is none. */
- const char *build_id;
- Elf32_Word buildidscnidx;
-
- /* If DSO is generated, this is the SONAME. */
- const char *soname;
-
- /* List of all relocation sections. */
- struct scninfo *rellist;
- /* Total size of non-PLT relocations. */
- size_t relsize_total;
-
- /* Record for the GOT symbol, if known. */
- struct symbol *got_symbol;
- /* Record for the dynamic section symbol, if known. */
- struct symbol *dyn_symbol;
-
- /* Obstack used for small objects which will not be deleted. */
- struct obstack smem;
-};
-
-
-/* The interface to the scanner. */
-
-/* Parser entry point. */
-extern int ldparse (void);
-
-/* The input file. */
-extern FILE *ldin;
-
-/* Name of the input file. */
-extern const char *ldin_fname;
-
-/* Current line number. Must be reset for a new file. */
-extern int ldlineno;
-
-/* If nonzero we are currently parsing a version script. */
-extern int ld_scan_version_script;
-
-/* Flags defined in ld.c. */
-extern int verbose;
-extern int conserve_memory;
-
-
-/* Linker state. This contains all global information. */
-extern struct ld_state ld_state;
-
-
-/* Generic ld helper functions. */
-
-/* Append a new directory to search libraries in. */
-extern void ld_new_searchdir (const char *dir);
-
-/* Append a new file to the list of input files. */
-extern struct usedfiles *ld_new_inputfile (const char *fname,
- enum file_type type);
-
-
-/* These are the generic implementations for the callbacks used by ld. */
-
-/* Initialize state object. This callback function is called after the
- parameters are parsed but before any file is searched for. */
-extern int ld_prepare_state (const char *emulation);
-
-
-/* Function to determine whether an object will be dynamically linked. */
-extern bool dynamically_linked_p (void);
-
-/* Helper functions for the architecture specific code. */
-
-/* Checked whether the symbol is undefined and referenced from a DSO. */
-extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx);
-#ifdef __GNUC_STDC_INLINE__
-__attribute__ ((__gnu_inline__))
-#endif
-extern inline bool
-linked_from_dso_p (struct scninfo *scninfo, size_t symidx)
-{
- struct usedfiles *file = scninfo->fileinfo;
-
- /* If this symbol is not undefined in this file it cannot come from
- a DSO. */
- if (symidx < file->nlocalsymbols)
- return false;
-
- struct symbol *sym = file->symref[symidx];
-
- return sym->defined && sym->in_dso;
-}
-
-#endif /* ld.h */
diff --git a/src/ldgeneric.c b/src/ldgeneric.c
deleted file mode 100644
index 1b5d0f9..0000000
--- a/src/ldgeneric.c
+++ /dev/null
@@ -1,7132 +0,0 @@
-/* Copyright (C) 2001-2011 Red Hat, Inc.
- This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
-
- 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/>. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <assert.h>
-#include <ctype.h>
-#include <dlfcn.h>
-#include <errno.h>
-#include <error.h>
-#include <fcntl.h>
-#include <fnmatch.h>
-#include <gelf.h>
-#include <inttypes.h>
-#include <libintl.h>
-#include <stdbool.h>
-#include <stdio_ext.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-
-#include <elf-knowledge.h>
-#include "ld.h"
-#include "list.h"
-#include <md5.h>
-#include <sha1.h>
-#include <system.h>
-
-
-/* Header of .eh_frame_hdr section. */
-struct unw_eh_frame_hdr
-{
- unsigned char version;
- unsigned char eh_frame_ptr_enc;
- unsigned char fde_count_enc;
- unsigned char table_enc;
-};
-#define EH_FRAME_HDR_VERSION 1
-
-
-/* Prototypes for local functions. */
-static const char **ld_generic_lib_extensions (struct ld_state *)
- __attribute__ ((__const__));
-static int ld_generic_file_close (struct usedfiles *fileinfo,
- struct ld_state *statep);
-static int ld_generic_file_process (int fd, struct usedfiles *fileinfo,
- struct ld_state *statep,
- struct usedfiles **nextp);
-static void ld_generic_generate_sections (struct ld_state *statep);
-static void ld_generic_create_sections (struct ld_state *statep);
-static int ld_generic_flag_unresolved (struct ld_state *statep);
-static int ld_generic_open_outfile (struct ld_state *statep, int machine,
- int class, int data);
-static int ld_generic_create_outfile (struct ld_state *statep);
-static void ld_generic_relocate_section (struct ld_state *statep,
- Elf_Scn *outscn,
- struct scninfo *firstp,
- const Elf32_Word *dblindirect);
-static int ld_generic_finalize (struct ld_state *statep);
-static bool ld_generic_special_section_number_p (struct ld_state *statep,
- size_t number);
-static bool ld_generic_section_type_p (struct ld_state *statep,
- XElf_Word type);
-static XElf_Xword ld_generic_dynamic_section_flags (struct ld_state *statep);
-static void ld_generic_initialize_plt (struct ld_state *statep, Elf_Scn *scn);
-static void ld_generic_initialize_pltrel (struct ld_state *statep,
- Elf_Scn *scn);
-static void ld_generic_initialize_got (struct ld_state *statep, Elf_Scn *scn);
-static void ld_generic_initialize_gotplt (struct ld_state *statep,
- Elf_Scn *scn);
-static void ld_generic_finalize_plt (struct ld_state *statep, size_t nsym,
- size_t nsym_dyn,
- struct symbol **ndxtosymp);
-static int ld_generic_rel_type (struct ld_state *statep);
-static void ld_generic_count_relocations (struct ld_state *statep,
- struct scninfo *scninfo);
-static void ld_generic_create_relocations (struct ld_state *statep,
- const Elf32_Word *dblindirect);
-
-static int file_process2 (struct usedfiles *fileinfo);
-static void mark_section_used (struct scninfo *scninfo, Elf32_Word shndx,
- struct scninfo **grpscnp);
-
-
-/* Map symbol index to struct symbol record. */
-static struct symbol **ndxtosym;
-
-/* String table reference to all symbols in the symbol table. */
-static struct Ebl_Strent **symstrent;
-
-
-/* Check whether file associated with FD is a DSO. */
-static bool
-is_dso_p (int fd)
-{
- /* We have to read the 'e_type' field. It has the same size (16
- bits) in 32- and 64-bit ELF. */
- XElf_Half e_type;
-
- return (pread (fd, &e_type, sizeof (e_type), offsetof (XElf_Ehdr, e_type))
- == sizeof (e_type)
- && e_type == ET_DYN);
-}
-
-
-/* Print the complete name of a file, including the archive it is
- contained in. */
-static int
-print_file_name (FILE *s, struct usedfiles *fileinfo, int first_level,
- int newline)
-{
- int npar = 0;
-
- if (fileinfo->archive_file != NULL)
- {
- npar = print_file_name (s, fileinfo->archive_file, 0, 0) + 1;
- fputc_unlocked ('(', s);
- fputs_unlocked (fileinfo->rfname, s);
-
- if (first_level)
- while (npar-- > 0)
- fputc_unlocked (')', s);
- }
- else
- fputs_unlocked (fileinfo->rfname, s);
-
- if (first_level && newline)
- fputc_unlocked ('\n', s);
-
- return npar;
-}
-
-
-/* Function to determine whether an object will be dynamically linked. */
-bool
-dynamically_linked_p (void)
-{
- return (ld_state.file_type == dso_file_type || ld_state.nplt > 0
- || ld_state.ngot > 0);
-}
-
-
-bool
-linked_from_dso_p (struct scninfo *scninfo, size_t symidx)
-{
- struct usedfiles *file = scninfo->fileinfo;
-
- /* If this symbol is not undefined in this file it cannot come from
- a DSO. */
- if (symidx < file->nlocalsymbols)
- return false;
-
- struct symbol *sym = file->symref[symidx];
-
- return sym->defined && sym->in_dso;
-}
-
-
-/* Initialize state object. This callback function is called after the
- parameters are parsed but before any file is searched for. */
-int
-ld_prepare_state (const char *emulation)
-{
- /* When generating DSO we normally allow undefined symbols. */
- ld_state.nodefs = true;
-
- /* To be able to detect problems we add a .comment section entry by
- default. */
- ld_state.add_ld_comment = true;
-
- /* XXX We probably should find a better place for this. The index
- of the first user-defined version is 2. */
- ld_state.nextveridx = 2;
-
- /* Pick an not too small number for the initial size of the tables. */
- ld_symbol_tab_init (&ld_state.symbol_tab, 1027);
- ld_section_tab_init (&ld_state.section_tab, 67);
- ld_version_str_tab_init (&ld_state.version_str_tab, 67);
-
- /* Initialize the section header string table. */
- ld_state.shstrtab = ebl_strtabinit (true);
- if (ld_state.shstrtab == NULL)
- error (EXIT_FAILURE, errno, gettext ("cannot create string table"));
-
- /* Initialize the callbacks. These are the defaults, the appropriate
- backend can later install its own callbacks. */
- ld_state.callbacks.lib_extensions = ld_generic_lib_extensions;
- ld_state.callbacks.file_process = ld_generic_file_process;
- ld_state.callbacks.file_close = ld_generic_file_close;
- ld_state.callbacks.generate_sections = ld_generic_generate_sections;
- ld_state.callbacks.create_sections = ld_generic_create_sections;
- ld_state.callbacks.flag_unresolved = ld_generic_flag_unresolved;
- ld_state.callbacks.open_outfile = ld_generic_open_outfile;
- ld_state.callbacks.create_outfile = ld_generic_create_outfile;
- ld_state.callbacks.relocate_section = ld_generic_relocate_section;
- ld_state.callbacks.finalize = ld_generic_finalize;
- ld_state.callbacks.special_section_number_p =
- ld_generic_special_section_number_p;
- ld_state.callbacks.section_type_p = ld_generic_section_type_p;
- ld_state.callbacks.dynamic_section_flags = ld_generic_dynamic_section_flags;
- ld_state.callbacks.initialize_plt = ld_generic_initialize_plt;
- ld_state.callbacks.initialize_pltrel = ld_generic_initialize_pltrel;
- ld_state.callbacks.initialize_got = ld_generic_initialize_got;
- ld_state.callbacks.initialize_gotplt = ld_generic_initialize_gotplt;
- ld_state.callbacks.finalize_plt = ld_generic_finalize_plt;
- ld_state.callbacks.rel_type = ld_generic_rel_type;
- ld_state.callbacks.count_relocations = ld_generic_count_relocations;
- ld_state.callbacks.create_relocations = ld_generic_create_relocations;
-
-#ifndef BASE_ELF_NAME
- /* Find the ld backend library. Use EBL to determine the name if
- the user hasn't provided one on the command line. */
- if (emulation == NULL)
- {
- emulation = ebl_backend_name (ld_state.ebl);
- assert (emulation != NULL);
- }
- size_t emulation_len = strlen (emulation);
-
- /* Construct the file name. */
- char *fname = (char *) alloca (sizeof "libld_" - 1 + emulation_len
- + sizeof ".so");
- strcpy (mempcpy (stpcpy (fname, "libld_"), emulation, emulation_len), ".so");
-
- /* Try loading. */
- void *h = dlopen (fname, RTLD_LAZY);
- if (h == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot load ld backend library '%s': %s"),
- fname, dlerror ());
-
- /* Find the initializer. It must be present. */
- char *initname = (char *) alloca (emulation_len + sizeof "_ld_init");
- strcpy (mempcpy (initname, emulation, emulation_len), "_ld_init");
- int (*initfct) (struct ld_state *)
- = (int (*) (struct ld_state *)) dlsym (h, initname);
-
- if (initfct == NULL)
- error (EXIT_FAILURE, 0, gettext ("\
-cannot find init function in ld backend library '%s': %s"),
- fname, dlerror ());
-
- /* Store the handle. */
- ld_state.ldlib = h;
-
- /* Call the init function. */
- return initfct (&ld_state);
-#else
-# define INIT_FCT_NAME(base) _INIT_FCT_NAME(base)
-# define _INIT_FCT_NAME(base) base##_ld_init
- /* Declare and call the initialization function. */
- extern int INIT_FCT_NAME(BASE_ELF_NAME) (struct ld_state *);
- return INIT_FCT_NAME(BASE_ELF_NAME) (&ld_state);
-#endif
-}
-
-
-static int
-check_for_duplicate2 (struct usedfiles *newp, struct usedfiles *list)
-{
- struct usedfiles *first;
-
- if (list == NULL)
- return 0;
-
- list = first = list->next;
- do
- {
- /* When searching the needed list we might come across entries
- for files which are not yet opened. Stop then, there is
- nothing more to test. */
- if (likely (list->status == not_opened))
- break;
-
- if (unlikely (list->ino == newp->ino)
- && unlikely (list->dev == newp->dev))
- {
- close (newp->fd);
- newp->fd = -1;
- newp->status = closed;
- if (newp->file_type == relocatable_file_type)
- error (0, 0, gettext ("%s listed more than once as input"),
- newp->rfname);
-
- return 1;
- }
- list = list->next;
- }
- while (likely (list != first));
-
- return 0;
-}
-
-
-static int
-check_for_duplicate (struct usedfiles *newp)
-{
- struct stat st;
-
- if (unlikely (fstat (newp->fd, &st) < 0))
- {
- close (newp->fd);
- return errno;
- }
-
- newp->dev = st.st_dev;
- newp->ino = st.st_ino;
-
- return (check_for_duplicate2 (newp, ld_state.relfiles)
- || check_for_duplicate2 (newp, ld_state.dsofiles)
- || check_for_duplicate2 (newp, ld_state.needed));
-}
-
-
-/* Find a file along the path described in the state. */
-static int
-open_along_path2 (struct usedfiles *fileinfo, struct pathelement *path)
-{
- const char *fname = fileinfo->fname;
- size_t fnamelen = strlen (fname);
- int err = ENOENT;
- struct pathelement *firstp = path;
-
- if (path == NULL)
- /* Cannot find anything since we have no path. */
- return ENOENT;
-
- do
- {
- if (likely (path->exist >= 0))
- {
- /* Create the file name. */
- char *rfname = NULL;
- size_t dirlen = strlen (path->pname);
- int fd = -1;
-
- if (fileinfo->file_type == archive_file_type)
- {
- const char **exts = (ld_state.statically
- ? (const char *[2]) { ".a", NULL }
- : LIB_EXTENSION (&ld_state));
-
- /* We have to create the actual file name. We prepend "lib"
- and add one of the extensions the platform has. */
- while (*exts != NULL)
- {
- size_t extlen = strlen (*exts);
- rfname = (char *) alloca (dirlen + 5 + fnamelen + extlen);
- memcpy (mempcpy (stpcpy (mempcpy (rfname, path->pname,
- dirlen),
- "/lib"),
- fname, fnamelen),
- *exts, extlen + 1);
-
- fd = open (rfname, O_RDONLY);
- if (likely (fd != -1) || errno != ENOENT)
- {
- err = fd == -1 ? errno : 0;
- break;
- }
-
- /* Next extension. */
- ++exts;
- }
- }
- else
- {
- assert (fileinfo->file_type == dso_file_type
- || fileinfo->file_type == dso_needed_file_type);
-
- rfname = (char *) alloca (dirlen + 1 + fnamelen + 1);
- memcpy (stpcpy (mempcpy (rfname, path->pname, dirlen), "/"),
- fname, fnamelen + 1);
-
- fd = open (rfname, O_RDONLY);
- if (unlikely (fd == -1))
- err = errno;
- }
-
- if (likely (fd != -1))
- {
- /* We found the file. This also means the directory
- exists. */
- fileinfo->fd = fd;
- path->exist = 1;
-
- /* Check whether we have this file already loaded. */
- if (unlikely (check_for_duplicate (fileinfo) != 0))
- return EAGAIN;
-
- /* Make a copy of the name. */
- fileinfo->rfname = obstack_strdup (&ld_state.smem, rfname);
-
- if (unlikely (ld_state.trace_files))
- printf (fileinfo->file_type == archive_file_type
- ? gettext ("%s (for -l%s)\n")
- : gettext ("%s (for DT_NEEDED %s)\n"),
- rfname, fname);
-
- return 0;
- }
-
- /* The file does not exist. Maybe the whole directory doesn't.
- Check it unless we know it exists. */
- if (unlikely (path->exist == 0))
- {
- struct stat st;
-
- /* Keep only the directory name. Note that the path
- might be relative. This doesn't matter here. We do
- the test in any case even if there is the chance that
- somebody wants to change the programs working
- directory at some point which would make the result
- of this test void. Since changing the working
- directory is completely wrong we are not taking this
- case into account. */
- rfname[dirlen] = '\0';
- if (unlikely (stat (rfname, &st) < 0) || ! S_ISDIR (st.st_mode))
- /* The directory does not exist or the named file is no
- directory. */
- path->exist = -1;
- else
- path->exist = 1;
- }
- }
-
- /* Next path element. */
- path = path->next;
- }
- while (likely (err == ENOENT && path != firstp));
-
- return err;
-}
-
-
-static int
-open_along_path (struct usedfiles *fileinfo)
-{
- const char *fname = fileinfo->fname;
- int err = ENOENT;
-
- if (fileinfo->file_type == relocatable_file_type)
- {
- /* Only libraries are searched along the path. */
- fileinfo->fd = open (fname, O_RDONLY);
-
- if (likely (fileinfo->fd != -1))
- {
- /* We found the file. */
- if (unlikely (ld_state.trace_files))
- print_file_name (stdout, fileinfo, 1, 1);
-
- return check_for_duplicate (fileinfo);
- }
-
- /* If the name is an absolute path we are done. */
- err = errno;
- }
- else
- {
- /* If the user specified two parts to the LD_LIBRARY_PATH variable
- try the first part now. */
- err = open_along_path2 (fileinfo, ld_state.ld_library_path1);
-
- /* Try the user-specified path next. */
- if (err == ENOENT)
- err = open_along_path2 (fileinfo,
- fileinfo->file_type == archive_file_type
- ? ld_state.paths : ld_state.rpath_link);
-
- /* Then the second part of the LD_LIBRARY_PATH value. */
- if (unlikely (err == ENOENT))
- {
- err = open_along_path2 (fileinfo, ld_state.ld_library_path2);
-
- /* In case we look for a DSO handle now the RUNPATH. */
- if (err == ENOENT)
- {
- if (fileinfo->file_type == dso_file_type)
- err = open_along_path2 (fileinfo, ld_state.runpath_link);
-
- /* Finally the path from the default linker script. */
- if (err == ENOENT)
- err = open_along_path2 (fileinfo, ld_state.default_paths);
- }
- }
- }
-
- if (unlikely (err != 0)
- && (err != EAGAIN || fileinfo->file_type == relocatable_file_type))
- error (0, err, gettext ("cannot open %s"), fileinfo->fname);
-
- return err;
-}
-
-
-static int
-matching_group_comdat_scn (const XElf_Sym *sym, size_t shndx,
- struct usedfiles *fileinfo, struct symbol *oldp)
-{
- if ((shndx >= SHN_LORESERVE && shndx <= SHN_HIRESERVE)
- || (oldp->scndx >= SHN_LORESERVE && oldp->scndx <= SHN_HIRESERVE))
- /* Cannot be a group COMDAT section. */
- return 0;
-
- size_t newgrpid = fileinfo->scninfo[shndx].grpid;
- size_t oldgrpid = oldp->file->scninfo[oldp->scndx].grpid;
- if (newgrpid == 0 || oldgrpid == 0)
- return 0;
-
- assert (SCNINFO_SHDR (fileinfo->scninfo[newgrpid].shdr).sh_type
- == SHT_GROUP);
- assert (SCNINFO_SHDR (oldp->file->scninfo[oldgrpid].shdr).sh_type
- == SHT_GROUP);
-
- if (! fileinfo->scninfo[newgrpid].comdat_group
- || ! oldp->file->scninfo[oldgrpid].comdat_group)
- return 0;
-
- if (strcmp (fileinfo->scninfo[newgrpid].symbols->name,
- oldp->file->scninfo[oldgrpid].symbols->name) != 0)
- return 0;
-
- /* This is a matching, duplicate COMDAT group section. Ignore it. */
- return 1;
-}
-
-
-static void
-check_type_and_size (const XElf_Sym *sym, struct usedfiles *fileinfo,
- struct symbol *oldp)
-{
- /* We check the type and size of the symbols. In both cases the
- information can be missing (size is zero, type is STT_NOTYPE) in
- which case we issue no warnings. Otherwise everything must
- match. If the type does not match there is no point in checking
- the size. */
-
- if (XELF_ST_TYPE (sym->st_info) != STT_NOTYPE && oldp->type != STT_NOTYPE
- && unlikely (oldp->type != XELF_ST_TYPE (sym->st_info)))
- {
- char buf1[64];
- char buf2[64];
-
- error (0, 0, gettext ("\
-Warning: type of `%s' changed from %s in %s to %s in %s"),
- oldp->name,
- ebl_symbol_type_name (ld_state.ebl, oldp->type,
- buf1, sizeof (buf1)),
- oldp->file->rfname,
- ebl_symbol_type_name (ld_state.ebl, XELF_ST_TYPE (sym->st_info),
- buf2, sizeof (buf2)),
- fileinfo->rfname);
- }
- else if (XELF_ST_TYPE (sym->st_info) == STT_OBJECT
- && oldp->size != 0
- && unlikely (oldp->size != sym->st_size))
- error (0, 0, gettext ("\
-Warning: size of `%s' changed from %" PRIu64 " in %s to %" PRIu64 " in %s"),
- oldp->name, (uint64_t) oldp->size, oldp->file->rfname,
- (uint64_t) sym->st_size, fileinfo->rfname);
-}
-
-
-static int
-check_definition (const XElf_Sym *sym, size_t shndx, size_t symidx,
- struct usedfiles *fileinfo, struct symbol *oldp)
-{
- int result = 0;
- bool old_in_dso = FILEINFO_EHDR (oldp->file->ehdr).e_type == ET_DYN;
- bool new_in_dso = FILEINFO_EHDR (fileinfo->ehdr).e_type == ET_DYN;
- bool use_new_def = false;
-
- if (shndx != SHN_UNDEF
- && (! oldp->defined
- || (shndx != SHN_COMMON && oldp->common && ! new_in_dso)
- || (old_in_dso && ! new_in_dso)))
- {
- /* We found a definition for a previously undefined symbol or a
- real definition for a previous common-only definition or a
- redefinition of a symbol definition in an object file
- previously defined in a DSO. First perform some tests which
- will show whether the common is really matching the
- definition. */
- check_type_and_size (sym, fileinfo, oldp);
-
- /* We leave the next element intact to not interrupt the list
- with the unresolved symbols. Whoever walks the list will
- have to check the `defined' flag. But we remember that this
- list element is not unresolved anymore. */
- if (! oldp->defined)
- {
- /* Remove from the list. */
- --ld_state.nunresolved;
- if (! oldp->weak)
- --ld_state.nunresolved_nonweak;
- CDBL_LIST_DEL (ld_state.unresolved, oldp);
- }
- else if (oldp->common)
- /* Remove from the list. */
- CDBL_LIST_DEL (ld_state.common_syms, oldp);
-
- /* Use the values of the definition from now on. */
- use_new_def = true;
- }
- else if (shndx != SHN_UNDEF
- && oldp->defined
- && matching_group_comdat_scn (sym, shndx, fileinfo, oldp))
- /* The duplicate symbol is in a group COMDAT section with the same
- signature as the one containing the original definition.
- Just ignore the second definition. */
- /* nothing */;
- else if (shndx != SHN_UNDEF
- && unlikely (! oldp->common)
- && oldp->defined
- && shndx != SHN_COMMON
- /* Multiple definitions are no fatal errors if the -z muldefs flag
- is used. We don't warn about the multiple definition unless we
- are told to be verbose. */
- && (!ld_state.muldefs || verbose)
- && ! old_in_dso && fileinfo->file_type == relocatable_file_type)
- {
- /* We have a double definition. This is a problem. */
- char buf[64];
- XElf_Sym_vardef (oldsym);
- struct usedfiles *oldfile;
- const char *scnname;
- Elf32_Word xndx;
- size_t shnum;
-
- if (elf_getshdrnum (fileinfo->elf, &shnum) < 0)
- error (EXIT_FAILURE, 0,
- gettext ("cannot determine number of sections: %s"),
- elf_errmsg (-1));
-
- /* XXX Use only ebl_section_name. */
- if (shndx < SHN_LORESERVE || (shndx > SHN_HIRESERVE && shndx < shnum))
- scnname = elf_strptr (fileinfo->elf,
- fileinfo->shstrndx,
- SCNINFO_SHDR (fileinfo->scninfo[shndx].shdr).sh_name);
- else
- // XXX extended section
- scnname = ebl_section_name (ld_state.ebl, shndx, 0, buf, sizeof (buf),
- NULL, shnum);
-
- /* XXX Print source file and line number. */
- print_file_name (stderr, fileinfo, 1, 0);
- fprintf (stderr,
- gettext ("(%s+%#" PRIx64 "): multiple definition of %s `%s'\n"),
- scnname,
- (uint64_t) sym->st_value,
- ebl_symbol_type_name (ld_state.ebl, XELF_ST_TYPE (sym->st_info),
- buf, sizeof (buf)),
- oldp->name);
-
- oldfile = oldp->file;
- xelf_getsymshndx (oldfile->symtabdata, oldfile->xndxdata, oldp->symidx,
- oldsym, xndx);
- assert (oldsym != NULL);
-
- /* XXX Use only ebl_section_name. */
- if (oldp->scndx < SHN_LORESERVE || oldp->scndx > SHN_HIRESERVE)
- scnname = elf_strptr (oldfile->elf,
- oldfile->shstrndx,
- SCNINFO_SHDR (oldfile->scninfo[shndx].shdr).sh_name);
- else
- scnname = ebl_section_name (ld_state.ebl, oldp->scndx, oldp->scndx,
- buf, sizeof (buf), NULL, shnum);
-
- /* XXX Print source file and line number. */
- print_file_name (stderr, oldfile, 1, 0);
- fprintf (stderr, gettext ("(%s+%#" PRIx64 "): first defined here\n"),
- scnname, (uint64_t) oldsym->st_value);
-
- if (likely (!ld_state.muldefs))
- result = 1;
- }
- else if (old_in_dso && fileinfo->file_type == relocatable_file_type
- && shndx != SHN_UNDEF)
- /* We use the definition from a normal relocatable file over the
- definition in a DSO. This is what the dynamic linker would
- do, too. */
- use_new_def = true;
- else if (old_in_dso && !new_in_dso && oldp->defined && !oldp->on_dsolist)
- {
- CDBL_LIST_ADD_REAR (ld_state.from_dso, oldp);
- ++ld_state.nfrom_dso;
-
- /* If the object is a function we allocate a PLT entry,
- otherwise only a GOT entry. */
- if (oldp->type == STT_FUNC)
- ++ld_state.nplt;
- else
- ++ld_state.ngot;
-
- oldp->on_dsolist = 1;
- }
- else if (oldp->common && shndx == SHN_COMMON)
- {
- /* The symbol size is the largest of all common definitions. */
- oldp->size = MAX (oldp->size, sym->st_size);
- /* Similarly for the alignment. */
- oldp->merge.value = MAX (oldp->merge.value, sym->st_value);
- }
-
- if (unlikely (use_new_def))
- {
- /* Adjust the symbol record appropriately and remove
- the symbol from the list of symbols which are taken from DSOs. */
- if (old_in_dso && fileinfo->file_type == relocatable_file_type)
- {
- CDBL_LIST_DEL (ld_state.from_dso, oldp);
- --ld_state.nfrom_dso;
-
- if (likely (oldp->type == STT_FUNC))
- --ld_state.nplt;
- else
- --ld_state.ngot;
-
- oldp->on_dsolist = 0;
- }
-
- /* Use the values of the definition from now on. */
- oldp->size = sym->st_size;
- oldp->type = XELF_ST_TYPE (sym->st_info);
- oldp->symidx = symidx;
- oldp->scndx = shndx;
- //oldp->symscndx = THESYMSCNDX must be passed;
- oldp->file = fileinfo;
- oldp->defined = 1;
- oldp->in_dso = new_in_dso;
- oldp->common = shndx == SHN_COMMON;
- if (likely (fileinfo->file_type == relocatable_file_type))
- {
- /* If the definition comes from a DSO we pertain the weak flag
- and it's indicating whether the reference is weak or not. */
- oldp->weak = XELF_ST_BIND (sym->st_info) == STB_WEAK;
-
- // XXX Really exclude SHN_ABS?
- if (shndx != SHN_COMMON && shndx != SHN_ABS)
- {
- struct scninfo *ignore;
- mark_section_used (&fileinfo->scninfo[shndx], shndx, &ignore);
- }
- }
-
- /* Add to the list of symbols used from DSOs if necessary. */
- if (new_in_dso && !old_in_dso)
- {
- CDBL_LIST_ADD_REAR (ld_state.from_dso, oldp);
- ++ld_state.nfrom_dso;
-
- /* If the object is a function we allocate a PLT entry,
- otherwise only a GOT entry. */
- if (oldp->type == STT_FUNC)
- ++ld_state.nplt;
- else
- ++ld_state.ngot;
-
- oldp->on_dsolist = 1;
- }
- else if (shndx == SHN_COMMON)
- {
- /* Store the alignment. */
- oldp->merge.value = sym->st_value;
-
- CDBL_LIST_ADD_REAR (ld_state.common_syms, oldp);
- }
- }
-
- return result;
-}
-
-
-static struct scninfo *
-find_section_group (struct usedfiles *fileinfo, Elf32_Word shndx,
- Elf_Data **datap)
-{
- struct scninfo *runp;
-
- for (runp = fileinfo->groups; runp != NULL; runp = runp->next)
- if (!runp->used)
- {
- Elf32_Word *grpref;
- size_t cnt;
- Elf_Data *data;
-
- data = elf_getdata (runp->scn, NULL);
- if (data == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("%s: cannot get section group data: %s"),
- fileinfo->fname, elf_errmsg (-1));
-
- /* There cannot be another data block. */
- assert (elf_getdata (runp->scn, data) == NULL);
-
- grpref = (Elf32_Word *) data->d_buf;
- cnt = data->d_size / sizeof (Elf32_Word);
- /* Note that we stop after looking at index 1 since index 0
- contains the flags for the section group. */
- while (cnt > 1)
- if (grpref[--cnt] == shndx)
- {
- *datap = data;
- return runp;
- }
- }
-
- /* If we come here no section group contained the given section
- despite the SHF_GROUP flag. This is an error in the input
- file. */
- error (EXIT_FAILURE, 0, gettext ("\
-%s: section '%s' with group flag set does not belong to any group"),
- fileinfo->fname,
- elf_strptr (fileinfo->elf, fileinfo->shstrndx,
- SCNINFO_SHDR (fileinfo->scninfo[shndx].shdr).sh_name));
- return NULL;
-}
-
-
-/* Mark all sections which belong to the same group as section SHNDX
- as used. */
-static void
-mark_section_group (struct usedfiles *fileinfo, Elf32_Word shndx,
- struct scninfo **grpscnp)
-{
- /* First locate the section group. There can be several (many) of
- them. */
- size_t cnt;
- Elf32_Word *grpref;
- Elf_Data *data;
- struct scninfo *grpscn = find_section_group (fileinfo, shndx, &data);
- *grpscnp = grpscn;
-
- /* Mark all the sections as used.
-
- XXX Two possible problems here:
-
- - the gABI says "The section must be referenced by a section of type
- SHT_GROUP". I hope everybody reads this as "exactly one section".
-
- - section groups are also useful to mark the debugging section which
- belongs to a text section. Unconditionally adding debugging sections
- is therefore probably not what is wanted if stripping is required. */
-
- /* Mark the section group as handled. */
- grpscn->used = true;
-
- grpref = (Elf32_Word *) data->d_buf;
- cnt = data->d_size / sizeof (Elf32_Word);
- while (cnt > 1)
- {
- Elf32_Word idx = grpref[--cnt];
- XElf_Shdr *shdr = &SCNINFO_SHDR (fileinfo->scninfo[idx].shdr);
-
- if (fileinfo->scninfo[idx].grpid != grpscn->grpid)
- error (EXIT_FAILURE, 0, gettext ("\
-%s: section [%2d] '%s' is not in the correct section group"),
- fileinfo->fname, (int) idx,
- elf_strptr (fileinfo->elf, fileinfo->shstrndx, shdr->sh_name));
-
- if (ld_state.strip == strip_none
- /* If we are stripping, remove debug sections. */
- || (!ebl_debugscn_p (ld_state.ebl,
- elf_strptr (fileinfo->elf, fileinfo->shstrndx,
- shdr->sh_name))
- /* And the relocation sections for the debug sections. */
- && ((shdr->sh_type != SHT_RELA && shdr->sh_type != SHT_REL)
- || !ebl_debugscn_p (ld_state.ebl,
- elf_strptr (fileinfo->elf,
- fileinfo->shstrndx,
- SCNINFO_SHDR (fileinfo->scninfo[shdr->sh_info].shdr).sh_name)))))
- {
- struct scninfo *ignore;
-
- mark_section_used (&fileinfo->scninfo[idx], idx, &ignore);
- }
- }
-}
-
-
-static void
-mark_section_used (struct scninfo *scninfo, Elf32_Word shndx,
- struct scninfo **grpscnp)
-{
- if (likely (scninfo->used))
- /* Nothing to be done. */
- return;
-
- /* We need this section. */
- scninfo->used = true;
-
- /* Make sure the section header has been read from the file. */
- XElf_Shdr *shdr = &SCNINFO_SHDR (scninfo->shdr);
-#if NATIVE_ELF
- if (unlikely (scninfo->shdr == NULL))
-#else
- if (unlikely (scninfo->shdr.sh_type == SHT_NULL))
-#endif
- {
-#if NATIVE_ELF != 0
- shdr = xelf_getshdr (scninfo->scn, scninfo->shdr);
-#else
- xelf_getshdr_copy (scninfo->scn, shdr, scninfo->shdr);
-#endif
- if (unlikely (shdr == NULL))
- /* Something is very wrong. The calling code will notice it
- soon and print a message. */
- return;
- }
-
- /* Handle section linked by 'sh_link'. */
- if (unlikely (shdr->sh_link != 0))
- {
- struct scninfo *ignore;
- mark_section_used (&scninfo->fileinfo->scninfo[shdr->sh_link],
- shdr->sh_link, &ignore);
- }
-
- /* Handle section linked by 'sh_info'. */
- if (unlikely (shdr->sh_info != 0) && (shdr->sh_flags & SHF_INFO_LINK))
- {
- struct scninfo *ignore;
- mark_section_used (&scninfo->fileinfo->scninfo[shdr->sh_info],
- shdr->sh_info, &ignore);
- }
-
- if (unlikely (shdr->sh_flags & SHF_GROUP) && ld_state.gc_sections)
- /* Find the section group which contains this section. */
- mark_section_group (scninfo->fileinfo, shndx, grpscnp);
-}
-
-
-/* We collect all sections in a hashing table. All sections with the
- same name are collected in a list. Note that we do not determine
- which sections are finally collected in the same output section
- here. This would be terribly inefficient. It will be done later. */
-static void
-add_section (struct usedfiles *fileinfo, struct scninfo *scninfo)
-{
- struct scnhead *queued;
- struct scnhead search;
- unsigned long int hval;
- XElf_Shdr *shdr = &SCNINFO_SHDR (scninfo->shdr);
- struct scninfo *grpscn = NULL;
- Elf_Data *grpscndata = NULL;
-
- /* See whether we can determine right away whether we need this
- section in the output.
-
- XXX I assume here that --gc-sections only affects extraction
- from an archive. If it also affects objects files given on
- the command line then somebody must explain to me how the
- dependency analysis should work. Should the entry point be
- the root? What if it is a numeric value? */
- if (!scninfo->used
- && (ld_state.strip == strip_none
- || (shdr->sh_flags & SHF_ALLOC) != 0
- || shdr->sh_type == SHT_NOTE
- || (shdr->sh_type == SHT_PROGBITS
- && strcmp (elf_strptr (fileinfo->elf,
- fileinfo->shstrndx,
- shdr->sh_name), ".comment") == 0))
- && (fileinfo->status != in_archive || !ld_state.gc_sections))
- /* Mark as used and handle reference recursively if necessary. */
- mark_section_used (scninfo, elf_ndxscn (scninfo->scn), &grpscn);
-
- if ((shdr->sh_flags & SHF_GROUP) && grpscn == NULL)
- /* Determine the symbol which name constitutes the signature
- for the section group. */
- grpscn = find_section_group (fileinfo, elf_ndxscn (scninfo->scn),
- &grpscndata);
- assert (grpscn == NULL || grpscn->symbols->name != NULL);
-
- /* Determine the section name. */
- search.name = elf_strptr (fileinfo->elf, fileinfo->shstrndx, shdr->sh_name);
- search.type = shdr->sh_type;
- search.flags = shdr->sh_flags;
- search.entsize = shdr->sh_entsize;
- search.grp_signature = grpscn != NULL ? grpscn->symbols->name : NULL;
- search.kind = scn_normal;
- hval = elf_hash (search.name);
-
- /* Find already queued sections. */
- queued = ld_section_tab_find (&ld_state.section_tab, hval, &search);
- if (queued != NULL)
- {
- bool is_comdat = false;
-
- /* If this section is part of a COMDAT section group we simply
- ignore it since we already have a copy. */
- if (unlikely (shdr->sh_flags & SHF_GROUP))
- {
- /* Get the data of the section group section. */
- if (grpscndata == NULL)
- {
- grpscndata = elf_getdata (grpscn->scn, NULL);
- assert (grpscndata != NULL);
- }
-
- /* XXX Possibly unaligned memory access. */
- if ((((Elf32_Word *) grpscndata->d_buf)[0] & GRP_COMDAT) != 0)
- {
- /* We have to compare the group signatures. There might
- be sections with the same name but belonging to
- groups with different signatures. This means we have
- to compare the new group signature with all those
- already collected. There might also be some
- non-group sections in the mix. */
- struct scninfo *runp = queued->last;
- do
- {
- if (SCNINFO_SHDR (runp->shdr).sh_flags & SHF_GROUP)
- {
- struct scninfo *grpscn2
- = find_section_group (runp->fileinfo,
- elf_ndxscn (runp->scn),
- &grpscndata);
-
- if (strcmp (grpscn->symbols->name,
- grpscn2->symbols->name) == 0)
- {
- scninfo->unused_comdat = is_comdat = true;
- break;
- }
- }
-
- runp = runp->next;
- }
- while (runp != queued->last);
- }
- }
-
- if (!is_comdat)
- {
- /* No COMDAT section, we use the data. */
- scninfo->next = queued->last->next;
- queued->last = queued->last->next = scninfo;
-
- queued->flags = ebl_sh_flags_combine (ld_state.ebl, queued->flags,
- shdr->sh_flags);
- queued->align = MAX (queued->align, shdr->sh_addralign);
- }
- }
- else
- {
- /* We do not use obstacks here since the memory might be
- deallocated. */
- queued = (struct scnhead *) xcalloc (sizeof (struct scnhead), 1);
- queued->kind = scn_normal;
- queued->name = search.name;
- queued->type = shdr->sh_type;
- queued->flags = shdr->sh_flags;
- queued->align = shdr->sh_addralign;
- queued->entsize = shdr->sh_entsize;
- queued->grp_signature = grpscn != NULL ? grpscn->symbols->name : NULL;
- queued->segment_nr = ~0;
- queued->last = scninfo->next = scninfo;
-
- /* Check whether we need a TLS segment. */
- ld_state.need_tls |= (shdr->sh_flags & SHF_TLS) != 0;
-
- /* Add to the hash table and possibly overwrite existing value. */
- ld_section_tab_insert (&ld_state.section_tab, hval, queued);
- }
-}
-
-
-static int
-add_relocatable_file (struct usedfiles *fileinfo, GElf_Word secttype)
-{
- size_t scncnt;
- size_t cnt;
- Elf_Data *symtabdata = NULL;
- Elf_Data *xndxdata = NULL;
- Elf_Data *versymdata = NULL;
- Elf_Data *verdefdata = NULL;
- Elf_Data *verneeddata = NULL;
- size_t symstridx = 0;
- size_t nsymbols = 0;
- size_t nlocalsymbols = 0;
- bool has_merge_sections = false;
- bool has_tls_symbols = false;
- /* Unless we have different information we assume the code needs
- an executable stack. */
- enum execstack execstack = execstack_true;
-
- /* Prerequisites. */
- assert (fileinfo->elf != NULL);
-
- /* Allocate memory for the sections. */
- if (unlikely (elf_getshdrnum (fileinfo->elf, &scncnt) < 0))
- error (EXIT_FAILURE, 0,
- gettext ("cannot determine number of sections: %s"),
- elf_errmsg (-1));
-
- fileinfo->scninfo = (struct scninfo *)
- obstack_calloc (&ld_state.smem, scncnt * sizeof (struct scninfo));
-
- /* Read all the section headers and find the symbol table. Note
- that we don't skip the section with index zero. Even though the
- section itself is always empty the section header contains
- informaton for the case when the section index for the section
- header string table is too large to fit in the ELF header. */
- for (cnt = 0; cnt < scncnt; ++cnt)
- {
- /* Store the handle for the section. */
- fileinfo->scninfo[cnt].scn = elf_getscn (fileinfo->elf, cnt);
-
- /* Get the ELF section header and data. */
- XElf_Shdr *shdr;
-#if NATIVE_ELF != 0
- if (fileinfo->scninfo[cnt].shdr == NULL)
-#else
- if (fileinfo->scninfo[cnt].shdr.sh_type == SHT_NULL)
-#endif
- {
-#if NATIVE_ELF != 0
- shdr = xelf_getshdr (fileinfo->scninfo[cnt].scn,
- fileinfo->scninfo[cnt].shdr);
-#else
- xelf_getshdr_copy (fileinfo->scninfo[cnt].scn, shdr,
- fileinfo->scninfo[cnt].shdr);
-#endif
- if (shdr == NULL)
- {
- /* This should never happen. */
- fprintf (stderr, gettext ("%s: invalid ELF file (%s:%d)\n"),
- fileinfo->rfname, __FILE__, __LINE__);
- return 1;
- }
- }
- else
- shdr = &SCNINFO_SHDR (fileinfo->scninfo[cnt].shdr);
-
- Elf_Data *data = elf_getdata (fileinfo->scninfo[cnt].scn, NULL);
-
- /* Check whether this section is marked as merge-able. */
- has_merge_sections |= (shdr->sh_flags & SHF_MERGE) != 0;
- has_tls_symbols |= (shdr->sh_flags & SHF_TLS) != 0;
-
- /* Get the ELF section header and data. */
- /* Make the file structure available. */
- fileinfo->scninfo[cnt].fileinfo = fileinfo;
-
- if (unlikely (shdr->sh_type == SHT_SYMTAB)
- || unlikely (shdr->sh_type == SHT_DYNSYM))
- {
- if (shdr->sh_type == SHT_SYMTAB)
- {
- assert (fileinfo->symtabdata == NULL);
- fileinfo->symtabdata = data;
- fileinfo->nsymtab = shdr->sh_size / shdr->sh_entsize;
- fileinfo->nlocalsymbols = shdr->sh_info;
- fileinfo->symstridx = shdr->sh_link;
- }
- else
- {
- assert (fileinfo->dynsymtabdata == NULL);
- fileinfo->dynsymtabdata = data;
- fileinfo->ndynsymtab = shdr->sh_size / shdr->sh_entsize;
- fileinfo->dynsymstridx = shdr->sh_link;
- }
-
- /* If we are looking for the normal symbol table we just
- found it. */
- if (secttype == shdr->sh_type)
- {
- assert (symtabdata == NULL);
- symtabdata = data;
- symstridx = shdr->sh_link;
- nsymbols = shdr->sh_size / shdr->sh_entsize;
- nlocalsymbols = shdr->sh_info;
- }
- }
- else if (unlikely (shdr->sh_type == SHT_SYMTAB_SHNDX))
- {
- assert (xndxdata == NULL);
- fileinfo->xndxdata = xndxdata = data;
- }
- else if (unlikely (shdr->sh_type == SHT_GNU_versym))
- {
- assert (versymdata == 0);
- fileinfo->versymdata = versymdata = data;
- }
- else if (unlikely (shdr->sh_type == SHT_GNU_verdef))
- {
- size_t nversions;
-
- assert (verdefdata == 0);
- fileinfo->verdefdata = verdefdata = data;
-
- /* Allocate the arrays flagging the use of the version and
- to track of allocated names. */
- fileinfo->nverdef = nversions = shdr->sh_info;
- /* We have NVERSIONS + 1 because the indeces used to access the
- sectino start with one; zero represents local binding. */
- fileinfo->verdefused = (XElf_Versym *)
- obstack_calloc (&ld_state.smem,
- sizeof (XElf_Versym) * (nversions + 1));
- fileinfo->verdefent = (struct Ebl_Strent **)
- obstack_alloc (&ld_state.smem,
- sizeof (struct Ebl_Strent *) * (nversions + 1));
- }
- else if (unlikely (shdr->sh_type == SHT_GNU_verneed))
- {
- assert (verneeddata == 0);
- fileinfo->verneeddata = verneeddata = data;
- }
- else if (unlikely (shdr->sh_type == SHT_DYNAMIC))
- {
- assert (fileinfo->dynscn == NULL);
- fileinfo->dynscn = fileinfo->scninfo[cnt].scn;
- }
- else if (unlikely (shdr->sh_type == SHT_GROUP))
- {
- Elf_Scn *symscn;
- XElf_Shdr_vardef (symshdr);
- Elf_Data *symdata;
-
- if (FILEINFO_EHDR (fileinfo->ehdr).e_type != ET_REL)
- error (EXIT_FAILURE, 0, gettext ("\
-%s: only files of type ET_REL might contain section groups"),
- fileinfo->fname);
-
- fileinfo->scninfo[cnt].next = fileinfo->groups;
- fileinfo->scninfo[cnt].grpid = cnt;
- fileinfo->groups = &fileinfo->scninfo[cnt];
-
- /* Determine the signature. We create a symbol record for
- it. Only the name element is important. */
- fileinfo->scninfo[cnt].symbols = (struct symbol *)
- obstack_calloc (&ld_state.smem, sizeof (struct symbol));
-
- symscn = elf_getscn (fileinfo->elf, shdr->sh_link);
- xelf_getshdr (symscn, symshdr);
- symdata = elf_getdata (symscn, NULL);
-
- if (symshdr != NULL)
- {
- XElf_Sym_vardef (sym);
-
- /* We don't need the section index and therefore we don't
- have to use 'xelf_getsymshndx'. */
- xelf_getsym (symdata, shdr->sh_info, sym);
- if (sym != NULL)
- {
- struct symbol *symbol = fileinfo->scninfo[cnt].symbols;
-
-#ifndef NO_HACKS
- if (XELF_ST_TYPE (sym->st_info) == STT_SECTION)
- {
- XElf_Shdr_vardef (buggyshdr);
- xelf_getshdr (elf_getscn (fileinfo->elf, sym->st_shndx),
- buggyshdr);
-
- symbol->name = elf_strptr (fileinfo->elf,
- FILEINFO_EHDR (fileinfo->ehdr).e_shstrndx,
- buggyshdr->sh_name);
- symbol->symidx = -1;
- }
- else
-#endif
- {
- symbol->name = elf_strptr (fileinfo->elf,
- symshdr->sh_link,
- sym->st_name);
- symbol->symidx = shdr->sh_info;
- }
- symbol->file = fileinfo;
- }
- }
- if (fileinfo->scninfo[cnt].symbols->name == NULL)
- error (EXIT_FAILURE, 0, gettext ("\
-%s: cannot determine signature of section group [%2zd] '%s': %s"),
- fileinfo->fname,
- elf_ndxscn (fileinfo->scninfo[cnt].scn),
- elf_strptr (fileinfo->elf, fileinfo->shstrndx,
- shdr->sh_name),
- elf_errmsg (-1));
-
-
- /* For all the sections which are part of this group, add
- the reference. */
- if (data == NULL)
- error (EXIT_FAILURE, 0, gettext ("\
-%s: cannot get content of section group [%2zd] '%s': %s'"),
- fileinfo->fname, elf_ndxscn (fileinfo->scninfo[cnt].scn),
- elf_strptr (fileinfo->elf, fileinfo->shstrndx,
- shdr->sh_name),
- elf_errmsg (-1));
-
- Elf32_Word *grpdata = (Elf32_Word *) data->d_buf;
- if (grpdata[0] & GRP_COMDAT)
- fileinfo->scninfo[cnt].comdat_group = true;
- for (size_t inner = 1; inner < data->d_size / sizeof (Elf32_Word);
- ++inner)
- {
- if (grpdata[inner] >= scncnt)
- error (EXIT_FAILURE, 0, gettext ("\
-%s: group member %zu of section group [%2zd] '%s' has too high index: %" PRIu32),
- fileinfo->fname,
- inner, elf_ndxscn (fileinfo->scninfo[cnt].scn),
- elf_strptr (fileinfo->elf, fileinfo->shstrndx,
- shdr->sh_name),
- grpdata[inner]);
-
- fileinfo->scninfo[grpdata[inner]].grpid = cnt;
- }
-
- /* The 'used' flag is used to indicate when the information
- in the section group is used to mark all other sections
- as used. So it must not be true yet. */
- assert (fileinfo->scninfo[cnt].used == false);
- }
- else if (! SECTION_TYPE_P (&ld_state, shdr->sh_type)
- && unlikely ((shdr->sh_flags & SHF_OS_NONCONFORMING) != 0))
- /* According to the gABI it is a fatal error if the file contains
- a section with unknown type and the SHF_OS_NONCONFORMING flag
- set. */
- error (EXIT_FAILURE, 0,
- gettext ("%s: section '%s' has unknown type: %d"),
- fileinfo->fname,
- elf_strptr (fileinfo->elf, fileinfo->shstrndx,
- shdr->sh_name),
- (int) shdr->sh_type);
- /* We don't have to add a few section types here. These will be
- generated from scratch for the new output file. We also
- don't add the sections of DSOs here since these sections are
- not used in the resulting object file. */
- else if (likely (fileinfo->file_type == relocatable_file_type)
- && likely (cnt > 0)
- && likely (shdr->sh_type == SHT_PROGBITS
- || shdr->sh_type == SHT_RELA
- || shdr->sh_type == SHT_REL
- || shdr->sh_type == SHT_NOTE
- || shdr->sh_type == SHT_NOBITS
- || shdr->sh_type == SHT_INIT_ARRAY
- || shdr->sh_type == SHT_FINI_ARRAY
- || shdr->sh_type == SHT_PREINIT_ARRAY))
- {
- /* Check whether the section needs to be executable. */
- if (shdr->sh_type == SHT_PROGBITS
- && (shdr->sh_flags & SHF_EXECINSTR) == 0
- && strcmp (elf_strptr (fileinfo->elf, fileinfo->shstrndx,
- shdr->sh_name),
- ".note.GNU-stack") == 0)
- execstack = execstack_false;
-
- add_section (fileinfo, &fileinfo->scninfo[cnt]);
- }
- }
-
- /* Now we know more about the requirements for an executable stack
- of the result. */
- if (fileinfo->file_type == relocatable_file_type
- && execstack == execstack_true
- && ld_state.execstack != execstack_false_force)
- ld_state.execstack = execstack_true;
-
- /* Handle the symbols. Record defined and undefined symbols in the
- hash table. In theory there can be a file without any symbol
- table. */
- if (likely (symtabdata != NULL))
- {
- /* In case this file contains merge-able sections we have to
- locate the symbols which are in these sections. */
- fileinfo->has_merge_sections = has_merge_sections;
- if (likely (has_merge_sections || has_tls_symbols))
- {
- fileinfo->symref = (struct symbol **)
- obstack_calloc (&ld_state.smem,
- nsymbols * sizeof (struct symbol *));
-
- /* Only handle the local symbols here. */
- for (cnt = 0; cnt < nlocalsymbols; ++cnt)
- {
- Elf32_Word shndx;
- XElf_Sym_vardef (sym);
-
- xelf_getsymshndx (symtabdata, xndxdata, cnt, sym, shndx);
- if (sym == NULL)
- {
- /* This should never happen. */
- fprintf (stderr, gettext ("%s: invalid ELF file (%s:%d)\n"),
- fileinfo->rfname, __FILE__, __LINE__);
- return 1;
- }
-
- if (likely (shndx != SHN_XINDEX))
- shndx = sym->st_shndx;
- else if (unlikely (shndx == 0))
- {
- fprintf (stderr, gettext ("%s: invalid ELF file (%s:%d)\n"),
- fileinfo->rfname, __FILE__, __LINE__);
- return 1;
- }
-
- if (XELF_ST_TYPE (sym->st_info) != STT_SECTION
- && (shndx < SHN_LORESERVE || shndx > SHN_HIRESERVE)
- && ((SCNINFO_SHDR (fileinfo->scninfo[shndx].shdr).sh_flags
- & SHF_MERGE)
- || XELF_ST_TYPE (sym->st_info) == STT_TLS))
- {
- /* Create a symbol record for this symbol and add it
- to the list for this section. */
- struct symbol *newp;
-
- newp = (struct symbol *)
- obstack_calloc (&ld_state.smem, sizeof (struct symbol));
-
- newp->symidx = cnt;
- newp->scndx = shndx;
- newp->file = fileinfo;
- newp->defined = 1;
- fileinfo->symref[cnt] = newp;
-
- if (fileinfo->scninfo[shndx].symbols == NULL)
- fileinfo->scninfo[shndx].symbols = newp->next_in_scn
- = newp;
- else
- {
- newp->next_in_scn
- = fileinfo->scninfo[shndx].symbols->next_in_scn;
- fileinfo->scninfo[shndx].symbols
- = fileinfo->scninfo[shndx].symbols->next_in_scn = newp;
- }
- }
- }
- }
- else
- /* Create array with pointers to the symbol definitions. Note
- that we only allocate memory for the non-local symbols
- since we have no merge-able sections. But we store the
- pointer as if it was for the whole symbol table. This
- saves some memory. */
- fileinfo->symref = (struct symbol **)
- obstack_calloc (&ld_state.smem, ((nsymbols - nlocalsymbols)
- * sizeof (struct symbol *)))
- - nlocalsymbols;
-
- /* Don't handle local symbols here. It's either not necessary
- at all or has already happened. */
- for (cnt = nlocalsymbols; cnt < nsymbols; ++cnt)
- {
- XElf_Sym_vardef (sym);
- Elf32_Word shndx;
- xelf_getsymshndx (symtabdata, xndxdata, cnt, sym, shndx);
-
- if (sym == NULL)
- {
- /* This should never happen. */
- fprintf (stderr, gettext ("%s: invalid ELF file (%s:%d)\n"),
- fileinfo->rfname, __FILE__, __LINE__);
- return 1;
- }
-
- if (likely (shndx != SHN_XINDEX))
- shndx = sym->st_shndx;
- else if (unlikely (shndx == 0))
- {
- fprintf (stderr, gettext ("%s: invalid ELF file (%s:%d)\n"),
- fileinfo->rfname, __FILE__, __LINE__);
- return 1;
- }
-
- /* We ignore ABS symbols from DSOs. */
- // XXX Is this correct?
- if (unlikely (shndx == SHN_ABS) && secttype == SHT_DYNSYM)
- continue;
-
- if ((shndx < SHN_LORESERVE || shndx > SHN_HIRESERVE)
- && fileinfo->scninfo[shndx].unused_comdat)
- /* The symbol is not used. */
- continue;
-
- /* If the DSO uses symbol versions determine whether this is
- the default version. Otherwise we'll ignore the symbol. */
- if (versymdata != NULL)
- {
- XElf_Versym versym;
-
- if (xelf_getversym_copy (versymdata, cnt, versym) == NULL)
- /* XXX Should we handle faulty input files more graceful? */
- assert (! "xelf_getversym failed");
-
- if ((versym & 0x8000) != 0)
- /* Ignore the symbol, it's not the default version. */
- continue;
- }
-
- /* See whether we know anything about this symbol. */
- struct symbol search;
- search.name = elf_strptr (fileinfo->elf, symstridx, sym->st_name);
- unsigned long int hval = elf_hash (search.name);
-
- /* We ignore the symbols the linker generates. This are
- _GLOBAL_OFFSET_TABLE_, _DYNAMIC. */
- // XXX This loop is hot and the following tests hardly ever match.
- // XXX Maybe move the tests somewhere they are executed less often.
- if (((unlikely (hval == 165832675ul)
- && strcmp (search.name, "_DYNAMIC") == 0)
- || (unlikely (hval == 102264335ul)
- && strcmp (search.name, "_GLOBAL_OFFSET_TABLE_") == 0))
- && sym->st_shndx != SHN_UNDEF
- /* If somebody defines such a variable in a relocatable we
- don't ignore it. Let the user get what s/he deserves. */
- && fileinfo->file_type != relocatable_file_type)
- continue;
-
- struct symbol *oldp = ld_symbol_tab_find (&ld_state.symbol_tab,
- hval, &search);
- struct symbol *newp;
- if (likely (oldp == NULL))
- {
- /* No symbol of this name known. Add it. */
- newp = (struct symbol *) obstack_alloc (&ld_state.smem,
- sizeof (*newp));
- newp->name = search.name;
- newp->size = sym->st_size;
- newp->type = XELF_ST_TYPE (sym->st_info);
- newp->symidx = cnt;
- newp->outsymidx = 0;
- newp->outdynsymidx = 0;
- newp->scndx = shndx;
- newp->file = fileinfo;
- newp->defined = newp->scndx != SHN_UNDEF;
- newp->common = newp->scndx == SHN_COMMON;
- newp->weak = XELF_ST_BIND (sym->st_info) == STB_WEAK;
- newp->added = 0;
- newp->merged = 0;
- newp->local = 0;
- newp->hidden = 0;
- newp->need_copy = 0;
- newp->on_dsolist = 0;
- newp->in_dso = secttype == SHT_DYNSYM;
- newp->next_in_scn = NULL;
-#ifndef NDEBUG
- newp->next = NULL;
- newp->previous = NULL;
-#endif
-
- if (newp->scndx == SHN_UNDEF)
- {
- CDBL_LIST_ADD_REAR (ld_state.unresolved, newp);
- ++ld_state.nunresolved;
- if (! newp->weak)
- ++ld_state.nunresolved_nonweak;
- }
- else if (newp->scndx == SHN_COMMON)
- {
- /* Store the alignment requirement. */
- newp->merge.value = sym->st_value;
-
- CDBL_LIST_ADD_REAR (ld_state.common_syms, newp);
- }
-
- /* Insert the new symbol. */
- if (unlikely (ld_symbol_tab_insert (&ld_state.symbol_tab,
- hval, newp) != 0))
- /* This cannot happen. */
- abort ();
-
- fileinfo->symref[cnt] = newp;
-
- /* We have a few special symbols to recognize. The symbols
- _init and _fini are the initialization and finalization
- functions respectively. They have to be made known in
- the dynamic section and therefore we have to find out
- now whether these functions exist or not. */
- if (hval == 6685956 && strcmp (newp->name, "_init") == 0)
- ld_state.init_symbol = newp;
- else if (hval == 6672457 && strcmp (newp->name, "_fini") == 0)
- ld_state.fini_symbol = newp;
- }
- else if (unlikely (check_definition (sym, shndx, cnt, fileinfo, oldp)
- != 0))
- /* A fatal error (multiple definition of a symbol)
- occurred, no need to continue. */
- return 1;
- else
- /* Use the previously allocated symbol record. It has
- been updated in check_definition(), if necessary. */
- newp = fileinfo->symref[cnt] = oldp;
-
- /* Mark the section the symbol we need comes from as used. */
- if (shndx != SHN_UNDEF
- && (shndx < SHN_LORESERVE || shndx > SHN_HIRESERVE))
- {
- struct scninfo *ignore;
-
-#ifndef NDEBUG
- size_t shnum;
- assert (elf_getshdrnum (fileinfo->elf, &shnum) == 0);
- assert (shndx < shnum);
-#endif
-
- /* Mark section (and all dependencies) as used. */
- mark_section_used (&fileinfo->scninfo[shndx], shndx, &ignore);
-
- /* Check whether the section is merge-able. In this case we
- have to record the symbol. */
- if (SCNINFO_SHDR (fileinfo->scninfo[shndx].shdr).sh_flags
- & SHF_MERGE)
- {
- if (fileinfo->scninfo[shndx].symbols == NULL)
- fileinfo->scninfo[shndx].symbols = newp->next_in_scn
- = newp;
- else
- {
- newp->next_in_scn
- = fileinfo->scninfo[shndx].symbols->next_in_scn;
- fileinfo->scninfo[shndx].symbols
- = fileinfo->scninfo[shndx].symbols->next_in_scn = newp;
- }
- }
- }
- }
-
- /* This file is used. */
- if (likely (fileinfo->file_type == relocatable_file_type))
- {
- if (unlikely (ld_state.relfiles == NULL))
- ld_state.relfiles = fileinfo->next = fileinfo;
- else
- {
- fileinfo->next = ld_state.relfiles->next;
- ld_state.relfiles = ld_state.relfiles->next = fileinfo;
- }
-
- /* Update some summary information in the state structure. */
- ld_state.nsymtab += fileinfo->nsymtab;
- ld_state.nlocalsymbols += fileinfo->nlocalsymbols;
- }
- else if (likely (fileinfo->file_type == dso_file_type))
- {
- CSNGL_LIST_ADD_REAR (ld_state.dsofiles, fileinfo);
- ++ld_state.ndsofiles;
-
- if (fileinfo->lazyload)
- /* We have to create another dynamic section entry for the
- DT_POSFLAG_1 entry.
-
- XXX Once more functionality than the lazyloading flag
- are suppported the test must be extended. */
- ++ld_state.ndsofiles;
- }
- }
-
- return 0;
-}
-
-
-int
-ld_handle_filename_list (struct filename_list *fnames)
-{
- struct filename_list *runp;
- int res = 0;
-
- for (runp = fnames; runp != NULL; runp = runp->next)
- {
- struct usedfiles *curp;
-
- /* Create a record for the new file. */
- curp = runp->real = ld_new_inputfile (runp->name, relocatable_file_type);
-
- /* Set flags for group handling. */
- curp->group_start = runp->group_start;
- curp->group_end = runp->group_end;
-
- /* Set as-needed flag from the file, not the command line. */
- curp->as_needed = runp->as_needed;
-
- /* Read the file and everything else which comes up, including
- handling groups. */
- do
- res |= FILE_PROCESS (-1, curp, &ld_state, &curp);
- while (curp != NULL);
- }
-
- /* Free the list. */
- while (fnames != NULL)
- {
- runp = fnames;
- fnames = fnames->next;
- free (runp);
- }
-
- return res;
-}
-
-
-/* Handle opening of the given file with ELF descriptor. */
-static int
-open_elf (struct usedfiles *fileinfo, Elf *elf)
-{
- int res = 0;
-
- if (elf == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot get descriptor for ELF file (%s:%d): %s\n"),
- __FILE__, __LINE__, elf_errmsg (-1));
-
- if (unlikely (elf_kind (elf) == ELF_K_NONE))
- {
- struct filename_list *fnames;
-
- /* We don't have to look at this file again. */
- fileinfo->status = closed;
-
- /* Let's see whether this is a linker script. */
- if (fileinfo->fd != -1)
- /* Create a stream from the file handle we know. */
- ldin = fdopen (fileinfo->fd, "r");
- else
- {
- /* Get the memory for the archive member. */
- char *content;
- size_t contentsize;
-
- /* Get the content of the file. */
- content = elf_rawfile (elf, &contentsize);
- if (content == NULL)
- {
- fprintf (stderr, gettext ("%s: invalid ELF file (%s:%d)\n"),
- fileinfo->rfname, __FILE__, __LINE__);
- return 1;
- }
-
- /* The content of the file is available in memory. Read the
- memory region as a stream. */
- ldin = fmemopen (content, contentsize, "r");
- }
-
- /* No need for locking. */
- __fsetlocking (ldin, FSETLOCKING_BYCALLER);
-
- if (ldin == NULL)
- error (EXIT_FAILURE, errno, gettext ("cannot open '%s'"),
- fileinfo->rfname);
-
- /* Parse the file. If it is a linker script no problems will be
- reported. */
- ld_state.srcfiles = NULL;
- ldlineno = 1;
- ld_scan_version_script = 0;
- ldin_fname = fileinfo->rfname;
- res = ldparse ();
-
- fclose (ldin);
- if (fileinfo->fd != -1 && !fileinfo->fd_passed)
- {
- /* We won't need the file descriptor again. */
- close (fileinfo->fd);
- fileinfo->fd = -1;
- }
-
- elf_end (elf);
-
- if (unlikely (res != 0))
- /* Something went wrong during parsing. */
- return 1;
-
- /* This is no ELF file. */
- fileinfo->elf = NULL;
-
- /* Now we have to handle eventual INPUT and GROUP statements in
- the script. Read the files mentioned. */
- fnames = ld_state.srcfiles;
- if (fnames != NULL)
- {
- struct filename_list *oldp;
-
- /* Convert the list into a normal single-linked list. */
- oldp = fnames;
- fnames = fnames->next;
- oldp->next = NULL;
-
- /* Remove the list from the state structure. */
- ld_state.srcfiles = NULL;
-
- if (unlikely (ld_handle_filename_list (fnames) != 0))
- return 1;
- }
-
- return 0;
- }
-
- /* Store the file info. */
- fileinfo->elf = elf;
-
- /* The file is ready for action. */
- fileinfo->status = opened;
-
- return 0;
-}
-
-
-static int
-add_whole_archive (struct usedfiles *fileinfo)
-{
- Elf *arelf;
- Elf_Cmd cmd = ELF_C_READ_MMAP_PRIVATE;
- int res = 0;
-
- while ((arelf = elf_begin (fileinfo->fd, cmd, fileinfo->elf)) != NULL)
- {
- Elf_Arhdr *arhdr = elf_getarhdr (arelf);
- struct usedfiles *newp;
-
- if (arhdr == NULL)
- abort ();
-
- /* Just to be sure; since these are no files in the archive
- these names should never be returned. */
- assert (strcmp (arhdr->ar_name, "/") != 0);
- assert (strcmp (arhdr->ar_name, "//") != 0);
-
- newp = ld_new_inputfile (arhdr->ar_name, relocatable_file_type);
- newp->archive_file = fileinfo;
-
- if (unlikely (ld_state.trace_files))
- print_file_name (stdout, newp, 1, 1);
-
- /* This shows that this file is contained in an archive. */
- newp->fd = -1;
- /* Store the ELF descriptor. */
- newp->elf = arelf;
- /* Show that we are open for business. */
- newp->status = opened;
-
- /* Proces the file, add all the symbols etc. */
- res = file_process2 (newp);
- if (unlikely (res != 0))
- break;
-
- /* Advance to the next archive element. */
- cmd = elf_next (arelf);
- }
-
- return res;
-}
-
-
-static int
-extract_from_archive (struct usedfiles *fileinfo)
-{
- static int archive_seq;
- int res = 0;
-
- if (fileinfo->archive_seq == 0)
- /* This is an archive we are not using completely. Give it a
- unique number. */
- fileinfo->archive_seq = ++archive_seq;
-
- /* If there are no unresolved symbols don't do anything. */
- assert (ld_state.extract_rule == defaultextract
- || ld_state.extract_rule == weakextract);
- if ((likely (ld_state.extract_rule == defaultextract)
- ? ld_state.nunresolved_nonweak : ld_state.nunresolved) == 0)
- return 0;
-
- Elf_Arsym *syms;
- size_t nsyms;
-
- /* Get all the symbols. */
- syms = elf_getarsym (fileinfo->elf, &nsyms);
- if (syms == NULL)
- {
- cannot_read_archive:
- error (0, 0, gettext ("cannot read archive `%s': %s"),
- fileinfo->rfname, elf_errmsg (-1));
-
- /* We cannot use this archive anymore. */
- fileinfo->status = closed;
-
- return 1;
- }
-
- /* Now add all the symbols to the hash table. Note that there
- can potentially be duplicate definitions. We'll always use
- the first definition. */
- // XXX Is this a compatible behavior?
- bool any_used;
- do
- {
- any_used = false;
-
- size_t cnt;
- for (cnt = 0; cnt < nsyms; ++cnt)
- {
- struct symbol search = { .name = syms[cnt].as_name };
- struct symbol *sym = ld_symbol_tab_find (&ld_state.symbol_tab,
- syms[cnt].as_hash, &search);
- if (sym != NULL && ! sym->defined)
- {
- /* The symbol is referenced and not defined. */
- Elf *arelf;
- Elf_Arhdr *arhdr;
- struct usedfiles *newp;
-
- /* Find the archive member for this symbol. */
- if (unlikely (elf_rand (fileinfo->elf, syms[cnt].as_off)
- != syms[cnt].as_off))
- goto cannot_read_archive;
-
- /* Note: no test of a failing 'elf_begin' call. That's fine
- since 'elf'getarhdr' will report the problem. */
- arelf = elf_begin (fileinfo->fd, ELF_C_READ_MMAP_PRIVATE,
- fileinfo->elf);
- arhdr = elf_getarhdr (arelf);
- if (arhdr == NULL)
- goto cannot_read_archive;
-
- /* We have all the information and an ELF handle for the
- archive member. Create the normal data structure for
- a file now. */
- newp = ld_new_inputfile (obstack_strdup (&ld_state.smem,
- arhdr->ar_name),
- relocatable_file_type);
- newp->archive_file = fileinfo;
-
- if (unlikely (ld_state.trace_files))
- print_file_name (stdout, newp, 1, 1);
-
- /* This shows that this file is contained in an archive. */
- newp->fd = -1;
- /* Store the ELF descriptor. */
- newp->elf = arelf;
- /* Show that we are open for business. */
- newp->status = in_archive;
-
- /* Now read the file and add all the symbols. */
- res = file_process2 (newp);
- if (unlikely (res != 0))
- return res;
-
- any_used = true;
- }
- }
-
- if (any_used)
- {
- /* This is an archive therefore it must have a number. */
- assert (fileinfo->archive_seq != 0);
- ld_state.last_archive_used = fileinfo->archive_seq;
- }
- }
- while (any_used);
-
- return res;
-}
-
-
-static int
-file_process2 (struct usedfiles *fileinfo)
-{
- int res;
-
- if (likely (elf_kind (fileinfo->elf) == ELF_K_ELF))
- {
- /* The first time we get here we read the ELF header. */
-#if NATIVE_ELF != 0
- if (likely (fileinfo->ehdr == NULL))
-#else
- if (likely (FILEINFO_EHDR (fileinfo->ehdr).e_type == ET_NONE))
-#endif
- {
- XElf_Ehdr *ehdr;
-#if NATIVE_ELF != 0
- ehdr = xelf_getehdr (fileinfo->elf, fileinfo->ehdr);
-#else
- xelf_getehdr_copy (fileinfo->elf, ehdr, fileinfo->ehdr);
-#endif
- if (ehdr == NULL)
- {
- fprintf (stderr, gettext ("%s: invalid ELF file (%s:%d)\n"),
- fileinfo->rfname, __FILE__, __LINE__);
- fileinfo->status = closed;
- return 1;
- }
-
- if (FILEINFO_EHDR (fileinfo->ehdr).e_type != ET_REL
- && unlikely (FILEINFO_EHDR (fileinfo->ehdr).e_type != ET_DYN))
- /* XXX Add ebl* function to query types which are allowed
- to link in. */
- {
- char buf[64];
-
- print_file_name (stderr, fileinfo, 1, 0);
- fprintf (stderr,
- gettext ("file of type %s cannot be linked in\n"),
- ebl_object_type_name (ld_state.ebl,
- FILEINFO_EHDR (fileinfo->ehdr).e_type,
- buf, sizeof (buf)));
- fileinfo->status = closed;
- return 1;
- }
-
- /* Make sure the file type matches the backend. */
- if (FILEINFO_EHDR (fileinfo->ehdr).e_machine
- != ebl_get_elfmachine (ld_state.ebl))
- {
- fprintf (stderr, gettext ("\
-%s: input file incompatible with ELF machine type %s\n"),
- fileinfo->rfname,
- ebl_backend_name (ld_state.ebl));
- fileinfo->status = closed;
- return 1;
- }
-
- /* Determine the section header string table section index. */
- if (unlikely (elf_getshdrstrndx (fileinfo->elf, &fileinfo->shstrndx)
- < 0))
- {
- fprintf (stderr, gettext ("\
-%s: cannot get section header string table index: %s\n"),
- fileinfo->rfname, elf_errmsg (-1));
- fileinfo->status = closed;
- return 1;
- }
- }
-
- /* Now handle the different types of files. */
- if (FILEINFO_EHDR (fileinfo->ehdr).e_type == ET_REL)
- {
- /* Add all the symbol. Relocatable files have symbol
- tables. */
- res = add_relocatable_file (fileinfo, SHT_SYMTAB);
- }
- else
- {
- bool has_l_name = fileinfo->file_type == archive_file_type;
-
- assert (FILEINFO_EHDR (fileinfo->ehdr).e_type == ET_DYN);
-
- /* If the file is a DT_NEEDED dependency then the type is
- already correctly specified. */
- if (fileinfo->file_type != dso_needed_file_type)
- fileinfo->file_type = dso_file_type;
-
- /* We cannot use DSOs when generating relocatable objects. */
- if (ld_state.file_type == relocatable_file_type)
- {
- error (0, 0, gettext ("\
-cannot use DSO '%s' when generating relocatable object file"),
- fileinfo->fname);
- return 1;
- }
-
- /* Add all the symbols. For DSOs we are looking at the
- dynamic symbol table. */
- res = add_relocatable_file (fileinfo, SHT_DYNSYM);
-
- /* We always have to have a dynamic section. */
- assert (fileinfo->dynscn != NULL);
-
- /* We have to remember the dependencies for this object. It
- is necessary to look them up. */
- XElf_Shdr_vardef (dynshdr);
- xelf_getshdr (fileinfo->dynscn, dynshdr);
-
- Elf_Data *dyndata = elf_getdata (fileinfo->dynscn, NULL);
- /* XXX Should we flag the failure to get the dynamic section? */
- if (dynshdr != NULL)
- {
- int cnt = dynshdr->sh_size / dynshdr->sh_entsize;
- XElf_Dyn_vardef (dyn);
-
- while (--cnt >= 0)
- {
- xelf_getdyn (dyndata, cnt, dyn);
- if (dyn != NULL)
- {
- if(dyn->d_tag == DT_NEEDED)
- {
- struct usedfiles *newp;
-
- newp = ld_new_inputfile (elf_strptr (fileinfo->elf,
- dynshdr->sh_link,
- dyn->d_un.d_val),
- dso_needed_file_type);
-
- /* Enqueue the newly found dependencies. */
- // XXX Check that there not already a file with the
- // same name.
- CSNGL_LIST_ADD_REAR (ld_state.needed, newp);
- }
- else if (dyn->d_tag == DT_SONAME)
- {
- /* We use the DT_SONAME (this is what's there
- for). */
- fileinfo->soname = elf_strptr (fileinfo->elf,
- dynshdr->sh_link,
- dyn->d_un.d_val);
- has_l_name = false;
- }
- }
- }
- }
-
- /* Construct the file name if the DSO has no SONAME and the
- file name comes from a -lXX parameter on the comment
- line. */
- if (unlikely (has_l_name))
- {
- /* The FNAME is the parameter the user specified on the
- command line. We prepend "lib" and append ".so". */
- size_t len = strlen (fileinfo->fname) + 7;
- char *newp;
-
- newp = (char *) obstack_alloc (&ld_state.smem, len);
- strcpy (stpcpy (stpcpy (newp, "lib"), fileinfo->fname), ".so");
-
- fileinfo->soname = newp;
- }
- }
- }
- else if (likely (elf_kind (fileinfo->elf) == ELF_K_AR))
- {
- if (unlikely (ld_state.extract_rule == allextract))
- /* Which this option enabled we have to add all the object
- files in the archive. */
- res = add_whole_archive (fileinfo);
- else if (ld_state.file_type == relocatable_file_type)
- {
- /* When generating a relocatable object we don't find files
- in archives. */
- if (verbose)
- error (0, 0, gettext ("input file '%s' ignored"), fileinfo->fname);
-
- res = 0;
- }
- else
- {
- if (ld_state.group_start_requested
- && ld_state.group_start_archive == NULL)
- ld_state.group_start_archive = fileinfo;
-
- if (ld_state.archives == NULL)
- ld_state.archives = fileinfo;
-
- if (ld_state.tailarchives != NULL)
- ld_state.tailarchives->next = fileinfo;
- ld_state.tailarchives = fileinfo;
-
- /* Extract only the members from the archive which are
- currently referenced by unresolved symbols. */
- res = extract_from_archive (fileinfo);
- }
- }
- else
- /* This should never happen, we know about no other types. */
- abort ();
-
- return res;
-}
-
-
-/* Process a given file. The first parameter is a file descriptor for
- the file which can be -1 to indicate the file has not yet been
- found. The second parameter describes the file to be opened, the
- last one is the state of the linker which among other information
- contain the paths we look at. */
-static int
-ld_generic_file_process (int fd, struct usedfiles *fileinfo,
- struct ld_state *statep, struct usedfiles **nextp)
-{
- int res = 0;
-
- /* By default we go to the next file in the list. */
- *nextp = fileinfo->next;
-
- /* Set the flag to signal we are looking for a group start. */
- if (unlikely (fileinfo->group_start))
- {
- ld_state.group_start_requested = true;
- fileinfo->group_start = false;
- }
-
- /* If the file isn't open yet, open it now. */
- if (likely (fileinfo->status == not_opened))
- {
- bool fd_passed = true;
-
- if (likely (fd == -1))
- {
- /* Find the file ourselves. */
- int err = open_along_path (fileinfo);
- if (unlikely (err != 0))
- /* We allow libraries and DSOs to be named more than once.
- Don't report an error to the caller. */
- return err == EAGAIN ? 0 : err;
-
- fd_passed = false;
- }
- else
- fileinfo->fd = fd;
-
- /* Remember where we got the descriptor from. */
- fileinfo->fd_passed = fd_passed;
-
- /* We found the file. Now test whether it is a file type we can
- handle.
-
- XXX Do we need to have the ability to start from a given
- position in the search path again to look for another file if
- the one found has not the right type? */
- res = open_elf (fileinfo, elf_begin (fileinfo->fd,
- is_dso_p (fileinfo->fd)
- ? ELF_C_READ_MMAP
- : ELF_C_READ_MMAP_PRIVATE, NULL));
- if (unlikely (res != 0))
- return res;
- }
-
- /* Now that we have opened the file start processing it. */
- if (likely (fileinfo->status != closed))
- res = file_process2 (fileinfo);
-
- /* Determine which file to look at next. */
- if (unlikely (fileinfo->group_backref != NULL))
- {
- /* We only go back if an archive other than the one we would go
- back to has been used in the last round. */
- if (ld_state.last_archive_used > fileinfo->group_backref->archive_seq)
- {
- *nextp = fileinfo->group_backref;
- ld_state.last_archive_used = 0;
- }
- else
- {
- /* If we come here this means that the archives we read so
- far are not needed anymore. We can free some of the data
- now. */
- struct usedfiles *runp = ld_state.archives;
-
- do
- {
- /* We don't need the ELF descriptor anymore. Unless there
- are no files from the archive used this will not free
- the whole file but only some data structures. */
- elf_end (runp->elf);
- runp->elf = NULL;
-
- runp = runp->next;
- }
- while (runp != fileinfo->next);
-
- /* Do not do this again. */
- ld_state.archives = NULL;
-
- /* Do not move on to the next archive. */
- *nextp = fileinfo->next = NULL;
- }
- }
- else if (unlikely (fileinfo->group_end))
- {
- /* This is the end of a group. We possibly have to go back.
- Determine which file we would go back to and see whether it
- makes sense. If there has not been an archive we don't have
- to do anything. */
- if (ld_state.group_start_requested)
- {
- if (ld_state.group_start_archive != ld_state.tailarchives)
- /* The loop includes more than one archive, add the pointer. */
- {
- *nextp = ld_state.tailarchives->group_backref =
- ld_state.group_start_archive;
- ld_state.last_archive_used = 0;
- }
- else
- /* We might still have to go back to the beginning of the
- group if since the last archive other files have been
- added. But we go back exactly once. */
- if (ld_state.tailarchives != fileinfo)
- {
- *nextp = ld_state.group_start_archive;
- ld_state.last_archive_used = 0;
- }
- }
-
- /* Clear the flags. */
- ld_state.group_start_requested = false;
- ld_state.group_start_archive = NULL;
- fileinfo->group_end = false;
- }
-
- return res;
-}
-
-
-/* Library names passed to the linker as -lXX represent files named
- libXX.YY. The YY part can have different forms, depending on the
- platform. The generic set is .so and .a (in this order). */
-static const char **
-ld_generic_lib_extensions (struct ld_state *statep __attribute__ ((__unused__)))
-{
- static const char *exts[] =
- {
- ".so", ".a", NULL
- };
-
- return exts;
-}
-
-
-/* Flag unresolved symbols. */
-static int
-ld_generic_flag_unresolved (struct ld_state *statep)
-{
- int retval = 0;
-
- if (ld_state.nunresolved_nonweak > 0)
- {
- /* Go through the list and determine the unresolved symbols. */
- struct symbol *first;
- struct symbol *s;
-
- s = first = ld_state.unresolved->next;
- do
- {
- if (! s->defined && ! s->weak)
- {
- /* Two special symbol we recognize: the symbol for the
- GOT and the dynamic section. */
- if (strcmp (s->name, "_GLOBAL_OFFSET_TABLE_") == 0
- || strcmp (s->name, "_DYNAMIC") == 0)
- {
- /* We will have to fill in more information later. */
- ld_state.need_got = true;
-
- /* Remember that we found it. */
- if (s->name[1] == 'G')
- ld_state.got_symbol = s;
- else
- ld_state.dyn_symbol = s;
- }
- else if (ld_state.file_type != dso_file_type || !ld_state.nodefs)
- {
- /* XXX The error message should get better. It should use
- the debugging information if present to tell where in the
- sources the undefined reference is. */
- error (0, 0, gettext ("undefined symbol `%s' in %s"),
- s->name, s->file->fname);
-
- retval = 1;
- }
- }
-
- /* We cannot decide here what to do with undefined
- references which will come from DSO since we do not know
- what kind of symbol we expect. Only when looking at the
- relocations we can see whether we need a PLT entry or
- only a GOT entry. */
-
- s = s->next;
- }
- while (s != first);
- }
-
- return retval;
-}
-
-
-/* Close the given file. */
-static int
-ld_generic_file_close (struct usedfiles *fileinfo, struct ld_state *statep)
-{
- /* Close the ELF descriptor. */
- elf_end (fileinfo->elf);
-
- /* If we have opened the file descriptor close it. But we might
- have done this already in which case FD is -1. */
- if (!fileinfo->fd_passed && fileinfo->fd != -1)
- close (fileinfo->fd);
-
- /* We allocated the resolved file name. */
- if (fileinfo->fname != fileinfo->rfname)
- free ((char *) fileinfo->rfname);
-
- return 0;
-}
-
-
-static void
-new_generated_scn (enum scn_kind kind, const char *name, int type, int flags,
- int entsize, int align)
-{
- struct scnhead *newp;
-
- newp = (struct scnhead *) obstack_calloc (&ld_state.smem,
- sizeof (struct scnhead));
- newp->kind = kind;
- newp->name = name;
- newp->nameent = ebl_strtabadd (ld_state.shstrtab, name, 0);
- newp->type = type;
- newp->flags = flags;
- newp->entsize = entsize;
- newp->align = align;
- newp->grp_signature = NULL;
- newp->used = true;
-
- /* All is well. Create now the data for the section and insert it
- into the section table. */
- ld_section_tab_insert (&ld_state.section_tab, elf_hash (name), newp);
-}
-
-
-/* Create the sections which are generated by the linker and are not
- present in the input file. */
-static void
-ld_generic_generate_sections (struct ld_state *statep)
-{
- /* The relocation section type. */
- int rel_type = REL_TYPE (&ld_state) == DT_REL ? SHT_REL : SHT_RELA;
-
- /* When requested, every output file will have a build ID section. */
- if (statep->build_id != NULL)
- new_generated_scn (scn_dot_note_gnu_build_id, ".note.gnu.build-id",
- SHT_NOTE, SHF_ALLOC, 0, 4);
-
- /* When building dynamically linked object we have to include a
- section containing a string describing the interpreter. This
- should be at the very beginning of the file together with the
- other information the ELF loader (kernel or wherever) has to look
- at. We put it as the first section in the file.
-
- We also have to create the dynamic segment which is a special
- section the dynamic linker locates through an entry in the
- program header. */
- if (dynamically_linked_p ())
- {
- /* Use any versioning (defined or required)? */
- bool use_versioning = false;
- /* Use version requirements? */
- bool need_version = false;
-
- /* First the .interp section. */
- if (ld_state.interp != NULL || ld_state.file_type != dso_file_type)
- new_generated_scn (scn_dot_interp, ".interp", SHT_PROGBITS, SHF_ALLOC,
- 0, 1);
-
- /* Now the .dynamic section. */
- new_generated_scn (scn_dot_dynamic, ".dynamic", SHT_DYNAMIC,
- DYNAMIC_SECTION_FLAGS (&ld_state),
- xelf_fsize (ld_state.outelf, ELF_T_DYN, 1),
- xelf_fsize (ld_state.outelf, ELF_T_ADDR, 1));
-
- /* We will need in any case the dynamic symbol table (even in
- the unlikely case that no symbol is exported or referenced
- from a DSO). */
- ld_state.need_dynsym = true;
- new_generated_scn (scn_dot_dynsym, ".dynsym", SHT_DYNSYM, SHF_ALLOC,
- xelf_fsize (ld_state.outelf, ELF_T_SYM, 1),
- xelf_fsize (ld_state.outelf, ELF_T_ADDR, 1));
- /* It comes with a string table. */
- new_generated_scn (scn_dot_dynstr, ".dynstr", SHT_STRTAB, SHF_ALLOC,
- 0, 1);
- /* And a hashing table. */
- // XXX For Linux/Alpha we need other sizes unless they change...
- if (GENERATE_SYSV_HASH)
- new_generated_scn (scn_dot_hash, ".hash", SHT_HASH, SHF_ALLOC,
- sizeof (Elf32_Word), sizeof (Elf32_Word));
- if (GENERATE_GNU_HASH)
- new_generated_scn (scn_dot_gnu_hash, ".gnu.hash", SHT_GNU_HASH,
- SHF_ALLOC, sizeof (Elf32_Word),
- sizeof (Elf32_Word));
-
- /* Create the section associated with the PLT if necessary. */
- if (ld_state.nplt > 0)
- {
- /* Create the .plt section. */
- /* XXX We might need a function which returns the section flags. */
- new_generated_scn (scn_dot_plt, ".plt", SHT_PROGBITS,
- SHF_ALLOC | SHF_EXECINSTR,
- /* XXX Is the size correct? */
- xelf_fsize (ld_state.outelf, ELF_T_ADDR, 1),
- xelf_fsize (ld_state.outelf, ELF_T_ADDR, 1));
-
- /* Create the relocation section for the .plt. This is always
- separate even if the other relocation sections are combined. */
- new_generated_scn (scn_dot_pltrel, ".rel.plt", rel_type, SHF_ALLOC,
- rel_type == SHT_REL
- ? xelf_fsize (ld_state.outelf, ELF_T_REL, 1)
- : xelf_fsize (ld_state.outelf, ELF_T_RELA, 1),
- xelf_fsize (ld_state.outelf, ELF_T_ADDR, 1));
-
- /* XXX We might need a function which returns the section flags. */
- new_generated_scn (scn_dot_gotplt, ".got.plt", SHT_PROGBITS,
- SHF_ALLOC | SHF_WRITE,
- xelf_fsize (ld_state.outelf, ELF_T_ADDR, 1),
- xelf_fsize (ld_state.outelf, ELF_T_ADDR, 1));
-
- /* Mark all used DSOs as used. Determine whether any referenced
- object uses symbol versioning. */
- if (ld_state.from_dso != NULL)
- {
- struct symbol *srunp = ld_state.from_dso;
-
- do
- {
- srunp->file->used = true;
-
- if (srunp->file->verdefdata != NULL)
- {
- XElf_Versym versym;
-
- /* The input DSO uses versioning. */
- use_versioning = true;
- /* We reference versions. */
- need_version = true;
-
- if (xelf_getversym_copy (srunp->file->versymdata,
- srunp->symidx, versym) == NULL)
- assert (! "xelf_getversym failed");
-
- /* We cannot link explicitly with an older
- version of a symbol. */
- assert ((versym & 0x8000) == 0);
- /* We cannot reference local (index 0) or plain
- global (index 1) versions. */
- assert (versym > 1);
-
- /* Check whether we have already seen the
- version and if not add it to the referenced
- versions in the output file. */
- if (! srunp->file->verdefused[versym])
- {
- srunp->file->verdefused[versym] = 1;
-
- if (++srunp->file->nverdefused == 1)
- /* Count the file if it is using versioning. */
- ++ld_state.nverdeffile;
- ++ld_state.nverdefused;
- }
- }
- }
- while ((srunp = srunp->next) != ld_state.from_dso);
- }
-
- /* Create the sections used to record version dependencies. */
- if (need_version)
- new_generated_scn (scn_dot_version_r, ".gnu.version_r",
- SHT_GNU_verneed, SHF_ALLOC, 0,
- xelf_fsize (ld_state.outelf, ELF_T_WORD, 1));
- }
-
- /* Now count the used DSOs since this is what the user
- wants. */
- int ndt_needed = 0;
- if (ld_state.ndsofiles > 0)
- {
- struct usedfiles *frunp = ld_state.dsofiles;
-
- do
- if (! frunp->as_needed || frunp->used)
- {
- ++ndt_needed;
- if (frunp->lazyload)
- /* We have to create another dynamic section
- entry for the DT_POSFLAG_1 entry.
-
- XXX Once more functionality than the lazyloading
- flag are suppported the test must be
- extended. */
- ++ndt_needed;
- }
- while ((frunp = frunp->next) != ld_state.dsofiles);
- }
-
- if (use_versioning)
- new_generated_scn (scn_dot_version, ".gnu.version", SHT_GNU_versym,
- SHF_ALLOC,
- xelf_fsize (ld_state.outelf, ELF_T_HALF, 1),
- xelf_fsize (ld_state.outelf, ELF_T_HALF, 1));
-
- /* We need some entries all the time. */
- ld_state.ndynamic = (7 + (ld_state.runpath != NULL
- || ld_state.rpath != NULL)
- + ndt_needed
- + (ld_state.init_symbol != NULL ? 1 : 0)
- + (ld_state.fini_symbol != NULL ? 1 : 0)
- + (use_versioning ? 1 : 0)
- + (need_version ? 2 : 0)
- + (ld_state.nplt > 0 ? 4 : 0)
- + (ld_state.relsize_total > 0 ? 3 : 0));
- }
-
- /* When creating a relocatable file or when we are not stripping the
- output file we create a symbol table. */
- ld_state.need_symtab = (ld_state.file_type == relocatable_file_type
- || ld_state.strip == strip_none);
-
- /* Add the .got section if needed. */
- if (ld_state.need_got)
- /* XXX We might need a function which returns the section flags. */
- new_generated_scn (scn_dot_got, ".got", SHT_PROGBITS,
- SHF_ALLOC | SHF_WRITE,
- xelf_fsize (ld_state.outelf, ELF_T_ADDR, 1),
- xelf_fsize (ld_state.outelf, ELF_T_ADDR, 1));
-
- /* Add the .rel.dyn section. */
- if (ld_state.relsize_total > 0)
- new_generated_scn (scn_dot_dynrel, ".rel.dyn", rel_type, SHF_ALLOC,
- rel_type == SHT_REL
- ? xelf_fsize (ld_state.outelf, ELF_T_REL, 1)
- : xelf_fsize (ld_state.outelf, ELF_T_RELA, 1),
- xelf_fsize (ld_state.outelf, ELF_T_ADDR, 1));
-}
-
-
-/* Callback function registered with on_exit to make sure the temporary
- files gets removed if something goes wrong. */
-static void
-remove_tempfile (int status, void *arg)
-{
- if (status != 0 && ld_state.tempfname != NULL)
- unlink (ld_state.tempfname);
-}
-
-
-/* Create the output file. The file name is given or "a.out". We
- create as much of the ELF structure as possible. */
-static int
-ld_generic_open_outfile (struct ld_state *statep, int machine, int klass,
- int data)
-{
- /* We do not create the new file right away with the final name.
- This would destroy an existing file with this name before a
- replacement is finalized. We create instead a temporary file in
- the same directory. */
- if (ld_state.outfname == NULL)
- ld_state.outfname = "a.out";
-
- size_t outfname_len = strlen (ld_state.outfname);
- char *tempfname = (char *) obstack_alloc (&ld_state.smem,
- outfname_len + sizeof (".XXXXXX"));
- ld_state.tempfname = tempfname;
-
- int fd;
- int try = 0;
- while (1)
- {
- strcpy (mempcpy (tempfname, ld_state.outfname, outfname_len), ".XXXXXX");
-
- /* The use of mktemp() here is fine. We do not want to use
- mkstemp() since then the umask isn't used. And the output
- file will have these permissions anyhow. Any intruder could
- change the file later if it would be possible now. */
- if (mktemp (tempfname) != NULL
- && (fd = open (tempfname, O_RDWR | O_EXCL | O_CREAT | O_NOFOLLOW,
- ld_state.file_type == relocatable_file_type
- ? DEFFILEMODE : ACCESSPERMS)) != -1)
- break;
-
- /* Failed this round. We keep trying a number of times. */
- if (++try >= 10)
- error (EXIT_FAILURE, errno, gettext ("cannot create output file"));
- }
- ld_state.outfd = fd;
-
- /* Make sure we remove the temporary file in case something goes
- wrong. */
- on_exit (remove_tempfile, NULL);
-
- /* Create the ELF file data for the output file. */
- Elf *elf = ld_state.outelf = elf_begin (fd,
- conserve_memory
- ? ELF_C_WRITE : ELF_C_WRITE_MMAP,
- NULL);
- if (elf == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot create ELF descriptor for output file: %s"),
- elf_errmsg (-1));
-
- /* Create the basic data structures. */
- if (! xelf_newehdr (elf, klass))
- /* Couldn't create the ELF header. Very bad. */
- error (EXIT_FAILURE, 0,
- gettext ("could not create ELF header for output file: %s"),
- elf_errmsg (-1));
-
- /* And get the current header so that we can modify it. */
- XElf_Ehdr_vardef (ehdr);
- xelf_getehdr (elf, ehdr);
- assert (ehdr != NULL);
-
- /* Set the machine type. */
- ehdr->e_machine = machine;
-
- /* Modify it according to the info we have here and now. */
- if (ld_state.file_type == executable_file_type)
- ehdr->e_type = ET_EXEC;
- else if (ld_state.file_type == dso_file_type)
- ehdr->e_type = ET_DYN;
- else
- {
- assert (ld_state.file_type == relocatable_file_type);
- ehdr->e_type = ET_REL;
- }
-
- /* Set the ELF version. */
- ehdr->e_version = EV_CURRENT;
-
- /* Set the endianness. */
- ehdr->e_ident[EI_DATA] = data;
-
- /* Write the ELF header information back. */
- (void) xelf_update_ehdr (elf, ehdr);
-
- return 0;
-}
-
-
-/* We compute the offsets of the various copied objects and the total
- size of the memory needed. */
-// XXX The method used here is simple: go from front to back and pack
-// the objects in this order. A more space efficient way would
-// actually trying to pack the objects as dense as possible. But this
-// is more expensive.
-static void
-compute_copy_reloc_offset (XElf_Shdr *shdr)
-{
- struct symbol *runp = ld_state.from_dso;
- assert (runp != NULL);
-
- XElf_Off maxalign = 1;
- XElf_Off offset = 0;
-
- do
- if (runp->need_copy)
- {
- /* Determine alignment for the symbol. */
- // XXX The question is how? The symbol record itself does not
- // have the information. So we have to be conservative and
- // assume the alignment of the section the symbol is in.
-
- // XXX We can be more precise. Use the offset from the beginning
- // of the section and determine the largest power of two with
- // module zero.
- XElf_Off symalign = MAX (SCNINFO_SHDR (runp->file->scninfo[runp->scndx].shdr).sh_addralign, 1);
- /* Keep track of the maximum alignment requirement. */
- maxalign = MAX (maxalign, symalign);
-
- /* Align current position. */
- offset = (offset + symalign - 1) & ~(symalign - 1);
-
- runp->merge.value = offset;
-
- offset += runp->size;
- }
- while ((runp = runp->next) != ld_state.from_dso);
-
- shdr->sh_type = SHT_NOBITS;
- shdr->sh_size = offset;
- shdr->sh_addralign = maxalign;
-}
-
-
-static void
-compute_common_symbol_offset (XElf_Shdr *shdr)
-{
- struct symbol *runp = ld_state.common_syms;
- assert (runp != NULL);
-
- XElf_Off maxalign = 1;
- XElf_Off offset = 0;
-
- do
- {
- /* Determine alignment for the symbol. */
- XElf_Off symalign = runp->merge.value;
-
- /* Keep track of the maximum alignment requirement. */
- maxalign = MAX (maxalign, symalign);
-
- /* Align current position. */
- offset = (offset + symalign - 1) & ~(symalign - 1);
-
- runp->merge.value = offset;
-
- offset += runp->size;
- }
- while ((runp = runp->next) != ld_state.common_syms);
-
- shdr->sh_type = SHT_NOBITS;
- shdr->sh_size = offset;
- shdr->sh_addralign = maxalign;
-}
-
-
-static void
-sort_sections_generic (void)
-{
- /* XXX TBI */
- abort ();
-}
-
-
-static int
-match_section (const char *osectname, struct filemask_section_name *sectmask,
- struct scnhead **scnhead, bool new_section, size_t segment_nr)
-{
- struct scninfo *prevp;
- struct scninfo *runp;
- struct scninfo *notused;
-
- if (fnmatch (sectmask->section_name->name, (*scnhead)->name, 0) != 0)
- /* The section name does not match. */
- return new_section;
-
- /* If this is a section generated by the linker it doesn't contain
- the regular information (i.e., input section data etc) and must
- be handle special. */
- if ((*scnhead)->kind != scn_normal)
- {
- (*scnhead)->name = osectname;
- (*scnhead)->segment_nr = segment_nr;
-
- /* We have to count note section since they get their own
- program header entry. */
- if ((*scnhead)->type == SHT_NOTE)
- ++ld_state.nnotesections;
-
- ld_state.allsections[ld_state.nallsections++] = (*scnhead);
- return true;
- }
-
- /* Now we have to match the file names of the input files. Some of
- the sections here might not match. */
- runp = (*scnhead)->last->next;
- prevp = (*scnhead)->last;
- notused = NULL;
-
- do
- {
- /* Base of the file name the section comes from. */
- const char *brfname = basename (runp->fileinfo->rfname);
-
- /* If the section isn't used, the name doesn't match the positive
- inclusion list, or the name does match the negative inclusion
- list, ignore the section. */
- if (!runp->used
- || (sectmask->filemask != NULL
- && fnmatch (sectmask->filemask, brfname, 0) != 0)
- || (sectmask->excludemask != NULL
- && fnmatch (sectmask->excludemask, brfname, 0) == 0))
- {
- /* This file does not match the file name masks. */
- if (notused == NULL)
- notused = runp;
-
- prevp = runp;
- runp = runp->next;
- if (runp == notused)
- runp = NULL;
- }
- /* The section fulfills all requirements, add it to the output
- file with the correct section name etc. */
- else
- {
- struct scninfo *found = runp;
-
- /* Remove this input section data buffer from the list. */
- if (prevp != runp)
- runp = prevp->next = runp->next;
- else
- {
- free (*scnhead);
- *scnhead = NULL;
- runp = NULL;
- }
-
- /* Create a new section for the output file if the 'new_section'
- flag says so. Otherwise append the buffer to the last
- section which we created in one of the last calls. */
- if (new_section)
- {
- struct scnhead *newp;
-
- newp = (struct scnhead *) obstack_calloc (&ld_state.smem,
- sizeof (*newp));
- newp->kind = scn_normal;
- newp->name = osectname;
- newp->type = SCNINFO_SHDR (found->shdr).sh_type;
- /* Executable or DSO do not have section groups. Drop that
- information. */
- newp->flags = SCNINFO_SHDR (found->shdr).sh_flags & ~SHF_GROUP;
- newp->segment_nr = segment_nr;
- newp->last = found->next = found;
- newp->used = true;
- newp->relsize = found->relsize;
- newp->entsize = SCNINFO_SHDR (found->shdr).sh_entsize;
-
- /* We have to count note section since they get their own
- program header entry. */
- if (newp->type == SHT_NOTE)
- ++ld_state.nnotesections;
-
- ld_state.allsections[ld_state.nallsections++] = newp;
- new_section = false;
- }
- else
- {
- struct scnhead *queued;
-
- queued = ld_state.allsections[ld_state.nallsections - 1];
-
- found->next = queued->last->next;
- queued->last = queued->last->next = found;
-
- /* If the linker script forces us to add incompatible
- sections together do so. But reflect this in the
- type and flags of the resulting file. */
- if (queued->type != SCNINFO_SHDR (found->shdr).sh_type)
- /* XXX Any better choice? */
- queued->type = SHT_PROGBITS;
- if (queued->flags != SCNINFO_SHDR (found->shdr).sh_flags)
- /* Executable or DSO do not have section groups. Drop that
- information. */
- queued->flags = ebl_sh_flags_combine (ld_state.ebl,
- queued->flags,
- SCNINFO_SHDR (found->shdr).sh_flags
- & ~SHF_GROUP);
-
- /* Accumulate the relocation section size. */
- queued->relsize += found->relsize;
- }
- }
- }
- while (runp != NULL);
-
- return new_section;
-}
-
-
-static void
-sort_sections_lscript (void)
-{
- struct scnhead *temp[ld_state.nallsections];
-
- /* Make a copy of the section head pointer array. */
- memcpy (temp, ld_state.allsections,
- ld_state.nallsections * sizeof (temp[0]));
- size_t nallsections = ld_state.nallsections;
-
- /* Convert the output segment list in a single-linked list. */
- struct output_segment *segment = ld_state.output_segments->next;
- ld_state.output_segments->next = NULL;
- ld_state.output_segments = segment;
-
- /* Put the sections in the correct order in the array in the state
- structure. This might involve merging of sections and also
- renaming the containing section in the output file. */
- ld_state.nallsections = 0;
- size_t segment_nr;
- size_t last_writable = ~0ul;
- for (segment_nr = 0; segment != NULL; segment = segment->next, ++segment_nr)
- {
- struct output_rule *orule;
-
- for (orule = segment->output_rules; orule != NULL; orule = orule->next)
- if (orule->tag == output_section)
- {
- struct input_rule *irule;
- bool new_section = true;
-
- for (irule = orule->val.section.input; irule != NULL;
- irule = irule->next)
- if (irule->tag == input_section)
- {
- size_t cnt;
-
- for (cnt = 0; cnt < nallsections; ++cnt)
- if (temp[cnt] != NULL)
- new_section =
- match_section (orule->val.section.name,
- irule->val.section, &temp[cnt],
- new_section, segment_nr);
- }
- }
-
- if ((segment->mode & PF_W) != 0)
- last_writable = ld_state.nallsections - 1;
- }
-
- /* In case we have to create copy relocations or we have common
- symbols, find the last writable segment and add one more data
- block. It will be a NOBITS block and take up no disk space.
- This is why it is important to get the last block. */
- if (ld_state.ncopy > 0 || ld_state.common_syms != NULL)
- {
- if (last_writable == ~0ul)
- error (EXIT_FAILURE, 0, "no writable segment");
-
- if (ld_state.allsections[last_writable]->type != SHT_NOBITS)
- {
- /* Make room in the ALLSECTIONS array for a new section.
- There is guaranteed room in the array. We add the new
- entry after the last writable section. */
- ++last_writable;
- memmove (&ld_state.allsections[last_writable + 1],
- &ld_state.allsections[last_writable],
- (ld_state.nallsections - last_writable)
- * sizeof (ld_state.allsections[0]));
-
- ld_state.allsections[last_writable] = (struct scnhead *)
- obstack_calloc (&ld_state.smem, sizeof (struct scnhead));
-
- /* Name for the new section. */
- ld_state.allsections[last_writable]->name = ".bss";
- /* Type: NOBITS. */
- ld_state.allsections[last_writable]->type = SHT_NOBITS;
- /* Same segment as the last writable section. */
- ld_state.allsections[last_writable]->segment_nr
- = ld_state.allsections[last_writable - 1]->segment_nr;
- }
- }
-
- /* Create common symbol data block. */
- if (ld_state.ncopy > 0)
- {
-#if NATIVE_ELF
- struct scninfo *si = (struct scninfo *)
- obstack_calloc (&ld_state.smem, sizeof (*si) + sizeof (XElf_Shdr));
- si->shdr = (XElf_Shdr *) (si + 1);
-#else
- struct scninfo *si = (struct scninfo *) obstack_calloc (&ld_state.smem,
- sizeof (*si));
-#endif
-
- /* Get the information regarding the symbols with copy relocations. */
- compute_copy_reloc_offset (&SCNINFO_SHDR (si->shdr));
-
- /* This section is needed. */
- si->used = true;
- /* Remember for later the section data structure. */
- ld_state.copy_section = si;
-
- if (likely (ld_state.allsections[last_writable]->last != NULL))
- {
- si->next = ld_state.allsections[last_writable]->last->next;
- ld_state.allsections[last_writable]->last->next = si;
- ld_state.allsections[last_writable]->last = si;
- }
- else
- ld_state.allsections[last_writable]->last = si->next = si;
- }
-
- /* Create common symbol data block. */
- if (ld_state.common_syms != NULL)
- {
-#if NATIVE_ELF
- struct scninfo *si = (struct scninfo *)
- obstack_calloc (&ld_state.smem, sizeof (*si) + sizeof (XElf_Shdr));
- si->shdr = (XElf_Shdr *) (si + 1);
-#else
- struct scninfo *si = (struct scninfo *) obstack_calloc (&ld_state.smem,
- sizeof (*si));
-#endif
-
- /* Get the information regarding the symbols with copy relocations. */
- compute_common_symbol_offset (&SCNINFO_SHDR (si->shdr));
-
- /* This section is needed. */
- si->used = true;
- /* Remember for later the section data structure. */
- ld_state.common_section = si;
-
- if (likely (ld_state.allsections[last_writable]->last != NULL))
- {
- si->next = ld_state.allsections[last_writable]->last->next;
- ld_state.allsections[last_writable]->last->next = si;
- ld_state.allsections[last_writable]->last = si;
- }
- else
- ld_state.allsections[last_writable]->last = si->next = si;
- }
-}
-
-
-/* Create the output sections now. This requires knowledge about all
- the sections we will need. It may be necessary to sort sections in
- the order they are supposed to appear in the executable. The
- sorting use many different kinds of information to optimize the
- resulting binary. Important is to respect segment boundaries and
- the needed alignment. The mode of the segments will be determined
- afterwards automatically by the output routines.
-
- The generic sorting routines work in one of two possible ways:
-
- - if a linker script specifies the sections to be used in the
- output and assigns them to a segment this information is used;
-
- - otherwise the linker will order the sections based on permissions
- and some special knowledge about section names.*/
-static void
-ld_generic_create_sections (struct ld_state *statep)
-{
- struct scngroup *groups;
- size_t cnt;
-
- /* For relocatable object we don't have to bother sorting the
- sections and we do want to preserve the relocation sections as
- they appear in the input files. */
- if (ld_state.file_type != relocatable_file_type)
- {
- /* Collect all the relocation sections. They are handled
- separately. */
- struct scninfo *list = NULL;
- for (cnt = 0; cnt < ld_state.nallsections; ++cnt)
- if ((ld_state.allsections[cnt]->type == SHT_REL
- || ld_state.allsections[cnt]->type == SHT_RELA)
- /* The generated relocation sections are not of any
- interest here. */
- && ld_state.allsections[cnt]->last != NULL)
- {
- if (list == NULL)
- list = ld_state.allsections[cnt]->last;
- else
- {
- /* Merge the sections list. */
- struct scninfo *first = list->next;
- list->next = ld_state.allsections[cnt]->last->next;
- ld_state.allsections[cnt]->last->next = first;
- list = ld_state.allsections[cnt]->last;
- }
-
- /* Remove the entry from the section list. */
- ld_state.allsections[cnt] = NULL;
- }
- ld_state.rellist = list;
-
- if (ld_state.output_segments == NULL)
- /* Sort using builtin rules. */
- sort_sections_generic ();
- else
- sort_sections_lscript ();
- }
-
- /* Now iterate over the input sections and create the sections in the
- order they are required in the output file. */
- for (cnt = 0; cnt < ld_state.nallsections; ++cnt)
- {
- struct scnhead *head = ld_state.allsections[cnt];
- Elf_Scn *scn;
- XElf_Shdr_vardef (shdr);
-
- /* Don't handle unused sections. */
- if (!head->used)
- continue;
-
- /* We first have to create the section group if necessary.
- Section group sections must come (in section index order)
- before any of the section contained. This all is necessary
- only for relocatable object as other object types are not
- allowed to contain section groups. */
- if (ld_state.file_type == relocatable_file_type
- && unlikely (head->flags & SHF_GROUP))
- {
- /* There is at least one section which is contained in a
- section group in the input file. This means we must
- create a section group here as well. The only problem is
- that not all input files have to have to same kind of
- partitioning of the sections. I.e., sections A and B in
- one input file and sections B and C in another input file
- can be in one group. That will result in a group
- containing the sections A, B, and C in the output
- file. */
- struct scninfo *runp;
- Elf32_Word here_groupidx = 0;
- struct scngroup *here_group;
- struct member *newp;
-
- /* First check whether any section is already in a group.
- In this case we have to add this output section, too. */
- runp = head->last;
- do
- {
- assert (runp->grpid != 0);
-
- here_groupidx = runp->fileinfo->scninfo[runp->grpid].outscnndx;
- if (here_groupidx != 0)
- break;
- }
- while ((runp = runp->next) != head->last);
-
- if (here_groupidx == 0)
- {
- /* We need a new section group section. */
- scn = elf_newscn (ld_state.outelf);
- xelf_getshdr (scn, shdr);
- if (shdr == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot create section for output file: %s"),
- elf_errmsg (-1));
-
- here_group = (struct scngroup *) xmalloc (sizeof (*here_group));
- here_group->outscnidx = here_groupidx = elf_ndxscn (scn);
- here_group->nscns = 0;
- here_group->member = NULL;
- here_group->next = ld_state.groups;
- /* Pick a name for the section. To keep it meaningful
- we use a name used in the input files. If the
- section group in the output file should contain
- section which were in section groups of different
- names in the input files this is the users
- problem. */
- here_group->nameent
- = ebl_strtabadd (ld_state.shstrtab,
- elf_strptr (runp->fileinfo->elf,
- runp->fileinfo->shstrndx,
- SCNINFO_SHDR (runp->shdr).sh_name),
- 0);
- /* Signature symbol. */
- here_group->symbol
- = runp->fileinfo->scninfo[runp->grpid].symbols;
-
- ld_state.groups = here_group;
- }
- else
- {
- /* Search for the group with this index. */
- here_group = ld_state.groups;
- while (here_group->outscnidx != here_groupidx)
- here_group = here_group->next;
- }
-
- /* Add the new output section. */
- newp = (struct member *) alloca (sizeof (*newp));
- newp->scn = head;
-#ifndef NDT_NEEDED
- newp->next = NULL;
-#endif
- CSNGL_LIST_ADD_REAR (here_group->member, newp);
- ++here_group->nscns;
-
- /* Store the section group index in all input files. */
- runp = head->last;
- do
- {
- assert (runp->grpid != 0);
-
- if (runp->fileinfo->scninfo[runp->grpid].outscnndx == 0)
- runp->fileinfo->scninfo[runp->grpid].outscnndx = here_groupidx;
- else
- assert (runp->fileinfo->scninfo[runp->grpid].outscnndx
- == here_groupidx);
- }
- while ((runp = runp->next) != head->last);
- }
-
- /* We'll use this section so get it's name in the section header
- string table. */
- if (head->kind == scn_normal)
- head->nameent = ebl_strtabadd (ld_state.shstrtab, head->name, 0);
-
- /* Create a new section in the output file and add all data
- from all the sections we read. */
- scn = elf_newscn (ld_state.outelf);
- head->scnidx = elf_ndxscn (scn);
- xelf_getshdr (scn, shdr);
- if (shdr == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot create section for output file: %s"),
- elf_errmsg (-1));
-
- assert (head->type != SHT_NULL);
- assert (head->type != SHT_SYMTAB);
- assert (head->type != SHT_DYNSYM || head->kind != scn_normal);
- assert (head->type != SHT_STRTAB || head->kind != scn_normal);
- assert (head->type != SHT_GROUP);
- shdr->sh_type = head->type;
- shdr->sh_flags = head->flags;
- shdr->sh_addralign = head->align;
- shdr->sh_entsize = head->entsize;
- assert (shdr->sh_entsize != 0 || (shdr->sh_flags & SHF_MERGE) == 0);
- (void) xelf_update_shdr (scn, shdr);
-
- /* We have to know the section index of the dynamic symbol table
- right away. */
- if (head->kind == scn_dot_dynsym)
- ld_state.dynsymscnidx = elf_ndxscn (scn);
- }
-
- /* Actually create the section group sections. */
- groups = ld_state.groups;
- while (groups != NULL)
- {
- Elf_Scn *scn;
- Elf_Data *data;
- Elf32_Word *grpdata;
- struct member *runp;
-
- scn = elf_getscn (ld_state.outelf, groups->outscnidx);
- assert (scn != NULL);
-
- data = elf_newdata (scn);
- if (data == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot create section for output file: %s"),
- elf_errmsg (-1));
-
- data->d_size = (groups->nscns + 1) * sizeof (Elf32_Word);
- data->d_buf = grpdata = (Elf32_Word *) xmalloc (data->d_size);
- data->d_type = ELF_T_WORD;
- data->d_version = EV_CURRENT;
- data->d_off = 0;
- /* XXX What better to use? */
- data->d_align = sizeof (Elf32_Word);
-
- /* The first word in the section is the flag word. */
- /* XXX Set COMDATA flag is necessary. */
- grpdata[0] = 0;
-
- runp = groups->member->next;
- cnt = 1;
- do
- /* Fill in the index of the section. */
- grpdata[cnt++] = runp->scn->scnidx;
- while ((runp = runp->next) != groups->member->next);
-
- groups = groups->next;
- }
-}
-
-
-static bool
-reduce_symbol_p (XElf_Sym *sym, struct Ebl_Strent *strent)
-{
- const char *str;
- const char *version;
- struct id_list search;
- struct id_list *verp;
- bool result = ld_state.default_bind_local;
-
- if (XELF_ST_BIND (sym->st_info) == STB_LOCAL || sym->st_shndx == SHN_UNDEF)
- /* We don't have to do anything to local symbols here. */
- /* XXX Any section value in [SHN_LORESERVER,SHN_XINDEX) need
- special treatment? */
- return false;
-
- /* XXX Handle other symbol bindings. */
- assert (XELF_ST_BIND (sym->st_info) == STB_GLOBAL
- || XELF_ST_BIND (sym->st_info) == STB_WEAK);
-
- str = ebl_string (strent);
- version = strchr (str, VER_CHR);
- if (version != NULL)
- {
- search.id = strndupa (str, version - str);
- if (*++version == VER_CHR)
- /* Skip the second '@' signaling a default definition. */
- ++version;
- }
- else
- {
- search.id = str;
- version = "";
- }
-
- verp = ld_version_str_tab_find (&ld_state.version_str_tab,
- elf_hash (search.id), &search);
- while (verp != NULL)
- {
- /* We have this symbol in the version hash table. Now match the
- version name. */
- if (strcmp (verp->u.s.versionname, version) == 0)
- /* Match! */
- return verp->u.s.local;
-
- verp = verp->next;
- }
-
- /* XXX Add test for wildcard version symbols. */
-
- return result;
-}
-
-
-static XElf_Addr
-eval_expression (struct expression *expr, XElf_Addr addr)
-{
- XElf_Addr val = ~((XElf_Addr) 0);
-
- switch (expr->tag)
- {
- case exp_num:
- val = expr->val.num;
- break;
-
- case exp_sizeof_headers:
- {
- /* The 'elf_update' call determine the offset of the first
- section. The the size of the header. */
- XElf_Shdr_vardef (shdr);
-
- xelf_getshdr (elf_getscn (ld_state.outelf, 1), shdr);
- assert (shdr != NULL);
-
- val = shdr->sh_offset;
- }
- break;
-
- case exp_pagesize:
- val = ld_state.pagesize;
- break;
-
- case exp_id:
- /* We are here computing only address expressions. It seems not
- to be necessary to handle any variable but ".". Let's avoid
- the complication. If it turns up to be needed we can add
- it. */
- if (strcmp (expr->val.str, ".") != 0)
- error (EXIT_FAILURE, 0, gettext ("\
-address computation expression contains variable '%s'"),
- expr->val.str);
-
- val = addr;
- break;
-
- case exp_mult:
- val = (eval_expression (expr->val.binary.left, addr)
- * eval_expression (expr->val.binary.right, addr));
- break;
-
- case exp_div:
- val = (eval_expression (expr->val.binary.left, addr)
- / eval_expression (expr->val.binary.right, addr));
- break;
-
- case exp_mod:
- val = (eval_expression (expr->val.binary.left, addr)
- % eval_expression (expr->val.binary.right, addr));
- break;
-
- case exp_plus:
- val = (eval_expression (expr->val.binary.left, addr)
- + eval_expression (expr->val.binary.right, addr));
- break;
-
- case exp_minus:
- val = (eval_expression (expr->val.binary.left, addr)
- - eval_expression (expr->val.binary.right, addr));
- break;
-
- case exp_and:
- val = (eval_expression (expr->val.binary.left, addr)
- & eval_expression (expr->val.binary.right, addr));
- break;
-
- case exp_or:
- val = (eval_expression (expr->val.binary.left, addr)
- | eval_expression (expr->val.binary.right, addr));
- break;
-
- case exp_align:
- val = eval_expression (expr->val.child, addr);
- if ((val & (val - 1)) != 0)
- error (EXIT_FAILURE, 0, gettext ("argument '%" PRIuMAX "' of ALIGN in address computation expression is no power of two"),
- (uintmax_t) val);
- val = (addr + val - 1) & ~(val - 1);
- break;
- }
-
- return val;
-}
-
-
-/* Find a good as possible size for the hash table so that all the
- non-zero entries in HASHCODES don't collide too much and the table
- isn't too large. There is no exact formular for this so we use a
- heuristic. Depending on the optimization level the search is
- longer or shorter. */
-static size_t
-optimal_bucket_size (Elf32_Word *hashcodes, size_t maxcnt, int optlevel)
-{
- size_t minsize;
- size_t maxsize;
- size_t bestsize;
- uint64_t bestcost;
- size_t size;
- uint32_t *counts;
- uint32_t *lengths;
-
- if (maxcnt == 0)
- return 0;
-
- /* When we are not optimizing we run only very few tests. */
- if (optlevel <= 0)
- {
- minsize = maxcnt;
- maxsize = maxcnt + 10000 / maxcnt;
- }
- else
- {
- /* Does not make much sense to start with a smaller table than
- one which has at least four collisions. */
- minsize = MAX (1, maxcnt / 4);
- /* We look for a best fit in the range of up to eigth times the
- number of elements. */
- maxsize = 2 * maxcnt + (6 * MIN (optlevel, 100) * maxcnt) / 100;
- }
- bestsize = maxcnt;
- bestcost = UINT_MAX;
-
- /* Array for counting the collisions and chain lengths. */
- counts = (uint32_t *) xmalloc ((maxcnt + 1 + maxsize) * sizeof (uint32_t));
- lengths = &counts[maxcnt + 1];
-
- for (size = minsize; size <= maxsize; ++size)
- {
- size_t inner;
- uint64_t cost;
- uint32_t maxlength;
- uint64_t success;
- uint32_t acc;
- double factor;
-
- memset (lengths, '\0', size * sizeof (uint32_t));
- memset (counts, '\0', (maxcnt + 1) * sizeof (uint32_t));
-
- /* Determine how often each hash bucket is used. */
- assert (hashcodes[0] == 0);
- for (inner = 1; inner < maxcnt; ++inner)
- ++lengths[hashcodes[inner] % size];
-
- /* Determine the lengths. */
- maxlength = 0;
- for (inner = 0; inner < size; ++inner)
- {
- ++counts[lengths[inner]];
-
- if (lengths[inner] > maxlength)
- maxlength = lengths[inner];
- }
-
- /* Determine successful lookup length. */
- acc = 0;
- success = 0;
- for (inner = 0; inner <= maxlength; ++inner)
- {
- acc += inner;
- success += counts[inner] * acc;
- }
-
- /* We can compute two factors now: the average length of a
- positive search and the average length of a negative search.
- We count the number of comparisons which have to look at the
- names themselves. Recognizing that the chain ended is not
- accounted for since it's almost for free.
-
- Which lookup is more important depends on the kind of DSO.
- If it is a system DSO like libc it is expected that most
- lookups succeed. Otherwise most lookups fail. */
- if (ld_state.is_system_library)
- factor = (1.0 * (double) success / (double) maxcnt
- + 0.3 * (double) maxcnt / (double) size);
- else
- factor = (0.3 * (double) success / (double) maxcnt
- + 1.0 * (double) maxcnt / (double) size);
-
- /* Combine the lookup cost factor. The 1/16th addend adds
- penalties for too large table sizes. */
- cost = (2 + maxcnt + size) * (factor + 1.0 / 16.0);
-
-#if 0
- printf ("maxcnt = %d, size = %d, cost = %Ld, success = %g, fail = %g, factor = %g\n",
- maxcnt, size, cost, (double) success / (double) maxcnt, (double) maxcnt / (double) size, factor);
-#endif
-
- /* Compare with current best results. */
- if (cost < bestcost)
- {
- bestcost = cost;
- bestsize = size;
- }
- }
-
- free (counts);
-
- return bestsize;
-}
-
-
-static void
-optimal_gnu_hash_size (Elf32_Word *hashcodes, size_t maxcnt, int optlevel,
- size_t *bitmask_nwords, size_t *shift, size_t *nbuckets)
-{
- // XXX Implement something real
- *bitmask_nwords = 256;
- *shift = 6;
- *nbuckets = 3 * maxcnt / 2;
-}
-
-
-static XElf_Addr
-find_entry_point (void)
-{
- XElf_Addr result;
-
- if (ld_state.entry != NULL)
- {
- struct symbol search = { .name = ld_state.entry };
- struct symbol *syment;
-
- syment = ld_symbol_tab_find (&ld_state.symbol_tab,
- elf_hash (ld_state.entry), &search);
- if (syment != NULL && syment->defined)
- {
- /* We found the symbol. */
- Elf_Data *data = elf_getdata (elf_getscn (ld_state.outelf,
- ld_state.symscnidx), NULL);
-
- XElf_Sym_vardef (sym);
-
- sym = NULL;
- if (data != NULL)
- xelf_getsym (data, ld_state.dblindirect[syment->outsymidx], sym);
-
- if (sym == NULL && ld_state.need_dynsym && syment->outdynsymidx != 0)
- {
- /* Use the dynamic symbol table if available. */
- data = elf_getdata (elf_getscn (ld_state.outelf,
- ld_state.dynsymscnidx), NULL);
-
- sym = NULL;
- if (data != NULL)
- xelf_getsym (data, syment->outdynsymidx, sym);
- }
-
- if (sym != NULL)
- return sym->st_value;
-
- /* XXX What to do if the output has no non-dynamic symbol
- table and the dynamic symbol table does not contain the
- symbol? */
- assert (ld_state.need_symtab);
- assert (ld_state.symscnidx != 0);
- }
- }
-
- /* We couldn't find the symbol or none was given. Use the first
- address of the ".text" section then. */
-
-
- result = 0;
-
- /* In DSOs this is no fatal error. They usually have no entry
- points. In this case we set the entry point to zero, which makes
- sure it will always fail. */
- if (ld_state.file_type == executable_file_type)
- {
- if (ld_state.entry != NULL)
- error (0, 0, gettext ("\
-cannot find entry symbol '%s': defaulting to %#0*" PRIx64),
- ld_state.entry,
- xelf_getclass (ld_state.outelf) == ELFCLASS32 ? 10 : 18,
- (uint64_t) result);
- else
- error (0, 0, gettext ("\
-no entry symbol specified: defaulting to %#0*" PRIx64),
- xelf_getclass (ld_state.outelf) == ELFCLASS32 ? 10 : 18,
- (uint64_t) result);
- }
-
- return result;
-}
-
-
-static void
-fillin_special_symbol (struct symbol *symst, size_t scnidx, size_t nsym,
- Elf_Data *symdata, struct Ebl_Strtab *strtab)
-{
- assert (ld_state.file_type != relocatable_file_type);
-
- XElf_Sym_vardef (sym);
- xelf_getsym_ptr (symdata, nsym, sym);
-
- /* The name offset will be filled in later. */
- sym->st_name = 0;
- /* Traditionally: globally visible. */
- sym->st_info = XELF_ST_INFO (symst->local ? STB_LOCAL : STB_GLOBAL,
- symst->type);
- sym->st_other = symst->hidden ? STV_HIDDEN : STV_DEFAULT;
- /* Reference to the GOT or dynamic section. Since the GOT and
- dynamic section are only created for executables and DSOs it
- cannot be that the section index is too large. */
- assert (scnidx != 0);
- assert (scnidx < SHN_LORESERVE || scnidx == SHN_ABS);
- sym->st_shndx = scnidx;
- /* We want the beginning of the section. */
- sym->st_value = 0;
- // XXX What size?
- sym->st_size = 0;
-
- /* Determine the size of the section. */
- if (scnidx != SHN_ABS)
- {
- Elf_Data *data = elf_getdata (elf_getscn (ld_state.outelf, scnidx),
- NULL);
- assert (data != NULL);
- sym->st_size = data->d_size;
- /* Make sure there is no second data block. */
- assert (elf_getdata (elf_getscn (ld_state.outelf, scnidx), data)
- == NULL);
- }
-
- /* Insert symbol into the symbol table. Note that we do not have to
- use xelf_update_symshdx. */
- (void) xelf_update_sym (symdata, nsym, sym);
-
- /* Cross-references. */
- ndxtosym[nsym] = symst;
- symst->outsymidx = nsym;
-
- /* Add the name to the string table. */
- symstrent[nsym] = ebl_strtabadd (strtab, symst->name, 0);
-}
-
-
-static void
-new_dynamic_entry (Elf_Data *data, int idx, XElf_Sxword tag, XElf_Addr val)
-{
- XElf_Dyn_vardef (dyn);
- xelf_getdyn_ptr (data, idx, dyn);
- dyn->d_tag = tag;
- dyn->d_un.d_ptr = val;
- (void) xelf_update_dyn (data, idx, dyn);
-}
-
-
-static void
-allocate_version_names (struct usedfiles *runp, struct Ebl_Strtab *dynstrtab)
-{
- /* If this DSO has no versions skip it. */
- if (runp->status != opened || runp->verdefdata == NULL)
- return;
-
- /* Add the object name. */
- int offset = 0;
- while (1)
- {
- XElf_Verdef_vardef (def);
- XElf_Verdaux_vardef (aux);
-
- /* Get data at the next offset. */
- xelf_getverdef (runp->verdefdata, offset, def);
- assert (def != NULL);
- xelf_getverdaux (runp->verdefdata, offset + def->vd_aux, aux);
- assert (aux != NULL);
-
- assert (def->vd_ndx <= runp->nverdef);
- if (def->vd_ndx == 1 || runp->verdefused[def->vd_ndx] != 0)
- {
- runp->verdefent[def->vd_ndx]
- = ebl_strtabadd (dynstrtab, elf_strptr (runp->elf,
- runp->dynsymstridx,
- aux->vda_name), 0);
-
- if (def->vd_ndx > 1)
- runp->verdefused[def->vd_ndx] = ld_state.nextveridx++;
- }
-
- if (def->vd_next == 0)
- /* That were all versions. */
- break;
-
- offset += def->vd_next;
- }
-}
-
-
-static XElf_Off
-create_verneed_data (XElf_Off offset, Elf_Data *verneeddata,
- struct usedfiles *runp, int *ntotal)
-{
- size_t verneed_size = xelf_fsize (ld_state.outelf, ELF_T_VNEED, 1);
- size_t vernaux_size = xelf_fsize (ld_state.outelf, ELF_T_VNAUX, 1);
- int need_offset;
- bool filled = false;
- GElf_Verneed verneed;
- GElf_Vernaux vernaux;
- int ndef = 0;
- size_t cnt;
-
- /* If this DSO has no versions skip it. */
- if (runp->nverdefused == 0)
- return offset;
-
- /* We fill in the Verneed record last. Remember the offset. */
- need_offset = offset;
- offset += verneed_size;
-
- for (cnt = 2; cnt <= runp->nverdef; ++cnt)
- if (runp->verdefused[cnt] != 0)
- {
- assert (runp->verdefent[cnt] != NULL);
-
- if (filled)
- {
- vernaux.vna_next = vernaux_size;
- (void) gelf_update_vernaux (verneeddata, offset, &vernaux);
- offset += vernaux_size;
- }
-
- vernaux.vna_hash = elf_hash (ebl_string (runp->verdefent[cnt]));
- vernaux.vna_flags = 0;
- vernaux.vna_other = runp->verdefused[cnt];
- vernaux.vna_name = ebl_strtaboffset (runp->verdefent[cnt]);
- filled = true;
- ++ndef;
- }
-
- assert (filled);
- vernaux.vna_next = 0;
- (void) gelf_update_vernaux (verneeddata, offset, &vernaux);
- offset += vernaux_size;
-
- verneed.vn_version = VER_NEED_CURRENT;
- verneed.vn_cnt = ndef;
- verneed.vn_file = ebl_strtaboffset (runp->verdefent[1]);
- /* The first auxiliary entry is always found directly
- after the verneed entry. */
- verneed.vn_aux = verneed_size;
- verneed.vn_next = --*ntotal > 0 ? offset - need_offset : 0;
- (void) gelf_update_verneed (verneeddata, need_offset, &verneed);
-
- return offset;
-}
-
-
-/* Callback for qsort to sort dynamic string table. */
-static Elf32_Word *global_hashcodes;
-static size_t global_nbuckets;
-static int
-sortfct_hashval (const void *p1, const void *p2)
-{
- size_t idx1 = *(size_t *) p1;
- size_t idx2 = *(size_t *) p2;
-
- int def1 = ndxtosym[idx1]->defined && !ndxtosym[idx1]->in_dso;
- int def2 = ndxtosym[idx2]->defined && !ndxtosym[idx2]->in_dso;
-
- if (! def1 && def2)
- return -1;
- if (def1 && !def2)
- return 1;
- if (! def1)
- return 0;
-
- Elf32_Word hval1 = (global_hashcodes[ndxtosym[idx1]->outdynsymidx]
- % global_nbuckets);
- Elf32_Word hval2 = (global_hashcodes[ndxtosym[idx2]->outdynsymidx]
- % global_nbuckets);
-
- if (hval1 < hval2)
- return -1;
- if (hval1 > hval2)
- return 1;
- return 0;
-}
-
-
-/* Sort the dynamic symbol table. The GNU hash table lookup assumes
- that all symbols with the same hash value module the bucket table
- size follow one another. This avoids the extra hash chain table.
- There is no need (and no way) to perform this operation if we do
- not use the new hash table format. */
-static void
-create_gnu_hash (size_t nsym_local, size_t nsym, size_t nsym_dyn,
- Elf32_Word *gnuhashcodes)
-{
- size_t gnu_bitmask_nwords = 0;
- size_t gnu_shift = 0;
- size_t gnu_nbuckets = 0;
- Elf32_Word *gnu_bitmask = NULL;
- Elf32_Word *gnu_buckets = NULL;
- Elf32_Word *gnu_chain = NULL;
- XElf_Shdr_vardef (shdr);
-
- /* Determine the "optimal" bucket size. */
- optimal_gnu_hash_size (gnuhashcodes, nsym_dyn, ld_state.optlevel,
- &gnu_bitmask_nwords, &gnu_shift, &gnu_nbuckets);
-
- /* Create the .gnu.hash section data structures. */
- Elf_Scn *hashscn = elf_getscn (ld_state.outelf, ld_state.gnuhashscnidx);
- xelf_getshdr (hashscn, shdr);
- Elf_Data *hashdata = elf_newdata (hashscn);
- if (shdr == NULL || hashdata == NULL)
- error (EXIT_FAILURE, 0, gettext ("\
-cannot create GNU hash table section for output file: %s"),
- elf_errmsg (-1));
-
- shdr->sh_link = ld_state.dynsymscnidx;
- (void) xelf_update_shdr (hashscn, shdr);
-
- hashdata->d_size = (xelf_fsize (ld_state.outelf, ELF_T_ADDR,
- gnu_bitmask_nwords)
- + (4 + gnu_nbuckets + nsym_dyn) * sizeof (Elf32_Word));
- hashdata->d_buf = xcalloc (1, hashdata->d_size);
- hashdata->d_align = sizeof (Elf32_Word);
- hashdata->d_type = ELF_T_WORD;
- hashdata->d_off = 0;
-
- ((Elf32_Word *) hashdata->d_buf)[0] = gnu_nbuckets;
- ((Elf32_Word *) hashdata->d_buf)[2] = gnu_bitmask_nwords;
- ((Elf32_Word *) hashdata->d_buf)[3] = gnu_shift;
- gnu_bitmask = &((Elf32_Word *) hashdata->d_buf)[4];
- gnu_buckets = &gnu_bitmask[xelf_fsize (ld_state.outelf, ELF_T_ADDR,
- gnu_bitmask_nwords)
- / sizeof (*gnu_buckets)];
- gnu_chain = &gnu_buckets[gnu_nbuckets];
-#ifndef NDEBUG
- void *endp = &gnu_chain[nsym_dyn];
-#endif
- assert (endp == (void *) ((char *) hashdata->d_buf + hashdata->d_size));
-
-
- size_t *remap = xmalloc (nsym_dyn * sizeof (size_t));
-#ifndef NDEBUG
- size_t nsym_dyn_cnt = 1;
-#endif
- for (size_t cnt = nsym_local; cnt < nsym; ++cnt)
- if (symstrent[cnt] != NULL)
- {
- assert (ndxtosym[cnt]->outdynsymidx > 0);
- assert (ndxtosym[cnt]->outdynsymidx < nsym_dyn);
- remap[ndxtosym[cnt]->outdynsymidx] = cnt;
-#ifndef NDEBUG
- ++nsym_dyn_cnt;
-#endif
- }
- assert (nsym_dyn_cnt == nsym_dyn);
-
- // XXX Until we can rely on qsort_r use global variables.
- global_hashcodes = gnuhashcodes;
- global_nbuckets = gnu_nbuckets;
- qsort (remap + 1, nsym_dyn - 1, sizeof (size_t), sortfct_hashval);
-
- bool bm32 = (xelf_fsize (ld_state.outelf, ELF_T_ADDR, 1)
- == sizeof (Elf32_Word));
-
- size_t first_defined = 0;
- Elf64_Word bitmask_idxbits = gnu_bitmask_nwords - 1;
- Elf32_Word last_bucket = 0;
- for (size_t cnt = 1; cnt < nsym_dyn; ++cnt)
- {
- if (first_defined == 0)
- {
- if (! ndxtosym[remap[cnt]]->defined
- || ndxtosym[remap[cnt]]->in_dso)
- goto next;
-
- ((Elf32_Word *) hashdata->d_buf)[1] = first_defined = cnt;
- }
-
- Elf32_Word hval = gnuhashcodes[ndxtosym[remap[cnt]]->outdynsymidx];
-
- if (bm32)
- {
- Elf32_Word *bsw = &gnu_bitmask[(hval / 32) & bitmask_idxbits];
- assert ((void *) gnu_bitmask <= (void *) bsw);
- assert ((void *) bsw < (void *) gnu_buckets);
- *bsw |= 1 << (hval & 31);
- *bsw |= 1 << ((hval >> gnu_shift) & 31);
- }
- else
- {
- Elf64_Word *bsw = &((Elf64_Word *) gnu_bitmask)[(hval / 64)
- & bitmask_idxbits];
- assert ((void *) gnu_bitmask <= (void *) bsw);
- assert ((void *) bsw < (void *) gnu_buckets);
- *bsw |= 1 << (hval & 63);
- *bsw |= 1 << ((hval >> gnu_shift) & 63);
- }
-
- size_t this_bucket = hval % gnu_nbuckets;
- if (cnt == first_defined || this_bucket != last_bucket)
- {
- if (cnt != first_defined)
- {
- /* Terminate the previous chain. */
- assert ((void *) &gnu_chain[cnt - first_defined - 1] < endp);
- gnu_chain[cnt - first_defined - 1] |= 1;
- }
-
- assert (this_bucket < gnu_nbuckets);
- gnu_buckets[this_bucket] = cnt;
- last_bucket = this_bucket;
- }
-
- assert (cnt >= first_defined);
- assert (cnt - first_defined < nsym_dyn);
- gnu_chain[cnt - first_defined] = hval & ~1u;
-
- next:
- ndxtosym[remap[cnt]]->outdynsymidx = cnt;
- }
-
- /* Terminate the last chain. */
- if (first_defined != 0)
- {
- assert (nsym_dyn > first_defined);
- assert (nsym_dyn - first_defined - 1 < nsym_dyn);
- gnu_chain[nsym_dyn - first_defined - 1] |= 1;
-
- hashdata->d_size -= first_defined * sizeof (Elf32_Word);
- }
- else
- /* We do not need any hash table. */
- // XXX
- do { } while (0);
-
- free (remap);
-}
-
-
-/* Create the SysV-style hash table. */
-static void
-create_hash (size_t nsym_local, size_t nsym, size_t nsym_dyn,
- Elf32_Word *hashcodes)
-{
- size_t nbucket = 0;
- Elf32_Word *bucket = NULL;
- Elf32_Word *chain = NULL;
- XElf_Shdr_vardef (shdr);
-
- /* Determine the "optimal" bucket size. If we also generate the
- new-style hash function there is no need to waste effort and
- space on the old one which should not be used. Make it as small
- as possible. */
- if (GENERATE_GNU_HASH)
- nbucket = 1;
- else
- nbucket = optimal_bucket_size (hashcodes, nsym_dyn, ld_state.optlevel);
- /* Create the .hash section data structures. */
- Elf_Scn *hashscn = elf_getscn (ld_state.outelf, ld_state.hashscnidx);
- xelf_getshdr (hashscn, shdr);
- Elf_Data *hashdata = elf_newdata (hashscn);
- if (shdr == NULL || hashdata == NULL)
- error (EXIT_FAILURE, 0, gettext ("\
-cannot create hash table section for output file: %s"),
- elf_errmsg (-1));
-
- shdr->sh_link = ld_state.dynsymscnidx;
- (void) xelf_update_shdr (hashscn, shdr);
-
- hashdata->d_size = (2 + nsym_dyn + nbucket) * sizeof (Elf32_Word);
- hashdata->d_buf = xcalloc (1, hashdata->d_size);
- hashdata->d_align = sizeof (Elf32_Word);
- hashdata->d_type = ELF_T_WORD;
- hashdata->d_off = 0;
-
- ((Elf32_Word *) hashdata->d_buf)[0] = nbucket;
- ((Elf32_Word *) hashdata->d_buf)[1] = nsym_dyn;
- bucket = &((Elf32_Word *) hashdata->d_buf)[2];
- chain = &((Elf32_Word *) hashdata->d_buf)[2 + nbucket];
-
- for (size_t cnt = nsym_local; cnt < nsym; ++cnt)
- if (symstrent[cnt] != NULL)
- {
- size_t dynidx = ndxtosym[cnt]->outdynsymidx;
- size_t hashidx = hashcodes[dynidx] % nbucket;
- if (bucket[hashidx] == 0)
- bucket[hashidx] = dynidx;
- else
- {
- hashidx = bucket[hashidx];
- while (chain[hashidx] != 0)
- hashidx = chain[hashidx];
-
- chain[hashidx] = dynidx;
- }
- }
-}
-
-
-static void
-create_build_id_section (Elf_Scn *scn)
-{
- /* We know how large the section will be so we can create it now. */
- Elf_Data *d = elf_newdata (scn);
- if (d == NULL)
- error (EXIT_FAILURE, 0, gettext ("cannot create build ID section: %s"),
- elf_errmsg (-1));
-
- d->d_type = ELF_T_BYTE;
- d->d_version = EV_CURRENT;
-
- /* The note section header. */
- assert (sizeof (Elf32_Nhdr) == sizeof (Elf64_Nhdr));
- d->d_size = sizeof (GElf_Nhdr);
- /* The string is four bytes long. */
- d->d_size += sizeof (ELF_NOTE_GNU);
- assert (d->d_size % 4 == 0);
-
- if (strcmp (ld_state.build_id, "md5") == 0
- || strcmp (ld_state.build_id, "uuid") == 0)
- d->d_size += 16;
- else if (strcmp (ld_state.build_id, "sha1") == 0)
- d->d_size += 20;
- else
- {
- assert (ld_state.build_id[0] == '0' && ld_state.build_id[1] == 'x');
- /* Use an upper limit of the possible number of bytes generated
- from the string. */
- d->d_size += strlen (ld_state.build_id) / 2;
- }
-
- d->d_buf = xcalloc (d->d_size, 1);
- d->d_off = 0;
- d->d_align = 0;
-}
-
-
-static void
-compute_hash_sum (void (*hashfct) (const void *, size_t, void *), void *ctx)
-{
- /* The call cannot fail. */
- size_t shstrndx;
- (void) elf_getshdrstrndx (ld_state.outelf, &shstrndx);
-
- const char *ident = elf_getident (ld_state.outelf, NULL);
- bool same_byte_order = ((ident[EI_DATA] == ELFDATA2LSB
- && __BYTE_ORDER == __LITTLE_ENDIAN)
- || (ident[EI_DATA] == ELFDATA2MSB
- && __BYTE_ORDER == __BIG_ENDIAN));
-
- /* Iterate over all sections to find those which are not strippable. */
- Elf_Scn *scn = NULL;
- while ((scn = elf_nextscn (ld_state.outelf, scn)) != NULL)
- {
- /* Get the section header. */
- GElf_Shdr shdr_mem;
- GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
- assert (shdr != NULL);
-
- if (SECTION_STRIP_P (shdr, elf_strptr (ld_state.outelf, shstrndx,
- shdr->sh_name), true))
- /* The section can be stripped. Don't use it. */
- continue;
-
- /* Do not look at NOBITS sections. */
- if (shdr->sh_type == SHT_NOBITS)
- continue;
-
- /* Iterate through the list of data blocks. */
- Elf_Data *data = NULL;
- while ((data = INTUSE(elf_getdata) (scn, data)) != NULL)
- /* If the file byte order is the same as the host byte order
- process the buffer directly. If the data is just a stream
- of bytes which the library will not convert we can use it
- as well. */
- if (likely (same_byte_order) || data->d_type == ELF_T_BYTE)
- hashfct (data->d_buf, data->d_size, ctx);
- else
- {
- /* Convert the data to file byte order. */
- if (gelf_xlatetof (ld_state.outelf, data, data, ident[EI_DATA])
- == NULL)
- error (EXIT_FAILURE, 0, gettext ("\
-cannot convert section data to file format: %s"),
- elf_errmsg (-1));
-
- hashfct (data->d_buf, data->d_size, ctx);
-
- /* And convert it back. */
- if (gelf_xlatetom (ld_state.outelf, data, data, ident[EI_DATA])
- == NULL)
- error (EXIT_FAILURE, 0, gettext ("\
-cannot convert section data to memory format: %s"),
- elf_errmsg (-1));
- }
- }
-}
-
-
-/* Iterate over the sections */
-static void
-compute_build_id (void)
-{
- Elf_Data *d = elf_getdata (elf_getscn (ld_state.outelf,
- ld_state.buildidscnidx), NULL);
- assert (d != NULL);
-
- GElf_Nhdr *hdr = d->d_buf;
- hdr->n_namesz = sizeof (ELF_NOTE_GNU);
- hdr->n_type = NT_GNU_BUILD_ID;
- char *dp = mempcpy (hdr + 1, ELF_NOTE_GNU, sizeof (ELF_NOTE_GNU));
-
- if (strcmp (ld_state.build_id, "sha1") == 0)
- {
- /* Compute the SHA1 sum of various parts of the generated file.
- We compute the hash sum over the external representation. */
- struct sha1_ctx ctx;
- sha1_init_ctx (&ctx);
-
- /* Compute the hash sum by running over all sections. */
- compute_hash_sum ((void (*) (const void *, size_t, void *)) sha1_process_bytes,
- &ctx);
-
- /* We are done computing the checksum. */
- (void) sha1_finish_ctx (&ctx, dp);
-
- hdr->n_descsz = SHA1_DIGEST_SIZE;
- }
- else if (strcmp (ld_state.build_id, "md5") == 0)
- {
- /* Compute the MD5 sum of various parts of the generated file.
- We compute the hash sum over the external representation. */
- struct md5_ctx ctx;
- md5_init_ctx (&ctx);
-
- /* Compute the hash sum by running over all sections. */
- compute_hash_sum ((void (*) (const void *, size_t, void *)) md5_process_bytes,
- &ctx);
-
- /* We are done computing the checksum. */
- (void) md5_finish_ctx (&ctx, dp);
-
- hdr->n_descsz = MD5_DIGEST_SIZE;
- }
- else if (strcmp (ld_state.build_id, "uuid") == 0)
- {
- int fd = open ("/dev/urandom", O_RDONLY);
- if (fd == -1)
- error (EXIT_FAILURE, errno, gettext ("cannot open '%s'"),
- "/dev/urandom");
-
- if (TEMP_FAILURE_RETRY (read (fd, dp, 16)) != 16)
- error (EXIT_FAILURE, 0, gettext ("cannot read enough data for UUID"));
-
- close (fd);
-
- hdr->n_descsz = 16;
- }
- else
- {
- const char *cp = ld_state.build_id + 2;
-
- /* The form of the string has been verified before so here we can
- simplify the scanning. */
- do
- {
- if (isxdigit (cp[0]))
- {
- char ch1 = tolower (cp[0]);
- char ch2 = tolower (cp[1]);
-
- *dp++ = (((isdigit (ch1) ? ch1 - '0' : ch1 - 'a' + 10) << 4)
- | (isdigit (ch2) ? ch2 - '0' : ch2 - 'a' + 10));
- }
- else
- ++cp;
- }
- while (*cp != '\0');
- }
-}
-
-
-/* Create the output file.
-
- For relocatable files what basically has to happen is that all
- sections from all input files are written into the output file.
- Sections with the same name are combined (offsets adjusted
- accordingly). The symbol tables are combined in one single table.
- When stripping certain symbol table entries are omitted.
-
- For executables (shared or not) we have to create the program header,
- additional sections like the .interp, eventually (in addition) create
- a dynamic symbol table and a dynamic section. Also the relocations
- have to be processed differently. */
-static int
-ld_generic_create_outfile (struct ld_state *statep)
-{
- struct scnlist
- {
- size_t scnidx;
- struct scninfo *scninfo;
- struct scnlist *next;
- };
- struct scnlist *rellist = NULL;
- size_t cnt;
- Elf_Scn *symscn = NULL;
- Elf_Scn *xndxscn = NULL;
- Elf_Scn *strscn = NULL;
- struct Ebl_Strtab *strtab = NULL;
- struct Ebl_Strtab *dynstrtab = NULL;
- XElf_Shdr_vardef (shdr);
- Elf_Data *data;
- Elf_Data *symdata = NULL;
- Elf_Data *xndxdata = NULL;
- struct usedfiles *file;
- size_t nsym;
- size_t nsym_local;
- size_t nsym_allocated;
- size_t nsym_dyn = 0;
- Elf32_Word *dblindirect = NULL;
-#ifndef NDEBUG
- bool need_xndx;
-#endif
- Elf_Scn *shstrtab_scn;
- size_t shstrtab_ndx;
- XElf_Ehdr_vardef (ehdr);
- struct Ebl_Strent *symtab_ent = NULL;
- struct Ebl_Strent *xndx_ent = NULL;
- struct Ebl_Strent *strtab_ent = NULL;
- struct Ebl_Strent *shstrtab_ent;
- struct scngroup *groups;
- Elf_Scn *dynsymscn = NULL;
- Elf_Data *dynsymdata = NULL;
- Elf_Data *dynstrdata = NULL;
- Elf32_Word *hashcodes = NULL;
- Elf32_Word *gnuhashcodes = NULL;
- size_t nsym_dyn_allocated = 0;
- Elf_Scn *versymscn = NULL;
- Elf_Data *versymdata = NULL;
-
- if (ld_state.need_symtab)
- {
- /* First create the symbol table. We need the symbol section itself
- and the string table for it. */
- symscn = elf_newscn (ld_state.outelf);
- ld_state.symscnidx = elf_ndxscn (symscn);
- symdata = elf_newdata (symscn);
- if (symdata == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot create symbol table for output file: %s"),
- elf_errmsg (-1));
-
- symdata->d_type = ELF_T_SYM;
- /* This is an estimated size, but it will definitely cap the real value.
- We might have to adjust the number later. */
- nsym_allocated = (1 + ld_state.nsymtab + ld_state.nplt + ld_state.ngot
- + ld_state.nusedsections + ld_state.nlscript_syms);
- symdata->d_size = xelf_fsize (ld_state.outelf, ELF_T_SYM,
- nsym_allocated);
-
- /* Optionally the extended section table. */
- /* XXX Is SHN_LORESERVE correct? Do we need some other sections? */
- if (unlikely (ld_state.nusedsections >= SHN_LORESERVE))
- {
- xndxscn = elf_newscn (ld_state.outelf);
- ld_state.xndxscnidx = elf_ndxscn (xndxscn);
-
- xndxdata = elf_newdata (xndxscn);
- if (xndxdata == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot create symbol table for output file: %s"),
- elf_errmsg (-1));
-
- /* The following relies on the fact that Elf32_Word and Elf64_Word
- have the same size. */
- xndxdata->d_type = ELF_T_WORD;
- /* This is an estimated size, but it will definitely cap the
- real value. we might have to adjust the number later. */
- xndxdata->d_size = xelf_fsize (ld_state.outelf, ELF_T_WORD,
- nsym_allocated);
- /* The first entry is left empty, clear it here and now. */
- xndxdata->d_buf = memset (xmalloc (xndxdata->d_size), '\0',
- xelf_fsize (ld_state.outelf, ELF_T_WORD,
- 1));
- xndxdata->d_off = 0;
- /* XXX Should use an ebl function. */
- xndxdata->d_align = sizeof (Elf32_Word);
- }
- }
- else
- {
- assert (ld_state.need_dynsym);
-
- /* First create the symbol table. We need the symbol section itself
- and the string table for it. */
- symscn = elf_getscn (ld_state.outelf, ld_state.dynsymscnidx);
- symdata = elf_newdata (symscn);
- if (symdata == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot create symbol table for output file: %s"),
- elf_errmsg (-1));
-
- symdata->d_version = EV_CURRENT;
- symdata->d_type = ELF_T_SYM;
- /* This is an estimated size, but it will definitely cap the real value.
- We might have to adjust the number later. */
- nsym_allocated = (1 + ld_state.nsymtab + ld_state.nplt + ld_state.ngot
- - ld_state.nlocalsymbols + ld_state.nlscript_syms);
- symdata->d_size = xelf_fsize (ld_state.outelf, ELF_T_SYM,
- nsym_allocated);
- }
-
- /* The first entry is left empty, clear it here and now. */
- symdata->d_buf = memset (xmalloc (symdata->d_size), '\0',
- xelf_fsize (ld_state.outelf, ELF_T_SYM, 1));
- symdata->d_off = 0;
- /* XXX This is ugly but how else can it be done. */
- symdata->d_align = xelf_fsize (ld_state.outelf, ELF_T_ADDR, 1);
-
- /* Allocate another array to keep track of the handles for the symbol
- names. */
- symstrent = (struct Ebl_Strent **) xcalloc (nsym_allocated,
- sizeof (struct Ebl_Strent *));
-
- /* By starting at 1 we effectively add a null entry. */
- nsym = 1;
-
- /* Iteration over all sections. */
- for (cnt = 0; cnt < ld_state.nallsections; ++cnt)
- {
- struct scnhead *head = ld_state.allsections[cnt];
- Elf_Scn *scn;
- struct scninfo *runp;
- XElf_Off offset;
- Elf32_Word xndx;
-
- /* Don't handle unused sections at all. */
- if (!head->used)
- continue;
-
- /* Get the section handle. */
- scn = elf_getscn (ld_state.outelf, head->scnidx);
-
- if (unlikely (head->kind == scn_dot_interp))
- {
- Elf_Data *outdata = elf_newdata (scn);
- if (outdata == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot create section for output file: %s"),
- elf_errmsg (-1));
-
- /* This is the string we'll put in the section. */
- const char *interp = ld_state.interp ?: "/lib/ld.so.1";
-
- /* Create the section data. */
- outdata->d_buf = (void *) interp;
- outdata->d_size = strlen (interp) + 1;
- outdata->d_type = ELF_T_BYTE;
- outdata->d_off = 0;
- outdata->d_align = 1;
- outdata->d_version = EV_CURRENT;
-
- /* Remember the index of this section. */
- ld_state.interpscnidx = head->scnidx;
-
- continue;
- }
-
- if (unlikely (head->kind == scn_dot_got))
- {
- /* Remember the index of this section. */
- ld_state.gotscnidx = elf_ndxscn (scn);
-
- /* Give the backend the change to initialize the section. */
- INITIALIZE_GOT (&ld_state, scn);
-
- continue;
- }
-
- if (unlikely (head->kind == scn_dot_gotplt))
- {
- /* Remember the index of this section. */
- ld_state.gotpltscnidx = elf_ndxscn (scn);
-
- /* Give the backend the change to initialize the section. */
- INITIALIZE_GOTPLT (&ld_state, scn);
-
- continue;
- }
-
- if (unlikely (head->kind == scn_dot_dynrel))
- {
- Elf_Data *outdata;
-
- outdata = elf_newdata (scn);
- if (outdata == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot create section for output file: %s"),
- elf_errmsg (-1));
-
- outdata->d_size = ld_state.relsize_total;
- outdata->d_buf = xmalloc (outdata->d_size);
- outdata->d_type = (REL_TYPE (&ld_state) == DT_REL
- ? ELF_T_REL : ELF_T_RELA);
- outdata->d_off = 0;
- outdata->d_align = xelf_fsize (ld_state.outelf, ELF_T_ADDR, 1);
-
- /* Remember the index of this section. */
- ld_state.reldynscnidx = elf_ndxscn (scn);
-
- continue;
- }
-
- if (unlikely (head->kind == scn_dot_dynamic))
- {
- /* Only create the data for now. */
- Elf_Data *outdata;
-
- /* Account for a few more entries we have to add. */
- if (ld_state.dt_flags != 0)
- ++ld_state.ndynamic;
- if (ld_state.dt_flags_1 != 0)
- ++ld_state.ndynamic;
- if (ld_state.dt_feature_1 != 0)
- ++ld_state.ndynamic;
-
- outdata = elf_newdata (scn);
- if (outdata == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot create section for output file: %s"),
- elf_errmsg (-1));
-
- /* Create the section data. */
- outdata->d_size = xelf_fsize (ld_state.outelf, ELF_T_DYN,
- ld_state.ndynamic);
- outdata->d_buf = xcalloc (1, outdata->d_size);
- outdata->d_type = ELF_T_DYN;
- outdata->d_off = 0;
- outdata->d_align = xelf_fsize (ld_state.outelf, ELF_T_ADDR, 1);
-
- /* Remember the index of this section. */
- ld_state.dynamicscnidx = elf_ndxscn (scn);
-
- continue;
- }
-
- if (unlikely (head->kind == scn_dot_dynsym))
- {
- /* We already know the section index. */
- assert (ld_state.dynsymscnidx == elf_ndxscn (scn));
-
- continue;
- }
-
- if (unlikely (head->kind == scn_dot_dynstr))
- {
- /* Remember the index of this section. */
- ld_state.dynstrscnidx = elf_ndxscn (scn);
-
- /* Create the string table. */
- dynstrtab = ebl_strtabinit (true);
-
- /* XXX TBI
- We have to add all the strings which are needed in the
- dynamic section here. This means DT_FILTER,
- DT_AUXILIARY, ... entries. */
- if (ld_state.ndsofiles > 0)
- {
- struct usedfiles *frunp = ld_state.dsofiles;
-
- do
- if (! frunp->as_needed || frunp->used)
- frunp->sonameent = ebl_strtabadd (dynstrtab, frunp->soname,
- 0);
- while ((frunp = frunp->next) != ld_state.dsofiles);
- }
-
-
- /* Add the runtime path information. The strings are stored
- in the .dynstr section. If both rpath and runpath are defined
- the runpath information is used. */
- if (ld_state.runpath != NULL || ld_state.rpath != NULL)
- {
- struct pathelement *startp;
- struct pathelement *prunp;
- int tag;
- size_t len;
- char *str;
- char *cp;
-
- if (ld_state.runpath != NULL)
- {
- startp = ld_state.runpath;
- tag = DT_RUNPATH;
- }
- else
- {
- startp = ld_state.rpath;
- tag = DT_RPATH;
- }
-
- /* Determine how long the string will be. */
- for (len = 0, prunp = startp; prunp != NULL; prunp = prunp->next)
- len += strlen (prunp->pname) + 1;
-
- cp = str = (char *) obstack_alloc (&ld_state.smem, len);
- /* Copy the string. */
- for (prunp = startp; prunp != NULL; prunp = prunp->next)
- {
- cp = stpcpy (cp, prunp->pname);
- *cp++ = ':';
- }
- /* Remove the last colon. */
- cp[-1] = '\0';
-
- /* Remember the values until we can generate the dynamic
- section. */
- ld_state.rxxpath_strent = ebl_strtabadd (dynstrtab, str, len);
- ld_state.rxxpath_tag = tag;
- }
-
- continue;
- }
-
- if (unlikely (head->kind == scn_dot_hash))
- {
- /* Remember the index of this section. */
- ld_state.hashscnidx = elf_ndxscn (scn);
-
- continue;
- }
-
- if (unlikely (head->kind == scn_dot_gnu_hash))
- {
- /* Remember the index of this section. */
- ld_state.gnuhashscnidx = elf_ndxscn (scn);
-
- continue;
- }
-
- if (unlikely (head->kind == scn_dot_plt))
- {
- /* Remember the index of this section. */
- ld_state.pltscnidx = elf_ndxscn (scn);
-
- /* Give the backend the change to initialize the section. */
- INITIALIZE_PLT (&ld_state, scn);
-
- continue;
- }
-
- if (unlikely (head->kind == scn_dot_pltrel))
- {
- /* Remember the index of this section. */
- ld_state.pltrelscnidx = elf_ndxscn (scn);
-
- /* Give the backend the change to initialize the section. */
- INITIALIZE_PLTREL (&ld_state, scn);
-
- continue;
- }
-
- if (unlikely (head->kind == scn_dot_version))
- {
- /* Remember the index of this section. */
- ld_state.versymscnidx = elf_ndxscn (scn);
-
- continue;
- }
-
- if (unlikely (head->kind == scn_dot_version_r))
- {
- /* Remember the index of this section. */
- ld_state.verneedscnidx = elf_ndxscn (scn);
-
- continue;
- }
-
- if (unlikely (head->kind == scn_dot_note_gnu_build_id))
- {
- /* Remember the index of this section. */
- ld_state.buildidscnidx = elf_ndxscn (scn);
-
- create_build_id_section (scn);
-
- continue;
- }
-
- /* If we come here we must be handling a normal section. */
- assert (head->kind == scn_normal);
-
- /* Create an STT_SECTION entry in the symbol table. But not for
- the symbolic symbol table. */
- if (ld_state.need_symtab)
- {
- /* XXX Can we be cleverer and do this only if needed? */
- XElf_Sym_vardef (sym);
-
- /* Optimization ahead: in the native linker we get a pointer
- to the final location so that the following code writes
- directly in the correct place. Otherwise we write into
- the local variable first. */
- xelf_getsym_ptr (symdata, nsym, sym);
-
- /* Usual section symbol: local, no specific information,
- except the section index. The offset here is zero, the
- start address will later be added. */
- sym->st_name = 0;
- sym->st_info = XELF_ST_INFO (STB_LOCAL, STT_SECTION);
- sym->st_other = 0;
- sym->st_value = 0;
- sym->st_size = 0;
- /* In relocatable files the section index can be too big for
- the ElfXX_Sym struct. we have to deal with the extended
- symbol table. */
- if (likely (head->scnidx < SHN_LORESERVE))
- {
- sym->st_shndx = head->scnidx;
- xndx = 0;
- }
- else
- {
- sym->st_shndx = SHN_XINDEX;
- xndx = head->scnidx;
- }
- /* Commit the change. See the optimization above, this does
- not change the symbol table entry. But the extended
- section index table entry is always written, if there is
- such a table. */
- assert (nsym < nsym_allocated);
- xelf_update_symshndx (symdata, xndxdata, nsym, sym, xndx, 0);
-
- /* Remember the symbol's index in the symbol table. */
- head->scnsymidx = nsym++;
- }
-
- if (head->type == SHT_REL || head->type == SHT_RELA)
- {
- /* Remember that we have to fill in the symbol table section
- index. */
- if (ld_state.file_type == relocatable_file_type)
- {
- struct scnlist *newp;
-
- newp = (struct scnlist *) alloca (sizeof (*newp));
- newp->scnidx = head->scnidx;
- newp->scninfo = head->last->next;
-#ifndef NDEBUG
- newp->next = NULL;
-#endif
- SNGL_LIST_PUSH (rellist, newp);
- }
- else
- {
- /* When we create an executable or a DSO we don't simply
- copy the existing relocations. Instead many will be
- resolved, others will be converted. Create a data buffer
- large enough to contain the contents which we will fill
- in later. */
- int type = head->type == SHT_REL ? ELF_T_REL : ELF_T_RELA;
-
- data = elf_newdata (scn);
- if (data == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot create section for output file: %s"),
- elf_errmsg (-1));
-
- data->d_size = xelf_fsize (ld_state.outelf, type, head->relsize);
- data->d_buf = xcalloc (data->d_size, 1);
- data->d_type = type;
- data->d_align = xelf_fsize (ld_state.outelf, ELF_T_ADDR, 1);
- data->d_off = 0;
-
- continue;
- }
- }
-
- /* Recognize string and merge flag and handle them. */
- if (head->flags & SHF_MERGE)
- {
- /* We merge the contents of the sections. For this we do
- not look at the contents of section directly. Instead we
- look at the symbols of the section. */
- Elf_Data *outdata;
-
- /* Concatenate the lists of symbols for all sections.
-
- XXX In case any input section has no symbols associated
- (this happens for debug sections) we cannot use this
- method. Implement parsing the other debug sections and
- find the string pointers. For now we don't merge. */
- runp = head->last->next;
- if (runp->symbols == NULL)
- {
- head->flags &= ~SHF_MERGE;
- goto no_merge;
- }
- head->symbols = runp->symbols;
-
- while ((runp = runp->next) != head->last->next)
- {
- if (runp->symbols == NULL)
- {
- head->flags &= ~SHF_MERGE;
- head->symbols = NULL;
- goto no_merge;
- }
-
- struct symbol *oldhead = head->symbols->next_in_scn;
-
- head->symbols->next_in_scn = runp->symbols->next_in_scn;
- runp->symbols->next_in_scn = oldhead;
- head->symbols = runp->symbols;
- }
-
- /* Create the output section. */
- outdata = elf_newdata (scn);
- if (outdata == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot create section for output file: %s"),
- elf_errmsg (-1));
-
- /* We use different merging algorithms for performance
- reasons. We can easily handle single-byte and
- wchar_t-wide character strings. All other cases (which
- really should happen in real life) are handled by the
- generic code. */
- if (SCNINFO_SHDR (head->last->shdr).sh_entsize == 1
- && (head->flags & SHF_STRINGS))
- {
- /* Simple, single-byte string matching. */
- struct Ebl_Strtab *mergestrtab;
- struct symbol *symrunp;
- Elf_Data *locsymdata = NULL;
- Elf_Data *locdata = NULL;
-
- mergestrtab = ebl_strtabinit (false);
-
- symrunp = head->symbols->next_in_scn;
- file = NULL;
- do
- {
- /* Accelarate the loop. We cache the file
- information since it might very well be the case
- that the previous entry was from the same
- file. */
- if (symrunp->file != file)
- {
- /* Remember the file. */
- file = symrunp->file;
- /* Symbol table data from that file. */
- locsymdata = file->symtabdata;
- /* String section data. */
- locdata = elf_rawdata (file->scninfo[symrunp->scndx].scn,
- NULL);
- assert (locdata != NULL);
- /* While we are at it, remember the output
- section. If we don't access the string data
- section the section won't be in the output
- file. So it is sufficient to do the work
- here. */
- file->scninfo[symrunp->scndx].outscnndx = head->scnidx;
- }
-
- /* Get the symbol information. This provides us the
- offset into the string data section. */
- XElf_Sym_vardef (sym);
- xelf_getsym (locsymdata, symrunp->symidx, sym);
- assert (sym != NULL);
-
- /* Get the data from the file. Note that we access
- the raw section data; no endian-ness issues with
- single-byte strings. */
- symrunp->merge.handle
- = ebl_strtabadd (mergestrtab,
- (char *) locdata->d_buf + sym->st_value,
- 0);
- }
- while ((symrunp = symrunp->next_in_scn)
- != head->symbols->next_in_scn);
-
- /* All strings have been added. Create the final table. */
- ebl_strtabfinalize (mergestrtab, outdata);
-
- /* Compute the final offsets in the section. */
- symrunp = runp->symbols;
- do
- {
- symrunp->merge.value
- = ebl_strtaboffset (symrunp->merge.handle);
- symrunp->merged = 1;
- }
- while ((symrunp = symrunp->next_in_scn) != runp->symbols);
-
- /* We don't need the string table anymore. */
- ebl_strtabfree (mergestrtab);
- }
- else if (likely (SCNINFO_SHDR (head->last->shdr).sh_entsize
- == sizeof (wchar_t))
- && likely (head->flags & SHF_STRINGS))
- {
- /* Simple, wchar_t string merging. */
- struct Ebl_WStrtab *mergestrtab;
- struct symbol *symrunp;
- Elf_Data *locsymdata = NULL;
- Elf_Data *locdata = NULL;
-
- mergestrtab = ebl_wstrtabinit (false);
-
- symrunp = runp->symbols;
- file = NULL;
- do
- {
- /* Accelarate the loop. We cache the file
- information since it might very well be the case
- that the previous entry was from the same
- file. */
- if (symrunp->file != file)
- {
- /* Remember the file. */
- file = symrunp->file;
- /* Symbol table data from that file. */
- locsymdata = file->symtabdata;
- /* String section data. */
- locdata = elf_rawdata (file->scninfo[symrunp->scndx].scn,
- NULL);
- assert (locdata != NULL);
-
- /* While we are at it, remember the output
- section. If we don't access the string data
- section the section won't be in the output
- file. So it is sufficient to do the work
- here. */
- file->scninfo[symrunp->scndx].outscnndx = head->scnidx;
- }
-
- /* Get the symbol information. This provides us the
- offset into the string data section. */
- XElf_Sym_vardef (sym);
- xelf_getsym (locsymdata, symrunp->symidx, sym);
- assert (sym != NULL);
-
- /* Get the data from the file. Using the raw
- section data here is possible since we don't
- interpret the string themselves except for
- looking for the wide NUL character. The NUL
- character has fortunately the same representation
- regardless of the byte order. */
- symrunp->merge.handle
- = ebl_wstrtabadd (mergestrtab,
- (wchar_t *) ((char *) locdata->d_buf
- + sym->st_value), 0);
- }
- while ((symrunp = symrunp->next_in_scn) != runp->symbols);
-
- /* All strings have been added. Create the final table. */
- ebl_wstrtabfinalize (mergestrtab, outdata);
-
- /* Compute the final offsets in the section. */
- symrunp = runp->symbols;
- do
- {
- symrunp->merge.value
- = ebl_wstrtaboffset (symrunp->merge.handle);
- symrunp->merged = 1;
- }
- while ((symrunp = symrunp->next_in_scn) != runp->symbols);
-
- /* We don't need the string table anymore. */
- ebl_wstrtabfree (mergestrtab);
- }
- else
- {
- /* Non-standard merging. */
- struct Ebl_GStrtab *mergestrtab;
- struct symbol *symrunp;
- Elf_Data *locsymdata = NULL;
- Elf_Data *locdata = NULL;
- /* If this is no string section the length of each "string"
- is always one. */
- unsigned int len = (head->flags & SHF_STRINGS) ? 0 : 1;
-
- /* This is the generic string table functionality. Much
- slower than the specialized code. */
- mergestrtab
- = ebl_gstrtabinit (SCNINFO_SHDR (head->last->shdr).sh_entsize,
- false);
-
- symrunp = runp->symbols;
- file = NULL;
- do
- {
- /* Accelarate the loop. We cache the file
- information since it might very well be the case
- that the previous entry was from the same
- file. */
- if (symrunp->file != file)
- {
- /* Remember the file. */
- file = symrunp->file;
- /* Symbol table data from that file. */
- locsymdata = file->symtabdata;
- /* String section data. */
- locdata = elf_rawdata (file->scninfo[symrunp->scndx].scn,
- NULL);
- assert (locdata != NULL);
-
- /* While we are at it, remember the output
- section. If we don't access the string data
- section the section won't be in the output
- file. So it is sufficient to do the work
- here. */
- file->scninfo[symrunp->scndx].outscnndx = head->scnidx;
- }
-
- /* Get the symbol information. This provides us the
- offset into the string data section. */
- XElf_Sym_vardef (sym);
- xelf_getsym (locsymdata, symrunp->symidx, sym);
- assert (sym != NULL);
-
- /* Get the data from the file. Using the raw
- section data here is possible since we don't
- interpret the string themselves except for
- looking for the wide NUL character. The NUL
- character has fortunately the same representation
- regardless of the byte order. */
- symrunp->merge.handle
- = ebl_gstrtabadd (mergestrtab,
- (char *) locdata->d_buf + sym->st_value,
- len);
- }
- while ((symrunp = symrunp->next_in_scn) != runp->symbols);
-
- /* Create the final table. */
- ebl_gstrtabfinalize (mergestrtab, outdata);
-
- /* Compute the final offsets in the section. */
- symrunp = runp->symbols;
- do
- {
- symrunp->merge.value
- = ebl_gstrtaboffset (symrunp->merge.handle);
- symrunp->merged = 1;
- }
- while ((symrunp = symrunp->next_in_scn) != runp->symbols);
-
- /* We don't need the string table anymore. */
- ebl_gstrtabfree (mergestrtab);
- }
- }
- else
- {
- no_merge:
- assert (head->scnidx == elf_ndxscn (scn));
-
- /* It is important to start with the first list entry (and
- not just any one) to add the sections in the correct
- order. */
- runp = head->last->next;
- offset = 0;
- do
- {
- Elf_Data *outdata = elf_newdata (scn);
- if (outdata == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot create section for output file: %s"),
- elf_errmsg (-1));
-
- /* Exceptional case: if we synthesize a data block SCN
- is NULL and the sectio header info must be for a
- SHT_NOBITS block and the size and alignment are
- filled in. */
- if (likely (runp->scn != NULL))
- {
- data = elf_getdata (runp->scn, NULL);
- assert (data != NULL);
-
- /* We reuse the data buffer in the input file. */
- *outdata = *data;
-
- /* Given that we read the input file from disk we know there
- cannot be another data part. */
- assert (elf_getdata (runp->scn, data) == NULL);
- }
- else
- {
- /* Must be a NOBITS section. */
- assert (SCNINFO_SHDR (runp->shdr).sh_type == SHT_NOBITS);
-
- outdata->d_buf = NULL; /* Not needed. */
- outdata->d_type = ELF_T_BYTE;
- outdata->d_version = EV_CURRENT;
- outdata->d_size = SCNINFO_SHDR (runp->shdr).sh_size;
- outdata->d_align = SCNINFO_SHDR (runp->shdr).sh_addralign;
- }
-
- XElf_Off align = MAX (1, outdata->d_align);
- assert (powerof2 (align));
- offset = ((offset + align - 1) & ~(align - 1));
-
- runp->offset = offset;
- runp->outscnndx = head->scnidx;
- runp->allsectionsidx = cnt;
-
- outdata->d_off = offset;
-
- offset += outdata->d_size;
- }
- while ((runp = runp->next) != head->last->next);
-
- /* If necessary add the additional line to the .comment section. */
- if (ld_state.add_ld_comment
- && head->flags == 0
- && head->type == SHT_PROGBITS
- && strcmp (head->name, ".comment") == 0
- && head->entsize == 0)
- {
- Elf_Data *outdata = elf_newdata (scn);
-
- if (outdata == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot create section for output file: %s"),
- elf_errmsg (-1));
-
- outdata->d_buf = (void *) "\0ld (" PACKAGE_NAME ") " PACKAGE_VERSION;
- outdata->d_size = strlen ((char *) outdata->d_buf + 1) + 2;
- outdata->d_off = offset;
- outdata->d_type = ELF_T_BYTE;
- outdata->d_align = 1;
- }
- /* XXX We should create a .comment section if none exists.
- This requires that we early on detect that no such
- section exists. This should probably be implemented
- together with some merging of the section contents.
- Currently identical entries are not merged. */
- }
- }
-
- /* The table we collect the strings in. */
- strtab = ebl_strtabinit (true);
- if (strtab == NULL)
- error (EXIT_FAILURE, errno, gettext ("cannot create string table"));
-
-
-#ifndef NDEBUG
- /* Keep track of the use of the XINDEX. */
- need_xndx = false;
-#endif
-
- /* We we generate a normal symbol table for an executable and the
- --export-dynamic option is not given, we need an extra table
- which keeps track of the symbol entry belonging to the symbol
- table entry. Note that EXPORT_ALL_DYNAMIC is always set if we
- generate a DSO so we do not have to test this separately. */
- ndxtosym = (struct symbol **) xcalloc (nsym_allocated,
- sizeof (struct symbol));
-
- /* Create the special symbol for the GOT section. */
- if (ld_state.got_symbol != NULL)
- {
- assert (nsym < nsym_allocated);
- // XXX Fix so that it works even if no PLT is needed.
- fillin_special_symbol (ld_state.got_symbol, ld_state.gotpltscnidx,
- nsym++, symdata, strtab);
- }
-
- /* Similarly for the dynamic section symbol. */
- if (ld_state.dyn_symbol != NULL)
- {
- assert (nsym < nsym_allocated);
- fillin_special_symbol (ld_state.dyn_symbol, ld_state.dynamicscnidx,
- nsym++, symdata, strtab);
- }
-
- /* Create symbol table entries for the symbols defined in the linker
- script. */
- if (ld_state.lscript_syms != NULL)
- {
- struct symbol *rsym = ld_state.lscript_syms;
- do
- {
- assert (nsym < nsym_allocated);
- fillin_special_symbol (rsym, SHN_ABS, nsym++, symdata, strtab);
- }
- while ((rsym = rsym->next) != NULL);
- }
-
- /* Iterate over all input files to collect the symbols. */
- file = ld_state.relfiles->next;
- symdata = elf_getdata (elf_getscn (ld_state.outelf, ld_state.symscnidx),
- NULL);
-
- do
- {
- size_t maxcnt;
- Elf_Data *insymdata;
- Elf_Data *inxndxdata;
-
- /* There must be no dynamic symbol table when creating
- relocatable files. */
- assert (ld_state.file_type != relocatable_file_type
- || file->dynsymtabdata == NULL);
-
- insymdata = file->symtabdata;
- assert (insymdata != NULL);
- inxndxdata = file->xndxdata;
-
- maxcnt = file->nsymtab;
-
- file->symindirect = (Elf32_Word *) xcalloc (maxcnt, sizeof (Elf32_Word));
-
- /* The dynamic symbol table does not contain local symbols. So
- we skip those entries. */
- for (cnt = ld_state.need_symtab ? 1 : file->nlocalsymbols; cnt < maxcnt;
- ++cnt)
- {
- XElf_Sym_vardef (sym);
- Elf32_Word xndx;
- struct symbol *defp = NULL;
-
- xelf_getsymshndx (insymdata, inxndxdata, cnt, sym, xndx);
- assert (sym != NULL);
-
- if (unlikely (XELF_ST_TYPE (sym->st_info) == STT_SECTION))
- {
- /* Section symbols should always be local but who knows... */
- if (ld_state.need_symtab)
- {
- /* Determine the real section index in the source file.
- Use the XINDEX section content if necessary. We don't
- add this information to the dynamic symbol table. */
- if (sym->st_shndx != SHN_XINDEX)
- xndx = sym->st_shndx;
-
- assert (file->scninfo[xndx].allsectionsidx
- < ld_state.nallsections);
- file->symindirect[cnt] = ld_state.allsections[file->scninfo[xndx].allsectionsidx]->scnsymidx;
- /* Note that the resulting index can be zero here. There is
- no guarantee that the output file will contain all the
- sections the input file did. */
- }
- continue;
- }
-
- if ((ld_state.strip >= strip_all || !ld_state.need_symtab)
- /* XXX Do we need these entries? */
- && XELF_ST_TYPE (sym->st_info) == STT_FILE)
- continue;
-
-#if NATIVE_ELF != 0
- /* Copy old data. We create a temporary copy because the
- symbol might still be discarded. */
- XElf_Sym sym_mem;
- sym_mem = *sym;
- sym = &sym_mem;
-#endif
-
- if (sym->st_shndx != SHN_UNDEF
- && (sym->st_shndx < SHN_LORESERVE
- || sym->st_shndx == SHN_XINDEX))
- {
- /* If we are creating an executable with no normal
- symbol table and we do not export all symbols and
- this symbol is not defined in a DSO as well, ignore
- it. */
- if (!ld_state.export_all_dynamic && !ld_state.need_symtab)
- {
- assert (cnt >= file->nlocalsymbols);
- defp = file->symref[cnt];
- assert (defp != NULL);
-
- if (!defp->in_dso)
- /* Ignore it. */
- continue;
- }
-
- /* Determine the real section index in the source file. Use
- the XINDEX section content if necessary. */
- if (sym->st_shndx != SHN_XINDEX)
- xndx = sym->st_shndx;
-
- sym->st_value += file->scninfo[xndx].offset;
-
- assert (file->scninfo[xndx].outscnndx < SHN_LORESERVE
- || file->scninfo[xndx].outscnndx > SHN_HIRESERVE);
- if (unlikely (file->scninfo[xndx].outscnndx > SHN_LORESERVE))
- {
- /* It is not possible to have an extended section index
- table for the dynamic symbol table. */
- if (!ld_state.need_symtab)
- error (EXIT_FAILURE, 0, gettext ("\
-section index too large in dynamic symbol table"));
-
- assert (xndxdata != NULL);
- sym->st_shndx = SHN_XINDEX;
- xndx = file->scninfo[xndx].outscnndx;
-#ifndef NDEBUG
- need_xndx = true;
-#endif
- }
- else
- {
- sym->st_shndx = file->scninfo[xndx].outscnndx;
- xndx = 0;
- }
- }
- else if (sym->st_shndx == SHN_COMMON || sym->st_shndx == SHN_UNDEF)
- {
- /* Check whether we have a (real) definition for this
- symbol. If this is the case we skip this symbol
- table entry. */
- assert (cnt >= file->nlocalsymbols);
- defp = file->symref[cnt];
- assert (defp != NULL);
-
- assert (sym->st_shndx != SHN_COMMON || defp->defined);
-
- if ((sym->st_shndx == SHN_COMMON && !defp->common)
- || (sym->st_shndx == SHN_UNDEF && defp->defined)
- || defp->added)
- /* Ignore this symbol table entry, there is a
- "better" one or we already added it. */
- continue;
-
- /* Remember that we already added this symbol. */
- defp->added = 1;
-
- /* Adjust the section number for common symbols. */
- if (sym->st_shndx == SHN_COMMON)
- {
- sym->st_value = (ld_state.common_section->offset
- + file->symref[cnt]->merge.value);
- assert (ld_state.common_section->outscnndx < SHN_LORESERVE);
- sym->st_shndx = ld_state.common_section->outscnndx;
- xndx = 0;
- }
- }
- else if (unlikely (sym->st_shndx != SHN_ABS))
- {
- if (SPECIAL_SECTION_NUMBER_P (&ld_state, sym->st_shndx))
- /* XXX Add code to handle machine specific special
- sections. */
- abort ();
- }
-
- /* Add the symbol name to the string table. If the user
- chooses the highest level of stripping avoid adding names
- for local symbols in the string table. */
- if (sym->st_name != 0
- && (ld_state.strip < strip_everything
- || XELF_ST_BIND (sym->st_info) != STB_LOCAL))
- symstrent[nsym] = ebl_strtabadd (strtab,
- elf_strptr (file->elf,
- file->symstridx,
- sym->st_name), 0);
-
- /* Once we know the name this field will get the correct
- offset. For now set it to zero which means no name
- associated. */
- GElf_Word st_name = sym->st_name;
- sym->st_name = 0;
-
- /* If we had to merge sections we have a completely new
- offset for the symbol. */
- if (file->has_merge_sections && file->symref[cnt] != NULL
- && file->symref[cnt]->merged)
- sym->st_value = file->symref[cnt]->merge.value;
-
- /* Create the record in the output sections. */
- assert (nsym < nsym_allocated);
- xelf_update_symshndx (symdata, xndxdata, nsym, sym, xndx, 1);
-
- /* Add the reference to the symbol record in case we need it.
- Find the symbol if this has not happened yet. We do
- not need the information for local symbols. */
- if (defp == NULL && cnt >= file->nlocalsymbols)
- {
- defp = file->symref[cnt];
-
- if (defp == NULL)
- {
- /* This is a symbol in a discarded COMDAT section.
- Find the definition we actually use. */
- // XXX The question is: do we have to do this here
- // XXX or can we do it earlier when we discard the
- // XXX section.
- struct symbol search;
- search.name = elf_strptr (file->elf, file->symstridx,
- st_name);
- struct symbol *realp
- = ld_symbol_tab_find (&ld_state.symbol_tab,
- elf_hash (search.name), &search);
- if (realp == NULL)
- // XXX What to do here?
- error (EXIT_FAILURE, 0,
- "couldn't find symbol from COMDAT section");
-
- file->symref[cnt] = realp;
-
- continue;
- }
- }
-
- /* Store the reference to the symbol record. The sorting
- code will have to keep this array in the correct order, too. */
- ndxtosym[nsym] = defp;
-
- /* One more entry finished. */
- if (cnt >= file->nlocalsymbols)
- {
- assert (file->symref[cnt]->outsymidx == 0);
- file->symref[cnt]->outsymidx = nsym;
- }
- file->symindirect[cnt] = nsym++;
- }
- }
- while ((file = file->next) != ld_state.relfiles->next);
- /* Make sure we didn't create the extended section index table for
- nothing. */
- assert (xndxdata == NULL || need_xndx);
-
- /* Create the version related sections. */
- if (ld_state.verneedscnidx != 0)
- {
- /* We know the number of input files and total number of
- referenced versions. This allows us to allocate the memory
- and then we iterate over the DSOs to get the version
- information. */
- struct usedfiles *runp;
-
- runp = ld_state.dsofiles->next;
- do
- allocate_version_names (runp, dynstrtab);
- while ((runp = runp->next) != ld_state.dsofiles->next);
-
- if (ld_state.needed != NULL)
- {
- runp = ld_state.needed->next;
- do
- allocate_version_names (runp, dynstrtab);
- while ((runp = runp->next) != ld_state.needed->next);
- }
- }
-
- /* At this point we should hide symbols and so on. */
- if (ld_state.default_bind_local || ld_state.version_str_tab.filled > 0)
- /* XXX Add one more test when handling of wildcard symbol names
- is supported. */
- {
- /* Check all non-local symbols whether they are on the export list. */
- bool any_reduced = false;
-
- for (cnt = 1; cnt < nsym; ++cnt)
- {
- XElf_Sym_vardef (sym);
-
- /* Note that we don't have to use 'xelf_getsymshndx' since we
- only need the binding and the symbol name. */
- xelf_getsym (symdata, cnt, sym);
- assert (sym != NULL);
-
- if (reduce_symbol_p (sym, symstrent[cnt]))
- {
- // XXX Check whether this is correct...
- assert (ndxtosym[cnt]->outdynsymidx != 0);
- ndxtosym[cnt]->outdynsymidx = 0;
-
- sym->st_info = XELF_ST_INFO (STB_LOCAL,
- XELF_ST_TYPE (sym->st_info));
- (void) xelf_update_sym (symdata, cnt, sym);
-
- /* Show that we don't need this string anymore. */
- if (ld_state.strip == strip_everything)
- {
- symstrent[cnt] = NULL;
- any_reduced = true;
- }
- }
- }
-
- if (unlikely (any_reduced))
- {
- /* Since we will not write names of local symbols in the
- output file and we have reduced the binding of some
- symbols the string table previously constructed contains
- too many string. Correct it. */
- struct Ebl_Strtab *newp = ebl_strtabinit (true);
-
- for (cnt = 1; cnt < nsym; ++cnt)
- if (symstrent[cnt] != NULL)
- symstrent[cnt] = ebl_strtabadd (newp,
- ebl_string (symstrent[cnt]), 0);
-
- ebl_strtabfree (strtab);
- strtab = newp;
- }
- }
-
- /* Add the references to DSOs. We can add these entries this late
- (after sorting out versioning) because references to DSOs are not
- effected. */
- if (ld_state.from_dso != NULL)
- {
- struct symbol *runp;
- size_t plt_base = nsym + ld_state.nfrom_dso - ld_state.nplt;
- size_t plt_idx = 0;
- size_t obj_idx = 0;
-
- assert (ld_state.nfrom_dso >= ld_state.nplt);
- runp = ld_state.from_dso;
- do
- {
- // XXX What about functions which are only referenced via
- // pointers and not PLT entries? Can we distinguish such uses?
- size_t idx;
- if (runp->type == STT_FUNC)
- {
- /* Store the PLT entry number. */
- runp->merge.value = plt_idx + 1;
- idx = plt_base + plt_idx++;
- }
- else
- idx = nsym + obj_idx++;
-
- XElf_Sym_vardef (sym);
- xelf_getsym_ptr (symdata, idx, sym);
-
- sym->st_value = 0;
- sym->st_size = runp->size;
- sym->st_info = XELF_ST_INFO (runp->weak ? STB_WEAK : STB_GLOBAL,
- runp->type);
- sym->st_other = STV_DEFAULT;
- sym->st_shndx = SHN_UNDEF;
-
- /* Create the record in the output sections. */
- xelf_update_symshndx (symdata, xndxdata, idx, sym, 0, 0);
-
- const char *name = runp->name;
- size_t namelen = 0;
-
- if (runp->file->verdefdata != NULL)
- {
- // XXX Is it useful to add the versym value to struct symbol?
- XElf_Versym versym;
-
- (void) xelf_getversym_copy (runp->file->versymdata, runp->symidx,
- versym);
-
- /* One can only link with the default version. */
- assert ((versym & 0x8000) == 0);
-
- const char *versname
- = ebl_string (runp->file->verdefent[versym]);
-
- size_t versname_len = strlen (versname) + 1;
- namelen = strlen (name) + versname_len + 2;
- char *newp = (char *) obstack_alloc (&ld_state.smem, namelen);
- memcpy (stpcpy (stpcpy (newp, name), "@@"),
- versname, versname_len);
- name = newp;
- }
-
- symstrent[idx] = ebl_strtabadd (strtab, name, namelen);
-
- /* Record the initial index in the symbol table. */
- runp->outsymidx = idx;
-
- /* Remember the symbol record this ELF symbol came from. */
- ndxtosym[idx] = runp;
- }
- while ((runp = runp->next) != ld_state.from_dso);
-
- assert (nsym + obj_idx == plt_base);
- assert (plt_idx == ld_state.nplt);
- nsym = plt_base + plt_idx;
- }
-
- /* Now we know how many symbols will be in the output file. Adjust
- the count in the section data. */
- symdata->d_size = xelf_fsize (ld_state.outelf, ELF_T_SYM, nsym);
- if (unlikely (xndxdata != NULL))
- xndxdata->d_size = xelf_fsize (ld_state.outelf, ELF_T_WORD, nsym);
-
- /* Create the symbol string table section. */
- strscn = elf_newscn (ld_state.outelf);
- ld_state.strscnidx = elf_ndxscn (strscn);
- data = elf_newdata (strscn);
- xelf_getshdr (strscn, shdr);
- if (data == NULL || shdr == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot create section for output file: %s"),
- elf_errmsg (-1));
-
- /* Create a compact string table, allocate the memory for it, and
- fill in the section data information. */
- ebl_strtabfinalize (strtab, data);
-
- shdr->sh_type = SHT_STRTAB;
- assert (shdr->sh_entsize == 0);
-
- if (unlikely (xelf_update_shdr (strscn, shdr) == 0))
- error (EXIT_FAILURE, 0,
- gettext ("cannot create section for output file: %s"),
- elf_errmsg (-1));
-
- /* Fill in the offsets of the symbol names. */
- for (cnt = 1; cnt < nsym; ++cnt)
- if (symstrent[cnt] != NULL)
- {
- XElf_Sym_vardef (sym);
-
- /* Note that we don't have to use 'xelf_getsymshndx' since we don't
- modify the section index. */
- xelf_getsym (symdata, cnt, sym);
- /* This better worked, we did it before. */
- assert (sym != NULL);
- sym->st_name = ebl_strtaboffset (symstrent[cnt]);
- (void) xelf_update_sym (symdata, cnt, sym);
- }
-
- /* Since we are going to reorder the symbol table but still have to
- be able to find the new position based on the old one (since the
- latter is stored in 'symindirect' information of the input file
- data structure) we have to create yet another indirection
- table. */
- ld_state.dblindirect = dblindirect
- = (Elf32_Word *) xmalloc (nsym * sizeof (Elf32_Word));
-
- /* Sort the symbol table so that the local symbols come first. */
- /* XXX We don't use stable sorting here. It seems not necessary and
- would be more expensive. If it turns out to be necessary this can
- be fixed easily. */
- nsym_local = 1;
- cnt = nsym - 1;
- while (nsym_local < cnt)
- {
- XElf_Sym_vardef (locsym);
- Elf32_Word locxndx;
- XElf_Sym_vardef (globsym);
- Elf32_Word globxndx;
-
- do
- {
- xelf_getsymshndx (symdata, xndxdata, nsym_local, locsym, locxndx);
- /* This better works. */
- assert (locsym != NULL);
-
- if (XELF_ST_BIND (locsym->st_info) != STB_LOCAL
- && (ld_state.need_symtab || ld_state.export_all_dynamic))
- {
- do
- {
- xelf_getsymshndx (symdata, xndxdata, cnt, globsym, globxndx);
- /* This better works. */
- assert (globsym != NULL);
-
- if (unlikely (XELF_ST_BIND (globsym->st_info) == STB_LOCAL))
- {
- /* We swap the two entries. */
-#if NATIVE_ELF != 0
- /* Since we directly modify the data in the ELF
- data structure we have to make a copy of one
- of the entries. */
- XElf_Sym locsym_copy = *locsym;
- locsym = &locsym_copy;
-#endif
- xelf_update_symshndx (symdata, xndxdata, nsym_local,
- globsym, globxndx, 1);
- xelf_update_symshndx (symdata, xndxdata, cnt,
- locsym, locxndx, 1);
-
- /* Also swap the cross references. */
- dblindirect[nsym_local] = cnt;
- dblindirect[cnt] = nsym_local;
-
- /* And the entries for the symbol names. */
- struct Ebl_Strent *strtmp = symstrent[nsym_local];
- symstrent[nsym_local] = symstrent[cnt];
- symstrent[cnt] = strtmp;
-
- /* And the mapping from symbol table entry to
- struct symbol record. */
- struct symbol *symtmp = ndxtosym[nsym_local];
- ndxtosym[nsym_local] = ndxtosym[cnt];
- ndxtosym[cnt] = symtmp;
-
- /* Go to the next entry. */
- ++nsym_local;
- --cnt;
-
- break;
- }
-
- dblindirect[cnt] = cnt;
- }
- while (nsym_local < --cnt);
-
- break;
- }
-
- dblindirect[nsym_local] = nsym_local;
- }
- while (++nsym_local < cnt);
- }
-
- /* The symbol 'nsym_local' is currently pointing to might be local,
- too. Check and increment the variable if this is the case. */
- if (likely (nsym_local < nsym))
- {
- XElf_Sym_vardef (locsym);
-
- /* This entry isn't moved. */
- dblindirect[nsym_local] = nsym_local;
-
- /* Note that it is OK to not use 'xelf_getsymshndx' here. */
- xelf_getsym (symdata, nsym_local, locsym);
- /* This better works. */
- assert (locsym != NULL);
-
- if (XELF_ST_BIND (locsym->st_info) == STB_LOCAL)
- ++nsym_local;
- }
-
-
- /* We need the versym array right away to keep track of the version
- symbols. */
- if (ld_state.versymscnidx != 0)
- {
- /* We allocate more memory than we need since the array is morroring
- the dynamic symbol table and not the normal symbol table. I.e.,
- no local symbols are present. */
- versymscn = elf_getscn (ld_state.outelf, ld_state.versymscnidx);
- versymdata = elf_newdata (versymscn);
- if (versymdata == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot create versioning section: %s"),
- elf_errmsg (-1));
-
- versymdata->d_size = xelf_fsize (ld_state.outelf, ELF_T_HALF,
- nsym - nsym_local + 1);
- versymdata->d_buf = xcalloc (1, versymdata->d_size);
- versymdata->d_align = xelf_fsize (ld_state.outelf, ELF_T_HALF, 1);
- versymdata->d_off = 0;
- versymdata->d_type = ELF_T_HALF;
- }
-
-
- /* If we have to construct the dynamic symbol table we must not include
- the local symbols. If the normal symbol has to be emitted as well
- we haven't done anything else yet and we can construct it from
- scratch now. */
- if (unlikely (!ld_state.need_symtab))
- {
- /* Note that the following code works even if there is no entry
- to remove since the zeroth entry is always local. */
- size_t reduce = xelf_fsize (ld_state.outelf, ELF_T_SYM, nsym_local - 1);
-
- XElf_Sym_vardef (nullsym);
- xelf_getsym_ptr (symdata, nsym_local - 1, nullsym);
-
- /* Note that we don't have to use 'xelf_update_symshndx' since
- this is the dynamic symbol table we write. */
- (void) xelf_update_sym (symdata, nsym_local - 1,
- memset (nullsym, '\0', sizeof (*nullsym)));
-
- /* Update the buffer pointer and size in the output data. */
- symdata->d_buf = (char *) symdata->d_buf + reduce;
- symdata->d_size -= reduce;
-
- /* Add the version symbol information. */
- if (versymdata != NULL)
- {
- nsym_dyn = 1;
- for (cnt = nsym_local; cnt < nsym; ++cnt, ++nsym_dyn)
- {
- struct symbol *symp = ndxtosym[cnt];
-
- if (symp->file->versymdata != NULL)
- {
- GElf_Versym versym;
-
- gelf_getversym (symp->file->versymdata, symp->symidx,
- &versym);
-
- (void) gelf_update_versym (versymdata, symp->outdynsymidx,
- &symp->file->verdefused[versym]);
- }
- }
- }
-
- /* Since we only created the dynamic symbol table the number of
- dynamic symbols is the total number of symbols. */
- nsym_dyn = nsym - nsym_local + 1;
-
- /* XXX TBI. Create whatever data structure is missing. */
- abort ();
- }
- else if (ld_state.need_dynsym)
- {
- /* Create the dynamic symbol table section data along with the
- string table. We look at all non-local symbols we found for
- the normal symbol table and add those. */
- dynsymscn = elf_getscn (ld_state.outelf, ld_state.dynsymscnidx);
- dynsymdata = elf_newdata (dynsymscn);
-
- dynstrdata = elf_newdata (elf_getscn (ld_state.outelf,
- ld_state.dynstrscnidx));
- if (dynsymdata == NULL || dynstrdata == NULL)
- error (EXIT_FAILURE, 0, gettext ("\
-cannot create dynamic symbol table for output file: %s"),
- elf_errmsg (-1));
-
- nsym_dyn_allocated = nsym - nsym_local + 1;
- dynsymdata->d_size = xelf_fsize (ld_state.outelf, ELF_T_SYM,
- nsym_dyn_allocated);
- dynsymdata->d_buf = memset (xmalloc (dynsymdata->d_size), '\0',
- xelf_fsize (ld_state.outelf, ELF_T_SYM, 1));
- dynsymdata->d_type = ELF_T_SYM;
- dynsymdata->d_off = 0;
- dynsymdata->d_align = xelf_fsize (ld_state.outelf, ELF_T_ADDR, 1);
-
- /* We need one more array which contains the hash codes of the
- symbol names. */
- hashcodes = (Elf32_Word *) xcalloc (__builtin_popcount ((int) ld_state.hash_style)
- * nsym_dyn_allocated,
- sizeof (Elf32_Word));
- gnuhashcodes = hashcodes;
- if (GENERATE_SYSV_HASH)
- gnuhashcodes += nsym_dyn_allocated;
-
- /* We have and empty entry at the beginning. */
- nsym_dyn = 1;
-
- /* Populate the table. */
- for (cnt = nsym_local; cnt < nsym; ++cnt)
- {
- XElf_Sym_vardef (sym);
-
- xelf_getsym (symdata, cnt, sym);
- assert (sym != NULL);
-
- if (sym->st_shndx == SHN_XINDEX)
- error (EXIT_FAILURE, 0, gettext ("\
-section index too large in dynamic symbol table"));
-
- /* We do not add the symbol to the dynamic symbol table if
-
- - the symbol is for a file
- - it is not externally visible (internal, hidden)
- - export_all_dynamic is not set and the symbol is only defined
- in the executable (i.e., it is defined, but not (also) in DSO)
-
- Set symstrent[cnt] to NULL in case an entry is ignored. */
- if (XELF_ST_TYPE (sym->st_info) == STT_FILE
- || XELF_ST_VISIBILITY (sym->st_other) == STV_INTERNAL
- || XELF_ST_VISIBILITY (sym->st_other) == STV_HIDDEN
- || (!ld_state.export_all_dynamic
- && !ndxtosym[cnt]->in_dso && ndxtosym[cnt]->defined))
- {
- symstrent[cnt] = NULL;
- continue;
- }
-
- /* Store the index of the symbol in the dynamic symbol
- table. This is a preliminary value in case we use the
- GNU-style hash table. */
- ndxtosym[cnt]->outdynsymidx = nsym_dyn;
-
- /* Create a new string table entry. */
- const char *str = ndxtosym[cnt]->name;
- symstrent[cnt] = ebl_strtabadd (dynstrtab, str, 0);
- if (GENERATE_SYSV_HASH)
- hashcodes[nsym_dyn] = elf_hash (str);
- if (GENERATE_GNU_HASH)
- gnuhashcodes[nsym_dyn] = elf_gnu_hash (str);
- ++nsym_dyn;
- }
-
- if (ld_state.file_type != relocatable_file_type)
- {
- /* Finalize the dynamic string table. */
- ebl_strtabfinalize (dynstrtab, dynstrdata);
-
- assert (ld_state.hashscnidx != 0 || ld_state.gnuhashscnidx != 0);
-
- /* Create the GNU-style hash table. */
- if (GENERATE_GNU_HASH)
- create_gnu_hash (nsym_local, nsym, nsym_dyn, gnuhashcodes);
-
- /* Create the SysV-style hash table. This has to happen
- after the GNU-style table is created since
- CREATE-GNU-HASH might reorder the dynamic symbol table. */
- if (GENERATE_SYSV_HASH)
- create_hash (nsym_local, nsym, nsym_dyn, hashcodes);
- }
-
- /* Add the version information. */
- if (versymdata != NULL)
- for (cnt = nsym_local; cnt < nsym; ++cnt)
- if (symstrent[cnt] != NULL)
- {
- struct symbol *symp = ndxtosym[cnt];
-
- /* Synthetic symbols (i.e., those with no file attached)
- have no version information. */
- if (symp->file != NULL && symp->file->verdefdata != NULL)
- {
- GElf_Versym versym;
-
- gelf_getversym (symp->file->versymdata, symp->symidx,
- &versym);
-
- (void) gelf_update_versym (versymdata, symp->outdynsymidx,
- &symp->file->verdefused[versym]);
- }
- else
- {
- /* XXX Add support for version definitions. */
- GElf_Versym global = VER_NDX_GLOBAL;
- (void) gelf_update_versym (versymdata, nsym_dyn, &global);
- }
- }
-
- /* Update the information about the symbol section. */
- if (versymdata != NULL)
- {
- /* Correct the size now that we know how many entries the
- dynamic symbol table has. */
- versymdata->d_size = xelf_fsize (ld_state.outelf, ELF_T_HALF,
- nsym_dyn);
-
- /* Add the reference to the symbol table. */
- xelf_getshdr (versymscn, shdr);
- assert (shdr != NULL);
-
- shdr->sh_link = ld_state.dynsymscnidx;
-
- (void) xelf_update_shdr (versymscn, shdr);
- }
- }
-
- if (ld_state.file_type != relocatable_file_type)
- {
- /* Now put the names in. */
- for (cnt = nsym_local; cnt < nsym; ++cnt)
- if (symstrent[cnt] != NULL)
- {
- XElf_Sym_vardef (sym);
- size_t dynidx = ndxtosym[cnt]->outdynsymidx;
-
-#if NATIVE_ELF != 0
- XElf_Sym *osym;
- memcpy (xelf_getsym (dynsymdata, dynidx, sym),
- xelf_getsym (symdata, cnt, osym),
- sizeof (XElf_Sym));
-#else
- xelf_getsym (symdata, cnt, sym);
- assert (sym != NULL);
-#endif
-
- sym->st_name = ebl_strtaboffset (symstrent[cnt]);
-
- (void) xelf_update_sym (dynsymdata, dynidx, sym);
- }
-
- free (hashcodes);
-
- /* Create the required version section. */
- if (ld_state.verneedscnidx != 0)
- {
- Elf_Scn *verneedscn;
- Elf_Data *verneeddata;
- struct usedfiles *runp;
- size_t verneed_size = xelf_fsize (ld_state.outelf, ELF_T_VNEED, 1);
- size_t vernaux_size = xelf_fsize (ld_state.outelf, ELF_T_VNAUX, 1);
- size_t offset;
- int ntotal;
-
- verneedscn = elf_getscn (ld_state.outelf, ld_state.verneedscnidx);
- xelf_getshdr (verneedscn, shdr);
- verneeddata = elf_newdata (verneedscn);
- if (shdr == NULL || verneeddata == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot create versioning data: %s"),
- elf_errmsg (-1));
-
- verneeddata->d_size = (ld_state.nverdeffile * verneed_size
- + ld_state.nverdefused * vernaux_size);
- verneeddata->d_buf = xmalloc (verneeddata->d_size);
- verneeddata->d_type = ELF_T_VNEED;
- verneeddata->d_align = xelf_fsize (ld_state.outelf, ELF_T_WORD, 1);
- verneeddata->d_off = 0;
-
- offset = 0;
- ntotal = ld_state.nverdeffile;
- runp = ld_state.dsofiles->next;
- do
- {
- offset = create_verneed_data (offset, verneeddata, runp,
- &ntotal);
- runp = runp->next;
- }
- while (ntotal > 0 && runp != ld_state.dsofiles->next);
-
- if (ntotal > 0)
- {
- runp = ld_state.needed->next;
- do
- {
- offset = create_verneed_data (offset, verneeddata, runp,
- &ntotal);
- runp = runp->next;
- }
- while (ntotal > 0 && runp != ld_state.needed->next);
- }
-
- assert (offset == verneeddata->d_size);
-
- /* Add the needed information to the section header. */
- shdr->sh_link = ld_state.dynstrscnidx;
- shdr->sh_info = ld_state.nverdeffile;
- (void) xelf_update_shdr (verneedscn, shdr);
- }
-
- /* Adjust the section size. */
- dynsymdata->d_size = xelf_fsize (ld_state.outelf, ELF_T_SYM, nsym_dyn);
- if (versymdata != NULL)
- versymdata->d_size = xelf_fsize (ld_state.outelf, ELF_T_HALF,
- nsym_dyn);
-
- /* Add the remaining information to the section header. */
- xelf_getshdr (dynsymscn, shdr);
- /* There is always exactly one local symbol. */
- shdr->sh_info = 1;
- /* Reference the string table. */
- shdr->sh_link = ld_state.dynstrscnidx;
- /* Write the updated info back. */
- (void) xelf_update_shdr (dynsymscn, shdr);
- }
-
- /* We don't need the string table anymore. */
- free (symstrent);
-
- /* Remember the total number of symbols in the dynamic symbol table. */
- ld_state.ndynsym = nsym_dyn;
-
- /* Fill in the section header information. */
- symscn = elf_getscn (ld_state.outelf, ld_state.symscnidx);
- xelf_getshdr (symscn, shdr);
- if (shdr == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot create symbol table for output file: %s"),
- elf_errmsg (-1));
-
- shdr->sh_type = SHT_SYMTAB;
- shdr->sh_link = ld_state.strscnidx;
- shdr->sh_info = nsym_local;
- shdr->sh_entsize = xelf_fsize (ld_state.outelf, ELF_T_SYM, 1);
-
- (void) xelf_update_shdr (symscn, shdr);
-
-
- /* Add names for the generated sections. */
- if (ld_state.symscnidx != 0)
- symtab_ent = ebl_strtabadd (ld_state.shstrtab, ".symtab", 8);
- if (ld_state.xndxscnidx != 0)
- xndx_ent = ebl_strtabadd (ld_state.shstrtab, ".symtab_shndx", 14);
- if (ld_state.strscnidx != 0)
- strtab_ent = ebl_strtabadd (ld_state.shstrtab, ".strtab", 8);
- /* At this point we would have to test for failures in the
- allocation. But we skip this. First, the problem will be caught
- later when doing more allocations for the section header table.
- Even if this would not be the case all that would happen is that
- the section names are empty. The binary would still be usable if
- it is an executable or a DSO. Not adding the test here saves
- quite a bit of code. */
-
-
- /* Finally create the section for the section header string table. */
- shstrtab_scn = elf_newscn (ld_state.outelf);
- shstrtab_ndx = elf_ndxscn (shstrtab_scn);
- if (unlikely (shstrtab_ndx == SHN_UNDEF))
- error (EXIT_FAILURE, 0,
- gettext ("cannot create section header string section: %s"),
- elf_errmsg (-1));
-
- /* Add the name of the section to the string table. */
- shstrtab_ent = ebl_strtabadd (ld_state.shstrtab, ".shstrtab", 10);
- if (unlikely (shstrtab_ent == NULL))
- error (EXIT_FAILURE, errno,
- gettext ("cannot create section header string section"));
-
- /* Finalize the section header string table. */
- data = elf_newdata (shstrtab_scn);
- if (data == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot create section header string section: %s"),
- elf_errmsg (-1));
- ebl_strtabfinalize (ld_state.shstrtab, data);
-
- /* Now we know the string offsets for all section names. */
- for (cnt = 0; cnt < ld_state.nallsections; ++cnt)
- if (ld_state.allsections[cnt]->scnidx != 0)
- {
- Elf_Scn *scn;
-
- scn = elf_getscn (ld_state.outelf, ld_state.allsections[cnt]->scnidx);
-
- xelf_getshdr (scn, shdr);
- assert (shdr != NULL);
-
- shdr->sh_name = ebl_strtaboffset (ld_state.allsections[cnt]->nameent);
-
- if (xelf_update_shdr (scn, shdr) == 0)
- assert (0);
- }
-
- /* Add the names for the generated sections to the respective
- section headers. */
- if (symtab_ent != NULL)
- {
- Elf_Scn *scn = elf_getscn (ld_state.outelf, ld_state.symscnidx);
-
- xelf_getshdr (scn, shdr);
- /* This cannot fail, we already accessed the header before. */
- assert (shdr != NULL);
-
- shdr->sh_name = ebl_strtaboffset (symtab_ent);
-
- (void) xelf_update_shdr (scn, shdr);
- }
- if (xndx_ent != NULL)
- {
- Elf_Scn *scn = elf_getscn (ld_state.outelf, ld_state.xndxscnidx);
-
- xelf_getshdr (scn, shdr);
- /* This cannot fail, we already accessed the header before. */
- assert (shdr != NULL);
-
- shdr->sh_name = ebl_strtaboffset (xndx_ent);
-
- (void) xelf_update_shdr (scn, shdr);
- }
- if (strtab_ent != NULL)
- {
- Elf_Scn *scn = elf_getscn (ld_state.outelf, ld_state.strscnidx);
-
- xelf_getshdr (scn, shdr);
- /* This cannot fail, we already accessed the header before. */
- assert (shdr != NULL);
-
- shdr->sh_name = ebl_strtaboffset (strtab_ent);
-
- (void) xelf_update_shdr (scn, shdr);
- }
-
- /* And the section header table section itself. */
- xelf_getshdr (shstrtab_scn, shdr);
- if (shdr == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot create section header string section: %s"),
- elf_errmsg (-1));
-
- shdr->sh_name = ebl_strtaboffset (shstrtab_ent);
- shdr->sh_type = SHT_STRTAB;
-
- if (unlikely (xelf_update_shdr (shstrtab_scn, shdr) == 0))
- error (EXIT_FAILURE, 0,
- gettext ("cannot create section header string section: %s"),
- elf_errmsg (-1));
-
-
- /* Add the correct section header info to the section group sections. */
- groups = ld_state.groups;
- while (groups != NULL)
- {
- Elf_Scn *scn = elf_getscn (ld_state.outelf, groups->outscnidx);
- xelf_getshdr (scn, shdr);
- assert (shdr != NULL);
-
- shdr->sh_name = ebl_strtaboffset (groups->nameent);
- shdr->sh_type = SHT_GROUP;
- shdr->sh_flags = 0;
- shdr->sh_link = ld_state.symscnidx;
- shdr->sh_entsize = sizeof (Elf32_Word);
-
- /* Determine the index for the signature symbol. */
- Elf32_Word si
- = groups->symbol->file->symindirect[groups->symbol->symidx];
- if (si == 0)
- {
- assert (groups->symbol->file->symref[groups->symbol->symidx]
- != NULL);
- si = groups->symbol->file->symref[groups->symbol->symidx]->outsymidx;
- assert (si != 0);
- }
- shdr->sh_info = ld_state.dblindirect[si];
-
- (void) xelf_update_shdr (scn, shdr);
-
- struct scngroup *oldp = groups;
- groups = groups->next;
- free (oldp);
- }
-
-
- if (ld_state.file_type != relocatable_file_type)
- {
- /* Every executable needs a program header. The number of entries
- varies. One exists for each segment. Each SHT_NOTE section gets
- one, too. For dynamically linked executables we have to create
- one for the program header, the interpreter, and the dynamic
- section. First count the number of segments.
-
- XXX Determine whether the segment is non-empty. */
- size_t nphdr = 0;
-
- /* We always add a PT_GNU_stack entry. */
- ++nphdr;
-
- struct output_segment *segment = ld_state.output_segments;
- while (segment != NULL)
- {
- ++nphdr;
- segment = segment->next;
- }
-
- /* Add the number of SHT_NOTE sections. We counted them earlier. */
- nphdr += ld_state.nnotesections;
-
- /* If we create a DSO or the file is linked against DSOs we have
- at least one more entry: DYNAMIC. If an interpreter is
- specified we add PHDR and INTERP, too. */
- if (dynamically_linked_p ())
- {
- ++nphdr;
-
- if (ld_state.interp != NULL || ld_state.file_type != dso_file_type)
- nphdr += 2;
- }
-
- /* If we need a TLS segment we need an entry for that. */
- if (ld_state.need_tls)
- ++nphdr;
-
- /* Create the program header structure. */
- XElf_Phdr_vardef (phdr);
- if (xelf_newphdr (ld_state.outelf, nphdr) == 0)
- error (EXIT_FAILURE, 0, gettext ("cannot create program header: %s"),
- elf_errmsg (-1));
-
-
- /* Determine the section sizes and offsets. We have to do this
- to be able to determine the memory layout (which normally
- differs from the file layout). */
- if (elf_update (ld_state.outelf, ELF_C_NULL) == -1)
- error (EXIT_FAILURE, 0, gettext ("while determining file layout: %s"),
- elf_errmsg (-1));
-
-
- /* Now determine the memory addresses of all the sections and
- segments. */
- Elf32_Word nsec = 0;
- Elf_Scn *scn = elf_getscn (ld_state.outelf,
- ld_state.allsections[nsec]->scnidx);
- xelf_getshdr (scn, shdr);
- assert (shdr != NULL);
-
- /* The address we start with is the offset of the first (not
- zeroth) section. */
- XElf_Addr addr = shdr->sh_offset;
- XElf_Addr tls_offset = 0;
- XElf_Addr tls_start = ~((XElf_Addr) 0);
- XElf_Addr tls_end = 0;
- XElf_Off tls_filesize = 0;
- XElf_Addr tls_align = 0;
-
- /* The index of the first loadable segment. */
- nphdr = 0;
- if (dynamically_linked_p ())
- {
- ++nphdr;
- if (ld_state.interp != NULL
- || ld_state.file_type != dso_file_type)
- nphdr += 2;
- }
-
- segment = ld_state.output_segments;
- while (segment != NULL)
- {
- struct output_rule *orule;
- bool first_section = true;
- XElf_Off nobits_size = 0;
- XElf_Off memsize = 0;
-
- /* The minimum alignment is a page size. */
- segment->align = ld_state.pagesize;
-
- for (orule = segment->output_rules; orule != NULL;
- orule = orule->next)
- if (orule->tag == output_section)
- {
- /* See whether this output rule corresponds to the next
- section. Yes, this is a pointer comparison. */
- if (ld_state.allsections[nsec]->name
- != orule->val.section.name)
- /* No, ignore this output rule. */
- continue;
-
- /* We assign addresses only in segments which are actually
- loaded. */
- if (segment->mode != 0)
- {
- /* Adjust the offset of the input sections. */
- struct scninfo *isect;
- struct scninfo *first;
-
- isect = first = ld_state.allsections[nsec]->last;
- if (isect != NULL)
- do
- isect->offset += addr;
- while ((isect = isect->next) != first);
-
- /* Set the address of current section. */
- shdr->sh_addr = addr;
-
- /* Write the result back. */
- (void) xelf_update_shdr (scn, shdr);
-
- /* Remember the address. */
- ld_state.allsections[nsec]->addr = addr;
-
- /* Handle TLS sections. */
- if (unlikely (shdr->sh_flags & SHF_TLS))
- {
- if (tls_start > addr)
- {
- tls_start = addr;
- tls_offset = shdr->sh_offset;
- }
- if (tls_end < addr + shdr->sh_size)
- tls_end = addr + shdr->sh_size;
- if (shdr->sh_type != SHT_NOBITS)
- tls_filesize += shdr->sh_size;
- if (shdr->sh_addralign > tls_align)
- tls_align = shdr->sh_addralign;
- }
- }
-
- if (first_section)
- {
- /* The first segment starts at offset zero. */
- if (segment == ld_state.output_segments)
- {
- segment->offset = 0;
- segment->addr = addr - shdr->sh_offset;
- }
- else
- {
- segment->offset = shdr->sh_offset;
- segment->addr = addr;
- }
-
- /* Determine the maximum alignment requirement. */
- segment->align = MAX (segment->align, shdr->sh_addralign);
-
- first_section = false;
- }
-
- /* NOBITS TLS sections are not laid out in address space
- along with the other sections. */
- if (shdr->sh_type != SHT_NOBITS
- || (shdr->sh_flags & SHF_TLS) == 0)
- {
- memsize = (shdr->sh_offset - segment->offset
- + shdr->sh_size);
- if (nobits_size != 0 && shdr->sh_type != SHT_NOTE)
- error (EXIT_FAILURE, 0, gettext ("\
-internal error: non-nobits section follows nobits section"));
- if (shdr->sh_type == SHT_NOBITS)
- nobits_size += shdr->sh_size;
- }
-
- /* Determine the new address which is computed using
- the difference of the offsets on the sections. Note
- that this assumes that the sections following each
- other in the section header table are also
- consecutive in the file. This is true here because
- libelf constructs files this way. */
- XElf_Off oldoff = shdr->sh_offset;
-
- if (++nsec >= ld_state.nallsections)
- break;
-
- scn = elf_getscn (ld_state.outelf,
- ld_state.allsections[nsec]->scnidx);
- xelf_getshdr (scn, shdr);
- assert (shdr != NULL);
-
- /* This is the new address resulting from the offsets
- in the file. */
- assert (oldoff <= shdr->sh_offset);
- addr += shdr->sh_offset - oldoff;
- }
- else
- {
- assert (orule->tag == output_assignment);
-
- if (strcmp (orule->val.assignment->variable, ".") == 0)
- /* This is a change of the address. */
- addr = eval_expression (orule->val.assignment->expression,
- addr);
- else if (orule->val.assignment->sym != NULL)
- {
- /* This symbol is used. Update the symbol table
- entry. */
- XElf_Sym_vardef (sym);
- size_t idx;
-
- /* Note that we do not have to use
- xelf_getsymshndx since we only update the
- symbol address, not the section
- information. */
- idx = dblindirect[orule->val.assignment->sym->outsymidx];
- xelf_getsym (symdata, idx, sym);
- sym->st_value = addr;
- (void) xelf_update_sym (symdata, idx, sym);
-
- idx = orule->val.assignment->sym->outdynsymidx;
- if (idx != 0)
- {
- assert (dynsymdata != NULL);
- xelf_getsym (dynsymdata, idx, sym);
- sym->st_value = addr;
- (void) xelf_update_sym (dynsymdata, idx, sym);
- }
- }
- }
-
- /* Store the segment parameter for loadable segments. */
- if (segment->mode != 0)
- {
- xelf_getphdr_ptr (ld_state.outelf, nphdr, phdr);
-
- phdr->p_type = PT_LOAD;
- phdr->p_offset = segment->offset;
- phdr->p_vaddr = segment->addr;
- phdr->p_paddr = phdr->p_vaddr;
- phdr->p_filesz = memsize - nobits_size;
- phdr->p_memsz = memsize;
- phdr->p_flags = segment->mode;
- phdr->p_align = segment->align;
-
- (void) xelf_update_phdr (ld_state.outelf, nphdr, phdr);
- ++nphdr;
- }
-
- segment = segment->next;
- }
-
- /* Create the other program header entries. */
- xelf_getehdr (ld_state.outelf, ehdr);
- assert (ehdr != NULL);
-
- /* Add the TLS information. */
- if (ld_state.need_tls)
- {
- xelf_getphdr_ptr (ld_state.outelf, nphdr, phdr);
- phdr->p_type = PT_TLS;
- phdr->p_offset = tls_offset;
- phdr->p_vaddr = tls_start;
- phdr->p_paddr = tls_start;
- phdr->p_filesz = tls_filesize;
- phdr->p_memsz = tls_end - tls_start;
- phdr->p_flags = PF_R;
- phdr->p_align = tls_align;
- ld_state.tls_tcb = tls_end;
- ld_state.tls_start = tls_start;
-
- (void) xelf_update_phdr (ld_state.outelf, nphdr, phdr);
- ++nphdr;
- }
-
- /* Add the stack information. */
- xelf_getphdr_ptr (ld_state.outelf, nphdr, phdr);
- phdr->p_type = PT_GNU_STACK;
- phdr->p_offset = 0;
- phdr->p_vaddr = 0;
- phdr->p_paddr = 0;
- phdr->p_filesz = 0;
- phdr->p_memsz = 0;
- phdr->p_flags = (PF_R | PF_W
- | (ld_state.execstack == execstack_true ? PF_X : 0));
- phdr->p_align = xelf_fsize (ld_state.outelf, ELF_T_ADDR, 1);
-
- (void) xelf_update_phdr (ld_state.outelf, nphdr, phdr);
- ++nphdr;
-
-
- /* Adjust the addresses in the address fields of the symbol
- records according to the load addresses of the sections. */
- if (ld_state.need_symtab)
- for (cnt = 1; cnt < nsym; ++cnt)
- {
- XElf_Sym_vardef (sym);
- Elf32_Word shndx;
-
- xelf_getsymshndx (symdata, xndxdata, cnt, sym, shndx);
- assert (sym != NULL);
-
- if (sym->st_shndx != SHN_XINDEX)
- shndx = sym->st_shndx;
-
- if ((shndx > SHN_UNDEF && shndx < SHN_LORESERVE)
- || shndx > SHN_HIRESERVE)
- {
- /* Note we subtract 1 from the section index since ALLSECTIONS
- does not store the dummy section with offset zero. */
- sym->st_value += ld_state.allsections[shndx - 1]->addr;
-
- /* We don't have to use 'xelf_update_symshndx' since the
- section number doesn't change. */
- (void) xelf_update_sym (symdata, cnt, sym);
- }
- }
-
- if (ld_state.need_dynsym)
- for (cnt = 1; cnt < nsym_dyn; ++cnt)
- {
- XElf_Sym_vardef (sym);
-
- xelf_getsym (dynsymdata, cnt, sym);
- assert (sym != NULL);
-
- if (sym->st_shndx > SHN_UNDEF && sym->st_shndx < SHN_LORESERVE)
- {
- /* Note we subtract 1 from the section index since ALLSECTIONS
- does not store the dummy section with offset zero. */
- sym->st_value += ld_state.allsections[sym->st_shndx - 1]->addr;
-
- /* We don't have to use 'xelf_update_symshndx' since the
- section number doesn't change. */
- (void) xelf_update_sym (dynsymdata, cnt, sym);
- }
- }
-
- /* Now is a good time to determine the values of all the symbols
- we encountered. */
- // XXX This loop is very inefficient. The hash tab iterator also
- // returns all symbols in DSOs.
- struct symbol *se;
- void *p = NULL;
- while ((se = ld_symbol_tab_iterate (&ld_state.symbol_tab, &p)) != NULL)
- if (! se->in_dso)
- {
- XElf_Sym_vardef (sym);
-
- addr = 0;
-
- if (se->outdynsymidx != 0)
- {
- xelf_getsym (dynsymdata, se->outdynsymidx, sym);
- assert (sym != NULL);
- addr = sym->st_value;
- }
- else if (se->outsymidx != 0)
- {
- assert (dblindirect[se->outsymidx] != 0);
- xelf_getsym (symdata, dblindirect[se->outsymidx], sym);
- assert (sym != NULL);
- addr = sym->st_value;
- }
- else
- abort ();
-
- se->merge.value = addr;
- }
-
- /* Complete the header of the .rel.dyn/.rela.dyn section. Point
- to the symbol table. The sh_info field is left zero since
- there is no specific section the contained relocations are
- for. */
- if (ld_state.reldynscnidx != 0)
- {
- assert (ld_state.dynsymscnidx != 0);
- scn = elf_getscn (ld_state.outelf, ld_state.reldynscnidx);
- xelf_getshdr (scn, shdr);
- assert (shdr != NULL);
-
- shdr->sh_link = ld_state.dynsymscnidx;
-
- (void) xelf_update_shdr (scn, shdr);
- }
-
- /* Fill in the dynamic segment/section. */
- if (dynamically_linked_p ())
- {
- Elf_Scn *outscn;
-
- int idx = 0;
- if (ld_state.interp != NULL || ld_state.file_type != dso_file_type)
- {
- assert (ld_state.interpscnidx != 0);
- xelf_getshdr (elf_getscn (ld_state.outelf,
- ld_state.interpscnidx), shdr);
- assert (shdr != NULL);
-
- xelf_getphdr_ptr (ld_state.outelf, idx, phdr);
- phdr->p_type = PT_PHDR;
- phdr->p_offset = ehdr->e_phoff;
- phdr->p_vaddr = ld_state.output_segments->addr + phdr->p_offset;
- phdr->p_paddr = phdr->p_vaddr;
- phdr->p_filesz = ehdr->e_phnum * ehdr->e_phentsize;
- phdr->p_memsz = phdr->p_filesz;
- phdr->p_flags = 0; /* No need to set PF_R or so. */
- phdr->p_align = xelf_fsize (ld_state.outelf, ELF_T_ADDR, 1);
-
- (void) xelf_update_phdr (ld_state.outelf, idx, phdr);
- ++idx;
-
- /* The interpreter string. */
- xelf_getphdr_ptr (ld_state.outelf, idx, phdr);
- phdr->p_type = PT_INTERP;
- phdr->p_offset = shdr->sh_offset;
- phdr->p_vaddr = shdr->sh_addr;
- phdr->p_paddr = phdr->p_vaddr;
- phdr->p_filesz = shdr->sh_size;
- phdr->p_memsz = phdr->p_filesz;
- phdr->p_flags = 0; /* No need to set PF_R or so. */
- phdr->p_align = 1; /* It's a string. */
-
- (void) xelf_update_phdr (ld_state.outelf, idx, phdr);
- ++idx;
- }
-
- /* The pointer to the dynamic section. We this we need to
- get the information for the dynamic section first. */
- assert (ld_state.dynamicscnidx);
- outscn = elf_getscn (ld_state.outelf, ld_state.dynamicscnidx);
- xelf_getshdr (outscn, shdr);
- assert (shdr != NULL);
-
- xelf_getphdr_ptr (ld_state.outelf, idx, phdr);
- phdr->p_type = PT_DYNAMIC;
- phdr->p_offset = shdr->sh_offset;
- phdr->p_vaddr = shdr->sh_addr;
- phdr->p_paddr = phdr->p_vaddr;
- phdr->p_filesz = shdr->sh_size;
- phdr->p_memsz = phdr->p_filesz;
- phdr->p_flags = 0; /* No need to set PF_R or so. */
- phdr->p_align = shdr->sh_addralign;
-
- (void) xelf_update_phdr (ld_state.outelf, idx, phdr);
-
- /* Fill in the reference to the .dynstr section. */
- assert (ld_state.dynstrscnidx != 0);
- shdr->sh_link = ld_state.dynstrscnidx;
- (void) xelf_update_shdr (outscn, shdr);
-
- /* And fill the remaining entries. */
- Elf_Data *dyndata = elf_getdata (outscn, NULL);
- assert (dyndata != NULL);
-
- /* Add the DT_NEEDED entries. */
- if (ld_state.ndsofiles > 0)
- {
- struct usedfiles *runp = ld_state.dsofiles->next;
-
- do
- if (runp->used || !runp->as_needed)
- {
- /* Add the position-dependent flag if necessary. */
- if (runp->lazyload)
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++,
- DT_POSFLAG_1, DF_P1_LAZYLOAD);
-
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++,
- DT_NEEDED,
- ebl_strtaboffset (runp->sonameent));
- }
- while ((runp = runp->next) != ld_state.dsofiles->next);
- }
-
- /* We can finish the DT_RUNPATH/DT_RPATH entries now. */
- if (ld_state.rxxpath_strent != NULL)
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++,
- ld_state.rxxpath_tag,
- ebl_strtaboffset (ld_state.rxxpath_strent));
-
- /* Reference to initialization and finalization functions. */
- // XXX This code depends on symbol table being relocated.
- if (ld_state.init_symbol != NULL)
- {
- XElf_Sym_vardef (sym);
-
- if (ld_state.need_symtab)
- xelf_getsym (symdata,
- dblindirect[ld_state.init_symbol->outsymidx],
- sym);
- else
- xelf_getsym (dynsymdata, ld_state.init_symbol->outdynsymidx,
- sym);
- assert (sym != NULL);
-
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++,
- DT_INIT, sym->st_value);
- }
- if (ld_state.fini_symbol != NULL)
- {
- XElf_Sym_vardef (sym);
-
- if (ld_state.need_symtab)
- xelf_getsym (symdata,
- dblindirect[ld_state.fini_symbol->outsymidx],
- sym);
- else
- xelf_getsym (dynsymdata, ld_state.fini_symbol->outdynsymidx,
- sym);
- assert (sym != NULL);
-
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++,
- DT_FINI, sym->st_value);
- }
- // XXX Support init,fini,preinit arrays
-
- /* The hash table which comes with dynamic symbol table. */
- xelf_getshdr (elf_getscn (ld_state.outelf, ld_state.hashscnidx),
- shdr);
- assert (shdr != NULL);
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++, DT_HASH,
- shdr->sh_addr);
-
- /* Reference to the symbol table section. */
- assert (ld_state.dynsymscnidx != 0);
- xelf_getshdr (elf_getscn (ld_state.outelf, ld_state.dynsymscnidx),
- shdr);
- assert (shdr != NULL);
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++, DT_SYMTAB,
- shdr->sh_addr);
-
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++, DT_SYMENT,
- xelf_fsize (ld_state.outelf, ELF_T_SYM, 1));
-
- /* And the string table which comes with it. */
- xelf_getshdr (elf_getscn (ld_state.outelf, ld_state.dynstrscnidx),
- shdr);
- assert (shdr != NULL);
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++, DT_STRTAB,
- shdr->sh_addr);
-
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++, DT_STRSZ,
- shdr->sh_size);
-
- /* Add the entries related to the .plt. */
- if (ld_state.nplt > 0)
- {
- // XXX Make this work if there is no PLT
- xelf_getshdr (elf_getscn (ld_state.outelf,
- ld_state.gotpltscnidx), shdr);
- assert (shdr != NULL);
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++,
- // XXX This should probably be machine
- // dependent.
- DT_PLTGOT, shdr->sh_addr);
-
- xelf_getshdr (elf_getscn (ld_state.outelf,
- ld_state.pltrelscnidx), shdr);
- assert (shdr != NULL);
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++,
- DT_PLTRELSZ, shdr->sh_size);
-
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++,
- DT_JMPREL, shdr->sh_addr);
-
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++,
- DT_PLTREL, REL_TYPE (statep));
- }
-
- if (ld_state.relsize_total > 0)
- {
- int rel = REL_TYPE (statep);
- xelf_getshdr (elf_getscn (ld_state.outelf,
- ld_state.reldynscnidx), shdr);
- assert (shdr != NULL);
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++,
- rel, shdr->sh_addr);
-
- /* Trick ahead. Use arithmetic to get the right tag.
- We check the validity of this assumption in the asserts. */
- assert (DT_RELASZ - DT_RELA == 1);
- assert (DT_RELSZ - DT_REL == 1);
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++,
- rel + 1, shdr->sh_size);
-
- /* Similar for the entry size tag. */
- assert (DT_RELAENT - DT_RELA == 2);
- assert (DT_RELENT - DT_REL == 2);
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++,
- rel + 2,
- rel == DT_REL
- ? xelf_fsize (ld_state.outelf, ELF_T_REL, 1)
- : xelf_fsize (ld_state.outelf, ELF_T_RELA,
- 1));
- }
-
- if (ld_state.verneedscnidx != 0)
- {
- xelf_getshdr (elf_getscn (ld_state.outelf,
- ld_state.verneedscnidx), shdr);
- assert (shdr != NULL);
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++,
- DT_VERNEED, shdr->sh_addr);
-
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++,
- DT_VERNEEDNUM, ld_state.nverdeffile);
- }
-
- if (ld_state.versymscnidx != 0)
- {
- xelf_getshdr (elf_getscn (ld_state.outelf,
- ld_state.versymscnidx), shdr);
- assert (shdr != NULL);
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++,
- DT_VERSYM, shdr->sh_addr);
- }
-
- /* We always create the DT_DEBUG entry. */
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++, DT_DEBUG, 0);
- assert (ld_state.ndynamic_filled < ld_state.ndynamic);
-
- /* Add the flag words if necessary. */
- if (ld_state.dt_flags != 0)
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++, DT_FLAGS,
- ld_state.dt_flags);
-
- /* Create entry for the DT_FLAGS_1 flag. */
- if (ld_state.dt_flags_1 != 0)
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++,
- DT_FLAGS_1, ld_state.dt_flags_1);
-
- /* Create entry for the DT_FEATURE_1 flag. */
- if (ld_state.dt_feature_1 != 0)
- new_dynamic_entry (dyndata, ld_state.ndynamic_filled++,
- DT_FEATURE_1, ld_state.dt_feature_1);
-
- assert (ld_state.ndynamic_filled <= ld_state.ndynamic);
- }
- }
-
-
- // XXX The following code isn't nice. We use two different
- // mechanisms to handle relocations, one for relocatable files, one
- // for executables and DSOs. Maybe this is the best method but also
- // maybe it can be somewhat unified.
-
- /* Now that we created the symbol table we can add the reference to
- it in the sh_link field of the section headers of the relocation
- sections. */
- while (rellist != NULL)
- {
- assert (ld_state.file_type == relocatable_file_type);
- Elf_Scn *outscn;
-
- outscn = elf_getscn (ld_state.outelf, rellist->scnidx);
- xelf_getshdr (outscn, shdr);
- /* This must not fail since we did it before. */
- assert (shdr != NULL);
-
- /* Remember the symbol table which belongs to the relocation section. */
- shdr->sh_link = ld_state.symscnidx;
-
- /* And the reference to the section which is relocated by this
- relocation section. We use the info from the first input
- section but all records should have the same information. */
- shdr->sh_info =
- rellist->scninfo->fileinfo->scninfo[SCNINFO_SHDR (rellist->scninfo->shdr).sh_info].outscnndx;
-
-
- /* Perform the actual relocations. We only have to adjust
- offsets and symbol indices. */
- RELOCATE_SECTION (statep, outscn, rellist->scninfo, dblindirect);
-
- /* Store the changes. */
- (void) xelf_update_shdr (outscn, shdr);
-
- /* Up to the next relocation section. */
- rellist = rellist->next;
- }
-
- if (ld_state.rellist != NULL)
- {
- assert (ld_state.file_type != relocatable_file_type);
- /* Create the relocations for the output file. */
- CREATE_RELOCATIONS (statep, dblindirect);
- }
-
-
- /* We need the ELF header once more. */
- xelf_getehdr (ld_state.outelf, ehdr);
- assert (ehdr != NULL);
-
- /* Set the section header string table index. */
- if (likely (shstrtab_ndx < SHN_HIRESERVE)
- && likely (shstrtab_ndx != SHN_XINDEX))
- ehdr->e_shstrndx = shstrtab_ndx;
- else
- {
- /* We have to put the section index in the sh_link field of the
- zeroth section header. */
- Elf_Scn *scn = elf_getscn (ld_state.outelf, 0);
-
- xelf_getshdr (scn, shdr);
- if (unlikely (shdr == NULL))
- error (EXIT_FAILURE, 0,
- gettext ("cannot get header of 0th section: %s"),
- elf_errmsg (-1));
-
- shdr->sh_link = shstrtab_ndx;
-
- (void) xelf_update_shdr (scn, shdr);
-
- ehdr->e_shstrndx = SHN_XINDEX;
- }
-
- if (ld_state.file_type != relocatable_file_type)
- /* DSOs and executables have to define the entry point symbol. */
- ehdr->e_entry = find_entry_point ();
-
- if (unlikely (xelf_update_ehdr (ld_state.outelf, ehdr) == 0))
- error (EXIT_FAILURE, 0,
- gettext ("cannot update ELF header: %s"),
- elf_errmsg (-1));
-
-
- /* Free the data which we don't need anymore. */
- free (ld_state.dblindirect);
-
-
- /* Finalize the .plt section and what else belongs to it. */
- FINALIZE_PLT (statep, nsym, nsym_local, ndxtosym);
-
-
- /* Finally, if we have to compute the build ID. */
- if (ld_state.build_id != NULL)
- compute_build_id ();
-
-
- /* We don't need the map from the symbol table index to the symbol
- structure anymore. */
- free (ndxtosym);
-
- return 0;
-}
-
-
-/* This is a function which must be specified in all backends. */
-static void
-ld_generic_relocate_section (struct ld_state *statep, Elf_Scn *outscn,
- struct scninfo *firstp,
- const Elf32_Word *dblindirect)
-{
- error (EXIT_FAILURE, 0, gettext ("\
-linker backend didn't specify function to relocate section"));
- /* NOTREACHED */
-}
-
-
-/* Finalize the output file. */
-static int
-ld_generic_finalize (struct ld_state *statep)
-{
- /* Write out the ELF file data. */
- if (elf_update (ld_state.outelf, ELF_C_WRITE) == -1)
- error (EXIT_FAILURE, 0, gettext ("while writing output file: %s"),
- elf_errmsg (-1));
-
- /* Free the resources. */
- if (elf_end (ld_state.outelf) != 0)
- error (EXIT_FAILURE, 0, gettext ("while finishing output file: %s"),
- elf_errmsg (-1));
-
- /* Get the file status of the temporary file. */
- struct stat temp_st;
- if (fstat (ld_state.outfd, &temp_st) != 0)
- error (EXIT_FAILURE, errno, gettext ("cannot stat output file"));
-
- /* Now it's time to rename the file. Remove an old existing file
- first. */
- if (rename (ld_state.tempfname, ld_state.outfname) != 0)
- /* Something went wrong. */
- error (EXIT_FAILURE, errno, gettext ("cannot rename output file"));
-
- /* Make sure the output file is really the one we created. */
- struct stat new_st;
- if (stat (ld_state.outfname, &new_st) != 0
- || new_st.st_ino != temp_st.st_ino
- || new_st.st_dev != temp_st.st_dev)
- {
- /* Wow, somebody overwrote the output file, probably some intruder. */
- unlink (ld_state.outfname);
- error (EXIT_FAILURE, 0, gettext ("\
-WARNING: temporary output file overwritten before linking finished"));
- }
-
- /* Close the file descriptor. */
- (void) close (ld_state.outfd);
-
- /* Signal the cleanup handler that the file is correctly created. */
- ld_state.tempfname = NULL;
-
- return 0;
-}
-
-
-static bool
-ld_generic_special_section_number_p (struct ld_state *statep, size_t number)
-{
- /* There are no special section numbers in the gABI. */
- return false;
-}
-
-
-static bool
-ld_generic_section_type_p (struct ld_state *statep, GElf_Word type)
-{
- if (type < SHT_NUM
- /* XXX Enable the following two when implemented. */
- // || type == SHT_GNU_LIBLIST
- // || type == SHT_CHECKSUM
- /* XXX Eventually include SHT_SUNW_move, SHT_SUNW_COMDAT, and
- SHT_SUNW_syminfo. */
- || (type >= SHT_GNU_verdef && type <= SHT_GNU_versym))
- return true;
-
- return false;
-}
-
-
-static XElf_Xword
-ld_generic_dynamic_section_flags (struct ld_state *statep)
-{
- /* By default the .dynamic section is writable (and is of course
- loaded). Few architecture differ from this. */
- return SHF_ALLOC | SHF_WRITE;
-}
-
-
-static void
-ld_generic_initialize_plt (struct ld_state *statep, Elf_Scn *scn)
-{
- /* This cannot be implemented generally. There should have been a
- machine dependent implementation and we should never have arrived
- here. */
- error (EXIT_FAILURE, 0, gettext ("no machine specific '%s' implementation"),
- "initialize_plt");
-}
-
-
-static void
-ld_generic_initialize_pltrel (struct ld_state *statep, Elf_Scn *scn)
-{
- /* This cannot be implemented generally. There should have been a
- machine dependent implementation and we should never have arrived
- here. */
- error (EXIT_FAILURE, 0, gettext ("no machine specific '%s' implementation"),
- "initialize_pltrel");
-}
-
-
-static void
-ld_generic_initialize_got (struct ld_state *statep, Elf_Scn *scn)
-{
- /* This cannot be implemented generally. There should have been a
- machine dependent implementation and we should never have arrived
- here. */
- error (EXIT_FAILURE, 0, gettext ("no machine specific '%s' implementation"),
- "initialize_got");
-}
-
-
-static void
-ld_generic_initialize_gotplt (struct ld_state *statep, Elf_Scn *scn)
-{
- /* This cannot be implemented generally. There should have been a
- machine dependent implementation and we should never have arrived
- here. */
- error (EXIT_FAILURE, 0, gettext ("no machine specific '%s' implementation"),
- "initialize_gotplt");
-}
-
-
-static void
-ld_generic_finalize_plt (struct ld_state *statep, size_t nsym, size_t nsym_dyn,
- struct symbol **ndxtosymp)
-{
- /* By default we assume that nothing has to be done. */
-}
-
-
-static int
-ld_generic_rel_type (struct ld_state *statep)
-{
- /* This cannot be implemented generally. There should have been a
- machine dependent implementation and we should never have arrived
- here. */
- error (EXIT_FAILURE, 0, gettext ("no machine specific '%s' implementation"),
- "rel_type");
- /* Just to keep the compiler calm. */
- return 0;
-}
-
-
-static void
-ld_generic_count_relocations (struct ld_state *statep, struct scninfo *scninfo)
-{
- /* This cannot be implemented generally. There should have been a
- machine dependent implementation and we should never have arrived
- here. */
- error (EXIT_FAILURE, 0, gettext ("no machine specific '%s' implementation"),
- "count_relocations");
-}
-
-
-static void
-ld_generic_create_relocations (struct ld_state *statep,
- const Elf32_Word *dblindirect)
-{
- /* This cannot be implemented generally. There should have been a
- machine dependent implementation and we should never have arrived
- here. */
- error (EXIT_FAILURE, 0, gettext ("no machine specific '%s' implementation"),
- "create_relocations");
-}
diff --git a/src/ldlex.l b/src/ldlex.l
deleted file mode 100644
index 835c2dc..0000000
--- a/src/ldlex.l
+++ /dev/null
@@ -1,353 +0,0 @@
-%{
-/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2008 Red Hat, Inc.
- This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
-
- 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/>. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <assert.h>
-#include <ctype.h>
-#include <elf.h>
-#include <error.h>
-#include <inttypes.h>
-#include <libintl.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <system.h>
-#include <ld.h>
-#include "ldscript.h"
-
-/* We sure use no threads to read the stream, so use the _unlocked
- variants of the functions. */
-#undef getc
-#define getc(s) getc_unlocked (s)
-#undef ferror
-#define ferror(s) ferror_unlocked (s)
-#undef fread
-#define fread(b, m, n, s) fread_unlocked (b, m, n, s)
-#undef fwrite
-#define fwrite(b, m, n, s) fwrite_unlocked (b, m, n, s)
-
-/* ECHO must be redefined since the default implementation ignores
- the return value of fwrite_unlocked. */
-#define ECHO do { size_t n__ __attribute__ ((unused)) \
- = fwrite (yytext, yyleng, 1, yyout); } while (0)
-
-/* Defined in ld.c. */
-extern int ld_scan_version_script;
-
-#define MAX_PREPDEPTH 20
-static enum prepstate
-{
- prep_normal,
- skip_if,
- skip_to_endif
-} prepstate[MAX_PREPDEPTH];
-static int prepdepth;
-
-static void eat_comment (void);
-static void eat_to_eol (bool empty);
-static int attrib_convert (int c);
-static void push_state (enum prepstate);
-static int pop_state (void);
-static int handle_ifdef (void);
-static void invalid_char (int ch);
-%}
-
-ID [a-zA-Z0-9_.*?][a-zA-Z0-9_.*?-]*
-FILENAMECHAR1 [a-zA-Z0-9_/.\\~]
-FILENAMECHAR [^][{}[:space:]():;]+
-HEX 0[xX][0-9a-fA-F]+[kKmM]?
-OCT 0[0-7]*[kKmM]?
-DEC [0-9]+[kKmM]?
-WHITE [[:space:]]+
-
-%option yylineno
-%option never-interactive
-%option noyywrap
-
-%x IGNORE
-
-%%
- if (unlikely (ld_scan_version_script))
- {
- ld_scan_version_script = -1;
- return kVERSION_SCRIPT;
- }
-
-^"#"ifdef/[[:space:]] { BEGIN (handle_ifdef ()); }
-^"#"else/[[:space:]\n] { eat_to_eol (true);
- push_state (skip_to_endif);
- BEGIN (IGNORE); }
-^"#"elifdef/[[:space:]] { eat_to_eol (false);
- push_state (skip_to_endif);
- BEGIN (IGNORE); }
-^"#"endif/[[:space:]\n] { eat_to_eol (true) ; }
-
-<IGNORE>^"#"ifdef/[[:space:]\n] { eat_to_eol (false);
- push_state (skip_to_endif); }
-<IGNORE>^"#"else/[[:space:]\n] { eat_to_eol (true);
- assert (prepdepth > 0);
- if (prepstate[prepdepth - 1] == skip_if)
- {
- /* Back to normal processing. */
- assert (prepdepth == 1);
- BEGIN (pop_state ());
- }
- }
-<IGNORE>^"#"elifdef/[[:space:]] { assert (prepdepth > 0);
- if (prepstate[prepdepth - 1] == skip_if)
- {
- /* Maybe this symbol is defined. */
- pop_state ();
- BEGIN (handle_ifdef ());
- }
- }
-<IGNORE>^"#"endif/[[:space:]\n] { eat_to_eol (true);
- BEGIN (pop_state ()); }
-<IGNORE>.|\n { /* nothing */ }
-
-
-"/*" { eat_comment (); }
-
-ALIGN { return kALIGN; }
-AS_NEEDED { return kAS_NEEDED; }
-ENTRY { return kENTRY; }
-EXCLUDE_FILE { return kEXCLUDE_FILE; }
-"global:" { return kGLOBAL; }
-GROUP { return kGROUP; }
-INPUT { return kINPUT; }
-INTERP { return kINTERP; }
-KEEP { return kKEEP; }
-"local:" { return kLOCAL; }
-OUTPUT_FORMAT { return kOUTPUT_FORMAT; }
-PAGESIZE { return kPAGESIZE; }
-PROVIDE { return kPROVIDE; }
-SEARCH_DIR { return kSEARCH_DIR; }
-SEGMENT { return kSEGMENT; }
-SIZEOF_HEADERS { return kSIZEOF_HEADERS; }
-SORT { return kSORT; }
-VERSION { return kVERSION; }
-
-"["([RWX]){0,3}"]" { unsigned int cnt = 1 ;
- ldlval.num = 0;
- while (cnt < yyleng - 1)
- ldlval.num |= attrib_convert (yytext[cnt++]);
- return kMODE; }
-
-"{" { return '{'; }
-"}" { return '}'; }
-"(" { return '('; }
-")" { return ')'; }
-":" { return ':'; }
-";" { return ';'; }
-"=" { return '='; }
-"+" { ldlval.op = exp_plus; return kADD_OP; }
-"-" { ldlval.op = exp_minus; return kADD_OP; }
-"*" { return '*'; }
-"/" { ldlval.op = exp_div; return kMUL_OP; }
-"%" { ldlval.op = exp_mod; return kMUL_OP; }
-"&" { return '&'; }
-"|" { return '|'; }
-
-"," { return ','; }
-
-{HEX}|{OCT}|{DEC} { char *endp;
- ldlval.num = strtoumax (yytext, &endp, 0);
- if (*endp != '\0')
- {
- if (tolower (*endp) == 'k')
- ldlval.num *= 1024;
- else
- {
- assert (tolower (*endp) == 'm');
- ldlval.num *= 1024 * 1024;
- }
- }
- return kNUM; }
-
-{ID} { ldlval.str = obstack_strndup (&ld_state.smem,
- yytext, yyleng);
- return kID; }
-
-{FILENAMECHAR1}{FILENAMECHAR} { ldlval.str = obstack_strndup (&ld_state.smem,
- yytext, yyleng);
- return kFILENAME; }
-
-{WHITE} { /* IGNORE */ }
-
-. { invalid_char (*yytext); }
-
-%%
-
-static void
-eat_comment (void)
-{
- while (1)
- {
- int c = input ();
-
- while (c != '*' && c != EOF)
- c = input ();
-
- if (c == '*')
- {
- c = input ();
- while (c == '*')
- c = input ();
- if (c == '/')
- break;
- }
-
- if (c == EOF)
- {
- /* XXX Use the setjmp buffer and signal EOF in comment */
- error (0, 0, gettext ("EOF in comment"));
- break;
- }
- }
-}
-
-
-static void
-eat_to_eol (bool empty)
-{
- bool warned = false;
-
- while (1)
- {
- int c = input ();
-
- if (c == EOF)
- break;
- if (c == '\n')
- {
- ++yylineno;
- break;
- }
-
- if (empty && ! isspace (c) && ! warned)
- {
- error (0, 0, gettext ("%d: garbage at end of line"), yylineno);
- warned = true;
- }
- }
-}
-
-
-static int
-attrib_convert (int c)
-{
- if (c == 'X')
- return PF_X;
- if (c == 'W')
- return PF_W;
- assert (c == 'R');
- return PF_R;
-}
-
-
-static void
-push_state (enum prepstate state)
-{
- if (prepdepth >= MAX_PREPDEPTH)
- error (EXIT_FAILURE, 0, gettext ("%d: conditionals nested too deep"),
- yylineno);
-
- prepstate[prepdepth++] = state;
-}
-
-
-static int
-pop_state (void)
-{
- if (prepdepth == 0)
- error (0, 0, gettext ("%d: unexpected #endif"), yylineno);
- else
- --prepdepth;
-
- return prepdepth == 0 ? INITIAL : IGNORE;
-}
-
-
-static int
-handle_ifdef (void)
-{
- char idbuf[50];
- char *id = idbuf;
- size_t idlen = 0;
- size_t idmax = sizeof (idbuf);
- bool ignore_ws = true;
- bool defined = false;
- int result;
-
- while (1)
- {
- int c = input ();
-
- if (isspace (c) && ignore_ws)
- continue;
-
- if (c != '_' && (c < 'a' || c > 'z') && (c < 'A' || c > 'Z')
- && (idlen == 0 || c < '0' || c > '9'))
- {
- unput (c);
- break;
- }
-
- if (idlen == idmax)
- {
- char *newp = (char *) alloca (idmax *= 2);
- id = memcpy (newp, id, idlen);
- }
-
- id[idlen++] = c;
- ignore_ws = false;
- }
-
- /* XXX Compare in a better way. */
- if (idlen == 6 && strncmp (id, "SHARED", 6) == 0)
- defined = ld_state.file_type == dso_file_type;
-
- if (defined)
- result = INITIAL;
- else
- {
- push_state (skip_if);
- result = IGNORE;
- }
-
- return result;
-}
-
-
-static void
-invalid_char (int ch)
-{
- error (0, 0, (isascii (ch)
- ? gettext ("invalid character '%c' at line %d; ignored")
- : gettext ("invalid character '\\%o' at line %d; ignored")),
- ch, yylineno);
-}
-
-
-// Local Variables:
-// mode: C
-// End:
diff --git a/src/ldscript.y b/src/ldscript.y
deleted file mode 100644
index 3502ce1..0000000
--- a/src/ldscript.y
+++ /dev/null
@@ -1,803 +0,0 @@
-%{
-/* Parser for linker scripts.
- Copyright (C) 2001-2011 Red Hat, Inc.
- This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
-
- 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/>. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <assert.h>
-#include <error.h>
-#include <libintl.h>
-#include <stdbool.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <system.h>
-#include <ld.h>
-
-/* The error handler. */
-static void yyerror (const char *s);
-
-/* Some helper functions we need to construct the data structures
- describing information from the file. */
-static struct expression *new_expr (int tag);
-static struct input_section_name *new_input_section_name (const char *name,
- bool sort_flag);
-static struct input_rule *new_input_rule (int tag);
-static struct output_rule *new_output_rule (int tag);
-static struct assignment *new_assignment (const char *variable,
- struct expression *expression,
- bool provide_flag);
-static void new_segment (int mode, struct output_rule *output_rule);
-static struct filename_list *new_filename_listelem (const char *string);
-static void add_inputfiles (struct filename_list *fnames);
-static struct id_list *new_id_listelem (const char *str);
- static struct filename_list *mark_as_needed (struct filename_list *listp);
-static struct version *new_version (struct id_list *local,
- struct id_list *global);
-static struct version *merge_versions (struct version *one,
- struct version *two);
-static void add_versions (struct version *versions);
-
-extern int yylex (void);
-%}
-
-%union {
- uintmax_t num;
- enum expression_tag op;
- char *str;
- struct expression *expr;
- struct input_section_name *sectionname;
- struct filemask_section_name *filemask_section_name;
- struct input_rule *input_rule;
- struct output_rule *output_rule;
- struct assignment *assignment;
- struct filename_list *filename_list;
- struct version *version;
- struct id_list *id_list;
-}
-
-%token kADD_OP
-%token kALIGN
-%token kAS_NEEDED
-%token kENTRY
-%token kEXCLUDE_FILE
-%token <str> kFILENAME
-%token kGLOBAL
-%token kGROUP
-%token <str> kID
-%token kINPUT
-%token kINTERP
-%token kKEEP
-%token kLOCAL
-%token <num> kMODE
-%token kMUL_OP
-%token <num> kNUM
-%token kOUTPUT_FORMAT
-%token kPAGESIZE
-%token kPROVIDE
-%token kSEARCH_DIR
-%token kSEGMENT
-%token kSIZEOF_HEADERS
-%token kSORT
-%token kVERSION
-%token kVERSION_SCRIPT
-
-%left '|'
-%left '&'
-%left ADD_OP
-%left MUL_OP '*'
-
-%type <op> kADD_OP
-%type <op> kMUL_OP
-%type <str> filename_id
-%type <str> filename_id_star
-%type <str> exclude_opt
-%type <expr> expr
-%type <sectionname> sort_opt_name
-%type <filemask_section_name> sectionname
-%type <input_rule> inputsection
-%type <input_rule> inputsections
-%type <output_rule> outputsection
-%type <output_rule> outputsections
-%type <assignment> assignment
-%type <filename_list> filename_id_list
-%type <filename_list> filename_id_listelem
-%type <version> versionlist
-%type <version> version
-%type <version> version_stmt_list
-%type <version> version_stmt
-%type <id_list> filename_id_star_list
-
-%expect 16
-
-%%
-
-script_or_version:
- file
- | kVERSION_SCRIPT versionlist
- { add_versions ($2); }
- ;
-
-file: file content
- | content
- ;
-
-content: kENTRY '(' kID ')' ';'
- {
- if (likely (ld_state.entry == NULL))
- ld_state.entry = $3;
- }
- | kSEARCH_DIR '(' filename_id ')' ';'
- {
- ld_new_searchdir ($3);
- }
- | kPAGESIZE '(' kNUM ')' ';'
- {
- if (likely (ld_state.pagesize == 0))
- ld_state.pagesize = $3;
- }
- | kINTERP '(' filename_id ')' ';'
- {
- if (likely (ld_state.interp == NULL)
- && ld_state.file_type != dso_file_type)
- ld_state.interp = $3;
- }
- | kSEGMENT kMODE '{' outputsections '}'
- {
- new_segment ($2, $4);
- }
- | kSEGMENT error '{' outputsections '}'
- {
- fputs_unlocked (gettext ("mode for segment invalid\n"),
- stderr);
- new_segment (0, $4);
- }
- | kGROUP '(' filename_id_list ')'
- {
- /* First little optimization. If there is only one
- file in the group don't do anything. */
- if ($3 != $3->next)
- {
- $3->next->group_start = 1;
- $3->group_end = 1;
- }
- add_inputfiles ($3);
- }
- | kINPUT '(' filename_id_list ')'
- { add_inputfiles ($3); }
- | kAS_NEEDED '(' filename_id_list ')'
- { add_inputfiles (mark_as_needed ($3)); }
- | kVERSION '{' versionlist '}'
- { add_versions ($3); }
- | kOUTPUT_FORMAT '(' filename_id ')'
- { /* XXX TODO */ }
- ;
-
-outputsections: outputsections outputsection
- {
- $2->next = $1->next;
- $$ = $1->next = $2;
- }
- | outputsection
- { $$ = $1; }
- ;
-
-outputsection: assignment ';'
- {
- $$ = new_output_rule (output_assignment);
- $$->val.assignment = $1;
- }
- | kID '{' inputsections '}'
- {
- $$ = new_output_rule (output_section);
- $$->val.section.name = $1;
- $$->val.section.input = $3->next;
- if (ld_state.strip == strip_debug
- && ebl_debugscn_p (ld_state.ebl, $1))
- $$->val.section.ignored = true;
- else
- $$->val.section.ignored = false;
- $3->next = NULL;
- }
- | kID ';'
- {
- /* This is a short cut for "ID { *(ID) }". */
- $$ = new_output_rule (output_section);
- $$->val.section.name = $1;
- $$->val.section.input = new_input_rule (input_section);
- $$->val.section.input->next = NULL;
- $$->val.section.input->val.section =
- (struct filemask_section_name *)
- obstack_alloc (&ld_state.smem,
- sizeof (struct filemask_section_name));
- $$->val.section.input->val.section->filemask = NULL;
- $$->val.section.input->val.section->excludemask = NULL;
- $$->val.section.input->val.section->section_name =
- new_input_section_name ($1, false);
- $$->val.section.input->val.section->keep_flag = false;
- if (ld_state.strip == strip_debug
- && ebl_debugscn_p (ld_state.ebl, $1))
- $$->val.section.ignored = true;
- else
- $$->val.section.ignored = false;
- }
- ;
-
-assignment: kID '=' expr
- { $$ = new_assignment ($1, $3, false); }
- | kPROVIDE '(' kID '=' expr ')'
- { $$ = new_assignment ($3, $5, true); }
- ;
-
-inputsections: inputsections inputsection
- {
- $2->next = $1->next;
- $$ = $1->next = $2;
- }
- | inputsection
- { $$ = $1; }
- ;
-
-inputsection: sectionname
- {
- $$ = new_input_rule (input_section);
- $$->val.section = $1;
- }
- | kKEEP '(' sectionname ')'
- {
- $3->keep_flag = true;
-
- $$ = new_input_rule (input_section);
- $$->val.section = $3;
- }
- | assignment ';'
- {
- $$ = new_input_rule (input_assignment);
- $$->val.assignment = $1;
- }
- ;
-
-sectionname: filename_id_star '(' exclude_opt sort_opt_name ')'
- {
- $$ = (struct filemask_section_name *)
- obstack_alloc (&ld_state.smem, sizeof (*$$));
- $$->filemask = $1;
- $$->excludemask = $3;
- $$->section_name = $4;
- $$->keep_flag = false;
- }
- ;
-
-sort_opt_name: kID
- { $$ = new_input_section_name ($1, false); }
- | kSORT '(' kID ')'
- { $$ = new_input_section_name ($3, true); }
- ;
-
-exclude_opt: kEXCLUDE_FILE '(' filename_id ')'
- { $$ = $3; }
- |
- { $$ = NULL; }
- ;
-
-expr: kALIGN '(' expr ')'
- {
- $$ = new_expr (exp_align);
- $$->val.child = $3;
- }
- | '(' expr ')'
- { $$ = $2; }
- | expr '*' expr
- {
- $$ = new_expr (exp_mult);
- $$->val.binary.left = $1;
- $$->val.binary.right = $3;
- }
- | expr kMUL_OP expr
- {
- $$ = new_expr ($2);
- $$->val.binary.left = $1;
- $$->val.binary.right = $3;
- }
- | expr kADD_OP expr
- {
- $$ = new_expr ($2);
- $$->val.binary.left = $1;
- $$->val.binary.right = $3;
- }
- | expr '&' expr
- {
- $$ = new_expr (exp_and);
- $$->val.binary.left = $1;
- $$->val.binary.right = $3;
- }
- | expr '|' expr
- {
- $$ = new_expr (exp_or);
- $$->val.binary.left = $1;
- $$->val.binary.right = $3;
- }
- | kNUM
- {
- $$ = new_expr (exp_num);
- $$->val.num = $1;
- }
- | kID
- {
- $$ = new_expr (exp_id);
- $$->val.str = $1;
- }
- | kSIZEOF_HEADERS
- { $$ = new_expr (exp_sizeof_headers); }
- | kPAGESIZE
- { $$ = new_expr (exp_pagesize); }
- ;
-
-filename_id_list: filename_id_list comma_opt filename_id_listelem
- {
- $3->next = $1->next;
- $$ = $1->next = $3;
- }
- | filename_id_listelem
- { $$ = $1; }
- ;
-
-comma_opt: ','
- |
- ;
-
-filename_id_listelem: kGROUP '(' filename_id_list ')'
- {
- /* First little optimization. If there is only one
- file in the group don't do anything. */
- if ($3 != $3->next)
- {
- $3->next->group_start = 1;
- $3->group_end = 1;
- }
- $$ = $3;
- }
- | kAS_NEEDED '(' filename_id_list ')'
- { $$ = mark_as_needed ($3); }
- | filename_id
- { $$ = new_filename_listelem ($1); }
- ;
-
-
-versionlist: versionlist version
- {
- $2->next = $1->next;
- $$ = $1->next = $2;
- }
- | version
- { $$ = $1; }
- ;
-
-version: '{' version_stmt_list '}' ';'
- {
- $2->versionname = "";
- $2->parentname = NULL;
- $$ = $2;
- }
- | filename_id '{' version_stmt_list '}' ';'
- {
- $3->versionname = $1;
- $3->parentname = NULL;
- $$ = $3;
- }
- | filename_id '{' version_stmt_list '}' filename_id ';'
- {
- $3->versionname = $1;
- $3->parentname = $5;
- $$ = $3;
- }
- ;
-
-version_stmt_list:
- version_stmt_list version_stmt
- { $$ = merge_versions ($1, $2); }
- | version_stmt
- { $$ = $1; }
- ;
-
-version_stmt: kGLOBAL filename_id_star_list
- { $$ = new_version (NULL, $2); }
- | kLOCAL filename_id_star_list
- { $$ = new_version ($2, NULL); }
- ;
-
-filename_id_star_list:
- filename_id_star_list filename_id_star ';'
- {
- struct id_list *newp = new_id_listelem ($2);
- newp->next = $1->next;
- $$ = $1->next = newp;
- }
- | filename_id_star ';'
- { $$ = new_id_listelem ($1); }
- ;
-
-filename_id: kFILENAME
- { $$ = $1; }
- | kID
- { $$ = $1; }
- ;
-
-filename_id_star: filename_id
- { $$ = $1; }
- | '*'
- { $$ = NULL; }
- ;
-
-%%
-
-static void
-yyerror (const char *s)
-{
- error (0, 0, (ld_scan_version_script
- ? gettext ("while reading version script '%s': %s at line %d")
- : gettext ("while reading linker script '%s': %s at line %d")),
- ldin_fname, gettext (s), ldlineno);
-}
-
-
-static struct expression *
-new_expr (int tag)
-{
- struct expression *newp = (struct expression *)
- obstack_alloc (&ld_state.smem, sizeof (*newp));
-
- newp->tag = tag;
- return newp;
-}
-
-
-static struct input_section_name *
-new_input_section_name (const char *name, bool sort_flag)
-{
- struct input_section_name *newp = (struct input_section_name *)
- obstack_alloc (&ld_state.smem, sizeof (*newp));
-
- newp->name = name;
- newp->sort_flag = sort_flag;
- return newp;
-}
-
-
-static struct input_rule *
-new_input_rule (int tag)
-{
- struct input_rule *newp = (struct input_rule *)
- obstack_alloc (&ld_state.smem, sizeof (*newp));
-
- newp->tag = tag;
- newp->next = newp;
- return newp;
-}
-
-
-static struct output_rule *
-new_output_rule (int tag)
-{
- struct output_rule *newp = (struct output_rule *)
- memset (obstack_alloc (&ld_state.smem, sizeof (*newp)),
- '\0', sizeof (*newp));
-
- newp->tag = tag;
- newp->next = newp;
- return newp;
-}
-
-
-static struct assignment *
-new_assignment (const char *variable, struct expression *expression,
- bool provide_flag)
-{
- struct assignment *newp = (struct assignment *)
- obstack_alloc (&ld_state.smem, sizeof (*newp));
-
- newp->variable = variable;
- newp->expression = expression;
- newp->sym = NULL;
- newp->provide_flag = provide_flag;
-
- /* Insert the symbol into a hash table. We will later have to matc*/
- return newp;
-}
-
-
-static void
-new_segment (int mode, struct output_rule *output_rule)
-{
- struct output_segment *newp;
-
- newp
- = (struct output_segment *) obstack_alloc (&ld_state.smem, sizeof (*newp));
- newp->mode = mode;
- newp->next = newp;
-
- newp->output_rules = output_rule->next;
- output_rule->next = NULL;
-
- /* Enqueue the output segment description. */
- if (ld_state.output_segments == NULL)
- ld_state.output_segments = newp;
- else
- {
- newp->next = ld_state.output_segments->next;
- ld_state.output_segments = ld_state.output_segments->next = newp;
- }
-
- /* If the output file should be stripped of all symbol set the flag
- in the structures of all output sections. */
- if (mode == 0 && ld_state.strip == strip_all)
- {
- struct output_rule *runp;
-
- for (runp = newp->output_rules; runp != NULL; runp = runp->next)
- if (runp->tag == output_section)
- runp->val.section.ignored = true;
- }
-}
-
-
-static struct filename_list *
-new_filename_listelem (const char *string)
-{
- struct filename_list *newp;
-
- /* We use calloc and not the obstack since this object can be freed soon. */
- newp = (struct filename_list *) xcalloc (1, sizeof (*newp));
- newp->name = string;
- newp->next = newp;
- return newp;
-}
-
-
-static struct filename_list *
-mark_as_needed (struct filename_list *listp)
-{
- struct filename_list *runp = listp;
- do
- {
- runp->as_needed = true;
- runp = runp->next;
- }
- while (runp != listp);
-
- return listp;
-}
-
-
-static void
-add_inputfiles (struct filename_list *fnames)
-{
- assert (fnames != NULL);
-
- if (ld_state.srcfiles == NULL)
- ld_state.srcfiles = fnames;
- else
- {
- struct filename_list *first = ld_state.srcfiles->next;
-
- ld_state.srcfiles->next = fnames->next;
- fnames->next = first;
- ld_state.srcfiles->next = fnames;
- }
-}
-
-
-static _Bool
-special_char_p (const char *str)
-{
- while (*str != '\0')
- {
- if (__builtin_expect (*str == '*', 0)
- || __builtin_expect (*str == '?', 0)
- || __builtin_expect (*str == '[', 0))
- return true;
-
- ++str;
- }
-
- return false;
-}
-
-
-static struct id_list *
-new_id_listelem (const char *str)
-{
- struct id_list *newp;
-
- newp = (struct id_list *) obstack_alloc (&ld_state.smem, sizeof (*newp));
- if (str == NULL)
- newp->u.id_type = id_all;
- else if (__builtin_expect (special_char_p (str), false))
- newp->u.id_type = id_wild;
- else
- newp->u.id_type = id_str;
- newp->id = str;
- newp->next = newp;
-
- return newp;
-}
-
-
-static struct version *
-new_version (struct id_list *local, struct id_list *global)
-{
- struct version *newp;
-
- newp = (struct version *) obstack_alloc (&ld_state.smem, sizeof (*newp));
- newp->next = newp;
- newp->local_names = local;
- newp->global_names = global;
- newp->versionname = NULL;
- newp->parentname = NULL;
-
- return newp;
-}
-
-
-static struct version *
-merge_versions (struct version *one, struct version *two)
-{
- assert (two->local_names == NULL || two->global_names == NULL);
-
- if (two->local_names != NULL)
- {
- if (one->local_names == NULL)
- one->local_names = two->local_names;
- else
- {
- two->local_names->next = one->local_names->next;
- one->local_names = one->local_names->next = two->local_names;
- }
- }
- else
- {
- if (one->global_names == NULL)
- one->global_names = two->global_names;
- else
- {
- two->global_names->next = one->global_names->next;
- one->global_names = one->global_names->next = two->global_names;
- }
- }
-
- return one;
-}
-
-
-static void
-add_id_list (const char *versionname, struct id_list *runp, _Bool local)
-{
- struct id_list *lastp = runp;
-
- if (runp == NULL)
- /* Nothing to do. */
- return;
-
- /* Convert into a simple single-linked list. */
- runp = runp->next;
- assert (runp != NULL);
- lastp->next = NULL;
-
- do
- if (runp->u.id_type == id_str)
- {
- struct id_list *curp;
- struct id_list *defp;
- unsigned long int hval = elf_hash (runp->id);
-
- curp = runp;
- runp = runp->next;
-
- defp = ld_version_str_tab_find (&ld_state.version_str_tab, hval, curp);
- if (defp != NULL)
- {
- /* There is already a version definition for this symbol. */
- while (strcmp (defp->u.s.versionname, versionname) != 0)
- {
- if (defp->next == NULL)
- {
- /* No version like this so far. */
- defp->next = curp;
- curp->u.s.local = local;
- curp->u.s.versionname = versionname;
- curp->next = NULL;
- defp = NULL;
- break;
- }
-
- defp = defp->next;
- }
-
- if (defp != NULL && defp->u.s.local != local)
- error (EXIT_FAILURE, 0, versionname[0] == '\0'
- ? gettext ("\
-symbol '%s' is declared both local and global for unnamed version '%s'")
- : gettext ("\
-symbol '%s' is declared both local and global for version '%s'"),
- runp->id, versionname);
- }
- else
- {
- /* This is the first version definition for this symbol. */
- ld_version_str_tab_insert (&ld_state.version_str_tab, hval, curp);
-
- curp->u.s.local = local;
- curp->u.s.versionname = versionname;
- curp->next = NULL;
- }
- }
- else if (runp->u.id_type == id_all)
- {
- if (local)
- {
- if (ld_state.default_bind_global)
- error (EXIT_FAILURE, 0,
- gettext ("default visibility set as local and global"));
- ld_state.default_bind_local = true;
- }
- else
- {
- if (ld_state.default_bind_local)
- error (EXIT_FAILURE, 0,
- gettext ("default visibility set as local and global"));
- ld_state.default_bind_global = true;
- }
-
- runp = runp->next;
- }
- else
- {
- assert (runp->u.id_type == id_wild);
- /* XXX TBI */
- abort ();
- }
- while (runp != NULL);
-}
-
-
-static void
-add_versions (struct version *versions)
-{
- struct version *lastp = versions;
-
- if (versions == NULL)
- return;
-
- /* Convert into a simple single-linked list. */
- versions = versions->next;
- assert (versions != NULL);
- lastp->next = NULL;
-
- do
- {
- add_id_list (versions->versionname, versions->local_names, true);
- add_id_list (versions->versionname, versions->global_names, false);
-
- versions = versions->next;
- }
- while (versions != NULL);
-}
diff --git a/src/libld_elf_i386.map b/src/libld_elf_i386.map
deleted file mode 100644
index 703af6d..0000000
--- a/src/libld_elf_i386.map
+++ /dev/null
@@ -1,7 +0,0 @@
-ELFUTILS_1.0 {
- global:
- elf_i386_ld_init;
-
- local:
- *;
-};
diff --git a/src/nm.c b/src/nm.c
index 2911afa..969c6d3 100644
--- a/src/nm.c
+++ b/src/nm.c
@@ -41,15 +41,16 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <sys/param.h>
+#include <libeu.h>
#include <system.h>
+#include <color.h>
+#include <printversion.h>
#include "../libebl/libeblP.h"
#include "../libdwfl/libdwflP.h"
/* Name and version of program. */
-static void print_version (FILE *stream, struct argp_state *state);
ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
@@ -254,20 +255,6 @@
}
-/* Print the version information. */
-static void
-print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
-{
- fprintf (stream, "nm (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
- fprintf (stream, gettext ("\
-Copyright (C) %s Red Hat, Inc.\n\
-This is free software; see the source for copying conditions. There is NO\n\
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2012");
- fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
-}
-
-
/* Handle program arguments. */
static error_t
parse_opt (int key, char *arg,
@@ -1311,6 +1298,11 @@
XXX We can use a dirty trick here. Since GElf_Sym == Elf64_Sym we
can use the data memory instead of copying again if what we read
is a 64 bit file. */
+ if (nentries > SIZE_MAX / sizeof (GElf_SymX))
+ error (EXIT_FAILURE, 0,
+ gettext ("%s: entries (%zd) in section %zd `%s' is too large"),
+ fullname, nentries, elf_ndxscn (scn),
+ elf_strptr (ebl->elf, shstrndx, shdr->sh_name));
GElf_SymX *sym_mem;
if (nentries * sizeof (GElf_SymX) < MAX_STACK_ALLOC)
sym_mem = (GElf_SymX *) alloca (nentries * sizeof (GElf_SymX));
diff --git a/src/none_ld.c b/src/none_ld.c
deleted file mode 100644
index fb0f0fb..0000000
--- a/src/none_ld.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Nothing here. This is just a testimony of automake inflexibility. */
diff --git a/src/objdump.c b/src/objdump.c
index 0aa41e8..0dd9a6a 100644
--- a/src/objdump.c
+++ b/src/objdump.c
@@ -32,14 +32,15 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <sys/param.h>
+#include <libeu.h>
#include <system.h>
+#include <color.h>
+#include <printversion.h>
#include "../libebl/libeblP.h"
/* Name and version of program. */
-static void print_version (FILE *stream, struct argp_state *state);
ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
@@ -169,20 +170,6 @@
}
-/* Print the version information. */
-static void
-print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
-{
- fprintf (stream, "objdump (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
- fprintf (stream, gettext ("\
-Copyright (C) %s Red Hat, Inc.\n\
-This is free software; see the source for copying conditions. There is NO\n\
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2012");
- fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
-}
-
-
/* Handle program arguments. */
static error_t
parse_opt (int key, char *arg,
@@ -234,7 +221,9 @@
program_invocation_short_name);
exit (EXIT_FAILURE);
}
-
+ /* We only use this for checking the number of arguments, we don't
+ actually want to consume them. */
+ FALLTHROUGH;
default:
return ARGP_ERR_UNKNOWN;
}
diff --git a/src/ranlib.c b/src/ranlib.c
index c93c5ac..cc0ee23 100644
--- a/src/ranlib.c
+++ b/src/ranlib.c
@@ -35,10 +35,10 @@
#include <stdio_ext.h>
#include <unistd.h>
#include <sys/mman.h>
-#include <sys/param.h>
#include <sys/stat.h>
#include <system.h>
+#include <printversion.h>
#include "arlib.h"
@@ -48,7 +48,6 @@
/* Name and version of program. */
-static void print_version (FILE *stream, struct argp_state *state);
ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
@@ -116,20 +115,6 @@
}
-/* Print the version information. */
-static void
-print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
-{
- fprintf (stream, "ranlib (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
- fprintf (stream, gettext ("\
-Copyright (C) %s Red Hat, Inc.\n\
-This is free software; see the source for copying conditions. There is NO\n\
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2012");
- fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
-}
-
-
static int
copy_content (Elf *elf, int newfd, off_t off, size_t n)
{
diff --git a/src/readelf.c b/src/readelf.c
index 0db192e..faed61a 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -1,7 +1,6 @@
/* Print information from ELF file in human-readable form.
- Copyright (C) 1999-2015 Red Hat, Inc.
+ Copyright (C) 1999-2018 Red Hat, Inc.
This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 1999.
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
@@ -36,15 +35,19 @@
#include <locale.h>
#include <stdarg.h>
#include <stdbool.h>
+#include <stdio.h>
+#include <stdio_ext.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <time.h>
#include <unistd.h>
-#include <sys/param.h>
#include <sys/stat.h>
#include <signal.h>
+#include <libeu.h>
#include <system.h>
+#include <printversion.h>
#include "../libelf/libelfP.h"
#include "../libelf/common.h"
#include "../libebl/libeblP.h"
@@ -55,9 +58,22 @@
#include "../libdw/known-dwarf.h"
+#ifdef __linux__
+#define CORE_SIGILL SIGILL
+#define CORE_SIGBUS SIGBUS
+#define CORE_SIGFPE SIGFPE
+#define CORE_SIGSEGV SIGSEGV
+#define CORE_SI_USER SI_USER
+#else
+/* We want the linux version of those as that is what shows up in the core files. */
+#define CORE_SIGILL 4 /* Illegal instruction (ANSI). */
+#define CORE_SIGBUS 7 /* BUS error (4.2 BSD). */
+#define CORE_SIGFPE 8 /* Floating-point exception (ANSI). */
+#define CORE_SIGSEGV 11 /* Segmentation violation (ANSI). */
+#define CORE_SI_USER 0 /* Sent by kill, sigsend. */
+#endif
/* Name and version of program. */
-static void print_version (FILE *stream, struct argp_state *state);
ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
@@ -66,6 +82,13 @@
/* argp key value for --elf-section, non-ascii. */
#define ELF_INPUT_SECTION 256
+/* argp key value for --dwarf-skeleton, non-ascii. */
+#define DWARF_SKELETON 257
+
+/* Terrible hack for hooking unrelated skeleton/split compile units,
+ see __libdw_link_skel_split in print_debug. */
+static bool do_not_close_dwfl = false;
+
/* Definitions of arguments for argp functions. */
static const struct argp_option options[] =
{
@@ -73,6 +96,9 @@
{ "elf-section", ELF_INPUT_SECTION, "SECTION", OPTION_ARG_OPTIONAL,
N_("Use the named SECTION (default .gnu_debugdata) as (compressed) ELF "
"input data"), 0 },
+ { "dwarf-skeleton", DWARF_SKELETON, "FILE", 0,
+ N_("Used with -w to find the skeleton Compile Units in FILE associated "
+ "with the Split Compile units in a .dwo input file"), 0 },
{ NULL, 0, NULL, 0, N_("ELF output selection:"), 0 },
{ "all", 'a', NULL, 0,
N_("All these plus -p .strtab -p .dynstr -p .comment"), 0 },
@@ -83,9 +109,11 @@
{ "program-headers", 'l', NULL, 0, N_("Display the program headers"), 0 },
{ "segments", 'l', NULL, OPTION_ALIAS | OPTION_HIDDEN, NULL, 0 },
{ "relocs", 'r', NULL, 0, N_("Display relocations"), 0 },
+ { "section-groups", 'g', NULL, 0, N_("Display the section groups"), 0 },
{ "section-headers", 'S', NULL, 0, N_("Display the sections' headers"), 0 },
{ "sections", 'S', NULL, OPTION_ALIAS | OPTION_HIDDEN, NULL, 0 },
- { "symbols", 's', NULL, 0, N_("Display the symbol table"), 0 },
+ { "symbols", 's', "SECTION", OPTION_ARG_OPTIONAL,
+ N_("Display the symbol table sections"), 0 },
{ "version-info", 'V', NULL, 0, N_("Display versioning information"), 0 },
{ "notes", 'n', NULL, 0, N_("Display the ELF notes"), 0 },
{ "arch-specific", 'A', NULL, 0,
@@ -95,8 +123,8 @@
{ NULL, 0, NULL, 0, N_("Additional output selection:"), 0 },
{ "debug-dump", 'w', "SECTION", OPTION_ARG_OPTIONAL,
- N_("Display DWARF section content. SECTION can be one of abbrev, "
- "aranges, decodedaranges, frame, gdb_index, info, loc, line, "
+ N_("Display DWARF section content. SECTION can be one of abbrev, addr, "
+ "aranges, decodedaranges, frame, gdb_index, info, info+, loc, line, "
"decodedline, ranges, pubnames, str, macinfo, macro or exception"), 0 },
{ "hex-dump", 'x', "SECTION", 0,
N_("Dump the uninterpreted contents of SECTION, by number or name"), 0 },
@@ -137,6 +165,9 @@
/* If non-null, the section from which we should read to (compressed) ELF. */
static const char *elf_input_section = NULL;
+/* If non-null, the file that contains the skeleton CUs. */
+static const char *dwarf_skeleton = NULL;
+
/* Flags set by the option controlling the output. */
/* True if dynamic segment should be printed. */
@@ -157,6 +188,9 @@
/* True if the symbol table should be printed. */
static bool print_symbol_table;
+/* A specific section name, or NULL to print all symbol tables. */
+static char *symbol_table_section;
+
/* True if the version information should be printed. */
static bool print_version_info;
@@ -196,14 +230,16 @@
/* True if we want to show more information about compressed sections. */
static bool print_decompress = false;
+/* True if we want to show split compile units for debug_info skeletons. */
+static bool show_split_units = false;
+
/* Select printing of debugging sections. */
static enum section_e
{
section_abbrev = 1, /* .debug_abbrev */
section_aranges = 2, /* .debug_aranges */
section_frame = 4, /* .debug_frame or .eh_frame & al. */
- section_info = 8, /* .debug_info, .debug_types */
- section_types = section_info,
+ section_info = 8, /* .debug_info, (implies .debug_types) */
section_line = 16, /* .debug_line */
section_loc = 32, /* .debug_loc */
section_pubnames = 64, /* .debug_pubnames */
@@ -213,11 +249,13 @@
section_exception = 1024, /* .eh_frame & al. */
section_gdb_index = 2048, /* .gdb_index */
section_macro = 4096, /* .debug_macro */
+ section_addr = 8192, /* .debug_addr */
+ section_types = 16384, /* .debug_types (implied by .debug_info) */
section_all = (section_abbrev | section_aranges | section_frame
| section_info | section_line | section_loc
| section_pubnames | section_str | section_macinfo
| section_ranges | section_exception | section_gdb_index
- | section_macro)
+ | section_macro | section_addr | section_types)
} print_debug_sections, implicit_debug_sections;
/* Select hex dumping of sections. */
@@ -271,15 +309,26 @@
static void dump_archive_index (Elf *, const char *);
+/* Looked up once with gettext in main. */
+static char *yes_str;
+static char *no_str;
+
int
main (int argc, char *argv[])
{
+ /* We use no threads here which can interfere with handling a stream. */
+ (void) __fsetlocking (stdout, FSETLOCKING_BYCALLER);
+
/* Set locale. */
setlocale (LC_ALL, "");
/* Initialize the message catalog. */
textdomain (PACKAGE_TARNAME);
+ /* Look up once. */
+ yes_str = gettext ("yes");
+ no_str = gettext ("no");
+
/* Parse and process arguments. */
int remaining;
argp_parse (&argp, argc, argv, 0, &remaining, NULL);
@@ -389,6 +438,7 @@
case 's':
print_symbol_table = true;
any_control_option = true;
+ symbol_table_section = arg;
break;
case 'V':
print_version_info = true;
@@ -399,9 +449,18 @@
break;
case 'w':
if (arg == NULL)
- print_debug_sections = section_all;
+ {
+ print_debug_sections = section_all;
+ implicit_debug_sections = section_info;
+ show_split_units = true;
+ }
else if (strcmp (arg, "abbrev") == 0)
print_debug_sections |= section_abbrev;
+ else if (strcmp (arg, "addr") == 0)
+ {
+ print_debug_sections |= section_addr;
+ implicit_debug_sections |= section_info;
+ }
else if (strcmp (arg, "aranges") == 0)
print_debug_sections |= section_aranges;
else if (strcmp (arg, "decodedaranges") == 0)
@@ -417,7 +476,16 @@
else if (strcmp (arg, "frame") == 0 || strcmp (arg, "frames") == 0)
print_debug_sections |= section_frame;
else if (strcmp (arg, "info") == 0)
- print_debug_sections |= section_info;
+ {
+ print_debug_sections |= section_info;
+ print_debug_sections |= section_types;
+ }
+ else if (strcmp (arg, "info+") == 0)
+ {
+ print_debug_sections |= section_info;
+ print_debug_sections |= section_types;
+ show_split_units = true;
+ }
else if (strcmp (arg, "loc") == 0)
{
print_debug_sections |= section_loc;
@@ -433,7 +501,11 @@
else if (strcmp (arg, "pubnames") == 0)
print_debug_sections |= section_pubnames;
else if (strcmp (arg, "str") == 0)
- print_debug_sections |= section_str;
+ {
+ print_debug_sections |= section_str;
+ /* For mapping string offset tables to CUs. */
+ implicit_debug_sections |= section_info;
+ }
else if (strcmp (arg, "macinfo") == 0)
print_debug_sections |= section_macinfo;
else if (strcmp (arg, "macro") == 0)
@@ -459,7 +531,7 @@
print_string_sections = true;
break;
}
- /* Fall through. */
+ FALLTHROUGH;
case 'x':
add_dump_section (arg, false);
any_control_option = true;
@@ -494,6 +566,9 @@
else
elf_input_section = arg;
break;
+ case DWARF_SKELETON:
+ dwarf_skeleton = arg;
+ break;
default:
return ARGP_ERR_UNKNOWN;
}
@@ -501,20 +576,6 @@
}
-/* Print the version information. */
-static void
-print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
-{
- fprintf (stream, "readelf (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
- fprintf (stream, gettext ("\
-Copyright (C) %s Red Hat, Inc.\n\
-This is free software; see the source for copying conditions. There is NO\n\
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2012");
- fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
-}
-
-
/* Create a file descriptor to read the data from the
elf_input_section given a file descriptor to an ELF file. */
static int
@@ -730,31 +791,9 @@
debuglink_crc, debuginfo_file_name);
}
-/* Process one input file. */
-static void
-process_file (int fd, const char *fname, bool only_one)
+static Dwfl *
+create_dwfl (int fd, const char *fname)
{
- if (print_archive_index)
- check_archive_index (fd, fname, only_one);
-
- if (!any_control_option)
- return;
-
- if (elf_input_section != NULL)
- {
- /* Replace fname and fd with section content. */
- char *fnname = alloca (strlen (fname) + strlen (elf_input_section) + 2);
- sprintf (fnname, "%s:%s", fname, elf_input_section);
- fd = open_input_section (fd);
- if (fd == -1)
- {
- error (0, 0, gettext ("No such section '%s' in '%s'"),
- elf_input_section, fname);
- return;
- }
- fname = fnname;
- }
-
/* Duplicate an fd for dwfl_report_offline to swallow. */
int dwfl_fd = dup (fd);
if (unlikely (dwfl_fd < 0))
@@ -782,11 +821,42 @@
error (0, 0, gettext ("failed reading '%s': %s"),
fname, dwfl_errmsg (-1));
close (dwfl_fd); /* Consumed on success, not on failure. */
+ dwfl = NULL;
}
else
- {
- dwfl_report_end (dwfl, NULL, NULL);
+ dwfl_report_end (dwfl, NULL, NULL);
+ return dwfl;
+}
+
+/* Process one input file. */
+static void
+process_file (int fd, const char *fname, bool only_one)
+{
+ if (print_archive_index)
+ check_archive_index (fd, fname, only_one);
+
+ if (!any_control_option)
+ return;
+
+ if (elf_input_section != NULL)
+ {
+ /* Replace fname and fd with section content. */
+ char *fnname = alloca (strlen (fname) + strlen (elf_input_section) + 2);
+ sprintf (fnname, "%s:%s", fname, elf_input_section);
+ fd = open_input_section (fd);
+ if (fd == -1)
+ {
+ error (0, 0, gettext ("No such section '%s' in '%s'"),
+ elf_input_section, fname);
+ return;
+ }
+ fname = fnname;
+ }
+
+ Dwfl *dwfl = create_dwfl (fd, fname);
+ if (dwfl != NULL)
+ {
if (only_one)
{
/* Clear ONLY_ONE if we have multiple modules, from an archive. */
@@ -798,7 +868,10 @@
struct process_dwflmod_args a = { .fd = fd, .only_one = only_one };
dwfl_getmodules (dwfl, &process_dwflmod, &a, 0);
}
- dwfl_end (dwfl);
+ /* Terrible hack for hooking unrelated skeleton/split compile units,
+ see __libdw_link_skel_split in print_debug. */
+ if (! do_not_close_dwfl)
+ dwfl_end (dwfl);
/* Need to close the replaced fd if we created it. Caller takes
care of original. */
@@ -1529,6 +1602,11 @@
gettext ("Couldn't uncompress section"),
elf_ndxscn (scn));
shdr = gelf_getshdr (scn, &shdr_mem);
+ if (unlikely (shdr == NULL))
+ error (EXIT_FAILURE, 0,
+ gettext ("cannot get section [%zd] header: %s"),
+ elf_ndxscn (scn),
+ elf_errmsg (-1));
}
handle_scngrp (ebl, scn, shdr);
}
@@ -2231,6 +2309,19 @@
if (shdr != NULL && shdr->sh_type == (GElf_Word) type)
{
+ if (symbol_table_section != NULL)
+ {
+ /* Get the section header string table index. */
+ size_t shstrndx;
+ const char *sname;
+ if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
+ error (EXIT_FAILURE, 0,
+ gettext ("cannot get section header string table index"));
+ sname = elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
+ if (sname == NULL || strcmp (sname, symbol_table_section) != 0)
+ continue;
+ }
+
if ((shdr->sh_flags & SHF_COMPRESSED) != 0)
{
if (elf_compress (scn, 0, 0) < 0)
@@ -2238,6 +2329,10 @@
gettext ("Couldn't uncompress section"),
elf_ndxscn (scn));
shdr = gelf_getshdr (scn, &shdr_mem);
+ if (unlikely (shdr == NULL))
+ error (EXIT_FAILURE, 0,
+ gettext ("cannot get section [%zd] header: %s"),
+ elf_ndxscn (scn), elf_errmsg (-1));
}
handle_symtab (ebl, scn, shdr);
}
@@ -3112,9 +3207,18 @@
for (Elf32_Word cnt = 0; cnt < nbucket; ++cnt)
{
Elf32_Word inner = bucket[cnt];
+ Elf32_Word chain_len = 0;
while (inner > 0 && inner < nchain)
{
++nsyms;
+ ++chain_len;
+ if (chain_len > nchain)
+ {
+ error (0, 0, gettext ("invalid chain in sysv.hash section %d"),
+ (int) elf_ndxscn (scn));
+ free (lengths);
+ return;
+ }
if (maxlength < ++lengths[cnt])
++maxlength;
@@ -3169,9 +3273,18 @@
for (Elf64_Xword cnt = 0; cnt < nbucket; ++cnt)
{
Elf64_Xword inner = bucket[cnt];
+ Elf64_Xword chain_len = 0;
while (inner > 0 && inner < nchain)
{
++nsyms;
+ ++chain_len;
+ if (chain_len > nchain)
+ {
+ error (0, 0, gettext ("invalid chain in sysv.hash64 section %d"),
+ (int) elf_ndxscn (scn));
+ free (lengths);
+ return;
+ }
if (maxlength < ++lengths[cnt])
++maxlength;
@@ -3250,7 +3363,7 @@
++nsyms;
if (maxlength < ++lengths[cnt])
++maxlength;
- if (inner > max_nsyms)
+ if (inner >= max_nsyms)
goto invalid_data;
}
while ((chain[inner++] & 1) == 0);
@@ -3317,6 +3430,10 @@
gettext ("Couldn't uncompress section"),
elf_ndxscn (scn));
shdr = gelf_getshdr (scn, &shdr_mem);
+ if (unlikely (shdr == NULL))
+ error (EXIT_FAILURE, 0,
+ gettext ("cannot get section [%zd] header: %s"),
+ elf_ndxscn (scn), elf_errmsg (-1));
}
if (shdr->sh_type == SHT_HASH)
@@ -3588,9 +3705,9 @@
}
-static char *
-format_dwarf_addr (Dwfl_Module *dwflmod,
- int address_size, Dwarf_Addr address, Dwarf_Addr raw)
+void
+print_dwarf_addr (Dwfl_Module *dwflmod,
+ int address_size, Dwarf_Addr address, Dwarf_Addr raw)
{
/* See if there is a name we can give for this address. */
GElf_Sym sym;
@@ -3616,61 +3733,41 @@
: dwfl_module_relocation_info (dwflmod, i, NULL));
}
- char *result;
if ((name != NULL
? (off != 0
? (scn != NULL
? (address_size == 0
- ? asprintf (&result,
- gettext ("%s+%#" PRIx64 " <%s+%#" PRIx64 ">"),
- scn, address, name, off)
- : asprintf (&result,
- gettext ("%s+%#0*" PRIx64 " <%s+%#" PRIx64 ">"),
- scn, 2 + address_size * 2, address,
- name, off))
+ ? printf ("%s+%#" PRIx64 " <%s+%#" PRIx64 ">",
+ scn, address, name, off)
+ : printf ("%s+%#0*" PRIx64 " <%s+%#" PRIx64 ">",
+ scn, 2 + address_size * 2, address,
+ name, off))
: (address_size == 0
- ? asprintf (&result,
- gettext ("%#" PRIx64 " <%s+%#" PRIx64 ">"),
- address, name, off)
- : asprintf (&result,
- gettext ("%#0*" PRIx64 " <%s+%#" PRIx64 ">"),
- 2 + address_size * 2, address,
- name, off)))
+ ? printf ("%#" PRIx64 " <%s+%#" PRIx64 ">",
+ address, name, off)
+ : printf ("%#0*" PRIx64 " <%s+%#" PRIx64 ">",
+ 2 + address_size * 2, address,
+ name, off)))
: (scn != NULL
? (address_size == 0
- ? asprintf (&result,
- gettext ("%s+%#" PRIx64 " <%s>"),
- scn, address, name)
- : asprintf (&result,
- gettext ("%s+%#0*" PRIx64 " <%s>"),
- scn, 2 + address_size * 2, address, name))
+ ? printf ("%s+%#" PRIx64 " <%s>", scn, address, name)
+ : printf ("%s+%#0*" PRIx64 " <%s>",
+ scn, 2 + address_size * 2, address, name))
: (address_size == 0
- ? asprintf (&result,
- gettext ("%#" PRIx64 " <%s>"),
- address, name)
- : asprintf (&result,
- gettext ("%#0*" PRIx64 " <%s>"),
- 2 + address_size * 2, address, name))))
+ ? printf ("%#" PRIx64 " <%s>", address, name)
+ : printf ("%#0*" PRIx64 " <%s>",
+ 2 + address_size * 2, address, name))))
: (scn != NULL
? (address_size == 0
- ? asprintf (&result,
- gettext ("%s+%#" PRIx64),
- scn, address)
- : asprintf (&result,
- gettext ("%s+%#0*" PRIx64),
- scn, 2 + address_size * 2, address))
+ ? printf ("%s+%#" PRIx64, scn, address)
+ : printf ("%s+%#0*" PRIx64, scn, 2 + address_size * 2, address))
: (address_size == 0
- ? asprintf (&result,
- "%#" PRIx64,
- address)
- : asprintf (&result,
- "%#0*" PRIx64,
- 2 + address_size * 2, address)))) < 0)
- error (EXIT_FAILURE, 0, _("memory exhausted"));
-
- return result;
+ ? printf ("%#" PRIx64, address)
+ : printf ("%#0*" PRIx64, 2 + address_size * 2, address)))) < 0)
+ error (EXIT_FAILURE, 0, _("sprintf failure"));
}
+
static const char *
dwarf_tag_string (unsigned int tag)
{
@@ -3779,6 +3876,23 @@
static const char *
+dwarf_defaulted_string (unsigned int code)
+{
+ static const char *const known[] =
+ {
+#define DWARF_ONE_KNOWN_DW_DEFAULTED(NAME, CODE) [CODE] = #NAME,
+ DWARF_ALL_KNOWN_DW_DEFAULTED
+#undef DWARF_ONE_KNOWN_DW_DEFAULTED
+ };
+
+ if (likely (code < sizeof (known) / sizeof (known[0])))
+ return known[code];
+
+ return NULL;
+}
+
+
+static const char *
dwarf_visibility_string (unsigned int code)
{
static const char *const known[] =
@@ -3900,6 +4014,62 @@
}
+static const char *
+dwarf_unit_string (unsigned int type)
+{
+ switch (type)
+ {
+#define DWARF_ONE_KNOWN_DW_UT(NAME, CODE) case CODE: return #NAME;
+ DWARF_ALL_KNOWN_DW_UT
+#undef DWARF_ONE_KNOWN_DW_UT
+ default:
+ return NULL;
+ }
+}
+
+
+static const char *
+dwarf_range_list_encoding_string (unsigned int kind)
+{
+ switch (kind)
+ {
+#define DWARF_ONE_KNOWN_DW_RLE(NAME, CODE) case CODE: return #NAME;
+ DWARF_ALL_KNOWN_DW_RLE
+#undef DWARF_ONE_KNOWN_DW_RLE
+ default:
+ return NULL;
+ }
+}
+
+
+static const char *
+dwarf_loc_list_encoding_string (unsigned int kind)
+{
+ switch (kind)
+ {
+#define DWARF_ONE_KNOWN_DW_LLE(NAME, CODE) case CODE: return #NAME;
+ DWARF_ALL_KNOWN_DW_LLE
+#undef DWARF_ONE_KNOWN_DW_LLE
+ default:
+ return NULL;
+ }
+}
+
+
+static const char *
+dwarf_line_content_description_string (unsigned int kind)
+{
+ switch (kind)
+ {
+#define DWARF_ONE_KNOWN_DW_LNCT(NAME, CODE) case CODE: return #NAME;
+ DWARF_ALL_KNOWN_DW_LNCT
+#undef DWARF_ONE_KNOWN_DW_LNCT
+ default:
+ return NULL;
+ }
+}
+
+
/* Used by all dwarf_foo_name functions. */
static const char *
string_or_unknown (const char *known, unsigned int code,
@@ -3984,6 +4154,14 @@
static const char *
+dwarf_defaulted_name (unsigned int code)
+{
+ const char *ret = dwarf_defaulted_string (code);
+ return string_or_unknown (ret, code, 0, 0, false);
+}
+
+
+static const char *
dwarf_visibility_name (unsigned int code)
{
const char *ret = dwarf_visibility_string (code);
@@ -4031,6 +4209,39 @@
}
+static const char *
+dwarf_unit_name (unsigned int type)
+{
+ const char *ret = dwarf_unit_string (type);
+ return string_or_unknown (ret, type, DW_UT_lo_user, DW_UT_hi_user, true);
+}
+
+
+static const char *
+dwarf_range_list_encoding_name (unsigned int kind)
+{
+ const char *ret = dwarf_range_list_encoding_string (kind);
+ return string_or_unknown (ret, kind, 0, 0, false);
+}
+
+
+static const char *
+dwarf_loc_list_encoding_name (unsigned int kind)
+{
+ const char *ret = dwarf_loc_list_encoding_string (kind);
+ return string_or_unknown (ret, kind, 0, 0, false);
+}
+
+
+static const char *
+dwarf_line_content_description_name (unsigned int kind)
+{
+ const char *ret = dwarf_line_content_description_string (kind);
+ return string_or_unknown (ret, kind, DW_LNCT_lo_user, DW_LNCT_hi_user,
+ false);
+}
+
+
static void
print_block (size_t n, const void *block)
{
@@ -4048,6 +4259,43 @@
}
static void
+print_bytes (size_t n, const unsigned char *bytes)
+{
+ while (n-- > 0)
+ {
+ printf ("%02x", *bytes++);
+ if (n > 0)
+ printf (" ");
+ }
+}
+
+static int
+get_indexed_addr (Dwarf_CU *cu, Dwarf_Word idx, Dwarf_Addr *addr)
+{
+ if (cu == NULL)
+ return -1;
+
+ Elf_Data *debug_addr = cu->dbg->sectiondata[IDX_debug_addr];
+ if (debug_addr == NULL)
+ return -1;
+
+ Dwarf_Off base = __libdw_cu_addr_base (cu);
+ Dwarf_Word off = idx * cu->address_size;
+ if (base > debug_addr->d_size
+ || off > debug_addr->d_size - base
+ || cu->address_size > debug_addr->d_size - base - off)
+ return -1;
+
+ const unsigned char *addrp = debug_addr->d_buf + base + off;
+ if (cu->address_size == 4)
+ *addr = read_4ubyte_unaligned (cu->dbg, addrp);
+ else
+ *addr = read_8ubyte_unaligned (cu->dbg, addrp);
+
+ return 0;
+}
+
+static void
print_ops (Dwfl_Module *dwflmod, Dwarf *dbg, int indent, int indentrest,
unsigned int vers, unsigned int addrsize, unsigned int offset_size,
struct Dwarf_CU *cu, Dwarf_Word len, const unsigned char *data)
@@ -4094,15 +4342,16 @@
data += addrsize;
CONSUME (addrsize);
- char *a = format_dwarf_addr (dwflmod, 0, addr, addr);
- printf ("%*s[%4" PRIuMAX "] %s %s\n",
- indent, "", (uintmax_t) offset, op_name, a);
- free (a);
+ printf ("%*s[%2" PRIuMAX "] %s ",
+ indent, "", (uintmax_t) offset, op_name);
+ print_dwarf_addr (dwflmod, 0, addr, addr);
+ printf ("\n");
offset += 1 + addrsize;
break;
case DW_OP_call_ref:
+ case DW_OP_GNU_variable_value:
/* Offset operand. */
if (ref_size != 4 && ref_size != 8)
goto invalid; /* Cannot be used in CFA. */
@@ -4113,8 +4362,8 @@
addr = read_8ubyte_unaligned (dbg, data);
data += ref_size;
CONSUME (ref_size);
-
- printf ("%*s[%4" PRIuMAX "] %s %#" PRIxMAX "\n",
+ /* addr is a DIE offset, so format it as one. */
+ printf ("%*s[%2" PRIuMAX "] %s [%6" PRIxMAX "]\n",
indent, "", (uintmax_t) offset,
op_name, (uintmax_t) addr);
offset += 1 + ref_size;
@@ -4126,7 +4375,7 @@
case DW_OP_const1u:
// XXX value might be modified by relocation
NEED (1);
- printf ("%*s[%4" PRIuMAX "] %s %" PRIu8 "\n",
+ printf ("%*s[%2" PRIuMAX "] %s %" PRIu8 "\n",
indent, "", (uintmax_t) offset,
op_name, *((uint8_t *) data));
++data;
@@ -4137,7 +4386,7 @@
case DW_OP_const2u:
NEED (2);
// XXX value might be modified by relocation
- printf ("%*s[%4" PRIuMAX "] %s %" PRIu16 "\n",
+ printf ("%*s[%2" PRIuMAX "] %s %" PRIu16 "\n",
indent, "", (uintmax_t) offset,
op_name, read_2ubyte_unaligned (dbg, data));
CONSUME (2);
@@ -4148,7 +4397,7 @@
case DW_OP_const4u:
NEED (4);
// XXX value might be modified by relocation
- printf ("%*s[%4" PRIuMAX "] %s %" PRIu32 "\n",
+ printf ("%*s[%2" PRIuMAX "] %s %" PRIu32 "\n",
indent, "", (uintmax_t) offset,
op_name, read_4ubyte_unaligned (dbg, data));
CONSUME (4);
@@ -4159,7 +4408,7 @@
case DW_OP_const8u:
NEED (8);
// XXX value might be modified by relocation
- printf ("%*s[%4" PRIuMAX "] %s %" PRIu64 "\n",
+ printf ("%*s[%2" PRIuMAX "] %s %" PRIu64 "\n",
indent, "", (uintmax_t) offset,
op_name, (uint64_t) read_8ubyte_unaligned (dbg, data));
CONSUME (8);
@@ -4170,7 +4419,7 @@
case DW_OP_const1s:
NEED (1);
// XXX value might be modified by relocation
- printf ("%*s[%4" PRIuMAX "] %s %" PRId8 "\n",
+ printf ("%*s[%2" PRIuMAX "] %s %" PRId8 "\n",
indent, "", (uintmax_t) offset,
op_name, *((int8_t *) data));
++data;
@@ -4181,7 +4430,7 @@
case DW_OP_const2s:
NEED (2);
// XXX value might be modified by relocation
- printf ("%*s[%4" PRIuMAX "] %s %" PRId16 "\n",
+ printf ("%*s[%2" PRIuMAX "] %s %" PRId16 "\n",
indent, "", (uintmax_t) offset,
op_name, read_2sbyte_unaligned (dbg, data));
CONSUME (2);
@@ -4192,7 +4441,7 @@
case DW_OP_const4s:
NEED (4);
// XXX value might be modified by relocation
- printf ("%*s[%4" PRIuMAX "] %s %" PRId32 "\n",
+ printf ("%*s[%2" PRIuMAX "] %s %" PRId32 "\n",
indent, "", (uintmax_t) offset,
op_name, read_4sbyte_unaligned (dbg, data));
CONSUME (4);
@@ -4203,7 +4452,7 @@
case DW_OP_const8s:
NEED (8);
// XXX value might be modified by relocation
- printf ("%*s[%4" PRIuMAX "] %s %" PRId64 "\n",
+ printf ("%*s[%2" PRIuMAX "] %s %" PRId64 "\n",
indent, "", (uintmax_t) offset,
op_name, read_8sbyte_unaligned (dbg, data));
CONSUME (8);
@@ -4219,12 +4468,32 @@
uint64_t uleb;
NEED (1);
get_uleb128 (uleb, data, data + len);
- printf ("%*s[%4" PRIuMAX "] %s %" PRIu64 "\n",
+ printf ("%*s[%2" PRIuMAX "] %s %" PRIu64 "\n",
indent, "", (uintmax_t) offset, op_name, uleb);
CONSUME (data - start);
offset += 1 + (data - start);
break;
+ case DW_OP_addrx:
+ case DW_OP_GNU_addr_index:
+ case DW_OP_constx:
+ case DW_OP_GNU_const_index:;
+ start = data;
+ NEED (1);
+ get_uleb128 (uleb, data, data + len);
+ printf ("%*s[%2" PRIuMAX "] %s [%" PRIu64 "] ",
+ indent, "", (uintmax_t) offset, op_name, uleb);
+ CONSUME (data - start);
+ offset += 1 + (data - start);
+ if (get_indexed_addr (cu, uleb, &addr) != 0)
+ printf ("???\n");
+ else
+ {
+ print_dwarf_addr (dwflmod, 0, addr, addr);
+ printf ("\n");
+ }
+ break;
+
case DW_OP_bit_piece:
start = data;
uint64_t uleb2;
@@ -4232,7 +4501,7 @@
get_uleb128 (uleb, data, data + len);
NEED (1);
get_uleb128 (uleb2, data, data + len);
- printf ("%*s[%4" PRIuMAX "] %s %" PRIu64 ", %" PRIu64 "\n",
+ printf ("%*s[%2" PRIuMAX "] %s %" PRIu64 ", %" PRIu64 "\n",
indent, "", (uintmax_t) offset, op_name, uleb, uleb2);
CONSUME (data - start);
offset += 1 + (data - start);
@@ -4245,7 +4514,7 @@
int64_t sleb;
NEED (1);
get_sleb128 (sleb, data, data + len);
- printf ("%*s[%4" PRIuMAX "] %s %" PRId64 "\n",
+ printf ("%*s[%2" PRIuMAX "] %s %" PRId64 "\n",
indent, "", (uintmax_t) offset, op_name, sleb);
CONSUME (data - start);
offset += 1 + (data - start);
@@ -4257,7 +4526,7 @@
get_uleb128 (uleb, data, data + len);
NEED (1);
get_sleb128 (sleb, data, data + len);
- printf ("%*s[%4" PRIuMAX "] %s %" PRIu64 " %" PRId64 "\n",
+ printf ("%*s[%2" PRIuMAX "] %s %" PRIu64 " %" PRId64 "\n",
indent, "", (uintmax_t) offset, op_name, uleb, sleb);
CONSUME (data - start);
offset += 1 + (data - start);
@@ -4265,26 +4534,28 @@
case DW_OP_call2:
NEED (2);
- printf ("%*s[%4" PRIuMAX "] %s %" PRIu16 "\n",
+ printf ("%*s[%2" PRIuMAX "] %s [%6" PRIx16 "]\n",
indent, "", (uintmax_t) offset, op_name,
read_2ubyte_unaligned (dbg, data));
CONSUME (2);
+ data += 2;
offset += 3;
break;
case DW_OP_call4:
NEED (4);
- printf ("%*s[%4" PRIuMAX "] %s %" PRIu32 "\n",
+ printf ("%*s[%2" PRIuMAX "] %s [%6" PRIx32 "]\n",
indent, "", (uintmax_t) offset, op_name,
read_4ubyte_unaligned (dbg, data));
CONSUME (4);
+ data += 4;
offset += 5;
break;
case DW_OP_skip:
case DW_OP_bra:
NEED (2);
- printf ("%*s[%4" PRIuMAX "] %s %" PRIuMAX "\n",
+ printf ("%*s[%2" PRIuMAX "] %s %" PRIuMAX "\n",
indent, "", (uintmax_t) offset, op_name,
(uintmax_t) (offset + read_2sbyte_unaligned (dbg, data) + 3));
CONSUME (2);
@@ -4296,7 +4567,7 @@
start = data;
NEED (1);
get_uleb128 (uleb, data, data + len);
- printf ("%*s[%4" PRIuMAX "] %s: ",
+ printf ("%*s[%2" PRIuMAX "] %s: ",
indent, "", (uintmax_t) offset, op_name);
NEED (uleb);
print_block (uleb, data);
@@ -4305,6 +4576,7 @@
offset += 1 + (data - start);
break;
+ case DW_OP_implicit_pointer:
case DW_OP_GNU_implicit_pointer:
/* DIE offset operand. */
start = data;
@@ -4320,28 +4592,30 @@
NEED (1);
get_sleb128 (sleb, data, data + len);
- printf ("%*s[%4" PRIuMAX "] %s [%6" PRIxMAX "] %+" PRId64 "\n",
+ printf ("%*s[%2" PRIuMAX "] %s [%6" PRIxMAX "] %+" PRId64 "\n",
indent, "", (intmax_t) offset,
op_name, (uintmax_t) addr, sleb);
CONSUME (data - start);
offset += 1 + (data - start);
break;
+ case DW_OP_entry_value:
case DW_OP_GNU_entry_value:
/* Size plus expression block. */
start = data;
NEED (1);
get_uleb128 (uleb, data, data + len);
- printf ("%*s[%4" PRIuMAX "] %s:\n",
+ printf ("%*s[%2" PRIuMAX "] %s:\n",
indent, "", (uintmax_t) offset, op_name);
NEED (uleb);
- print_ops (dwflmod, dbg, indent + 6, indent + 6, vers,
+ print_ops (dwflmod, dbg, indent + 5, indent + 5, vers,
addrsize, offset_size, cu, uleb, data);
data += uleb;
CONSUME (data - start);
offset += 1 + (data - start);
break;
+ case DW_OP_const_type:
case DW_OP_GNU_const_type:
/* uleb128 CU relative DW_TAG_base_type DIE offset, 1-byte
unsigned size plus block. */
@@ -4353,7 +4627,7 @@
NEED (1);
uint8_t usize = *(uint8_t *) data++;
NEED (usize);
- printf ("%*s[%4" PRIuMAX "] %s [%6" PRIxMAX "] ",
+ printf ("%*s[%2" PRIuMAX "] %s [%6" PRIxMAX "] ",
indent, "", (uintmax_t) offset, op_name, uleb);
print_block (usize, data);
data += usize;
@@ -4361,6 +4635,7 @@
offset += 1 + (data - start);
break;
+ case DW_OP_regval_type:
case DW_OP_GNU_regval_type:
/* uleb128 register number, uleb128 CU relative
DW_TAG_base_type DIE offset. */
@@ -4371,12 +4646,13 @@
get_uleb128 (uleb2, data, data + len);
if (! print_unresolved_addresses && cu != NULL)
uleb2 += cu->start;
- printf ("%*s[%4" PRIuMAX "] %s %" PRIu64 " [%6" PRIx64 "]\n",
+ printf ("%*s[%2" PRIuMAX "] %s %" PRIu64 " [%6" PRIx64 "]\n",
indent, "", (uintmax_t) offset, op_name, uleb, uleb2);
CONSUME (data - start);
offset += 1 + (data - start);
break;
+ case DW_OP_deref_type:
case DW_OP_GNU_deref_type:
/* 1-byte unsigned size of value, uleb128 CU relative
DW_TAG_base_type DIE offset. */
@@ -4387,6 +4663,20 @@
get_uleb128 (uleb, data, data + len);
if (! print_unresolved_addresses && cu != NULL)
uleb += cu->start;
+ printf ("%*s[%2" PRIuMAX "] %s %" PRIu8 " [%6" PRIxMAX "]\n",
+ indent, "", (uintmax_t) offset,
+ op_name, usize, uleb);
+ CONSUME (data - start);
+ offset += 1 + (data - start);
+ break;
+
+ case DW_OP_xderef_type:
+ /* 1-byte unsigned size of value, uleb128 base_type DIE offset. */
+ start = data;
+ NEED (1);
+ usize = *(uint8_t *) data++;
+ NEED (1);
+ get_uleb128 (uleb, data, data + len);
printf ("%*s[%4" PRIuMAX "] %s %" PRIu8 " [%6" PRIxMAX "]\n",
indent, "", (uintmax_t) offset,
op_name, usize, uleb);
@@ -4394,7 +4684,9 @@
offset += 1 + (data - start);
break;
+ case DW_OP_convert:
case DW_OP_GNU_convert:
+ case DW_OP_reinterpret:
case DW_OP_GNU_reinterpret:
/* uleb128 CU relative offset to DW_TAG_base_type, or zero
for conversion to untyped. */
@@ -4403,7 +4695,7 @@
get_uleb128 (uleb, data, data + len);
if (uleb != 0 && ! print_unresolved_addresses && cu != NULL)
uleb += cu->start;
- printf ("%*s[%4" PRIuMAX "] %s [%6" PRIxMAX "]\n",
+ printf ("%*s[%2" PRIuMAX "] %s [%6" PRIxMAX "]\n",
indent, "", (uintmax_t) offset, op_name, uleb);
CONSUME (data - start);
offset += 1 + (data - start);
@@ -4416,7 +4708,7 @@
uintmax_t param_off = (uintmax_t) read_4ubyte_unaligned (dbg, data);
if (! print_unresolved_addresses && cu != NULL)
param_off += cu->start;
- printf ("%*s[%4" PRIuMAX "] %s [%6" PRIxMAX "]\n",
+ printf ("%*s[%2" PRIuMAX "] %s [%6" PRIxMAX "]\n",
indent, "", (uintmax_t) offset, op_name, param_off);
CONSUME (4);
data += 4;
@@ -4425,7 +4717,7 @@
default:
/* No Operand. */
- printf ("%*s[%4" PRIuMAX "] %s\n",
+ printf ("%*s[%2" PRIuMAX "] %s\n",
indent, "", (uintmax_t) offset, op_name);
++offset;
break;
@@ -4435,7 +4727,7 @@
continue;
invalid:
- printf (gettext ("%*s[%4" PRIuMAX "] %s <TRUNCATED>\n"),
+ printf (gettext ("%*s[%2" PRIuMAX "] %s <TRUNCATED>\n"),
indent, "", (uintmax_t) offset, op_name);
break;
}
@@ -4449,31 +4741,38 @@
bool dwarf64:1;
bool warned:1;
struct Dwarf_CU *cu;
+ unsigned int attr;
};
#define listptr_offset_size(p) ((p)->dwarf64 ? 8 : 4)
#define listptr_address_size(p) ((p)->addr64 ? 8 : 4)
static Dwarf_Addr
-listptr_base (struct listptr *p)
+cudie_base (Dwarf_Die *cudie)
{
Dwarf_Addr base;
- Dwarf_Die cu = CUDIE (p->cu);
/* Find the base address of the compilation unit. It will normally
be specified by DW_AT_low_pc. In DWARF-3 draft 4, the base
address could be overridden by DW_AT_entry_pc. It's been
removed, but GCC emits DW_AT_entry_pc and not DW_AT_lowpc for
compilation units with discontinuous ranges. */
- if (unlikely (dwarf_lowpc (&cu, &base) != 0))
+ if (unlikely (dwarf_lowpc (cudie, &base) != 0))
{
Dwarf_Attribute attr_mem;
- if (dwarf_formaddr (dwarf_attr (&cu, DW_AT_entry_pc, &attr_mem),
+ if (dwarf_formaddr (dwarf_attr (cudie, DW_AT_entry_pc, &attr_mem),
&base) != 0)
base = 0;
}
return base;
}
+static Dwarf_Addr
+listptr_base (struct listptr *p)
+{
+ Dwarf_Die cu = CUDIE (p->cu);
+ return cudie_base (&cu);
+}
+
static int
compare_listptr (const void *a, const void *b, void *arg)
{
@@ -4509,6 +4808,15 @@
gettext ("%s %#" PRIx64 " used with different base addresses"),
name, (uint64_t) p1->offset);
}
+ if (p1->attr != p2 ->attr)
+ {
+ p1->warned = p2->warned = true;
+ error (0, 0,
+ gettext ("%s %#" PRIx64
+ " used with different attribute %s and %s"),
+ name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr),
+ dwarf_attr_name (p2->attr));
+ }
}
return 0;
@@ -4521,8 +4829,12 @@
struct listptr *table;
};
-static struct listptr_table known_loclistptr;
+static struct listptr_table known_locsptr;
+static struct listptr_table known_loclistsptr;
static struct listptr_table known_rangelistptr;
+static struct listptr_table known_rnglistptr;
+static struct listptr_table known_addrbases;
+static struct listptr_table known_stroffbases;
static void
reset_listptr (struct listptr_table *table)
@@ -4536,7 +4848,7 @@
static bool
notice_listptr (enum section_e section, struct listptr_table *table,
uint_fast8_t address_size, uint_fast8_t offset_size,
- struct Dwarf_CU *cu, Dwarf_Off offset)
+ struct Dwarf_CU *cu, Dwarf_Off offset, unsigned int attr)
{
if (print_debug_sections & section)
{
@@ -4557,7 +4869,8 @@
.addr64 = address_size == 8,
.dwarf64 = offset_size == 8,
.offset = offset,
- .cu = cu
+ .cu = cu,
+ .attr = attr
};
if (p->offset != offset)
@@ -4581,7 +4894,8 @@
skip_listptr_hole (struct listptr_table *table, size_t *idxp,
uint_fast8_t *address_sizep, uint_fast8_t *offset_sizep,
Dwarf_Addr *base, struct Dwarf_CU **cu, ptrdiff_t offset,
- unsigned char **readp, unsigned char *endp)
+ unsigned char **readp, unsigned char *endp,
+ unsigned int *attr)
{
if (table->n == 0)
return false;
@@ -4616,10 +4930,62 @@
*base = listptr_base (p);
if (cu != NULL)
*cu = p->cu;
+ if (attr != NULL)
+ *attr = p->attr;
return false;
}
+static Dwarf_Off
+next_listptr_offset (struct listptr_table *table, size_t idx)
+{
+ /* Note that multiple attributes could in theory point to the same loclist
+ offset, so make sure we pick one that is bigger than the current one.
+ The table is sorted on offset. */
+ Dwarf_Off offset = table->table[idx].offset;
+ while (++idx < table->n)
+ {
+ Dwarf_Off next = table->table[idx].offset;
+ if (next > offset)
+ return next;
+ }
+ return 0;
+}
+
+/* Returns the listptr associated with the given index, or NULL. */
+static struct listptr *
+get_listptr (struct listptr_table *table, size_t idx)
+{
+ if (idx >= table->n)
+ return NULL;
+ return &table->table[idx];
+}
+
+/* Returns the next index, base address and CU associated with the
+ list unit offsets. If there is none false is returned, otherwise
+ true. Assumes the table has been sorted. */
+static bool
+listptr_cu (struct listptr_table *table, size_t *idxp,
+ Dwarf_Off start, Dwarf_Off end,
+ Dwarf_Addr *base, struct Dwarf_CU **cu)
+{
+ while (*idxp < table->n
+ && table->table[*idxp].offset < start)
+ ++*idxp;
+
+ if (*idxp < table->n
+ && table->table[*idxp].offset >= start
+ && table->table[*idxp].offset < end)
+ {
+ struct listptr *p = &table->table[*idxp];
+ *base = listptr_base (p);
+ *cu = p->cu;
+ ++*idxp;
+ return true;
+ }
+
+ return false;
+}
static void
print_debug_abbrev_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
@@ -4669,20 +5035,22 @@
printf (gettext (" [%5u] offset: %" PRId64
", children: %s, tag: %s\n"),
code, (int64_t) offset,
- has_children ? gettext ("yes") : gettext ("no"),
+ has_children ? yes_str : no_str,
dwarf_tag_name (tag));
size_t cnt = 0;
unsigned int name;
unsigned int form;
+ Dwarf_Sword data;
Dwarf_Off enoffset;
- while (dwarf_getabbrevattr (&abbrev, cnt,
- &name, &form, &enoffset) == 0)
+ while (dwarf_getabbrevattr_data (&abbrev, cnt, &name, &form,
+ &data, &enoffset) == 0)
{
- printf (" attr: %s, form: %s, offset: %#" PRIx64 "\n",
- dwarf_attr_name (name), dwarf_form_name (form),
- (uint64_t) enoffset);
-
+ printf (" attr: %s, form: %s",
+ dwarf_attr_name (name), dwarf_form_name (form));
+ if (form == DW_FORM_implicit_const)
+ printf (" (%" PRId64 ")", data);
+ printf (", offset: %#" PRIx64 "\n", (uint64_t) enoffset);
++cnt;
}
@@ -4692,6 +5060,230 @@
}
+static void
+print_debug_addr_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
+ Ebl *ebl, GElf_Ehdr *ehdr,
+ Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg)
+{
+ printf (gettext ("\
+\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
+ elf_ndxscn (scn), section_name (ebl, ehdr, shdr),
+ (uint64_t) shdr->sh_offset);
+
+ if (shdr->sh_size == 0)
+ return;
+
+ /* We like to get the section from libdw to make sure they are relocated. */
+ Elf_Data *data = (dbg->sectiondata[IDX_debug_addr]
+ ?: elf_rawdata (scn, NULL));
+ if (unlikely (data == NULL))
+ {
+ error (0, 0, gettext ("cannot get .debug_addr section data: %s"),
+ elf_errmsg (-1));
+ return;
+ }
+
+ size_t idx = 0;
+ sort_listptr (&known_addrbases, "addr_base");
+
+ const unsigned char *start = (const unsigned char *) data->d_buf;
+ const unsigned char *readp = start;
+ const unsigned char *readendp = ((const unsigned char *) data->d_buf
+ + data->d_size);
+
+ while (readp < readendp)
+ {
+ /* We cannot really know whether or not there is an header. The
+ DebugFission extension to DWARF4 doesn't add one. The DWARF5
+ .debug_addr variant does. Whether or not we have an header,
+ DW_AT_[GNU_]addr_base points at "index 0". So if the current
+ offset equals the CU addr_base then we can just start
+ printing addresses. If there is no CU with an exact match
+ then we'll try to parse the header first. */
+ Dwarf_Off off = (Dwarf_Off) (readp
+ - (const unsigned char *) data->d_buf);
+
+ printf ("Table at offset %" PRIx64 " ", off);
+
+ struct listptr *listptr = get_listptr (&known_addrbases, idx++);
+ const unsigned char *next_unitp;
+
+ uint64_t unit_length;
+ uint16_t version;
+ uint8_t address_size;
+ uint8_t segment_size;
+ if (listptr == NULL)
+ {
+ error (0, 0, "Warning: No CU references .debug_addr after %" PRIx64,
+ off);
+
+ /* We will have to assume it is just addresses to the end... */
+ address_size = ehdr->e_ident[EI_CLASS] == ELFCLASS32 ? 4 : 8;
+ next_unitp = readendp;
+ printf ("Unknown CU:\n");
+ }
+ else
+ {
+ Dwarf_Die cudie;
+ if (dwarf_cu_die (listptr->cu, &cudie,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL) == NULL)
+ printf ("Unknown CU (%s):\n", dwarf_errmsg (-1));
+ else
+ printf ("for CU [%6" PRIx64 "]:\n", dwarf_dieoffset (&cudie));
+
+ if (listptr->offset == off)
+ {
+ address_size = listptr_address_size (listptr);
+ segment_size = 0;
+ version = 4;
+
+ /* The addresses start here, but where do they end? */
+ listptr = get_listptr (&known_addrbases, idx);
+ if (listptr == NULL)
+ next_unitp = readendp;
+ else if (listptr->cu->version < 5)
+ {
+ next_unitp = start + listptr->offset;
+ if (listptr->offset < off || listptr->offset > data->d_size)
+ {
+ error (0, 0,
+ "Warning: Bad address base for next unit at %"
+ PRIx64, off);
+ next_unitp = readendp;
+ }
+ }
+ else
+ {
+ /* Tricky, we don't have a header for this unit, but
+ there is one for the next. We will have to
+ "guess" how big it is and subtract it from the
+ offset (because that points after the header). */
+ unsigned int offset_size = listptr_offset_size (listptr);
+ Dwarf_Off next_off = (listptr->offset
+ - (offset_size == 4 ? 4 : 12) /* len */
+ - 2 /* version */
+ - 1 /* address size */
+ - 1); /* segment selector size */
+ next_unitp = start + next_off;
+ if (next_off < off || next_off > data->d_size)
+ {
+ error (0, 0,
+ "Warning: Couldn't calculate .debug_addr "
+ " unit lenght at %" PRIx64, off);
+ next_unitp = readendp;
+ }
+ }
+ unit_length = (uint64_t) (next_unitp - readp);
+
+ /* Pretend we have a header. */
+ printf ("\n");
+ printf (gettext (" Length: %8" PRIu64 "\n"),
+ unit_length);
+ printf (gettext (" DWARF version: %8" PRIu16 "\n"), version);
+ printf (gettext (" Address size: %8" PRIu64 "\n"),
+ (uint64_t) address_size);
+ printf (gettext (" Segment size: %8" PRIu64 "\n"),
+ (uint64_t) segment_size);
+ printf ("\n");
+ }
+ else
+ {
+ /* OK, we have to parse an header first. */
+ unit_length = read_4ubyte_unaligned_inc (dbg, readp);
+ if (unlikely (unit_length == 0xffffffff))
+ {
+ if (unlikely (readp > readendp - 8))
+ {
+ invalid_data:
+ error (0, 0, "Invalid data");
+ return;
+ }
+ unit_length = read_8ubyte_unaligned_inc (dbg, readp);
+ }
+ printf ("\n");
+ printf (gettext (" Length: %8" PRIu64 "\n"),
+ unit_length);
+
+ /* We need at least 2-bytes (version) + 1-byte
+ (addr_size) + 1-byte (segment_size) = 4 bytes to
+ complete the header. And this unit cannot go beyond
+ the section data. */
+ if (readp > readendp - 4
+ || unit_length < 4
+ || unit_length > (uint64_t) (readendp - readp))
+ goto invalid_data;
+
+ next_unitp = readp + unit_length;
+
+ version = read_2ubyte_unaligned_inc (dbg, readp);
+ printf (gettext (" DWARF version: %8" PRIu16 "\n"), version);
+
+ if (version != 5)
+ {
+ error (0, 0, gettext ("Unknown version"));
+ goto next_unit;
+ }
+
+ address_size = *readp++;
+ printf (gettext (" Address size: %8" PRIu64 "\n"),
+ (uint64_t) address_size);
+
+ if (address_size != 4 && address_size != 8)
+ {
+ error (0, 0, gettext ("unsupported address size"));
+ goto next_unit;
+ }
+
+ segment_size = *readp++;
+ printf (gettext (" Segment size: %8" PRIu64 "\n"),
+ (uint64_t) segment_size);
+ printf ("\n");
+
+ if (segment_size != 0)
+ {
+ error (0, 0, gettext ("unsupported segment size"));
+ goto next_unit;
+ }
+
+ if (listptr->offset != (Dwarf_Off) (readp - start))
+ {
+ error (0, 0, "Address index doesn't start after header");
+ goto next_unit;
+ }
+ }
+ }
+
+ int digits = 1;
+ size_t addresses = (next_unitp - readp) / address_size;
+ while (addresses >= 10)
+ {
+ ++digits;
+ addresses /= 10;
+ }
+
+ unsigned int index = 0;
+ size_t index_offset = readp - (const unsigned char *) data->d_buf;
+ printf (" Addresses start at offset 0x%zx:\n", index_offset);
+ while (readp <= next_unitp - address_size)
+ {
+ Dwarf_Addr addr = read_addr_unaligned_inc (address_size, dbg,
+ readp);
+ printf (" [%*u] ", digits, index++);
+ print_dwarf_addr (dwflmod, address_size, addr, addr);
+ printf ("\n");
+ }
+ printf ("\n");
+
+ if (readp != next_unitp)
+ error (0, 0, "extra %zd bytes at end of unit",
+ (size_t) (next_unitp - readp));
+
+ next_unit:
+ readp = next_unitp;
+ }
+}
+
/* Print content of DWARF .debug_aranges section. We fortunately do
not have to know a bit about the structure of the section, libdwarf
takes care of it. */
@@ -4772,7 +5364,8 @@
return;
}
- Elf_Data *data = dbg->sectiondata[IDX_debug_aranges];
+ Elf_Data *data = (dbg->sectiondata[IDX_debug_aranges]
+ ?: elf_rawdata (scn, NULL));
if (unlikely (data == NULL))
{
@@ -4894,18 +5487,17 @@
if (range_address == 0 && range_length == 0 && segment == 0)
break;
- char *b = format_dwarf_addr (dwflmod, address_size, range_address,
- range_address);
- char *e = format_dwarf_addr (dwflmod, address_size,
- range_address + range_length - 1,
- range_length);
+ printf (" ");
+ print_dwarf_addr (dwflmod, address_size, range_address,
+ range_address);
+ printf ("..");
+ print_dwarf_addr (dwflmod, address_size,
+ range_address + range_length - 1,
+ range_length);
if (segment_size != 0)
- printf (gettext (" %s..%s (%" PRIx64 ")\n"), b, e,
- (uint64_t) segment);
+ printf (" (%" PRIx64 ")\n", (uint64_t) segment);
else
- printf (gettext (" %s..%s\n"), b, e);
- free (b);
- free (e);
+ printf ("\n");
}
next_table:
@@ -4919,6 +5511,402 @@
}
+static bool is_split_dwarf (Dwarf *dbg, uint64_t *id, Dwarf_CU **split_cu);
+
+/* Returns true and sets cu and cu_base if the given Dwarf is a split
+ DWARF (.dwo) file. */
+static bool
+split_dwarf_cu_base (Dwarf *dbg, Dwarf_CU **cu, Dwarf_Addr *cu_base)
+{
+ uint64_t id;
+ if (is_split_dwarf (dbg, &id, cu))
+ {
+ Dwarf_Die cudie;
+ if (dwarf_cu_info (*cu, NULL, NULL, &cudie, NULL, NULL, NULL, NULL) == 0)
+ {
+ *cu_base = cudie_base (&cudie);
+ return true;
+ }
+ }
+ return false;
+}
+
+/* Print content of DWARF .debug_rnglists section. */
+static void
+print_debug_rnglists_section (Dwfl_Module *dwflmod,
+ Ebl *ebl, GElf_Ehdr *ehdr,
+ Elf_Scn *scn, GElf_Shdr *shdr,
+ Dwarf *dbg __attribute__((unused)))
+{
+ printf (gettext ("\
+\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
+ elf_ndxscn (scn), section_name (ebl, ehdr, shdr),
+ (uint64_t) shdr->sh_offset);
+
+ Elf_Data *data =(dbg->sectiondata[IDX_debug_rnglists]
+ ?: elf_rawdata (scn, NULL));
+ if (unlikely (data == NULL))
+ {
+ error (0, 0, gettext ("cannot get .debug_rnglists content: %s"),
+ elf_errmsg (-1));
+ return;
+ }
+
+ /* For the listptr to get the base address/CU. */
+ sort_listptr (&known_rnglistptr, "rnglistptr");
+ size_t listptr_idx = 0;
+
+ const unsigned char *readp = data->d_buf;
+ const unsigned char *const dataend = ((unsigned char *) data->d_buf
+ + data->d_size);
+ while (readp < dataend)
+ {
+ if (unlikely (readp > dataend - 4))
+ {
+ invalid_data:
+ error (0, 0, gettext ("invalid data in section [%zu] '%s'"),
+ elf_ndxscn (scn), section_name (ebl, ehdr, shdr));
+ return;
+ }
+
+ ptrdiff_t offset = readp - (unsigned char *) data->d_buf;
+ printf (gettext ("Table at Offset 0x%" PRIx64 ":\n\n"),
+ (uint64_t) offset);
+
+ uint64_t unit_length = read_4ubyte_unaligned_inc (dbg, readp);
+ unsigned int offset_size = 4;
+ if (unlikely (unit_length == 0xffffffff))
+ {
+ if (unlikely (readp > dataend - 8))
+ goto invalid_data;
+
+ unit_length = read_8ubyte_unaligned_inc (dbg, readp);
+ offset_size = 8;
+ }
+ printf (gettext (" Length: %8" PRIu64 "\n"), unit_length);
+
+ /* We need at least 2-bytes + 1-byte + 1-byte + 4-bytes = 8
+ bytes to complete the header. And this unit cannot go beyond
+ the section data. */
+ if (readp > dataend - 8
+ || unit_length < 8
+ || unit_length > (uint64_t) (dataend - readp))
+ goto invalid_data;
+
+ const unsigned char *nexthdr = readp + unit_length;
+
+ uint16_t version = read_2ubyte_unaligned_inc (dbg, readp);
+ printf (gettext (" DWARF version: %8" PRIu16 "\n"), version);
+
+ if (version != 5)
+ {
+ error (0, 0, gettext ("Unknown version"));
+ goto next_table;
+ }
+
+ uint8_t address_size = *readp++;
+ printf (gettext (" Address size: %8" PRIu64 "\n"),
+ (uint64_t) address_size);
+
+ if (address_size != 4 && address_size != 8)
+ {
+ error (0, 0, gettext ("unsupported address size"));
+ goto next_table;
+ }
+
+ uint8_t segment_size = *readp++;
+ printf (gettext (" Segment size: %8" PRIu64 "\n"),
+ (uint64_t) segment_size);
+
+ if (segment_size != 0 && segment_size != 4 && segment_size != 8)
+ {
+ error (0, 0, gettext ("unsupported segment size"));
+ goto next_table;
+ }
+
+ uint32_t offset_entry_count = read_4ubyte_unaligned_inc (dbg, readp);
+ printf (gettext (" Offset entries: %8" PRIu64 "\n"),
+ (uint64_t) offset_entry_count);
+
+ /* We need the CU that uses this unit to get the initial base address. */
+ Dwarf_Addr cu_base = 0;
+ struct Dwarf_CU *cu = NULL;
+ if (listptr_cu (&known_rnglistptr, &listptr_idx,
+ (Dwarf_Off) offset,
+ (Dwarf_Off) (nexthdr - (unsigned char *) data->d_buf),
+ &cu_base, &cu)
+ || split_dwarf_cu_base (dbg, &cu, &cu_base))
+ {
+ Dwarf_Die cudie;
+ if (dwarf_cu_die (cu, &cudie,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL) == NULL)
+ printf (gettext (" Unknown CU base: "));
+ else
+ printf (gettext (" CU [%6" PRIx64 "] base: "),
+ dwarf_dieoffset (&cudie));
+ print_dwarf_addr (dwflmod, address_size, cu_base, cu_base);
+ printf ("\n");
+ }
+ else
+ printf (gettext (" Not associated with a CU.\n"));
+
+ printf ("\n");
+
+ const unsigned char *offset_array_start = readp;
+ if (offset_entry_count > 0)
+ {
+ uint64_t max_entries = (unit_length - 8) / offset_size;
+ if (offset_entry_count > max_entries)
+ {
+ error (0, 0,
+ gettext ("too many offset entries for unit length"));
+ offset_entry_count = max_entries;
+ }
+
+ printf (gettext (" Offsets starting at 0x%" PRIx64 ":\n"),
+ (uint64_t) (offset_array_start
+ - (unsigned char *) data->d_buf));
+ for (uint32_t idx = 0; idx < offset_entry_count; idx++)
+ {
+ printf (" [%6" PRIu32 "] ", idx);
+ if (offset_size == 4)
+ {
+ uint32_t off = read_4ubyte_unaligned_inc (dbg, readp);
+ printf ("0x%" PRIx32 "\n", off);
+ }
+ else
+ {
+ uint64_t off = read_8ubyte_unaligned_inc (dbg, readp);
+ printf ("0x%" PRIx64 "\n", off);
+ }
+ }
+ printf ("\n");
+ }
+
+ Dwarf_Addr base = cu_base;
+ bool start_of_list = true;
+ while (readp < nexthdr)
+ {
+ uint8_t kind = *readp++;
+ uint64_t op1, op2;
+
+ /* Skip padding. */
+ if (start_of_list && kind == DW_RLE_end_of_list)
+ continue;
+
+ if (start_of_list)
+ {
+ base = cu_base;
+ printf (" Offset: %" PRIx64 ", Index: %" PRIx64 "\n",
+ (uint64_t) (readp - (unsigned char *) data->d_buf - 1),
+ (uint64_t) (readp - offset_array_start - 1));
+ start_of_list = false;
+ }
+
+ printf (" %s", dwarf_range_list_encoding_name (kind));
+ switch (kind)
+ {
+ case DW_RLE_end_of_list:
+ start_of_list = true;
+ printf ("\n\n");
+ break;
+
+ case DW_RLE_base_addressx:
+ if ((uint64_t) (nexthdr - readp) < 1)
+ {
+ invalid_range:
+ error (0, 0, gettext ("invalid range list data"));
+ goto next_table;
+ }
+ get_uleb128 (op1, readp, nexthdr);
+ printf (" %" PRIx64 "\n", op1);
+ if (! print_unresolved_addresses)
+ {
+ Dwarf_Addr addr;
+ if (get_indexed_addr (cu, op1, &addr) != 0)
+ printf (" ???\n");
+ else
+ {
+ printf (" ");
+ print_dwarf_addr (dwflmod, address_size, addr, addr);
+ printf ("\n");
+ }
+ }
+ break;
+
+ case DW_RLE_startx_endx:
+ if ((uint64_t) (nexthdr - readp) < 1)
+ goto invalid_range;
+ get_uleb128 (op1, readp, nexthdr);
+ if ((uint64_t) (nexthdr - readp) < 1)
+ goto invalid_range;
+ get_uleb128 (op2, readp, nexthdr);
+ printf (" %" PRIx64 ", %" PRIx64 "\n", op1, op2);
+ if (! print_unresolved_addresses)
+ {
+ Dwarf_Addr addr1;
+ Dwarf_Addr addr2;
+ if (get_indexed_addr (cu, op1, &addr1) != 0
+ || get_indexed_addr (cu, op2, &addr2) != 0)
+ {
+ printf (" ???..\n");
+ printf (" ???\n");
+ }
+ else
+ {
+ printf (" ");
+ print_dwarf_addr (dwflmod, address_size, addr1, addr1);
+ printf ("..\n ");
+ print_dwarf_addr (dwflmod, address_size,
+ addr2 - 1, addr2);
+ printf ("\n");
+ }
+ }
+ break;
+
+ case DW_RLE_startx_length:
+ if ((uint64_t) (nexthdr - readp) < 1)
+ goto invalid_range;
+ get_uleb128 (op1, readp, nexthdr);
+ if ((uint64_t) (nexthdr - readp) < 1)
+ goto invalid_range;
+ get_uleb128 (op2, readp, nexthdr);
+ printf (" %" PRIx64 ", %" PRIx64 "\n", op1, op2);
+ if (! print_unresolved_addresses)
+ {
+ Dwarf_Addr addr1;
+ Dwarf_Addr addr2;
+ if (get_indexed_addr (cu, op1, &addr1) != 0)
+ {
+ printf (" ???..\n");
+ printf (" ???\n");
+ }
+ else
+ {
+ addr2 = addr1 + op2;
+ printf (" ");
+ print_dwarf_addr (dwflmod, address_size, addr1, addr1);
+ printf ("..\n ");
+ print_dwarf_addr (dwflmod, address_size,
+ addr2 - 1, addr2);
+ printf ("\n");
+ }
+ }
+ break;
+
+ case DW_RLE_offset_pair:
+ if ((uint64_t) (nexthdr - readp) < 1)
+ goto invalid_range;
+ get_uleb128 (op1, readp, nexthdr);
+ if ((uint64_t) (nexthdr - readp) < 1)
+ goto invalid_range;
+ get_uleb128 (op2, readp, nexthdr);
+ printf (" %" PRIx64 ", %" PRIx64 "\n", op1, op2);
+ if (! print_unresolved_addresses)
+ {
+ op1 += base;
+ op2 += base;
+ printf (" ");
+ print_dwarf_addr (dwflmod, address_size, op1, op1);
+ printf ("..\n ");
+ print_dwarf_addr (dwflmod, address_size, op2 - 1, op2);
+ printf ("\n");
+ }
+ break;
+
+ case DW_RLE_base_address:
+ if (address_size == 4)
+ {
+ if ((uint64_t) (nexthdr - readp) < 4)
+ goto invalid_range;
+ op1 = read_4ubyte_unaligned_inc (dbg, readp);
+ }
+ else
+ {
+ if ((uint64_t) (nexthdr - readp) < 8)
+ goto invalid_range;
+ op1 = read_8ubyte_unaligned_inc (dbg, readp);
+ }
+ base = op1;
+ printf (" 0x%" PRIx64 "\n", base);
+ if (! print_unresolved_addresses)
+ {
+ printf (" ");
+ print_dwarf_addr (dwflmod, address_size, base, base);
+ printf ("\n");
+ }
+ break;
+
+ case DW_RLE_start_end:
+ if (address_size == 4)
+ {
+ if ((uint64_t) (nexthdr - readp) < 8)
+ goto invalid_range;
+ op1 = read_4ubyte_unaligned_inc (dbg, readp);
+ op2 = read_4ubyte_unaligned_inc (dbg, readp);
+ }
+ else
+ {
+ if ((uint64_t) (nexthdr - readp) < 16)
+ goto invalid_range;
+ op1 = read_8ubyte_unaligned_inc (dbg, readp);
+ op2 = read_8ubyte_unaligned_inc (dbg, readp);
+ }
+ printf (" 0x%" PRIx64 "..0x%" PRIx64 "\n", op1, op2);
+ if (! print_unresolved_addresses)
+ {
+ printf (" ");
+ print_dwarf_addr (dwflmod, address_size, op1, op1);
+ printf ("..\n ");
+ print_dwarf_addr (dwflmod, address_size, op2 - 1, op2);
+ printf ("\n");
+ }
+ break;
+
+ case DW_RLE_start_length:
+ if (address_size == 4)
+ {
+ if ((uint64_t) (nexthdr - readp) < 4)
+ goto invalid_range;
+ op1 = read_4ubyte_unaligned_inc (dbg, readp);
+ }
+ else
+ {
+ if ((uint64_t) (nexthdr - readp) < 8)
+ goto invalid_range;
+ op1 = read_8ubyte_unaligned_inc (dbg, readp);
+ }
+ if ((uint64_t) (nexthdr - readp) < 1)
+ goto invalid_range;
+ get_uleb128 (op2, readp, nexthdr);
+ printf (" 0x%" PRIx64 ", %" PRIx64 "\n", op1, op2);
+ if (! print_unresolved_addresses)
+ {
+ op2 = op1 + op2;
+ printf (" ");
+ print_dwarf_addr (dwflmod, address_size, op1, op1);
+ printf ("..\n ");
+ print_dwarf_addr (dwflmod, address_size, op2 - 1, op2);
+ printf ("\n");
+ }
+ break;
+
+ default:
+ goto invalid_range;
+ }
+ }
+
+ next_table:
+ if (readp != nexthdr)
+ {
+ size_t padding = nexthdr - readp;
+ printf (gettext (" %zu padding bytes\n\n"), padding);
+ readp = nexthdr;
+ }
+ }
+}
+
/* Print content of DWARF .debug_ranges section. */
static void
print_debug_ranges_section (Dwfl_Module *dwflmod,
@@ -4926,8 +5914,8 @@
Elf_Scn *scn, GElf_Shdr *shdr,
Dwarf *dbg)
{
- Elf_Data *data = dbg->sectiondata[IDX_debug_ranges];
-
+ Elf_Data *data = (dbg->sectiondata[IDX_debug_ranges]
+ ?: elf_rawdata (scn, NULL));
if (unlikely (data == NULL))
{
error (0, 0, gettext ("cannot get .debug_ranges content: %s"),
@@ -4949,15 +5937,32 @@
Dwarf_Addr base = 0;
unsigned char *const endp = (unsigned char *) data->d_buf + data->d_size;
unsigned char *readp = data->d_buf;
+ Dwarf_CU *last_cu = NULL;
while (readp < endp)
{
ptrdiff_t offset = readp - (unsigned char *) data->d_buf;
+ Dwarf_CU *cu = last_cu;
if (first && skip_listptr_hole (&known_rangelistptr, &listptr_idx,
- &address_size, NULL, &base, NULL,
- offset, &readp, endp))
+ &address_size, NULL, &base, &cu,
+ offset, &readp, endp, NULL))
continue;
+ if (last_cu != cu)
+ {
+ Dwarf_Die cudie;
+ if (dwarf_cu_die (cu, &cudie,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL) == NULL)
+ printf (gettext ("\n Unknown CU base: "));
+ else
+ printf (gettext ("\n CU [%6" PRIx64 "] base: "),
+ dwarf_dieoffset (&cudie));
+ print_dwarf_addr (dwflmod, address_size, base, base);
+ printf ("\n");
+ }
+ last_cu = cu;
+
if (unlikely (data->d_size - offset < (size_t) address_size * 2))
{
printf (gettext (" [%6tx] <INVALID DATA>\n"), offset);
@@ -4981,30 +5986,36 @@
if (begin == (Dwarf_Addr) -1l) /* Base address entry. */
{
- char *b = format_dwarf_addr (dwflmod, address_size, end, end);
- printf (gettext (" [%6tx] base address %s\n"), offset, b);
- free (b);
+ printf (gettext (" [%6tx] base address\n "), offset);
+ print_dwarf_addr (dwflmod, address_size, end, end);
+ printf ("\n");
base = end;
}
else if (begin == 0 && end == 0) /* End of list entry. */
{
if (first)
- printf (gettext (" [%6tx] empty list\n"), offset);
+ printf (gettext (" [%6tx] empty list\n"), offset);
first = true;
}
else
{
- char *b = format_dwarf_addr (dwflmod, address_size, base + begin,
- begin);
- char *e = format_dwarf_addr (dwflmod, address_size, base + end,
- end);
/* We have an address range entry. */
if (first) /* First address range entry in a list. */
- printf (gettext (" [%6tx] %s..%s\n"), offset, b, e);
+ printf (" [%6tx] ", offset);
else
- printf (gettext (" %s..%s\n"), b, e);
- free (b);
- free (e);
+ printf (" ");
+
+ printf ("range %" PRIx64 ", %" PRIx64 "\n", begin, end);
+ if (! print_unresolved_addresses)
+ {
+ printf (" ");
+ print_dwarf_addr (dwflmod, address_size, base + begin,
+ base + begin);
+ printf ("..\n ");
+ print_dwarf_addr (dwflmod, address_size,
+ base + end - 1, base + end);
+ printf ("\n");
+ }
first = false;
}
@@ -5044,11 +6055,68 @@
return set;
}
+static const unsigned char *
+read_encoded (unsigned int encoding, const unsigned char *readp,
+ const unsigned char *const endp, uint64_t *res, Dwarf *dbg)
+{
+ if ((encoding & 0xf) == DW_EH_PE_absptr)
+ encoding = gelf_getclass (dbg->elf) == ELFCLASS32
+ ? DW_EH_PE_udata4 : DW_EH_PE_udata8;
+
+ switch (encoding & 0xf)
+ {
+ case DW_EH_PE_uleb128:
+ get_uleb128 (*res, readp, endp);
+ break;
+ case DW_EH_PE_sleb128:
+ get_sleb128 (*res, readp, endp);
+ break;
+ case DW_EH_PE_udata2:
+ if (readp + 2 > endp)
+ goto invalid;
+ *res = read_2ubyte_unaligned_inc (dbg, readp);
+ break;
+ case DW_EH_PE_udata4:
+ if (readp + 4 > endp)
+ goto invalid;
+ *res = read_4ubyte_unaligned_inc (dbg, readp);
+ break;
+ case DW_EH_PE_udata8:
+ if (readp + 8 > endp)
+ goto invalid;
+ *res = read_8ubyte_unaligned_inc (dbg, readp);
+ break;
+ case DW_EH_PE_sdata2:
+ if (readp + 2 > endp)
+ goto invalid;
+ *res = read_2sbyte_unaligned_inc (dbg, readp);
+ break;
+ case DW_EH_PE_sdata4:
+ if (readp + 4 > endp)
+ goto invalid;
+ *res = read_4sbyte_unaligned_inc (dbg, readp);
+ break;
+ case DW_EH_PE_sdata8:
+ if (readp + 8 > endp)
+ goto invalid;
+ *res = read_8sbyte_unaligned_inc (dbg, readp);
+ break;
+ default:
+ invalid:
+ error (1, 0,
+ gettext ("invalid encoding"));
+ }
+
+ return readp;
+}
+
+
static void
print_cfa_program (const unsigned char *readp, const unsigned char *const endp,
Dwarf_Word vma_base, unsigned int code_align,
int data_align,
unsigned int version, unsigned int ptr_size,
+ unsigned int encoding,
Dwfl_Module *dwflmod, Ebl *ebl, Dwarf *dbg)
{
char regnamebuf[REGNAMESZ];
@@ -5079,9 +6147,9 @@
case DW_CFA_set_loc:
if ((uint64_t) (endp - readp) < 1)
goto invalid;
- get_uleb128 (op1, readp, endp);
- op1 += vma_base;
- printf (" set_loc %" PRIu64 "\n", op1 * code_align);
+ readp = read_encoded (encoding, readp, endp, &op1, dbg);
+ printf (" set_loc %#" PRIx64 " to %#" PRIx64 "\n",
+ op1, pc = vma_base + op1);
break;
case DW_CFA_advance_loc1:
if ((uint64_t) (endp - readp) < 1)
@@ -5421,62 +6489,6 @@
}
-static const unsigned char *
-read_encoded (unsigned int encoding, const unsigned char *readp,
- const unsigned char *const endp, uint64_t *res, Dwarf *dbg)
-{
- if ((encoding & 0xf) == DW_EH_PE_absptr)
- encoding = gelf_getclass (dbg->elf) == ELFCLASS32
- ? DW_EH_PE_udata4 : DW_EH_PE_udata8;
-
- switch (encoding & 0xf)
- {
- case DW_EH_PE_uleb128:
- get_uleb128 (*res, readp, endp);
- break;
- case DW_EH_PE_sleb128:
- get_sleb128 (*res, readp, endp);
- break;
- case DW_EH_PE_udata2:
- if (readp + 2 > endp)
- goto invalid;
- *res = read_2ubyte_unaligned_inc (dbg, readp);
- break;
- case DW_EH_PE_udata4:
- if (readp + 4 > endp)
- goto invalid;
- *res = read_4ubyte_unaligned_inc (dbg, readp);
- break;
- case DW_EH_PE_udata8:
- if (readp + 8 > endp)
- goto invalid;
- *res = read_8ubyte_unaligned_inc (dbg, readp);
- break;
- case DW_EH_PE_sdata2:
- if (readp + 2 > endp)
- goto invalid;
- *res = read_2sbyte_unaligned_inc (dbg, readp);
- break;
- case DW_EH_PE_sdata4:
- if (readp + 4 > endp)
- goto invalid;
- *res = read_4sbyte_unaligned_inc (dbg, readp);
- break;
- case DW_EH_PE_sdata8:
- if (readp + 8 > endp)
- goto invalid;
- *res = read_8sbyte_unaligned_inc (dbg, readp);
- break;
- default:
- invalid:
- error (1, 0,
- gettext ("invalid encoding"));
- }
-
- return readp;
-}
-
-
static void
print_debug_frame_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr,
Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg)
@@ -5497,7 +6509,8 @@
bool is_eh_frame = strcmp (scnname, ".eh_frame") == 0;
Elf_Data *data = (is_eh_frame
? elf_rawdata (scn, NULL)
- : dbg->sectiondata[IDX_debug_frame]);
+ : (dbg->sectiondata[IDX_debug_frame]
+ ?: elf_rawdata (scn, NULL)));
if (unlikely (data == NULL))
{
@@ -5766,14 +6779,13 @@
+ (base - (const unsigned char *) data->d_buf)
- bias);
- char *a = format_dwarf_addr (dwflmod, cie->address_size,
- pc_start, initial_location);
printf ("\n [%6tx] FDE length=%" PRIu64 " cie=[%6tx]\n"
" CIE_pointer: %" PRIu64 "\n"
- " initial_location: %s",
+ " initial_location: ",
offset, (uint64_t) unit_length,
- cie->cie_offset, (uint64_t) cie_id, a);
- free (a);
+ cie->cie_offset, (uint64_t) cie_id);
+ print_dwarf_addr (dwflmod, cie->address_size,
+ pc_start, initial_location);
if ((fde_encoding & 0x70) == DW_EH_PE_pcrel)
{
vma_base = (((uint64_t) shdr->sh_offset
@@ -5851,12 +6863,39 @@
else
print_cfa_program (readp, cieend, vma_base, code_alignment_factor,
data_alignment_factor, version, ptr_size,
- dwflmod, ebl, dbg);
+ fde_encoding, dwflmod, ebl, dbg);
readp = cieend;
}
}
+/* Returns the signedness (or false if it cannot be determined) and
+ the byte size (or zero if it cannot be gotten) of the given DIE
+ DW_AT_type attribute. Uses dwarf_peel_type and dwarf_aggregate_size. */
+static void
+die_type_sign_bytes (Dwarf_Die *die, bool *is_signed, int *bytes)
+{
+ Dwarf_Attribute attr;
+ Dwarf_Die type;
+
+ *bytes = 0;
+ *is_signed = false;
+
+ if (dwarf_peel_type (dwarf_formref_die (dwarf_attr_integrate (die,
+ DW_AT_type,
+ &attr), &type),
+ &type) == 0)
+ {
+ Dwarf_Word val;
+ *is_signed = (dwarf_formudata (dwarf_attr (&type, DW_AT_encoding,
+ &attr), &val) == 0
+ && (val == DW_ATE_signed || val == DW_ATE_signed_char));
+
+ if (dwarf_aggregate_size (&type, &val) == 0)
+ *bytes = val;
+ }
+}
+
struct attrcb_args
{
Dwfl_Module *dwflmod;
@@ -5864,6 +6903,7 @@
Dwarf_Die *die;
int level;
bool silent;
+ bool is_split;
unsigned int version;
unsigned int addrsize;
unsigned int offset_size;
@@ -5876,13 +6916,16 @@
{
struct attrcb_args *cbargs = (struct attrcb_args *) arg;
const int level = cbargs->level;
+ Dwarf_Die *die = cbargs->die;
+ bool is_split = cbargs->is_split;
unsigned int attr = dwarf_whatattr (attrp);
if (unlikely (attr == 0))
{
if (!cbargs->silent)
- error (0, 0, gettext ("cannot get attribute code: %s"),
- dwarf_errmsg (-1));
+ error (0, 0, gettext ("DIE [%" PRIx64 "] "
+ "cannot get attribute code: %s"),
+ dwarf_dieoffset (die), dwarf_errmsg (-1));
return DWARF_CB_ABORT;
}
@@ -5890,14 +6933,21 @@
if (unlikely (form == 0))
{
if (!cbargs->silent)
- error (0, 0, gettext ("cannot get attribute form: %s"),
- dwarf_errmsg (-1));
+ error (0, 0, gettext ("DIE [%" PRIx64 "] "
+ "cannot get attribute form: %s"),
+ dwarf_dieoffset (die), dwarf_errmsg (-1));
return DWARF_CB_ABORT;
}
switch (form)
{
case DW_FORM_addr:
+ case DW_FORM_addrx:
+ case DW_FORM_addrx1:
+ case DW_FORM_addrx2:
+ case DW_FORM_addrx3:
+ case DW_FORM_addrx4:
+ case DW_FORM_GNU_addr_index:
if (!cbargs->silent)
{
Dwarf_Addr addr;
@@ -5905,23 +6955,45 @@
{
attrval_out:
if (!cbargs->silent)
- error (0, 0, gettext ("cannot get attribute value: %s"),
+ error (0, 0, gettext ("DIE [%" PRIx64 "] "
+ "cannot get attribute '%s' (%s) value: "
+ "%s"),
+ dwarf_dieoffset (die),
+ dwarf_attr_name (attr),
+ dwarf_form_name (form),
dwarf_errmsg (-1));
- return DWARF_CB_ABORT;
+ /* Don't ABORT, it might be other attributes can be resolved. */
+ return DWARF_CB_OK;
}
- char *a = format_dwarf_addr (cbargs->dwflmod, cbargs->addrsize,
- addr, addr);
- printf (" %*s%-20s (%s) %s\n",
- (int) (level * 2), "", dwarf_attr_name (attr),
- dwarf_form_name (form), a);
- free (a);
+ if (form != DW_FORM_addr )
+ {
+ Dwarf_Word index;
+ if (dwarf_formudata (attrp, &index) != 0)
+ goto attrval_out;
+ printf (" %*s%-20s (%s) [%" PRIx64 "] ",
+ (int) (level * 2), "", dwarf_attr_name (attr),
+ dwarf_form_name (form), index);
+ }
+ else
+ printf (" %*s%-20s (%s) ",
+ (int) (level * 2), "", dwarf_attr_name (attr),
+ dwarf_form_name (form));
+ print_dwarf_addr (cbargs->dwflmod, cbargs->addrsize, addr, addr);
+ printf ("\n");
}
break;
case DW_FORM_indirect:
case DW_FORM_strp:
+ case DW_FORM_line_strp:
+ case DW_FORM_strx:
+ case DW_FORM_strx1:
+ case DW_FORM_strx2:
+ case DW_FORM_strx3:
+ case DW_FORM_strx4:
case DW_FORM_string:
case DW_FORM_GNU_strp_alt:
+ case DW_FORM_GNU_str_index:
if (cbargs->silent)
break;
const char *str = dwarf_formstring (attrp);
@@ -5939,15 +7011,21 @@
case DW_FORM_ref2:
case DW_FORM_ref1:
case DW_FORM_GNU_ref_alt:
+ case DW_FORM_ref_sup4:
+ case DW_FORM_ref_sup8:
if (cbargs->silent)
break;
Dwarf_Die ref;
if (unlikely (dwarf_formref_die (attrp, &ref) == NULL))
goto attrval_out;
- printf (" %*s%-20s (%s) [%6" PRIxMAX "]\n",
+ printf (" %*s%-20s (%s) ",
(int) (level * 2), "", dwarf_attr_name (attr),
- dwarf_form_name (form), (uintmax_t) dwarf_dieoffset (&ref));
+ dwarf_form_name (form));
+ if (is_split)
+ printf ("{%6" PRIxMAX "}\n", (uintmax_t) dwarf_dieoffset (&ref));
+ else
+ printf ("[%6" PRIxMAX "]\n", (uintmax_t) dwarf_dieoffset (&ref));
break;
case DW_FORM_ref_sig8:
@@ -5960,9 +7038,12 @@
break;
case DW_FORM_sec_offset:
+ case DW_FORM_rnglistx:
+ case DW_FORM_loclistx:
+ case DW_FORM_implicit_const:
case DW_FORM_udata:
case DW_FORM_sdata:
- case DW_FORM_data8:
+ case DW_FORM_data8: /* Note no data16 here, we see that as block. */
case DW_FORM_data4:
case DW_FORM_data2:
case DW_FORM_data1:;
@@ -5971,6 +7052,7 @@
goto attrval_out;
const char *valuestr = NULL;
+ bool as_hex_id = false;
switch (attr)
{
/* This case can take either a constant or a loclistptr. */
@@ -5985,9 +7067,9 @@
dwarf_form_name (form), (uintmax_t) num);
return DWARF_CB_OK;
}
- /* else fallthrough */
+ FALLTHROUGH;
- /* These cases always take a loclistptr and no constant. */
+ /* These cases always take a loclist[ptr] and no constant. */
case DW_AT_location:
case DW_AT_data_location:
case DW_AT_vtable_elem_location:
@@ -5996,14 +7078,65 @@
case DW_AT_frame_base:
case DW_AT_return_addr:
case DW_AT_static_link:
+ case DW_AT_segment:
case DW_AT_GNU_call_site_value:
case DW_AT_GNU_call_site_data_value:
case DW_AT_GNU_call_site_target:
case DW_AT_GNU_call_site_target_clobbered:
+ case DW_AT_GNU_locviews:
{
- bool nlpt = notice_listptr (section_loc, &known_loclistptr,
- cbargs->addrsize, cbargs->offset_size,
- cbargs->cu, num);
+ bool nlpt;
+ if (cbargs->cu->version < 5)
+ {
+ if (! cbargs->is_split)
+ {
+ nlpt = notice_listptr (section_loc, &known_locsptr,
+ cbargs->addrsize,
+ cbargs->offset_size,
+ cbargs->cu, num, attr);
+ }
+ else
+ nlpt = true;
+ }
+ else
+ {
+ /* Only register for a real section offset. Otherwise
+ it is a DW_FORM_loclistx which is just an index
+ number and we should already have registered the
+ section offset for the index when we saw the
+ DW_AT_loclists_base CU attribute. */
+ if (form == DW_FORM_sec_offset)
+ nlpt = notice_listptr (section_loc, &known_loclistsptr,
+ cbargs->addrsize, cbargs->offset_size,
+ cbargs->cu, num, attr);
+ else
+ nlpt = true;
+
+ }
+
+ if (!cbargs->silent)
+ {
+ if (cbargs->cu->version < 5 || form == DW_FORM_sec_offset)
+ printf (" %*s%-20s (%s) location list [%6"
+ PRIxMAX "]%s\n",
+ (int) (level * 2), "", dwarf_attr_name (attr),
+ dwarf_form_name (form), (uintmax_t) num,
+ nlpt ? "" : " <WARNING offset too big>");
+ else
+ printf (" %*s%-20s (%s) location index [%6"
+ PRIxMAX "]\n",
+ (int) (level * 2), "", dwarf_attr_name (attr),
+ dwarf_form_name (form), (uintmax_t) num);
+ }
+ }
+ return DWARF_CB_OK;
+
+ case DW_AT_loclists_base:
+ {
+ bool nlpt = notice_listptr (section_loc, &known_loclistsptr,
+ cbargs->addrsize, cbargs->offset_size,
+ cbargs->cu, num, attr);
+
if (!cbargs->silent)
printf (" %*s%-20s (%s) location list [%6" PRIxMAX "]%s\n",
(int) (level * 2), "", dwarf_attr_name (attr),
@@ -6013,18 +7146,90 @@
return DWARF_CB_OK;
case DW_AT_ranges:
+ case DW_AT_start_scope:
{
- bool nlpt = notice_listptr (section_ranges, &known_rangelistptr,
- cbargs->addrsize, cbargs->offset_size,
- cbargs->cu, num);
+ bool nlpt;
+ if (cbargs->cu->version < 5)
+ nlpt = notice_listptr (section_ranges, &known_rangelistptr,
+ cbargs->addrsize, cbargs->offset_size,
+ cbargs->cu, num, attr);
+ else
+ {
+ /* Only register for a real section offset. Otherwise
+ it is a DW_FORM_rangelistx which is just an index
+ number and we should already have registered the
+ section offset for the index when we saw the
+ DW_AT_rnglists_base CU attribute. */
+ if (form == DW_FORM_sec_offset)
+ nlpt = notice_listptr (section_ranges, &known_rnglistptr,
+ cbargs->addrsize, cbargs->offset_size,
+ cbargs->cu, num, attr);
+ else
+ nlpt = true;
+ }
+
if (!cbargs->silent)
- printf (" %*s%-20s (%s) range list [%6" PRIxMAX "]%s\n",
+ {
+ if (cbargs->cu->version < 5 || form == DW_FORM_sec_offset)
+ printf (" %*s%-20s (%s) range list [%6"
+ PRIxMAX "]%s\n",
+ (int) (level * 2), "", dwarf_attr_name (attr),
+ dwarf_form_name (form), (uintmax_t) num,
+ nlpt ? "" : " <WARNING offset too big>");
+ else
+ printf (" %*s%-20s (%s) range index [%6"
+ PRIxMAX "]\n",
+ (int) (level * 2), "", dwarf_attr_name (attr),
+ dwarf_form_name (form), (uintmax_t) num);
+ }
+ }
+ return DWARF_CB_OK;
+
+ case DW_AT_rnglists_base:
+ {
+ bool nlpt = notice_listptr (section_ranges, &known_rnglistptr,
+ cbargs->addrsize, cbargs->offset_size,
+ cbargs->cu, num, attr);
+ if (!cbargs->silent)
+ printf (" %*s%-20s (%s) range list [%6"
+ PRIxMAX "]%s\n",
(int) (level * 2), "", dwarf_attr_name (attr),
dwarf_form_name (form), (uintmax_t) num,
nlpt ? "" : " <WARNING offset too big>");
}
return DWARF_CB_OK;
+ case DW_AT_addr_base:
+ case DW_AT_GNU_addr_base:
+ {
+ bool addrbase = notice_listptr (section_addr, &known_addrbases,
+ cbargs->addrsize,
+ cbargs->offset_size,
+ cbargs->cu, num, attr);
+ if (!cbargs->silent)
+ printf (" %*s%-20s (%s) address base [%6"
+ PRIxMAX "]%s\n",
+ (int) (level * 2), "", dwarf_attr_name (attr),
+ dwarf_form_name (form), (uintmax_t) num,
+ addrbase ? "" : " <WARNING offset too big>");
+ }
+ return DWARF_CB_OK;
+
+ case DW_AT_str_offsets_base:
+ {
+ bool stroffbase = notice_listptr (section_str, &known_stroffbases,
+ cbargs->addrsize,
+ cbargs->offset_size,
+ cbargs->cu, num, attr);
+ if (!cbargs->silent)
+ printf (" %*s%-20s (%s) str offsets base [%6"
+ PRIxMAX "]%s\n",
+ (int) (level * 2), "", dwarf_attr_name (attr),
+ dwarf_form_name (form), (uintmax_t) num,
+ stroffbase ? "" : " <WARNING offset too big>");
+ }
+ return DWARF_CB_OK;
+
case DW_AT_language:
valuestr = dwarf_lang_name (num);
break;
@@ -6034,6 +7239,9 @@
case DW_AT_accessibility:
valuestr = dwarf_access_name (num);
break;
+ case DW_AT_defaulted:
+ valuestr = dwarf_defaulted_name (num);
+ break;
case DW_AT_visibility:
valuestr = dwarf_visibility_name (num);
break;
@@ -6055,6 +7263,49 @@
case DW_AT_discr_list:
valuestr = dwarf_discr_list_name (num);
break;
+ case DW_AT_decl_file:
+ case DW_AT_call_file:
+ {
+ if (cbargs->silent)
+ break;
+
+ /* Try to get the actual file, the current interface only
+ gives us full paths, but we only want to show the file
+ name for now. */
+ Dwarf_Die cudie;
+ if (dwarf_cu_die (cbargs->cu, &cudie,
+ NULL, NULL, NULL, NULL, NULL, NULL) != NULL)
+ {
+ Dwarf_Files *files;
+ size_t nfiles;
+ if (dwarf_getsrcfiles (&cudie, &files, &nfiles) == 0)
+ {
+ valuestr = dwarf_filesrc (files, num, NULL, NULL);
+ if (valuestr != NULL)
+ {
+ char *filename = strrchr (valuestr, '/');
+ if (filename != NULL)
+ valuestr = filename + 1;
+ }
+ else
+ error (0, 0, gettext ("invalid file (%" PRId64 "): %s"),
+ num, dwarf_errmsg (-1));
+ }
+ else
+ error (0, 0, gettext ("no srcfiles for CU [%" PRIx64 "]"),
+ dwarf_dieoffset (&cudie));
+ }
+ else
+ error (0, 0, gettext ("couldn't get DWARF CU: %s"),
+ dwarf_errmsg (-1));
+ if (valuestr == NULL)
+ valuestr = "???";
+ }
+ break;
+ case DW_AT_GNU_dwo_id:
+ as_hex_id = true;
+ break;
+
default:
/* Nothing. */
break;
@@ -6068,39 +7319,97 @@
Dwarf_Addr highpc;
if (attr == DW_AT_high_pc && dwarf_highpc (cbargs->die, &highpc) == 0)
{
- char *a = format_dwarf_addr (cbargs->dwflmod, cbargs->addrsize,
- highpc, highpc);
- printf (" %*s%-20s (%s) %" PRIuMAX " (%s)\n",
+ printf (" %*s%-20s (%s) %" PRIuMAX " (",
(int) (level * 2), "", dwarf_attr_name (attr),
- dwarf_form_name (form), (uintmax_t) num, a);
- free (a);
+ dwarf_form_name (form), (uintmax_t) num);
+ print_dwarf_addr (cbargs->dwflmod, cbargs->addrsize, highpc, highpc);
+ printf (")\n");
}
else
{
- Dwarf_Sword snum = 0;
- if (form == DW_FORM_sdata)
- if (unlikely (dwarf_formsdata (attrp, &snum) != 0))
- goto attrval_out;
-
- if (valuestr == NULL)
+ if (as_hex_id)
{
- printf (" %*s%-20s (%s)",
+ printf (" %*s%-20s (%s) 0x%.16" PRIx64 "\n",
(int) (level * 2), "", dwarf_attr_name (attr),
- dwarf_form_name (form));
- if (form == DW_FORM_sdata)
- printf (" %" PRIdMAX "\n", (intmax_t) snum);
- else
- printf (" %" PRIuMAX "\n", (uintmax_t) num);
+ dwarf_form_name (form), num);
}
else
{
- printf (" %*s%-20s (%s) %s",
- (int) (level * 2), "", dwarf_attr_name (attr),
- dwarf_form_name (form), valuestr);
- if (form == DW_FORM_sdata)
- printf (" (%" PRIdMAX ")\n", (intmax_t) snum);
+ Dwarf_Sword snum = 0;
+ bool is_signed;
+ int bytes = 0;
+ if (attr == DW_AT_const_value)
+ die_type_sign_bytes (cbargs->die, &is_signed, &bytes);
else
- printf (" (%" PRIuMAX ")\n", (uintmax_t) num);
+ is_signed = (form == DW_FORM_sdata
+ || form == DW_FORM_implicit_const);
+
+ if (is_signed)
+ if (unlikely (dwarf_formsdata (attrp, &snum) != 0))
+ goto attrval_out;
+
+ if (valuestr == NULL)
+ {
+ printf (" %*s%-20s (%s) ",
+ (int) (level * 2), "", dwarf_attr_name (attr),
+ dwarf_form_name (form));
+ }
+ else
+ {
+ printf (" %*s%-20s (%s) %s (",
+ (int) (level * 2), "", dwarf_attr_name (attr),
+ dwarf_form_name (form), valuestr);
+ }
+
+ switch (bytes)
+ {
+ case 1:
+ if (is_signed)
+ printf ("%" PRId8, (int8_t) snum);
+ else
+ printf ("%" PRIu8, (uint8_t) num);
+ break;
+
+ case 2:
+ if (is_signed)
+ printf ("%" PRId16, (int16_t) snum);
+ else
+ printf ("%" PRIu16, (uint16_t) num);
+ break;
+
+ case 4:
+ if (is_signed)
+ printf ("%" PRId32, (int32_t) snum);
+ else
+ printf ("%" PRIu32, (uint32_t) num);
+ break;
+
+ case 8:
+ if (is_signed)
+ printf ("%" PRId64, (int64_t) snum);
+ else
+ printf ("%" PRIu64, (uint64_t) num);
+ break;
+
+ default:
+ if (is_signed)
+ printf ("%" PRIdMAX, (intmax_t) snum);
+ else
+ printf ("%" PRIuMAX, (uintmax_t) num);
+ break;
+ }
+
+ /* Make clear if we switched from a signed encoding to
+ an unsigned value. */
+ if (attr == DW_AT_const_value
+ && (form == DW_FORM_sdata || form == DW_FORM_implicit_const)
+ && !is_signed)
+ printf (" (%" PRIdMAX ")", (intmax_t) num);
+
+ if (valuestr == NULL)
+ printf ("\n");
+ else
+ printf (")\n");
}
}
break;
@@ -6114,7 +7423,7 @@
printf (" %*s%-20s (%s) %s\n",
(int) (level * 2), "", dwarf_attr_name (attr),
- dwarf_form_name (form), nl_langinfo (flag ? YESSTR : NOSTR));
+ dwarf_form_name (form), flag ? yes_str : no_str);
break;
case DW_FORM_flag_present:
@@ -6122,7 +7431,7 @@
break;
printf (" %*s%-20s (%s) %s\n",
(int) (level * 2), "", dwarf_attr_name (attr),
- dwarf_form_name (form), nl_langinfo (YESSTR));
+ dwarf_form_name (form), yes_str);
break;
case DW_FORM_exprloc:
@@ -6130,6 +7439,7 @@
case DW_FORM_block2:
case DW_FORM_block1:
case DW_FORM_block:
+ case DW_FORM_data16: /* DWARF5 calls this a constant class. */
if (cbargs->silent)
break;
Dwarf_Block block;
@@ -6148,7 +7458,7 @@
print_block (block.length, block.data);
break;
}
- /* Fall through. */
+ FALLTHROUGH;
case DW_AT_location:
case DW_AT_data_location:
@@ -6173,11 +7483,16 @@
case DW_AT_GNU_call_site_data_value:
case DW_AT_GNU_call_site_target:
case DW_AT_GNU_call_site_target_clobbered:
- putchar ('\n');
- print_ops (cbargs->dwflmod, cbargs->dbg,
- 12 + level * 2, 12 + level * 2,
- cbargs->version, cbargs->addrsize, cbargs->offset_size,
- attrp->cu, block.length, block.data);
+ if (form != DW_FORM_data16)
+ {
+ putchar ('\n');
+ print_ops (cbargs->dwflmod, cbargs->dbg,
+ 12 + level * 2, 12 + level * 2,
+ cbargs->version, cbargs->addrsize, cbargs->offset_size,
+ attrp->cu, block.length, block.data);
+ }
+ else
+ print_block (block.length, block.data);
break;
}
break;
@@ -6185,9 +7500,9 @@
default:
if (cbargs->silent)
break;
- printf (" %*s%-20s (form: %#x) ???\n",
+ printf (" %*s%-20s (%s) ???\n",
(int) (level * 2), "", dwarf_attr_name (attr),
- (int) form);
+ dwarf_form_name (form));
break;
}
@@ -6200,7 +7515,7 @@
Elf_Scn *scn, GElf_Shdr *shdr,
Dwarf *dbg, bool debug_types)
{
- const bool silent = !(print_debug_sections & section_info);
+ const bool silent = !(print_debug_sections & section_info) && !debug_types;
const char *secname = section_name (ebl, ehdr, shdr);
if (!silent)
@@ -6215,73 +7530,140 @@
int maxdies = 20;
Dwarf_Die *dies = (Dwarf_Die *) xmalloc (maxdies * sizeof (Dwarf_Die));
- Dwarf_Off offset = 0;
-
/* New compilation unit. */
- size_t cuhl;
Dwarf_Half version;
+
+ Dwarf_Die result;
Dwarf_Off abbroffset;
uint8_t addrsize;
uint8_t offsize;
- Dwarf_Off nextcu;
- uint64_t typesig;
- Dwarf_Off typeoff;
+ uint64_t unit_id;
+ Dwarf_Off subdie_off;
+
+ int unit_res;
+ Dwarf_CU *cu;
+ Dwarf_CU cu_mem;
+ uint8_t unit_type;
+ Dwarf_Die cudie;
+
+ /* We cheat a little because we want to see only the CUs from .debug_info
+ or .debug_types. We know the Dwarf_CU struct layout. Set it up at
+ the end of .debug_info if we want .debug_types only. Check the returned
+ Dwarf_CU is still in the expected section. */
+ if (debug_types)
+ {
+ cu_mem.dbg = dbg;
+ cu_mem.end = dbg->sectiondata[IDX_debug_info]->d_size;
+ cu_mem.sec_idx = IDX_debug_info;
+ cu = &cu_mem;
+ }
+ else
+ cu = NULL;
+
next_cu:
- if (dwarf_next_unit (dbg, offset, &nextcu, &cuhl, &version,
- &abbroffset, &addrsize, &offsize,
- debug_types ? &typesig : NULL,
- debug_types ? &typeoff : NULL) != 0)
+ unit_res = dwarf_get_units (dbg, cu, &cu, &version, &unit_type,
+ &cudie, NULL);
+ if (unit_res == 1)
goto do_return;
+ if (unit_res == -1)
+ {
+ if (!silent)
+ error (0, 0, gettext ("cannot get next unit: %s"), dwarf_errmsg (-1));
+ goto do_return;
+ }
+
+ if (cu->sec_idx != (size_t) (debug_types ? IDX_debug_types : IDX_debug_info))
+ goto do_return;
+
+ dwarf_cu_die (cu, &result, NULL, &abbroffset, &addrsize, &offsize,
+ &unit_id, &subdie_off);
+
if (!silent)
{
- if (debug_types)
- printf (gettext (" Type unit at offset %" PRIu64 ":\n"
- " Version: %" PRIu16 ", Abbreviation section offset: %"
- PRIu64 ", Address size: %" PRIu8
- ", Offset size: %" PRIu8
- "\n Type signature: %#" PRIx64
- ", Type offset: %#" PRIx64 "\n"),
- (uint64_t) offset, version, abbroffset, addrsize, offsize,
- typesig, (uint64_t) typeoff);
+ Dwarf_Off offset = cu->start;
+ if (debug_types && version < 5)
+ {
+ Dwarf_Die typedie;
+ Dwarf_Off dieoffset;
+ dieoffset = dwarf_dieoffset (dwarf_offdie_types (dbg, subdie_off,
+ &typedie));
+ printf (gettext (" Type unit at offset %" PRIu64 ":\n"
+ " Version: %" PRIu16
+ ", Abbreviation section offset: %" PRIu64
+ ", Address size: %" PRIu8
+ ", Offset size: %" PRIu8
+ "\n Type signature: %#" PRIx64
+ ", Type offset: %#" PRIx64 " [%" PRIx64 "]\n"),
+ (uint64_t) offset, version, abbroffset, addrsize, offsize,
+ unit_id, (uint64_t) subdie_off, dieoffset);
+ }
else
- printf (gettext (" Compilation unit at offset %" PRIu64 ":\n"
- " Version: %" PRIu16 ", Abbreviation section offset: %"
- PRIu64 ", Address size: %" PRIu8
- ", Offset size: %" PRIu8 "\n"),
- (uint64_t) offset, version, abbroffset, addrsize, offsize);
+ {
+ printf (gettext (" Compilation unit at offset %" PRIu64 ":\n"
+ " Version: %" PRIu16
+ ", Abbreviation section offset: %" PRIu64
+ ", Address size: %" PRIu8
+ ", Offset size: %" PRIu8 "\n"),
+ (uint64_t) offset, version, abbroffset, addrsize, offsize);
+
+ if (version >= 5 || (unit_type != DW_UT_compile
+ && unit_type != DW_UT_partial))
+ {
+ printf (gettext (" Unit type: %s (%" PRIu8 ")"),
+ dwarf_unit_name (unit_type), unit_type);
+ if (unit_type == DW_UT_type
+ || unit_type == DW_UT_skeleton
+ || unit_type == DW_UT_split_compile
+ || unit_type == DW_UT_split_type)
+ printf (", Unit id: 0x%.16" PRIx64 "", unit_id);
+ if (unit_type == DW_UT_type
+ || unit_type == DW_UT_split_type)
+ {
+ Dwarf_Die typedie;
+ Dwarf_Off dieoffset;
+ dwarf_cu_info (cu, NULL, NULL, NULL, &typedie,
+ NULL, NULL, NULL);
+ dieoffset = dwarf_dieoffset (&typedie);
+ printf (", Unit DIE off: %#" PRIx64 " [%" PRIx64 "]",
+ subdie_off, dieoffset);
+ }
+ printf ("\n");
+ }
+ }
+ }
+
+ if (version < 2 || version > 5
+ || unit_type < DW_UT_compile || unit_type > DW_UT_split_type)
+ {
+ if (!silent)
+ error (0, 0, gettext ("unknown version (%d) or unit type (%d)"),
+ version, unit_type);
+ goto next_cu;
}
struct attrcb_args args =
{
.dwflmod = dwflmod,
- .dbg = dbg,
.silent = silent,
.version = version,
.addrsize = addrsize,
.offset_size = offsize
};
- offset += cuhl;
-
+ bool is_split = false;
int level = 0;
-
- if (unlikely ((debug_types ? dwarf_offdie_types : dwarf_offdie)
- (dbg, offset, &dies[level]) == NULL))
- {
- if (!silent)
- error (0, 0, gettext ("cannot get DIE at offset %" PRIu64
- " in section '%s': %s"),
- (uint64_t) offset, secname, dwarf_errmsg (-1));
- goto do_return;
- }
-
+ dies[0] = cudie;
args.cu = dies[0].cu;
+ args.dbg = dbg;
+ args.is_split = is_split;
+ /* We might return here again for the split CU subdie. */
+ do_cu:
do
{
- offset = dwarf_dieoffset (&dies[level]);
- if (unlikely (offset == ~0ul))
+ Dwarf_Off offset = dwarf_dieoffset (&dies[level]);
+ if (unlikely (offset == (Dwarf_Off) -1))
{
if (!silent)
error (0, 0, gettext ("cannot get DIE offset: %s"),
@@ -6293,16 +7675,22 @@
if (unlikely (tag == DW_TAG_invalid))
{
if (!silent)
- error (0, 0, gettext ("cannot get tag of DIE at offset %" PRIu64
- " in section '%s': %s"),
+ error (0, 0, gettext ("cannot get tag of DIE at offset [%" PRIx64
+ "] in section '%s': %s"),
(uint64_t) offset, secname, dwarf_errmsg (-1));
goto do_return;
}
if (!silent)
- printf (" [%6" PRIx64 "] %*s%s\n",
- (uint64_t) offset, (int) (level * 2), "",
- dwarf_tag_name (tag));
+ {
+ unsigned int code = dwarf_getabbrevcode (dies[level].abbrev);
+ if (is_split)
+ printf (" {%6" PRIx64 "} ", (uint64_t) offset);
+ else
+ printf (" [%6" PRIx64 "] ", (uint64_t) offset);
+ printf ("%*s%-20s abbrev: %u\n", (int) (level * 2), "",
+ dwarf_tag_name (tag), code);
+ }
/* Print the attribute values. */
args.level = level;
@@ -6342,9 +7730,68 @@
}
while (level >= 0);
- offset = nextcu;
- if (offset != 0)
- goto next_cu;
+ /* We might want to show the split compile unit if this was a skeleton.
+ We need to scan it if we are requesting printing .debug_ranges for
+ DWARF4 since GNU DebugFission uses "offsets" into the main ranges
+ section. */
+ if (unit_type == DW_UT_skeleton
+ && ((!silent && show_split_units)
+ || (version < 5 && (print_debug_sections & section_ranges) != 0)))
+ {
+ Dwarf_Die subdie;
+ if (dwarf_cu_info (cu, NULL, NULL, NULL, &subdie, NULL, NULL, NULL) != 0
+ || dwarf_tag (&subdie) == DW_TAG_invalid)
+ {
+ if (!silent)
+ {
+ Dwarf_Attribute dwo_at;
+ const char *dwo_name =
+ (dwarf_formstring (dwarf_attr (&cudie, DW_AT_dwo_name,
+ &dwo_at))
+ ?: (dwarf_formstring (dwarf_attr (&cudie, DW_AT_GNU_dwo_name,
+ &dwo_at))
+ ?: "<unknown>"));
+ fprintf (stderr,
+ "Could not find split unit '%s', id: %" PRIx64 "\n",
+ dwo_name, unit_id);
+ }
+ }
+ else
+ {
+ Dwarf_CU *split_cu = subdie.cu;
+ dwarf_cu_die (split_cu, &result, NULL, &abbroffset,
+ &addrsize, &offsize, &unit_id, &subdie_off);
+ Dwarf_Off offset = cu->start;
+
+ if (!silent)
+ {
+ printf (gettext (" Split compilation unit at offset %"
+ PRIu64 ":\n"
+ " Version: %" PRIu16
+ ", Abbreviation section offset: %" PRIu64
+ ", Address size: %" PRIu8
+ ", Offset size: %" PRIu8 "\n"),
+ (uint64_t) offset, version, abbroffset,
+ addrsize, offsize);
+ printf (gettext (" Unit type: %s (%" PRIu8 ")"),
+ dwarf_unit_name (unit_type), unit_type);
+ printf (", Unit id: 0x%.16" PRIx64 "", unit_id);
+ printf ("\n");
+ }
+
+ unit_type = DW_UT_split_compile;
+ is_split = true;
+ level = 0;
+ dies[0] = subdie;
+ args.cu = dies[0].cu;
+ args.dbg = split_cu->dbg;
+ args.is_split = is_split;
+ goto do_cu;
+ }
+ }
+
+ /* And again... */
+ goto next_cu;
do_return:
free (dies);
@@ -6377,23 +7824,51 @@
size_t address_size
= elf_getident (ebl->elf, NULL)[EI_CLASS] == ELFCLASS32 ? 4 : 8;
- Dwarf_Off cuoffset;
- Dwarf_Off ncuoffset = 0;
- size_t hsize;
- while (dwarf_nextcu (dbg, cuoffset = ncuoffset, &ncuoffset, &hsize,
- NULL, NULL, NULL) == 0)
+ Dwarf_Lines *lines;
+ size_t nlines;
+ Dwarf_Off off, next_off = 0;
+ Dwarf_CU *cu = NULL;
+ while (dwarf_next_lines (dbg, off = next_off, &next_off, &cu, NULL, NULL,
+ &lines, &nlines) == 0)
{
Dwarf_Die cudie;
- if (dwarf_offdie (dbg, cuoffset + hsize, &cudie) == NULL)
- continue;
+ if (cu != NULL && dwarf_cu_info (cu, NULL, NULL, &cudie,
+ NULL, NULL, NULL, NULL) == 0)
+ printf (" CU [%" PRIx64 "] %s\n",
+ dwarf_dieoffset (&cudie), dwarf_diename (&cudie));
+ else
+ {
+ /* DWARF5 lines can be independent of any CU, but they probably
+ are used by some CU. Determine the CU this block is for. */
+ Dwarf_Off cuoffset;
+ Dwarf_Off ncuoffset = 0;
+ size_t hsize;
+ while (dwarf_nextcu (dbg, cuoffset = ncuoffset, &ncuoffset, &hsize,
+ NULL, NULL, NULL) == 0)
+ {
+ if (dwarf_offdie (dbg, cuoffset + hsize, &cudie) == NULL)
+ continue;
+ Dwarf_Attribute stmt_list;
+ if (dwarf_attr (&cudie, DW_AT_stmt_list, &stmt_list) == NULL)
+ continue;
+ Dwarf_Word lineoff;
+ if (dwarf_formudata (&stmt_list, &lineoff) != 0)
+ continue;
+ if (lineoff == off)
+ {
+ /* Found the CU. */
+ cu = cudie.cu;
+ break;
+ }
+ }
- size_t nlines;
- Dwarf_Lines *lines;
- if (dwarf_getsrclines (&cudie, &lines, &nlines) != 0)
- continue;
+ if (cu != NULL)
+ printf (" CU [%" PRIx64 "] %s\n",
+ dwarf_dieoffset (&cudie), dwarf_diename (&cudie));
+ else
+ printf (" No CU\n");
+ }
- printf (" CU [%" PRIx64 "] %s\n",
- dwarf_dieoffset (&cudie), dwarf_diename (&cudie));
printf (" line:col SBPE* disc isa op address"
" (Statement Block Prologue Epilogue *End)\n");
const char *last_file = "";
@@ -6436,17 +7911,17 @@
dwarf_linediscriminator (line, &disc);
/* End sequence is special, it is one byte past. */
- char *a = format_dwarf_addr (dwflmod, address_size,
- address - (endseq ? 1 : 0), address);
- printf (" %4d:%-3d %c%c%c%c%c %4d %3d %2d %s\n",
+ printf (" %4d:%-3d %c%c%c%c%c %4d %3d %2d ",
lineno, colno,
(statement ? 'S' : ' '),
(block ? 'B' : ' '),
(prologue_end ? 'P' : ' '),
(epilogue_begin ? 'E' : ' '),
(endseq ? '*' : ' '),
- disc, isa, lineop, a);
- free (a);
+ disc, isa, lineop);
+ print_dwarf_addr (dwflmod, address_size,
+ address - (endseq ? 1 : 0), address);
+ printf ("\n");
if (endseq)
printf("\n");
@@ -6455,6 +7930,231 @@
}
+/* Print the value of a form.
+ Returns new value of readp, or readendp on failure. */
+static const unsigned char *
+print_form_data (Dwarf *dbg, int form, const unsigned char *readp,
+ const unsigned char *readendp, unsigned int offset_len,
+ Dwarf_Off str_offsets_base)
+{
+ Dwarf_Word val;
+ unsigned char *endp;
+ Elf_Data *data;
+ char *str;
+ switch (form)
+ {
+ case DW_FORM_data1:
+ if (readendp - readp < 1)
+ {
+ invalid_data:
+ error (0, 0, "invalid data");
+ return readendp;
+ }
+ val = *readp++;
+ printf (" %" PRIx8, (unsigned int) val);
+ break;
+
+ case DW_FORM_data2:
+ if (readendp - readp < 2)
+ goto invalid_data;
+ val = read_2ubyte_unaligned_inc (dbg, readp);
+ printf(" %" PRIx16, (unsigned int) val);
+ break;
+
+ case DW_FORM_data4:
+ if (readendp - readp < 4)
+ goto invalid_data;
+ val = read_4ubyte_unaligned_inc (dbg, readp);
+ printf (" %" PRIx32, (unsigned int) val);
+ break;
+
+ case DW_FORM_data8:
+ if (readendp - readp < 8)
+ goto invalid_data;
+ val = read_8ubyte_unaligned_inc (dbg, readp);
+ printf (" %" PRIx64, val);
+ break;
+
+ case DW_FORM_sdata:
+ if (readendp - readp < 1)
+ goto invalid_data;
+ get_sleb128 (val, readp, readendp);
+ printf (" %" PRIx64, val);
+ break;
+
+ case DW_FORM_udata:
+ if (readendp - readp < 1)
+ goto invalid_data;
+ get_uleb128 (val, readp, readendp);
+ printf (" %" PRIx64, val);
+ break;
+
+ case DW_FORM_block:
+ if (readendp - readp < 1)
+ goto invalid_data;
+ get_uleb128 (val, readp, readendp);
+ if ((size_t) (readendp - readp) < val)
+ goto invalid_data;
+ print_bytes (val, readp);
+ readp += val;
+ break;
+
+ case DW_FORM_block1:
+ if (readendp - readp < 1)
+ goto invalid_data;
+ val = *readp++;
+ if ((size_t) (readendp - readp) < val)
+ goto invalid_data;
+ print_bytes (val, readp);
+ readp += val;
+ break;
+
+ case DW_FORM_block2:
+ if (readendp - readp < 2)
+ goto invalid_data;
+ val = read_2ubyte_unaligned_inc (dbg, readp);
+ if ((size_t) (readendp - readp) < val)
+ goto invalid_data;
+ print_bytes (val, readp);
+ readp += val;
+ break;
+
+ case DW_FORM_block4:
+ if (readendp - readp < 4)
+ goto invalid_data;
+ val = read_4ubyte_unaligned_inc (dbg, readp);
+ if ((size_t) (readendp - readp) < val)
+ goto invalid_data;
+ print_bytes (val, readp);
+ readp += val;
+ break;
+
+ case DW_FORM_data16:
+ if (readendp - readp < 16)
+ goto invalid_data;
+ print_bytes (16, readp);
+ readp += 16;
+ break;
+
+ case DW_FORM_flag:
+ if (readendp - readp < 1)
+ goto invalid_data;
+ val = *readp++;
+ printf ("%s", val != 0 ? yes_str : no_str);
+ break;
+
+ case DW_FORM_string:
+ endp = memchr (readp, '\0', readendp - readp);
+ if (endp == NULL)
+ goto invalid_data;
+ printf ("%s", readp);
+ readp = endp + 1;
+ break;
+
+ case DW_FORM_strp:
+ case DW_FORM_line_strp:
+ case DW_FORM_strp_sup:
+ if ((size_t) (readendp - readp) < offset_len)
+ goto invalid_data;
+ if (offset_len == 8)
+ val = read_8ubyte_unaligned_inc (dbg, readp);
+ else
+ val = read_4ubyte_unaligned_inc (dbg, readp);
+ if (form == DW_FORM_strp)
+ data = dbg->sectiondata[IDX_debug_str];
+ else if (form == DW_FORM_line_strp)
+ data = dbg->sectiondata[IDX_debug_line_str];
+ else /* form == DW_FORM_strp_sup */
+ {
+ Dwarf *alt = dwarf_getalt (dbg);
+ data = alt != NULL ? alt->sectiondata[IDX_debug_str] : NULL;
+ }
+ if (data == NULL || val >= data->d_size
+ || memchr (data->d_buf + val, '\0', data->d_size - val) == NULL)
+ str = "???";
+ else
+ str = (char *) data->d_buf + val;
+ printf ("%s (%" PRIu64 ")", str, val);
+ break;
+
+ case DW_FORM_sec_offset:
+ if ((size_t) (readendp - readp) < offset_len)
+ goto invalid_data;
+ if (offset_len == 8)
+ val = read_8ubyte_unaligned_inc (dbg, readp);
+ else
+ val = read_4ubyte_unaligned_inc (dbg, readp);
+ printf ("[%" PRIx64 "]", val);
+ break;
+
+ case DW_FORM_strx:
+ case DW_FORM_GNU_str_index:
+ if (readendp - readp < 1)
+ goto invalid_data;
+ get_uleb128 (val, readp, readendp);
+ strx_val:
+ data = dbg->sectiondata[IDX_debug_str_offsets];
+ if (data == NULL
+ || data->d_size - str_offsets_base < val)
+ str = "???";
+ else
+ {
+ const unsigned char *strreadp = data->d_buf + str_offsets_base + val;
+ const unsigned char *strreadendp = data->d_buf + data->d_size;
+ if ((size_t) (strreadendp - strreadp) < offset_len)
+ str = "???";
+ else
+ {
+ Dwarf_Off idx;
+ if (offset_len == 8)
+ idx = read_8ubyte_unaligned (dbg, strreadp);
+ else
+ idx = read_4ubyte_unaligned (dbg, strreadp);
+
+ data = dbg->sectiondata[IDX_debug_str];
+ if (data == NULL || idx >= data->d_size
+ || memchr (data->d_buf + idx, '\0',
+ data->d_size - idx) == NULL)
+ str = "???";
+ else
+ str = (char *) data->d_buf + idx;
+ }
+ }
+ printf ("%s (%" PRIu64 ")", str, val);
+ break;
+
+ case DW_FORM_strx1:
+ if (readendp - readp < 1)
+ goto invalid_data;
+ val = *readp++;
+ goto strx_val;
+
+ case DW_FORM_strx2:
+ if (readendp - readp < 2)
+ goto invalid_data;
+ val = read_2ubyte_unaligned_inc (dbg, readp);
+ goto strx_val;
+
+ case DW_FORM_strx3:
+ if (readendp - readp < 3)
+ goto invalid_data;
+ val = read_3ubyte_unaligned_inc (dbg, readp);
+ goto strx_val;
+
+ case DW_FORM_strx4:
+ if (readendp - readp < 4)
+ goto invalid_data;
+ val = read_4ubyte_unaligned_inc (dbg, readp);
+ goto strx_val;
+
+ default:
+ error (0, 0, gettext ("unknown form: %s"), dwarf_form_name (form));
+ return readendp;
+ }
+
+ return readp;
+}
+
static void
print_debug_line_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr,
Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg)
@@ -6475,8 +8175,9 @@
/* There is no functionality in libdw to read the information in the
way it is represented here. Hardcode the decoder. */
- Elf_Data *data = dbg->sectiondata[IDX_debug_line];
- if (unlikely (data == NULL || data->d_buf == NULL))
+ Elf_Data *data = (dbg->sectiondata[IDX_debug_line]
+ ?: elf_rawdata (scn, NULL));
+ if (unlikely (data == NULL))
{
error (0, 0, gettext ("cannot get line data section data: %s"),
elf_errmsg (-1));
@@ -6511,35 +8212,67 @@
}
/* Check whether we have enough room in the section. */
- if (unlikely (unit_length > (size_t) (lineendp - linep)
- || unit_length < 2 + length + 5 * 1))
+ if (unlikely (unit_length > (size_t) (lineendp - linep)))
goto invalid_data;
lineendp = linep + unit_length;
/* The next element of the header is the version identifier. */
+ if ((size_t) (lineendp - linep) < 2)
+ goto invalid_data;
uint_fast16_t version = read_2ubyte_unaligned_inc (dbg, linep);
+ size_t address_size
+ = elf_getident (ebl->elf, NULL)[EI_CLASS] == ELFCLASS32 ? 4 : 8;
+ unsigned char segment_selector_size = 0;
+ if (version > 4)
+ {
+ if ((size_t) (lineendp - linep) < 2)
+ goto invalid_data;
+ address_size = *linep++;
+ segment_selector_size = *linep++;
+ }
+
/* Next comes the header length. */
Dwarf_Word header_length;
if (length == 4)
- header_length = read_4ubyte_unaligned_inc (dbg, linep);
+ {
+ if ((size_t) (lineendp - linep) < 4)
+ goto invalid_data;
+ header_length = read_4ubyte_unaligned_inc (dbg, linep);
+ }
else
- header_length = read_8ubyte_unaligned_inc (dbg, linep);
- //const unsigned char *header_start = linep;
+ {
+ if ((size_t) (lineendp - linep) < 8)
+ goto invalid_data;
+ header_length = read_8ubyte_unaligned_inc (dbg, linep);
+ }
/* Next the minimum instruction length. */
+ if ((size_t) (lineendp - linep) < 1)
+ goto invalid_data;
uint_fast8_t minimum_instr_len = *linep++;
/* Next the maximum operations per instruction, in version 4 format. */
- uint_fast8_t max_ops_per_instr = version < 4 ? 1 : *linep++;
+ uint_fast8_t max_ops_per_instr;
+ if (version < 4)
+ max_ops_per_instr = 1;
+ else
+ {
+ if ((size_t) (lineendp - linep) < 1)
+ goto invalid_data;
+ max_ops_per_instr = *linep++;
+ }
- /* Then the flag determining the default value of the is_stmt
- register. */
+ /* We need at least 4 more bytes. */
+ if ((size_t) (lineendp - linep) < 4)
+ goto invalid_data;
+
+ /* Then the flag determining the default value of the is_stmt
+ register. */
uint_fast8_t default_is_stmt = *linep++;
/* Now the line base. */
- int_fast8_t line_base = *((const int_fast8_t *) linep);
- ++linep;
+ int_fast8_t line_base = *linep++;
/* And the line range. */
uint_fast8_t line_range = *linep++;
@@ -6549,22 +8282,49 @@
/* Print what we got so far. */
printf (gettext ("\n"
- " Length: %" PRIu64 "\n"
- " DWARF version: %" PRIuFAST16 "\n"
- " Prologue length: %" PRIu64 "\n"
- " Minimum instruction length: %" PRIuFAST8 "\n"
- " Maximum operations per instruction: %" PRIuFAST8 "\n"
- " Initial value if '%s': %" PRIuFAST8 "\n"
- " Line base: %" PRIdFAST8 "\n"
- " Line range: %" PRIuFAST8 "\n"
- " Opcode base: %" PRIuFAST8 "\n"
+ " Length: %" PRIu64 "\n"
+ " DWARF version: %" PRIuFAST16 "\n"
+ " Prologue length: %" PRIu64 "\n"
+ " Address size: %zd\n"
+ " Segment selector size: %zd\n"
+ " Min instruction length: %" PRIuFAST8 "\n"
+ " Max operations per instruction: %" PRIuFAST8 "\n"
+ " Initial value if 'is_stmt': %" PRIuFAST8 "\n"
+ " Line base: %" PRIdFAST8 "\n"
+ " Line range: %" PRIuFAST8 "\n"
+ " Opcode base: %" PRIuFAST8 "\n"
"\n"
"Opcodes:\n"),
(uint64_t) unit_length, version, (uint64_t) header_length,
+ address_size, (size_t) segment_selector_size,
minimum_instr_len, max_ops_per_instr,
- "is_stmt", default_is_stmt, line_base,
+ default_is_stmt, line_base,
line_range, opcode_base);
+ if (version < 2 || version > 5)
+ {
+ error (0, 0, gettext ("cannot handle .debug_line version: %u\n"),
+ (unsigned int) version);
+ linep = lineendp;
+ continue;
+ }
+
+ if (address_size != 4 && address_size != 8)
+ {
+ error (0, 0, gettext ("cannot handle address size: %u\n"),
+ (unsigned int) address_size);
+ linep = lineendp;
+ continue;
+ }
+
+ if (segment_selector_size != 0)
+ {
+ error (0, 0, gettext ("cannot handle segment selector size: %u\n"),
+ (unsigned int) segment_selector_size);
+ linep = lineendp;
+ continue;
+ }
+
if (unlikely (linep + opcode_base - 1 >= lineendp))
{
invalid_unit:
@@ -6589,59 +8349,182 @@
(int) linep[cnt - 1]),
opcode_base_l10, cnt, linep[cnt - 1]);
linep += opcode_base - 1;
+
if (unlikely (linep >= lineendp))
goto invalid_unit;
+ Dwarf_Off str_offsets_base = str_offsets_base_off (dbg, NULL);
+
puts (gettext ("\nDirectory table:"));
- while (*linep != 0)
+ if (version > 4)
{
- unsigned char *endp = memchr (linep, '\0', lineendp - linep);
- if (unlikely (endp == NULL))
- goto invalid_unit;
+ struct encpair { uint16_t desc; uint16_t form; };
+ struct encpair enc[256];
- printf (" %s\n", (char *) linep);
+ printf (gettext (" ["));
+ if ((size_t) (lineendp - linep) < 1)
+ goto invalid_data;
+ unsigned char directory_entry_format_count = *linep++;
+ for (int i = 0; i < directory_entry_format_count; i++)
+ {
+ uint16_t desc, form;
+ if ((size_t) (lineendp - linep) < 1)
+ goto invalid_data;
+ get_uleb128 (desc, linep, lineendp);
+ if ((size_t) (lineendp - linep) < 1)
+ goto invalid_data;
+ get_uleb128 (form, linep, lineendp);
- linep = endp + 1;
+ enc[i].desc = desc;
+ enc[i].form = form;
+
+ printf ("%s(%s)",
+ dwarf_line_content_description_name (desc),
+ dwarf_form_name (form));
+ if (i + 1 < directory_entry_format_count)
+ printf (", ");
+ }
+ printf ("]\n");
+
+ uint64_t directories_count;
+ if ((size_t) (lineendp - linep) < 1)
+ goto invalid_data;
+ get_uleb128 (directories_count, linep, lineendp);
+
+ if (directory_entry_format_count == 0
+ && directories_count != 0)
+ goto invalid_data;
+
+ for (uint64_t i = 0; i < directories_count; i++)
+ {
+ printf (" %-5" PRIu64 " ", i);
+ for (int j = 0; j < directory_entry_format_count; j++)
+ {
+ linep = print_form_data (dbg, enc[j].form,
+ linep, lineendp, length,
+ str_offsets_base);
+ if (j + 1 < directory_entry_format_count)
+ printf (", ");
+ }
+ printf ("\n");
+ if (linep >= lineendp)
+ goto invalid_unit;
+ }
}
- /* Skip the final NUL byte. */
- ++linep;
+ else
+ {
+ while (*linep != 0)
+ {
+ unsigned char *endp = memchr (linep, '\0', lineendp - linep);
+ if (unlikely (endp == NULL))
+ goto invalid_unit;
+
+ printf (" %s\n", (char *) linep);
+
+ linep = endp + 1;
+ }
+ /* Skip the final NUL byte. */
+ ++linep;
+ }
if (unlikely (linep >= lineendp))
goto invalid_unit;
- puts (gettext ("\nFile name table:\n"
- " Entry Dir Time Size Name"));
- for (unsigned int cnt = 1; *linep != 0; ++cnt)
+
+ puts (gettext ("\nFile name table:"));
+ if (version > 4)
{
- /* First comes the file name. */
- char *fname = (char *) linep;
- unsigned char *endp = memchr (fname, '\0', lineendp - linep);
- if (unlikely (endp == NULL))
- goto invalid_unit;
- linep = endp + 1;
+ struct encpair { uint16_t desc; uint16_t form; };
+ struct encpair enc[256];
- /* Then the index. */
- unsigned int diridx;
- if (lineendp - linep < 1)
- goto invalid_unit;
- get_uleb128 (diridx, linep, lineendp);
+ printf (gettext (" ["));
+ if ((size_t) (lineendp - linep) < 1)
+ goto invalid_data;
+ unsigned char file_name_format_count = *linep++;
+ for (int i = 0; i < file_name_format_count; i++)
+ {
+ uint64_t desc, form;
+ if ((size_t) (lineendp - linep) < 1)
+ goto invalid_data;
+ get_uleb128 (desc, linep, lineendp);
+ if ((size_t) (lineendp - linep) < 1)
+ goto invalid_data;
+ get_uleb128 (form, linep, lineendp);
- /* Next comes the modification time. */
- unsigned int mtime;
- if (lineendp - linep < 1)
- goto invalid_unit;
- get_uleb128 (mtime, linep, lineendp);
+ if (! libdw_valid_user_form (form))
+ goto invalid_data;
- /* Finally the length of the file. */
- unsigned int fsize;
- if (lineendp - linep < 1)
- goto invalid_unit;
- get_uleb128 (fsize, linep, lineendp);
+ enc[i].desc = desc;
+ enc[i].form = form;
- printf (" %-5u %-5u %-9u %-9u %s\n",
- cnt, diridx, mtime, fsize, fname);
+ printf ("%s(%s)",
+ dwarf_line_content_description_name (desc),
+ dwarf_form_name (form));
+ if (i + 1 < file_name_format_count)
+ printf (", ");
+ }
+ printf ("]\n");
+
+ uint64_t file_name_count;
+ if ((size_t) (lineendp - linep) < 1)
+ goto invalid_data;
+ get_uleb128 (file_name_count, linep, lineendp);
+
+ if (file_name_format_count == 0
+ && file_name_count != 0)
+ goto invalid_data;
+
+ for (uint64_t i = 0; i < file_name_count; i++)
+ {
+ printf (" %-5" PRIu64 " ", i);
+ for (int j = 0; j < file_name_format_count; j++)
+ {
+ linep = print_form_data (dbg, enc[j].form,
+ linep, lineendp, length,
+ str_offsets_base);
+ if (j + 1 < file_name_format_count)
+ printf (", ");
+ }
+ printf ("\n");
+ if (linep >= lineendp)
+ goto invalid_unit;
+ }
}
- /* Skip the final NUL byte. */
- ++linep;
+ else
+ {
+ puts (gettext (" Entry Dir Time Size Name"));
+ for (unsigned int cnt = 1; *linep != 0; ++cnt)
+ {
+ /* First comes the file name. */
+ char *fname = (char *) linep;
+ unsigned char *endp = memchr (fname, '\0', lineendp - linep);
+ if (unlikely (endp == NULL))
+ goto invalid_unit;
+ linep = endp + 1;
+
+ /* Then the index. */
+ unsigned int diridx;
+ if (lineendp - linep < 1)
+ goto invalid_unit;
+ get_uleb128 (diridx, linep, lineendp);
+
+ /* Next comes the modification time. */
+ unsigned int mtime;
+ if (lineendp - linep < 1)
+ goto invalid_unit;
+ get_uleb128 (mtime, linep, lineendp);
+
+ /* Finally the length of the file. */
+ unsigned int fsize;
+ if (lineendp - linep < 1)
+ goto invalid_unit;
+ get_uleb128 (fsize, linep, lineendp);
+
+ printf (" %-5u %-5u %-9u %-9u %s\n",
+ cnt, diridx, mtime, fsize, fname);
+ }
+ /* Skip the final NUL byte. */
+ ++linep;
+ }
puts (gettext ("\nLine number statements:"));
Dwarf_Word address = 0;
@@ -6649,34 +8532,6 @@
size_t line = 1;
uint_fast8_t is_stmt = default_is_stmt;
- /* Default address value, in case we do not find the CU. */
- size_t address_size
- = elf_getident (ebl->elf, NULL)[EI_CLASS] == ELFCLASS32 ? 4 : 8;
-
- /* Determine the CU this block is for. */
- Dwarf_Off cuoffset;
- Dwarf_Off ncuoffset = 0;
- size_t hsize;
- while (dwarf_nextcu (dbg, cuoffset = ncuoffset, &ncuoffset, &hsize,
- NULL, NULL, NULL) == 0)
- {
- Dwarf_Die cudie;
- if (dwarf_offdie (dbg, cuoffset + hsize, &cudie) == NULL)
- continue;
- Dwarf_Attribute stmt_list;
- if (dwarf_attr (&cudie, DW_AT_stmt_list, &stmt_list) == NULL)
- continue;
- Dwarf_Word lineoff;
- if (dwarf_formudata (&stmt_list, &lineoff) != 0)
- continue;
- if (lineoff == start_offset)
- {
- /* Found the CU. */
- address_size = cudie.cu->address_size;
- break;
- }
- }
-
/* Apply the "operation advance" from a special opcode
or DW_LNS_advance_pc (as per DWARF4 6.2.5.1). */
unsigned int op_addr_advance;
@@ -6685,7 +8540,7 @@
{
op_addr_advance = minimum_instr_len * ((op_index + op_advance)
/ max_ops_per_instr);
- address += op_advance;
+ address += op_addr_advance;
show_op_index = (op_index > 0 ||
(op_index + op_advance) % max_ops_per_instr > 0);
op_index = (op_index + op_advance) % max_ops_per_instr;
@@ -6728,17 +8583,15 @@
line += line_increment;
advance_pc ((opcode - opcode_base) / line_range);
- char *a = format_dwarf_addr (dwflmod, 0, address, address);
+ printf (gettext (" special opcode %u: address+%u = "),
+ opcode, op_addr_advance);
+ print_dwarf_addr (dwflmod, 0, address, address);
if (show_op_index)
- printf (gettext ("\
- special opcode %u: address+%u = %s, op_index = %u, line%+d = %zu\n"),
- opcode, op_addr_advance, a, op_index,
- line_increment, line);
+ printf (gettext (", op_index = %u, line%+d = %zu\n"),
+ op_index, line_increment, line);
else
- printf (gettext ("\
- special opcode %u: address+%u = %s, line%+d = %zu\n"),
- opcode, op_addr_advance, a, line_increment, line);
- free (a);
+ printf (gettext (", line%+d = %zu\n"),
+ line_increment, line);
}
else if (opcode == 0)
{
@@ -6778,9 +8631,9 @@
else
address = read_8ubyte_unaligned_inc (dbg, linep);
{
- char *a = format_dwarf_addr (dwflmod, 0, address, address);
- printf (gettext (" set address to %s\n"), a);
- free (a);
+ printf (gettext (" set address to "));
+ print_dwarf_addr (dwflmod, 0, address, address);
+ printf ("\n");
}
break;
@@ -6845,15 +8698,12 @@
get_uleb128 (u128, linep, lineendp);
advance_pc (u128);
{
- char *a = format_dwarf_addr (dwflmod, 0, address, address);
+ printf (gettext (" advance address by %u to "),
+ op_addr_advance);
+ print_dwarf_addr (dwflmod, 0, address, address);
if (show_op_index)
- printf (gettext ("\
- advance address by %u to %s, op_index to %u\n"),
- op_addr_advance, a, op_index);
- else
- printf (gettext (" advance address by %u to %s\n"),
- op_addr_advance, a);
- free (a);
+ printf (gettext (", op_index to %u"), op_index);
+ printf ("\n");
}
break;
@@ -6904,16 +8754,12 @@
advance_pc ((255 - opcode_base) / line_range);
{
- char *a = format_dwarf_addr (dwflmod, 0, address, address);
+ printf (gettext (" advance address by constant %u to "),
+ op_addr_advance);
+ print_dwarf_addr (dwflmod, 0, address, address);
if (show_op_index)
- printf (gettext ("\
- advance address by constant %u to %s, op_index to %u\n"),
- op_addr_advance, a, op_index);
- else
- printf (gettext ("\
- advance address by constant %u to %s\n"),
- op_addr_advance, a);
- free (a);
+ printf (gettext (", op_index to %u"), op_index);
+ printf ("\n");
}
break;
@@ -6927,11 +8773,11 @@
address += u128;
op_index = 0;
{
- char *a = format_dwarf_addr (dwflmod, 0, address, address);
printf (gettext ("\
- advance address by fixed value %u to %s\n"),
- u128, a);
- free (a);
+ advance address by fixed value %u to \n"),
+ u128);
+ print_dwarf_addr (dwflmod, 0, address, address);
+ printf ("\n");
}
break;
@@ -6984,11 +8830,439 @@
static void
+print_debug_loclists_section (Dwfl_Module *dwflmod,
+ Ebl *ebl, GElf_Ehdr *ehdr,
+ Elf_Scn *scn, GElf_Shdr *shdr,
+ Dwarf *dbg)
+{
+ printf (gettext ("\
+\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
+ elf_ndxscn (scn), section_name (ebl, ehdr, shdr),
+ (uint64_t) shdr->sh_offset);
+
+ Elf_Data *data = (dbg->sectiondata[IDX_debug_loclists]
+ ?: elf_rawdata (scn, NULL));
+ if (unlikely (data == NULL))
+ {
+ error (0, 0, gettext ("cannot get .debug_loclists content: %s"),
+ elf_errmsg (-1));
+ return;
+ }
+
+ /* For the listptr to get the base address/CU. */
+ sort_listptr (&known_loclistsptr, "loclistsptr");
+ size_t listptr_idx = 0;
+
+ const unsigned char *readp = data->d_buf;
+ const unsigned char *const dataend = ((unsigned char *) data->d_buf
+ + data->d_size);
+ while (readp < dataend)
+ {
+ if (unlikely (readp > dataend - 4))
+ {
+ invalid_data:
+ error (0, 0, gettext ("invalid data in section [%zu] '%s'"),
+ elf_ndxscn (scn), section_name (ebl, ehdr, shdr));
+ return;
+ }
+
+ ptrdiff_t offset = readp - (unsigned char *) data->d_buf;
+ printf (gettext ("Table at Offset 0x%" PRIx64 ":\n\n"),
+ (uint64_t) offset);
+
+ uint64_t unit_length = read_4ubyte_unaligned_inc (dbg, readp);
+ unsigned int offset_size = 4;
+ if (unlikely (unit_length == 0xffffffff))
+ {
+ if (unlikely (readp > dataend - 8))
+ goto invalid_data;
+
+ unit_length = read_8ubyte_unaligned_inc (dbg, readp);
+ offset_size = 8;
+ }
+ printf (gettext (" Length: %8" PRIu64 "\n"), unit_length);
+
+ /* We need at least 2-bytes + 1-byte + 1-byte + 4-bytes = 8
+ bytes to complete the header. And this unit cannot go beyond
+ the section data. */
+ if (readp > dataend - 8
+ || unit_length < 8
+ || unit_length > (uint64_t) (dataend - readp))
+ goto invalid_data;
+
+ const unsigned char *nexthdr = readp + unit_length;
+
+ uint16_t version = read_2ubyte_unaligned_inc (dbg, readp);
+ printf (gettext (" DWARF version: %8" PRIu16 "\n"), version);
+
+ if (version != 5)
+ {
+ error (0, 0, gettext ("Unknown version"));
+ goto next_table;
+ }
+
+ uint8_t address_size = *readp++;
+ printf (gettext (" Address size: %8" PRIu64 "\n"),
+ (uint64_t) address_size);
+
+ if (address_size != 4 && address_size != 8)
+ {
+ error (0, 0, gettext ("unsupported address size"));
+ goto next_table;
+ }
+
+ uint8_t segment_size = *readp++;
+ printf (gettext (" Segment size: %8" PRIu64 "\n"),
+ (uint64_t) segment_size);
+
+ if (segment_size != 0)
+ {
+ error (0, 0, gettext ("unsupported segment size"));
+ goto next_table;
+ }
+
+ uint32_t offset_entry_count = read_4ubyte_unaligned_inc (dbg, readp);
+ printf (gettext (" Offset entries: %8" PRIu64 "\n"),
+ (uint64_t) offset_entry_count);
+
+ /* We need the CU that uses this unit to get the initial base address. */
+ Dwarf_Addr cu_base = 0;
+ struct Dwarf_CU *cu = NULL;
+ if (listptr_cu (&known_loclistsptr, &listptr_idx,
+ (Dwarf_Off) offset,
+ (Dwarf_Off) (nexthdr - (unsigned char *) data->d_buf),
+ &cu_base, &cu)
+ || split_dwarf_cu_base (dbg, &cu, &cu_base))
+ {
+ Dwarf_Die cudie;
+ if (dwarf_cu_die (cu, &cudie,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL) == NULL)
+ printf (gettext (" Unknown CU base: "));
+ else
+ printf (gettext (" CU [%6" PRIx64 "] base: "),
+ dwarf_dieoffset (&cudie));
+ print_dwarf_addr (dwflmod, address_size, cu_base, cu_base);
+ printf ("\n");
+ }
+ else
+ printf (gettext (" Not associated with a CU.\n"));
+
+ printf ("\n");
+
+ const unsigned char *offset_array_start = readp;
+ if (offset_entry_count > 0)
+ {
+ uint64_t max_entries = (unit_length - 8) / offset_size;
+ if (offset_entry_count > max_entries)
+ {
+ error (0, 0,
+ gettext ("too many offset entries for unit length"));
+ offset_entry_count = max_entries;
+ }
+
+ printf (gettext (" Offsets starting at 0x%" PRIx64 ":\n"),
+ (uint64_t) (offset_array_start
+ - (unsigned char *) data->d_buf));
+ for (uint32_t idx = 0; idx < offset_entry_count; idx++)
+ {
+ printf (" [%6" PRIu32 "] ", idx);
+ if (offset_size == 4)
+ {
+ uint32_t off = read_4ubyte_unaligned_inc (dbg, readp);
+ printf ("0x%" PRIx32 "\n", off);
+ }
+ else
+ {
+ uint64_t off = read_8ubyte_unaligned_inc (dbg, readp);
+ printf ("0x%" PRIx64 "\n", off);
+ }
+ }
+ printf ("\n");
+ }
+
+ Dwarf_Addr base = cu_base;
+ bool start_of_list = true;
+ while (readp < nexthdr)
+ {
+ uint8_t kind = *readp++;
+ uint64_t op1, op2, len;
+
+ /* Skip padding. */
+ if (start_of_list && kind == DW_LLE_end_of_list)
+ continue;
+
+ if (start_of_list)
+ {
+ base = cu_base;
+ printf (" Offset: %" PRIx64 ", Index: %" PRIx64 "\n",
+ (uint64_t) (readp - (unsigned char *) data->d_buf - 1),
+ (uint64_t) (readp - offset_array_start - 1));
+ start_of_list = false;
+ }
+
+ printf (" %s", dwarf_loc_list_encoding_name (kind));
+ switch (kind)
+ {
+ case DW_LLE_end_of_list:
+ start_of_list = true;
+ printf ("\n\n");
+ break;
+
+ case DW_LLE_base_addressx:
+ if ((uint64_t) (nexthdr - readp) < 1)
+ {
+ invalid_entry:
+ error (0, 0, gettext ("invalid loclists data"));
+ goto next_table;
+ }
+ get_uleb128 (op1, readp, nexthdr);
+ printf (" %" PRIx64 "\n", op1);
+ if (! print_unresolved_addresses)
+ {
+ Dwarf_Addr addr;
+ if (get_indexed_addr (cu, op1, &addr) != 0)
+ printf (" ???\n");
+ else
+ {
+ printf (" ");
+ print_dwarf_addr (dwflmod, address_size, addr, addr);
+ printf ("\n");
+ }
+ }
+ break;
+
+ case DW_LLE_startx_endx:
+ if ((uint64_t) (nexthdr - readp) < 1)
+ goto invalid_entry;
+ get_uleb128 (op1, readp, nexthdr);
+ if ((uint64_t) (nexthdr - readp) < 1)
+ goto invalid_entry;
+ get_uleb128 (op2, readp, nexthdr);
+ printf (" %" PRIx64 ", %" PRIx64 "\n", op1, op2);
+ if (! print_unresolved_addresses)
+ {
+ Dwarf_Addr addr1;
+ Dwarf_Addr addr2;
+ if (get_indexed_addr (cu, op1, &addr1) != 0
+ || get_indexed_addr (cu, op2, &addr2) != 0)
+ {
+ printf (" ???..\n");
+ printf (" ???\n");
+ }
+ else
+ {
+ printf (" ");
+ print_dwarf_addr (dwflmod, address_size, addr1, addr1);
+ printf ("..\n ");
+ print_dwarf_addr (dwflmod, address_size,
+ addr2 - 1, addr2);
+ printf ("\n");
+ }
+ }
+ if ((uint64_t) (nexthdr - readp) < 1)
+ goto invalid_entry;
+ get_uleb128 (len, readp, nexthdr);
+ if ((uint64_t) (nexthdr - readp) < len)
+ goto invalid_entry;
+ print_ops (dwflmod, dbg, 8, 8, version,
+ address_size, offset_size, cu, len, readp);
+ readp += len;
+ break;
+
+ case DW_LLE_startx_length:
+ if ((uint64_t) (nexthdr - readp) < 1)
+ goto invalid_entry;
+ get_uleb128 (op1, readp, nexthdr);
+ if ((uint64_t) (nexthdr - readp) < 1)
+ goto invalid_entry;
+ get_uleb128 (op2, readp, nexthdr);
+ printf (" %" PRIx64 ", %" PRIx64 "\n", op1, op2);
+ if (! print_unresolved_addresses)
+ {
+ Dwarf_Addr addr1;
+ Dwarf_Addr addr2;
+ if (get_indexed_addr (cu, op1, &addr1) != 0)
+ {
+ printf (" ???..\n");
+ printf (" ???\n");
+ }
+ else
+ {
+ addr2 = addr1 + op2;
+ printf (" ");
+ print_dwarf_addr (dwflmod, address_size, addr1, addr1);
+ printf ("..\n ");
+ print_dwarf_addr (dwflmod, address_size,
+ addr2 - 1, addr2);
+ printf ("\n");
+ }
+ }
+ if ((uint64_t) (nexthdr - readp) < 1)
+ goto invalid_entry;
+ get_uleb128 (len, readp, nexthdr);
+ if ((uint64_t) (nexthdr - readp) < len)
+ goto invalid_entry;
+ print_ops (dwflmod, dbg, 8, 8, version,
+ address_size, offset_size, cu, len, readp);
+ readp += len;
+ break;
+
+ case DW_LLE_offset_pair:
+ if ((uint64_t) (nexthdr - readp) < 1)
+ goto invalid_entry;
+ get_uleb128 (op1, readp, nexthdr);
+ if ((uint64_t) (nexthdr - readp) < 1)
+ goto invalid_entry;
+ get_uleb128 (op2, readp, nexthdr);
+ printf (" %" PRIx64 ", %" PRIx64 "\n", op1, op2);
+ if (! print_unresolved_addresses)
+ {
+ op1 += base;
+ op2 += base;
+ printf (" ");
+ print_dwarf_addr (dwflmod, address_size, op1, op1);
+ printf ("..\n ");
+ print_dwarf_addr (dwflmod, address_size, op2 - 1, op2);
+ printf ("\n");
+ }
+ if ((uint64_t) (nexthdr - readp) < 1)
+ goto invalid_entry;
+ get_uleb128 (len, readp, nexthdr);
+ if ((uint64_t) (nexthdr - readp) < len)
+ goto invalid_entry;
+ print_ops (dwflmod, dbg, 8, 8, version,
+ address_size, offset_size, cu, len, readp);
+ readp += len;
+ break;
+
+ case DW_LLE_default_location:
+ if ((uint64_t) (nexthdr - readp) < 1)
+ goto invalid_entry;
+ get_uleb128 (len, readp, nexthdr);
+ if ((uint64_t) (nexthdr - readp) < len)
+ goto invalid_entry;
+ print_ops (dwflmod, dbg, 8, 8, version,
+ address_size, offset_size, cu, len, readp);
+ readp += len;
+ break;
+
+ case DW_LLE_base_address:
+ if (address_size == 4)
+ {
+ if ((uint64_t) (nexthdr - readp) < 4)
+ goto invalid_entry;
+ op1 = read_4ubyte_unaligned_inc (dbg, readp);
+ }
+ else
+ {
+ if ((uint64_t) (nexthdr - readp) < 8)
+ goto invalid_entry;
+ op1 = read_8ubyte_unaligned_inc (dbg, readp);
+ }
+ base = op1;
+ printf (" 0x%" PRIx64 "\n", base);
+ if (! print_unresolved_addresses)
+ {
+ printf (" ");
+ print_dwarf_addr (dwflmod, address_size, base, base);
+ printf ("\n");
+ }
+ break;
+
+ case DW_LLE_start_end:
+ if (address_size == 4)
+ {
+ if ((uint64_t) (nexthdr - readp) < 8)
+ goto invalid_entry;
+ op1 = read_4ubyte_unaligned_inc (dbg, readp);
+ op2 = read_4ubyte_unaligned_inc (dbg, readp);
+ }
+ else
+ {
+ if ((uint64_t) (nexthdr - readp) < 16)
+ goto invalid_entry;
+ op1 = read_8ubyte_unaligned_inc (dbg, readp);
+ op2 = read_8ubyte_unaligned_inc (dbg, readp);
+ }
+ printf (" 0x%" PRIx64 "..0x%" PRIx64 "\n", op1, op2);
+ if (! print_unresolved_addresses)
+ {
+ printf (" ");
+ print_dwarf_addr (dwflmod, address_size, op1, op1);
+ printf ("..\n ");
+ print_dwarf_addr (dwflmod, address_size, op2 - 1, op2);
+ printf ("\n");
+ }
+ if ((uint64_t) (nexthdr - readp) < 1)
+ goto invalid_entry;
+ get_uleb128 (len, readp, nexthdr);
+ if ((uint64_t) (nexthdr - readp) < len)
+ goto invalid_entry;
+ print_ops (dwflmod, dbg, 8, 8, version,
+ address_size, offset_size, cu, len, readp);
+ readp += len;
+ break;
+
+ case DW_LLE_start_length:
+ if (address_size == 4)
+ {
+ if ((uint64_t) (nexthdr - readp) < 4)
+ goto invalid_entry;
+ op1 = read_4ubyte_unaligned_inc (dbg, readp);
+ }
+ else
+ {
+ if ((uint64_t) (nexthdr - readp) < 8)
+ goto invalid_entry;
+ op1 = read_8ubyte_unaligned_inc (dbg, readp);
+ }
+ if ((uint64_t) (nexthdr - readp) < 1)
+ goto invalid_entry;
+ get_uleb128 (op2, readp, nexthdr);
+ printf (" 0x%" PRIx64 ", %" PRIx64 "\n", op1, op2);
+ if (! print_unresolved_addresses)
+ {
+ op2 = op1 + op2;
+ printf (" ");
+ print_dwarf_addr (dwflmod, address_size, op1, op1);
+ printf ("..\n ");
+ print_dwarf_addr (dwflmod, address_size, op2 - 1, op2);
+ printf ("\n");
+ }
+ if ((uint64_t) (nexthdr - readp) < 1)
+ goto invalid_entry;
+ get_uleb128 (len, readp, nexthdr);
+ if ((uint64_t) (nexthdr - readp) < len)
+ goto invalid_entry;
+ print_ops (dwflmod, dbg, 8, 8, version,
+ address_size, offset_size, cu, len, readp);
+ readp += len;
+ break;
+
+ default:
+ goto invalid_entry;
+ }
+ }
+
+ next_table:
+ if (readp != nexthdr)
+ {
+ size_t padding = nexthdr - readp;
+ printf (gettext (" %zu padding bytes\n\n"), padding);
+ readp = nexthdr;
+ }
+ }
+}
+
+
+static void
print_debug_loc_section (Dwfl_Module *dwflmod,
Ebl *ebl, GElf_Ehdr *ehdr,
Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg)
{
- Elf_Data *data = dbg->sectiondata[IDX_debug_loc];
+ Elf_Data *data = (dbg->sectiondata[IDX_debug_loc]
+ ?: elf_rawdata (scn, NULL));
if (unlikely (data == NULL))
{
@@ -7002,35 +9276,154 @@
elf_ndxscn (scn), section_name (ebl, ehdr, shdr),
(uint64_t) shdr->sh_offset);
- sort_listptr (&known_loclistptr, "loclistptr");
+ sort_listptr (&known_locsptr, "loclistptr");
size_t listptr_idx = 0;
uint_fast8_t address_size = ehdr->e_ident[EI_CLASS] == ELFCLASS32 ? 4 : 8;
uint_fast8_t offset_size = 4;
bool first = true;
- struct Dwarf_CU *cu = NULL;
Dwarf_Addr base = 0;
unsigned char *readp = data->d_buf;
unsigned char *const endp = (unsigned char *) data->d_buf + data->d_size;
+ Dwarf_CU *last_cu = NULL;
while (readp < endp)
{
ptrdiff_t offset = readp - (unsigned char *) data->d_buf;
+ Dwarf_CU *cu = last_cu;
+ unsigned int attr = 0;
- if (first && skip_listptr_hole (&known_loclistptr, &listptr_idx,
+ if (first && skip_listptr_hole (&known_locsptr, &listptr_idx,
&address_size, &offset_size, &base,
- &cu, offset, &readp, endp))
+ &cu, offset, &readp, endp, &attr))
continue;
- if (unlikely (data->d_size - offset < (size_t) address_size * 2))
+ if (last_cu != cu)
+ {
+ Dwarf_Die cudie;
+ if (dwarf_cu_die (cu, &cudie,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL) == NULL)
+ printf (gettext ("\n Unknown CU base: "));
+ else
+ printf (gettext ("\n CU [%6" PRIx64 "] base: "),
+ dwarf_dieoffset (&cudie));
+ print_dwarf_addr (dwflmod, address_size, base, base);
+ printf ("\n");
+ }
+ last_cu = cu;
+
+ if (attr == DW_AT_GNU_locviews)
{
+ Dwarf_Off next_off = next_listptr_offset (&known_locsptr,
+ listptr_idx);
+ const unsigned char *locp = readp;
+ const unsigned char *locendp;
+ if (next_off == 0
+ || next_off > (size_t) (endp
+ - (const unsigned char *) data->d_buf))
+ locendp = endp;
+ else
+ locendp = (const unsigned char *) data->d_buf + next_off;
+
+ while (locp < locendp)
+ {
+ uint64_t v1, v2;
+ get_uleb128 (v1, locp, locendp);
+ if (locp >= locendp)
+ {
+ printf (gettext (" [%6tx] <INVALID DATA>\n"), offset);
+ break;
+ }
+ get_uleb128 (v2, locp, locendp);
+ if (first) /* First view pair in a list. */
+ printf (" [%6tx] ", offset);
+ else
+ printf (" ");
+ printf ("view pair %" PRId64 ", %" PRId64 "\n", v1, v2);
+ first = false;
+ }
+
+ first = true;
+ readp = (unsigned char *) locendp;
+ continue;
+ }
+
+ /* GNU DebugFission encoded addresses as addrx. */
+ bool is_debugfission = ((cu != NULL
+ || split_dwarf_cu_base (dbg, &cu, &base))
+ && (cu->version < 5
+ && cu->unit_type == DW_UT_split_compile));
+ if (!is_debugfission
+ && unlikely (data->d_size - offset < (size_t) address_size * 2))
+ {
+ invalid_data:
printf (gettext (" [%6tx] <INVALID DATA>\n"), offset);
break;
}
Dwarf_Addr begin;
Dwarf_Addr end;
- if (address_size == 8)
+ bool use_base = true;
+ if (is_debugfission)
+ {
+ const unsigned char *locp = readp;
+ const unsigned char *locendp = readp + data->d_size;
+ if (locp >= locendp)
+ goto invalid_data;
+
+ Dwarf_Word idx;
+ unsigned char code = *locp++;
+ switch (code)
+ {
+ case DW_LLE_GNU_end_of_list_entry:
+ begin = 0;
+ end = 0;
+ break;
+
+ case DW_LLE_GNU_base_address_selection_entry:
+ if (locp >= locendp)
+ goto invalid_data;
+ begin = (Dwarf_Addr) -1;
+ get_uleb128 (idx, locp, locendp);
+ if (get_indexed_addr (cu, idx, &end) != 0)
+ end = idx; /* ... */
+ break;
+
+ case DW_LLE_GNU_start_end_entry:
+ if (locp >= locendp)
+ goto invalid_data;
+ get_uleb128 (idx, locp, locendp);
+ if (get_indexed_addr (cu, idx, &begin) != 0)
+ begin = idx; /* ... */
+ if (locp >= locendp)
+ goto invalid_data;
+ get_uleb128 (idx, locp, locendp);
+ if (get_indexed_addr (cu, idx, &end) != 0)
+ end = idx; /* ... */
+ use_base = false;
+ break;
+
+ case DW_LLE_GNU_start_length_entry:
+ if (locp >= locendp)
+ goto invalid_data;
+ get_uleb128 (idx, locp, locendp);
+ if (get_indexed_addr (cu, idx, &begin) != 0)
+ begin = idx; /* ... */
+ if (locendp - locp < 4)
+ goto invalid_data;
+ end = read_4ubyte_unaligned_inc (dbg, locp);
+ end += begin;
+ use_base = false;
+ break;
+
+ default:
+ goto invalid_data;
+ }
+
+ readp = (unsigned char *) locp;
+ }
+ else if (address_size == 8)
{
begin = read_8ubyte_unaligned_inc (dbg, readp);
end = read_8ubyte_unaligned_inc (dbg, readp);
@@ -7045,15 +9438,15 @@
if (begin == (Dwarf_Addr) -1l) /* Base address entry. */
{
- char *b = format_dwarf_addr (dwflmod, address_size, end, end);
- printf (gettext (" [%6tx] base address %s\n"), offset, b);
- free (b);
+ printf (gettext (" [%6tx] base address\n "), offset);
+ print_dwarf_addr (dwflmod, address_size, end, end);
+ printf ("\n");
base = end;
}
else if (begin == 0 && end == 0) /* End of list entry. */
{
if (first)
- printf (gettext (" [%6tx] empty list\n"), offset);
+ printf (gettext (" [%6tx] empty list\n"), offset);
first = true;
}
else
@@ -7061,18 +9454,22 @@
/* We have a location expression entry. */
uint_fast16_t len = read_2ubyte_unaligned_inc (dbg, readp);
- char *b = format_dwarf_addr (dwflmod, address_size, base + begin,
- begin);
- char *e = format_dwarf_addr (dwflmod, address_size, base + end,
- end);
-
if (first) /* First entry in a list. */
- printf (gettext (" [%6tx] %s..%s"), offset, b, e);
+ printf (" [%6tx] ", offset);
else
- printf (gettext (" %s..%s"), b, e);
+ printf (" ");
- free (b);
- free (e);
+ printf ("range %" PRIx64 ", %" PRIx64 "\n", begin, end);
+ if (! print_unresolved_addresses)
+ {
+ Dwarf_Addr dab = use_base ? base + begin : begin;
+ Dwarf_Addr dae = use_base ? base + end : end;
+ printf (" ");
+ print_dwarf_addr (dwflmod, address_size, dab, dab);
+ printf ("..\n ");
+ print_dwarf_addr (dwflmod, address_size, dae - 1, dae);
+ printf ("\n");
+ }
if (endp - readp <= (ptrdiff_t) len)
{
@@ -7080,8 +9477,9 @@
break;
}
- print_ops (dwflmod, dbg, 1, 18 + (address_size * 4),
- 3 /*XXX*/, address_size, offset_size, cu, len, readp);
+ print_ops (dwflmod, dbg, 11, 11,
+ cu != NULL ? cu->version : 3,
+ address_size, offset_size, cu, len, readp);
first = false;
readp += len;
@@ -7125,8 +9523,9 @@
/* There is no function in libdw to iterate over the raw content of
the section but it is easy enough to do. */
- Elf_Data *data = dbg->sectiondata[IDX_debug_macinfo];
- if (unlikely (data == NULL || data->d_buf == NULL))
+ Elf_Data *data = (dbg->sectiondata[IDX_debug_macinfo]
+ ?: elf_rawdata (scn, NULL));
+ if (unlikely (data == NULL))
{
error (0, 0, gettext ("cannot get macro information section data: %s"),
elf_errmsg (-1));
@@ -7287,8 +9686,9 @@
(uint64_t) shdr->sh_offset);
putc_unlocked ('\n', stdout);
- Elf_Data *data = dbg->sectiondata[IDX_debug_macro];
- if (unlikely (data == NULL || data->d_buf == NULL))
+ Elf_Data *data = (dbg->sectiondata[IDX_debug_macro]
+ ?: elf_rawdata (scn, NULL));
+ if (unlikely (data == NULL))
{
error (0, 0, gettext ("cannot get macro information section data: %s"),
elf_errmsg (-1));
@@ -7347,7 +9747,7 @@
// Version 4 is the GNU extension for DWARF4. DWARF5 will use version
// 5 when it gets standardized.
- if (vers != 4)
+ if (vers != 4 && vers != 5)
{
printf (gettext (" unknown version, cannot parse section\n"));
return;
@@ -7371,7 +9771,19 @@
line_offset);
}
- const unsigned char *vendor[DW_MACRO_GNU_hi_user - DW_MACRO_GNU_lo_user];
+ struct mac_culist *cu = NULL;
+ if (line_offset != (Dwarf_Off) -1)
+ {
+ cu = culist;
+ while (cu != NULL && line_offset != cu->offset)
+ cu = cu->next;
+ }
+
+ Dwarf_Off str_offsets_base = str_offsets_base_off (dbg, (cu != NULL
+ ? cu->die.cu
+ : NULL));
+
+ const unsigned char *vendor[DW_MACRO_hi_user - DW_MACRO_lo_user + 1];
memset (vendor, 0, sizeof vendor);
if (flag & 0x04)
{
@@ -7388,12 +9800,12 @@
goto invalid_data;
unsigned int opcode = *readp++;
printf (gettext (" [%" PRIx8 "]"), opcode);
- if (opcode < DW_MACRO_GNU_lo_user
- || opcode > DW_MACRO_GNU_hi_user)
+ if (opcode < DW_MACRO_lo_user
+ || opcode > DW_MACRO_hi_user)
goto invalid_data;
// Record the start of description for this vendor opcode.
// uleb128 nr args, 1 byte per arg form.
- vendor[opcode - DW_MACRO_GNU_lo_user] = readp;
+ vendor[opcode - DW_MACRO_lo_user] = readp;
if (readp + 1 > readendp)
goto invalid_data;
unsigned int args = *readp++;
@@ -7405,21 +9817,8 @@
if (readp + 1 > readendp)
goto invalid_data;
unsigned int form = *readp++;
- printf (" %s", dwarf_form_string (form));
- if (form != DW_FORM_data1
- && form != DW_FORM_data2
- && form != DW_FORM_data4
- && form != DW_FORM_data8
- && form != DW_FORM_sdata
- && form != DW_FORM_udata
- && form != DW_FORM_block
- && form != DW_FORM_block1
- && form != DW_FORM_block2
- && form != DW_FORM_block4
- && form != DW_FORM_flag
- && form != DW_FORM_string
- && form != DW_FORM_strp
- && form != DW_FORM_sec_offset)
+ printf (" %s", dwarf_form_name (form));
+ if (! libdw_valid_user_form (form))
goto invalid_data;
args--;
if (args > 0)
@@ -7446,7 +9845,7 @@
switch (opcode)
{
- case DW_MACRO_GNU_start_file:
+ case DW_MACRO_start_file:
get_uleb128 (u128, readp, readendp);
if (readp >= readendp)
goto invalid_data;
@@ -7454,34 +9853,28 @@
/* Find the CU DIE that matches this line offset. */
const char *fname = "???";
- if (line_offset != (Dwarf_Off) -1)
+ if (cu != NULL)
{
- struct mac_culist *cu = culist;
- while (cu != NULL && line_offset != cu->offset)
- cu = cu->next;
- if (cu != NULL)
- {
- if (cu->files == NULL
- && dwarf_getsrcfiles (&cu->die, &cu->files,
- NULL) != 0)
- cu->files = (Dwarf_Files *) -1l;
+ if (cu->files == NULL
+ && dwarf_getsrcfiles (&cu->die, &cu->files,
+ NULL) != 0)
+ cu->files = (Dwarf_Files *) -1l;
- if (cu->files != (Dwarf_Files *) -1l)
- fname = (dwarf_filesrc (cu->files, u128_2,
- NULL, NULL) ?: "???");
- }
+ if (cu->files != (Dwarf_Files *) -1l)
+ fname = (dwarf_filesrc (cu->files, u128_2,
+ NULL, NULL) ?: "???");
}
printf ("%*sstart_file %u, [%u] %s\n",
level, "", u128, u128_2, fname);
++level;
break;
- case DW_MACRO_GNU_end_file:
+ case DW_MACRO_end_file:
--level;
printf ("%*send_file\n", level, "");
break;
- case DW_MACRO_GNU_define:
+ case DW_MACRO_define:
get_uleb128 (u128, readp, readendp);
endp = memchr (readp, '\0', readendp - readp);
if (endp == NULL)
@@ -7491,7 +9884,7 @@
readp = endp + 1;
break;
- case DW_MACRO_GNU_undef:
+ case DW_MACRO_undef:
get_uleb128 (u128, readp, readendp);
endp = memchr (readp, '\0', readendp - readp);
if (endp == NULL)
@@ -7501,7 +9894,7 @@
readp = endp + 1;
break;
- case DW_MACRO_GNU_define_indirect:
+ case DW_MACRO_define_strp:
get_uleb128 (u128, readp, readendp);
if (readp + offset_len > readendp)
goto invalid_data;
@@ -7513,7 +9906,7 @@
level, "", dwarf_getstring (dbg, off, NULL), u128);
break;
- case DW_MACRO_GNU_undef_indirect:
+ case DW_MACRO_undef_strp:
get_uleb128 (u128, readp, readendp);
if (readp + offset_len > readendp)
goto invalid_data;
@@ -7525,7 +9918,7 @@
level, "", dwarf_getstring (dbg, off, NULL), u128);
break;
- case DW_MACRO_GNU_transparent_include:
+ case DW_MACRO_import:
if (readp + offset_len > readendp)
goto invalid_data;
if (offset_len == 8)
@@ -7536,141 +9929,83 @@
level, "", off);
break;
+ case DW_MACRO_define_sup:
+ get_uleb128 (u128, readp, readendp);
+ if (readp + offset_len > readendp)
+ goto invalid_data;
+ printf ("%*s#define ", level, "");
+ readp = print_form_data (dbg, DW_FORM_strp_sup,
+ readp, readendp, offset_len,
+ str_offsets_base);
+ printf (", line %u (sup)\n", u128);
+ break;
+
+ case DW_MACRO_undef_sup:
+ get_uleb128 (u128, readp, readendp);
+ if (readp + offset_len > readendp)
+ goto invalid_data;
+ printf ("%*s#undef ", level, "");
+ readp = print_form_data (dbg, DW_FORM_strp_sup,
+ readp, readendp, offset_len,
+ str_offsets_base);
+ printf (", line %u (sup)\n", u128);
+ break;
+
+ case DW_MACRO_import_sup:
+ if (readp + offset_len > readendp)
+ goto invalid_data;
+ if (offset_len == 8)
+ off = read_8ubyte_unaligned_inc (dbg, readp);
+ else
+ off = read_4ubyte_unaligned_inc (dbg, readp);
+ // XXX Needs support for reading from supplementary object file.
+ printf ("%*s#include offset 0x%" PRIx64 " (sup)\n",
+ level, "", off);
+ break;
+
+ case DW_MACRO_define_strx:
+ get_uleb128 (u128, readp, readendp);
+ if (readp + offset_len > readendp)
+ goto invalid_data;
+ printf ("%*s#define ", level, "");
+ readp = print_form_data (dbg, DW_FORM_strx,
+ readp, readendp, offset_len,
+ str_offsets_base);
+ printf (", line %u (strx)\n", u128);
+ break;
+
+ case DW_MACRO_undef_strx:
+ get_uleb128 (u128, readp, readendp);
+ if (readp + offset_len > readendp)
+ goto invalid_data;
+ printf ("%*s#undef ", level, "");
+ readp = print_form_data (dbg, DW_FORM_strx,
+ readp, readendp, offset_len,
+ str_offsets_base);
+ printf (", line %u (strx)\n", u128);
+ break;
+
default:
printf ("%*svendor opcode 0x%" PRIx8, level, "", opcode);
- if (opcode < DW_MACRO_GNU_lo_user
- || opcode > DW_MACRO_GNU_lo_user
- || vendor[opcode - DW_MACRO_GNU_lo_user] == NULL)
+ if (opcode < DW_MACRO_lo_user
+ || opcode > DW_MACRO_lo_user
+ || vendor[opcode - DW_MACRO_lo_user] == NULL)
goto invalid_data;
const unsigned char *op_desc;
- op_desc = vendor[opcode - DW_MACRO_GNU_lo_user];
+ op_desc = vendor[opcode - DW_MACRO_lo_user];
// Just skip the arguments, we cannot really interpret them,
// but print as much as we can.
unsigned int args = *op_desc++;
- while (args > 0)
+ while (args > 0 && readp < readendp)
{
unsigned int form = *op_desc++;
- Dwarf_Word val;
- switch (form)
- {
- case DW_FORM_data1:
- if (readp + 1 > readendp)
- goto invalid_data;
- val = *readp++;
- printf (" %" PRIx8, (unsigned int) val);
- break;
-
- case DW_FORM_data2:
- if (readp + 2 > readendp)
- goto invalid_data;
- val = read_2ubyte_unaligned_inc (dbg, readp);
- printf(" %" PRIx16, (unsigned int) val);
- break;
-
- case DW_FORM_data4:
- if (readp + 4 > readendp)
- goto invalid_data;
- val = read_4ubyte_unaligned_inc (dbg, readp);
- printf (" %" PRIx32, (unsigned int) val);
- break;
-
- case DW_FORM_data8:
- if (readp + 8 > readendp)
- goto invalid_data;
- val = read_8ubyte_unaligned_inc (dbg, readp);
- printf (" %" PRIx64, val);
- break;
-
- case DW_FORM_sdata:
- get_sleb128 (val, readp, readendp);
- printf (" %" PRIx64, val);
- break;
-
- case DW_FORM_udata:
- get_uleb128 (val, readp, readendp);
- printf (" %" PRIx64, val);
- break;
-
- case DW_FORM_block:
- get_uleb128 (val, readp, readendp);
- printf (" block[%" PRIu64 "]", val);
- if (readp + val > readendp)
- goto invalid_data;
- readp += val;
- break;
-
- case DW_FORM_block1:
- if (readp + 1 > readendp)
- goto invalid_data;
- val = *readp++;
- printf (" block[%" PRIu64 "]", val);
- if (readp + val > readendp)
- goto invalid_data;
- break;
-
- case DW_FORM_block2:
- if (readp + 2 > readendp)
- goto invalid_data;
- val = read_2ubyte_unaligned_inc (dbg, readp);
- printf (" block[%" PRIu64 "]", val);
- if (readp + val > readendp)
- goto invalid_data;
- break;
-
- case DW_FORM_block4:
- if (readp + 2 > readendp)
- goto invalid_data;
- val =read_4ubyte_unaligned_inc (dbg, readp);
- printf (" block[%" PRIu64 "]", val);
- if (readp + val > readendp)
- goto invalid_data;
- break;
-
- case DW_FORM_flag:
- if (readp + 1 > readendp)
- goto invalid_data;
- val = *readp++;
- printf (" %s", nl_langinfo (val != 0 ? YESSTR : NOSTR));
- break;
-
- case DW_FORM_string:
- endp = memchr (readp, '\0', readendp - readp);
- if (endp == NULL)
- goto invalid_data;
- printf (" %s", readp);
- readp = endp + 1;
- break;
-
- case DW_FORM_strp:
- if (readp + offset_len > readendp)
- goto invalid_data;
- if (offset_len == 8)
- val = read_8ubyte_unaligned_inc (dbg, readp);
- else
- val = read_4ubyte_unaligned_inc (dbg, readp);
- printf (" %s", dwarf_getstring (dbg, val, NULL));
- break;
-
- case DW_FORM_sec_offset:
- if (readp + offset_len > readendp)
- goto invalid_data;
- if (offset_len == 8)
- val = read_8ubyte_unaligned_inc (dbg, readp);
- else
- val = read_4ubyte_unaligned_inc (dbg, readp);
- printf (" %" PRIx64, val);
- break;
-
- default:
- error (0, 0, gettext ("vendor opcode not verified?"));
- return;
- }
-
+ readp = print_form_data (dbg, form, readp, readendp,
+ offset_len, str_offsets_base);
args--;
if (args > 0)
- putchar_unlocked (',');
+ printf (", ");
}
putchar_unlocked ('\n');
}
@@ -7718,10 +10053,11 @@
static void
print_debug_str_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
Ebl *ebl, GElf_Ehdr *ehdr,
- Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg)
+ Elf_Scn *scn, GElf_Shdr *shdr,
+ Dwarf *dbg __attribute__ ((unused)))
{
- const size_t sh_size = (dbg->sectiondata[IDX_debug_str] ?
- dbg->sectiondata[IDX_debug_str]->d_size : 0);
+ Elf_Data *data = elf_rawdata (scn, NULL);
+ const size_t sh_size = data ? data->d_size : 0;
/* Compute floor(log16(shdr->sh_size)). */
GElf_Addr tmp = sh_size;
@@ -7744,20 +10080,207 @@
while (offset < sh_size)
{
size_t len;
- const char *str = dwarf_getstring (dbg, offset, &len);
- if (unlikely (str == NULL))
+ const char *str = (const char *) data->d_buf + offset;
+ const char *endp = memchr (str, '\0', sh_size - offset);
+ if (unlikely (endp == NULL))
{
- printf (gettext (" *** error while reading strings: %s\n"),
- dwarf_errmsg (-1));
+ printf (gettext (" *** error, missing string terminator\n"));
break;
}
printf (" [%*" PRIx64 "] \"%s\"\n", digits, (uint64_t) offset, str);
-
+ len = endp - str;
offset += len + 1;
}
}
+static void
+print_debug_str_offsets_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
+ Ebl *ebl, GElf_Ehdr *ehdr,
+ Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg)
+{
+ printf (gettext ("\
+\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
+ elf_ndxscn (scn), section_name (ebl, ehdr, shdr),
+ (uint64_t) shdr->sh_offset);
+
+ if (shdr->sh_size == 0)
+ return;
+
+ /* We like to get the section from libdw to make sure they are relocated. */
+ Elf_Data *data = (dbg->sectiondata[IDX_debug_str_offsets]
+ ?: elf_rawdata (scn, NULL));
+ if (unlikely (data == NULL))
+ {
+ error (0, 0, gettext ("cannot get .debug_str_offsets section data: %s"),
+ elf_errmsg (-1));
+ return;
+ }
+
+ size_t idx = 0;
+ sort_listptr (&known_stroffbases, "str_offsets");
+
+ const unsigned char *start = (const unsigned char *) data->d_buf;
+ const unsigned char *readp = start;
+ const unsigned char *readendp = ((const unsigned char *) data->d_buf
+ + data->d_size);
+
+ while (readp < readendp)
+ {
+ /* Most string offset tables will have a header. For split
+ dwarf unit GNU DebugFission didn't add one. But they were
+ also only defined for split units (main or skeleton units
+ didn't have indirect strings). So if we don't have a
+ DW_AT_str_offsets_base at all and this is offset zero, then
+ just start printing offsets immediately, if this is a .dwo
+ section. */
+ Dwarf_Off off = (Dwarf_Off) (readp
+ - (const unsigned char *) data->d_buf);
+
+ printf ("Table at offset %" PRIx64 " ", off);
+
+ struct listptr *listptr = get_listptr (&known_stroffbases, idx++);
+ const unsigned char *next_unitp = readendp;
+ uint8_t offset_size;
+ bool has_header;
+ if (listptr == NULL)
+ {
+ /* This can happen for .dwo files. There is only an header
+ in the case this is a version 5 split DWARF file. */
+ Dwarf_CU *cu;
+ uint8_t unit_type;
+ if (dwarf_get_units (dbg, NULL, &cu, NULL, &unit_type,
+ NULL, NULL) != 0)
+ {
+ error (0, 0, "Warning: Cannot find any DWARF unit.");
+ /* Just guess some values. */
+ has_header = false;
+ offset_size = 4;
+ }
+ else if (off == 0
+ && (unit_type == DW_UT_split_type
+ || unit_type == DW_UT_split_compile))
+ {
+ has_header = cu->version > 4;
+ offset_size = cu->offset_size;
+ }
+ else
+ {
+ error (0, 0,
+ "Warning: No CU references .debug_str_offsets after %"
+ PRIx64, off);
+ has_header = cu->version > 4;
+ offset_size = cu->offset_size;
+ }
+ printf ("\n");
+ }
+ else
+ {
+ /* This must be DWARF5, since GNU DebugFission didn't define
+ DW_AT_str_offsets_base. */
+ has_header = true;
+
+ Dwarf_Die cudie;
+ if (dwarf_cu_die (listptr->cu, &cudie,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL) == NULL)
+ printf ("Unknown CU (%s):\n", dwarf_errmsg (-1));
+ else
+ printf ("for CU [%6" PRIx64 "]:\n", dwarf_dieoffset (&cudie));
+ }
+
+ if (has_header)
+ {
+ uint64_t unit_length;
+ uint16_t version;
+ uint16_t padding;
+
+ unit_length = read_4ubyte_unaligned_inc (dbg, readp);
+ if (unlikely (unit_length == 0xffffffff))
+ {
+ if (unlikely (readp > readendp - 8))
+ {
+ invalid_data:
+ error (0, 0, "Invalid data");
+ return;
+ }
+ unit_length = read_8ubyte_unaligned_inc (dbg, readp);
+ offset_size = 8;
+ }
+ else
+ offset_size = 4;
+
+ printf ("\n");
+ printf (gettext (" Length: %8" PRIu64 "\n"),
+ unit_length);
+ printf (gettext (" Offset size: %8" PRIu8 "\n"),
+ offset_size);
+
+ /* We need at least 2-bytes (version) + 2-bytes (padding) =
+ 4 bytes to complete the header. And this unit cannot go
+ beyond the section data. */
+ if (readp > readendp - 4
+ || unit_length < 4
+ || unit_length > (uint64_t) (readendp - readp))
+ goto invalid_data;
+
+ next_unitp = readp + unit_length;
+
+ version = read_2ubyte_unaligned_inc (dbg, readp);
+ printf (gettext (" DWARF version: %8" PRIu16 "\n"), version);
+
+ if (version != 5)
+ {
+ error (0, 0, gettext ("Unknown version"));
+ goto next_unit;
+ }
+
+ padding = read_2ubyte_unaligned_inc (dbg, readp);
+ printf (gettext (" Padding: %8" PRIx16 "\n"), padding);
+
+ if (listptr != NULL
+ && listptr->offset != (Dwarf_Off) (readp - start))
+ {
+ error (0, 0, "String offsets index doesn't start after header");
+ goto next_unit;
+ }
+
+ printf ("\n");
+ }
+
+ int digits = 1;
+ size_t offsets = (next_unitp - readp) / offset_size;
+ while (offsets >= 10)
+ {
+ ++digits;
+ offsets /= 10;
+ }
+
+ unsigned int index = 0;
+ size_t index_offset = readp - (const unsigned char *) data->d_buf;
+ printf (" Offsets start at 0x%zx:\n", index_offset);
+ while (readp <= next_unitp - offset_size)
+ {
+ Dwarf_Word offset;
+ if (offset_size == 4)
+ offset = read_4ubyte_unaligned_inc (dbg, readp);
+ else
+ offset = read_8ubyte_unaligned_inc (dbg, readp);
+ const char *str = dwarf_getstring (dbg, offset, NULL);
+ printf (" [%*u] [%*" PRIx64 "] \"%s\"\n",
+ digits, index++, (int) offset_size * 2, offset, str ?: "???");
+ }
+ printf ("\n");
+
+ if (readp != next_unitp)
+ error (0, 0, "extra %zd bytes at end of unit",
+ (size_t) (next_unitp - readp));
+
+ next_unit:
+ readp = next_unitp;
+ }
+}
+
/* Print the content of the call frame search table section
'.eh_frame_hdr'. */
@@ -8204,12 +10727,11 @@
uint32_t idx = read_4ubyte_unaligned (dbg, readp);
readp += 4;
- char *l = format_dwarf_addr (dwflmod, 8, low, low);
- char *h = format_dwarf_addr (dwflmod, 8, high - 1, high);
- printf (" [%4zu] %s..%s, CU index: %5" PRId32 "\n",
- n, l, h, idx);
- free (l);
- free (h);
+ printf (" [%4zu] ", n);
+ print_dwarf_addr (dwflmod, 8, low, low);
+ printf ("..");
+ print_dwarf_addr (dwflmod, 8, high - 1, high);
+ printf (", CU index: %5" PRId32 "\n", idx);
n++;
}
@@ -8294,9 +10816,60 @@
}
}
+/* Returns true and sets split DWARF CU id if there is a split compile
+ unit in the given Dwarf, and no non-split units are found (before it). */
+static bool
+is_split_dwarf (Dwarf *dbg, uint64_t *id, Dwarf_CU **split_cu)
+{
+ Dwarf_CU *cu = NULL;
+ while (dwarf_get_units (dbg, cu, &cu, NULL, NULL, NULL, NULL) == 0)
+ {
+ uint8_t unit_type;
+ if (dwarf_cu_info (cu, NULL, &unit_type, NULL, NULL,
+ id, NULL, NULL) != 0)
+ return false;
+
+ if (unit_type != DW_UT_split_compile && unit_type != DW_UT_split_type)
+ return false;
+
+ /* We really only care about the split compile unit, the types
+ should be fine and self sufficient. Also they don't have an
+ id that we can match with a skeleton unit. */
+ if (unit_type == DW_UT_split_compile)
+ {
+ *split_cu = cu;
+ return true;
+ }
+ }
+
+ return false;
+}
+
+/* Check that there is one and only one Dwfl_Module, return in arg. */
+static int
+getone_dwflmod (Dwfl_Module *dwflmod,
+ void **userdata __attribute__ ((unused)),
+ const char *name __attribute__ ((unused)),
+ Dwarf_Addr base __attribute__ ((unused)),
+ void *arg)
+{
+ Dwfl_Module **m = (Dwfl_Module **) arg;
+ if (*m != NULL)
+ return DWARF_CB_ABORT;
+ *m = dwflmod;
+ return DWARF_CB_OK;
+}
+
static void
print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr)
{
+ /* Used for skeleton file, if necessary for split DWARF. */
+ Dwfl *skel_dwfl = NULL;
+ Dwfl_Module *skel_mod = NULL;
+ char *skel_name = NULL;
+ Dwarf *split_dbg = NULL;
+ Dwarf_CU *split_cu = NULL;
+
/* Before we start the real work get a debug context descriptor. */
Dwarf_Addr dwbias;
Dwarf *dbg = dwfl_module_getdwarf (dwflmod, &dwbias);
@@ -8312,6 +10885,141 @@
dwfl_errmsg (-1));
dbg = &dummy_dbg;
}
+ else
+ {
+ /* If we are asked about a split dwarf (.dwo) file, use the user
+ provided, or find the corresponding skeleton file. If we got
+ a skeleton file, replace the given dwflmod and dbg, with one
+ derived from the skeleton file to provide enough context. */
+ uint64_t split_id;
+ if (is_split_dwarf (dbg, &split_id, &split_cu))
+ {
+ if (dwarf_skeleton != NULL)
+ skel_name = strdup (dwarf_skeleton);
+ else
+ {
+ /* Replace file.dwo with file.o and see if that matches. */
+ const char *fname;
+ dwfl_module_info (dwflmod, NULL, NULL, NULL, NULL, NULL,
+ &fname, NULL);
+ if (fname != NULL)
+ {
+ size_t flen = strlen (fname);
+ if (flen > 4 && strcmp (".dwo", fname + flen - 4) == 0)
+ {
+ skel_name = strdup (fname);
+ if (skel_name != NULL)
+ {
+ skel_name[flen - 3] = 'o';
+ skel_name[flen - 2] = '\0';
+ }
+ }
+ }
+ }
+
+ if (skel_name != NULL)
+ {
+ int skel_fd = open (skel_name, O_RDONLY);
+ if (skel_fd == -1)
+ fprintf (stderr, "Warning: Couldn't open DWARF skeleton file"
+ " '%s'\n", skel_name);
+ else
+ skel_dwfl = create_dwfl (skel_fd, skel_name);
+
+ if (skel_dwfl != NULL)
+ {
+ if (dwfl_getmodules (skel_dwfl, &getone_dwflmod,
+ &skel_mod, 0) != 0)
+ {
+ fprintf (stderr, "Warning: Bad DWARF skeleton,"
+ " multiple modules '%s'\n", skel_name);
+ dwfl_end (skel_dwfl);
+ skel_mod = NULL;
+ }
+ }
+ else if (skel_fd != -1)
+ fprintf (stderr, "Warning: Couldn't create skeleton dwfl for"
+ " '%s': %s\n", skel_name, dwfl_errmsg (-1));
+
+ if (skel_mod != NULL)
+ {
+ Dwarf *skel_dbg = dwfl_module_getdwarf (skel_mod, &dwbias);
+ if (skel_dbg != NULL)
+ {
+ /* First check the skeleton CU DIE, only fetch
+ the split DIE if we know the id matches to
+ not unnecessary search for any split DIEs we
+ don't need. */
+ Dwarf_CU *cu = NULL;
+ while (dwarf_get_units (skel_dbg, cu, &cu,
+ NULL, NULL, NULL, NULL) == 0)
+ {
+ uint8_t unit_type;
+ uint64_t skel_id;
+ if (dwarf_cu_info (cu, NULL, &unit_type, NULL, NULL,
+ &skel_id, NULL, NULL) == 0
+ && unit_type == DW_UT_skeleton
+ && split_id == skel_id)
+ {
+ Dwarf_Die subdie;
+ if (dwarf_cu_info (cu, NULL, NULL, NULL,
+ &subdie,
+ NULL, NULL, NULL) == 0
+ && dwarf_tag (&subdie) != DW_TAG_invalid)
+ {
+ split_dbg = dwarf_cu_getdwarf (subdie.cu);
+ if (split_dbg == NULL)
+ fprintf (stderr,
+ "Warning: Couldn't get split_dbg:"
+ " %s\n", dwarf_errmsg (-1));
+ break;
+ }
+ else
+ {
+ /* Everything matches up, but not
+ according to libdw. Which means
+ the user knew better. So...
+ Terrible hack... We can never
+ destroy the underlying dwfl
+ because it would free the wrong
+ Dwarfs... So we leak memory...*/
+ if (cu->split == NULL
+ && dwarf_skeleton != NULL)
+ {
+ do_not_close_dwfl = true;
+ __libdw_link_skel_split (cu, split_cu);
+ split_dbg = dwarf_cu_getdwarf (split_cu);
+ break;
+ }
+ else
+ fprintf (stderr, "Warning: Couldn't get"
+ " skeleton subdie: %s\n",
+ dwarf_errmsg (-1));
+ }
+ }
+ }
+ if (split_dbg == NULL)
+ fprintf (stderr, "Warning: '%s' didn't contain a skeleton for split id %" PRIx64 "\n", skel_name, split_id);
+ }
+ else
+ fprintf (stderr, "Warning: Couldn't get skeleton DWARF:"
+ " %s\n", dwfl_errmsg (-1));
+ }
+ }
+
+ if (split_dbg != NULL)
+ {
+ dbg = split_dbg;
+ dwflmod = skel_mod;
+ }
+ else if (skel_name == NULL)
+ fprintf (stderr,
+ "Warning: split DWARF file, but no skeleton found.\n");
+ }
+ else if (dwarf_skeleton != NULL)
+ fprintf (stderr, "Warning: DWARF skeleton given,"
+ " but not a split DWARF file\n");
+ }
/* Get the section header string table index. */
size_t shstrndx;
@@ -8319,6 +11027,42 @@
error (EXIT_FAILURE, 0,
gettext ("cannot get section header string table index"));
+ /* If the .debug_info section is listed as implicitly required then
+ we must make sure to handle it before handling any other debug
+ section. Various other sections depend on the CU DIEs being
+ scanned (silently) first. */
+ bool implicit_info = (implicit_debug_sections & section_info) != 0;
+ bool explicit_info = (print_debug_sections & section_info) != 0;
+ if (implicit_info)
+ {
+ Elf_Scn *scn = NULL;
+ while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
+ {
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+
+ if (shdr != NULL && shdr->sh_type == SHT_PROGBITS)
+ {
+ const char *name = elf_strptr (ebl->elf, shstrndx,
+ shdr->sh_name);
+ if (name == NULL)
+ continue;
+
+ if (strcmp (name, ".debug_info") == 0
+ || strcmp (name, ".debug_info.dwo") == 0
+ || strcmp (name, ".zdebug_info") == 0
+ || strcmp (name, ".zdebug_info.dwo") == 0)
+ {
+ print_debug_info_section (dwflmod, ebl, ehdr,
+ scn, shdr, dbg);
+ break;
+ }
+ }
+ }
+ print_debug_sections &= ~section_info;
+ implicit_debug_sections &= ~section_info;
+ }
+
/* Look through all the sections for the debugging sections to print. */
Elf_Scn *scn = NULL;
while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
@@ -8339,17 +11083,30 @@
#define NEW_SECTION(name) \
{ ".debug_" #name, section_##name, print_debug_##name##_section }
NEW_SECTION (abbrev),
+ NEW_SECTION (addr),
NEW_SECTION (aranges),
NEW_SECTION (frame),
NEW_SECTION (info),
NEW_SECTION (types),
NEW_SECTION (line),
NEW_SECTION (loc),
+ /* loclists is loc for DWARF5. */
+ { ".debug_loclists", section_loc,
+ print_debug_loclists_section },
NEW_SECTION (pubnames),
NEW_SECTION (str),
+ /* A DWARF5 specialised debug string section. */
+ { ".debug_line_str", section_str,
+ print_debug_str_section },
+ /* DWARF5 string offsets table. */
+ { ".debug_str_offsets", section_str,
+ print_debug_str_offsets_section },
NEW_SECTION (macinfo),
NEW_SECTION (macro),
NEW_SECTION (ranges),
+ /* rnglists is ranges for DWARF5. */
+ { ".debug_rnglists", section_ranges,
+ print_debug_rnglists_section },
{ ".eh_frame", section_frame | section_exception,
print_debug_frame_section },
{ ".eh_frame_hdr", section_frame | section_exception,
@@ -8367,22 +11124,45 @@
int n;
for (n = 0; n < ndebug_sections; ++n)
- if (strcmp (name, debug_sections[n].name) == 0
- || (name[0] == '.' && name[1] == 'z'
- && debug_sections[n].name[1] == 'd'
- && strcmp (&name[2], &debug_sections[n].name[1]) == 0)
- )
- {
- if ((print_debug_sections | implicit_debug_sections)
- & debug_sections[n].bitmask)
- debug_sections[n].fp (dwflmod, ebl, ehdr, scn, shdr, dbg);
- break;
- }
+ {
+ size_t dbglen = strlen (debug_sections[n].name);
+ size_t scnlen = strlen (name);
+ if ((strncmp (name, debug_sections[n].name, dbglen) == 0
+ && (dbglen == scnlen
+ || (scnlen == dbglen + 4
+ && strstr (name, ".dwo") == name + dbglen)))
+ || (name[0] == '.' && name[1] == 'z'
+ && debug_sections[n].name[1] == 'd'
+ && strncmp (&name[2], &debug_sections[n].name[1],
+ dbglen - 1) == 0
+ && (scnlen == dbglen + 1
+ || (scnlen == dbglen + 5
+ && strstr (name, ".dwo") == name + dbglen + 1))))
+ {
+ if ((print_debug_sections | implicit_debug_sections)
+ & debug_sections[n].bitmask)
+ debug_sections[n].fp (dwflmod, ebl, ehdr, scn, shdr, dbg);
+ break;
+ }
+ }
}
}
- reset_listptr (&known_loclistptr);
+ dwfl_end (skel_dwfl);
+ free (skel_name);
+
+ /* Turn implicit and/or explicit back on in case we go over another file. */
+ if (implicit_info)
+ implicit_debug_sections |= section_info;
+ if (explicit_info)
+ print_debug_sections |= section_info;
+
+ reset_listptr (&known_locsptr);
+ reset_listptr (&known_loclistsptr);
reset_listptr (&known_rangelistptr);
+ reset_listptr (&known_rnglistptr);
+ reset_listptr (&known_addrbases);
+ reset_listptr (&known_stroffbases);
}
@@ -9116,7 +11896,7 @@
printf (" %s\n", name);
break;
}
- /* Fall through */
+ FALLTHROUGH;
case 'x': /* hex */
case 'p': /* address */
case 's': /* address of string */
@@ -9225,10 +12005,10 @@
if (si_code > 0)
switch (si_signo)
{
- case SIGILL:
- case SIGFPE:
- case SIGSEGV:
- case SIGBUS:
+ case CORE_SIGILL:
+ case CORE_SIGFPE:
+ case CORE_SIGSEGV:
+ case CORE_SIGBUS:
{
uint64_t addr;
if (! buf_read_ulong (core, &ptr, end, &addr))
@@ -9239,7 +12019,7 @@
default:
;
}
- else if (si_code == SI_USER)
+ else if (si_code == CORE_SI_USER)
{
int pid, uid;
if (! buf_read_int (core, &ptr, end, &pid)
@@ -9347,7 +12127,7 @@
&& (offset = gelf_getnote (data, offset,
&nhdr, &name_offset, &desc_offset)) > 0)
{
- const char *name = data->d_buf + name_offset;
+ const char *name = nhdr.n_namesz == 0 ? "" : data->d_buf + name_offset;
const char *desc = data->d_buf + desc_offset;
char buf[100];
@@ -9401,9 +12181,9 @@
return;
bad_note:
- error (EXIT_FAILURE, 0,
- gettext ("cannot get content of note section: %s"),
- elf_errmsg (-1));
+ error (0, 0,
+ gettext ("cannot get content of note: %s"),
+ data != NULL ? "garbage data" : elf_errmsg (-1));
}
static void
@@ -9508,9 +12288,19 @@
so we can show both the original shdr size and the uncompressed
data size. */
if ((shdr->sh_flags & SHF_COMPRESSED) != 0)
- elf_compress (scn, 0, 0);
+ {
+ if (elf_compress (scn, 0, 0) < 0)
+ printf ("WARNING: %s [%zd]\n",
+ gettext ("Couldn't uncompress section"),
+ elf_ndxscn (scn));
+ }
else if (strncmp (name, ".zdebug", strlen (".zdebug")) == 0)
- elf_compress_gnu (scn, 0, 0);
+ {
+ if (elf_compress_gnu (scn, 0, 0) < 0)
+ printf ("WARNING: %s [%zd]\n",
+ gettext ("Couldn't uncompress section"),
+ elf_ndxscn (scn));
+ }
}
Elf_Data *data = elf_rawdata (scn, NULL);
@@ -9549,9 +12339,19 @@
so we can show both the original shdr size and the uncompressed
data size. */
if ((shdr->sh_flags & SHF_COMPRESSED) != 0)
- elf_compress (scn, 0, 0);
+ {
+ if (elf_compress (scn, 0, 0) < 0)
+ printf ("WARNING: %s [%zd]\n",
+ gettext ("Couldn't uncompress section"),
+ elf_ndxscn (scn));
+ }
else if (strncmp (name, ".zdebug", strlen (".zdebug")) == 0)
- elf_compress_gnu (scn, 0, 0);
+ {
+ if (elf_compress_gnu (scn, 0, 0) < 0)
+ printf ("WARNING: %s [%zd]\n",
+ gettext ("Couldn't uncompress section"),
+ elf_ndxscn (scn));
+ }
}
Elf_Data *data = elf_rawdata (scn, NULL);
diff --git a/src/sectionhash.c b/src/sectionhash.c
deleted file mode 100644
index 83a7cca..0000000
--- a/src/sectionhash.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Section hash table implementation.
- Copyright (C) 2001, 2002, 2005 Red Hat, Inc.
- This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
-
- 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/>. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <string.h>
-
-#include <elf-knowledge.h>
-#include <ld.h>
-
-
-/* Comparison function for sections. */
-static int
-scnhead_compare (struct scnhead *one, struct scnhead *two)
-{
- int result = strcmp (one->name, two->name);
-
- if (result == 0)
- {
- result = one->type - two->type;
-
- if (result == 0)
- {
- GElf_Sxword diff = (SH_FLAGS_IMPORTANT (one->flags)
- - SH_FLAGS_IMPORTANT (two->flags));
- result = diff < 0 ? -1 : diff == 0 ? 0 : 1;
-
- if (result == 0)
- {
- result = one->entsize - two->entsize;
-
- if (result == 0)
- {
- result = (one->grp_signature == NULL
- ? (two->grp_signature == NULL ? 0 : -1)
- : (two->grp_signature == NULL
- ? 1 : strcmp (one->grp_signature,
- two->grp_signature)));
-
- if (result == 0)
- result = one->kind - two->kind;
- }
- }
- }
- }
-
- return result;
-}
-
-/* Definitions for the section hash table. */
-#define TYPE struct scnhead *
-#define NAME ld_section_tab
-#define ITERATE 1
-#define COMPARE(a, b) scnhead_compare (a, b)
-
-#include "../lib/dynamicsizehash.c"
diff --git a/src/sectionhash.h b/src/sectionhash.h
deleted file mode 100644
index 96da336..0000000
--- a/src/sectionhash.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 2001, 2002 Red Hat, Inc.
- This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
-
- 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/>. */
-
-#ifndef SECTIONHASH_H
-#define SECTIONHASH_H 1
-
-/* Definitions for the section hash table. */
-#define TYPE struct scnhead *
-#define NAME ld_section_tab
-#define ITERATE 1
-#include <dynamicsizehash.h>
-
-#endif /* sectionhash.h */
diff --git a/src/size.c b/src/size.c
index 7c03cce..ad8dbcb 100644
--- a/src/size.c
+++ b/src/size.c
@@ -34,13 +34,11 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <sys/param.h>
#include <system.h>
-
+#include <printversion.h>
/* Name and version of program. */
-static void print_version (FILE *stream, struct argp_state *state);
ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
@@ -199,20 +197,6 @@
}
-/* Print the version information. */
-static void
-print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
-{
- fprintf (stream, "size (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
- fprintf (stream, gettext ("\
-Copyright (C) %s Red Hat, Inc.\n\
-This is free software; see the source for copying conditions. There is NO\n\
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2012");
- fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
-}
-
-
/* Handle program arguments. */
static error_t
parse_opt (int key, char *arg,
diff --git a/src/stack.c b/src/stack.c
index c277dfd..52ae3a8 100644
--- a/src/stack.c
+++ b/src/stack.c
@@ -30,9 +30,9 @@
#include <dwarf.h>
#include <system.h>
+#include <printversion.h>
/* Name and version of program. */
-static void print_version (FILE *stream, struct argp_state *state);
ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
@@ -362,7 +362,7 @@
if (frames->frames > 0)
frames_shown = true;
- printf ("TID %d:\n", tid);
+ printf ("TID %lld:\n", (long long) tid);
int frame_nr = 0;
for (int nr = 0; nr < frames->frames && (maxframes == 0
|| frame_nr < maxframes); nr++)
@@ -419,8 +419,8 @@
}
if (frames->frames > 0 && frame_nr == maxframes)
- error (0, 0, "tid %d: shown max number of frames "
- "(%d, use -n 0 for unlimited)", tid, maxframes);
+ error (0, 0, "tid %lld: shown max number of frames "
+ "(%d, use -n 0 for unlimited)", (long long) tid, maxframes);
else if (dwflerr != 0)
{
if (frames->frames > 0)
@@ -440,11 +440,12 @@
else
modname = "<unknown>";
}
- error (0, 0, "%s tid %d at 0x%" PRIx64 " in %s: %s", what, tid,
- pc_adjusted, modname, dwfl_errmsg (dwflerr));
+ error (0, 0, "%s tid %lld at 0x%" PRIx64 " in %s: %s", what,
+ (long long) tid, pc_adjusted, modname, dwfl_errmsg (dwflerr));
}
else
- error (0, 0, "%s tid %d: %s", what, tid, dwfl_errmsg (dwflerr));
+ error (0, 0, "%s tid %lld: %s", what, (long long) tid,
+ dwfl_errmsg (dwflerr));
}
}
@@ -470,12 +471,6 @@
return DWARF_CB_OK;
}
-static void
-print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
-{
- fprintf (stream, "stack (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
-}
-
static error_t
parse_opt (int key, char *arg __attribute__ ((unused)),
struct argp_state *state)
@@ -581,10 +576,11 @@
int err = dwfl_linux_proc_report (dwfl, pid);
if (err < 0)
- error (EXIT_BAD, 0, "dwfl_linux_proc_report pid %d: %s", pid,
- dwfl_errmsg (-1));
+ error (EXIT_BAD, 0, "dwfl_linux_proc_report pid %lld: %s",
+ (long long) pid, dwfl_errmsg (-1));
else if (err > 0)
- error (EXIT_BAD, err, "dwfl_linux_proc_report pid %d", pid);
+ error (EXIT_BAD, err, "dwfl_linux_proc_report pid %lld",
+ (long long) pid);
}
if (core != NULL)
@@ -603,10 +599,11 @@
{
int err = dwfl_linux_proc_attach (dwfl, pid, false);
if (err < 0)
- error (EXIT_BAD, 0, "dwfl_linux_proc_attach pid %d: %s", pid,
- dwfl_errmsg (-1));
+ error (EXIT_BAD, 0, "dwfl_linux_proc_attach pid %lld: %s",
+ (long long) pid, dwfl_errmsg (-1));
else if (err > 0)
- error (EXIT_BAD, err, "dwfl_linux_proc_attach pid %d", pid);
+ error (EXIT_BAD, err, "dwfl_linux_proc_attach pid %lld",
+ (long long) pid);
}
if (core != NULL)
@@ -681,7 +678,8 @@
{
.options = options,
.parser = parse_opt,
- .doc = N_("Print a stack for each thread in a process or core file.\v\
+ .doc = N_("Print a stack for each thread in a process or core file.\n\
+\n\
Program exits with return code 0 if all frames were shown without \
any errors. If some frames were shown, but there were some non-fatal \
errors, possibly causing an incomplete backtrace, the program exits \
@@ -694,7 +692,7 @@
if (show_modules)
{
- printf ("PID %d - %s module memory map\n", dwfl_pid (dwfl),
+ printf ("PID %lld - %s module memory map\n", (long long) dwfl_pid (dwfl),
pid != 0 ? "process" : "core");
if (dwfl_getmodules (dwfl, module_callback, NULL, 0) != 0)
error (EXIT_BAD, 0, "dwfl_getmodules: %s", dwfl_errmsg (-1));
@@ -727,7 +725,8 @@
}
else
{
- printf ("PID %d - %s\n", dwfl_pid (dwfl), pid != 0 ? "process" : "core");
+ printf ("PID %lld - %s\n", (long long) dwfl_pid (dwfl),
+ pid != 0 ? "process" : "core");
switch (dwfl_getthreads (dwfl, thread_callback, &frames))
{
case DWARF_CB_OK:
diff --git a/src/strings.c b/src/strings.c
index c1d63cd..03d0f13 100644
--- a/src/strings.c
+++ b/src/strings.c
@@ -38,10 +38,11 @@
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>
-#include <sys/param.h>
#include <sys/stat.h>
+#include <libeu.h>
#include <system.h>
+#include <printversion.h>
#ifndef MAP_POPULATE
# define MAP_POPULATE 0
@@ -54,7 +55,6 @@
/* Name and version of program. */
-static void print_version (FILE *stream, struct argp_state *state);
ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
@@ -222,20 +222,6 @@
}
-/* Print the version information. */
-static void
-print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
-{
- fprintf (stream, "strings (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
- fprintf (stream, gettext ("\
-Copyright (C) %s Red Hat, Inc.\n\
-This is free software; see the source for copying conditions. There is NO\n\
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2012");
- fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
-}
-
-
/* Handle program arguments. */
static error_t
parse_opt (int key, char *arg,
@@ -260,7 +246,7 @@
case 'b':
case 'B':
big_endian = true;
- /* FALLTHROUGH */
+ FALLTHROUGH;
case 'l':
case 'L':
diff --git a/src/strip.c b/src/strip.c
index 06d7cfd..773ed54 100644
--- a/src/strip.c
+++ b/src/strip.c
@@ -1,5 +1,5 @@
/* Discard section not used at runtime from object files.
- Copyright (C) 2000-2012, 2014, 2015 Red Hat, Inc.
+ Copyright (C) 2000-2012, 2014, 2015, 2016, 2017 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2000.
@@ -26,6 +26,7 @@
#include <endian.h>
#include <error.h>
#include <fcntl.h>
+#include <fnmatch.h>
#include <gelf.h>
#include <libelf.h>
#include <libintl.h>
@@ -36,18 +37,19 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <sys/param.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <elf-knowledge.h>
#include <libebl.h>
+#include "libdwelf.h"
+#include <libeu.h>
#include <system.h>
+#include <printversion.h>
typedef uint8_t GElf_Byte;
/* Name and version of program. */
-static void print_version (FILE *stream, struct argp_state *state);
ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
@@ -59,6 +61,7 @@
#define OPT_PERMISSIVE 0x101
#define OPT_STRIP_SECTIONS 0x102
#define OPT_RELOC_DEBUG 0x103
+#define OPT_KEEP_SECTION 0x104
/* Definitions of arguments for argp functions. */
@@ -82,7 +85,8 @@
N_("Resolve all trivial relocations between debug sections if the removed sections are placed in a debug file (only relevant for ET_REL files, operation is not reversable, needs -f)"), 0 },
{ "remove-comment", OPT_REMOVE_COMMENT, NULL, 0,
N_("Remove .comment section"), 0 },
- { "remove-section", 'R', "SECTION", OPTION_HIDDEN, NULL, 0 },
+ { "remove-section", 'R', "SECTION", 0, N_("Remove the named section. SECTION is an extended wildcard pattern. May be given more than once. Only non-allocated sections can be removed."), 0 },
+ { "keep-section", OPT_KEEP_SECTION, "SECTION", 0, N_("Keep the named section. SECTION is an extended wildcard pattern. May be given more than once."), 0 },
{ "permissive", OPT_PERMISSIVE, NULL, 0,
N_("Relax a few rules to handle slightly broken ELF files"), 0 },
{ NULL, 0, NULL, 0, NULL, 0 }
@@ -156,6 +160,58 @@
/* If true perform relocations between debug sections. */
static bool reloc_debug;
+/* Sections the user explicitly wants to keep or remove. */
+struct section_pattern
+{
+ char *pattern;
+ struct section_pattern *next;
+};
+
+static struct section_pattern *keep_secs = NULL;
+static struct section_pattern *remove_secs = NULL;
+
+static void
+add_pattern (struct section_pattern **patterns, const char *pattern)
+{
+ struct section_pattern *p = xmalloc (sizeof *p);
+ p->pattern = xstrdup (pattern);
+ p->next = *patterns;
+ *patterns = p;
+}
+
+static void
+free_sec_patterns (struct section_pattern *patterns)
+{
+ struct section_pattern *pattern = patterns;
+ while (pattern != NULL)
+ {
+ struct section_pattern *p = pattern;
+ pattern = p->next;
+ free (p->pattern);
+ free (p);
+ }
+}
+
+static void
+free_patterns (void)
+{
+ free_sec_patterns (keep_secs);
+ free_sec_patterns (remove_secs);
+}
+
+static bool
+section_name_matches (struct section_pattern *patterns, const char *name)
+{
+ struct section_pattern *pattern = patterns;
+ while (pattern != NULL)
+ {
+ if (fnmatch (pattern->pattern, name, FNM_EXTMATCH) == 0)
+ return true;
+ pattern = pattern->next;
+ }
+ return false;
+}
+
int
main (int argc, char *argv[])
@@ -206,24 +262,11 @@
while (++remaining < argc);
}
+ free_patterns ();
return result;
}
-/* Print the version information. */
-static void
-print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
-{
- fprintf (stream, "strip (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
- fprintf (stream, gettext ("\
-Copyright (C) %s Red Hat, Inc.\n\
-This is free software; see the source for copying conditions. There is NO\n\
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2012");
- fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
-}
-
-
/* Handle program arguments. */
static error_t
parse_opt (int key, char *arg, struct argp_state *state)
@@ -270,14 +313,13 @@
break;
case 'R':
- if (!strcmp (arg, ".comment"))
+ if (fnmatch (arg, ".comment", FNM_EXTMATCH) == 0)
remove_comment = true;
- else
- {
- argp_error (state,
- gettext ("-R option supports only .comment section"));
- return EINVAL;
- }
+ add_pattern (&remove_secs, arg);
+ break;
+
+ case OPT_KEEP_SECTION:
+ add_pattern (&keep_secs, arg);
break;
case 'g':
@@ -297,6 +339,16 @@
case 's': /* Ignored for compatibility. */
break;
+ case ARGP_KEY_SUCCESS:
+ if (remove_comment == true
+ && section_name_matches (keep_secs, ".comment"))
+ {
+ argp_error (state,
+ gettext ("cannot both keep and remove .comment section"));
+ return EINVAL;
+ }
+ break;
+
default:
return ARGP_ERR_UNKNOWN;
}
@@ -432,7 +484,7 @@
Elf32_Word group_idx;
Elf32_Word group_cnt;
Elf_Scn *newscn;
- struct Ebl_Strent *se;
+ Dwelf_Strent *se;
Elf32_Word *newsymidx;
} *shdr_info = NULL;
Elf_Scn *scn;
@@ -443,7 +495,7 @@
GElf_Ehdr *newehdr;
GElf_Ehdr debugehdr_mem;
GElf_Ehdr *debugehdr;
- struct Ebl_Strtab *shst = NULL;
+ Dwelf_Strtab *shst = NULL;
Elf_Data debuglink_crc_data;
bool any_symtab_changes = false;
Elf_Data *shstrtab_data = NULL;
@@ -635,6 +687,28 @@
goto fail_close;
}
+ /* Sanity check the user. */
+ if (section_name_matches (remove_secs, shdr_info[cnt].name))
+ {
+ if ((shdr_info[cnt].shdr.sh_flags & SHF_ALLOC) != 0)
+ {
+ error (0, 0,
+ gettext ("Cannot remove allocated section '%s'"),
+ shdr_info[cnt].name);
+ result = 1;
+ goto fail_close;
+ }
+
+ if (section_name_matches (keep_secs, shdr_info[cnt].name))
+ {
+ error (0, 0,
+ gettext ("Cannot both keep and remove section '%s'"),
+ shdr_info[cnt].name);
+ result = 1;
+ goto fail_close;
+ }
+ }
+
/* Mark them as present but not yet investigated. */
shdr_info[cnt].idx = 1;
@@ -722,14 +796,22 @@
know how to handle them
- if a section is referred to from a section which is not removed
in the sh_link or sh_info element it cannot be removed either
+ - the user might have explicitly said to remove or keep a section
*/
for (cnt = 1; cnt < shnum; ++cnt)
- /* Check whether the section can be removed. */
+ /* Check whether the section can be removed. Since we will create
+ a new .shstrtab assume it will be removed too. */
if (remove_shdrs ? !(shdr_info[cnt].shdr.sh_flags & SHF_ALLOC)
- : ebl_section_strip_p (ebl, ehdr, &shdr_info[cnt].shdr,
- shdr_info[cnt].name, remove_comment,
- remove_debug))
+ : (ebl_section_strip_p (ebl, ehdr, &shdr_info[cnt].shdr,
+ shdr_info[cnt].name, remove_comment,
+ remove_debug)
+ || cnt == ehdr->e_shstrndx
+ || section_name_matches (remove_secs, shdr_info[cnt].name)))
{
+ /* The user might want to explicitly keep this one. */
+ if (section_name_matches (keep_secs, shdr_info[cnt].name))
+ continue;
+
/* For now assume this section will be removed. */
shdr_info[cnt].idx = 0;
@@ -878,8 +960,19 @@
if (shdr_info[scnidx].idx == 0)
/* This symbol table has a real symbol in
a discarded section. So preserve the
- original table in the debug file. */
- shdr_info[cnt].debug_data = symdata;
+ original table in the debug file. Unless
+ it is a redundant data marker to a debug
+ (data only) section. */
+ if (! (ebl_section_strip_p (ebl, ehdr,
+ &shdr_info[scnidx].shdr,
+ shdr_info[scnidx].name,
+ remove_comment,
+ remove_debug)
+ && ebl_data_marker_symbol (ebl, sym,
+ elf_strptr (elf,
+ shdr_info[cnt].shdr.sh_link,
+ sym->st_name))))
+ shdr_info[cnt].debug_data = symdata;
}
}
@@ -1043,7 +1136,7 @@
will already be marked as unused. */
/* We need a string table for the section headers. */
- shst = ebl_strtabinit (true);
+ shst = dwelf_strtab_init (true);
if (shst == NULL)
{
cleanup_debug ();
@@ -1071,19 +1164,23 @@
elf_assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
/* Add this name to the section header string table. */
- shdr_info[cnt].se = ebl_strtabadd (shst, shdr_info[cnt].name, 0);
+ shdr_info[cnt].se = dwelf_strtab_add (shst, shdr_info[cnt].name);
}
- /* Test whether we are doing anything at all. */
- if (cnt == idx)
- /* Nope, all removable sections are already gone. */
- goto fail_close;
+ /* Test whether we are doing anything at all. Either all removable
+ sections are already gone. Or the only section we would remove is
+ the .shstrtab section which we would add again. */
+ bool removing_sections = !(cnt == idx
+ || (cnt == idx + 1
+ && shdr_info[ehdr->e_shstrndx].idx == 0));
+ if (output_fname == NULL && !removing_sections)
+ goto fail_close;
- /* Create the reference to the file with the debug info. */
- if (debug_fname != NULL && !remove_shdrs)
+ /* Create the reference to the file with the debug info (if any). */
+ if (debug_fname != NULL && !remove_shdrs && removing_sections)
{
/* Add the section header string table section name. */
- shdr_info[cnt].se = ebl_strtabadd (shst, ".gnu_debuglink", 15);
+ shdr_info[cnt].se = dwelf_strtab_add_len (shst, ".gnu_debuglink", 15);
shdr_info[cnt].idx = idx++;
/* Create the section header. */
@@ -1146,7 +1243,7 @@
shdridx = cnt;
/* Add the section header string table section name. */
- shdr_info[cnt].se = ebl_strtabadd (shst, ".shstrtab", 10);
+ shdr_info[cnt].se = dwelf_strtab_add_len (shst, ".shstrtab", 10);
shdr_info[cnt].idx = idx;
/* Create the section header. */
@@ -1183,7 +1280,12 @@
gettext ("while create section header string table: %s"),
elf_errmsg (-1));
}
- ebl_strtabfinalize (shst, shstrtab_data);
+ if (dwelf_strtab_finalize (shst, shstrtab_data) == NULL)
+ {
+ cleanup_debug ();
+ error (EXIT_FAILURE, 0,
+ gettext ("no memory to create section header string table"));
+ }
/* We have to set the section size. */
shdr_info[cnt].shdr.sh_size = shstrtab_data->d_size;
@@ -1199,10 +1301,13 @@
elf_assert (scn != NULL);
/* Update the name. */
- shdr_info[cnt].shdr.sh_name = ebl_strtaboffset (shdr_info[cnt].se);
+ shdr_info[cnt].shdr.sh_name = dwelf_strent_off (shdr_info[cnt].se);
/* Update the section header from the input file. Some fields
- might be section indeces which now have to be adjusted. */
+ might be section indeces which now have to be adjusted. Keep
+ the index to the "current" sh_link in case we need it to lookup
+ symbol table names. */
+ size_t sh_link = shdr_info[cnt].shdr.sh_link;
if (shdr_info[cnt].shdr.sh_link != 0)
shdr_info[cnt].shdr.sh_link =
shdr_info[shdr_info[cnt].shdr.sh_link].idx;
@@ -1267,8 +1372,10 @@
shndxdata = elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn,
NULL);
- elf_assert ((versiondata->d_size / sizeof (Elf32_Word))
- >= shdr_info[cnt].data->d_size / elsize);
+ elf_assert (shndxdata != NULL
+ && shndxdata->d_buf != NULL
+ && ((shndxdata->d_size / sizeof (Elf32_Word))
+ >= shdr_info[cnt].data->d_size / elsize));
}
if (shdr_info[cnt].version_idx != 0)
@@ -1333,15 +1440,12 @@
/* Get the full section index, if necessary from the
XINDEX table. */
- if (sym->st_shndx != SHN_XINDEX)
- sec = shdr_info[sym->st_shndx].idx;
- else
- {
- elf_assert (shndxdata != NULL
- && shndxdata->d_buf != NULL);
-
- sec = shdr_info[xshndx].idx;
- }
+ if (sym->st_shndx == SHN_XINDEX)
+ elf_assert (shndxdata != NULL
+ && shndxdata->d_buf != NULL);
+ size_t sidx = (sym->st_shndx != SHN_XINDEX
+ ? sym->st_shndx : xshndx);
+ sec = shdr_info[sidx].idx;
if (sec != 0)
{
@@ -1379,20 +1483,40 @@
shdr_info[cnt].shdr.sh_info = destidx - 1;
}
}
+ else if ((shdr_info[cnt].shdr.sh_flags & SHF_ALLOC) != 0
+ && GELF_ST_TYPE (sym->st_info) != STT_SECTION
+ && shdr_info[sidx].shdr.sh_type != SHT_GROUP)
+ {
+ /* Removing a real symbol from an allocated
+ symbol table is hard and probably a
+ mistake. Really removing it means
+ rewriting the dynamic segment and hash
+ sections. Just warn and set the symbol
+ section to UNDEF. */
+ error (0, 0,
+ gettext ("Cannot remove symbol [%zd] from allocated symbol table [%zd]"), inner, cnt);
+ sym->st_shndx = SHN_UNDEF;
+ if (gelf_update_sym (shdr_info[cnt].data, destidx,
+ sym) == 0)
+ INTERNAL_ERROR (fname);
+ shdr_info[cnt].newsymidx[inner] = destidx++;
+ }
else if (debug_fname != NULL
&& shdr_info[cnt].debug_data == NULL)
/* The symbol points to a section that is discarded
but isn't preserved in the debug file. Check that
this is a section or group signature symbol
- for a section which has been removed. */
+ for a section which has been removed. Or a special
+ data marker symbol to a debug section. */
{
- size_t sidx = (sym->st_shndx != SHN_XINDEX
- ? sym->st_shndx : xshndx);
elf_assert (GELF_ST_TYPE (sym->st_info) == STT_SECTION
|| ((shdr_info[sidx].shdr.sh_type
== SHT_GROUP)
&& (shdr_info[sidx].shdr.sh_info
- == inner)));
+ == inner))
+ || ebl_data_marker_symbol (ebl, sym,
+ elf_strptr (elf, sh_link,
+ sym->st_name)));
}
}
@@ -1748,7 +1872,8 @@
/* Remove any relocations between debug sections in ET_REL
for the debug file when requested. These relocations are always
zero based between the unallocated sections. */
- if (debug_fname != NULL && reloc_debug && ehdr->e_type == ET_REL)
+ if (debug_fname != NULL && removing_sections
+ && reloc_debug && ehdr->e_type == ET_REL)
{
scn = NULL;
cnt = 0;
@@ -1783,10 +1908,18 @@
Elf_Data *reldata = elf_getdata (scn, NULL);
if (reldata == NULL || reldata->d_buf == NULL)
INTERNAL_ERROR (fname);
- /* We actually wanted the rawdata, but since we already
- accessed it earlier as elf_getdata () that won't
- work. But debug sections are all ELF_T_BYTE, so it
- doesn't really matter. */
+
+ /* Make sure we adjust the uncompressed debug data
+ (and recompress if necessary at the end). */
+ GElf_Chdr tchdr;
+ int tcompress_type = 0;
+ if (gelf_getchdr (tscn, &tchdr) != NULL)
+ {
+ tcompress_type = tchdr.ch_type;
+ if (elf_compress (tscn, 0, 0) != 1)
+ INTERNAL_ERROR (fname);
+ }
+
Elf_Data *tdata = elf_getdata (tscn, NULL);
if (tdata == NULL || tdata->d_buf == NULL
|| tdata->d_type != ELF_T_BYTE)
@@ -1968,13 +2101,17 @@
nrels = next;
shdr->sh_size = reldata->d_size = nrels * shdr->sh_entsize;
gelf_update_shdr (scn, shdr);
+
+ if (tcompress_type != 0)
+ if (elf_compress (tscn, tcompress_type, ELF_CHF_FORCE) != 1)
+ INTERNAL_ERROR (fname);
}
}
}
/* Now that we have done all adjustments to the data,
we can actually write out the debug file. */
- if (debug_fname != NULL)
+ if (debug_fname != NULL && removing_sections)
{
/* Finally write the file. */
if (unlikely (elf_update (debugelf, ELF_C_WRITE) == -1))
@@ -2148,14 +2285,14 @@
if (shdr_info != NULL)
{
/* For some sections we might have created an table to map symbol
- table indices. */
- if (any_symtab_changes)
- for (cnt = 1; cnt <= shdridx; ++cnt)
- {
- free (shdr_info[cnt].newsymidx);
- if (shdr_info[cnt].debug_data != NULL)
- free (shdr_info[cnt].debug_data->d_buf);
- }
+ table indices. Or we might kept (original) data around to put
+ into the .debug file. */
+ for (cnt = 1; cnt <= shdridx; ++cnt)
+ {
+ free (shdr_info[cnt].newsymidx);
+ if (shdr_info[cnt].debug_data != NULL)
+ free (shdr_info[cnt].debug_data->d_buf);
+ }
/* Free data we allocated for the .gnu_debuglink section. */
free (debuglink_buf);
@@ -2169,7 +2306,7 @@
if (shstrtab_data != NULL)
free (shstrtab_data->d_buf);
if (shst != NULL)
- ebl_strtabfree (shst);
+ dwelf_strtab_free (shst);
/* That was it. Close the descriptors. */
if (elf_end (newelf) != 0)
@@ -2207,7 +2344,11 @@
/* Close the file descriptor if we created a new file. */
if (output_fname != NULL)
- close (fd);
+ {
+ close (fd);
+ if (result != 0)
+ unlink (output_fname);
+ }
return result;
}
diff --git a/src/symbolhash.c b/src/symbolhash.c
deleted file mode 100644
index 3fd9649..0000000
--- a/src/symbolhash.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Symbol hash table implementation.
- Copyright (C) 2001, 2002 Red Hat, Inc.
- This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
-
- 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/>. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <string.h>
-
-#include <ld.h>
-
-/* Definitions for the symbol hash table. */
-#define TYPE struct symbol *
-#define NAME ld_symbol_tab
-#define ITERATE 1
-#define COMPARE(a, b) strcmp ((a)->name, (b)->name)
-
-#include "../lib/dynamicsizehash.c"
diff --git a/src/symbolhash.h b/src/symbolhash.h
deleted file mode 100644
index 062dade..0000000
--- a/src/symbolhash.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright (C) 2001, 2002 Red Hat, Inc.
- This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
-
- 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/>. */
-
-#ifndef SYMBOLHASH_H
-#define SYMBOLHASH_H 1
-
-/* Definitions for the symbol hash table. */
-#define TYPE struct symbol *
-#define NAME ld_symbol_tab
-#define ITERATE 1
-#define COMPARE(a, b) strcmp ((a)->name, (b)->name)
-#include <dynamicsizehash.h>
-
-#endif /* symbolhash.h */
diff --git a/src/unaligned.h b/src/unaligned.h
deleted file mode 100644
index 2916653..0000000
--- a/src/unaligned.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Unaligned memory access functionality.
- Copyright (C) 2000, 2001, 2002, 2003, 2008 Red Hat, Inc.
- This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
-
- 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/>. */
-
-#ifndef _UNALIGNED_H
-#define _UNALIGNED_H 1
-
-#include <byteswap.h>
-#include <endian.h>
-
-
-#ifndef UNALIGNED_ACCESS_CLASS
-# error "UNALIGNED_ACCESS_CLASS must be defined"
-#endif
-
-
-/* Macros to convert from the host byte order to that of the object file. */
-#if UNALIGNED_ACCESS_CLASS == BYTE_ORDER
-# define target_bswap_16(n) (n)
-# define target_bswap_32(n) (n)
-# define target_bswap_64(n) (n)
-#else
-# define target_bswap_16(n) bswap_16 (n)
-# define target_bswap_32(n) bswap_32 (n)
-# define target_bswap_64(n) bswap_64 (n)
-#endif
-
-
-union u_2ubyte_unaligned
-{
- uint16_t u;
- char c[2];
-} __attribute__((packed));
-
-union u_4ubyte_unaligned
-{
- uint32_t u;
- char c[4];
-} __attribute__((packed));
-
-union u_8ubyte_unaligned
-{
- uint64_t u;
- char c[8];
-} __attribute__((packed));
-
-
-/* Macros to store value at unaligned address. */
-#define store_2ubyte_unaligned(ptr, value) \
- (void) (((union u_2ubyte_unaligned *) (ptr))->u = target_bswap_16 (value))
-#define store_4ubyte_unaligned(ptr, value) \
- (void) (((union u_4ubyte_unaligned *) (ptr))->u = target_bswap_32 (value))
-#define store_8ubyte_unaligned(ptr, value) \
- (void) (((union u_8ubyte_unaligned *) (ptr))->u = target_bswap_64 (value))
-
-
-/* Macros to add value to unaligned address. This is a bit more
- complicated since the value must be read from memory and eventually
- converted twice. */
-#if UNALIGNED_ACCESS_CLASS == BYTE_ORDER
-# define add_2ubyte_unaligned(ptr, value) \
- (void) (((union u_2ubyte_unaligned *) (ptr))->u += value)
-# define add_4ubyte_unaligned(ptr, value) \
- (void) (((union u_4ubyte_unaligned *) (ptr))->u += value)
-# define add_8ubyte_unaligned(ptr, value) \
- (void) (((union u_8ubyte_unaligned *) (ptr))->u += value)
-#else
-# define add_2ubyte_unaligned(ptr, value) \
- do { \
- union u_2ubyte_unaligned *_ptr = (void *) (ptr); \
- uint16_t _val = bswap_16 (_ptr->u) + (value); \
- _ptr->u = bswap_16 (_val); \
- } while (0)
-# define add_4ubyte_unaligned(ptr, value) \
- do { \
- union u_4ubyte_unaligned *_ptr = (void *) (ptr); \
- uint32_t _val = bswap_32 (_ptr->u) + (value); \
- _ptr->u = bswap_32 (_val); \
- } while (0)
-# define add_8ubyte_unaligned(ptr, value) \
- do { \
- union u_8ubyte_unaligned *_ptr = (void *) (ptr); \
- uint64_t _val = bswap_64 (_ptr->u) + (value); \
- _ptr->u = bswap_64 (_val); \
- } while (0)
-#endif
-
-#endif /* unaligned.h */
diff --git a/src/unstrip.c b/src/unstrip.c
index 85e0a1d..f368e69 100644
--- a/src/unstrip.c
+++ b/src/unstrip.c
@@ -48,14 +48,15 @@
#include <gelf.h>
#include <libebl.h>
#include <libdwfl.h>
-#include "system.h"
+#include "libdwelf.h"
+#include "libeu.h"
+#include "printversion.h"
#ifndef _
# define _(str) gettext (str)
#endif
/* Name and version of program. */
-static void print_version (FILE *stream, struct argp_state *state);
ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
@@ -223,19 +224,6 @@
}
return 0;
}
-
-/* Print the version information. */
-static void
-print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
-{
- fprintf (stream, "unstrip (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
- fprintf (stream, _("\
-Copyright (C) %s Red Hat, Inc.\n\
-This is free software; see the source for copying conditions. There is NO\n\
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2012");
- fprintf (stream, gettext ("Written by %s.\n"), "Roland McGrath");
-}
#define ELF_CHECK(call, msg) \
do \
@@ -686,7 +674,7 @@
Elf_Scn *scn;
const char *name;
Elf_Scn *outscn;
- struct Ebl_Strent *strent;
+ Dwelf_Strent *strent;
GElf_Shdr shdr;
};
@@ -757,7 +745,7 @@
union
{
const char *name;
- struct Ebl_Strent *strent;
+ Dwelf_Strent *strent;
};
union
{
@@ -1039,21 +1027,24 @@
shnum = ehdr.e64.e_shnum;
}
+ bool class32 = ehdr.e32.e_ident[EI_CLASS] == ELFCLASS32;
+ size_t shsize = class32 ? sizeof (Elf32_Shdr) : sizeof (Elf64_Shdr);
+ if (unlikely (shnum == 0 || shnum > SIZE_MAX / shsize + 1))
+ error (EXIT_FAILURE, 0, _("overflow with shnum = %zu in '%s' section"),
+ (size_t) shnum, ".gnu.prelink_undo");
+
+ --shnum;
+
size_t phsize = gelf_fsize (main, ELF_T_PHDR, phnum, EV_CURRENT);
src.d_buf += src.d_size + phsize;
- src.d_size = gelf_fsize (main, ELF_T_SHDR, shnum - 1, EV_CURRENT);
+ src.d_size = gelf_fsize (main, ELF_T_SHDR, shnum, EV_CURRENT);
src.d_type = ELF_T_SHDR;
if ((size_t) (src.d_buf - undodata->d_buf) > undodata->d_size
|| undodata->d_size - (src.d_buf - undodata->d_buf) != src.d_size)
error (EXIT_FAILURE, 0, _("invalid contents in '%s' section"),
".gnu.prelink_undo");
- bool class32 = ehdr.e32.e_ident[EI_CLASS] == ELFCLASS32;
- size_t shsize = class32 ? sizeof (Elf32_Shdr) : sizeof (Elf64_Shdr);
- if (unlikely ((shnum - 1) > SIZE_MAX / shsize))
- error (EXIT_FAILURE, 0, _("overflow with shnum = %zu in '%s' section"),
- (size_t) shnum, ".gnu.prelink_undo");
- const size_t shdr_bytes = (shnum - 1) * shsize;
+ const size_t shdr_bytes = shnum * shsize;
void *shdr = xmalloc (shdr_bytes);
dst.d_buf = shdr;
dst.d_size = shdr_bytes;
@@ -1061,12 +1052,12 @@
main_ehdr->e_ident[EI_DATA]) != NULL,
_("cannot read '.gnu.prelink_undo' section: %s"));
- undo_sections = xmalloc ((shnum - 1) * sizeof undo_sections[0]);
- for (size_t i = 0; i < shnum - 1; ++i)
+ undo_sections = xmalloc (shnum * sizeof undo_sections[0]);
+ for (size_t i = 0; i < shnum; ++i)
{
struct section *sec = &undo_sections[undo_nalloc];
- Elf32_Shdr (*s32)[shnum - 1] = shdr;
- Elf64_Shdr (*s64)[shnum - 1] = shdr;
+ Elf32_Shdr (*s32)[shnum] = shdr;
+ Elf64_Shdr (*s64)[shnum] = shdr;
if (class32)
{
#define COPY(field) sec->shdr.field = (*s32)[i].field
@@ -1214,12 +1205,12 @@
new_shstrtab (Elf *unstripped, size_t unstripped_shnum,
Elf_Data *shstrtab, size_t unstripped_shstrndx,
struct section *sections, size_t stripped_shnum,
- struct Ebl_Strtab *strtab)
+ Dwelf_Strtab *strtab)
{
if (strtab == NULL)
return NULL;
- struct Ebl_Strent *unstripped_strent[unstripped_shnum - 1];
+ Dwelf_Strent *unstripped_strent[unstripped_shnum - 1];
memset (unstripped_strent, 0, sizeof unstripped_strent);
for (struct section *sec = sections;
sec < §ions[stripped_shnum - 1];
@@ -1228,7 +1219,7 @@
{
if (sec->strent == NULL)
{
- sec->strent = ebl_strtabadd (strtab, sec->name, 0);
+ sec->strent = dwelf_strtab_add (strtab, sec->name);
ELF_CHECK (sec->strent != NULL,
_("cannot add section name to string table: %s"));
}
@@ -1243,7 +1234,7 @@
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
const char *name = get_section_name (i + 1, shdr, shstrtab);
- unstripped_strent[i] = ebl_strtabadd (strtab, name, 0);
+ unstripped_strent[i] = dwelf_strtab_add (strtab, name);
ELF_CHECK (unstripped_strent[i] != NULL,
_("cannot add section name to string table: %s"));
}
@@ -1255,7 +1246,8 @@
unstripped_shstrndx), NULL);
ELF_CHECK (elf_flagdata (strtab_data, ELF_C_SET, ELF_F_DIRTY),
_("cannot update section header string table data: %s"));
- ebl_strtabfinalize (strtab, strtab_data);
+ if (dwelf_strtab_finalize (strtab, strtab_data) == NULL)
+ error (EXIT_FAILURE, 0, "Not enough memory to create string table");
/* Update the sh_name fields of sections we aren't modifying later. */
for (size_t i = 0; i < unstripped_shnum - 1; ++i)
@@ -1264,7 +1256,7 @@
Elf_Scn *scn = elf_getscn (unstripped, i + 1);
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
- shdr->sh_name = ebl_strtaboffset (unstripped_strent[i]);
+ shdr->sh_name = dwelf_strent_off (unstripped_strent[i]);
if (i + 1 == unstripped_shstrndx)
shdr->sh_size = strtab_data->d_size;
update_shdr (scn, shdr);
@@ -1360,6 +1352,7 @@
/* Match each debuginfo section with its corresponding stripped section. */
bool check_prelink = false;
Elf_Scn *unstripped_symtab = NULL;
+ size_t unstripped_strndx = 0;
size_t alloc_avail = 0;
scn = NULL;
while ((scn = elf_nextscn (unstripped, scn)) != NULL)
@@ -1371,11 +1364,12 @@
if (shdr->sh_type == SHT_SYMTAB)
{
unstripped_symtab = scn;
+ unstripped_strndx = shdr->sh_link;
continue;
}
const size_t ndx = elf_ndxscn (scn);
- if (ndx == unstripped_shstrndx)
+ if (ndx == unstripped_shstrndx || ndx == unstripped_strndx)
continue;
const char *name = get_section_name (ndx, shdr, shstrtab);
@@ -1456,7 +1450,7 @@
const struct section *stripped_dynsym = NULL;
size_t debuglink = SHN_UNDEF;
size_t ndx_section[stripped_shnum - 1];
- struct Ebl_Strtab *strtab = NULL;
+ Dwelf_Strtab *strtab = NULL;
for (struct section *sec = sections;
sec < §ions[stripped_shnum - 1];
++sec)
@@ -1482,13 +1476,11 @@
}
if (unstripped_symtab != NULL && stripped_symtab != NULL
- && secndx == stripped_symtab->shdr.sh_link)
+ && secndx == stripped_symtab->shdr.sh_link
+ && unstripped_strndx != 0)
{
/* ... nor its string table. */
- GElf_Shdr shdr_mem;
- GElf_Shdr *shdr = gelf_getshdr (unstripped_symtab, &shdr_mem);
- ELF_CHECK (shdr != NULL, _("cannot get section header: %s"));
- ndx_section[secndx - 1] = shdr->sh_link;
+ ndx_section[secndx - 1] = unstripped_strndx;
continue;
}
@@ -1508,8 +1500,8 @@
_("cannot add new section: %s"));
if (strtab == NULL)
- strtab = ebl_strtabinit (true);
- sec->strent = ebl_strtabadd (strtab, sec->name, 0);
+ strtab = dwelf_strtab_init (true);
+ sec->strent = dwelf_strtab_add (strtab, sec->name);
ELF_CHECK (sec->strent != NULL,
_("cannot add section name to string table: %s"));
}
@@ -1570,7 +1562,7 @@
shdr_mem.sh_info = ndx_section[sec->shdr.sh_info - 1];
if (strtab != NULL)
- shdr_mem.sh_name = ebl_strtaboffset (sec->strent);
+ shdr_mem.sh_name = dwelf_strent_off (sec->strent);
Elf_Data *indata = elf_getdata (sec->scn, NULL);
ELF_CHECK (indata != NULL, _("cannot get section data: %s"));
@@ -1641,7 +1633,7 @@
/* We may need to update the symbol table. */
Elf_Data *symdata = NULL;
- struct Ebl_Strtab *symstrtab = NULL;
+ Dwelf_Strtab *symstrtab = NULL;
Elf_Data *symstrdata = NULL;
if (unstripped_symtab != NULL && (stripped_symtab != NULL
|| check_prelink /* Section adjustments. */
@@ -1721,13 +1713,13 @@
/* Now a final pass updates the map with the final order,
and builds up the new string table. */
- symstrtab = ebl_strtabinit (true);
+ symstrtab = dwelf_strtab_init (true);
for (size_t i = 0; i < nsym; ++i)
{
assert (symbols[i].name != NULL);
assert (*symbols[i].map != 0);
*symbols[i].map = 1 + i;
- symbols[i].strent = ebl_strtabadd (symstrtab, symbols[i].name, 0);
+ symbols[i].strent = dwelf_strtab_add (symstrtab, symbols[i].name);
}
/* Scan the discarded symbols too, just to update their slots
@@ -1752,7 +1744,7 @@
/* If symtab and the section header table share the string table
add the section names to the strtab and then (after finalizing)
fixup the section header sh_names. Also dispose of the old data. */
- struct Ebl_Strent *unstripped_strent[unstripped_shnum - 1];
+ Dwelf_Strent *unstripped_strent[unstripped_shnum - 1];
if (unstripped_shstrndx == elf_ndxscn (unstripped_strtab))
{
for (size_t i = 0; i < unstripped_shnum - 1; ++i)
@@ -1761,20 +1753,22 @@
GElf_Shdr mem;
GElf_Shdr *hdr = gelf_getshdr (sec, &mem);
const char *name = get_section_name (i + 1, hdr, shstrtab);
- unstripped_strent[i + 1] = ebl_strtabadd (symstrtab, name, 0);
- ELF_CHECK (unstripped_strent[i + 1] != NULL,
+ unstripped_strent[i] = dwelf_strtab_add (symstrtab, name);
+ ELF_CHECK (unstripped_strent[i] != NULL,
_("cannot add section name to string table: %s"));
}
if (strtab != NULL)
{
- ebl_strtabfree (strtab);
+ dwelf_strtab_free (strtab);
free (strtab_data->d_buf);
strtab = NULL;
}
}
- ebl_strtabfinalize (symstrtab, symstrdata);
+ if (dwelf_strtab_finalize (symstrtab, symstrdata) == NULL)
+ error (EXIT_FAILURE, 0, "Not enough memory to create symbol table");
+
elf_flagdata (symstrdata, ELF_C_SET, ELF_F_DIRTY);
/* And update the section header names if necessary. */
@@ -1785,7 +1779,7 @@
Elf_Scn *sec = elf_getscn (unstripped, i + 1);
GElf_Shdr mem;
GElf_Shdr *hdr = gelf_getshdr (sec, &mem);
- shdr->sh_name = ebl_strtaboffset (unstripped_strent[i + 1]);
+ shdr->sh_name = dwelf_strent_off (unstripped_strent[i]);
update_shdr (sec, hdr);
}
}
@@ -1810,7 +1804,7 @@
struct symbol *s = &symbols[i];
/* Fill in the symbol details. */
- sym.st_name = ebl_strtaboffset (s->strent);
+ sym.st_name = dwelf_strent_off (s->strent);
sym.st_value = s->value; /* Already biased to output address. */
sym.st_size = s->size;
sym.st_shndx = s->shndx; /* Already mapped to output index. */
@@ -1959,13 +1953,13 @@
if (strtab != NULL)
{
- ebl_strtabfree (strtab);
+ dwelf_strtab_free (strtab);
free (strtab_data->d_buf);
}
if (symstrtab != NULL)
{
- ebl_strtabfree (symstrtab);
+ dwelf_strtab_free (symstrtab);
free (symstrdata->d_buf);
}
free_new_data ();
@@ -2389,7 +2383,8 @@
.children = argp_children,
.args_doc = N_("STRIPPED-FILE DEBUG-FILE\n[MODULE...]"),
.doc = N_("\
-Combine stripped files with separate symbols and debug information.\v\
+Combine stripped files with separate symbols and debug information.\n\
+\n\
The first form puts the result in DEBUG-FILE if -o was not given.\n\
\n\
MODULE arguments give file name patterns matching modules to process.\n\
diff --git a/src/versionhash.c b/src/versionhash.c
deleted file mode 100644
index cc4d283..0000000
--- a/src/versionhash.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Version symbol hash table implementation.
- Copyright (C) 2001, 2002 Red Hat, Inc.
- This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
-
- 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/>. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <string.h>
-
-#include <ld.h>
-
-/* Definitions for the symbol hash table. */
-#define TYPE struct id_list *
-#define NAME ld_version_str_tab
-#define COMPARE(a, b) strcmp ((a)->id, (b)->id)
-
-#include "../lib/dynamicsizehash.c"
diff --git a/src/versionhash.h b/src/versionhash.h
deleted file mode 100644
index 4434e05..0000000
--- a/src/versionhash.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Copyright (C) 2001, 2002 Red Hat, Inc.
- This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
-
- 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/>. */
-
-#ifndef VERSIONHASH_H
-#define VERSIONHASH_H 1
-
-/* Definitions for the symbol hash table. */
-#define TYPE struct id_list *
-#define NAME ld_version_str_tab
-#include <dynamicsizehash.h>
-
-#endif /* versionhash.h */
diff --git a/src/xelf.h b/src/xelf.h
deleted file mode 100644
index f292327..0000000
--- a/src/xelf.h
+++ /dev/null
@@ -1,391 +0,0 @@
-/* Macros to enable writing native and generic ELF access code.
- Copyright (C) 2003 Red Hat, Inc.
- This file is part of elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2003.
-
- 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/>. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <libebl.h>
-
-
-/* By default the linker is handling all architectures. But it can
- be configured to be a native-only linker. */
-#if NATIVE_ELF == 32
-/* 32-bit only. */
-# define XElf_Ehdr Elf32_Ehdr
-# define XElf_Shdr Elf32_Shdr
-# define XElf_Off Elf32_Off
-# define XElf_Addr Elf32_Addr
-# define XElf_Half Elf32_Half
-# define XElf_Word Elf32_Word
-# define XElf_Xword Elf32_Word
-# define XElf_Sxword Elf32_Sword
-# define XElf_Versym Elf32_Versym
-# define XElf_Sym Elf32_Sym
-# define XElf_Rel Elf32_Rel
-# define XElf_Rela Elf32_Rela
-
-# define XElf_Ehdr_vardef(name) Elf32_Ehdr *name
-# define xelf_getehdr(elf, name) name = elf32_getehdr (elf)
-# define xelf_getehdr_copy(elf, name, copy) \
- (copy) = *(name = elf32_getehdr (elf))
-# define xelf_newehdr(elf, klass) elf32_newehdr (elf)
-# define xelf_update_ehdr(elf, ehdr) \
- /* nothing */ ((void) (elf), (void) (ehdr), 1)
-
-# define xelf_getclass(elf) ELFCLASS32
-
-# define XElf_Phdr_vardef(name) Elf32_Phdr *name
-# define xelf_newphdr(elf, n) elf32_newphdr (elf, n)
-# define xelf_getphdr(elf, idx, name) name = elf32_getphdr (elf) + idx
-# define xelf_getphdr_ptr(elf, idx, name) name = elf32_getphdr (elf) + idx
-# define xelf_update_phdr(elf, idx, phdr) \
- /* nothing */ ((void) (elf), (void) (idx), (void) (phdr), 1)
-
-# define XElf_Shdr_vardef(name) Elf32_Shdr *name
-# define xelf_getshdr(scn, name) name = elf32_getshdr (scn)
-# define xelf_getshdr_copy(scn, name, copy) \
- (copy) = *(name = elf32_getshdr (scn))
-# define xelf_update_shdr(scn, shdr) \
- /* nothing */ ((void) (scn), (void) (shdr), 1)
-
-# define XElf_Sym_vardef(name) Elf32_Sym *name
-# define xelf_getsym(data, idx, name) \
- name = &((Elf32_Sym *) (data)->d_buf)[idx]
-# define xelf_getsym_ptr(data, idx, name) \
- name = &((Elf32_Sym *) (data)->d_buf)[idx]
-# define xelf_getsymshndx(data, ndxdata, idx, name1, name2) \
- (name1 = &((Elf32_Sym *) ((data)->d_buf))[idx]); \
- name2 = (unlikely ((ndxdata) != NULL) \
- ? ((Elf32_Word *) ((ndxdata)->d_buf))[idx] : 0)
-# define xelf_update_sym(data, idx, sym) \
- /* nothing */ ((void) (data), (void) (idx), (void) (sym), 1)
-# define xelf_update_symshndx(data, ndxdata, idx, name1, name2, datachanged) \
- if (datachanged) \
- ((Elf32_Sym *) ((data)->d_buf))[idx] = *name1; \
- if (unlikely (ndxdata != NULL)) \
- ((Elf32_Word *) ((ndxdata)->d_buf))[idx] = name2
-
-# define XElf_Versym_vardef(name) Elf32_Versym name
-# define xelf_getversym_copy(data, idx, name) \
- (name = ((Elf32_Versym *) ((data)->d_buf))[idx], &name)
-
-# define XElf_Dyn_vardef(name) Elf32_Dyn *name
-# define xelf_getdyn(data, idx, name) \
- name = &((Elf32_Dyn *) ((data)->d_buf))[idx]
-# define xelf_getdyn_ptr(data, idx, name) \
- name = &((Elf32_Dyn *) ((data)->d_buf))[idx]
-# define xelf_update_dyn(data, idx, name) \
- /* nothing */ ((void) (data), (void) (idx), (void) (name), 1)
-
-# define XElf_Rel_vardef(name) Elf32_Rel *name
-# define xelf_getrel(data, idx, name) \
- name = &((Elf32_Rel *) ((data)->d_buf))[idx]
-# define xelf_getrel_ptr(data, idx, name) \
- name = &((Elf32_Rel *) ((data)->d_buf))[idx]
-# define xelf_update_rel(data, idx, name) \
- /* nothing */ ((void) (data), (void) (idx), (void) (name), 1)
-
-# define XElf_Rela_vardef(name) Elf32_Rela *name
-# define xelf_getrela(data, idx, name) \
- name = &((Elf32_Rela *) ((data)->d_buf))[idx]
-# define xelf_getrela_ptr(data, idx, name) \
- name = &((Elf32_Rela *) ((data)->d_buf))[idx]
-# define xelf_update_rela(data, idx, name) \
- /* nothing */ ((void) (data), (void) (idx), (void) (name), 1)
-
-# define XElf_Verdef_vardef(name) Elf32_Verdef *name
-# define xelf_getverdef(data, offset, name) \
- name = ((Elf32_Verdef *) ((char *) ((data)->d_buf) + (offset)))
-
-# define XElf_Verdaux_vardef(name) Elf32_Verdaux *name
-# define xelf_getverdaux(data, offset, name) \
- name = ((Elf32_Verdaux *) ((char *) ((data)->d_buf) + (offset)))
-
-# define XELF_ST_TYPE(info) ELF32_ST_TYPE (info)
-# define XELF_ST_BIND(info) ELF32_ST_BIND (info)
-# define XELF_ST_INFO(bind, type) ELF32_ST_INFO (bind, type)
-# define XELF_ST_VISIBILITY(info) ELF32_ST_VISIBILITY (info)
-
-# define XELF_R_SYM(info) ELF32_R_SYM (info)
-# define XELF_R_TYPE(info) ELF32_R_TYPE (info)
-# define XELF_R_INFO(sym, type) ELF32_R_INFO (sym, type)
-
-# define xelf_fsize(elf, type, cnt) \
- (__builtin_constant_p (type) \
- ? ({ size_t fsize; \
- switch (type) \
- { \
- case ELF_T_BYTE: fsize = 1; break; \
- case ELF_T_ADDR: fsize = sizeof (Elf32_Addr); break; \
- case ELF_T_DYN: fsize = sizeof (Elf32_Dyn); break; \
- case ELF_T_EHDR: fsize = sizeof (Elf32_Ehdr); break; \
- case ELF_T_HALF: fsize = sizeof (Elf32_Half); break; \
- case ELF_T_OFF: fsize = sizeof (Elf32_Off); break; \
- case ELF_T_PHDR: fsize = sizeof (Elf32_Phdr); break; \
- case ELF_T_RELA: fsize = sizeof (Elf32_Rela); break; \
- case ELF_T_REL: fsize = sizeof (Elf32_Rel); break; \
- case ELF_T_SHDR: fsize = sizeof (Elf32_Shdr); break; \
- case ELF_T_SWORD: fsize = sizeof (Elf32_Sword); break; \
- case ELF_T_SYM: fsize = sizeof (Elf32_Sym); break; \
- case ELF_T_WORD: fsize = sizeof (Elf32_Word); break; \
- case ELF_T_XWORD: fsize = sizeof (Elf32_Xword); break; \
- case ELF_T_SXWORD: fsize = sizeof (Elf32_Sxword); break; \
- case ELF_T_VDEF: fsize = sizeof (Elf32_Verdef); break; \
- case ELF_T_VDAUX: fsize = sizeof (Elf32_Verdaux); break; \
- case ELF_T_VNEED: fsize = sizeof (Elf32_Verneed); break; \
- case ELF_T_VNAUX: fsize = sizeof (Elf32_Vernaux); break; \
- case ELF_T_NHDR: fsize = sizeof (Elf32_Nhdr); break; \
- case ELF_T_SYMINFO: fsize = sizeof (Elf32_Syminfo); break; \
- case ELF_T_MOVE: fsize = sizeof (Elf32_Move); break; \
- default: fsize = 0; break; \
- } \
- fsize * (cnt); }) \
- : gelf_fsize (elf, type, cnt, EV_CURRENT))
-#elif NATIVE_ELF == 64
-/* 64-bit only. */
-# define XElf_Ehdr Elf64_Ehdr
-# define XElf_Shdr Elf64_Shdr
-# define XElf_Addr Elf64_Addr
-# define XElf_Half Elf64_Half
-# define XElf_Off Elf64_Off
-# define XElf_Word Elf64_Word
-# define XElf_Xword Elf64_Xword
-# define XElf_Sxword Elf64_Sxword
-# define XElf_Versym Elf64_Versym
-# define XElf_Sym Elf64_Sym
-# define XElf_Rel Elf64_Rel
-# define XElf_Rela Elf64_Rela
-
-# define XElf_Ehdr_vardef(name) Elf64_Ehdr *name
-# define xelf_getehdr(elf, name) name = elf64_getehdr (elf)
-# define xelf_getehdr_copy(elf, name, copy) \
- (copy) = *(name = elf64_getehdr (elf))
-# define xelf_newehdr(elf, klass) elf64_newehdr (elf)
-# define xelf_update_ehdr(elf, ehdr) \
- /* nothing */ ((void) (elf), (void) (ehdr), 1)
-
-# define xelf_getclass(elf) ELFCLASS32
-
-# define XElf_Phdr_vardef(name) Elf64_Phdr *name
-# define xelf_newphdr(elf, n) elf64_newphdr (elf, n)
-# define xelf_getphdr(elf, idx, name) name = elf64_getphdr (elf) + idx
-# define xelf_getphdr_ptr(elf, idx, name) name = elf64_getphdr (elf) + idx
-# define xelf_update_phdr(elf, idx, phdr) \
- /* nothing */ ((void) (elf), (void) (idx), (void) (phdr), 1)
-
-# define XElf_Shdr_vardef(name) Elf64_Shdr *name
-# define xelf_getshdr(scn, name) name = elf64_getshdr (scn)
-# define xelf_getshdr_copy(scn, name, copy) \
- (copy) = *(name = elf64_getshdr (scn))
-# define xelf_update_shdr(scn, shdr) \
- /* nothing */ ((void) (scn), (void) (shdr), 1)
-
-# define XElf_Sym_vardef(name) Elf64_Sym *name
-# define xelf_getsym(data, idx, name) \
- name = &((Elf64_Sym *) (data)->d_buf)[idx]
-# define xelf_getsym_ptr(data, idx, name) \
- name = &((Elf64_Sym *) (data)->d_buf)[idx]
-# define xelf_getsymshndx(data, ndxdata, idx, name1, name2) \
- (name1 = &((Elf64_Sym *) ((data)->d_buf))[idx]); \
- name2 = (unlikely ((ndxdata) != NULL) \
- ? ((Elf32_Word *) ((ndxdata)->d_buf))[idx] : 0)
-# define xelf_update_sym(data, idx, sym) \
- /* nothing */ ((void) (data), (void) (idx), (void) (sym), 1)
-# define xelf_update_symshndx(data, ndxdata, idx, name1, name2, datachanged) \
- if (datachanged) \
- ((Elf64_Sym *) ((data)->d_buf))[idx] = *name1; \
- if (ndxdata != NULL) \
- (((Elf32_Word *) ((ndxdata)->d_buf))[idx] = name2)
-
-# define XElf_Versym_vardef(name) Elf64_Versym name
-# define xelf_getversym_copy(data, idx, name) \
- (name = ((Elf64_Versym *) ((data)->d_buf))[idx], (&name))
-
-# define XElf_Dyn_vardef(name) Elf64_Dyn *name
-# define xelf_getdyn(data, idx, name) \
- name = &((Elf64_Dyn *) ((data)->d_buf))[idx]
-# define xelf_getdyn_ptr(data, idx, name) \
- name = &((Elf64_Dyn *) ((data)->d_buf))[idx]
-# define xelf_update_dyn(data, idx, name) \
- /* nothing */ ((void) (data), (void) (idx), (void) (name), 1)
-
-# define XElf_Rel_vardef(name) Elf64_Rel *name
-# define xelf_getrel(data, idx, name) \
- name = &((Elf64_Rel *) ((data)->d_buf))[idx]
-# define xelf_getrel_ptr(data, idx, name) \
- name = &((Elf64_Rel *) ((data)->d_buf))[idx]
-# define xelf_update_rel(data, idx, name) \
- /* nothing */ ((void) (data), (void) (idx), (void) (name), 1)
-
-# define XElf_Rela_vardef(name) Elf64_Rela *name
-# define xelf_getrela(data, idx, name) \
- name = &((Elf64_Rela *) ((data)->d_buf))[idx]
-# define xelf_getrela_ptr(data, idx, name) \
- name = &((Elf64_Rela *) ((data)->d_buf))[idx]
-# define xelf_update_rela(data, idx, name) \
- /* nothing */ ((void) (data), (void) (idx), (void) (name), 1)
-
-# define XElf_Verdef_vardef(name) Elf64_Verdef *name
-# define xelf_getverdef(data, offset, name) \
- name = ((Elf64_Verdef *) ((char *) ((data)->d_buf) + (offset)))
-
-# define XElf_Verdaux_vardef(name) Elf64_Verdaux *name
-# define xelf_getverdaux(data, offset, name) \
- name = ((Elf64_Verdaux *) ((char *) ((data)->d_buf) + (offset)))
-
-# define XELF_ST_TYPE(info) ELF64_ST_TYPE (info)
-# define XELF_ST_BIND(info) ELF64_ST_BIND (info)
-# define XELF_ST_INFO(bind, type) ELF64_ST_INFO (bind, type)
-# define XELF_ST_VISIBILITY(info) ELF64_ST_VISIBILITY (info)
-
-# define XELF_R_SYM(info) ELF64_R_SYM (info)
-# define XELF_R_TYPE(info) ELF64_R_TYPE (info)
-# define XELF_R_INFO(sym, type) ELF64_R_INFO (sym, type)
-
-# define xelf_fsize(elf, type, cnt) \
- (__builtin_constant_p (type) \
- ? ({ size_t fsize; \
- switch (type) \
- { \
- case ELF_T_BYTE: fsize = 1; break; \
- case ELF_T_ADDR: fsize = sizeof (Elf64_Addr); break; \
- case ELF_T_DYN: fsize = sizeof (Elf64_Dyn); break; \
- case ELF_T_EHDR: fsize = sizeof (Elf64_Ehdr); break; \
- case ELF_T_HALF: fsize = sizeof (Elf64_Half); break; \
- case ELF_T_OFF: fsize = sizeof (Elf64_Off); break; \
- case ELF_T_PHDR: fsize = sizeof (Elf64_Phdr); break; \
- case ELF_T_RELA: fsize = sizeof (Elf64_Rela); break; \
- case ELF_T_REL: fsize = sizeof (Elf64_Rel); break; \
- case ELF_T_SHDR: fsize = sizeof (Elf64_Shdr); break; \
- case ELF_T_SWORD: fsize = sizeof (Elf64_Sword); break; \
- case ELF_T_SYM: fsize = sizeof (Elf64_Sym); break; \
- case ELF_T_WORD: fsize = sizeof (Elf64_Word); break; \
- case ELF_T_XWORD: fsize = sizeof (Elf64_Xword); break; \
- case ELF_T_SXWORD: fsize = sizeof (Elf64_Sxword); break; \
- case ELF_T_VDEF: fsize = sizeof (Elf64_Verdef); break; \
- case ELF_T_VDAUX: fsize = sizeof (Elf64_Verdaux); break; \
- case ELF_T_VNEED: fsize = sizeof (Elf64_Verneed); break; \
- case ELF_T_VNAUX: fsize = sizeof (Elf64_Vernaux); break; \
- case ELF_T_NHDR: fsize = sizeof (Elf64_Nhdr); break; \
- case ELF_T_SYMINFO: fsize = sizeof (Elf64_Syminfo); break; \
- case ELF_T_MOVE: fsize = sizeof (Elf64_Move); break; \
- default: fsize = 0; break; \
- } \
- fsize * (cnt); }) \
- : gelf_fsize (elf, type, cnt, EV_CURRENT))
-#else
-# include <gelf.h>
-
-/* Generic linker. */
-# define XElf_Ehdr GElf_Ehdr
-# define XElf_Shdr GElf_Shdr
-# define XElf_Addr GElf_Addr
-# define XElf_Half GElf_Half
-# define XElf_Off GElf_Off
-# define XElf_Word GElf_Word
-# define XElf_Xword GElf_Xword
-# define XElf_Sxword GElf_Sxword
-# define XElf_Versym GElf_Versym
-# define XElf_Sym GElf_Sym
-# define XElf_Rel GElf_Rel
-# define XElf_Rela GElf_Rela
-
-# define XElf_Ehdr_vardef(name) GElf_Ehdr name##_mem; GElf_Ehdr *name
-# define xelf_getehdr(elf, name) name = gelf_getehdr (elf, &name##_mem)
-# define xelf_getehdr_copy(elf, name, copy) \
- name = gelf_getehdr (elf, &(copy))
-# define xelf_newehdr(elf, klass) gelf_newehdr (elf, klass)
-# define xelf_update_ehdr(elf, ehdr) gelf_update_ehdr (elf, ehdr)
-
-# define xelf_getclass(elf) gelf_getclass (elf)
-
-# define XElf_Phdr_vardef(name) GElf_Phdr name##_mem; GElf_Phdr *name
-# define xelf_newphdr(elf, n) gelf_newphdr (elf, n)
-# define xelf_getphdr(elf, idx, name) \
- name = gelf_getphdr (elf, idx, &name##_mem)
-# define xelf_getphdr_ptr(elf, idx, name) \
- name = &name##_mem
-# define xelf_update_phdr(elf, idx, phdr) \
- gelf_update_phdr (elf, idx, phdr)
-
-# define XElf_Shdr_vardef(name) GElf_Shdr name##_mem; GElf_Shdr *name
-# define xelf_getshdr(scn, name) name = gelf_getshdr (scn, &name##_mem)
-# define xelf_getshdr_copy(scn, name, copy) \
- name = gelf_getshdr (scn, &(copy))
-# define xelf_update_shdr(scn, shdr) gelf_update_shdr (scn, shdr)
-
-# define XElf_Sym_vardef(name) GElf_Sym name##_mem; GElf_Sym *name
-# define xelf_getsym(data, idx, name) \
- name = gelf_getsym (data, idx, &name##_mem)
-# define xelf_getsym_ptr(data, idx, name) \
- name = &name##_mem
-# define xelf_getsymshndx(data, ndxdata, idx, name1, name2) \
- name1 = gelf_getsymshndx (data, ndxdata, idx, &name1##_mem, &(name2))
-# define xelf_update_sym(data, idx, sym) gelf_update_sym (data, idx, sym)
-# define xelf_update_symshndx(data, ndxdata, idx, name1, name2, datachanged) \
- gelf_update_symshndx (data, ndxdata, idx, name1, name2)
-
-# define XElf_Versym_vardef(name) GElf_Versym name
-# define xelf_getversym_copy(data, idx, name) \
- gelf_getversym (data, idx, &name)
-
-# define XElf_Dyn_vardef(name) GElf_Dyn name##_mem; GElf_Dyn *name
-# define xelf_getdyn(data, idx, name) \
- name = gelf_getdyn (data, idx, &name##_mem)
-# define xelf_getdyn_ptr(data, idx, name) \
- name = &name##_mem
-# define xelf_update_dyn(data, idx, name) \
- gelf_update_dyn (data, idx, name)
-
-# define XElf_Rel_vardef(name) GElf_Rel name##_mem; GElf_Rel *name
-# define xelf_getrel(data, idx, name) \
- name = gelf_getrel (data, idx, &name##_mem)
-# define xelf_getrel_ptr(data, idx, name) \
- name = &name##_mem
-# define xelf_update_rel(data, idx, name) \
- gelf_update_rel (data, idx, name)
-
-# define XElf_Rela_vardef(name) GElf_Rela name##_mem; GElf_Rela *name
-# define xelf_getrela(data, idx, name) \
- name = gelf_getrela (data, idx, &name##_mem)
-# define xelf_getrela_ptr(data, idx, name) \
- name = &name##_mem
-# define xelf_update_rela(data, idx, name) \
- gelf_update_rela (data, idx, name)
-
-# define XElf_Verdef_vardef(name) GElf_Verdef name##_mem; GElf_Verdef *name
-# define xelf_getverdef(data, offset, name) \
- name = gelf_getverdef (data, offset, &name##_mem)
-
-# define XElf_Verdaux_vardef(name) GElf_Verdaux name##_mem; GElf_Verdaux *name
-# define xelf_getverdaux(data, offset, name) \
- name = gelf_getverdaux (data, offset, &name##_mem)
-
-# define XELF_ST_TYPE(info) GELF_ST_TYPE (info)
-# define XELF_ST_BIND(info) GELF_ST_BIND (info)
-# define XELF_ST_INFO(bind, type) GELF_ST_INFO (bind, type)
-# define XELF_ST_VISIBILITY(info) GELF_ST_VISIBILITY (info)
-
-# define XELF_R_SYM(info) GELF_R_SYM (info)
-# define XELF_R_TYPE(info) GELF_R_TYPE (info)
-# define XELF_R_INFO(sym, type) GELF_R_INFO (sym, type)
-
-# define xelf_fsize(elf, type, cnt) \
- gelf_fsize (elf, type, cnt, EV_CURRENT)
-#endif
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 37f9811..765a874 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,770 @@
+2018-06-28 Mark Wielaard <mark@klomp.org>
+
+ * next_cfi.c: New file.
+ * run-next-cfi.sh: New test.
+ * run-next-cfi-self.sh: Likewise.
+ * Makefile.am (check_PROGRAMS): Add next_cfi.
+ (TESTS): Add run-next-cfi.sh and run-next-cfi-self.sh.
+ (EXTRA_DIST): Likewise.
+ (next_cfi_LDADD): New variable.
+
+2018-06-27 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_cfi.c: New file.
+ * run-dwarfcfi.sh: New test.
+ * testfile11-debugframe.bz2: New testfile.
+ * testfile12-debugframe.bz2: Likewise.
+ * testfileaarch64-debugframe.bz2: Likewise.
+ * testfilearm-debugframe.bz2: Likewise.
+ * testfileppc32-debugframe.bz2: Likewise.
+ * testfileppc64-debugframe.bz2: Likewise.
+ * Makefile.am (check_PROGRAMS): Add dwarfcfi.
+ (TESTS): Add run-dwarfcfi.sh.
+ (EXTRA_DIST): Add run-dwarfcfi.sh, testfile11-debugframe.bz2,
+ testfile12-debugframe.bz2, testfileaarch64-debugframe.bz2,
+ testfilearm-debugframe.bz2, testfileppc32-debugframe.bz2 and
+ testfileppc64-debugframe.bz2.
+
+2018-06-23 Mark Wielaard <mark@klomp.org>
+
+ * varlocs.c (print_expr): Take a new depth argument. Check it isn't
+ greater than MAX_DEPTH (64). Pass on to print_expr_block.
+ (print_expr_block): Take a new depth argument. Pass it to print_expr.
+ (print_expr_block_addrs): Call print_expr_block with zero depth.
+
+2018-06-25 Mark Wielaard <mark@klomp.org>
+
+ * next-files.c: New file.
+ * next-lines.c: Likewise.
+ * run-next-files.sh: New test.
+ * run-next-lines.sh: Likewise.
+ * testfile-only-debug-line.bz2: New test file.
+ * Makefile.am (check_PROGRAMS): Add next-files and next-lines.
+ (TESTS): Add run-next-files.sh and run-next-lines.sh.
+ (EXTRA_DIST): Add run-next-files.sh, run-next-lines.sh and
+ testfile-only-debug-line.bz2.
+ (next_lines_LDADD): New variable.
+ (next_files_LDADD): Likewise.
+
+2018-06-16 Yonghong Song <yhs@fb.com>
+
+ * run-reloc-bpf.sh: New test.
+ * testfile-bpf-reloc.o.bz2: New test file.
+ * testfile-bpf-reloc.expect.bz2: New test file.
+ * Makefile.am (TESTS): Add run-reloc-bpf.sh.
+ (EXTRA_DIST): Add run-reloc-bpf.sh, testfile-bpf-reloc.o.bz2 and
+ testfile-bpf-reloc.expect.bz2.
+
+2018-06-13 Mark Wielaard <mark@klomp.org>
+
+ * run-readelf-const-values.sh: New test.
+ * testfile-const-values.debug.bz2: New test file.
+ * run-readelf-zdebug-rel.sh: Adjust expected const_value.
+ * Makefile.am (TESTS): Add run-readelf-const-values.sh.
+ (EXTRA_DIST): Add run-readelf-const-values.sh and
+ testfile-const-values.debug.bz2.
+
+2018-06-08 Mark Wielaard <mark@klomp.org>
+
+ * varlocs.c (print_expr): Error on bad DW_OP_GNU_parameter_ref
+ target, do not assert.
+
+2018-06-08 Mark Wielaard <mark@klomp.org>
+
+ * get-units-invalid.c (main): Check invalid dwarf_getabbrev call.
+ * show-abbrev.c (main): Check illegal dwarf_getabbrev offset call.
+
+2018-06-08 Mark Wielaard <mark@klomp.org>
+
+ * varlocs.c (main): Only assert when cfi_debug_bias != 0 if there
+ actually is a cfi_debug.
+
+2018-06-07 Mark Wielaard <mark@klomp.org>
+
+ * run-readelf-loc.sh: Fix expected output for startx_length.
+
+2018-06-06 Mark Wielaard <mark@klomp.org>
+
+ * varlocs.c (print_base_type): Use error, not assert when the DIE
+ isn't a base type.
+
+2018-06-02 Mark Wielaard <mark@klomp.org>
+
+ * test-subr.sh (self_test_files_exe): Drop shared libraries.
+ Keep addr2line, elfcmp, objdump and readelf.
+
+2018-05-31 Mark Wielaard <mark@klomp.org>
+
+ * run-readelf-types.sh: New test.
+ * Makefile.am (TESTS): Add run-readelf-types.sh.
+ (EXTRA_DIST): Likewise.
+
+2018-05-31 Mark Wielaard <mark@klomp.org>
+
+ * splitdwarf4-not-split4.dwo.bz2: New test file.
+ * testfile-splitdwarf4-not-split4.debug.bz2: Likewise.
+ * run-readelf-loc.sh: Add test for splitdwarf4-not-split4.dwo
+ and testfile-splitdwarf4-not-split4.debug.
+ * run-varlocs.sh: Test testfile-splitdwarf4-not-split4.debug.
+ * Makefile.am (EXTRA_DIST): Add splitdwarf4-not-split4.dwo.bz2
+ and testfile-splitdwarf4-not-split4.debug.bz2.
+
+2018-05-31 Mark Wielaard <mark@klomp.org>
+
+ * test-subr.sh (self_test_files): Split into self_test_files_exe,
+ self_test_files_lib and self_test_obj.
+ (testrun_on_self_exe): New function.
+ (testrun_on_self_lib): Likewise.
+ * run-get-units-split.sh: Replace testrun_on_self with
+ testrun_on_self_exe and testrun_on_self_lib.
+ * run-unit-info.sh: Likewise.
+
+2018-05-31 Mark Wielaard <mark@klomp.org>
+
+ * low_high_pc.c (handle_die): Handle NULL name. Print offset and
+ name of die.
+ (main): Check if the cu DIE is a skeleton, then get and handle
+ the split subdie.
+ * run-low-high-pc.sh: Run on testfile-splitdwarf-4 and
+ testfile-splitdwarf-5. Run on all selftest files.
+
+2018-05-31 Mark Wielaard <mark@klomp.org>
+
+ * get-units-invalid.c (main): Check dwarf_cuoffset and
+ dwarf_dieoffset.
+
+2018-05-29 Mark Wielaard <mark@klomp.org>
+
+ * dwarf-die-addr-die.c (check_dbg): Also check subdies, split or
+ type, gotten through dwarf_get_units.
+ * run-dwarf-die-addr-die.sh: Add tests for dwarf-4, dwarf-5,
+ split-dwarf-4, split-dwarf-5 and dwo files.
+
+2018-05-29 Mark Wielaard <mark@klomp.org>
+
+ * run-readelf-loc.sh: Add GNU DebugFission split-dwarf variant.
+ * run-varlocs.sh: Likewise.
+
+2018-05-29 Mark Wielaard <mark@klomp.org>
+
+ * run-readelf-twofiles.sh: Add --debug-dump=loc testcase.
+
+2018-05-28 Mark Wielaard <mark@klomp.org>
+
+ * run-readelf-info-plus.sh: New test.
+ * Makefile.am (TESTS): Add run-readelf-info-plus.sh.
+ (EXTRA_DIST): Likewise.
+
+2018-04-29 Mark Wielaard <mark@klomp.org>
+
+ * run-readelf-addr.sh: New test.
+ * Makefile.am (TESTS): Add run-readelf-addr.sh.
+ (EXTRA_DIST): Likewise.
+
+2018-04-27 Mark Wielaard <mark@klomp.org>
+
+ * run-readelf-ranges.sh: Adjust expected output for address base.
+ * run-readelf-addr.sh: New test.
+ * Makefile.am (TESTS): Add run-readelf-addr.sh.
+ (EXTRA_DIST): Likewise.
+
+2018-04-07 Mark Wielaard <mark@klomp.org>
+
+ * run-varlocs.sh: Run on testfileranges5.debug and
+ testsplitfileranges5.debug.
+ * varlocs.c (is_debug): New bool.
+ (print_expr): Don't fail on missing CFI for is_debug.
+ (main): Parse --debug, set is_debug.
+
+2018-04-12 Mark Wielaard <mark@klomp.org>
+
+ * run-readelf-loc.sh: Add new testcases.
+
+2018-04-06 Mark Wielaard <mark@klomp.org>
+
+ * testfileranges5.debug.bz2: New testfile.
+ * testfilesplitranges5.debug.bz2: Likewise.
+ * testfile-ranges-hello5.dwo.bz2: Likewise.
+ * testfile-ranges-world5.dwo.bz2: Likewise.
+ * run-dwarf-ranges.sh: Run on testfileranges5.debug.
+ * run-all-dwarf-ranges.sh: Run on testfilesplitranges5.debug.
+ * tests/Makefile.am (EXTRA_DIST): Add testfileranges5.debug.bz2,
+ testfilesplitranges5.debug.bz2, testfile-ranges-hello5.dwo.bz2 and
+ testfile-ranges-world5.dwo.bz2.
+
+2018-04-11 Mark Wielaard <mark@klomp.org>
+
+ * run-readelf-ranges.sh: New test.
+ * Makefile.am (TESTS): Add run-readelf-ranges.sh.
+ (EXTRA_DIST): Likewise.
+
+2018-05-21 Mark Wielaard <mark@klomp.org>
+
+ * addrx_constx-4.dwo.bz2: New testfile.
+ * addrx_constx-5.dwo.bz2: Likewise.
+ * testfile-addrx_constx-4.bz2: Likewise.
+ * testfile-addrx_constx-5.bz2: Likewise
+ * Makefile.am (EXTRA_DIST): Add addrx_constx-5.dwo.bz2
+ testfile-addrx_constx-4\ .bz2 testfile-addrx_constx-5.bz2.
+ * run-varlocs.sh: Add addrx_constx tests for DWARF4 and DWARF5.
+ * varlocx.c (print_expr): Handle DW_OP_GNU_addr_index,
+ DW_OP_addrx, DW_OP_GNU_const_index and DW_OP_constx.
+ (main): Handle split DWARF.
+ * run-all-dwarf-ranges.sh: Add new ranges for addrx low/highpc.
+
+2018-05-20 Mark Wielaard <mark@klomp.org>
+
+ * unit-info.c: New test.
+ * run-unit-info.sh: New test runner.
+ * Makefile.am (check_PROGRAMS): Add unit-info.
+ (TESTS): Add run-unit-info.sh
+ (EXTRA_INFO): Likewise.
+ (unit_info_LDADD): New variable.
+
+2018-05-24 Mark Wielaard <mark@klomp.org>
+
+ * get-units-invalid.c (main): Add check for invalid dwarf_ranges.
+ * run-all-dwarf-ranges.sh: Correct expected output.
+
+2018-05-18 Mark Wielaard <mark@klomp.org>
+
+ * Makefiles.am (check_PROGRAMS): Add all-dwarf-ranges.
+ (TESTS): Add run-all-dwarf-ranges.sh.
+ (EXTRA_DIST): Add run-all-dwarf-ranges.sh,
+ testfilesplitranges4.debug.bz2, testfile-ranges-hello.dwo.bz2
+ and testfile-ranges-world.dwo.bz2.
+ (all_dwarf_ranges_LDADD): New variable.
+ * all-dwarf-ranges.c: New test program.
+ * run-all-dwarf-ranges: New test runner.
+ * testfile-ranges-hello.dwo.bz2: New test file.
+ * testfile-ranges-world.dwo.bz2: Likewise.
+ * testfilesplitranges4.debug.bz2: Likewise.
+
+2018-05-18 Mark Wielaard <mark@klomp.org>
+
+ * run-get-files.sh: Add testcases for testfile-splitdwarf-4,
+ testfile-hello4.dwo, testfile-world4.dwo and testfile-splitdwarf-5,
+ testfile-hello5.dwo, testfile-world5.dwo.
+
+2018-05-17 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (check_PROGRAMS): Add attr-integrate-skel.
+ (TESTS): Add run-attr-integrate-skel.
+ (EXTRA_DIST): Likewise.
+ (attr_integrate_skel_LDADD): New variable.
+ * attr-integrate-skel.c: New test.
+ * run-attr-integrate-skel.sh: New test runner.
+
+2018-05-16 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (check_PROGRAMS): Add get-units-split.
+ (TESTS): Add run-get-units-split.sh.
+ (EXTRA_DIST): Add run-get-units-split.sh, testfile-hello4.dwo.bz2,
+ testfile-hello5.dwo.bz2, testfile-splitdwarf-4.bz2,
+ testfile-splitdwarf-5.bz2, testfile-world5.dwo.bz2 and
+ testfile-world4.dwo.bz2.
+ (get_units_split_LDADD): New variable.
+ * get-units-split.c: New test.
+ * run-get-units-split.sh: New test runner.
+ * testfile-dwarf-45.source: Extend with build instructions for new
+ test files.
+ * testfile-hello4.dwo.bz2: New test file.
+ * testfile-hello5.dwo.bz2: Likewise.
+ * testfile-splitdwarf-4.bz2: Likewise.
+ * testfile-splitdwarf-5.bz2: Likewise.
+ * testfile-world5.dwo.bz2 and: Likewise.
+ * testfile-world4.dwo.bz2: Likewise.
+
+2018-05-09 Mark Wielaard <mark@klomp.org>
+
+ * run-readelf-zdebug.sh: Adjust test output for new header layout.
+ * run-readelf-line.sh: Likewise. Add new tests for testfile-dwarf-4
+ and testfile-dwarf-5.
+
+2018-05-11 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (check_PROGRAMS): Add get-units-invalid.
+ (TESTS): Add run-get-units-invalid.sh.
+ (EXTRA_DIST): Likewise.
+ (get_units_invalid_LDADD): New variable.
+ * get-units-invalid.c: New test program.
+ * run-get-units-invalid.sh: New test program runner.
+
+2018-05-05 Mark Wielaard <mark@klomp.org>
+
+ * testfile-dwarf-45.source: New file.
+ * testfile-dwarf-4.bz2: New test file.
+ * testfile-dwarf-5.bz2: Likewise.
+ * run-readelf-line.sh: Add testcases for testfile-dwarf-4 and
+ testfile-dwarf-5.
+ * Makefile (EXTRA_DIST): Add testfile-dwarf-45.source,
+ testfile-dwarf-4.bz2 and testfile-dwarf-5.bz2.
+
+2018-04-19 Andreas Schwab <schwab@suse.de>
+
+ * hello_riscv64.ko.bz2: New file.
+ * run-strip-reloc.sh: Test it.
+ * Makefile.am (EXTRA_DIST): Add it.
+
+2018-04-16 Mark Wielaard <mark@klomp.org>
+
+ * testfile-ppc64-min-instr.bz2: New testfile.
+ * run-readelf-line.sh: Run against testfile-ppc64-min-instr.bz2.
+ * Makefile.am (EXTRA_DIST): Add testfile-ppc64-min-instr.bz2.
+
+2018-04-11 Mark Wielaard <mark@klomp.org>
+
+ * run-addrcfi.sh: Adjust expected rule for aarch64 sp.
+
+2018-04-03 Mark Wielaard <mark@klomp.org>
+
+ * testfileranges4.debug.bz2: New testfile.
+ * run-dwarf-ranges.sh: Run on testfileranges4.debug.
+ * tests/Makefile.am (EXTRA_DIST): Add testfileranges4.debug.bz2.
+
+2018-03-06 Mark Wielaard <mark@klomp.org>
+
+ * varlocs.c (print_expr): Handle DW_OP_implicit_pointer,
+ DW_OP_entry_value, DW_OP_convert, DW_OP_reinterpret,
+ DW_OP_regval_type, DW_OP_deref_type, DW_OP_xderef_type and
+ DW_OP_const_type.
+
+2018-02-16 Mark Wielaard <mark@klomp.org>
+
+ * backtrace-subr.sh (check_native_core): Check if there is any core,
+ if so, use it.
+
+2018-02-15 Mark Wielaard <mark@klomp.org>
+
+ * backtrace-child.c: Include signal.h after sys/ptrace.h.
+ * backtrace-dwarf.c: Include sys/wait.h and signal.h after
+ sys/ptrace.h.
+
+2018-01-25 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (check_PROGRAMS): Add dwarf-die-addr-die.
+ (TESTS): Add run-dwarf-die-addr-die.sh.
+ (EXTRA_DIST): Likewise.
+ (dwarf_die_addr_die_LDADD): New variable.
+ * dwarf-die-addr-die.c: New file.
+ * run-dwarf-die-addr-die.sh: New test.
+
+2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
+
+ * elfstrmerge.c (main): Use FALLTHROUGH macro instead of comment.
+
+2018-01-22 Mark Wielaard <mark@klomp.org>
+
+ * allfcts.c (setup_alt): Print warning when alt file couldn't be
+ found.
+ * run-allfcts-multi.sh: Add testcase where alt file is in a subdir
+ where it cannot be found by allfcts itself (but it can by libdw).
+
+2018-01-25 Mark Wielaard <mark@klomp.org>
+
+ * elfstrmerge.c (main): Initialize and check symtabshdr instead of
+ symtabndx.
+
+2018-01-14 Petr Machata <pmachata@gmail.com>
+
+ * testfile-sizes4.o.bz2: New test file.
+ * testfile-sizes4.s: New test source.
+ * run-aggregate-size.sh: Check testfile-sizes4.o v size 257.
+
+2017-12-23 Mark Wielaard <mark@klomp.org>
+
+ * backtrace-subr.sh (check_native_core): Use a lock file and try
+ to extract core using coredumpctl.
+ * Makefile.am (CLEANFILES): Clean core-dump-backtrace.lock.
+
+2017-12-11 Dima Kogan <dima@secretsauce.net>
+
+ * run-aggregate-size.sh: Added check for multi-dimensional arrays.
+ * run-peel-type.sh: Likewise.
+ * testfile-sizes3.o.bz2: Likewise.
+
+2017-12-07 Mark Wielaard <mark@klomp.org>
+
+ * run-readelf-variant.sh: New test.
+ * testfile-ada-variant.bz2: New testfile.
+ * Makefile.am (TESTS): Add run-readelf-variant.sh.
+ (EXTRA_DISTS): Add run-readelf-variant.sh and
+ testfile-ada-variant.bz2.
+
+2017-11-29 Mark Wielaard <mark@klomp.org>
+
+ * run-readelf-loc.sh: Adjust expected loc list output.
+ * run-readelf-zdebug-rel.sh: Likewise.
+ * run-readelf-zdebug.sh: Likewise.
+
+2017-11-29 Mark Wielaard <mark@klomp.org>
+
+ * run-readelf-loc.sh: Adjust expected range list output.
+ * run-readelf-zdebug.sh: Likewise.
+
+2017-11-29 Mark Wielaard <mark@klomp.org>
+
+ * run-readelf-dwz-multi.sh: Add expected file names.
+ * run-readelf-zdebug-rel.sh: Likewise.
+
+2017-11-29 Mark Wielaard <mark@klomp.org>
+
+ * run-readelf-dwz-multi.sh: Add expected abbrev codes.
+ * run-readelf-zdebug-rel.sh: Likewise.
+
+2017-11-29 Mark Wielaard <mark@klomp.org>
+
+ * run-readelf-dwz-multi.sh: Adjust expected ops index spaces.
+ * run-readelf-loc.sh: Likewise.
+ * run-readelf-zdebug-rel.sh: Likewise.
+ * run-readelf-zdebug.sh: Likewise.
+
+2017-11-16 Mark Wielaard <mark@klomp.org>
+
+ * varlocs.c (main): Fix cfi_debug => cfi_debug_bias typo in assert.
+
+2017-11-10 Mark Wielaard <mark@klomp.org>
+
+ * run-exprlocs-self.sh: New test.
+ * run-varlocs-self.sh: Likewise.
+ * Makefile.am (TESTS) Add run-exprlocs-self.sh and
+ run-varlocs-self.sh.
+ (EXTRA_DIST): Likewise.
+ * varlocs.c (cfi_debug_bias): New global variable.
+ (is_ET_REL): Likewise.
+ (print_expr): Don't crash and burn when CFI cannot be found for an
+ ET_REL file for DW_OP_call_frame_cfa.
+ (handle_die): If there is no entry_pc pick the lowest pc start range
+ for the DIE.
+ (main): Check at least one CU was found. Use dwfl_module_dwarf_cfi
+ and dwfl_module_eh_cfi to fix memory leak. Set is_ET_REL.
+
+2017-11-03 Mark Wielaard <mark@klomp.org>
+
+ * run-exprlocs.sh: New test.
+ * testfile-stridex.bz2: New testfile.
+ * Makefile.am (TESTS): Add run-exprlocs.sh.
+ (EXTRA_DIST): Add run-exprlocs.sh and testfile-stridex.bz2.
+ * varlocs.c (dwarf_tag_string): New function.
+ (dwarf_attr_string): Likewise.
+ (dwarf_form_string): Likewise.
+ (print_expr): Fix typo in error message.r
+ Handle DW_OP_GNU_variable_value.
+ (attr_arg): New struct.
+ (handle_attr): New function.
+ (handle_die): Likewise.
+ (main): Handle --exprlocs argument. Call handle_die.
+
+2017-10-16 Mark Wielaard <mark@klomp.org>
+
+ * md5-sha1-test.c: Removed.
+ * Makefile.am (check_PROGRAMS): Remove md5-sha1-test.
+ (TESTS): Likewise.
+ (md5_sha1_test_LDADD): Removed.
+
+2017-10-04 Mark Wielaard <mark@klomp.org>
+
+ * msg_tst.c: Handle ELF_E_INVALID_ELF.
+
+2017-09-10 Mark Wielaard <mark@klomp.org>
+
+ * run-ar.sh: New test.
+ * Makefile.am (TESTS): Add run-ar.sh.
+ (EXTRA_DIST): Likewise.
+
+2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
+
+ * Makefile.am: Drop -rdynamic from deleted_lib_so_LDFLAGS.
+
+2017-04-27 Ulf Hermann <ulf.hermann@qt.io>
+
+ * Makefile.am: Use fpie_CFLAGS and fpic_CFLAGS.
+
+2017-08-08 Dmitry V. Levin <ldv@altlinux.org>
+
+ * run-strip-nothing.sh: Add -s.
+
+2017-07-26 Mark Wielaard <mark@klomp.org>
+
+ * dwarf-getmacros.c (mac): Use DW_MACRO names instead of DW_MACRO_GNU.
+
+2016-10-27 Mark Wielaard <mjw@redhat.com>
+
+ * dwarf_default_lower_bound.c: New test.
+ * Makefile.am (check_PROGRAMS): Add dwarf_default_lower_bound.
+ (TESTS): Likewise.
+ (dwarf_default_lower_bound_LDADD): New variable.
+
+2017-07-21 Mark Wielaard <mark@klomp.org>
+
+ * get-lines.c (main): Add dwarf_line_file test.
+
+2017-07-19 Gustavo Romero <gromero@linux.vnet.ibm.com>
+
+ * run-addrcfi.sh: Update generic SPRs names to HTM SPRs names
+ * run-allregs.sh: Update generic SPRs names to HTM SPRs names
+
+2017-07-20 Mark Wielaard <mark@klomp.org>
+
+ * run-strip-g.sh: New test.
+ * Makefile.am (TESTS): Add run-strip-g.sh.
+ (EXTRA_DIST): Likewise.
+
+2017-07-18 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (TESTS): Always add run-disasm-bpf.sh if HAVE_LIBASM.
+
+2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
+
+ * elfshphehdr.c: For writing, use /dev/null rather than /dev/zero.
+
+2017-07-14 Mark Wielaard <mark@klomp.org>
+
+ * run-strip-remove-keep.sh: New test.
+ * Makefile.am (TESTS): Add run-strip-remove-keep.sh.
+ (EXTRA_DIST): Likewise.
+
+2017-06-07 Mark Wielaard <mark@klomp.org>
+
+ * run-strip-nothing.sh: New test.
+ * Makefile.am (TESTS): Add run-strip-nothing.sh.
+ (EXTRA_DIST): Likewise.
+
+2017-06-06 Mark Wielaard <mark@klomp.org>
+
+ * run-strip-test.sh: Test strip -g doesn't introduce extra .shstrtab.
+
+2017-05-30 Mark Wielaard <mark@klomp.org>
+
+ * run-backtrace-fp-core-ppc64le.sh: New test.
+ * backtrace.ppc64le.fp.core.bz2: New test file.
+ * backtrace.ppc64le.fp.exec.bz2: New testfile.
+ * backtrace-subr.sh (check_backtracegen): Accept '(null)'.
+ * Makefile.am (TESTS): Add run-backtrace-fp-core-ppc64le.sh.
+ (EXTRA_DIST): Add run-backtrace-fp-core-ppc64le.sh,
+ backtrace.ppc64le.fp.core.bz2 and backtrace.ppc64le.fp.exec.bz2.
+
+2017-02-13 Ulf Hermann <ulf.hermann@qt.io>
+ Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am: Add test for unwinding with frame pointers on aarch64
+ * backtrace.aarch64.fp.core.bz2: New file
+ * backtrace.aarch64.fp.exec.bz2: New file
+ * run-backtrace-fp-core-aarch64.sh: New file
+ * backtrace-subr.sh (check_err): Allow Invalid register.
+ * backtrace.c (callback_verify): Allow duplicate_sigusr2 frames.
+
+2017-04-06 Mark Wielaard <mark@klomp.org>
+
+ * run-backtrace-fp-core-i386.sh: New test.
+ * backtrace.i386.fp.core.bz2: New test file.
+ * backtrace.i386.fp.exec.bz2: New testfile.
+ * Makefile.am (TESTS): Add run-backtrace-fp-core-i386.sh.
+ (EXTRA_DIST): Add run-backtrace-fp-core-i386.sh,
+ backtrace.i386.fp.core.bz2 and backtrace.i386.fp.exec.bz2.
+
+2017-02-09 Ulf Hermann <ulf.hermann@qt.io>
+
+ * Makefile.am: Add test for unwinding with frame pointers on x86_64
+ * backtrace.x86_64.fp.core.bz2: New file
+ * backtrace.x86_64.fp.exec.bz2: New file
+ * run-backtrace-fp-core-x86_64.sh: New file
+
+2017-04-25 Mark Wielaard <mark@klomp.org>
+
+ * backtrace-subr.sh (check_backtracegen): New function.
+ (check_core): Add check_backtracegen call.
+ * backtrace.ppc.exec.bz2: Regenerated.
+ * backtrace.ppc.core.bz2: Likewise.
+
+2017-04-24 Mark Wielaard <mark@klomp.org>
+
+ * backtrace.c: Remove option to allow unknown symbols in the trace.
+ * backtrace-substr.sh: Remove option to allow unknown symbols
+ to check_core() and allow failed symbol lookups in check_err().
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * run-readelf-dwz-multi.sh: Expect readelf to output "yes" for flags
+ that are set.
+ * run-readelf-zdebug-rel.sh: Likewise.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * backtrace-child.c: Include sys/ptrace.h only on linux.
+ * backtrace-dwarf.c: Likewise.
+
+2017-04-05 Mark Wielaard <mark@klomp.org>
+
+ * test-subr.sh (testrun_on_self_compressed): New function.
+ * run-elflint-self.sh: Call testrun_on_self_compressed.
+ * run-elflint-test.sh: Add testfile42z and testfile-s390x-hash-bothz.
+
+2017-03-30 Mark Wielaard <mark@klomp.org>
+
+ * peel_type.c: New file.
+ * run-peel-type.sh: New test.
+ * Makefile.am (check_PROGRAMS): Add peel_type.c.
+ (TESTS): Add run-peel-type.sh.
+ (EXTRA_DIST): Likewise.
+ (peel_type_LDADD): New variable.
+
+2017-03-27 Mark Wielaard <mark@klomp.org>
+
+ * fillfile.c: New file.
+ * Makefile.am (check_PROGRAMS): Add fillfile.
+ (TESTS): Likewise.
+ (fillfile_LDADD): New variable.
+
+2017-02-15 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (EXTRA_DIST): Add testfileppc64attrs.o.bz2.
+ * run-readelf-A.sh: Add testfileppc64.o test.
+
+2017-02-15 Ulf Hermann <ulf.hermann@qt.io>
+
+ * elfstrmerge.c: Include system.h.
+
+2017-02-09 Ulf Hermann <ulf.hermann@qt.io>
+
+ * backtrace.c: Add an option to allow unknown symbols in the trace
+ * backtrace-substr.sh: Add an option to allow unknown symbols
+ to check_core() and allow failed symbol lookups in check_err()
+
+2017-02-09 Ulf Hermann <ulf.hermann@qt.io>
+
+ * backtrace-data.c: Don't assert that symbols are found.
+ The unwinder is allowed to ask for invalid addresses. We deny
+ such requests, rather than make the test fail.
+
+2016-11-17 Mark Wielaard <mjw@redhat.com>
+
+ * run-readelf-s.sh: Add --symbols=.dynsym and --symbols=.symtab tests.
+
+2016-11-02 Mark Wielaard <mjw@redhat.com>
+
+ * backtrace-data.c (thread_callback): Add explicit break after error.
+ * backtrace.c (callback_verify): Change PASSTHRU to FALLTHRU.
+
+2016-10-22 Kevin Cernekee <cernekee@chromium.org>
+
+ * Makefile.am (TESTS): Add run-unstrip-test4.sh.
+ (EXTRA_DIST): Add run-unstrip-test4.sh, testfile-strtab.bz2,
+ testfile-strtab.stripped.bz2, testfile-strtab.debuginfo.bz2.
+ (run-unstrip-test4.sh): New file.
+ (testfile-strtab.bz2): New file.
+ (testfile-strtab.stripped.bz2): New file.
+ (testfile-strtab.debuginfo.bz2): New file.
+
+2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+
+ * arextract.c: Remove sys/param.h include, add system.h include.
+
+2016-08-30 Mark Wielaard <mjw@redhat.com>
+
+ * Makefile.am (asm_tst?_LDADD): Add libdw.
+
+2016-08-25 Mark Wielaard <mjw@redhat.com>
+
+ * backtrace-child.c: Disable and add documentation about why we disable
+ RAISE_JMP_PATCHING even on x86_64.
+ * backtrace.c (is_x86_64_native): Rename to...
+ (use_raise_jmp_patching): ... this.
+ (callback_verify): Use use_raise_jmp_patching instead of
+ is_x86_64_native.
+ (see_exec_module): Return DWARF_CB_ABORT after finding the correct exe
+ path.
+ (prepare_thread): Use RAISE_JMP_PATCHING instead of __x86_64__
+ conditional.
+ (exec_dump): Only assert on data.mod != NULL. Drop ptrdiff. Use
+ RAISE_JMP_PATCHING instead of __x86_64__ conditional. Use
+ use_raise_jmp_patching instead of is_x86_64_native.
+
+2016-08-24 Mark Wielaard <mjw@redhat.com>
+
+ * Makefile.am (EXTRA_DIST): Add testfilesparc64attrs.o.bz2.
+
+2016-08-09 Jose E. Marchesi <jose.marchesi@oracle.com>
+
+ * testfilesparc64attrs.o.bz2: New file.
+ * run-readelf-A.sh: Check attributes in a sparc object.
+
+2016-08-06 Mark Wielaard <mjw@redhat.com>
+
+ * run-strip-reloc.sh: Add explicit compressed and uncompressed
+ test cases.
+
+2016-08-10 Richard Henderson <rth@redhat.com>
+
+ * file-bpf-dis1.expect.bz2: Fix expected mod and endian operations
+ output.
+
+2016-07-08 Mark Wielaard <mjw@redhat.com>
+
+ * update3_LDADD: Use libdw instead of libebl.
+ * update4_LDADD: Likewise.
+ * alldts_LDADD: Likewise.
+ * elfstrmerge_LDADD: Likewise.
+ * alldts.c (main): Use dwelf_strtab instead of ebl_strtab.
+ * elfstrmerge.c (release): Likewise.
+ (main): Likewise.
+ * update3.c (main): Likewise.
+ * update4.c (main): Likewise.
+
+2016-07-10 Andreas Schwab <schwab@linux-m68k.org>
+
+ * Makefile.am (TESTS): Add run-strip-test11.sh.
+ (EXTRA_DIST): Add run-strip-test11.sh, hello_m68k.ko.bz2,
+ testfile-m86k-core.bz2, testfile-m68k.bz2, testfile-m68k-s.bz2.
+ (run-strip-test11.sh): New file.
+ (hello_m68k.ko.bz2): New file.
+ (testfile-m68k-core.bz2): New file.
+ (testfile-m68k.bz2): New file.
+ (testfile-m68k-s.bz2): New file.
+ * run-allregs.sh: Add test for testfile-m68k-core.
+ * run-readelf-mixed-corenote.sh: Likewise.
+ * run-strip-reloc.sh: Add test for hello_m68k.ko.
+
+2016-07-06 Mark Wielaard <mjw@redhat.com>
+
+ * Makefile.am (check_PROGRAMS): Add vendorelf.
+ (TESTS): Likewise.
+ (vendorelf_LDADD): New variable.
+ * vendorelf.c: New test.
+ * elfshphehdr.c (test): Check elf_getphdrnum succeeds.
+
+2016-06-24 Mark Wielaard <mjw@redhat.com>
+
+ * Makefile.am (check_PROGRAMS): Add emptyfile.
+ (TESTS): Likewise.
+ (emptyfile_LDADD): New variable.
+ * emptyfile.c: New test.
+
+2016-06-28 Richard Henderson <rth@redhat.com>
+
+ * Makefile.am (TESTS): Add run-disasm-bpf.sh, conditionally.
+ (EXTRA_DIST): Add run-disasm-bpf.sh, testfile-bpf-dis1.expect.bz2,
+ testfile-bpf-dis1.o.bz2
+ (run-disasm-bpf.sh): New file.
+ (testfile-bpf-dis1.expect.bz2): New file.
+ (testfile-bpf-dis1.o.bz2): New file.
+
+2016-02-09 Mark Wielaard <mjw@redhat.com>
+
+ * testfile-s390x-hash-both.bz2: New testfile.
+ * Makefile.am (EXTRA_DIST): Add testfile-s390x-hash-both.bz2.
+ * run-elflint-test.sh: Add elflint testfile-s390x-hash-both test.
+
+2016-02-04 Mark Wielaard <mjw@redhat.com>
+
+ * run-strip-nobitsalign.sh: New test.
+ * testfile-nobitsalign.bz2: New testfile.
+ * testfile-nobitsalign.strip.bz2: Likewise.
+ * Makefile.am (TESTS): Add run-strip-nobitsalign.sh.
+ (EXTRA_DIST): Add run-strip-nobitsalign.sh, testfile-nobitsalign.bz2
+ and testfile-nobitsalign.strip.bz2.
+ * run-strip-test.sh: Add --gnu to elflint calls.
+
2016-01-13 Mark Wielaard <mjw@redhat.com>
* dwfl-bug-fd-leak.c: Skip test unless on __linux__.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7b9e108..ecc2d68 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to create Makefile.in
##
-## Copyright (C) 1996-2015 Red Hat, Inc.
+## Copyright (C) 1996-2018 Red Hat, Inc.
## This file is part of elfutils.
##
## This file is free software; you can redistribute it and/or modify
@@ -38,22 +38,28 @@
check_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \
showptable update1 update2 update3 update4 test-nlist \
- show-die-info get-files get-lines get-pubnames \
+ show-die-info get-files next-files get-lines next-lines \
+ get-pubnames \
get-aranges allfcts line2addr addrscopes funcscopes \
show-abbrev hash newscn ecp dwflmodtest \
find-prologues funcretval allregs rdwrmmap \
dwfl-bug-addr-overflow arls dwfl-bug-fd-leak \
dwfl-addr-sect dwfl-bug-report early-offscn \
dwfl-bug-getmodules dwarf-getmacros dwarf-ranges addrcfi \
+ dwarfcfi \
test-flag-nobits dwarf-getstring rerequest_tag \
- alldts md5-sha1-test typeiter typeiter2 low_high_pc \
+ alldts typeiter typeiter2 low_high_pc \
test-elf_cntl_gelf_getshdr dwflsyms dwfllines \
dwfl-report-elf-align varlocs backtrace backtrace-child \
backtrace-data backtrace-dwarf debuglink debugaltlink \
- buildid deleted deleted-lib.so aggregate_size vdsosyms \
+ buildid deleted deleted-lib.so aggregate_size peel_type \
+ vdsosyms \
getsrc_die strptr newdata elfstrtab dwfl-proc-attach \
elfshphehdr elfstrmerge dwelfgnucompressed elfgetchdr \
- elfgetzdata elfputzdata zstrptr
+ elfgetzdata elfputzdata zstrptr emptyfile vendorelf \
+ fillfile dwarf_default_lower_bound dwarf-die-addr-die \
+ get-units-invalid get-units-split attr-integrate-skel \
+ all-dwarf-ranges unit-info next_cfi
asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \
asm-tst6 asm-tst7 asm-tst8 asm-tst9
@@ -70,27 +76,33 @@
$(AM_LDFLAGS) $(LDFLAGS) $(backtrace_child_LDFLAGS) \
-o $@ $<
-TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \
+TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile test-nlist \
update1 update2 update3 update4 \
run-show-die-info.sh run-get-files.sh run-get-lines.sh \
+ run-next-files.sh run-next-lines.sh \
run-get-pubnames.sh run-get-aranges.sh run-allfcts.sh \
run-show-abbrev.sh run-line2addr.sh hash \
newscn run-strip-test.sh run-strip-test2.sh \
run-strip-test3.sh run-strip-test4.sh run-strip-test5.sh \
run-strip-test6.sh run-strip-test7.sh run-strip-test8.sh \
- run-strip-test9.sh run-strip-test10.sh \
+ run-strip-test9.sh run-strip-test10.sh run-strip-test11.sh \
+ run-strip-nothing.sh run-strip-g.sh \
run-strip-groups.sh run-strip-reloc.sh run-strip-strmerge.sh \
- run-unstrip-test.sh run-unstrip-test2.sh \
- run-unstrip-test3.sh run-unstrip-M.sh run-elfstrmerge-test.sh \
+ run-strip-nobitsalign.sh run-strip-remove-keep.sh \
+ run-unstrip-test.sh run-unstrip-test2.sh run-unstrip-test3.sh \
+ run-unstrip-test4.sh run-unstrip-M.sh run-elfstrmerge-test.sh \
run-ecp-test.sh run-ecp-test2.sh run-alldts.sh \
run-elflint-test.sh run-elflint-self.sh run-ranlib-test.sh \
run-ranlib-test2.sh run-ranlib-test3.sh run-ranlib-test4.sh \
run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \
run-find-prologues.sh run-allregs.sh run-addrcfi.sh \
- run-nm-self.sh run-readelf-self.sh \
+ run-dwarfcfi.sh \
+ run-nm-self.sh run-readelf-self.sh run-readelf-info-plus.sh \
+ run-readelf-const-values.sh \
+ run-varlocs-self.sh run-exprlocs-self.sh \
run-readelf-test1.sh run-readelf-test2.sh run-readelf-test3.sh \
run-readelf-test4.sh run-readelf-twofiles.sh \
- run-readelf-macro.sh run-readelf-loc.sh \
+ run-readelf-macro.sh run-readelf-loc.sh run-readelf-ranges.sh \
run-readelf-aranges.sh run-readelf-line.sh run-readelf-z.sh \
run-native-test.sh run-bug1-test.sh \
run-debuglink.sh run-debugaltlink.sh run-buildid.sh \
@@ -105,27 +117,42 @@
run-low_high_pc.sh run-macro-test.sh run-elf_cntl_gelf_getshdr.sh \
run-test-archive64.sh run-readelf-vmcoreinfo.sh \
run-readelf-mixed-corenote.sh run-dwfllines.sh \
+ run-readelf-variant.sh \
run-dwfl-report-elf-align.sh run-addr2line-test.sh \
run-addr2line-i-test.sh run-addr2line-i-lex-test.sh \
run-addr2line-i-demangle-test.sh run-addr2line-alt-debugpath.sh \
- run-varlocs.sh run-funcretval.sh \
+ run-varlocs.sh run-exprlocs.sh run-funcretval.sh \
run-backtrace-native.sh run-backtrace-data.sh run-backtrace-dwarf.sh \
run-backtrace-native-biarch.sh run-backtrace-native-core.sh \
run-backtrace-native-core-biarch.sh run-backtrace-core-x86_64.sh \
+ run-backtrace-fp-core-x86_64.sh \
+ run-backtrace-fp-core-aarch64.sh \
+ run-backtrace-fp-core-ppc64le.sh \
run-backtrace-core-x32.sh \
- run-backtrace-core-i386.sh run-backtrace-core-ppc.sh \
+ run-backtrace-core-i386.sh run-backtrace-fp-core-i386.sh \
+ run-backtrace-core-ppc.sh \
run-backtrace-core-s390x.sh run-backtrace-core-s390.sh \
run-backtrace-core-aarch64.sh run-backtrace-core-sparc.sh \
run-backtrace-demangle.sh run-stack-d-test.sh run-stack-i-test.sh \
run-stack-demangled-test.sh run-readelf-zx.sh run-readelf-zp.sh \
+ run-readelf-addr.sh run-readelf-str.sh \
+ run-readelf-types.sh \
run-readelf-dwz-multi.sh run-allfcts-multi.sh run-deleted.sh \
- run-linkmap-cut.sh run-aggregate-size.sh vdsosyms run-readelf-A.sh \
+ run-linkmap-cut.sh run-aggregate-size.sh run-peel-type.sh \
+ vdsosyms run-readelf-A.sh \
run-getsrc-die.sh run-strptr.sh newdata elfstrtab dwfl-proc-attach \
elfshphehdr run-lfs-symbols.sh run-dwelfgnucompressed.sh \
run-elfgetchdr.sh \
run-elfgetzdata.sh run-elfputzdata.sh run-zstrptr.sh \
run-compress-test.sh \
- run-readelf-zdebug.sh run-readelf-zdebug-rel.sh
+ run-readelf-zdebug.sh run-readelf-zdebug-rel.sh \
+ emptyfile vendorelf fillfile dwarf_default_lower_bound \
+ run-dwarf-die-addr-die.sh \
+ run-get-units-invalid.sh run-get-units-split.sh \
+ run-attr-integrate-skel.sh \
+ run-all-dwarf-ranges.sh run-unit-info.sh \
+ run-reloc-bpf.sh \
+ run-next-cfi.sh run-next-cfi-self.sh
if !BIARCH
export ELFUTILS_DISABLE_BIARCH = 1
@@ -136,8 +163,8 @@
endif
if !STANDALONE
-check_PROGRAMS += msg_tst md5-sha1-test system-elf-libelf-test
-TESTS += msg_tst md5-sha1-test system-elf-libelf-test
+check_PROGRAMS += msg_tst system-elf-libelf-test
+TESTS += msg_tst system-elf-libelf-test
endif
if LZMA
@@ -146,11 +173,12 @@
if HAVE_LIBASM
check_PROGRAMS += $(asm_TESTS)
-TESTS += $(asm_TESTS)
+TESTS += $(asm_TESTS) run-disasm-bpf.sh
endif
-EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
+EXTRA_DIST = run-arextract.sh run-arsymtest.sh run-ar.sh \
run-show-die-info.sh run-get-files.sh run-get-lines.sh \
+ run-next-files.sh run-next-lines.sh testfile-only-debug-line.bz2 \
run-get-pubnames.sh run-get-aranges.sh \
run-show-abbrev.sh run-strip-test.sh \
run-strip-test2.sh run-ecp-test.sh run-ecp-test2.sh \
@@ -162,22 +190,37 @@
run-line2addr.sh run-elflint-test.sh testfile14.bz2 \
run-strip-test4.sh run-strip-test5.sh run-strip-test6.sh \
run-strip-test7.sh run-strip-test8.sh run-strip-groups.sh \
- run-strip-test9.sh run-strip-test10.sh run-strip-strmerge.sh \
+ run-strip-test9.sh run-strip-test10.sh run-strip-test11.sh \
+ run-strip-nothing.sh run-strip-remove-keep.sh run-strip-g.sh \
+ run-strip-strmerge.sh run-strip-nobitsalign.sh \
+ testfile-nobitsalign.bz2 testfile-nobitsalign.strip.bz2 \
run-strip-reloc.sh hello_i386.ko.bz2 hello_x86_64.ko.bz2 \
hello_ppc64.ko.bz2 hello_s390.ko.bz2 hello_aarch64.ko.bz2 \
+ hello_m68k.ko.bz2 hello_riscv64.ko.bz2 \
run-unstrip-test.sh run-unstrip-test2.sh \
testfile-info-link.bz2 testfile-info-link.debuginfo.bz2 \
testfile-info-link.stripped.bz2 run-unstrip-test3.sh \
+ run-unstrip-test4.sh testfile-strtab.bz2 \
+ testfile-strtab.stripped.bz2 testfile-strtab.debuginfo.bz2 \
run-unstrip-M.sh run-elfstrmerge-test.sh \
run-elflint-self.sh run-ranlib-test.sh run-ranlib-test2.sh \
run-ranlib-test3.sh run-ranlib-test4.sh \
run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \
- run-nm-self.sh run-readelf-self.sh run-addrcfi.sh \
+ run-nm-self.sh run-readelf-self.sh run-readelf-info-plus.sh \
+ run-readelf-const-values.sh testfile-const-values.debug.bz2 \
+ run-addrcfi.sh run-dwarfcfi.sh \
+ testfile11-debugframe.bz2 testfile12-debugframe.bz2 \
+ testfileaarch64-debugframe.bz2 testfilearm-debugframe.bz2 \
+ testfileppc32-debugframe.bz2 testfileppc64-debugframe.bz2 \
+ run-varlocs-self.sh run-exprlocs-self.sh \
run-find-prologues.sh run-allregs.sh run-native-test.sh \
run-addrname-test.sh run-dwfl-bug-offline-rel.sh \
run-dwfl-addr-sect.sh run-early-offscn.sh \
run-dwarf-getmacros.sh \
run-dwarf-ranges.sh debug-ranges-no-lowpc.o.bz2 \
+ testfileranges4.debug.bz2 testfileranges5.debug.bz2 \
+ testfilesplitranges5.debug.bz2 \
+ testfile-ranges-hello5.dwo.bz2 testfile-ranges-world5.dwo.bz2 \
run-test-flag-nobits.sh \
run-dwarf-getstring.sh run-rerequest_tag.sh run-alldts.sh \
testfile15.bz2 testfile15.debug.bz2 \
@@ -208,11 +251,19 @@
testfile-macros-0xff.bz2 \
run-readelf-macro.sh testfilemacro.bz2 \
run-readelf-loc.sh testfileloc.bz2 \
+ splitdwarf4-not-split4.dwo.bz2 \
+ testfile-splitdwarf4-not-split4.debug.bz2 \
+ run-readelf-ranges.sh \
run-readelf-aranges.sh run-readelf-line.sh testfilefoobarbaz.bz2 \
+ testfile-ppc64-min-instr.bz2 \
+ testfile-dwarf-45.source \
+ testfile-dwarf-4.bz2 testfile-dwarf-5.bz2 \
run-readelf-z.sh \
run-readelf-dwz-multi.sh libtestfile_multi_shared.so.bz2 \
testfile_multi.dwz.bz2 testfile_multi_main.bz2 \
testfile-dwzstr.bz2 testfile-dwzstr.multi.bz2 \
+ run-readelf-addr.sh run-readelf-str.sh \
+ run-readelf-types.sh \
run-allfcts-multi.sh \
test-offset-loop.bz2 test-offset-loop.alt.bz2 \
run-prelink-addr-test.sh \
@@ -233,6 +284,7 @@
testfile56.bz2 testfile57.bz2 testfile58.bz2 \
run-typeiter.sh testfile59.bz2 \
run-readelf-d.sh testlib_dynseg.so.bz2 \
+ testfile-s390x-hash-both.bz2 \
run-readelf-gdb_index.sh testfilegdbindex5.bz2 \
testfilegdbindex7.bz2 \
run-readelf-s.sh testfilebazdbg.bz2 testfilebazdyn.bz2 \
@@ -245,6 +297,7 @@
testfilebazdynppc64.bz2 testfilebazmdbppc64.bz2 \
testfilebazminppc64.bz2 testfilebazminppc64_pl.bz2 \
testfilebazminppc64_plr.bz2 testfilebaztabppc64.bz2 \
+ run-readelf-variant.sh testfile-ada-variant.bz2 \
run-dwflsyms.sh \
run-unstrip-n.sh testcore-rtlib.bz2 testcore-rtlib-ppc.bz2 \
run-low_high_pc.sh testfile_low_high_pc.bz2 \
@@ -267,21 +320,31 @@
testfileppc32.bz2 testfileppc64.bz2 \
testfiles390.bz2 testfiles390x.bz2 \
testfilearm.bz2 testfileaarch64.bz2 \
- run-varlocs.sh \
+ run-varlocs.sh run-exprlocs.sh testfile-stridex.bz2 \
testfile_const_type.c testfile_const_type.bz2 \
testfile_implicit_pointer.c testfile_implicit_pointer.bz2 \
testfile_parameter_ref.c testfile_parameter_ref.bz2 \
testfile_entry_value.c testfile_entry_value.bz2 \
testfile_implicit_value.c testfile_implicit_value.bz2 \
testfile_aarch64_core.bz2 testfile_i686_core.bz2 \
+ addrx_constx-4.dwo.bz2 addrx_constx-5.dwo.bz2 \
+ testfile-addrx_constx-4.bz2 testfile-addrx_constx-5.bz2 \
run-funcretval.sh funcretval_test.c funcretval_test_aarch64.bz2 \
run-backtrace-data.sh run-backtrace-dwarf.sh cleanup-13.c \
run-backtrace-native.sh run-backtrace-native-biarch.sh \
run-backtrace-native-core.sh run-backtrace-native-core-biarch.sh \
run-backtrace-core-x86_64.sh run-backtrace-core-i386.sh \
+ run-backtrace-fp-core-x86_64.sh \
run-backtrace-core-x32.sh \
+ run-backtrace-fp-core-aarch64.sh \
+ backtrace.aarch64.fp.core.bz2 backtrace.aarch64.fp.exec.bz2 \
backtrace-subr.sh backtrace.i386.core.bz2 backtrace.i386.exec.bz2 \
+ run-backtrace-fp-core-i386.sh \
+ backtrace.i386.fp.core.bz2 backtrace.i386.fp.exec.bz2 \
+ run-backtrace-fp-core-ppc64le.sh \
+ backtrace.ppc64le.fp.core.bz2 backtrace.ppc64le.fp.exec.bz2 \
backtrace.x86_64.core.bz2 backtrace.x86_64.exec.bz2 \
+ backtrace.x86_64.fp.core.bz2 backtrace.x86_64.fp.exec.bz2 \
backtrace.ppc.core.bz2 backtrace.ppc.exec.bz2 \
run-backtrace-core-ppc.sh testfile66.bz2 testfile66.core.bz2 \
backtrace.s390x.core.bz2 backtrace.s390x.exec.bz2 \
@@ -304,8 +367,10 @@
run-deleted.sh run-linkmap-cut.sh linkmap-cut-lib.so.bz2 \
linkmap-cut.bz2 linkmap-cut.core.bz2 \
run-aggregate-size.sh testfile-sizes1.o.bz2 testfile-sizes2.o.bz2 \
- testfile-sizes3.o.bz2 \
+ testfile-sizes3.o.bz2 testfile-sizes4.o.bz2 testfile-sizes4.s \
+ run-peel-type.sh \
run-readelf-A.sh testfileppc32attrs.o.bz2 \
+ testfilesparc64attrs.o.bz2 testfileppc64attrs.o.bz2 \
testfile-debug-types.bz2 \
run-getsrc-die.sh run-strptr.sh \
testfile-x32-core.bz2 testfile-x32.bz2 \
@@ -318,7 +383,21 @@
testfile-zgabi32.bz2 testfile-zgabi64.bz2 \
testfile-zgabi32be.bz2 testfile-zgabi64be.bz2 \
run-elfgetchdr.sh run-elfgetzdata.sh run-elfputzdata.sh \
- run-zstrptr.sh run-compress-test.sh
+ run-zstrptr.sh run-compress-test.sh \
+ run-disasm-bpf.sh \
+ testfile-bpf-dis1.expect.bz2 testfile-bpf-dis1.o.bz2 \
+ run-reloc-bpf.sh \
+ testfile-bpf-reloc.expect.bz2 testfile-bpf-reloc.o.bz2 \
+ testfile-m68k-core.bz2 testfile-m68k.bz2 testfile-m68k-s.bz2 \
+ run-dwarf-die-addr-die.sh \
+ run-get-units-invalid.sh run-get-units-split.sh \
+ testfile-hello4.dwo.bz2 testfile-hello5.dwo.bz2 \
+ testfile-splitdwarf-4.bz2 testfile-splitdwarf-5.bz2 \
+ testfile-world5.dwo.bz2 testfile-world4.dwo.bz2 \
+ run-attr-integrate-skel.sh \
+ run-all-dwarf-ranges.sh testfilesplitranges4.debug.bz2 \
+ testfile-ranges-hello.dwo.bz2 testfile-ranges-world.dwo.bz2 \
+ run-unit-info.sh run-next-cfi.sh run-next-cfi-self.sh
if USE_VALGRIND
valgrind_cmd='valgrind -q --leak-check=full --error-exitcode=1'
@@ -394,13 +473,15 @@
ecp_LDADD = $(libelf)
update1_LDADD = $(libelf)
update2_LDADD = $(libelf)
-update3_LDADD = $(libebl) $(libelf)
-update4_LDADD = $(libebl) $(libelf)
+update3_LDADD = $(libdw) $(libelf)
+update4_LDADD = $(libdw) $(libelf)
show_die_info_LDADD = $(libdw) $(libelf)
get_pubnames_LDADD = $(libdw) $(libelf)
show_abbrev_LDADD = $(libdw) $(libelf)
get_lines_LDADD = $(libdw) $(libelf)
+next_lines_LDADD = $(libdw) $(libelf)
get_files_LDADD = $(libdw) $(libelf)
+next_files_LDADD = $(libdw) $(libelf)
get_aranges_LDADD = $(libdw) $(libelf)
allfcts_LDADD = $(libdw) $(libelf)
line2addr_LDADD = $(libdw) $(argp_LDADD)
@@ -410,15 +491,15 @@
allregs_LDADD = $(libdw) $(argp_LDADD)
find_prologues_LDADD = $(libdw) $(argp_LDADD)
#show_ciefde_LDADD = ../libdwarf/libdwarf.so $(libelf)
-asm_tst1_LDADD = $(libasm) $(libebl) $(libelf) -ldl
-asm_tst2_LDADD = $(libasm) $(libebl) $(libelf) -ldl
-asm_tst3_LDADD = $(libasm) $(libebl) $(libelf) -ldl
-asm_tst4_LDADD = $(libasm) $(libebl) $(libelf) -ldl
-asm_tst5_LDADD = $(libasm) $(libebl) $(libelf) -ldl
-asm_tst6_LDADD = $(libasm) $(libebl) $(libelf) -ldl
-asm_tst7_LDADD = $(libasm) $(libebl) $(libelf) -ldl
-asm_tst8_LDADD = $(libasm) $(libebl) $(libelf) -ldl
-asm_tst9_LDADD = $(libasm) $(libebl) $(libelf) -ldl
+asm_tst1_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) -ldl
+asm_tst2_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) -ldl
+asm_tst3_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) -ldl
+asm_tst4_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) -ldl
+asm_tst5_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) -ldl
+asm_tst6_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) -ldl
+asm_tst7_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) -ldl
+asm_tst8_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) -ldl
+asm_tst9_LDADD = $(libasm) $(libebl) $(libelf) $(libdw) -ldl
dwflmodtest_LDADD = $(libdw) $(libebl) $(libelf) $(argp_LDADD) -ldl
rdwrmmap_LDADD = $(libelf)
dwfl_bug_addr_overflow_LDADD = $(libdw) $(libebl) $(libelf) -ldl
@@ -431,10 +512,10 @@
dwarf_ranges_LDADD = $(libdw)
dwarf_getstring_LDADD = $(libdw)
addrcfi_LDADD = $(libdw) $(libebl) $(libelf) $(argp_LDADD) -ldl
+dwarfcfi_LDADD = $(libdw) $(libelf)
test_flag_nobits_LDADD = $(libelf)
rerequest_tag_LDADD = $(libdw)
-alldts_LDADD = $(libebl) $(libelf)
-md5_sha1_test_LDADD = $(libeu)
+alldts_LDADD = $(libdw) $(libelf)
typeiter_LDADD = $(libdw) $(libelf)
typeiter2_LDADD = $(libdw) $(libelf)
low_high_pc_LDADD = $(libdw) $(libelf) $(argp_LDADD)
@@ -445,7 +526,7 @@
varlocs_LDADD = $(libdw) $(libelf) $(argp_LDADD)
backtrace_LDADD = $(libdw) $(libelf) $(argp_LDADD)
# backtrace-child-biarch also uses those *_CFLAGS and *_LDLAGS variables:
-backtrace_child_CFLAGS = -fPIE
+backtrace_child_CFLAGS = $(fpie_CFLAGS)
backtrace_child_LDFLAGS = -pie -pthread
backtrace_child_biarch_SOURCES = backtrace-child.c
backtrace_data_LDADD = $(libdw) $(libelf)
@@ -455,9 +536,10 @@
debugaltlink_LDADD = $(libdw) $(libelf)
buildid_LDADD = $(libdw) $(libelf)
deleted_LDADD = ./deleted-lib.so
-deleted_lib_so_LDFLAGS = -shared -rdynamic
-deleted_lib_so_CFLAGS = -fPIC -fasynchronous-unwind-tables
+deleted_lib_so_LDFLAGS = -shared
+deleted_lib_so_CFLAGS = $(fpic_CFLAGS) -fasynchronous-unwind-tables
aggregate_size_LDADD = $(libdw) $(libelf) $(argp_LDADD)
+peel_type_LDADD = $(libdw) $(libelf) $(argp_LDADD)
vdsosyms_LDADD = $(libdw) $(libelf)
getsrc_die_LDADD = $(libdw) $(libelf)
strptr_LDADD = $(libelf)
@@ -466,18 +548,32 @@
dwfl_proc_attach_LDADD = $(libdw)
dwfl_proc_attach_LDFLAGS = -pthread $(AM_LDFLAGS)
elfshphehdr_LDADD =$(libelf)
-elfstrmerge_LDADD = $(libebl) $(libelf)
+elfstrmerge_LDADD = $(libdw) $(libelf)
dwelfgnucompressed_LDADD = $(libelf) $(libdw)
elfgetchdr_LDADD = $(libelf) $(libdw)
elfgetzdata_LDADD = $(libelf)
elfputzdata_LDADD = $(libelf)
zstrptr_LDADD = $(libelf)
+emptyfile_LDADD = $(libelf)
+vendorelf_LDADD = $(libelf)
+fillfile_LDADD = $(libelf)
+dwarf_default_lower_bound_LDADD = $(libdw)
+dwarf_die_addr_die_LDADD = $(libdw)
+get_units_invalid_LDADD = $(libdw)
+get_units_split_LDADD = $(libdw)
+attr_integrate_skel_LDADD = $(libdw)
+all_dwarf_ranges_LDADD = $(libdw)
+unit_info_LDADD = $(libdw)
+next_cfi_LDADD = $(libelf) $(libdw)
# We want to test the libelf header against the system elf.h header.
# Don't include any -I CPPFLAGS.
system_elf_libelf_test_CPPFLAGS =
system_elf_libelf_test_LDADD = $(libelf)
+# A lock file used to make sure only one test dumps core at a time
+CLEANFILES += core-dump-backtrace.lock
+
if GCOV
check: check-am coverage
.PHONY: coverage
diff --git a/tests/addrx_constx-4.dwo.bz2 b/tests/addrx_constx-4.dwo.bz2
new file mode 100644
index 0000000..f0bae1c
--- /dev/null
+++ b/tests/addrx_constx-4.dwo.bz2
Binary files differ
diff --git a/tests/addrx_constx-5.dwo.bz2 b/tests/addrx_constx-5.dwo.bz2
new file mode 100644
index 0000000..a5f4b1a
--- /dev/null
+++ b/tests/addrx_constx-5.dwo.bz2
Binary files differ
diff --git a/tests/all-dwarf-ranges.c b/tests/all-dwarf-ranges.c
new file mode 100644
index 0000000..4331a05
--- /dev/null
+++ b/tests/all-dwarf-ranges.c
@@ -0,0 +1,90 @@
+/* Test program for dwarf_ranges
+ Copyright (C) 2015, 2018 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/>. */
+
+#include <config.h>
+#include ELFUTILS_HEADER(dw)
+#include <dwarf.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <inttypes.h>
+
+static void
+ranges_die (Dwarf_Die *die)
+{
+ Dwarf_Addr base, start, end;
+ int ranges = dwarf_ranges (die, 0, &base, &start, &end);
+ if (ranges < 0)
+ puts (dwarf_errmsg (-1));
+ else if (ranges > 0)
+ {
+ printf ("die: %s (%x)\n", dwarf_diename (die) ?: "<unknown>",
+ dwarf_tag (die));
+ for (ptrdiff_t off = 0;
+ (off = dwarf_ranges (die, off, &base, &start, &end)); )
+ if (off == -1)
+ {
+ puts (dwarf_errmsg (-1));
+ break;
+ }
+ else
+ printf (" %"PRIx64"..%"PRIx64"\n", start, end);
+ printf ("\n");
+ }
+}
+
+static void
+walk_tree (Dwarf_Die *dwarf_die)
+{
+ Dwarf_Die die = *dwarf_die;
+ do
+ {
+ Dwarf_Die child;
+ ranges_die (&die);
+ if (dwarf_child (&die, &child) == 0)
+ walk_tree (&child);
+ }
+ while (dwarf_siblingof (&die, &die) == 0);
+}
+
+int
+main (int argc, char *argv[])
+{
+ assert (argc >= 2);
+ const char *name = argv[1];
+
+ int fd = open (name, O_RDONLY);
+ Dwarf *dbg = dwarf_begin (fd, DWARF_C_READ);
+
+ Dwarf_CU *cu = NULL;
+ Dwarf_Die cudie, subdie;
+ uint8_t unit_type;
+ while (dwarf_get_units (dbg, cu, &cu, NULL,
+ &unit_type, &cudie, &subdie) == 0)
+ {
+ Dwarf_Die die = (unit_type == DW_UT_skeleton
+ ? subdie : cudie);
+ walk_tree (&die);
+ }
+ dwarf_end (dbg);
+
+ return 0;
+}
diff --git a/tests/alldts.c b/tests/alldts.c
index eaecaf5..28b3063 100644
--- a/tests/alldts.c
+++ b/tests/alldts.c
@@ -1,5 +1,5 @@
/* Create an ELF file with all the DT_* flags set.
- Copyright (C) 2011 Red Hat, Inc.
+ Copyright (C) 2011, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Marek Polacek <mpolacek@redhat.com>, 2011.
@@ -20,7 +20,7 @@
# include <config.h>
#endif
-#include ELFUTILS_HEADER(ebl)
+#include ELFUTILS_HEADER(dwelf)
#include <elf.h>
#include <gelf.h>
#include <fcntl.h>
@@ -38,9 +38,9 @@
main (void)
{
static const char fname[] = "testfile-alldts";
- struct Ebl_Strtab *shst;
- struct Ebl_Strent *dynscn;
- struct Ebl_Strent *shstrtabse;
+ Dwelf_Strtab *shst;
+ Dwelf_Strent *dynscn;
+ Dwelf_Strent *shstrtabse;
const Elf32_Sword dtflags[] =
{
DT_NULL, DT_NEEDED, DT_PLTRELSZ, DT_PLTGOT,
@@ -117,7 +117,7 @@
phdr[1].p_type = PT_DYNAMIC;
elf_flagphdr (elf, ELF_C_SET, ELF_F_DIRTY);
- shst = ebl_strtabinit (true);
+ shst = dwelf_strtab_init (true);
/* Create the .dynamic section. */
Elf_Scn *scn = elf_newscn (elf);
@@ -134,7 +134,7 @@
return 1;
}
- dynscn = ebl_strtabadd (shst, ".dynamic", 0);
+ dynscn = dwelf_strtab_add (shst, ".dynamic");
/* We'll need to know the section offset. But this will be set up
by elf_update later, so for now just store the address. */
@@ -191,7 +191,7 @@
return 1;
}
- shstrtabse = ebl_strtabadd (shst, ".shstrtab", 0);
+ shstrtabse = dwelf_strtab_add (shst, ".shstrtab");
shdr->sh_type = SHT_STRTAB;
shdr->sh_flags = 0;
@@ -211,10 +211,10 @@
}
/* No more sections, finalize the section header string table. */
- ebl_strtabfinalize (shst, data);
+ dwelf_strtab_finalize (shst, data);
- elf32_getshdr (elf_getscn (elf, 1))->sh_name = ebl_strtaboffset (dynscn);
- shdr->sh_name = ebl_strtaboffset (shstrtabse);
+ elf32_getshdr (elf_getscn (elf, 1))->sh_name = dwelf_strent_off (dynscn);
+ shdr->sh_name = dwelf_strent_off (shstrtabse);
/* Let the library compute the internal structure information. */
if (elf_update (elf, ELF_C_NULL) < 0)
@@ -251,7 +251,7 @@
}
/* We don't need the string table anymore. */
- ebl_strtabfree (shst);
+ dwelf_strtab_free (shst);
/* And the data allocated in the .shstrtab section. */
free (data->d_buf);
diff --git a/tests/allfcts.c b/tests/allfcts.c
index d3c8d26..f637311 100644
--- a/tests/allfcts.c
+++ b/tests/allfcts.c
@@ -51,7 +51,10 @@
errx (1, "dwelf_dwarf_gnu_debugaltlink: %s", dwarf_errmsg (-1));
int fd = open (alt_name, O_RDONLY);
if (fd < 0)
- err (1, "open (%s)", alt_name);
+ {
+ printf ("Warning: no alt file found.\n");
+ return NULL;
+ }
Dwarf *dbg_alt = dwarf_begin (fd, DWARF_C_READ);
if (dbg_alt == NULL)
errx (1, "dwarf_begin (%s): %s", alt_name, dwarf_errmsg (-1));
diff --git a/tests/arextract.c b/tests/arextract.c
index 21850b6..2c4dc75 100644
--- a/tests/arextract.c
+++ b/tests/arextract.c
@@ -25,7 +25,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <sys/param.h>
+#include <system.h>
int
diff --git a/tests/attr-integrate-skel.c b/tests/attr-integrate-skel.c
new file mode 100644
index 0000000..644cd27
--- /dev/null
+++ b/tests/attr-integrate-skel.c
@@ -0,0 +1,109 @@
+/* Test dwarf_get_units finds split DWO CUs.
+ Copyright (C) 2018 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/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <dwarf.h>
+#include ELFUTILS_HEADER(dw)
+#include <stdio.h>
+#include <inttypes.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+
+int
+main (int argc, char *argv[])
+{
+ for (int i = 1; i < argc; i++)
+ {
+ printf ("file: %s\n", argv[i]);
+ int fd = open (argv[i], O_RDONLY);
+ Dwarf *dbg = dwarf_begin (fd, DWARF_C_READ);
+ if (dbg == NULL)
+ {
+ printf ("%s not usable: %s\n", argv[i], dwarf_errmsg (-1));
+ return -1;
+ }
+
+ Dwarf_CU *cu = NULL;
+ Dwarf_Die cudie, subdie;
+ uint8_t unit_type;
+ Dwarf_Half version;
+ int count = 0;
+ while (dwarf_get_units (dbg, cu, &cu, &version,
+ &unit_type, &cudie, &subdie) == 0)
+ {
+ count++;
+ if (unit_type == DW_UT_skeleton)
+ {
+ Dwarf_Attribute attr;
+ Dwarf_Word word;
+ Dwarf_Addr addr;
+
+ printf ("Split DIE: %s\n", dwarf_diename (&subdie));
+
+ if (dwarf_attr_integrate (&subdie,
+ DW_AT_GNU_addr_base, &attr) == NULL
+ && dwarf_attr_integrate (&subdie,
+ DW_AT_addr_base, &attr) == NULL)
+ printf ("No addr_base");
+ else if (dwarf_formudata (&attr, &word) != 0)
+ printf ("Bad addr_base: %s\n", dwarf_errmsg (-1));
+ else
+ printf ("addr_base secoff: 0x%" PRIx64 "\n", word);
+
+ if (dwarf_attr (&subdie, DW_AT_low_pc, &attr) != NULL)
+ printf ("Unexpected low_pc on split DIE.\n");
+
+ if (dwarf_attr_integrate (&subdie,
+ DW_AT_low_pc, &attr) == NULL)
+ printf ("No low_pc");
+ else if (dwarf_formaddr (&attr, &addr) != 0)
+ printf ("Bad low_pc: %s\n", dwarf_errmsg (-1));
+ else
+ printf ("low_pc addr: 0x%" PRIx64 "\n", addr);
+
+ if (dwarf_hasattr (&subdie, DW_AT_high_pc))
+ printf ("Unexpected highpc on split DIE\n");
+ if (dwarf_hasattr (&subdie, DW_AT_ranges))
+ printf ("Unexpected ranges on split DIE\n");
+
+ if (dwarf_hasattr_integrate (&subdie, DW_AT_high_pc))
+ printf ("Skel has high_pc.\n");
+ if (dwarf_hasattr_integrate (&subdie, DW_AT_ranges))
+ printf ("Skel has ranges.\n");
+
+ printf ("\n");
+ }
+ }
+
+ if (count == 0)
+ {
+ printf ("No units found\n");
+ return -1;
+ }
+
+ dwarf_end (dbg);
+ close (fd);
+ }
+
+ return 0;
+}
diff --git a/tests/backtrace-child.c b/tests/backtrace-child.c
index 40e7b32..9c6ba94 100644
--- a/tests/backtrace-child.c
+++ b/tests/backtrace-child.c
@@ -1,5 +1,5 @@
/* Test child for parent backtrace test.
- Copyright (C) 2013 Red Hat, Inc.
+ Copyright (C) 2013, 2016 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -19,7 +19,8 @@
--ptraceme will call ptrace (PTRACE_TRACEME) in the two threads.
--gencore will call abort () at its end.
Main thread will signal SIGUSR2. Other thread will signal SIGUSR1.
- On x86_64 only:
+ There used to be a difference between x86_64 and other architectures.
+ To test getting a signal at the very first instruction of a function:
PC will get changed to function 'jmp' by backtrace.c function
prepare_thread. Then SIGUSR2 will be signalled to backtrace-child
which will invoke function sigusr2.
@@ -66,14 +67,21 @@
# 5 0xf77c1a48 - 1 start
# 6 0xf77699da - 1 start_thread
# 7 0xf769bbfe - 1 __clone
+
+ But the raise jmp patching was unreliable. It depends on the CFI for the raise()
+ function in glibc to be the same as for the jmp() function. This is not always
+ the case. Some newer glibc versions rewrote raise() and now the CFA is calculated
+ differently. So we disable raise jmp patching everywhere.
*/
+#ifdef __x86_64__
+/* #define RAISE_JMP_PATCHING 1 */
+#endif
+
#include <config.h>
#include <assert.h>
#include <stdlib.h>
-#include <signal.h>
#include <errno.h>
-#include <sys/ptrace.h>
#include <string.h>
#include <pthread.h>
#include <stdio.h>
@@ -90,6 +98,8 @@
}
#else /* __linux__ */
+#include <sys/ptrace.h>
+#include <signal.h>
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
#define NOINLINE_NOCLONE __attribute__ ((noinline, noclone))
@@ -130,7 +140,7 @@
asm volatile ("");
}
-#ifdef __x86_64__
+#ifdef RAISE_JMP_PATCHING
static NOINLINE_NOCLONE USED void
jmp (void)
{
@@ -157,7 +167,7 @@
assert (errno == 0);
assert (l == 0);
}
-#ifdef __x86_64__
+#ifdef RAISE_JMP_PATCHING
if (! gencore)
{
/* Execution will get PC patched into function jmp. */
diff --git a/tests/backtrace-data.c b/tests/backtrace-data.c
index bc5ceba..a387d8f 100644
--- a/tests/backtrace-data.c
+++ b/tests/backtrace-data.c
@@ -76,10 +76,15 @@
errno = 0;
long l = ptrace (PTRACE_PEEKDATA, child, (void *) (uintptr_t) addr, NULL);
- assert (errno == 0);
+
+ // The unwinder can ask for an invalid address.
+ // Don't assert on that but just politely refuse.
+ if (errno != 0) {
+ errno = 0;
+ return false;
+ }
*result = l;
- /* We could also return false for failed ptrace. */
return true;
}
@@ -103,7 +108,8 @@
unsigned long start, end, offset;
i = fscanf (f, "%lx-%lx %*s %lx %*x:%*x %*x", &start, &end, &offset);
assert (errno == 0);
- assert (i == 3);
+ if (i != 3)
+ break;
char *filename = strdup ("");
assert (filename);
size_t filename_len = 0;
@@ -131,6 +137,8 @@
}
free (filename);
}
+ *basep = 0;
+ return NULL;
}
/* Add module containing ADDR to the DWFL address space.
@@ -145,6 +153,8 @@
{
GElf_Addr base;
char *long_name = maps_lookup (child, addr, &base);
+ if (!long_name)
+ return NULL; // not found
Dwfl_Module *mod = dwfl_report_elf (dwfl, long_name, long_name, -1,
base, false /* add_p_vaddr */);
assert (mod);
@@ -250,6 +260,7 @@
break;
case -1:
error (1, 0, "dwfl_thread_getframes: %s", dwfl_errmsg (-1));
+ break;
default:
abort ();
}
diff --git a/tests/backtrace-dwarf.c b/tests/backtrace-dwarf.c
index a644c8a..7ff826c 100644
--- a/tests/backtrace-dwarf.c
+++ b/tests/backtrace-dwarf.c
@@ -17,16 +17,13 @@
#include <config.h>
#include <assert.h>
-#include <signal.h>
#include <inttypes.h>
#include <stdio_ext.h>
#include <locale.h>
#include <errno.h>
#include <error.h>
#include <unistd.h>
-#include <sys/ptrace.h>
#include <sys/types.h>
-#include <sys/wait.h>
#include ELFUTILS_HEADER(dwfl)
#ifndef __linux__
@@ -40,6 +37,9 @@
}
#else /* __linux__ */
+#include <sys/ptrace.h>
+#include <sys/wait.h>
+#include <signal.h>
#define main cleanup_13_main
#include "cleanup-13.c"
diff --git a/tests/backtrace-subr.sh b/tests/backtrace-subr.sh
index 790b4f4..ff42c6f 100644
--- a/tests/backtrace-subr.sh
+++ b/tests/backtrace-subr.sh
@@ -40,13 +40,26 @@
false
}
+
+# Makes sure we saw the function that initiated the backtrace
+# when the core was generated through the tests backtrace --gencore.
+# This might disappear when frame pointer chasing gone bad.
+check_backtracegen()
+{
+ if grep -w backtracegen $1; then
+ return
+ fi
+ echo >&2 $2: no backtracegen
+ false
+}
+
# Verify the STDERR output does not contain unexpected errors.
# In some cases we cannot reliably find out we got behind _start as some
# operating system do not properly terminate CFI by undefined PC.
# Ignore it here as it is a bug of OS, not a bug of elfutils.
check_err()
{
- if [ $(egrep -v <$1 'dwfl_thread_getframes: (No DWARF information found|no matching address range)$' \
+ if [ $(egrep -v <$1 'dwfl_thread_getframes: (No DWARF information found|no matching address range|address out of range|Invalid register|\(null\))$' \
| wc -c) \
-eq 0 ]
then
@@ -105,6 +118,7 @@
cat backtrace.$arch.{bt,err}
check_unsupported backtrace.$arch.err backtrace.$arch.core
check_all backtrace.$arch.{bt,err} backtrace.$arch.core
+ check_backtracegen backtrace.$arch.bt backtrace.$arch.core
}
# Backtrace live process.
@@ -123,19 +137,53 @@
# Backtrace core file.
check_native_core()
{
+# systemd-coredump/coredumpctl doesn't seem to like concurrent core dumps
+# use a lock file (fd 200) tests/core-dump-backtrace.lock
+(
child=$1
# Disable valgrind while dumping core.
SAVED_VALGRIND_CMD="$VALGRIND_CMD"
unset VALGRIND_CMD
+ # Wait for lock for 10 seconds or skip.
+ flock -x -w 10 200 || exit 77;
+
# Skip the test if we cannot adjust core ulimit.
- core="core.`ulimit -c unlimited || exit 77; set +ex; testrun ${abs_builddir}/$child --gencore; true`"
+ pid="`ulimit -c unlimited || exit 77; set +ex; testrun ${abs_builddir}/$child --gencore; true`"
+ core="core.$pid"
# see if /proc/sys/kernel/core_uses_pid is set to 0
if [ -f core ]; then
mv core "$core"
fi
- if [ ! -f "$core" ]; then echo "No $core file generated"; exit 77; fi
+ type -P coredumpctl && have_coredumpctl=1 || have_coredumpctl=0
+ if [ ! -f "$core" -a $have_coredumpctl -eq 1 ]; then
+ # Maybe systemd-coredump took it. But give it some time to dump first...
+ sleep 1
+ coredumpctl --output="$core" dump $pid || rm -f $core
+
+ # Try a couple of times after waiting some more if something went wrong...
+ if [ ! -f "$core" ]; then
+ sleep 2
+ coredumpctl --output="$core" dump $pid || rm -f $core
+ fi
+
+ if [ ! -f "$core" ]; then
+ sleep 3
+ coredumpctl --output="$core" dump $pid || rm -f $core
+ fi
+ fi
+ if [ ! -f "$core" ]; then
+ # In some containers our view of pids is confused. Since tests are
+ # run in a new fresh directory any core here is most like is ours.
+ if ls core.[0-9]* 1> /dev/null 2>&1; then
+ mv core.[0-9]* "$core"
+ fi
+ fi
+ if [ ! -f "$core" ]; then
+ echo "No $core file generated";
+ exit 77;
+ fi
if [ "x$SAVED_VALGRIND_CMD" != "x" ]; then
VALGRIND_CMD="$SAVED_VALGRIND_CMD"
@@ -149,4 +197,6 @@
cat $core.{bt,err}
check_native_unsupported $core.err $child-$core
check_all $core.{bt,err} $child-$core
+ rm $core{,.{bt,err}}
+) 200>${abs_builddir}/core-dump-backtrace.lock
}
diff --git a/tests/backtrace.aarch64.fp.core.bz2 b/tests/backtrace.aarch64.fp.core.bz2
new file mode 100644
index 0000000..ff86788
--- /dev/null
+++ b/tests/backtrace.aarch64.fp.core.bz2
Binary files differ
diff --git a/tests/backtrace.aarch64.fp.exec.bz2 b/tests/backtrace.aarch64.fp.exec.bz2
new file mode 100644
index 0000000..9d06db1
--- /dev/null
+++ b/tests/backtrace.aarch64.fp.exec.bz2
Binary files differ
diff --git a/tests/backtrace.c b/tests/backtrace.c
index 1247643..f5dd761 100644
--- a/tests/backtrace.c
+++ b/tests/backtrace.c
@@ -1,5 +1,5 @@
/* Test program for unwinding of frames.
- Copyright (C) 2013, 2014 Red Hat, Inc.
+ Copyright (C) 2013, 2014, 2016 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -64,7 +64,7 @@
return DWARF_CB_OK;
}
-static bool is_x86_64_native;
+static bool use_raise_jmp_patching;
static pid_t check_tid;
static void
@@ -90,10 +90,14 @@
return;
}
Dwfl_Module *mod;
+ /* See case 4. Special case to help out simple frame pointer unwinders. */
+ static bool duplicate_sigusr2 = false;
+ if (duplicate_sigusr2)
+ frameno--;
static bool reduce_frameno = false;
if (reduce_frameno)
frameno--;
- if (! is_x86_64_native && frameno >= 2)
+ if (! use_raise_jmp_patching && frameno >= 2)
frameno += 2;
const char *symname2 = NULL;
switch (frameno)
@@ -112,8 +116,8 @@
case 2: // x86_64 only
/* __restore_rt - glibc maybe does not have to have this symbol. */
break;
- case 3: // x86_64 only
- if (is_x86_64_native)
+ case 3: // use_raise_jmp_patching
+ if (use_raise_jmp_patching)
{
/* Verify we trapped on the very first instruction of jmp. */
assert (symname != NULL && strcmp (symname, "jmp") == 0);
@@ -123,8 +127,16 @@
assert (symname2 == NULL || strcmp (symname2, "jmp") != 0);
break;
}
- /* PASSTHRU */
+ FALLTHROUGH;
case 4:
+ /* Some simple frame unwinders get this wrong and think sigusr2
+ is calling itself again. Allow it and just pretend there is
+ an extra sigusr2 frame. */
+ if (symname != NULL && strcmp (symname, "sigusr2") == 0)
+ {
+ duplicate_sigusr2 = true;
+ break;
+ }
assert (symname != NULL && strcmp (symname, "stdarg") == 0);
break;
case 5:
@@ -138,7 +150,7 @@
// there is no guarantee that the compiler doesn't reorder the
// instructions or even inserts some padding instructions at the end
// (which apparently happens on ppc64).
- if (is_x86_64_native)
+ if (use_raise_jmp_patching)
assert (symname2 == NULL || strcmp (symname2, "backtracegen") != 0);
break;
}
@@ -243,10 +255,10 @@
return DWARF_CB_OK;
assert (data->mod == NULL);
data->mod = mod;
- return DWARF_CB_OK;
+ return DWARF_CB_ABORT;
}
-/* On x86_64 only:
+/* We used to do this on x86_64 only (see backtrace-child why we now don't):
PC will get changed to function 'jmp' by backtrace.c function
prepare_thread. Then SIGUSR2 will be signalled to backtrace-child
which will invoke function sigusr2.
@@ -254,13 +266,17 @@
instruction of a function. Properly handled unwind should not slip into
the previous unrelated function. */
+#ifdef __x86_64__
+/* #define RAISE_JMP_PATCHING 1 */
+#endif
+
static void
prepare_thread (pid_t pid2 __attribute__ ((unused)),
void (*jmp) (void) __attribute__ ((unused)))
{
-#ifndef __x86_64__
+#ifndef RAISE_JMP_PATCHING
abort ();
-#else /* x86_64 */
+#else /* RAISE_JMP_PATCHING */
long l;
struct user_regs_struct user_regs;
errno = 0;
@@ -278,7 +294,7 @@
assert (got == pid2);
assert (WIFSTOPPED (status));
assert (WSTOPSIG (status) == SIGUSR1);
-#endif /* __x86_64__ */
+#endif /* RAISE_JMP_PATCHING */
}
#include <asm/unistd.h>
@@ -370,21 +386,20 @@
assert (ssize > 0 && ssize < (ssize_t) sizeof (data.selfpath));
data.selfpath[ssize] = '\0';
data.mod = NULL;
- ptrdiff_t ptrdiff = dwfl_getmodules (dwfl, see_exec_module, &data, 0);
- assert (ptrdiff == 0);
+ dwfl_getmodules (dwfl, see_exec_module, &data, 0);
assert (data.mod != NULL);
GElf_Addr loadbase;
Elf *elf = dwfl_module_getelf (data.mod, &loadbase);
GElf_Ehdr ehdr_mem, *ehdr = gelf_getehdr (elf, &ehdr_mem);
assert (ehdr != NULL);
/* It is false also on x86_64 with i386 inferior. */
-#ifndef __x86_64__
- is_x86_64_native = false;
-#else /* __x86_64__ */
- is_x86_64_native = ehdr->e_machine == EM_X86_64;
+#ifndef RAISE_JMP_PATCHING
+ use_raise_jmp_patching = false;
+#else /* RAISE_JMP_PATCHING_ */
+ use_raise_jmp_patching = ehdr->e_machine == EM_X86_64;
#endif /* __x86_64__ */
void (*jmp) (void) = 0;
- if (is_x86_64_native)
+ if (use_raise_jmp_patching)
{
// Find inferior symbol named "jmp".
int nsym = dwfl_module_getsymtab (data.mod);
diff --git a/tests/backtrace.i386.fp.core.bz2 b/tests/backtrace.i386.fp.core.bz2
new file mode 100644
index 0000000..3c49e24
--- /dev/null
+++ b/tests/backtrace.i386.fp.core.bz2
Binary files differ
diff --git a/tests/backtrace.i386.fp.exec.bz2 b/tests/backtrace.i386.fp.exec.bz2
new file mode 100755
index 0000000..cb4d32e
--- /dev/null
+++ b/tests/backtrace.i386.fp.exec.bz2
Binary files differ
diff --git a/tests/backtrace.ppc.core.bz2 b/tests/backtrace.ppc.core.bz2
index f20cd9f..3a025d2 100644
--- a/tests/backtrace.ppc.core.bz2
+++ b/tests/backtrace.ppc.core.bz2
Binary files differ
diff --git a/tests/backtrace.ppc.exec.bz2 b/tests/backtrace.ppc.exec.bz2
index 057c25a..333c6be 100644
--- a/tests/backtrace.ppc.exec.bz2
+++ b/tests/backtrace.ppc.exec.bz2
Binary files differ
diff --git a/tests/backtrace.ppc64le.fp.core.bz2 b/tests/backtrace.ppc64le.fp.core.bz2
new file mode 100644
index 0000000..e63babf
--- /dev/null
+++ b/tests/backtrace.ppc64le.fp.core.bz2
Binary files differ
diff --git a/tests/backtrace.ppc64le.fp.exec.bz2 b/tests/backtrace.ppc64le.fp.exec.bz2
new file mode 100755
index 0000000..ed1352a
--- /dev/null
+++ b/tests/backtrace.ppc64le.fp.exec.bz2
Binary files differ
diff --git a/tests/backtrace.x86_64.fp.core.bz2 b/tests/backtrace.x86_64.fp.core.bz2
new file mode 100644
index 0000000..e773ca2
--- /dev/null
+++ b/tests/backtrace.x86_64.fp.core.bz2
Binary files differ
diff --git a/tests/backtrace.x86_64.fp.exec.bz2 b/tests/backtrace.x86_64.fp.exec.bz2
new file mode 100644
index 0000000..0695845
--- /dev/null
+++ b/tests/backtrace.x86_64.fp.exec.bz2
Binary files differ
diff --git a/tests/dwarf-die-addr-die.c b/tests/dwarf-die-addr-die.c
new file mode 100644
index 0000000..7899988
--- /dev/null
+++ b/tests/dwarf-die-addr-die.c
@@ -0,0 +1,186 @@
+/* Test program for dwarf_die_addr_die.
+ Copyright (C) 2018 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/>. */
+
+#include <config.h>
+#include ELFUTILS_HEADER(dw)
+#include <dwarf.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <inttypes.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+
+/* The main Dwarf file. */
+static Dwarf *dwarf;
+
+int
+check_die (Dwarf_Die *die)
+{
+ if (dwarf_tag (die) == DW_TAG_invalid)
+ {
+ printf ("Invalid die\n");
+ return -1;
+ }
+
+ int res = 0;
+ void *addr = die->addr;
+ Dwarf_Die die2;
+ if (dwarf_die_addr_die (dwarf, addr, &die2) == NULL)
+ {
+ printf ("Bad die addr die at offset %" PRIx64 "\n",
+ dwarf_dieoffset (die));
+ res = -1;
+ }
+
+ if (dwarf_tag (die) != dwarf_tag (&die2))
+ {
+ printf ("Tags differ for die at offset %" PRIx64 "\n",
+ dwarf_dieoffset (die));
+ res = -1;
+ }
+
+ if (dwarf_cuoffset (die) != dwarf_cuoffset (&die2))
+ {
+ printf ("CU offsets differ for die at offset %" PRIx64 "\n",
+ dwarf_dieoffset (die));
+ res = -1;
+ }
+
+ Dwarf_Die child;
+ if (dwarf_child (die, &child) == 0)
+ res |= check_die (&child);
+
+ Dwarf_Die sibling;
+ if (dwarf_siblingof (die, &sibling) == 0)
+ res |= check_die (&sibling);
+
+ return res;
+}
+
+int
+check_dbg (Dwarf *dbg)
+{
+ int res = 0;
+ Dwarf_Off off = 0;
+ Dwarf_Off old_off = 0;
+ size_t hsize;
+ Dwarf_Off abbrev;
+ uint8_t addresssize;
+ uint8_t offsetsize;
+ while (dwarf_nextcu (dbg, off, &off, &hsize, &abbrev, &addresssize,
+ &offsetsize) == 0)
+ {
+ Dwarf_Die die;
+ if (dwarf_offdie (dbg, old_off + hsize, &die) != NULL)
+ {
+ printf ("checking CU at %" PRIx64 "\n", old_off);
+ res |= check_die (&die);
+ }
+
+ old_off = off;
+ }
+
+ // Same for type...
+ Dwarf_Half version;
+ uint64_t typesig;
+ Dwarf_Off typeoff;
+ off = 0;
+ old_off = 0;
+ while (dwarf_next_unit (dbg, off, &off, &hsize, &version, &abbrev,
+ &addresssize, &offsetsize, &typesig, &typeoff) == 0)
+ {
+ Dwarf_Die die;
+ if (dwarf_offdie_types (dbg, old_off + hsize, &die) != NULL)
+ {
+ printf ("checking TU at %" PRIx64 "\n", old_off);
+ res |= check_die (&die);
+ }
+
+ // We should have seen this already, but double check...
+ if (dwarf_offdie_types (dbg, old_off + typeoff, &die) != NULL)
+ {
+ printf ("checking Type DIE at %" PRIx64 "\n",
+ old_off + hsize + typeoff);
+ res |= check_die (&die);
+ }
+
+ old_off = off;
+ }
+
+ Dwarf *alt = dwarf_getalt (dbg);
+ if (alt != NULL)
+ {
+ printf ("checking alt debug\n");
+ res |= check_dbg (alt);
+ }
+
+ // Split or Type Dwarf_Dies gotten through dwarf_get_units.
+ Dwarf_CU *cu = NULL;
+ Dwarf_Die subdie;
+ uint8_t unit_type;
+ while (dwarf_get_units (dbg, cu, &cu, NULL,
+ &unit_type, NULL, &subdie) == 0)
+ {
+ if (dwarf_tag (&subdie) != DW_TAG_invalid)
+ {
+ printf ("checking %" PRIx8 " subdie\n", unit_type);
+ res |= check_die (&subdie);
+ }
+ }
+
+ return res;
+}
+
+int
+main (int argc, char *argv[])
+{
+ if (argc < 2)
+ {
+ printf ("No file given.\n");
+ return -1;
+ }
+
+ const char *name = argv[1];
+ int fd = open (name, O_RDONLY);
+ if (fd < 0)
+ {
+ printf ("Cannnot open '%s': %s\n", name, strerror (errno));
+ return -1;
+ }
+
+ dwarf = dwarf_begin (fd, DWARF_C_READ);
+ if (dwarf == NULL)
+ {
+ printf ("Not a Dwarf file '%s': %s\n", name, dwarf_errmsg (-1));
+ close (fd);
+ return -1;
+ }
+
+ printf ("checking %s\n", name);
+ int res = check_dbg (dwarf);
+
+ dwarf_end (dwarf);
+ close (fd);
+
+ return res;
+}
diff --git a/tests/dwarf-getmacros.c b/tests/dwarf-getmacros.c
index 92e093c..ac70248 100644
--- a/tests/dwarf-getmacros.c
+++ b/tests/dwarf-getmacros.c
@@ -38,7 +38,7 @@
dwarf_macro_opcode (macro, &opcode);
switch (opcode)
{
- case DW_MACRO_GNU_transparent_include:
+ case DW_MACRO_import:
{
Dwarf_Attribute at;
int r = dwarf_macro_param (macro, 0, &at);
@@ -56,7 +56,7 @@
break;
}
- case DW_MACRO_GNU_start_file:
+ case DW_MACRO_start_file:
{
Dwarf_Files *files;
size_t nfiles;
@@ -73,7 +73,7 @@
break;
}
- case DW_MACRO_GNU_end_file:
+ case DW_MACRO_end_file:
{
--level;
printf ("%*s/file\n", level, "");
@@ -81,7 +81,7 @@
}
case DW_MACINFO_define:
- case DW_MACRO_GNU_define_indirect:
+ case DW_MACRO_define_strp:
{
const char *value;
dwarf_macro_param2 (macro, NULL, &value);
@@ -90,7 +90,7 @@
}
case DW_MACINFO_undef:
- case DW_MACRO_GNU_undef_indirect:
+ case DW_MACRO_undef_strp:
break;
default:
diff --git a/tests/dwarf_default_lower_bound.c b/tests/dwarf_default_lower_bound.c
new file mode 100644
index 0000000..d57424f
--- /dev/null
+++ b/tests/dwarf_default_lower_bound.c
@@ -0,0 +1,83 @@
+/* Test all DW_LANG constants are handled by dwarf_default_lower_bound.
+
+ Copyright (C) 2016 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/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <dwarf.h>
+#include ELFUTILS_HEADER(dw)
+#include "../libdw/known-dwarf.h"
+
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+static void
+test_lang (const char *name, int lang)
+{
+ Dwarf_Sword low;
+ int res = dwarf_default_lower_bound (lang, &low);
+
+ /* Assembler is special, it doesn't really have arrays. */
+ if (lang == DW_LANG_Mips_Assembler)
+ {
+ if (res == 0)
+ {
+ printf ("%s shouldn't have a known lower bound\n", name);
+ exit (-1);
+ }
+ printf ("%s: <unknown>\n", name);
+ return;
+ }
+
+ if (res != 0)
+ {
+ printf ("dwarf_default_lower_bound failed (%d) for %s\n", res, name);
+ exit (-1);
+ }
+
+ /* All currently known lower bounds are either zero or one, but
+ they don't have to. Update test once one is a different value. */
+ if (low != 0 && low != 1)
+ {
+ printf ("unexpected lower bound %" PRId64 " for %s\n", low, name);
+ exit (-1);
+ }
+
+ printf ("%s: %" PRId64 "\n", name, low);
+}
+
+int
+main (int argc __attribute__ ((unused)), char *argv[] __attribute__ ((unused)))
+{
+ Dwarf_Sword low;
+ /* Bad language code must fail. */
+ if (dwarf_default_lower_bound (-1, &low) == 0)
+ {
+ printf ("Bad lang code -1 succeeded (%" PRId64 ")\n", low);
+ exit (-1);
+ }
+
+ /* Test all known language codes. */
+#define DWARF_ONE_KNOWN_DW_LANG(NAME, CODE) test_lang (#NAME, CODE);
+ DWARF_ALL_KNOWN_DW_LANG
+#undef DWARF_ONE_KNOWN_DW_LANG
+
+ return 0;
+}
diff --git a/tests/dwarfcfi.c b/tests/dwarfcfi.c
new file mode 100644
index 0000000..db4a36f
--- /dev/null
+++ b/tests/dwarfcfi.c
@@ -0,0 +1,175 @@
+/* Test program for DWARF (.debug_frame) CFI handling.
+ Copyright (C) 2009-2010, 2013, 2015, 2018 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/>. */
+
+#include <config.h>
+#include <assert.h>
+#include <inttypes.h>
+#include <error.h>
+#include ELFUTILS_HEADER(dw)
+#include <dwarf.h>
+#include <argp.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "../libdw/known-dwarf.h"
+
+static const char *
+op_name (unsigned int code)
+{
+ static const char *const known[] =
+ {
+#define DWARF_ONE_KNOWN_DW_OP(NAME, CODE) [CODE] = #NAME,
+ DWARF_ALL_KNOWN_DW_OP
+#undef DWARF_ONE_KNOWN_DW_OP
+ };
+
+ if (likely (code < sizeof (known) / sizeof (known[0])))
+ return known[code];
+
+ return NULL;
+}
+
+static void
+print_detail (int result, const Dwarf_Op *ops, size_t nops)
+{
+ if (result < 0)
+ printf ("indeterminate (%s)\n", dwarf_errmsg (-1));
+ else if (nops == 0)
+ printf ("%s\n", ops == NULL ? "same_value" : "undefined");
+ else
+ {
+ printf ("%s expression:", result == 0 ? "location" : "value");
+ for (size_t i = 0; i < nops; ++i)
+ {
+ printf (" %s", op_name(ops[i].atom));
+ if (ops[i].number2 == 0)
+ {
+ if (ops[i].atom == DW_OP_addr)
+ printf ("(%#" PRIx64 ")", ops[i].number);
+ else if (ops[i].number != 0)
+ printf ("(%" PRId64 ")", ops[i].number);
+ }
+ else
+ printf ("(%" PRId64 ",%" PRId64 ")",
+ ops[i].number, ops[i].number2);
+ }
+ puts ("");
+ }
+}
+
+static int
+handle_address (Dwarf_CFI *cfi, GElf_Addr pc)
+{
+ Dwarf_Frame *frame;
+ int result = dwarf_cfi_addrframe (cfi, pc, &frame);
+ if (result != 0)
+ {
+ printf ("dwarf_cfi_addrframe: %s\n", dwarf_errmsg (-1));
+ return 1;
+ }
+
+ Dwarf_Addr start = pc;
+ Dwarf_Addr end = pc;
+ bool signalp;
+ int ra_regno = dwarf_frame_info (frame, &start, &end, &signalp);
+
+ printf ("%#" PRIx64 " => [%#" PRIx64 ", %#" PRIx64 "):\n",
+ pc, start, end);
+
+ if (ra_regno < 0)
+ printf ("\treturn address register unavailable (%s)\n",
+ dwarf_errmsg (-1));
+ else
+ printf ("\treturn address in reg%u%s\n",
+ ra_regno, signalp ? " (signal frame)" : "");
+
+ // Point cfa_ops to dummy to match print_detail expectations.
+ // (nops == 0 && cfa_ops != NULL => "undefined")
+ Dwarf_Op dummy;
+ Dwarf_Op *cfa_ops = &dummy;
+ size_t cfa_nops;
+ result = dwarf_frame_cfa (frame, &cfa_ops, &cfa_nops);
+
+ printf ("\tCFA ");
+ print_detail (result, cfa_ops, cfa_nops);
+
+ // Print the location of the first 10 (DWARF nr) registers
+ for (int r = 0; r < 10; r++)
+ {
+ Dwarf_Op ops_mem[3];
+ Dwarf_Op *ops;
+ size_t nops;
+ printf ("\treg%d: ", r);
+ int reg_result = dwarf_frame_register (frame, r, ops_mem, &ops, &nops);
+ print_detail (reg_result, ops, nops);
+ result |= reg_result;
+ }
+
+ free (frame);
+ return result;
+}
+
+int
+main (int argc, char *argv[])
+{
+ if (argc <= 2)
+ error (EXIT_FAILURE, 0, "need file name argument and addresses");
+
+ int fd = open (argv[1], O_RDONLY);
+ if (fd == -1)
+ error (EXIT_FAILURE, errno, "cannot open input file `%s'", argv[1]);
+
+ elf_version (EV_CURRENT);
+
+ Elf *elf = elf_begin (fd, ELF_C_READ, NULL);
+ if (elf == NULL)
+ error (EXIT_FAILURE, 0, "cannot create ELF descriptor: %s",
+ elf_errmsg (-1));
+
+ Dwarf *dwarf = dwarf_begin_elf (elf, DWARF_C_READ, NULL);
+ if (dwarf == NULL)
+ error (EXIT_FAILURE, 0, "cannot create DWARF descriptor: %s",
+ dwarf_errmsg (-1));
+
+ Dwarf_CFI *cfi = dwarf_getcfi (dwarf);
+ if (cfi == NULL)
+ error (EXIT_FAILURE, 0, "cannot get DWARF CFI from .dwarf_frame: %s",
+ dwarf_errmsg (-1));
+
+ int result = 0;
+ int args = 2;
+ do
+ {
+ char *endp;
+ uintmax_t addr = strtoumax (argv[args], &endp, 0);
+ if (endp != argv[args])
+ result |= handle_address (cfi, addr);
+ else
+ result = 1;
+ }
+ while (args++ < argc - 1);
+
+ dwarf_end (dwarf);
+ elf_end (elf);
+
+ return result;
+}
diff --git a/tests/elfshphehdr.c b/tests/elfshphehdr.c
index 0d92934..8183937 100644
--- a/tests/elfshphehdr.c
+++ b/tests/elfshphehdr.c
@@ -126,7 +126,7 @@
check_elf ("elf_getshdrnum", elf_getshdrnum (elf, &shnum) == 0);
check ("shnum == 1", shnum == 2); /* section zero is also created. */
- check_elf ("elf_getphdrnum", elf_getphdrnum (elf, &phnum) != 0);
+ check_elf ("elf_getphdrnum", elf_getphdrnum (elf, &phnum) == 0);
check ("phnum == 1", phnum == 1);
check_elf ("gelf_getehdr", gelf_getehdr (elf, &ehdr) != NULL);
@@ -152,7 +152,7 @@
{
elf_version (EV_CURRENT);
- int fd = fd = open("/dev/zero", O_WRONLY);
+ int fd = open("/dev/null", O_WRONLY);
check ("open", fd >= 0);
Elf *elf;
diff --git a/tests/elfstrmerge.c b/tests/elfstrmerge.c
index 4149ca6..3bb90c4 100644
--- a/tests/elfstrmerge.c
+++ b/tests/elfstrmerge.c
@@ -1,5 +1,5 @@
/* Merge string sections.
- Copyright (C) 2015 Red Hat, Inc.
+ Copyright (C) 2015, 2016 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -29,8 +29,10 @@
#include <inttypes.h>
#include <unistd.h>
+#include <system.h>
#include <gelf.h>
-#include ELFUTILS_HEADER(ebl)
+#include ELFUTILS_HEADER(dwelf)
+#include "elf-knowledge.h"
/* The original ELF file. */
static int fd = -1;
@@ -43,13 +45,13 @@
static Elf *elfnew = NULL;
/* The merged string table. */
-static struct Ebl_Strtab *strings = NULL;
+static Dwelf_Strtab *strings = NULL;
/* Section name strents. */
-static struct Ebl_Strent **scnstrents = NULL;
+static Dwelf_Strent **scnstrents = NULL;
/* Symbol name strends. */
-static struct Ebl_Strent **symstrents = NULL;
+static Dwelf_Strent **symstrents = NULL;
/* New ELF file buffers. */
static Elf_Data newstrtabdata = { .d_buf = NULL };
@@ -62,7 +64,7 @@
{
/* The new string table. */
if (strings != NULL)
- ebl_strtabfree (strings);
+ dwelf_strtab_free (strings);
free (scnstrents);
free (symstrents);
@@ -193,7 +195,7 @@
size_t symtabndx = 0;
Elf_Scn *symtabscn = NULL;
GElf_Shdr symtabshdr_mem;
- GElf_Shdr *symtabshdr;
+ GElf_Shdr *symtabshdr = NULL;
while ((symtabscn = elf_nextscn (elf, symtabscn)) != NULL)
{
symtabshdr = gelf_getshdr (symtabscn, &symtabshdr_mem);
@@ -208,7 +210,7 @@
}
}
- if (symtabndx == 0)
+ if (symtabshdr == NULL)
fail ("No symtab found", fname);
if ((symtabshdr->sh_flags & SHF_ALLOC) != 0)
@@ -241,7 +243,7 @@
bool layout = phnum != 0;
/* Create a new merged strings table that starts with the empty string. */
- strings = ebl_strtabinit (true);
+ strings = dwelf_strtab_init (true);
if (strings == NULL)
fail ("No memory to create merged string table", NULL);
@@ -249,7 +251,7 @@
size_t shdrnum;
if (elf_getshdrnum (elf, &shdrnum) != 0)
fail_elf ("Couldn't get number of sections", fname);
- scnstrents = malloc (shdrnum * sizeof (struct Ebl_Strent *));
+ scnstrents = malloc (shdrnum * sizeof (Dwelf_Strent *));
if (scnstrents == NULL)
fail ("couldn't allocate memory for section strings", NULL);
@@ -275,8 +277,8 @@
const char *sname = elf_strptr (elf, shdrstrndx, shdr->sh_name);
if (sname == NULL)
fail_elf_idx ("couldn't get section name", fname, scnnum);
- if ((scnstrents[scnnum] = ebl_strtabadd (strings, sname, 0)) == NULL)
- fail ("No memory to add to merged string table", NULL);
+ if ((scnstrents[scnnum] = dwelf_strtab_add (strings, sname)) == NULL)
+ fail ("No memory to add to merged string table", NULL);
}
if (layout)
@@ -295,7 +297,7 @@
if (symd == NULL)
fail_elf ("couldn't get symtab data", fname);
size_t symsnum = symd->d_size / elsize;
- symstrents = malloc (symsnum * sizeof (struct Ebl_Strent *));
+ symstrents = malloc (symsnum * sizeof (Dwelf_Strent *));
if (symstrents == NULL)
fail_errno ("Couldn't allocate memory for symbol strings", NULL);
for (size_t i = 0; i < symsnum; i++)
@@ -309,7 +311,7 @@
const char *sname = elf_strptr (elf, strtabndx, sym->st_name);
if (sname == NULL)
fail_elf_idx ("Couldn't get symbol name", fname, i);
- if ((symstrents[i] = ebl_strtabadd (strings, sname, 0)) == NULL)
+ if ((symstrents[i] = dwelf_strtab_add (strings, sname)) == NULL)
fail_idx ("No memory to add to merged string table symbol",
fname, i);
}
@@ -317,7 +319,7 @@
/* We got all strings, build the new string table and store it as
new strtab. */
- ebl_strtabfinalize (strings, &newstrtabdata);
+ dwelf_strtab_finalize (strings, &newstrtabdata);
/* We share at least the empty string so the result is at least 1
byte smaller. */
@@ -453,7 +455,7 @@
GElf_Shdr newshdr;
newshdr.sh_name = (shdr->sh_name != 0
- ? ebl_strtaboffset (scnstrents[ndx]) : 0);
+ ? dwelf_strent_off (scnstrents[ndx]) : 0);
newshdr.sh_type = shdr->sh_type;
newshdr.sh_flags = shdr->sh_flags;
newshdr.sh_addr = shdr->sh_addr;
@@ -528,7 +530,7 @@
sym.st_shndx = newsecndx (sym.st_shndx, "section", ndx,
"symbol", i);
if (update_name && sym.st_name != 0)
- sym.st_name = ebl_strtaboffset (symstrents[i]);
+ sym.st_name = dwelf_strent_off (symstrents[i]);
/* We explicitly don't update the SHNDX table at
the same time, we do that below. */
@@ -576,7 +578,8 @@
break;
case SHT_DYNAMIC:
- /* Fallthrough. There are string indexes in here, but
+ FALLTHROUGH;
+ /* There are string indexes in here, but
they (should) point to a allocated string table,
which we don't alter. */
default:
diff --git a/tests/emptyfile.c b/tests/emptyfile.c
new file mode 100644
index 0000000..6d08624
--- /dev/null
+++ b/tests/emptyfile.c
@@ -0,0 +1,277 @@
+/* Test program for adding a section to an empty ELF file.
+ Copyright (C) 2016 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/>. */
+
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <errno.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include ELFUTILS_HEADER(elf)
+#include <gelf.h>
+
+
+/* Index of last string added. Returned by add_string (). */
+static size_t stridx = 0;
+
+/* Adds a string and returns the offset in the section. */
+static size_t
+add_string (Elf_Scn *scn, char *str)
+{
+ size_t lastidx = stridx;
+ size_t size = strlen (str) + 1;
+
+ Elf_Data *data = elf_newdata (scn);
+ if (data == NULL)
+ {
+ printf ("cannot create data SHSTRTAB section: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ data->d_buf = str;
+ data->d_type = ELF_T_BYTE;
+ data->d_size = size;
+ data->d_align = 1;
+ data->d_version = EV_CURRENT;
+
+ stridx += size;
+ printf ("add_string: '%s', stridx: %zd, lastidx: %zd\n",
+ str, stridx, lastidx);
+ return lastidx;
+}
+
+static void
+check_elf (const char *fname, int class, int use_mmap)
+{
+ printf ("\nfname: %s\n", fname);
+ stridx = 0; // Reset strtab strings index
+
+ int fd = open (fname, O_RDWR | O_CREAT | O_TRUNC, 0666);
+ if (fd == -1)
+ {
+ printf ("cannot open `%s': %s\n", fname, strerror (errno));
+ exit (1);
+ }
+
+ Elf *elf = elf_begin (fd, use_mmap ? ELF_C_WRITE_MMAP : ELF_C_WRITE, NULL);
+ if (elf == NULL)
+ {
+ printf ("cannot create ELF descriptor: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ // Create an ELF header.
+ if (gelf_newehdr (elf, class) == 0)
+ {
+ printf ("cannot create ELF header: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ GElf_Ehdr ehdr_mem;
+ GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
+ if (ehdr == NULL)
+ {
+ printf ("cannot get ELF header: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ // Initialize header.
+ ehdr->e_ident[EI_DATA] = class == ELFCLASS64 ? ELFDATA2LSB : ELFDATA2MSB;
+ ehdr->e_ident[EI_OSABI] = ELFOSABI_GNU;
+ ehdr->e_type = ET_NONE;
+ ehdr->e_machine = EM_X86_64;
+ ehdr->e_version = EV_CURRENT;
+
+ if (gelf_update_ehdr (elf, ehdr) == 0)
+ {
+ printf ("cannot update ELF header: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ // Write everything to disk.
+ if (elf_update (elf, ELF_C_WRITE) < 0)
+ {
+ printf ("failure in elf_update(WRITE): %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ if (elf_end (elf) != 0)
+ {
+ printf ("failure in elf_end: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ close (fd);
+
+ /* Reread the ELF from disk now. */
+ fd = open (fname, O_RDWR, 0666);
+ if (fd == -1)
+ {
+ printf ("cannot (re)open `%s': %s\n", fname, strerror (errno));
+ exit (1);
+ }
+
+ elf = elf_begin (fd, use_mmap ? ELF_C_RDWR_MMAP : ELF_C_RDWR, NULL);
+ if (elf == NULL)
+ {
+ printf ("cannot create ELF descriptor read-only: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ // There are no sections yet.
+ if (elf_nextscn (elf, NULL) != NULL)
+ {
+ printf ("Empty elf had a section???\n");
+ exit (1);
+ }
+
+ // Create strtab section.
+ Elf_Scn *scn = elf_newscn (elf);
+ if (scn == NULL)
+ {
+ printf ("cannot create strings section: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ // Add an empty string to the table as NUL entry for section zero.
+ add_string (scn, "");
+
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ if (shdr == NULL)
+ {
+ printf ("cannot get header for strings section: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ shdr->sh_type = SHT_STRTAB;
+ shdr->sh_flags = 0;
+ shdr->sh_addr = 0;
+ shdr->sh_link = SHN_UNDEF;
+ shdr->sh_info = SHN_UNDEF;
+ shdr->sh_addralign = 1;
+ shdr->sh_entsize = 0;
+ shdr->sh_name = add_string (scn, ".strtab");
+
+ // We have to store the section strtab index in the ELF header.
+ // So sections have actual names.
+ int ndx = elf_ndxscn (scn);
+ ehdr->e_shstrndx = ndx;
+
+ if (gelf_update_ehdr (elf, ehdr) == 0)
+ {
+ printf ("cannot update ELF header: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ // Finished strtab section, update the header.
+ if (gelf_update_shdr (scn, shdr) == 0)
+ {
+ printf ("cannot update STRTAB section header: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ // Write everything to disk.
+ if (elf_update (elf, ELF_C_WRITE) < 0)
+ {
+ printf ("failure in elf_update(WRITE): %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ if (elf_end (elf) != 0)
+ {
+ printf ("failure in elf_end: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ close (fd);
+
+ // And read it in one last time.
+ fd = open (fname, O_RDONLY, 0666);
+ if (fd == -1)
+ {
+ printf ("cannot open `%s' read-only: %s\n", fname, strerror (errno));
+ exit (1);
+ }
+
+ elf = elf_begin (fd, use_mmap ? ELF_C_READ_MMAP : ELF_C_READ, NULL);
+ if (elf == NULL)
+ {
+ printf ("cannot create ELF descriptor read-only: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ // Is our new section there?
+ scn = elf_nextscn (elf, NULL);
+ if (scn == NULL)
+ {
+ printf ("cannot get new section: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ shdr = gelf_getshdr (scn, &shdr_mem);
+ if (shdr == NULL)
+ {
+ printf ("cannot get header for new section: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ size_t shstrndx;
+ if (elf_getshdrstrndx (elf, &shstrndx) < 0)
+ {
+ printf ("elf_getshdrstrndx: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ const char *sname = elf_strptr (elf, shstrndx, shdr->sh_name);
+ if (sname == NULL || strcmp (sname, ".strtab") != 0)
+ {
+ printf ("Bad section name: %s\n", sname);
+ exit (1);
+ }
+
+ if (elf_end (elf) != 0)
+ {
+ printf ("failure in elf_end: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ close (fd);
+
+ unlink (fname);
+}
+
+int
+main (int argc __attribute__ ((unused)),
+ char *argv[] __attribute__ ((unused)))
+{
+ elf_version (EV_CURRENT);
+
+ check_elf ("empty.elf.32", ELFCLASS32, 0);
+ check_elf ("empty.elf.32.mmap", ELFCLASS32, 1);
+ check_elf ("empty.elf.64", ELFCLASS64, 0);
+ check_elf ("empty.elf.64.mmap", ELFCLASS64, 1);
+
+ return 0;
+}
diff --git a/tests/fillfile.c b/tests/fillfile.c
new file mode 100644
index 0000000..915e249
--- /dev/null
+++ b/tests/fillfile.c
@@ -0,0 +1,448 @@
+/* Test program for changing data in one section (but not others) with gaps.
+ 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 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/>. */
+
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <errno.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include ELFUTILS_HEADER(elf)
+#include <gelf.h>
+
+
+/* Index of last string added. Returned by add_string (). */
+static size_t stridx = 0;
+
+/* Adds a string and returns the offset in the section. */
+static size_t
+add_strtab_entry (Elf_Scn *strtab, const char *str)
+{
+ size_t lastidx = stridx;
+ size_t size = strlen (str) + 1;
+
+ Elf_Data *data = elf_newdata (strtab);
+ if (data == NULL)
+ {
+ printf ("cannot create data SHSTRTAB section: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ data->d_buf = (char *) str; /* Discards const, but we will not change. */
+ data->d_type = ELF_T_BYTE;
+ data->d_size = size;
+ data->d_align = 1;
+ data->d_version = EV_CURRENT;
+
+ stridx += size;
+ printf ("add_string: '%s', stridx: %zd, lastidx: %zd\n",
+ str, stridx, lastidx);
+ return lastidx;
+}
+
+static Elf_Scn *
+create_strtab (Elf *elf)
+{
+ // Create strtab section.
+ Elf_Scn *scn = elf_newscn (elf);
+ if (scn == NULL)
+ {
+ printf ("cannot create strings section: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ // Add an empty string to the table as NUL entry for section zero.
+ add_strtab_entry (scn, "");
+
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ if (shdr == NULL)
+ {
+ printf ("cannot get header for new strtab section: %s\n",
+ elf_errmsg (-1));
+ exit (1);
+ }
+
+ shdr->sh_type = SHT_STRTAB;
+ shdr->sh_flags = 0;
+ shdr->sh_addr = 0;
+ shdr->sh_link = SHN_UNDEF;
+ shdr->sh_info = SHN_UNDEF;
+ shdr->sh_addralign = 1;
+ shdr->sh_entsize = 0;
+ shdr->sh_name = add_strtab_entry (scn, ".strtab");
+
+ // We have to store the section strtab index in the ELF header.
+ // So sections have actual names.
+ GElf_Ehdr ehdr_mem;
+ GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
+ if (ehdr == NULL)
+ {
+ printf ("cannot get ELF header: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ int ndx = elf_ndxscn (scn);
+ ehdr->e_shstrndx = ndx;
+
+ if (gelf_update_ehdr (elf, ehdr) == 0)
+ {
+ printf ("cannot update ELF header: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ // Finished strtab section, update the header.
+ if (gelf_update_shdr (scn, shdr) == 0)
+ {
+ printf ("cannot update STRTAB section header: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ return scn;
+}
+
+static char sec_data[] = { 1, 2, 3, 4, 5 };
+static char new_data[] = { 5, 4, 3, 2, 1 };
+
+static void
+add_data_section (Elf *elf, Elf_Scn *strtab, const char *sname)
+{
+ printf ("Add data section %s\n", sname);
+ Elf_Scn *scn = elf_newscn (elf);
+ if (scn == NULL)
+ {
+ printf ("cannot create strings section: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ if (shdr == NULL)
+ {
+ printf ("cannot get header for new %s section: %s\n",
+ sname, elf_errmsg (-1));
+ exit (1);
+ }
+
+ shdr->sh_type = SHT_PROGBITS;
+ shdr->sh_flags = 0;
+ shdr->sh_addr = 0;
+ shdr->sh_link = SHN_UNDEF;
+ shdr->sh_info = SHN_UNDEF;
+ shdr->sh_addralign = 128; // Large alignment to force gap between sections.
+ shdr->sh_entsize = 1;
+ shdr->sh_name = add_strtab_entry (strtab, sname);
+
+ if (gelf_update_shdr (scn, shdr) == 0)
+ {
+ printf ("cannot update %s section header: %s\n", sname, elf_errmsg (-1));
+ exit (1);
+ }
+
+ /* Add some data, but less than alignment. */
+ Elf_Data *data = elf_newdata (scn);
+ if (data == NULL)
+ {
+ printf ("cannot update %s section header: %s\n", sname, elf_errmsg (-1));
+ exit (1);
+ }
+ data->d_buf = sec_data;
+ data->d_size = 5;
+}
+
+static void
+check_data (const char *sname, Elf_Data *data, char *buf)
+{
+ printf ("check data %s [", sname);
+ for (int i = 0; i < 5; i++)
+ printf ("%d%s", buf[i], i < 4 ? "," : "");
+ printf ("]\n");
+ if (data == NULL || data->d_buf == NULL)
+ {
+ printf ("No data in section %s\n", sname);
+ exit (1);
+ }
+
+ if (data->d_size != 5 || memcmp (data->d_buf, buf, 5) != 0)
+ {
+ printf ("Wrong data in section %s [", sname);
+ for (size_t i = 0; i < data->d_size; i++)
+ printf ("%d%s", ((char *)data->d_buf)[i],
+ i < data->d_size - 1 ? "," : "");
+ printf ("]\n");
+ exit(1);
+ }
+}
+
+static void
+check_elf (const char *fname, int class, int use_mmap)
+{
+ printf ("\nfname: %s\n", fname);
+ stridx = 0; // Reset strtab strings index
+
+ int fd = open (fname, O_RDWR | O_CREAT | O_TRUNC, 0666);
+ if (fd == -1)
+ {
+ printf ("cannot open `%s': %s\n", fname, strerror (errno));
+ exit (1);
+ }
+
+ Elf *elf = elf_begin (fd, use_mmap ? ELF_C_WRITE_MMAP : ELF_C_WRITE, NULL);
+ if (elf == NULL)
+ {
+ printf ("cannot create ELF descriptor: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ // Create an ELF header.
+ if (gelf_newehdr (elf, class) == 0)
+ {
+ printf ("cannot create ELF header: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ GElf_Ehdr ehdr_mem;
+ GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
+ if (ehdr == NULL)
+ {
+ printf ("cannot get ELF header: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ // Initialize header.
+ ehdr->e_ident[EI_DATA] = class == ELFCLASS64 ? ELFDATA2LSB : ELFDATA2MSB;
+ ehdr->e_ident[EI_OSABI] = ELFOSABI_GNU;
+ ehdr->e_type = ET_NONE;
+ ehdr->e_machine = EM_X86_64;
+ ehdr->e_version = EV_CURRENT;
+
+ if (gelf_update_ehdr (elf, ehdr) == 0)
+ {
+ printf ("cannot update ELF header: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ Elf_Scn *strtab = create_strtab (elf);
+ add_data_section (elf, strtab, ".data1");
+ add_data_section (elf, strtab, ".data2");
+ add_data_section (elf, strtab, ".data3");
+ add_data_section (elf, strtab, ".data4");
+
+ // Write everything to disk.
+ if (elf_update (elf, ELF_C_WRITE) < 0)
+ {
+ printf ("failure in elf_update(WRITE): %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ if (elf_end (elf) != 0)
+ {
+ printf ("failure in elf_end: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ close (fd);
+
+ /* Reread the ELF from disk now. */
+ printf ("Rereading %s\n", fname);
+ fd = open (fname, O_RDWR, 0666);
+ if (fd == -1)
+ {
+ printf ("cannot (re)open `%s': %s\n", fname, strerror (errno));
+ exit (1);
+ }
+
+ elf = elf_begin (fd, use_mmap ? ELF_C_RDWR_MMAP : ELF_C_RDWR, NULL);
+ if (elf == NULL)
+ {
+ printf ("cannot create ELF descriptor read-only: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ /* We are going to change some data (in-place), but want the layout
+ to stay exactly the same. */
+ elf_flagelf (elf, ELF_C_SET, ELF_F_LAYOUT);
+
+ size_t shdrstrndx;
+ if (elf_getshdrstrndx (elf, &shdrstrndx) != 0)
+ {
+ printf ("cannot get shdr str ndx\n");
+ exit (1);
+ }
+ printf ("shdrstrndx: %zd\n", shdrstrndx);
+
+ // Get third data section and change it.
+ Elf_Scn *checkscn = NULL;
+ Elf_Scn *scn = elf_nextscn (elf, NULL);
+ while (scn != NULL)
+ {
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ if (shdr == NULL)
+ {
+ printf ("cannot get header for section: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+ const char *sname = elf_strptr (elf, shdrstrndx, shdr->sh_name);
+ if (sname != NULL && strcmp (".data3", sname) == 0)
+ checkscn = scn;
+
+ // Get all data, but don't really use it
+ // (this triggered the original bug).
+ Elf_Data *data = elf_getdata (scn, NULL);
+ if (data != NULL && data->d_buf != NULL && data->d_size == 0)
+ {
+ printf ("Bad data...n");
+ exit (1);
+ }
+ scn = elf_nextscn (elf, scn);
+ }
+
+ if (checkscn == NULL)
+ {
+ printf ("ELF file doesn't have a .data3 section\n");
+ exit (1);
+ }
+
+ Elf_Data *data = elf_getdata (checkscn, NULL);
+ check_data (".data3", data, sec_data);
+ memcpy (data->d_buf, new_data, 5);
+ elf_flagdata (data, ELF_C_SET, ELF_F_DIRTY);
+
+ // Write everything to disk.
+ if (elf_update (elf, ELF_C_WRITE) < 0)
+ {
+ printf ("failure in elf_update(WRITE): %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ if (elf_end (elf) != 0)
+ {
+ printf ("failure in elf_end: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ close (fd);
+
+ // And read it in one last time.
+ printf ("Rereading %s again\n", fname);
+ fd = open (fname, O_RDONLY, 0666);
+ if (fd == -1)
+ {
+ printf ("cannot open `%s' read-only: %s\n", fname, strerror (errno));
+ exit (1);
+ }
+
+ elf = elf_begin (fd, use_mmap ? ELF_C_READ_MMAP : ELF_C_READ, NULL);
+ if (elf == NULL)
+ {
+ printf ("cannot create ELF descriptor read-only: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ // Get all .data sections and check them.
+ Elf_Scn *scn1 = NULL;
+ Elf_Scn *scn2 = NULL;
+ Elf_Scn *scn3 = NULL;
+ Elf_Scn *scn4 = NULL;
+ scn = elf_nextscn (elf, NULL);
+ while (scn != NULL)
+ {
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ if (shdr == NULL)
+ {
+ printf ("cannot get header for section: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+ const char *sname = elf_strptr (elf, shdrstrndx, shdr->sh_name);
+ if (sname != NULL && strcmp (".data1", sname) == 0)
+ scn1 = scn;
+ else if (sname != NULL && strcmp (".data2", sname) == 0)
+ scn2 = scn;
+ else if (sname != NULL && strcmp (".data3", sname) == 0)
+ scn3 = scn;
+ else if (sname != NULL && strcmp (".data4", sname) == 0)
+ scn4 = scn;
+ scn = elf_nextscn (elf, scn);
+ }
+
+ if (scn1 == NULL)
+ {
+ printf ("ELF file doesn't have a .data1 section\n");
+ exit (1);
+ }
+ data = elf_getdata (scn1, NULL);
+ check_data (".data1", data, sec_data);
+
+ if (scn2 == NULL)
+ {
+ printf ("ELF file doesn't have a .data2 section\n");
+ exit (1);
+ }
+ data = elf_getdata (scn2, NULL);
+ check_data (".data2", data, sec_data);
+
+ if (scn3 == NULL)
+ {
+ printf ("ELF file doesn't have a .data3 section\n");
+ exit (1);
+ }
+ data = elf_getdata (scn3, NULL);
+ check_data (".data3", data, new_data);
+
+ if (scn4 == NULL)
+ {
+ printf ("ELF file doesn't have a .data4 section\n");
+ exit (1);
+ }
+ data = elf_getdata (scn4, NULL);
+ check_data (".data4", data, sec_data);
+
+ if (elf_end (elf) != 0)
+ {
+ printf ("failure in elf_end: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ close (fd);
+
+ unlink (fname);
+}
+
+int
+main (int argc __attribute__ ((unused)),
+ char *argv[] __attribute__ ((unused)))
+{
+ elf_version (EV_CURRENT);
+
+ elf_fill (0xA);
+
+ check_elf ("fill.elf.32", ELFCLASS32, 0);
+ check_elf ("fill.elf.32.mmap", ELFCLASS32, 1);
+ check_elf ("fill.elf.64", ELFCLASS64, 0);
+ check_elf ("fill.elf.64.mmap", ELFCLASS64, 1);
+
+ return 0;
+}
diff --git a/tests/get-lines.c b/tests/get-lines.c
index c361a2c..188d016 100644
--- a/tests/get-lines.c
+++ b/tests/get-lines.c
@@ -24,6 +24,7 @@
#include <libelf.h>
#include ELFUTILS_HEADER(dw)
#include <stdio.h>
+#include <string.h>
#include <unistd.h>
@@ -100,6 +101,28 @@
printf ("%" PRIx64 ": %s:%d:", (uint64_t) addr,
file ?: "???", line);
+ /* Getting the file path through the Dwarf_Files should
+ result in the same path. */
+ Dwarf_Files *files;
+ size_t idx;
+ if (dwarf_line_file (l, &files, &idx) != 0)
+ {
+ printf ("%s: cannot get file from line (%zd): %s\n",
+ argv[cnt], i, dwarf_errmsg (-1));
+ result = 1;
+ break;
+ }
+ const char *path = dwarf_filesrc (files, idx, NULL, NULL);
+ if ((path == NULL && file != NULL)
+ || (path != NULL && file == NULL)
+ || (strcmp (file, path) != 0))
+ {
+ printf ("%s: line %zd srcline (%s) != file srcline (%s)\n",
+ argv[cnt], i, file ?: "???", path ?: "???");
+ result = 1;
+ break;
+ }
+
int column;
if (dwarf_linecol (l, &column) != 0)
column = 0;
diff --git a/tests/get-units-invalid.c b/tests/get-units-invalid.c
new file mode 100644
index 0000000..155e12d
--- /dev/null
+++ b/tests/get-units-invalid.c
@@ -0,0 +1,121 @@
+/* Test cudie and subdie properties.
+ Copyright (C) 2018 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/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <dwarf.h>
+#include ELFUTILS_HEADER(dw)
+#include <stdio.h>
+#include <inttypes.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+
+int
+main (int argc, char *argv[])
+{
+ for (int i = 1; i < argc; i++)
+ {
+ printf ("file: %s\n", argv[i]);
+ int fd = open (argv[i], O_RDONLY);
+ Dwarf *dbg = dwarf_begin (fd, DWARF_C_READ);
+ if (dbg == NULL)
+ {
+ printf ("%s not usable: %s\n", argv[i], dwarf_errmsg (-1));
+ return -1;
+ }
+
+ Dwarf_CU *cu = NULL;
+ Dwarf_Die cudie, subdie;
+ uint8_t unit_type;
+ while (dwarf_get_units (dbg, cu, &cu, NULL,
+ &unit_type, &cudie, &subdie) == 0)
+ {
+ printf ("Got cudie: %s, unit_type: %" PRIx8 "\n",
+ dwarf_diename (&cudie), unit_type);
+
+ int tag = dwarf_tag (&subdie);
+ if (unit_type == DW_UT_compile)
+ {
+ if (tag != DW_TAG_invalid)
+ {
+ printf ("Not invalid: %x\n", dwarf_tag (&subdie));
+ return -1;
+ }
+ if (dwarf_diename (&subdie) != NULL)
+ {
+ printf ("Should have NULL name: %s\n",
+ dwarf_diename (&subdie));
+ return -1;
+ }
+ Dwarf_Die result;
+ if (dwarf_siblingof (&subdie, &result) != -1)
+ {
+ printf ("Should NOT have a valid sibling: %s\n",
+ dwarf_diename (&result));
+ return -1;
+ }
+ if (dwarf_child (&subdie, &result) != -1)
+ {
+ printf ("Should NOT have a valid child: %s\n",
+ dwarf_diename (&result));
+ return -1;
+ }
+ Dwarf_Addr base, start, end;
+ if (dwarf_ranges (&subdie, 0, &base, &start, &end) != -1)
+ {
+ printf ("Should NOT have a ranges: %s\n",
+ dwarf_diename (&subdie));
+ return -1;
+ }
+ if (dwarf_cuoffset (&subdie) != (Dwarf_Off) -1)
+ {
+ printf ("Should NOT have a cuoffset: %s\n",
+ dwarf_diename (&subdie));
+ return -1;
+ }
+ if (dwarf_dieoffset (&subdie) != (Dwarf_Off) -1)
+ {
+ printf ("Should NOT have a die offset: %s\n",
+ dwarf_diename (&subdie));
+ return -1;
+ }
+ if (dwarf_getabbrev (&subdie, 0, NULL) != NULL)
+ {
+ printf ("Should NOT have an abbrev: %s\n",
+ dwarf_diename (&subdie));
+ return -1;
+ }
+ }
+ else if (unit_type == DW_UT_type)
+ printf ("subdie: %s\n", dwarf_diename (&subdie));
+ else
+ printf ("subdie tag: %x\n", dwarf_tag (&subdie));
+ }
+
+ dwarf_end (dbg);
+ close (fd);
+
+ printf ("\n");
+ }
+
+ return 0;
+}
diff --git a/tests/get-units-split.c b/tests/get-units-split.c
new file mode 100644
index 0000000..410483a
--- /dev/null
+++ b/tests/get-units-split.c
@@ -0,0 +1,101 @@
+/* Test dwarf_get_units finds split DWO CUs.
+ Copyright (C) 2018 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/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <dwarf.h>
+#include ELFUTILS_HEADER(dw)
+#include <stdio.h>
+#include <inttypes.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+
+int
+main (int argc, char *argv[])
+{
+ for (int i = 1; i < argc; i++)
+ {
+ printf ("file: %s\n", argv[i]);
+ int fd = open (argv[i], O_RDONLY);
+ Dwarf *dbg = dwarf_begin (fd, DWARF_C_READ);
+ if (dbg == NULL)
+ {
+ printf ("%s not usable: %s\n", argv[i], dwarf_errmsg (-1));
+ return -1;
+ }
+
+ Dwarf_CU *cu = NULL;
+ Dwarf_Die cudie, subdie;
+ uint8_t unit_type;
+ int count = 0;
+ while (dwarf_get_units (dbg, cu, &cu, NULL,
+ &unit_type, &cudie, &subdie) == 0)
+ {
+ count++;
+ printf ("Got cudie unit_type: %" PRIx8 "\n", unit_type);
+
+ if (unit_type == DW_UT_skeleton)
+ {
+ Dwarf_CU *skel_cu = cudie.cu;
+ Dwarf_CU *split_cu = subdie.cu;
+ Dwarf_Die skel_die, split_die;
+ uint64_t skel_id, split_id;
+
+ printf ("Found a skeleton unit, with split die: %s\n",
+ dwarf_diename (&subdie));
+
+ if (dwarf_cu_die (skel_cu, &skel_die, NULL, NULL, NULL, NULL,
+ &skel_id, NULL) == NULL)
+ {
+ printf ("bad skel_cu: %s\n", dwarf_errmsg (-1));
+ return -1;
+ }
+
+ if (dwarf_cu_die (split_cu, &split_die, NULL, NULL, NULL, NULL,
+ &split_id, NULL) == NULL)
+ {
+ printf ("bad skel_cu: %s\n", dwarf_errmsg (-1));
+ return -1;
+ }
+
+ if (skel_id != split_id)
+ {
+ printf ("Skeleton id and Split id not equal!\n");
+ return -1;
+ }
+ }
+ }
+
+ if (count == 0)
+ {
+ printf ("No units found\n");
+ return -1;
+ }
+
+ dwarf_end (dbg);
+ close (fd);
+
+ printf ("\n");
+ }
+
+ return 0;
+}
diff --git a/tests/hello_m68k.ko.bz2 b/tests/hello_m68k.ko.bz2
new file mode 100644
index 0000000..2da3d17
--- /dev/null
+++ b/tests/hello_m68k.ko.bz2
Binary files differ
diff --git a/tests/hello_riscv64.ko.bz2 b/tests/hello_riscv64.ko.bz2
new file mode 100644
index 0000000..355a512
--- /dev/null
+++ b/tests/hello_riscv64.ko.bz2
Binary files differ
diff --git a/tests/low_high_pc.c b/tests/low_high_pc.c
index d0f4302..5c6b343 100644
--- a/tests/low_high_pc.c
+++ b/tests/low_high_pc.c
@@ -1,5 +1,5 @@
/* Test program for dwarf_lowpc and dwarf_highpc
- Copyright (C) 2012 Red Hat, Inc.
+ Copyright (C) 2012, 2018 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -55,7 +55,9 @@
const char *name = dwarf_diename (die);
if (name == NULL)
- fail (off, "<no name>", "die without a name");
+ name = "<no name>";
+
+ printf ("[%" PRIx64 "] %s\n", off, name);
Dwarf_Addr lowpc = 0;
Dwarf_Addr highpc = 0;
@@ -101,9 +103,31 @@
a.file = dwarf_diename (a.cu);
handle_die (a.cu, &a);
dwarf_getfuncs (a.cu, &handle_die, &a, 0);
+
+ uint8_t unit_type;
+ Dwarf_Die subdie;
+ if (dwarf_cu_info (a.cu->cu, NULL, &unit_type, NULL, &subdie,
+ NULL, NULL, NULL) != 0)
+ {
+ Dwarf_Off off = dwarf_dieoffset (a.cu);
+ fail (off, "dwarf_cu_info", dwarf_errmsg (-1));
+ }
+
+ if (unit_type == DW_UT_skeleton)
+ {
+ const char *name = dwarf_diename (&subdie) ?: "<unknown>";
+ printf ("Following split subdie: %s\n", name);
+ struct args b = a;
+ b.cu = &subdie;
+ handle_die (b.cu, &b);
+ dwarf_getfuncs (b.cu, &handle_die, &b, 0);
+ printf ("Done subdie: %s\n", name);
+ }
}
dwfl_end (a.dwfl);
+ printf ("\n");
+
return result;
}
diff --git a/tests/md5-sha1-test.c b/tests/md5-sha1-test.c
deleted file mode 100644
index d50355e..0000000
--- a/tests/md5-sha1-test.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Copyright (C) 2011 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/>. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <string.h>
-#include <error.h>
-
-#include "md5.h"
-#include "sha1.h"
-
-static const struct expected
-{
- const char *sample;
- const char *md5_expected;
- const char *sha1_expected;
-} tests[] =
- {
- {
- "abc",
- "\x90\x01\x50\x98\x3c\xd2\x4f\xb0\xd6\x96\x3f\x7d\x28\xe1\x7f\x72",
- "\xa9\x99\x3e\x36\x47\x06\x81\x6a\xba\x3e"
- "\x25\x71\x78\x50\xc2\x6c\x9c\xd0\xd8\x9d"
- },
- {
- "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
- "\x82\x15\xef\x07\x96\xa2\x0b\xca\xaa\xe1\x16\xd3\x87\x6c\x66\x4a",
- "\x84\x98\x3e\x44\x1c\x3b\xd2\x6e\xba\xae"
- "\x4a\xa1\xf9\x51\x29\xe5\xe5\x46\x70\xf1"
- },
- {
- "\0a",
- "\x77\x07\xd6\xae\x4e\x02\x7c\x70\xee\xa2\xa9\x35\xc2\x29\x6f\x21",
- "\x34\xaa\x97\x3c\xd4\xc4\xda\xa4\xf6\x1e"
- "\xeb\x2b\xdb\xad\x27\x31\x65\x34\x01\x6f",
- },
- {
- "When in the Course of human events it becomes necessary",
- "\x62\x6b\x5e\x22\xcd\x3d\x02\xea\x07\xde\xd4\x50\x62\x3d\xb9\x96",
- "\x66\xc3\xc6\x8d\x62\x91\xc5\x1e\x63\x0c"
- "\x85\xc8\x6c\xc4\x4b\x3a\x79\x3e\x07\x28",
- },
- };
-#define NTESTS (sizeof tests / sizeof tests[0])
-
-#define md5_size 16
-#define sha1_size 20
-
-#define TEST_HASH(ALGO, I) \
- { \
- struct ALGO##_ctx ctx; \
- uint32_t result_buffer[(ALGO##_size + 3) / 4]; \
- ALGO##_init_ctx (&ctx); \
- if (tests[I].sample[0] == '\0') \
- { \
- char input_buffer[1000]; \
- memset (input_buffer, tests[I].sample[1], sizeof input_buffer); \
- for (int rept = 0; rept < 1000; ++rept) \
- ALGO##_process_bytes (input_buffer, sizeof input_buffer, &ctx); \
- } \
- else \
- ALGO##_process_bytes (tests[I].sample, strlen (tests[I].sample), &ctx); \
- char *result = ALGO##_finish_ctx (&ctx, result_buffer); \
- if (result != (void *) result_buffer \
- || memcmp (result, tests[I].ALGO##_expected, ALGO##_size) != 0) \
- error (0, 0, #ALGO " test %zu failed", 1 + I); \
- }
-
-int
-main (void)
-{
- for (size_t i = 0; i < NTESTS; ++i)
- {
- TEST_HASH (md5, i);
- TEST_HASH (sha1, i);
- }
- return error_message_count;
-}
diff --git a/tests/msg_tst.c b/tests/msg_tst.c
index 7baea0a..aa974d0 100644
--- a/tests/msg_tst.c
+++ b/tests/msg_tst.c
@@ -39,6 +39,7 @@
{ ELF_E_INVALID_ENCODING, "invalid encoding" },
{ ELF_E_NOMEM, "out of memory" },
{ ELF_E_INVALID_FILE, "invalid file descriptor" },
+ { ELF_E_INVALID_ELF, "invalid ELF file data" },
{ ELF_E_INVALID_OP, "invalid operation" },
{ ELF_E_NO_VERSION, "ELF version not set" },
{ ELF_E_INVALID_CMD, "invalid command" },
diff --git a/tests/next-files.c b/tests/next-files.c
new file mode 100644
index 0000000..9de5c8b
--- /dev/null
+++ b/tests/next-files.c
@@ -0,0 +1,93 @@
+/* A variant of get-files test that uses dwarf_next_lines.
+ Copyright (C) 2002, 2004, 2005, 2007, 2014, 2018 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/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <fcntl.h>
+#include <inttypes.h>
+#include <libelf.h>
+#include ELFUTILS_HEADER(dw)
+#include <stdio.h>
+#include <unistd.h>
+
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int cnt;
+
+ for (cnt = 1; cnt < argc; ++cnt)
+ {
+ int fd = open (argv[cnt], O_RDONLY);
+
+ Dwarf *dbg = dwarf_begin (fd, DWARF_C_READ);
+ if (dbg == NULL)
+ {
+ printf ("%s not usable\n", argv[cnt]);
+ result = 1;
+ if (fd != -1)
+ close (fd);
+ continue;
+ }
+
+ Dwarf_Off off;
+ Dwarf_Off next_off = 0;
+ Dwarf_CU *cu = NULL;
+ Dwarf_Files *files;
+ size_t nfiles;
+ int res;
+ while ((res = dwarf_next_lines (dbg, off = next_off, &next_off, &cu,
+ &files, &nfiles, NULL, NULL)) == 0)
+ {
+ printf ("off = %" PRIu64 "\n", off);
+
+ const char *const *dirs;
+ size_t ndirs;
+ if (dwarf_getsrcdirs (files, &dirs, &ndirs) != 0)
+ {
+ printf ("%s: cannot get include directories\n", argv[cnt]);
+ result = 1;
+ break;
+ }
+
+ if (dirs[0] == NULL)
+ puts (" dirs[0] = (null)");
+ else
+ printf (" dirs[0] = \"%s\"\n", dirs[0]);
+ for (size_t i = 1; i < ndirs; ++i)
+ printf (" dirs[%zu] = \"%s\"\n", i, dirs[i]);
+
+ for (size_t i = 0; i < nfiles; ++i)
+ printf (" file[%zu] = \"%s\"\n", i,
+ dwarf_filesrc (files, i, NULL, NULL));
+ }
+
+ if (res < 0)
+ {
+ printf ("dwarf_next_lines failed: %s\n", dwarf_errmsg (-1));
+ result = 1;
+ }
+
+ dwarf_end (dbg);
+ close (fd);
+ }
+
+ return result;
+}
diff --git a/tests/next-lines.c b/tests/next-lines.c
new file mode 100644
index 0000000..cfb74cd
--- /dev/null
+++ b/tests/next-lines.c
@@ -0,0 +1,144 @@
+/* A variant of get-lines that uses dwarf_next_lines.
+ Copyright (C) 2002, 2004, 2018 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/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <fcntl.h>
+#include <inttypes.h>
+#include <libelf.h>
+#include ELFUTILS_HEADER(dw)
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int cnt;
+
+ for (cnt = 1; cnt < argc; ++cnt)
+ {
+ int fd = open (argv[cnt], O_RDONLY);
+
+ Dwarf *dbg = dwarf_begin (fd, DWARF_C_READ);
+ if (dbg == NULL)
+ {
+ printf ("%s not usable: %s\n", argv[cnt], dwarf_errmsg (-1));
+ close (fd);
+ continue;
+ }
+
+ Dwarf_Off off;
+ Dwarf_Off next_off = 0;
+ Dwarf_CU *cu = NULL;
+ Dwarf_Lines *lb;
+ size_t nlb;
+ int res;
+ while ((res = dwarf_next_lines (dbg, off = next_off, &next_off, &cu,
+ NULL, NULL, &lb, &nlb)) == 0)
+ {
+ printf ("off = %" PRIu64 "\n", off);
+ printf (" %zu lines\n", nlb);
+
+ for (size_t i = 0; i < nlb; ++i)
+ {
+ Dwarf_Line *l = dwarf_onesrcline (lb, i);
+ if (l == NULL)
+ {
+ printf ("%s: cannot get individual line\n", argv[cnt]);
+ result = 1;
+ break;
+ }
+
+ Dwarf_Addr addr;
+ if (dwarf_lineaddr (l, &addr) != 0)
+ addr = 0;
+ const char *file = dwarf_linesrc (l, NULL, NULL);
+ int line;
+ if (dwarf_lineno (l, &line) != 0)
+ line = 0;
+
+ printf ("%" PRIx64 ": %s:%d:", (uint64_t) addr,
+ file ?: "???", line);
+
+ /* Getting the file path through the Dwarf_Files should
+ result in the same path. */
+ Dwarf_Files *files;
+ size_t idx;
+ if (dwarf_line_file (l, &files, &idx) != 0)
+ {
+ printf ("%s: cannot get file from line (%zd): %s\n",
+ argv[cnt], i, dwarf_errmsg (-1));
+ result = 1;
+ break;
+ }
+ const char *path = dwarf_filesrc (files, idx, NULL, NULL);
+ if ((path == NULL && file != NULL)
+ || (path != NULL && file == NULL)
+ || (strcmp (file, path) != 0))
+ {
+ printf ("%s: line %zd srcline (%s) != file srcline (%s)\n",
+ argv[cnt], i, file ?: "???", path ?: "???");
+ result = 1;
+ break;
+ }
+
+ int column;
+ if (dwarf_linecol (l, &column) != 0)
+ column = 0;
+ if (column >= 0)
+ printf ("%d:", column);
+
+ bool is_stmt;
+ if (dwarf_linebeginstatement (l, &is_stmt) != 0)
+ is_stmt = false;
+ bool end_sequence;
+ if (dwarf_lineendsequence (l, &end_sequence) != 0)
+ end_sequence = false;
+ bool basic_block;
+ if (dwarf_lineblock (l, &basic_block) != 0)
+ basic_block = false;
+ bool prologue_end;
+ if (dwarf_lineprologueend (l, &prologue_end) != 0)
+ prologue_end = false;
+ bool epilogue_begin;
+ if (dwarf_lineepiloguebegin (l, &epilogue_begin) != 0)
+ epilogue_begin = false;
+
+ printf (" is_stmt:%s, end_seq:%s, bb:%s, prologue:%s, epilogue:%s\n",
+ is_stmt ? "yes" : "no", end_sequence ? "yes" : "no",
+ basic_block ? "yes" : "no", prologue_end ? "yes" : "no",
+ epilogue_begin ? "yes" : "no");
+ }
+ }
+
+ if (res < 0)
+ {
+ printf ("dwarf_next_lines failed: %s\n", dwarf_errmsg (-1));
+ result = 1;
+ }
+
+ dwarf_end (dbg);
+ close (fd);
+ }
+
+ return result;
+}
diff --git a/tests/next_cfi.c b/tests/next_cfi.c
new file mode 100644
index 0000000..b923744
--- /dev/null
+++ b/tests/next_cfi.c
@@ -0,0 +1,131 @@
+/* Test program for dwarf_next_cfi
+ Copyright (C) 2018 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/>. */
+
+#include <config.h>
+#include <assert.h>
+#include <inttypes.h>
+#include <error.h>
+#include ELFUTILS_HEADER(dw)
+#include <dwarf.h>
+#include <argp.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+void
+handle_section (const unsigned char e_ident[],
+ Elf_Scn *scn, const bool is_eh)
+{
+ if (is_eh)
+ printf (".eh_frame\n");
+ else
+ printf (".debug_frame\n");
+
+ Elf_Data *data = elf_getdata (scn, NULL);
+ if (data == NULL || data->d_buf == NULL)
+ error (EXIT_FAILURE, 0, "no section data");
+
+ int res;
+ Dwarf_Off off;
+ Dwarf_Off next_off = 0;
+ Dwarf_CFI_Entry entry;
+ while ((res = dwarf_next_cfi (e_ident, data, is_eh, off = next_off,
+ &next_off, &entry)) == 0)
+ {
+ printf ("[%" PRId64 "] ", off);
+ if (dwarf_cfi_cie_p (&entry))
+ printf ("CIE augmentation=\"%s\"\n", entry.cie.augmentation);
+ else
+ {
+ printf ("FDE cie=[%" PRId64 "]\n", entry.fde.CIE_pointer);
+
+ Dwarf_Off cie_off = entry.fde.CIE_pointer;
+ Dwarf_Off cie_off_next;
+ Dwarf_CFI_Entry cie_entry;
+ if (dwarf_next_cfi (e_ident, data, is_eh, cie_off, &cie_off_next,
+ &cie_entry) != 0
+ || !dwarf_cfi_cie_p (&cie_entry))
+ error (EXIT_FAILURE, 0, "FDE doesn't point to CIE");
+ }
+ }
+
+ if (res < 0)
+ error (EXIT_FAILURE, 0, "dwarf_next_cfi failed: %s\n",
+ dwarf_errmsg (-1));
+}
+
+int
+main (int argc, char *argv[])
+{
+ if (argc != 2)
+ error (EXIT_FAILURE, 0, "need file name argument");
+
+ const char *file = argv[1];
+ printf ("%s\n", file);
+
+ int fd = open (file, O_RDONLY);
+ if (fd == -1)
+ error (EXIT_FAILURE, errno, "cannot open input file `%s'", file);
+
+ elf_version (EV_CURRENT);
+
+ Elf *elf = elf_begin (fd, ELF_C_READ, NULL);
+ if (elf == NULL)
+ error (EXIT_FAILURE, 0, "cannot create ELF descriptor: %s",
+ elf_errmsg (-1));
+
+ size_t esize;
+ const unsigned char *ident = (const unsigned char *) elf_getident (elf,
+ &esize);
+ if (ident == NULL || esize < EI_NIDENT)
+ error (EXIT_FAILURE, 0, "no, or too small, ELF ident");
+
+ GElf_Ehdr ehdr;
+ if (gelf_getehdr (elf, &ehdr) == NULL)
+ error (EXIT_FAILURE, 0, "cannot get the ELF header: %s\n",
+ elf_errmsg (-1));
+
+ size_t strndx = ehdr.e_shstrndx;
+
+ Elf_Scn *scn = NULL;
+ while ((scn = elf_nextscn (elf, scn)) != NULL)
+ {
+ GElf_Shdr shdr;
+ if (gelf_getshdr (scn, &shdr) != NULL)
+ {
+ char *name = elf_strptr (elf, strndx, (size_t) shdr.sh_name);
+ if (name != NULL && shdr.sh_type == SHT_PROGBITS)
+ {
+ if (strcmp (name, ".eh_frame") == 0)
+ handle_section (ident, scn, true);
+ if (strcmp (name, ".debug_frame") == 0)
+ handle_section (ident, scn, false);
+ }
+ }
+ }
+
+ elf_end (elf);
+ close (fd);
+
+ return 0;
+}
diff --git a/tests/peel_type.c b/tests/peel_type.c
new file mode 100644
index 0000000..bccce32
--- /dev/null
+++ b/tests/peel_type.c
@@ -0,0 +1,119 @@
+/* Test program for dwarf_peel_type. Peels type of top-level vars.
+ 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 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/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <assert.h>
+#include <argp.h>
+#include <inttypes.h>
+#include <fcntl.h>
+#include ELFUTILS_HEADER(dw)
+#include ELFUTILS_HEADER(dwfl)
+#include <stdio.h>
+#include <unistd.h>
+#include <dwarf.h>
+
+#include "../libdw/known-dwarf.h"
+
+static const char *
+dwarf_tag_string (unsigned int tag)
+{
+ switch (tag)
+ {
+#define DWARF_ONE_KNOWN_DW_TAG(NAME, CODE) case CODE: return #NAME;
+ DWARF_ALL_KNOWN_DW_TAG
+#undef DWARF_ONE_KNOWN_DW_TAG
+ default:
+ return NULL;
+ }
+}
+
+void
+print_var_raw_type (Dwarf_Die *var)
+{
+ Dwarf_Attribute attr_mem;
+ Dwarf_Die type_mem;
+ Dwarf_Die *type;
+ const char *name = dwarf_diename (var);
+
+ type = dwarf_formref_die (dwarf_attr (var, DW_AT_type, &attr_mem),
+ &type_mem);
+ if (type != NULL)
+ {
+ /* Test twice, once with a separate result DIE. Then with the
+ DIE itself. The resulting tag should be the same. */
+ Dwarf_Die result_mem;
+ Dwarf_Die *result = &result_mem;
+ int res = dwarf_peel_type (type, result);
+ if (res < 0)
+ printf ("%s error peeling type: %s\n", name, dwarf_errmsg (-1));
+ else if (res > 0)
+ printf ("%s missing DW_TAG_TYPE, could peel further: %s\n",
+ name, dwarf_tag_string (dwarf_tag (result)));
+ else
+ {
+ int tag = dwarf_tag (result);
+ printf ("%s raw type %s\n", name, dwarf_tag_string (tag));
+ res = dwarf_peel_type (type, type);
+ if (res < 0)
+ printf ("%s cannot peel type itself: %s\n", name,
+ dwarf_errmsg (-1));
+ else if (res > 0)
+ printf ("%s missing DW_TAG_TYPE, could peel type further: %s\n",
+ name, dwarf_tag_string (dwarf_tag (type)));
+ else if (dwarf_tag (type) != tag)
+ printf ("%s doesn't resolve the same: %s != %s\n", name,
+ dwarf_tag_string (tag),
+ dwarf_tag_string (dwarf_tag (type)));
+ }
+ }
+ else
+ printf ("%s has no type.\n", name);
+}
+
+int
+main (int argc, char *argv[])
+{
+
+ int remaining;
+ Dwfl *dwfl;
+ (void) argp_parse (dwfl_standard_argp (), argc, argv, 0, &remaining,
+ &dwfl);
+ assert (dwfl != NULL);
+
+ Dwarf_Die *cu = NULL;
+ Dwarf_Addr dwbias;
+ while ((cu = dwfl_nextcu (dwfl, cu, &dwbias)) != NULL)
+ {
+ Dwarf_Die die_mem;
+ Dwarf_Die *die = &die_mem;
+ dwarf_child (cu, &die_mem);
+
+ while (1)
+ {
+ if (dwarf_tag (die) == DW_TAG_variable)
+ print_var_raw_type (die);
+
+ if (dwarf_siblingof (die, &die_mem) != 0)
+ break;
+ }
+ }
+
+ dwfl_end (dwfl);
+}
diff --git a/tests/run-addrcfi.sh b/tests/run-addrcfi.sh
index c864eea..fd89d02 100755
--- a/tests/run-addrcfi.sh
+++ b/tests/run-addrcfi.sh
@@ -397,9 +397,9 @@
privileged reg111 (spr11): undefined
privileged reg112 (spr12): undefined
privileged reg113 (spr13): undefined
- privileged reg114 (spr14): undefined
- privileged reg115 (spr15): undefined
- privileged reg116 (spr16): undefined
+ privileged reg114 (tfhar): undefined
+ privileged reg115 (tfiar): undefined
+ privileged reg116 (texasr): undefined
privileged reg117 (spr17): undefined
privileged reg118 (dsisr): undefined
privileged reg119 (dar): undefined
@@ -1419,9 +1419,9 @@
privileged reg111 (spr11): undefined
privileged reg112 (spr12): undefined
privileged reg113 (spr13): undefined
- privileged reg114 (spr14): undefined
- privileged reg115 (spr15): undefined
- privileged reg116 (spr16): undefined
+ privileged reg114 (tfhar): undefined
+ privileged reg115 (tfiar): undefined
+ privileged reg116 (texasr): undefined
privileged reg117 (spr17): undefined
privileged reg118 (dsisr): undefined
privileged reg119 (dar): undefined
@@ -2447,9 +2447,9 @@
privileged reg111 (spr11): undefined
privileged reg112 (spr12): undefined
privileged reg113 (spr13): undefined
- privileged reg114 (spr14): undefined
- privileged reg115 (spr15): undefined
- privileged reg116 (spr16): undefined
+ privileged reg114 (tfhar): undefined
+ privileged reg115 (tfiar): undefined
+ privileged reg116 (texasr): undefined
privileged reg117 (spr17): undefined
privileged reg118 (dsisr): undefined
privileged reg119 (dar): undefined
@@ -3637,7 +3637,7 @@
integer reg28 (x28): same_value
integer reg29 (x29): same_value
integer reg30 (x30): same_value
- integer reg31 (sp): undefined
+ integer reg31 (sp): location expression: call_frame_cfa stack_value
integer reg33 (elr): undefined
FP/SIMD reg64 (v0): undefined
FP/SIMD reg65 (v1): undefined
diff --git a/tests/run-aggregate-size.sh b/tests/run-aggregate-size.sh
index 42b0742..08d57bb 100755
--- a/tests/run-aggregate-size.sh
+++ b/tests/run-aggregate-size.sh
@@ -54,6 +54,7 @@
# volatile int ia[32];
# const volatile void * const volatile restrict va[64];
# struct s sa[8];
+# double d3d[3][4][5];
#
# typedef const int foo;
# typedef volatile foo bar;
@@ -62,7 +63,9 @@
#
# gcc -std=c99 -g -c -o testfile-sizes3.o sizes.c
-testfiles testfile-sizes1.o testfile-sizes2.o testfile-sizes3.o
+# The file testfile-size4.o is hand-crafted.
+
+testfiles testfile-sizes1.o testfile-sizes2.o testfile-sizes3.o testfile-sizes4.o
testrun_compare ${abs_builddir}/aggregate_size -e testfile-sizes1.o <<\EOF
c size 1
@@ -98,8 +101,13 @@
ia size 128
va size 512
sa size 128
+d3d size 480
f size 4
b size 4
EOF
+testrun_compare ${abs_builddir}/aggregate_size -e testfile-sizes4.o <<\EOF
+v size 257
+EOF
+
exit 0
diff --git a/tests/run-all-dwarf-ranges.sh b/tests/run-all-dwarf-ranges.sh
new file mode 100755
index 0000000..cefb423
--- /dev/null
+++ b/tests/run-all-dwarf-ranges.sh
@@ -0,0 +1,129 @@
+#! /bin/sh
+# Copyright (C) 2018 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/>.
+
+. $srcdir/test-subr.sh
+
+# See run-dwarf-ranges.sh
+# Compiled with:
+# gcc -c -O2 -o testfile-ranges-hello.o -gsplit-dwarf -gdwarf-4 hello.c
+# gcc -c -O2 -o testfile-ranges-world.o -gsplit-dwarf -gdwarf-4 world.c
+# gcc -o testfilesplitranges4 -O2 \
+# testfile-ranges-hello.o testfile-ranges-world.o
+# eu-strip -f testfilesplitranges4.debug testfilesplitranges4
+
+testfiles testfilesplitranges4.debug
+testfiles testfile-ranges-hello.dwo testfile-ranges-world.dwo
+
+testrun_compare ${abs_builddir}/all-dwarf-ranges testfilesplitranges4.debug <<\EOF
+die: hello.c (11)
+ 4004e0..4004ff
+ 4003e0..4003f7
+
+die: no_say (2e)
+ 4004f0..4004ff
+
+die: main (2e)
+ 4003e0..4003f7
+
+die: subject (1d)
+ 4003e3..4003ef
+
+die: subject (2e)
+ 4004e0..4004f0
+
+die: world.c (11)
+ 400500..400567
+
+die: no_main (2e)
+ 400550..400567
+
+die: no_subject (1d)
+ 400553..40055f
+
+die: say (2e)
+ 400500..400540
+
+die: happy (1d)
+ 40051c..400526
+ 400530..400534
+ 400535..40053f
+
+die: sad (1d)
+ 40051c..400526
+ 400535..40053f
+
+die: no_subject (2e)
+ 400540..400550
+
+EOF
+
+# Same with -gdwarf-5
+# gcc -c -O2 -o testfile-ranges-hello5.o -gsplit-dwarf -gdwarf-5 hello.c
+# gcc -c -O2 -o testfile-ranges-world5.o -gsplit-dwarf -gdwarf-5 world.c
+# gcc -o testfilesplitranges5 -O2 testfile-ranges-hello5.o testfile-ranges-world5.o
+# eu-strip -f testfilesplitranges5.debug testfilesplitranges5
+
+testfiles testfilesplitranges5.debug
+testfiles testfile-ranges-hello5.dwo testfile-ranges-world5.dwo
+
+testrun_compare ${abs_builddir}/all-dwarf-ranges testfilesplitranges5.debug <<\EOF
+die: hello.c (11)
+ 401150..40117a
+ 401050..401067
+
+die: no_say (2e)
+ 401160..40117a
+
+die: main (2e)
+ 401050..401067
+
+die: subject (1d)
+ 401053..40105f
+
+die: subject (2e)
+ 401150..401160
+
+die: world.c (11)
+ 401180..4011e7
+
+die: no_main (2e)
+ 4011d0..4011e7
+
+die: no_subject (1d)
+ 4011d3..4011df
+
+die: say (2e)
+ 401180..4011c0
+
+die: happy (1d)
+ 40119b..40119b
+ 40119c..4011a6
+ 4011b0..4011b4
+ 4011b5..4011bf
+
+die: sad (1d)
+ 40119b..40119b
+ 40119c..4011a6
+ 4011b4..4011b4
+ 4011b5..4011bf
+
+die: no_subject (2e)
+ 4011c0..4011d0
+
+EOF
+
+exit 0
diff --git a/tests/run-allfcts-multi.sh b/tests/run-allfcts-multi.sh
index 727b76e..ef7bb30 100755
--- a/tests/run-allfcts-multi.sh
+++ b/tests/run-allfcts-multi.sh
@@ -53,4 +53,20 @@
/tmp/test-offset-loop.c:7:main
EOF
+# allfcts has a too simple mechanism for setting the alt file.
+# check that if we don't set it, things still work (because libdw will
+# find the alt file for us).
+mkdir subdir
+mv test-offset-loop test-offset-loop.alt subdir/
+testrun ${abs_builddir}/allfcts subdir/test-offset-loop > allfcts.out
+testrun_compare cat allfcts.out <<\EOF
+Warning: no alt file found.
+/tmp/test-offset-loop.c:6:get_errno
+/tmp/test-offset-loop.c:5:is_error
+/tmp/test-offset-loop.c:4:padding
+/tmp/test-offset-loop.c:7:main
+EOF
+
+rm -rf subdir
+
exit 0
diff --git a/tests/run-allregs.sh b/tests/run-allregs.sh
index 1f86429..7ddd452 100755
--- a/tests/run-allregs.sh
+++ b/tests/run-allregs.sh
@@ -253,9 +253,9 @@
111: spr11 (spr11), unsigned 32 bits
112: spr12 (spr12), unsigned 32 bits
113: spr13 (spr13), unsigned 32 bits
- 114: spr14 (spr14), unsigned 32 bits
- 115: spr15 (spr15), unsigned 32 bits
- 116: spr16 (spr16), unsigned 32 bits
+ 114: tfhar (tfhar), unsigned 32 bits
+ 115: tfiar (tfiar), unsigned 32 bits
+ 116: texasr (texasr), unsigned 32 bits
117: spr17 (spr17), unsigned 32 bits
118: dsisr (dsisr), unsigned 32 bits
119: dar (dar), unsigned 32 bits
@@ -1276,9 +1276,9 @@
111: spr11 (spr11), unsigned 64 bits
112: spr12 (spr12), unsigned 64 bits
113: spr13 (spr13), unsigned 64 bits
- 114: spr14 (spr14), unsigned 64 bits
- 115: spr15 (spr15), unsigned 64 bits
- 116: spr16 (spr16), unsigned 64 bits
+ 114: tfhar (tfhar), unsigned 64 bits
+ 115: tfiar (tfiar), unsigned 64 bits
+ 116: texasr (texasr), unsigned 64 bits
117: spr17 (spr17), unsigned 64 bits
118: dsisr (dsisr), unsigned 64 bits
119: dar (dar), unsigned 64 bits
@@ -2870,4 +2870,36 @@
39: %st6 (st6), float 80 bits
40: %st7 (st7), float 80 bits
EOF
+
+# See run-readelf-mixed-corenote.sh for instructions to regenerate
+# this core file.
+regs_test testfile-m68k-core <<\EOF
+integer registers:
+ 0: %d0 (d0), signed 32 bits
+ 1: %d1 (d1), signed 32 bits
+ 2: %d2 (d2), signed 32 bits
+ 3: %d3 (d3), signed 32 bits
+ 4: %d4 (d4), signed 32 bits
+ 5: %d5 (d5), signed 32 bits
+ 6: %d6 (d6), signed 32 bits
+ 7: %d7 (d7), signed 32 bits
+ 8: %a0 (a0), address 32 bits
+ 9: %a1 (a1), address 32 bits
+ 10: %a2 (a2), address 32 bits
+ 11: %a3 (a3), address 32 bits
+ 12: %a4 (a4), address 32 bits
+ 13: %a5 (a5), address 32 bits
+ 14: %a6 (a6), address 32 bits
+ 15: %a7 (a7), address 32 bits
+ 24: %pc (pc), address 32 bits
+FPU registers:
+ 16: %fp0 (fp0), float 96 bits
+ 17: %fp1 (fp1), float 96 bits
+ 18: %fp2 (fp2), float 96 bits
+ 19: %fp3 (fp3), float 96 bits
+ 20: %fp4 (fp4), float 96 bits
+ 21: %fp5 (fp5), float 96 bits
+ 22: %fp6 (fp6), float 96 bits
+ 23: %fp7 (fp7), float 96 bits
+EOF
exit 0
diff --git a/tests/run-ar.sh b/tests/run-ar.sh
new file mode 100755
index 0000000..fb9394d
--- /dev/null
+++ b/tests/run-ar.sh
@@ -0,0 +1,40 @@
+#! /bin/bash
+# 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 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/>.
+
+. $srcdir/test-subr.sh
+
+tempfiles objects.list test.ar
+
+echo Make a sorted list of the just build src .o files.
+(cd ${abs_top_builddir}/src; ls *.o | sort) > objects.list
+cat objects.list
+
+echo Create a new ar file with the .o files.
+testrun ${abs_top_builddir}/src/ar -r test.ar \
+ $(echo ${abs_top_builddir}/src/*.o | sort)
+
+echo List the ar file contents.
+testrun_compare ${abs_top_builddir}/src/ar -t test.ar < objects.list
+
+echo Delete all objects again.
+testrun ${abs_top_builddir}/src/ar -d test.ar $(cat objects.list)
+
+echo Check new ar file is now empty
+testrun_compare ${abs_top_builddir}/src/ar -t test.ar << EOF
+EOF
+
+exit 0
diff --git a/tests/run-attr-integrate-skel.sh b/tests/run-attr-integrate-skel.sh
new file mode 100755
index 0000000..a9a9409
--- /dev/null
+++ b/tests/run-attr-integrate-skel.sh
@@ -0,0 +1,52 @@
+#! /bin/sh
+# Copyright (C) 2018 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/>.
+
+. $srcdir/test-subr.sh
+
+# see tests/testfile-dwarf-45.source
+testfiles testfile-splitdwarf-4 testfile-hello4.dwo testfile-world4.dwo
+testfiles testfile-splitdwarf-5 testfile-hello5.dwo testfile-world5.dwo
+
+testrun_compare ${abs_builddir}/attr-integrate-skel testfile-splitdwarf-4 << EOF
+file: testfile-splitdwarf-4
+Split DIE: hello.c
+addr_base secoff: 0x0
+low_pc addr: 0x401160
+Skel has high_pc.
+
+Split DIE: world.c
+addr_base secoff: 0x98
+low_pc addr: 0x0
+Skel has ranges.
+
+EOF
+
+testrun_compare ${abs_builddir}/attr-integrate-skel testfile-splitdwarf-5 << EOF
+file: testfile-splitdwarf-5
+Split DIE: hello.c
+addr_base secoff: 0x8
+low_pc addr: 0x401160
+Skel has high_pc.
+
+Split DIE: world.c
+addr_base secoff: 0xa8
+low_pc addr: 0x0
+Skel has ranges.
+
+EOF
+
+exit 0
diff --git a/tests/run-backtrace-core-ppc.sh b/tests/run-backtrace-core-ppc.sh
index 65c9279..555ac35 100755
--- a/tests/run-backtrace-core-ppc.sh
+++ b/tests/run-backtrace-core-ppc.sh
@@ -17,4 +17,13 @@
. $srcdir/backtrace-subr.sh
+# executable generated by:
+#
+# gcc -D_GNU_SOURCE -I. -I.. -I../lib -m32 -pthread -static -g \
+# -o backtrace.ppc.exec backtrace-child.c
+#
+# core generated by:
+#
+# ./backtrace.ppc.exec --gencore
+
check_core ppc
diff --git a/tests/run-backtrace-fp-core-aarch64.sh b/tests/run-backtrace-fp-core-aarch64.sh
new file mode 100755
index 0000000..fda88d3
--- /dev/null
+++ b/tests/run-backtrace-fp-core-aarch64.sh
@@ -0,0 +1,28 @@
+#! /bin/bash
+# Copyright (C) 2017 The Qt Company
+# 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/>.
+
+. $srcdir/backtrace-subr.sh
+
+# The binary is generated by compiling with eh_frame CFI, but with frame
+# pointers.
+#
+# gcc -static -O2 -fno-omit-frame-pointer -fno-asynchronous-unwind-tables \
+# -D_GNU_SOURCE -pthread -o tests/backtrace.aarch64.fp.exec -I. -Ilib \
+# tests/backtrace-child.c
+# The core is generated by calling the binary with --gencore
+
+check_core aarch64.fp
diff --git a/tests/run-backtrace-fp-core-i386.sh b/tests/run-backtrace-fp-core-i386.sh
new file mode 100755
index 0000000..c58ff53
--- /dev/null
+++ b/tests/run-backtrace-fp-core-i386.sh
@@ -0,0 +1,29 @@
+#! /bin/bash
+# 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 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/>.
+
+. $srcdir/backtrace-subr.sh
+
+# The binary is generated by compiling backtrace-child without unwind
+# information, but with -fno-omit-frame-pointer.
+#
+# gcc -static -O2 -fno-omit-frame-pointer -fno-asynchronous-unwind-tables \
+# -D_GNU_SOURCE -pthread -o tests/backtrace.i386.fp.exec -I. -Ilib \
+# tests/backtrace-child.c
+#
+# The core is generated by calling tests/backtrace.i386.fp.exec --gencore
+
+check_core i386.fp
diff --git a/tests/run-backtrace-fp-core-ppc64le.sh b/tests/run-backtrace-fp-core-ppc64le.sh
new file mode 100755
index 0000000..326ca34
--- /dev/null
+++ b/tests/run-backtrace-fp-core-ppc64le.sh
@@ -0,0 +1,29 @@
+#! /bin/bash
+# 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 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/>.
+
+. $srcdir/backtrace-subr.sh
+
+# The binary is generated by compiling backtrace-child without unwind
+# information, but with -fno-omit-frame-pointer.
+#
+# gcc -static -O2 -fno-omit-frame-pointer -fno-asynchronous-unwind-tables \
+# -D_GNU_SOURCE -pthread -o tests/backtrace.ppc64le.fp.exec -I. -Ilib \
+# tests/backtrace-child.c
+#
+# The core is generated by calling tests/backtrace.ppc64le.fp.exec --gencore
+
+check_core ppc64le.fp
diff --git a/tests/run-backtrace-fp-core-x86_64.sh b/tests/run-backtrace-fp-core-x86_64.sh
new file mode 100755
index 0000000..348eb18
--- /dev/null
+++ b/tests/run-backtrace-fp-core-x86_64.sh
@@ -0,0 +1,29 @@
+#! /bin/bash
+# Copyright (C) 2017 The Qt Company
+# 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/>.
+
+. $srcdir/backtrace-subr.sh
+
+# The binary is generated by compiling with eh_frame CFI, but with frame
+# pointers.
+#
+# gcc -static -O2 -fno-omit-frame-pointer -fno-asynchronous-unwind-tables \
+# -D_GNU_SOURCE -pthread -o tests/backtrace.x86_64.fp.exec -I. -Ilib \
+# tests/backtrace-child.c
+#
+# The core is generated by calling the binary with --gencore
+
+check_core x86_64.fp
diff --git a/tests/run-disasm-bpf.sh b/tests/run-disasm-bpf.sh
new file mode 100755
index 0000000..8ca89d5
--- /dev/null
+++ b/tests/run-disasm-bpf.sh
@@ -0,0 +1,63 @@
+#! /bin/sh
+# Copyright (C) 2016 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/>.
+
+. $srcdir/test-subr.sh
+
+# This test file is created with
+#
+# #include <linux/bpf.h>
+# #include <stdio.h>
+#
+# int main()
+# {
+# int i;
+#
+# printf("\t.text\n");
+#
+# for (i = 0; i < 256; ++i)
+# if (i == (BPF_LD | BPF_IMM | BPF_DW))
+# printf("\t.byte\t%d, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n", i);
+# else
+# {
+# int regs = 0;
+# switch (BPF_CLASS(i))
+# {
+# case BPF_ALU:
+# case BPF_ALU64:
+# if (BPF_SRC(i) == BPF_X
+# && BPF_OP(i) != BPF_NEG
+# && BPF_OP(i) != BPF_END)
+# regs = 0x21;
+# break;
+# case BPF_LDX:
+# case BPF_STX:
+# regs = 0x21;
+# break;
+# }
+# printf("\t.byte\t%d, %d, 0, 0, 0, 0, 0, 0\n", i, regs);
+# }
+#
+# return 0;
+# }
+#
+# $ ./a.out | as -o z1.o
+# $ objcopy -j .text z1.o z2.o
+#
+# Then emacs hexl edit e_machine to 0xf7.
+
+testfiles testfile-bpf-dis1.o testfile-bpf-dis1.expect
+testrun_compare ${abs_top_builddir}/src/objdump -d testfile-bpf-dis1.o < testfile-bpf-dis1.expect
diff --git a/tests/run-dwarf-die-addr-die.sh b/tests/run-dwarf-die-addr-die.sh
new file mode 100755
index 0000000..951d1c5
--- /dev/null
+++ b/tests/run-dwarf-die-addr-die.sh
@@ -0,0 +1,52 @@
+#! /bin/sh
+# Copyright (C) 2012, 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/>.
+
+. $srcdir/test-subr.sh
+
+# See run-typeiter.sh
+testfiles testfile-debug-types
+
+testrun ${abs_builddir}/dwarf-die-addr-die testfile-debug-types
+
+# see run-readelf-dwz-multi.sh
+testfiles testfile_multi_main testfile_multi.dwz
+
+testrun ${abs_builddir}/dwarf-die-addr-die testfile_multi_main
+
+# see tests/run-dwflsyms.sh
+testfiles testfilebazdbgppc64.debug
+
+testrun ${abs_builddir}/dwarf-die-addr-die testfilebazdbgppc64.debug
+
+# see tests/testfile-dwarf-45.source
+testfiles testfile-dwarf-4 testfile-dwarf-5
+testfiles testfile-splitdwarf-4 testfile-hello4.dwo testfile-world4.dwo
+testfiles testfile-splitdwarf-5 testfile-hello5.dwo testfile-world5.dwo
+
+testrun ${abs_builddir}/dwarf-die-addr-die testfile-dwarf-4
+testrun ${abs_builddir}/dwarf-die-addr-die testfile-dwarf-5
+testrun ${abs_builddir}/dwarf-die-addr-die testfile-splitdwarf-4
+testrun ${abs_builddir}/dwarf-die-addr-die testfile-splitdwarf-5
+testrun ${abs_builddir}/dwarf-die-addr-die testfile-hello4.dwo
+testrun ${abs_builddir}/dwarf-die-addr-die testfile-world4.dwo
+testrun ${abs_builddir}/dwarf-die-addr-die testfile-hello5.dwo
+testrun ${abs_builddir}/dwarf-die-addr-die testfile-world5.dwo
+
+# Self test
+testrun_on_self ${abs_builddir}/dwarf-die-addr-die
+
+exit 0
diff --git a/tests/run-dwarf-ranges.sh b/tests/run-dwarf-ranges.sh
index d202ed3..ae25d6e 100755
--- a/tests/run-dwarf-ranges.sh
+++ b/tests/run-dwarf-ranges.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2015 Red Hat, Inc.
+# Copyright (C) 2015, 2018 Red Hat, Inc.
# This file is part of elfutils.
#
# This file is free software; you can redistribute it and/or modify
@@ -24,4 +24,103 @@
3..4 (base 0)
EOF
+# - hello.c
+# int say (const char *prefix);
+#
+# char *
+# subject (char *word, int count)
+# {
+# return count > 0 ? word : (word + count);
+# }
+#
+# int
+# main (int argc, char **argv)
+# {
+# return say (subject (argv[0], argc));
+# }
+#
+# int
+# no_say (const char *prefix)
+# {
+# const char *world = subject ("World", 42);
+# return prefix ? say (prefix) : say (world);
+# }
+#
+# - world.c
+# char * subject (char *word, int count);
+# int no_say (const char *prefix);
+#
+# static int
+# sad (char c)
+# {
+# return c > 0 ? c : c + 1;
+# }
+#
+# static int
+# happy (const char *w)
+# {
+# return sad (w[1]);
+# }
+#
+# int
+# say (const char *prefix)
+# {
+# const char *world = subject ("World", 42);;
+# return prefix ? sad (prefix[0]) : happy (world);
+# }
+#
+# char *
+# no_subject (char *word, int count)
+# {
+# return count > 0 ? word : (word + count);
+# }
+#
+# int
+# no_main (int argc, char **argv)
+# {
+# return no_say (no_subject (argv[0], argc));
+# }
+#
+# - gcc -c -O2 -gdwarf-4 hello.c
+# - gcc -c -O2 -gdwarf-4 world.c
+# - gcc -o testfileranges4 -O2 -gdwarf-4 hello.o world.o
+# - eu-strip -f testfileranges4.debug testfileranges4
+
+testfiles testfileranges4.debug
+testrun_compare ${abs_builddir}/dwarf-ranges testfileranges4.debug 0xb <<\EOF
+400500..40053a (base 0)
+400400..400415 (base 0)
+EOF
+
+testrun_compare ${abs_builddir}/dwarf-ranges testfileranges4.debug 0xcd <<\EOF
+400400..400402 (base 0)
+400405..40040d (base 0)
+EOF
+
+testrun_compare ${abs_builddir}/dwarf-ranges testfileranges4.debug 0x374 <<\EOF
+4005a0..4005a2 (base 400540)
+4005a5..4005ad (base 400540)
+EOF
+
+# Like above, but with -gdwarf-5.
+testfiles testfileranges5.debug
+testrun_compare ${abs_builddir}/dwarf-ranges testfileranges5.debug 0xc <<\EOF
+401150..40117a (base 0)
+401050..401067 (base 0)
+EOF
+
+testrun_compare ${abs_builddir}/dwarf-ranges testfileranges5.debug 0x2ce <<\EOF
+40119b..40119b (base 401180)
+40119c..4011a6 (base 401180)
+4011b0..4011b4 (base 401180)
+4011b5..4011bf (base 401180)
+EOF
+
+testrun_compare ${abs_builddir}/dwarf-ranges testfileranges5.debug 0x2ef <<\EOF
+40119b..40119b (base 401180)
+40119c..4011a6 (base 401180)
+4011b4..4011b4 (base 401180)
+4011b5..4011bf (base 401180)
+EOF
+
exit 0
diff --git a/tests/run-dwarfcfi.sh b/tests/run-dwarfcfi.sh
new file mode 100755
index 0000000..98fa171
--- /dev/null
+++ b/tests/run-dwarfcfi.sh
@@ -0,0 +1,133 @@
+#! /bin/sh
+# Test for dwarf_getcfi.
+# Copyright (C) 2018 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/>.
+
+. $srcdir/test-subr.sh
+
+# Test files come from run-addrcfi with all sections stripped except
+# the .debug_frame.
+# for i in <testfiles>
+# eu-strip -f $i-debugframe $i
+# eu-strip -g --remove-comment --keep-section=.debug_frame $i-debugframe
+# done
+testfiles testfile11-debugframe testfile12-debugframe
+testfiles testfileaarch64-debugframe
+testfiles testfilearm-debugframe
+testfiles testfileppc32-debugframe
+testfiles testfileppc64-debugframe
+
+testfiles testfile11-debugframe
+testrun_compare ${abs_builddir}/dwarfcfi testfile11-debugframe 0x080489b8 <<\EOF
+0x80489b8 => [0x80489b8, 0x80489b9):
+ return address in reg8
+ CFA location expression: bregx(4,4)
+ reg0: undefined
+ reg1: undefined
+ reg2: undefined
+ reg3: same_value
+ reg4: location expression: call_frame_cfa stack_value
+ reg5: same_value
+ reg6: same_value
+ reg7: same_value
+ reg8: location expression: call_frame_cfa plus_uconst(-4)
+ reg9: undefined
+EOF
+
+testfiles testfile12-debugframe
+testrun_compare ${abs_builddir}/dwarfcfi testfile12-debugframe 0x00000000000009d0 <<\EOF
+0x9d0 => [0x9d0, 0x9d1):
+ return address in reg16
+ CFA location expression: bregx(7,8)
+ reg0: same_value
+ reg1: undefined
+ reg2: undefined
+ reg3: undefined
+ reg4: undefined
+ reg5: undefined
+ reg6: same_value
+ reg7: location expression: call_frame_cfa stack_value
+ reg8: undefined
+ reg9: undefined
+EOF
+
+testfiles testfileppc32-debugframe
+testrun_compare ${abs_builddir}/dwarfcfi testfileppc32-debugframe 0x100004c0 <<\EOF
+0x100004c0 => [0x100004c0, 0x100004d0):
+ return address in reg65
+ CFA location expression: bregx(1)
+ reg0: undefined
+ reg1: location expression: call_frame_cfa stack_value
+ reg2: same_value
+ reg3: undefined
+ reg4: undefined
+ reg5: undefined
+ reg6: undefined
+ reg7: undefined
+ reg8: undefined
+ reg9: undefined
+EOF
+
+testfiles testfileppc64-debugframe
+testrun_compare ${abs_builddir}/dwarfcfi testfileppc64-debugframe 0x00000000100005b0 <<\EOF
+0x100005b0 => [0x100005b0, 0x100005d0):
+ return address in reg65
+ CFA location expression: bregx(1)
+ reg0: undefined
+ reg1: location expression: call_frame_cfa stack_value
+ reg2: same_value
+ reg3: undefined
+ reg4: undefined
+ reg5: undefined
+ reg6: undefined
+ reg7: undefined
+ reg8: undefined
+ reg9: undefined
+EOF
+
+testfiles testfilearm-debugframe
+testrun_compare ${abs_builddir}/dwarfcfi testfilearm-debugframe 0x00008510 <<\EOF
+0x8510 => [0x8510, 0x8524):
+ return address in reg14
+ CFA location expression: bregx(13)
+ reg0: undefined
+ reg1: undefined
+ reg2: undefined
+ reg3: undefined
+ reg4: same_value
+ reg5: same_value
+ reg6: same_value
+ reg7: same_value
+ reg8: same_value
+ reg9: undefined
+EOF
+
+testfiles testfileaarch64-debugframe
+testrun_compare ${abs_builddir}/dwarfcfi testfileaarch64-debugframe 0x400550 <<\EOF
+0x400550 => [0x400550, 0x400568):
+ return address in reg30
+ CFA location expression: bregx(31)
+ reg0: undefined
+ reg1: undefined
+ reg2: undefined
+ reg3: undefined
+ reg4: undefined
+ reg5: undefined
+ reg6: undefined
+ reg7: undefined
+ reg8: undefined
+ reg9: undefined
+EOF
diff --git a/tests/run-elflint-self.sh b/tests/run-elflint-self.sh
index 013109d..58fa7d0 100755
--- a/tests/run-elflint-self.sh
+++ b/tests/run-elflint-self.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2005, 2007 Red Hat, Inc.
+# Copyright (C) 2005, 2007, 2017 Red Hat, Inc.
# This file is part of elfutils.
# Written by Ulrich Drepper <drepper@redhat.com>, 2005.
#
@@ -19,3 +19,4 @@
. $srcdir/test-subr.sh
testrun_on_self ${abs_top_builddir}/src/elflint --quiet --gnu-ld
+testrun_on_self_compressed ${abs_top_builddir}/src/elflint --quiet --gnu-ld
diff --git a/tests/run-elflint-test.sh b/tests/run-elflint-test.sh
index 68615b9..caf172a 100755
--- a/tests/run-elflint-test.sh
+++ b/tests/run-elflint-test.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2005, 2007, 2008 Red Hat, Inc.
+# Copyright (C) 2005, 2007, 2008, 2015 Red Hat, Inc.
# This file is part of elfutils.
# Written by Ulrich Drepper <drepper@redhat.com>, 2005.
#
@@ -33,6 +33,11 @@
testfiles testfile42
testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testfile42
+# Contains debuginfo, compress it, recheck
+tempfiles testfile42z
+testrun ${abs_top_builddir}/src/elfcompress -f -q -o testfile42z testfile42
+testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testfile42z
+
testfiles testfile46
testrun ${abs_top_builddir}/src/elflint -q testfile46
@@ -40,4 +45,16 @@
testfiles testlib_dynseg.so
testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testlib_dynseg.so
+# s390x has SHT_HASH with sh_entsize 8 (really should be 4, but see common.h)
+# This was wrongly checked when comparing .gnu.hash and .hash.
+# Simple "int main (int argc, char **argv) { return 0; }"
+# gcc -Xlinker --hash-style=both -o testfile-s390x-hash-both s390x-hash-both.c
+testfiles testfile-s390x-hash-both
+testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testfile-s390x-hash-both
+
+# Compress the symtab/strtab just because and recheck
+tempfiles testfile-s390x-hash-bothz
+testrun ${abs_top_builddir}/src/elfcompress -f -q --name='.s??tab' -o testfile-s390x-hash-bothz testfile-s390x-hash-both
+testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testfile-s390x-hash-bothz
+
exit 0
diff --git a/tests/run-exprlocs-self.sh b/tests/run-exprlocs-self.sh
new file mode 100755
index 0000000..73d3ab9
--- /dev/null
+++ b/tests/run-exprlocs-self.sh
@@ -0,0 +1,22 @@
+#! /bin/sh
+# 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 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/>.
+
+. $srcdir/test-subr.sh
+
+# Just makes sure exprlocs doesn't crash, triggers self-check/asserts
+# or leaks memory under valgrind.
+testrun_on_self_quiet ${abs_top_builddir}/tests/varlocs --exprlocs -e
diff --git a/tests/run-exprlocs.sh b/tests/run-exprlocs.sh
new file mode 100755
index 0000000..379ca52
--- /dev/null
+++ b/tests/run-exprlocs.sh
@@ -0,0 +1,180 @@
+#! /bin/sh
+# 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 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/>.
+
+. $srcdir/test-subr.sh
+
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77589
+#
+# program repro
+# type small_stride
+# character*40 long_string
+# integer small_pad
+# end type small_stride
+# type(small_stride), dimension (20), target :: unpleasant
+# character*40, pointer, dimension(:):: c40pt
+# integer i
+# do i = 0,19
+# unpleasant(i+1)%small_pad = i+1
+# unpleasant(i+1)%long_string = char (ichar('0') + i) // '-hello'
+# end do
+# c40pt => unpleasant%long_string
+# print *, c40pt ! break-here
+# end program repro
+#
+# Needs GCC7+
+# gfortran -o testfile-stridex dwarf-stridex.f90 -Wall -g
+
+testfiles testfile-stridex
+
+testrun_compare ${abs_top_builddir}/tests/varlocs --exprlocs -e testfile-stridex <<\EOF
+module 'testfile-stridex'
+[b] CU 'dwarf-stridex.f90'@400717
+ producer (strp)
+ language (data1)
+ identifier_case (data1)
+ name (strp)
+ comp_dir (strp)
+ low_pc (addr)
+ high_pc (data8)
+ stmt_list (sec_offset)
+ [2e] base_type "integer(kind=8)"
+ byte_size (data1)
+ encoding (data1)
+ name (strp)
+ [35] structure_type "small_stride"
+ name (strp)
+ byte_size (data1)
+ decl_file (data1)
+ decl_line (data1)
+ sibling (ref4)
+ [41] member "long_string"
+ name (strp)
+ decl_file (data1)
+ decl_line (data1)
+ type (ref4)
+ data_member_location (data1) {plus_uconst(0)}
+ [4d] member "small_pad"
+ name (strp)
+ decl_file (data1)
+ decl_line (data1)
+ type (ref4)
+ data_member_location (data1) {plus_uconst(40)}
+ [5a] string_type
+ byte_size (data1)
+ [5c] base_type "integer(kind=4)"
+ byte_size (data1)
+ encoding (data1)
+ name (strp)
+ [63] const_type
+ type (ref4)
+ [68] subprogram "main"
+ external (flag_present)
+ name (strp)
+ decl_file (data1)
+ decl_line (data1)
+ type (ref4)
+ low_pc (addr)
+ high_pc (data8)
+ frame_base (exprloc) {call_frame_cfa {bregx(7,8)}}
+ GNU_all_tail_call_sites (flag_present)
+ sibling (ref4)
+ [89] formal_parameter "argc"
+ name (strp)
+ decl_file (data1)
+ decl_line (data1)
+ type (ref4)
+ location (exprloc) {fbreg(-20)}
+ [97] formal_parameter "argv"
+ name (strp)
+ decl_file (data1)
+ decl_line (data1)
+ type (ref4)
+ location (exprloc) {fbreg(-32), deref}
+ [a7] pointer_type
+ byte_size (data1)
+ type (ref4)
+ [ad] base_type "character(kind=1)"
+ byte_size (data1)
+ encoding (data1)
+ name (strp)
+ [b4] subprogram "repro"
+ name (strp)
+ decl_file (data1)
+ decl_line (data1)
+ main_subprogram (flag_present)
+ calling_convention (data1)
+ low_pc (addr)
+ high_pc (data8)
+ frame_base (exprloc) {call_frame_cfa {bregx(7,8)}}
+ GNU_all_tail_call_sites (flag_present)
+ sibling (ref4)
+ [d2] variable "c40pt"
+ name (strp)
+ decl_file (data1)
+ decl_line (data1)
+ type (ref4)
+ location (exprloc) {fbreg(-128)}
+ [e1] variable "span.0"
+ name (strp)
+ type (ref4)
+ artificial (flag_present)
+ location (exprloc) {fbreg(-80)}
+ [ee] variable "i"
+ name (string)
+ decl_file (data1)
+ decl_line (data1)
+ type (ref4)
+ location (exprloc) {fbreg(-68)}
+ [fb] variable "unpleasant"
+ name (strp)
+ decl_file (data1)
+ decl_line (data1)
+ type (ref4)
+ location (exprloc) {fbreg(-1008)}
+ [10a] lexical_block
+ low_pc (addr)
+ high_pc (data8)
+ sibling (ref4)
+ [11f] lexical_block
+ low_pc (addr)
+ high_pc (data8)
+ [131] lexical_block
+ low_pc (addr)
+ high_pc (data8)
+ [142] lexical_block
+ low_pc (addr)
+ high_pc (data8)
+ [153] lexical_block
+ low_pc (addr)
+ high_pc (data8)
+ [167] array_type
+ data_location (exprloc) {push_object_address, deref}
+ associated (exprloc) {push_object_address, deref, lit0, ne}
+ type (ref4)
+ sibling (ref4)
+ [178] subrange_type
+ lower_bound (exprloc) {push_object_address, plus_uconst(32), deref}
+ upper_bound (exprloc) {push_object_address, plus_uconst(40), deref}
+ byte_stride (exprloc) {push_object_address, plus_uconst(24), deref, GNU_variable_value([e1]) {fbreg(-80)}, mul}
+ [18f] array_type
+ type (ref4)
+ [194] subrange_type
+ type (ref4)
+ upper_bound (sdata)
+EOF
+
+exit 0
diff --git a/tests/run-get-files.sh b/tests/run-get-files.sh
index a2f2373..6f90be7 100755
--- a/tests/run-get-files.sh
+++ b/tests/run-get-files.sh
@@ -64,4 +64,70 @@
file[1] = "/shoggoth/drepper/m.c"
EOF
+# see tests/testfile-dwarf-45.source
+testfiles testfile-splitdwarf-4 testfile-hello4.dwo testfile-world4.dwo
+testfiles testfile-splitdwarf-5 testfile-hello5.dwo testfile-world5.dwo
+
+testrun_compare ${abs_builddir}/get-files testfile-splitdwarf-4 testfile-hello4.dwo testfile-world4.dwo <<\EOF
+cuhl = 11, o = 0, asz = 8, osz = 4, ncu = 52
+ dirs[0] = "/home/mark/src/elfutils/tests"
+ dirs[1] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include"
+ file[0] = "???"
+ file[1] = "/home/mark/src/elfutils/tests/hello.c"
+ file[2] = "/home/mark/src/elfutils/tests/hello.h"
+ file[3] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include/stddef.h"
+cuhl = 11, o = 26, asz = 8, osz = 4, ncu = 104
+ dirs[0] = "/home/mark/src/elfutils/tests"
+ dirs[1] = "/usr/include"
+ file[0] = "???"
+ file[1] = "/home/mark/src/elfutils/tests/world.c"
+ file[2] = "/home/mark/src/elfutils/tests/hello.h"
+ file[3] = "/usr/include/stdlib.h"
+cuhl = 11, o = 0, asz = 8, osz = 4, ncu = 414
+ dirs[0] = "/home/mark/src/elfutils/tests"
+ dirs[1] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include"
+ file[0] = "???"
+ file[1] = "/home/mark/src/elfutils/tests/hello.c"
+ file[2] = "/home/mark/src/elfutils/tests/hello.h"
+ file[3] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include/stddef.h"
+cuhl = 11, o = 0, asz = 8, osz = 4, ncu = 331
+ dirs[0] = "/home/mark/src/elfutils/tests"
+ dirs[1] = "/usr/include"
+ file[0] = "???"
+ file[1] = "/home/mark/src/elfutils/tests/world.c"
+ file[2] = "/home/mark/src/elfutils/tests/hello.h"
+ file[3] = "/usr/include/stdlib.h"
+EOF
+
+testrun_compare ${abs_builddir}/get-files testfile-splitdwarf-5 testfile-hello5.dwo testfile-world5.dwo <<\EOF
+cuhl = 20, o = 0, asz = 8, osz = 4, ncu = 53
+ dirs[0] = "/home/mark/src/elfutils/tests"
+ dirs[1] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include"
+ file[0] = "/home/mark/src/elfutils/tests/hello.c"
+ file[1] = "/home/mark/src/elfutils/tests/hello.c"
+ file[2] = "/home/mark/src/elfutils/tests/hello.h"
+ file[3] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include/stddef.h"
+cuhl = 20, o = 21, asz = 8, osz = 4, ncu = 106
+ dirs[0] = "/home/mark/src/elfutils/tests"
+ dirs[1] = "/usr/include"
+ file[0] = "/home/mark/src/elfutils/tests/world.c"
+ file[1] = "/home/mark/src/elfutils/tests/world.c"
+ file[2] = "/home/mark/src/elfutils/tests/hello.h"
+ file[3] = "/usr/include/stdlib.h"
+cuhl = 20, o = 0, asz = 8, osz = 4, ncu = 386
+ dirs[0] = "/home/mark/src/elfutils/tests"
+ dirs[1] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include"
+ file[0] = "/home/mark/src/elfutils/tests/hello.c"
+ file[1] = "/home/mark/src/elfutils/tests/hello.c"
+ file[2] = "/home/mark/src/elfutils/tests/hello.h"
+ file[3] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include/stddef.h"
+cuhl = 20, o = 0, asz = 8, osz = 4, ncu = 296
+ dirs[0] = "/home/mark/src/elfutils/tests"
+ dirs[1] = "/usr/include"
+ file[0] = "/home/mark/src/elfutils/tests/world.c"
+ file[1] = "/home/mark/src/elfutils/tests/world.c"
+ file[2] = "/home/mark/src/elfutils/tests/hello.h"
+ file[3] = "/usr/include/stdlib.h"
+EOF
+
exit 0
diff --git a/tests/run-get-units-invalid.sh b/tests/run-get-units-invalid.sh
new file mode 100755
index 0000000..66ef944
--- /dev/null
+++ b/tests/run-get-units-invalid.sh
@@ -0,0 +1,44 @@
+#! /bin/sh
+# Copyright (C) 2018 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/>.
+
+. $srcdir/test-subr.sh
+
+# See run-typeiter.sh
+testfiles testfile-debug-types
+
+testrun ${abs_builddir}/get-units-invalid testfile-debug-types
+
+# see run-readelf-dwz-multi.sh
+testfiles testfile_multi_main testfile_multi.dwz
+
+testrun ${abs_builddir}/get-units-invalid testfile_multi_main
+
+# see tests/run-dwflsyms.sh
+testfiles testfilebazdbgppc64.debug
+
+testrun ${abs_builddir}/get-units-invalid testfilebazdbgppc64.debug
+
+# see tests/testfile-dwarf-45.source
+testfiles testfile-dwarf-4 testfile-dwarf-5
+
+testrun ${abs_builddir}/get-units-invalid testfile-dwarf-4
+testrun ${abs_builddir}/get-units-invalid testfile-dwarf-5
+
+# Self test
+testrun_on_self ${abs_builddir}/get-units-invalid
+
+exit 0
diff --git a/tests/run-get-units-split.sh b/tests/run-get-units-split.sh
new file mode 100755
index 0000000..7a43c67
--- /dev/null
+++ b/tests/run-get-units-split.sh
@@ -0,0 +1,66 @@
+#! /bin/sh
+# Copyright (C) 2018 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/>.
+
+. $srcdir/test-subr.sh
+
+# See run-typeiter.sh
+testfiles testfile-debug-types
+
+testrun ${abs_builddir}/get-units-split testfile-debug-types
+
+# see run-readelf-dwz-multi.sh
+testfiles testfile_multi_main testfile_multi.dwz
+
+testrun ${abs_builddir}/get-units-split testfile_multi_main
+
+# see tests/run-dwflsyms.sh
+testfiles testfilebazdbgppc64.debug
+
+testrun ${abs_builddir}/get-units-split testfilebazdbgppc64.debug
+
+# see tests/testfile-dwarf-45.source
+testfiles testfile-dwarf-4 testfile-dwarf-5
+testfiles testfile-splitdwarf-4 testfile-hello4.dwo testfile-world4.dwo
+testfiles testfile-splitdwarf-5 testfile-hello5.dwo testfile-world5.dwo
+
+testrun ${abs_builddir}/get-units-split testfile-dwarf-4
+testrun ${abs_builddir}/get-units-split testfile-dwarf-5
+
+# These two files are the only ones that actually have skeleton units.
+testrun_compare ${abs_builddir}/get-units-split testfile-splitdwarf-4 << \EOF
+file: testfile-splitdwarf-4
+Got cudie unit_type: 4
+Found a skeleton unit, with split die: hello.c
+Got cudie unit_type: 4
+Found a skeleton unit, with split die: world.c
+
+EOF
+
+testrun_compare ${abs_builddir}/get-units-split testfile-splitdwarf-5 << \EOF
+file: testfile-splitdwarf-5
+Got cudie unit_type: 4
+Found a skeleton unit, with split die: hello.c
+Got cudie unit_type: 4
+Found a skeleton unit, with split die: world.c
+
+EOF
+
+# Self test (Not on obj files since those need relocation first).
+testrun_on_self_exe ${abs_builddir}/get-units-split
+testrun_on_self_lib ${abs_builddir}/get-units-split
+
+exit 0
diff --git a/tests/run-low_high_pc.sh b/tests/run-low_high_pc.sh
index ab5f2c3..41ec420 100755
--- a/tests/run-low_high_pc.sh
+++ b/tests/run-low_high_pc.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2005 Red Hat, Inc.
+# Copyright (C) 2005, 2018 Red Hat, Inc.
# This file is part of elfutils.
#
# This file is free software; you can redistribute it and/or modify
@@ -27,8 +27,15 @@
testrun ${abs_builddir}/low_high_pc -e ./testfile_low_high_pc
testrun ${abs_builddir}/low_high_pc -e ${abs_builddir}/low_high_pc
-testrun ${abs_builddir}/low_high_pc -e ${abs_top_builddir}/src/strip
-testrun ${abs_builddir}/low_high_pc -e ${abs_top_builddir}/src/strip.o
-testrun ${abs_builddir}/low_high_pc -e ${abs_top_builddir}/libelf/libelf.so
+
+# see tests/testfile-dwarf-45.source
+testfiles testfile-splitdwarf-4 testfile-splitdwarf-5
+testfiles testfile-hello4.dwo testfile-hello5.dwo
+testfiles testfile-world4.dwo testfile-world5.dwo
+
+testrun ${abs_builddir}/low_high_pc -e testfile-splitdwarf-4
+testrun ${abs_builddir}/low_high_pc -e testfile-splitdwarf-5
+
+testrun_on_self ${abs_builddir}/low_high_pc -e
exit 0
diff --git a/tests/run-next-cfi-self.sh b/tests/run-next-cfi-self.sh
new file mode 100755
index 0000000..2c42ea3
--- /dev/null
+++ b/tests/run-next-cfi-self.sh
@@ -0,0 +1,21 @@
+#! /bin/sh
+# 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 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/>.
+
+. $srcdir/test-subr.sh
+
+# Sanity check toolchain/dwarf_next_cfi
+testrun_on_self ${abs_builddir}/next_cfi
diff --git a/tests/run-next-cfi.sh b/tests/run-next-cfi.sh
new file mode 100755
index 0000000..23c0d7d
--- /dev/null
+++ b/tests/run-next-cfi.sh
@@ -0,0 +1,108 @@
+#! /bin/sh
+# Test for dwarf_next_cfi.
+# Copyright (C) 2018 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/>.
+
+. $srcdir/test-subr.sh
+
+# Test files come from run-addrcfi
+testfiles testfile11 testfile12
+testfiles testfilearm testfileaarch64
+testfiles testfileppc32 testfileppc64
+
+testrun_compare ${abs_builddir}/next_cfi testfile11 <<\EOF
+testfile11
+.eh_frame
+[0] CIE augmentation="zPL"
+[28] FDE cie=[0]
+[64] FDE cie=[0]
+[96] FDE cie=[0]
+[128] FDE cie=[0]
+.debug_frame
+[0] CIE augmentation=""
+[20] FDE cie=[0]
+[52] FDE cie=[0]
+[76] FDE cie=[0]
+[100] FDE cie=[0]
+[124] FDE cie=[0]
+[148] FDE cie=[0]
+[172] FDE cie=[0]
+[196] FDE cie=[0]
+EOF
+
+testrun_compare ${abs_builddir}/next_cfi testfile12 <<\EOF
+testfile12
+.eh_frame
+[0] CIE augmentation=""
+[16] CIE augmentation="zR"
+[40] FDE cie=[16]
+.debug_frame
+[0] CIE augmentation=""
+[24] FDE cie=[0]
+EOF
+
+testrun_compare ${abs_builddir}/next_cfi testfilearm <<\EOF
+testfilearm
+.eh_frame
+.debug_frame
+[0] CIE augmentation=""
+[16] FDE cie=[0]
+[32] CIE augmentation=""
+[48] FDE cie=[32]
+EOF
+
+testrun_compare ${abs_builddir}/next_cfi testfileaarch64 <<\EOF
+testfileaarch64
+.eh_frame
+[0] CIE augmentation="zR"
+[24] FDE cie=[0]
+[80] FDE cie=[0]
+.debug_frame
+[0] CIE augmentation=""
+[16] FDE cie=[0]
+[40] CIE augmentation=""
+[56] FDE cie=[40]
+EOF
+
+testrun_compare ${abs_builddir}/next_cfi testfileppc32 <<\EOF
+testfileppc32
+.eh_frame
+[0] CIE augmentation="zR"
+[20] FDE cie=[0]
+[40] FDE cie=[0]
+[96] FDE cie=[0]
+.debug_frame
+[0] CIE augmentation=""
+[16] FDE cie=[0]
+[32] CIE augmentation=""
+[48] FDE cie=[32]
+EOF
+
+testrun_compare ${abs_builddir}/next_cfi testfileppc64 <<\EOF
+testfileppc64
+.eh_frame
+[0] CIE augmentation="zR"
+[20] FDE cie=[0]
+[40] FDE cie=[0]
+[64] CIE augmentation="zR"
+[88] FDE cie=[64]
+[144] FDE cie=[64]
+.debug_frame
+[0] CIE augmentation=""
+[16] FDE cie=[0]
+[56] CIE augmentation=""
+[72] FDE cie=[56]
+EOF
diff --git a/tests/run-next-files.sh b/tests/run-next-files.sh
new file mode 100755
index 0000000..7a3b6d0
--- /dev/null
+++ b/tests/run-next-files.sh
@@ -0,0 +1,165 @@
+#! /bin/sh
+# Variant of run-get-files that uses dwarf_next_lines.
+# Copyright (C) 2018 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/>.
+
+. $srcdir/test-subr.sh
+
+testfiles testfile testfile2
+
+testrun_compare ${abs_builddir}/next-files testfile testfile2 <<\EOF
+off = 0
+ dirs[0] = "/home/drepper/gnu/new-bu/build/ttt"
+ file[0] = "???"
+ file[1] = "/home/drepper/gnu/new-bu/build/ttt/m.c"
+off = 75
+ dirs[0] = "/home/drepper/gnu/new-bu/build/ttt"
+ file[0] = "???"
+ file[1] = "/home/drepper/gnu/new-bu/build/ttt/b.c"
+ file[2] = "/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stddef.h"
+ file[3] = "/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h"
+ file[4] = "/usr/include/bits/types.h"
+ file[5] = "/usr/include/bits/sched.h"
+ file[6] = "/usr/include/bits/pthreadtypes.h"
+ file[7] = "/usr/include/stdio.h"
+ file[8] = "/usr/include/libio.h"
+ file[9] = "/usr/include/wchar.h"
+ file[10] = "/usr/include/_G_config.h"
+ file[11] = "/usr/include/gconv.h"
+off = 480
+ dirs[0] = "/home/drepper/gnu/new-bu/build/ttt"
+ file[0] = "???"
+ file[1] = "/home/drepper/gnu/new-bu/build/ttt/f.c"
+off = 0
+ dirs[0] = "/shoggoth/drepper"
+ file[0] = "???"
+ file[1] = "/shoggoth/drepper/b.c"
+ file[2] = "/home/geoffk/objs/laurel-000912-branch/lib/gcc-lib/powerpc-unknown-linux-gnu/2.96-laurel-000912/include/stddef.h"
+ file[3] = "/home/geoffk/objs/laurel-000912-branch/lib/gcc-lib/powerpc-unknown-linux-gnu/2.96-laurel-000912/include/stdarg.h"
+ file[4] = "/shoggoth/drepper/<built-in>"
+ file[5] = "/usr/include/bits/types.h"
+ file[6] = "/usr/include/stdio.h"
+ file[7] = "/usr/include/libio.h"
+ file[8] = "/usr/include/_G_config.h"
+off = 418
+ dirs[0] = "/shoggoth/drepper"
+ file[0] = "???"
+ file[1] = "/shoggoth/drepper/f.c"
+off = 485
+ dirs[0] = "/shoggoth/drepper"
+ file[0] = "???"
+ file[1] = "/shoggoth/drepper/m.c"
+EOF
+
+# see tests/testfile-dwarf-45.source
+testfiles testfile-splitdwarf-4 testfile-hello4.dwo testfile-world4.dwo
+testfiles testfile-splitdwarf-5 testfile-hello5.dwo testfile-world5.dwo
+
+testrun_compare ${abs_builddir}/next-files testfile-splitdwarf-4 testfile-hello4.dwo testfile-world4.dwo <<\EOF
+off = 0
+ dirs[0] = "/home/mark/src/elfutils/tests"
+ dirs[1] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include"
+ file[0] = "???"
+ file[1] = "/home/mark/src/elfutils/tests/hello.c"
+ file[2] = "/home/mark/src/elfutils/tests/hello.h"
+ file[3] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include/stddef.h"
+off = 612
+ dirs[0] = "/home/mark/src/elfutils/tests"
+ dirs[1] = "/usr/include"
+ file[0] = "???"
+ file[1] = "/home/mark/src/elfutils/tests/world.c"
+ file[2] = "/home/mark/src/elfutils/tests/hello.h"
+ file[3] = "/usr/include/stdlib.h"
+off = 0
+ dirs[0] = "/home/mark/src/elfutils/tests"
+ dirs[1] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include"
+ file[0] = "???"
+ file[1] = "/home/mark/src/elfutils/tests/hello.c"
+ file[2] = "/home/mark/src/elfutils/tests/hello.h"
+ file[3] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include/stddef.h"
+off = 0
+ dirs[0] = "/home/mark/src/elfutils/tests"
+ dirs[1] = "/usr/include"
+ file[0] = "???"
+ file[1] = "/home/mark/src/elfutils/tests/world.c"
+ file[2] = "/home/mark/src/elfutils/tests/hello.h"
+ file[3] = "/usr/include/stdlib.h"
+EOF
+
+# No problem with dirs[0] for DWARF5 line tables.
+testrun_compare ${abs_builddir}/next-files testfile-splitdwarf-5 testfile-hello5.dwo testfile-world5.dwo <<\EOF
+off = 0
+ dirs[0] = "/home/mark/src/elfutils/tests"
+ dirs[1] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include"
+ file[0] = "/home/mark/src/elfutils/tests/hello.c"
+ file[1] = "/home/mark/src/elfutils/tests/hello.c"
+ file[2] = "/home/mark/src/elfutils/tests/hello.h"
+ file[3] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include/stddef.h"
+off = 655
+ dirs[0] = "/home/mark/src/elfutils/tests"
+ dirs[1] = "/usr/include"
+ file[0] = "/home/mark/src/elfutils/tests/world.c"
+ file[1] = "/home/mark/src/elfutils/tests/world.c"
+ file[2] = "/home/mark/src/elfutils/tests/hello.h"
+ file[3] = "/usr/include/stdlib.h"
+off = 0
+ dirs[0] = "/home/mark/src/elfutils/tests"
+ dirs[1] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include"
+ file[0] = "/home/mark/src/elfutils/tests/hello.c"
+ file[1] = "/home/mark/src/elfutils/tests/hello.c"
+ file[2] = "/home/mark/src/elfutils/tests/hello.h"
+ file[3] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include/stddef.h"
+off = 0
+ dirs[0] = "/home/mark/src/elfutils/tests"
+ dirs[1] = "/usr/include"
+ file[0] = "/home/mark/src/elfutils/tests/world.c"
+ file[1] = "/home/mark/src/elfutils/tests/world.c"
+ file[2] = "/home/mark/src/elfutils/tests/hello.h"
+ file[3] = "/usr/include/stdlib.h"
+EOF
+
+# Created from testfile using
+# cp testfile testfile-only-debug-line
+# eu-strip -g --keep-section .debug_line
+#
+# Note how the comp dir cannot be retrieved and some files become relative.
+testfiles testfile-only-debug-line
+testrun_compare ${abs_builddir}/next-files testfile-only-debug-line <<\EOF
+off = 0
+ dirs[0] = (null)
+ file[0] = "???"
+ file[1] = "m.c"
+off = 75
+ dirs[0] = (null)
+ file[0] = "???"
+ file[1] = "b.c"
+ file[2] = "/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stddef.h"
+ file[3] = "/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h"
+ file[4] = "/usr/include/bits/types.h"
+ file[5] = "/usr/include/bits/sched.h"
+ file[6] = "/usr/include/bits/pthreadtypes.h"
+ file[7] = "/usr/include/stdio.h"
+ file[8] = "/usr/include/libio.h"
+ file[9] = "/usr/include/wchar.h"
+ file[10] = "/usr/include/_G_config.h"
+ file[11] = "/usr/include/gconv.h"
+off = 480
+ dirs[0] = (null)
+ file[0] = "???"
+ file[1] = "f.c"
+EOF
+
+exit 0
diff --git a/tests/run-next-lines.sh b/tests/run-next-lines.sh
new file mode 100755
index 0000000..84aee1c
--- /dev/null
+++ b/tests/run-next-lines.sh
@@ -0,0 +1,116 @@
+#! /bin/sh
+# Variant of run-get-lines that uses dwarf_next_lines.
+# Copyright (C) 2018 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/>.
+
+. $srcdir/test-subr.sh
+
+testfiles testfile testfile2 testfilenolines
+
+testrun_compare ${abs_builddir}/next-lines testfile testfile2 <<\EOF
+off = 0
+ 5 lines
+804842c: /home/drepper/gnu/new-bu/build/ttt/m.c:5:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+8048432: /home/drepper/gnu/new-bu/build/ttt/m.c:6:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+804844d: /home/drepper/gnu/new-bu/build/ttt/m.c:7:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+8048458: /home/drepper/gnu/new-bu/build/ttt/m.c:8:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+804845a: /home/drepper/gnu/new-bu/build/ttt/m.c:8:0: is_stmt:yes, end_seq:yes, bb:no, prologue:no, epilogue:no
+off = 75
+ 4 lines
+804845c: /home/drepper/gnu/new-bu/build/ttt/b.c:4:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+804845f: /home/drepper/gnu/new-bu/build/ttt/b.c:5:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+8048464: /home/drepper/gnu/new-bu/build/ttt/b.c:6:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+8048466: /home/drepper/gnu/new-bu/build/ttt/b.c:6:0: is_stmt:yes, end_seq:yes, bb:no, prologue:no, epilogue:no
+off = 480
+ 4 lines
+8048468: /home/drepper/gnu/new-bu/build/ttt/f.c:3:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+804846b: /home/drepper/gnu/new-bu/build/ttt/f.c:4:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+8048470: /home/drepper/gnu/new-bu/build/ttt/f.c:5:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+8048472: /home/drepper/gnu/new-bu/build/ttt/f.c:5:0: is_stmt:yes, end_seq:yes, bb:no, prologue:no, epilogue:no
+off = 0
+ 4 lines
+10000470: /shoggoth/drepper/b.c:4:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+1000047c: /shoggoth/drepper/b.c:5:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+10000480: /shoggoth/drepper/b.c:6:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+10000490: /shoggoth/drepper/b.c:6:0: is_stmt:yes, end_seq:yes, bb:no, prologue:no, epilogue:no
+off = 418
+ 4 lines
+10000490: /shoggoth/drepper/f.c:3:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+1000049c: /shoggoth/drepper/f.c:4:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+100004a0: /shoggoth/drepper/f.c:5:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+100004b0: /shoggoth/drepper/f.c:5:0: is_stmt:yes, end_seq:yes, bb:no, prologue:no, epilogue:no
+off = 485
+ 5 lines
+100004b0: /shoggoth/drepper/m.c:5:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+100004cc: /shoggoth/drepper/m.c:6:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+100004e8: /shoggoth/drepper/m.c:7:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+100004f4: /shoggoth/drepper/m.c:8:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+10000514: /shoggoth/drepper/m.c:8:0: is_stmt:yes, end_seq:yes, bb:no, prologue:no, epilogue:no
+EOF
+
+# - lines.c
+# int ft;
+#
+# int
+# main (int argc, char **argv)
+# {
+# return ft - 42;
+# }
+#
+# - nolines.c
+# int ft = 42;
+#
+# gcc -g -c lines.c
+# gcc -g -c nolines.c
+# gcc -g -o testfilenolines lines.o nolines.o
+
+testrun_compare ${abs_builddir}/next-lines testfilenolines <<\EOF
+off = 0
+ 4 lines
+400474: /home/mark/src/tests/lines.c:5:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+40047f: /home/mark/src/tests/lines.c:6:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+400488: /home/mark/src/tests/lines.c:7:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+40048a: /home/mark/src/tests/lines.c:7:0: is_stmt:yes, end_seq:yes, bb:no, prologue:no, epilogue:no
+off = 59
+ 0 lines
+EOF
+
+# See run-next-files.
+# Note no, comp_dir, so all paths are relative.
+testfiles testfile-only-debug-line
+testrun_compare ${abs_builddir}/next-lines testfile-only-debug-line <<\EOF
+off = 0
+ 5 lines
+804842c: m.c:5:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+8048432: m.c:6:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+804844d: m.c:7:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+8048458: m.c:8:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+804845a: m.c:8:0: is_stmt:yes, end_seq:yes, bb:no, prologue:no, epilogue:no
+off = 75
+ 4 lines
+804845c: b.c:4:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+804845f: b.c:5:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+8048464: b.c:6:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+8048466: b.c:6:0: is_stmt:yes, end_seq:yes, bb:no, prologue:no, epilogue:no
+off = 480
+ 4 lines
+8048468: f.c:3:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+804846b: f.c:4:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+8048470: f.c:5:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no
+8048472: f.c:5:0: is_stmt:yes, end_seq:yes, bb:no, prologue:no, epilogue:no
+EOF
+
+exit 0
diff --git a/tests/run-peel-type.sh b/tests/run-peel-type.sh
new file mode 100755
index 0000000..668e316
--- /dev/null
+++ b/tests/run-peel-type.sh
@@ -0,0 +1,63 @@
+#! /bin/sh
+# 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 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/>.
+
+. $srcdir/test-subr.sh
+
+# See run-aggregate-size.sh for how to generate testfiles.
+
+testfiles testfile-sizes1.o testfile-sizes2.o testfile-sizes3.o
+
+testrun_compare ${abs_builddir}/peel_type -e testfile-sizes1.o <<\EOF
+c raw type base_type
+i raw type base_type
+l raw type base_type
+v raw type pointer_type
+s raw type structure_type
+ca raw type array_type
+ia raw type array_type
+va raw type array_type
+sa raw type array_type
+EOF
+
+testrun_compare ${abs_builddir}/peel_type -e testfile-sizes2.o <<\EOF
+c raw type base_type
+i raw type base_type
+l raw type base_type
+v raw type pointer_type
+s raw type structure_type
+ca raw type array_type
+ia raw type array_type
+va raw type array_type
+sa raw type array_type
+EOF
+
+testrun_compare ${abs_builddir}/peel_type -e testfile-sizes3.o <<\EOF
+c raw type base_type
+i raw type base_type
+l raw type base_type
+v raw type pointer_type
+s raw type structure_type
+ca raw type array_type
+ia raw type array_type
+va raw type array_type
+sa raw type array_type
+d3d raw type array_type
+f raw type base_type
+b raw type base_type
+EOF
+
+exit 0
diff --git a/tests/run-readelf-A.sh b/tests/run-readelf-A.sh
index 6ca9be8..b7432be 100755
--- a/tests/run-readelf-A.sh
+++ b/tests/run-readelf-A.sh
@@ -1,5 +1,6 @@
#! /bin/sh
# Copyright (C) 2014 Red Hat, Inc.
+# Copyright (C) 2016 Oracle, Inc.
# This file is part of elfutils.
#
# This file is free software; you can redistribute it and/or modify
@@ -25,7 +26,18 @@
#
# gcc -m32 -c testfileppc32attrs.s
-testfiles testfilearm testfileppc32attrs.o
+# = testfilesparc64attrs.s =
+# .gnu_attribute 4,0x0aaaaaaa
+# .gnu_attribute 8,0x00000055
+#
+# gcc -c testfilesparc64attrs.s
+
+# = testfileppc64attrs.s =
+# .gnu_attribute 4,3
+#
+# gcc -c testfileppc64attrs.s
+
+testfiles testfilearm testfileppc32attrs.o testfilesparc64attrs.o testfileppc64attrs.o
testrun_compare ${abs_top_builddir}/src/readelf -A testfilearm <<\EOF
@@ -62,4 +74,23 @@
GNU_Power_ABI_Struct_Return: r3/r4
EOF
+testrun_compare ${abs_top_builddir}/src/readelf -A testfilesparc64attrs.o <<\EOF
+
+Object attributes section [ 4] '.gnu.attributes' of 21 bytes at offset 0x40:
+ Owner Size
+ gnu 20
+ File: 12
+ GNU_Sparc_HWCAPS: div32,v8plus,vis,asi_blk_init,vis3,random,fjfmau,asi_cache_sparing,des,camellia,sha1,sha512,mont,cbcond
+ GNU_Sparc_HWCAPS2: fjathplus,adp,mwait,xmont
+EOF
+
+testrun_compare ${abs_top_builddir}/src/readelf -A testfileppc64attrs.o <<\EOF
+
+Object attributes section [ 4] '.gnu.attributes' of 16 bytes at offset 0x40:
+ Owner Size
+ gnu 15
+ File: 7
+ GNU_Power_ABI_FP: Single-precision hard float
+EOF
+
exit 0
diff --git a/tests/run-readelf-addr.sh b/tests/run-readelf-addr.sh
new file mode 100755
index 0000000..ea723c2
--- /dev/null
+++ b/tests/run-readelf-addr.sh
@@ -0,0 +1,143 @@
+#! /bin/sh
+# Copyright (C) 2018 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/>.
+
+. $srcdir/test-subr.sh
+
+# See tests/testfile-dwarf-45.source
+testfiles testfile-splitdwarf-4 testfile-splitdwarf-5
+
+# DWARF4 GNU DebugFission No real table header.
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=addr testfile-splitdwarf-4<<\EOF
+
+DWARF section [33] '.debug_addr' at offset 0x3671:
+Table at offset 0 for CU [ b]:
+
+ Length: 152
+ DWARF version: 4
+ Address size: 8
+ Segment size: 0
+
+ Addresses start at offset 0x0:
+ [ 0] 0x000000000040116a <foo+0xa>
+ [ 1] 0x0000000000401189 <foo+0x29>
+ [ 2] 0x000000000040118d <foo+0x2d>
+ [ 3] 0x0000000000401194
+ [ 4] 0x0000000000401181 <foo+0x21>
+ [ 5] 0x00000000004011af <baz+0xf>
+ [ 6] 0x00000000004011b1
+ [ 7] 0x00000000004011a0 <baz>
+ [ 8] 0x0000000000401160 <foo>
+ [ 9] 0x00000000004011a0 <baz>
+ [10] 0x000000000040117b <foo+0x1b>
+ [11] 0x000000000040117b <foo+0x1b>
+ [12] 0x0000000000401181 <foo+0x21>
+ [13] 0x0000000000401181 <foo+0x21>
+ [14] 0x000000000040118d <foo+0x2d>
+ [15] 0x0000000000401160 <foo>
+ [16] 0x0000000000401060 <main>
+ [17] 0x000000000040117b <foo+0x1b>
+ [18] 0x0000000000404038 <m>
+
+Table at offset 98 for CU [ 3f]:
+
+ Length: 136
+ DWARF version: 4
+ Address size: 8
+ Segment size: 0
+
+ Addresses start at offset 0x98:
+ [ 0] 0x00000000004011df <calc+0x1f>
+ [ 1] 0x00000000004011e4 <calc+0x24>
+ [ 2] 0x0000000000401060 <main>
+ [ 3] 0x0000000000401071 <main+0x11>
+ [ 4] 0x0000000000401074 <main+0x14>
+ [ 5] 0x0000000000401079 <main+0x19>
+ [ 6] 0x00000000004011d3 <calc+0x13>
+ [ 7] 0x0000000000401078 <main+0x18>
+ [ 8] 0x00000000004011a0 <baz>
+ [ 9] 0x0000000000401040
+ [10] 0x0000000000401080 <_start>
+ [11] 0x00000000004011c0 <calc>
+ [12] 0x0000000000401060 <main>
+ [13] 0x00000000004011c0 <calc>
+ [14] 0x00000000004011c8 <calc+0x8>
+ [15] 0x00000000004011d8 <calc+0x18>
+ [16] 0x00000000004011da <calc+0x1a>
+
+EOF
+
+# DWARF5 Real table header.
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=addr testfile-splitdwarf-5<<\EOF
+
+DWARF section [32] '.debug_addr' at offset 0x365e:
+Table at offset 0 for CU [ 14]:
+
+ Length: 156
+ DWARF version: 5
+ Address size: 8
+ Segment size: 0
+
+ Addresses start at offset 0x8:
+ [ 0] 0x000000000040116a <foo+0xa>
+ [ 1] 0x0000000000401189 <foo+0x29>
+ [ 2] 0x000000000040118d <foo+0x2d>
+ [ 3] 0x0000000000401194
+ [ 4] 0x0000000000401181 <foo+0x21>
+ [ 5] 0x00000000004011af <baz+0xf>
+ [ 6] 0x00000000004011b1
+ [ 7] 0x00000000004011a0 <baz>
+ [ 8] 0x0000000000401160 <foo>
+ [ 9] 0x00000000004011a0 <baz>
+ [10] 0x000000000040117b <foo+0x1b>
+ [11] 0x000000000040117b <foo+0x1b>
+ [12] 0x0000000000401181 <foo+0x21>
+ [13] 0x0000000000401181 <foo+0x21>
+ [14] 0x000000000040118d <foo+0x2d>
+ [15] 0x0000000000401160 <foo>
+ [16] 0x0000000000401060 <main>
+ [17] 0x000000000040117b <foo+0x1b>
+ [18] 0x0000000000404038 <m>
+
+Table at offset a0 for CU [ 49]:
+
+ Length: 140
+ DWARF version: 5
+ Address size: 8
+ Segment size: 0
+
+ Addresses start at offset 0xa8:
+ [ 0] 0x00000000004011df <calc+0x1f>
+ [ 1] 0x00000000004011e4 <calc+0x24>
+ [ 2] 0x0000000000401060 <main>
+ [ 3] 0x0000000000401071 <main+0x11>
+ [ 4] 0x0000000000401074 <main+0x14>
+ [ 5] 0x0000000000401079 <main+0x19>
+ [ 6] 0x00000000004011d3 <calc+0x13>
+ [ 7] 0x0000000000401078 <main+0x18>
+ [ 8] 0x00000000004011a0 <baz>
+ [ 9] 0x0000000000401040
+ [10] 0x0000000000401080 <_start>
+ [11] 0x00000000004011c0 <calc>
+ [12] 0x0000000000401060 <main>
+ [13] 0x00000000004011c0 <calc>
+ [14] 0x00000000004011c8 <calc+0x8>
+ [15] 0x00000000004011d8 <calc+0x18>
+ [16] 0x00000000004011da <calc+0x1a>
+
+EOF
+
+exit 0
diff --git a/tests/run-readelf-const-values.sh b/tests/run-readelf-const-values.sh
new file mode 100755
index 0000000..0a6356f
--- /dev/null
+++ b/tests/run-readelf-const-values.sh
@@ -0,0 +1,230 @@
+#! /bin/sh
+# Test for displaying DW_AT_const_types with the "correct" sign.
+# Copyright (C) 2018 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/>.
+
+. $srcdir/test-subr.sh
+
+# = s.c
+#
+# int s()
+# {
+# int i = -1;
+# int j = -1;
+#
+# return i - j;
+# }
+#
+# = m.c
+#
+# extern int s();
+#
+# int
+# main ()
+# {
+# const signed char sc = -2;
+# const unsigned char uc = 254;
+#
+# const signed short ss = -16;
+# const unsigned short us = 65520;
+#
+# const signed int si = -3;
+# const unsigned int ui = 4200000000;
+#
+# signed long sl = -1;
+# unsigned long ul = 0xffffffffffffffffUL;
+#
+# return s ();
+# }
+#
+# gcc -gdwarf-5 -O2 -c s.c
+# gcc -gdwarf-4 -O2 -c m.c
+# gcc -o testfile-const-values s.o m.o
+# eu-strip -g -f testfile-const-values.debug testfile-const-values
+
+testfiles testfile-const-values.debug
+
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=info testfile-const-values.debug << EOF
+
+DWARF section [28] '.debug_info' at offset 0x2e0:
+ [Offset]
+ Compilation unit at offset 0:
+ Version: 5, Abbreviation section offset: 0, Address size: 8, Offset size: 4
+ Unit type: compile (1)
+ [ c] compile_unit abbrev: 2
+ producer (strp) "GNU C11 7.3.1 20180303 (Red Hat 7.3.1-5) -mtune=generic -march=x86-64 -gdwarf-5 -O2"
+ language (data1) C11 (29)
+ name (string) "s.c"
+ comp_dir (strp) "/home/mark/build/elfutils-obj"
+ low_pc (addr) 0x00000000004004d0
+ high_pc (data8) 3 (0x00000000004004d3)
+ stmt_list (sec_offset) 0
+ [ 2e] subprogram abbrev: 3
+ external (flag_present) yes
+ name (string) "s"
+ decl_file (data1) s.c (1)
+ decl_line (data1) 1
+ type (ref4) [ 5e]
+ low_pc (addr) 0x00000000004004d0
+ high_pc (data8) 3 (0x00000000004004d3)
+ frame_base (exprloc)
+ [ 0] call_frame_cfa
+ call_all_calls (flag_present) yes
+ sibling (ref4) [ 5e]
+ [ 4d] variable abbrev: 1
+ name (string) "i"
+ decl_file (implicit_const) s.c (1)
+ decl_line (data1) 3
+ type (ref4) [ 5e]
+ const_value (implicit_const) -1
+ [ 55] variable abbrev: 1
+ name (string) "j"
+ decl_file (implicit_const) s.c (1)
+ decl_line (data1) 4
+ type (ref4) [ 5e]
+ const_value (implicit_const) -1
+ [ 5e] base_type abbrev: 4
+ byte_size (data1) 4
+ encoding (data1) signed (5)
+ name (string) "int"
+ Compilation unit at offset 102:
+ Version: 4, Abbreviation section offset: 73, Address size: 8, Offset size: 4
+ [ 71] compile_unit abbrev: 1
+ producer (strp) "GNU C11 7.3.1 20180303 (Red Hat 7.3.1-5) -mtune=generic -march=x86-64 -gdwarf-4 -O2"
+ language (data1) C99 (12)
+ name (string) "m.c"
+ comp_dir (strp) "/home/mark/build/elfutils-obj"
+ ranges (sec_offset) range list [ 0]
+ low_pc (addr) 000000000000000000
+ stmt_list (sec_offset) 54
+ [ 8f] subprogram abbrev: 2
+ external (flag_present) yes
+ name (strp) "main"
+ decl_file (data1) m.c (1)
+ decl_line (data1) 4
+ type (ref4) [ 119]
+ low_pc (addr) 0x00000000004003e0
+ high_pc (data8) 7 (0x00000000004003e7)
+ frame_base (exprloc)
+ [ 0] call_frame_cfa
+ GNU_all_call_sites (flag_present) yes
+ sibling (ref4) [ 119]
+ [ b0] variable abbrev: 3
+ name (string) "sc"
+ decl_file (data1) m.c (1)
+ decl_line (data1) 6
+ type (ref4) [ 12c]
+ const_value (sdata) -2
+ [ bb] variable abbrev: 3
+ name (string) "uc"
+ decl_file (data1) m.c (1)
+ decl_line (data1) 7
+ type (ref4) [ 138]
+ const_value (sdata) 254 (-2)
+ [ c6] variable abbrev: 3
+ name (string) "ss"
+ decl_file (data1) m.c (1)
+ decl_line (data1) 9
+ type (ref4) [ 144]
+ const_value (sdata) -16
+ [ d1] variable abbrev: 3
+ name (string) "us"
+ decl_file (data1) m.c (1)
+ decl_line (data1) 10
+ type (ref4) [ 150]
+ const_value (sdata) 65520 (-16)
+ [ dc] variable abbrev: 3
+ name (string) "si"
+ decl_file (data1) m.c (1)
+ decl_line (data1) 12
+ type (ref4) [ 120]
+ const_value (sdata) -3
+ [ e7] variable abbrev: 3
+ name (string) "ui"
+ decl_file (data1) m.c (1)
+ decl_line (data1) 13
+ type (ref4) [ 15c]
+ const_value (sdata) 4200000000 (-94967296)
+ [ f5] variable abbrev: 3
+ name (string) "sl"
+ decl_file (data1) m.c (1)
+ decl_line (data1) 15
+ type (ref4) [ 161]
+ const_value (sdata) -1
+ [ 100] variable abbrev: 3
+ name (string) "ul"
+ decl_file (data1) m.c (1)
+ decl_line (data1) 16
+ type (ref4) [ 168]
+ const_value (sdata) 18446744073709551615 (-1)
+ [ 10b] GNU_call_site abbrev: 4
+ low_pc (addr) 0x00000000004003e7
+ GNU_tail_call (flag_present) yes
+ abstract_origin (ref4) [ 16f]
+ [ 119] base_type abbrev: 5
+ byte_size (data1) 4
+ encoding (data1) signed (5)
+ name (string) "int"
+ [ 120] const_type abbrev: 6
+ type (ref4) [ 119]
+ [ 125] base_type abbrev: 7
+ byte_size (data1) 1
+ encoding (data1) signed_char (6)
+ name (strp) "signed char"
+ [ 12c] const_type abbrev: 6
+ type (ref4) [ 125]
+ [ 131] base_type abbrev: 7
+ byte_size (data1) 1
+ encoding (data1) unsigned_char (8)
+ name (strp) "unsigned char"
+ [ 138] const_type abbrev: 6
+ type (ref4) [ 131]
+ [ 13d] base_type abbrev: 7
+ byte_size (data1) 2
+ encoding (data1) signed (5)
+ name (strp) "short int"
+ [ 144] const_type abbrev: 6
+ type (ref4) [ 13d]
+ [ 149] base_type abbrev: 7
+ byte_size (data1) 2
+ encoding (data1) unsigned (7)
+ name (strp) "short unsigned int"
+ [ 150] const_type abbrev: 6
+ type (ref4) [ 149]
+ [ 155] base_type abbrev: 7
+ byte_size (data1) 4
+ encoding (data1) unsigned (7)
+ name (strp) "unsigned int"
+ [ 15c] const_type abbrev: 6
+ type (ref4) [ 155]
+ [ 161] base_type abbrev: 7
+ byte_size (data1) 8
+ encoding (data1) signed (5)
+ name (strp) "long int"
+ [ 168] base_type abbrev: 7
+ byte_size (data1) 8
+ encoding (data1) unsigned (7)
+ name (strp) "long unsigned int"
+ [ 16f] subprogram abbrev: 8
+ external (flag_present) yes
+ declaration (flag_present) yes
+ linkage_name (string) "s"
+ name (string) "s"
+ decl_file (data1) m.c (1)
+ decl_line (data1) 1
+EOF
+
+exit 0
diff --git a/tests/run-readelf-dwz-multi.sh b/tests/run-readelf-dwz-multi.sh
index 27e0f38..4f317ac 100755
--- a/tests/run-readelf-dwz-multi.sh
+++ b/tests/run-readelf-dwz-multi.sh
@@ -84,7 +84,7 @@
[Offset]
Compilation unit at offset 0:
Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4
- [ b] compile_unit
+ [ b] compile_unit abbrev: 6
producer (strp) "GNU C 4.7.0 20120507 (Red Hat 4.7.0-5) -mtune=generic -march=x86-64 -g"
language (data1) C89 (1)
name (strp) "main.c"
@@ -92,46 +92,46 @@
low_pc (addr) 0x00000000004006ac <main>
high_pc (udata) 44 (0x00000000004006d8)
stmt_list (sec_offset) 0
- [ 26] imported_unit
+ [ 26] imported_unit abbrev: 5
import (GNU_ref_alt) [ b]
- [ 2b] pointer_type
+ [ 2b] pointer_type abbrev: 1
byte_size (data1) 8
type (GNU_ref_alt) [ 53]
- [ 31] subprogram
- external (flag_present)
+ [ 31] subprogram abbrev: 3
+ external (flag_present) yes
name (strp) "main"
- decl_file (data1) 1
+ decl_file (data1) main.c (1)
decl_line (data1) 3
- prototyped (flag_present)
+ prototyped (flag_present) yes
type (GNU_ref_alt) [ 3e]
low_pc (addr) 0x00000000004006ac <main>
high_pc (udata) 44 (0x00000000004006d8)
frame_base (exprloc)
- [ 0] call_frame_cfa
- GNU_all_tail_call_sites (flag_present)
+ [ 0] call_frame_cfa
+ GNU_all_tail_call_sites (flag_present) yes
sibling (ref_udata) [ 6e]
- [ 48] formal_parameter
+ [ 48] formal_parameter abbrev: 8
name (strp) "argc"
- decl_file (data1) 1
+ decl_file (data1) main.c (1)
decl_line (data1) 3
type (GNU_ref_alt) [ 3e]
location (exprloc)
- [ 0] fbreg -36
- [ 56] formal_parameter
+ [ 0] fbreg -36
+ [ 56] formal_parameter abbrev: 4
name (strp) "argv"
- decl_file (data1) 1
+ decl_file (data1) main.c (1)
decl_line (data1) 3
type (ref_udata) [ 6e]
location (exprloc)
- [ 0] fbreg -48
- [ 61] variable
+ [ 0] fbreg -48
+ [ 61] variable abbrev: 7
name (string) "b"
- decl_file (data1) 1
+ decl_file (data1) main.c (1)
decl_line (data1) 5
type (GNU_ref_alt) [ 5a]
location (exprloc)
- [ 0] fbreg -32
- [ 6e] pointer_type
+ [ 0] fbreg -32
+ [ 6e] pointer_type abbrev: 2
byte_size (data1) 8
type (ref_udata) [ 2b]
EOF
@@ -145,7 +145,7 @@
[Offset]
Compilation unit at offset 0:
Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4
- [ b] compile_unit
+ [ b] compile_unit abbrev: 6
producer (strp) "GNU C 4.7.0 20120507 (Red Hat 4.7.0-5) -mtune=generic -march=x86-64 -g"
language (data1) C89 (1)
name (strp) "main.c"
@@ -153,46 +153,46 @@
low_pc (addr) 0x00000000004006ac <main>
high_pc (udata) 44 (0x00000000004006d8)
stmt_list (sec_offset) 0
- [ 26] imported_unit
+ [ 26] imported_unit abbrev: 5
import (GNU_ref_alt) [ b]
- [ 2b] pointer_type
+ [ 2b] pointer_type abbrev: 1
byte_size (data1) 8
type (GNU_ref_alt) [ 53]
- [ 31] subprogram
- external (flag_present)
+ [ 31] subprogram abbrev: 3
+ external (flag_present) yes
name (strp) "main"
- decl_file (data1) 1
+ decl_file (data1) main.c (1)
decl_line (data1) 3
- prototyped (flag_present)
+ prototyped (flag_present) yes
type (GNU_ref_alt) [ 3e]
low_pc (addr) 0x00000000004006ac <main>
high_pc (udata) 44 (0x00000000004006d8)
frame_base (exprloc)
- [ 0] call_frame_cfa
- GNU_all_tail_call_sites (flag_present)
+ [ 0] call_frame_cfa
+ GNU_all_tail_call_sites (flag_present) yes
sibling (ref_udata) [ 6e]
- [ 48] formal_parameter
+ [ 48] formal_parameter abbrev: 8
name (strp) "argc"
- decl_file (data1) 1
+ decl_file (data1) main.c (1)
decl_line (data1) 3
type (GNU_ref_alt) [ 3e]
location (exprloc)
- [ 0] fbreg -36
- [ 56] formal_parameter
+ [ 0] fbreg -36
+ [ 56] formal_parameter abbrev: 4
name (strp) "argv"
- decl_file (data1) 1
+ decl_file (data1) main.c (1)
decl_line (data1) 3
type (ref_udata) [ 6e]
location (exprloc)
- [ 0] fbreg -48
- [ 61] variable
+ [ 0] fbreg -48
+ [ 61] variable abbrev: 7
name (string) "b"
- decl_file (data1) 1
+ decl_file (data1) main.c (1)
decl_line (data1) 5
type (GNU_ref_alt) [ 5a]
location (exprloc)
- [ 0] fbreg -32
- [ 6e] pointer_type
+ [ 0] fbreg -32
+ [ 6e] pointer_type abbrev: 2
byte_size (data1) 8
type (ref_udata) [ 2b]
EOF
@@ -205,7 +205,7 @@
[Offset]
Compilation unit at offset 0:
Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4
- [ b] compile_unit
+ [ b] compile_unit abbrev: 3
producer (strp) "GNU C 4.7.0 20120507 (Red Hat 4.7.0-5) -fpreprocessed -mtune=generic -march=x86-64 -g -fPIC"
language (data1) C89 (1)
name (strp) "shared.c"
@@ -213,27 +213,27 @@
low_pc (addr) +0x0000000000000670 <call_foo>
high_pc (udata) 23 (+0x0000000000000687)
stmt_list (sec_offset) 0
- [ 26] imported_unit
+ [ 26] imported_unit abbrev: 2
import (GNU_ref_alt) [ b]
- [ 2b] subprogram
- external (flag_present)
+ [ 2b] subprogram abbrev: 1
+ external (flag_present) yes
name (strp) "call_foo"
- decl_file (data1) 1
+ decl_file (data1) shared.c (1)
decl_line (data1) 3
- prototyped (flag_present)
+ prototyped (flag_present) yes
type (GNU_ref_alt) [ 3e]
low_pc (addr) +0x0000000000000670 <call_foo>
high_pc (udata) 23 (+0x0000000000000687)
frame_base (exprloc)
- [ 0] call_frame_cfa
- GNU_all_call_sites (flag_present)
- [ 41] formal_parameter
+ [ 0] call_frame_cfa
+ GNU_all_call_sites (flag_present) yes
+ [ 41] formal_parameter abbrev: 4
name (string) "fb"
- decl_file (data1) 1
+ decl_file (data1) shared.c (1)
decl_line (data1) 3
type (GNU_ref_alt) [ 76]
location (exprloc)
- [ 0] fbreg -24
+ [ 0] fbreg -24
EOF
# Same as above, but find alt debug file in a .dwz subdir.
@@ -245,7 +245,7 @@
[Offset]
Compilation unit at offset 0:
Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4
- [ b] compile_unit
+ [ b] compile_unit abbrev: 3
producer (strp) "GNU C 4.7.0 20120507 (Red Hat 4.7.0-5) -fpreprocessed -mtune=generic -march=x86-64 -g -fPIC"
language (data1) C89 (1)
name (strp) "shared.c"
@@ -253,27 +253,27 @@
low_pc (addr) +0x0000000000000670 <call_foo>
high_pc (udata) 23 (+0x0000000000000687)
stmt_list (sec_offset) 0
- [ 26] imported_unit
+ [ 26] imported_unit abbrev: 2
import (GNU_ref_alt) [ b]
- [ 2b] subprogram
- external (flag_present)
+ [ 2b] subprogram abbrev: 1
+ external (flag_present) yes
name (strp) "call_foo"
- decl_file (data1) 1
+ decl_file (data1) shared.c (1)
decl_line (data1) 3
- prototyped (flag_present)
+ prototyped (flag_present) yes
type (GNU_ref_alt) [ 3e]
low_pc (addr) +0x0000000000000670 <call_foo>
high_pc (udata) 23 (+0x0000000000000687)
frame_base (exprloc)
- [ 0] call_frame_cfa
- GNU_all_call_sites (flag_present)
- [ 41] formal_parameter
+ [ 0] call_frame_cfa
+ GNU_all_call_sites (flag_present) yes
+ [ 41] formal_parameter abbrev: 4
name (string) "fb"
- decl_file (data1) 1
+ decl_file (data1) shared.c (1)
decl_line (data1) 3
type (GNU_ref_alt) [ 76]
location (exprloc)
- [ 0] fbreg -24
+ [ 0] fbreg -24
EOF
mv .dwz/testfile_multi.dwz .
rmdir .dwz
@@ -284,7 +284,7 @@
[Offset]
Compilation unit at offset 0:
Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4
- [ b] compile_unit
+ [ b] compile_unit abbrev: 5
producer (GNU_strp_alt) "GNU C 4.7.2 20121109 (Red Hat 4.7.2-8) -mtune=generic -march=x86-64 -g"
language (data1) C89 (1)
name (GNU_strp_alt) "main.c"
@@ -292,41 +292,41 @@
low_pc (addr) 0x00000000004004ec <main>
high_pc (udata) 18 (0x00000000004004fe)
stmt_list (sec_offset) 0
- [ 26] imported_unit
+ [ 26] imported_unit abbrev: 2
import (GNU_ref_alt) [ b]
- [ 2b] subprogram
- external (flag_present)
+ [ 2b] subprogram abbrev: 4
+ external (flag_present) yes
name (GNU_strp_alt) "main"
- decl_file (data1) 1
+ decl_file (data1) main.c (1)
decl_line (data1) 8
- prototyped (flag_present)
+ prototyped (flag_present) yes
type (GNU_ref_alt) [ 30]
low_pc (addr) 0x00000000004004ec <main>
high_pc (udata) 18 (0x00000000004004fe)
frame_base (exprloc)
- [ 0] call_frame_cfa
- GNU_all_call_sites (flag_present)
- [ 41] formal_parameter
+ [ 0] call_frame_cfa
+ GNU_all_call_sites (flag_present) yes
+ [ 41] formal_parameter abbrev: 1
name (GNU_strp_alt) "argc"
- decl_file (data1) 1
+ decl_file (data1) main.c (1)
decl_line (data1) 8
type (GNU_ref_alt) [ 30]
location (exprloc)
- [ 0] fbreg -36
- [ 4f] formal_parameter
+ [ 0] fbreg -36
+ [ 4f] formal_parameter abbrev: 1
name (GNU_strp_alt) "argv"
- decl_file (data1) 1
+ decl_file (data1) main.c (1)
decl_line (data1) 8
type (GNU_ref_alt) [ 41]
location (exprloc)
- [ 0] fbreg -48
- [ 5d] variable
+ [ 0] fbreg -48
+ [ 5d] variable abbrev: 3
name (string) "fbb"
- decl_file (data1) 1
+ decl_file (data1) main.c (1)
decl_line (data1) 10
type (GNU_ref_alt) [ 14]
location (exprloc)
- [ 0] fbreg -32
+ [ 0] fbreg -32
EOF
exit 0
diff --git a/tests/run-readelf-info-plus.sh b/tests/run-readelf-info-plus.sh
new file mode 100755
index 0000000..ee1db02
--- /dev/null
+++ b/tests/run-readelf-info-plus.sh
@@ -0,0 +1,31 @@
+#! /bin/sh
+# Test for --debug-dump=info+ and finding split unit (in wrong file).
+# Copyright (C) 2018 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/>.
+
+. $srcdir/test-subr.sh
+
+# see tests/testfile-dwarf-45.source
+testfiles testfile-splitdwarf-5
+testfiles testfile-world5.dwo
+
+# note, wrong file, renamed as if this contains the correct dwo...
+tempfiles testfile-hello5.dwo
+cp testfile-world5.dwo testfile-hello5.dwo
+
+testrun ${abs_top_builddir}/src/readelf --debug-dump=info+ testfile-splitdwarf-5
+
+exit 0
diff --git a/tests/run-readelf-line.sh b/tests/run-readelf-line.sh
index 32bcf9d..a95e6aa 100755
--- a/tests/run-readelf-line.sh
+++ b/tests/run-readelf-line.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2013 Red Hat, Inc.
+# Copyright (C) 2013, 2018 Red Hat, Inc.
# This file is part of elfutils.
#
# This file is free software; you can redistribute it and/or modify
@@ -28,15 +28,17 @@
Table at offset 0:
- Length: 83
- DWARF version: 2
- Prologue length: 43
- Minimum instruction length: 1
- Maximum operations per instruction: 1
- Initial value if 'is_stmt': 1
- Line base: -5
- Line range: 14
- Opcode base: 13
+ Length: 83
+ DWARF version: 2
+ Prologue length: 43
+ Address size: 4
+ Segment selector size: 0
+ Min instruction length: 1
+ Max operations per instruction: 1
+ Initial value if 'is_stmt': 1
+ Line base: -5
+ Line range: 14
+ Opcode base: 13
Opcodes:
[ 1] 0 arguments
@@ -83,15 +85,17 @@
Table at offset 87:
- Length: 72
- DWARF version: 2
- Prologue length: 28
- Minimum instruction length: 1
- Maximum operations per instruction: 1
- Initial value if 'is_stmt': 1
- Line base: -5
- Line range: 14
- Opcode base: 13
+ Length: 72
+ DWARF version: 2
+ Prologue length: 28
+ Address size: 4
+ Segment selector size: 0
+ Min instruction length: 1
+ Max operations per instruction: 1
+ Initial value if 'is_stmt': 1
+ Line base: -5
+ Line range: 14
+ Opcode base: 13
Opcodes:
[ 1] 0 arguments
@@ -133,15 +137,17 @@
Table at offset 163:
- Length: 106
- DWARF version: 2
- Prologue length: 43
- Minimum instruction length: 1
- Maximum operations per instruction: 1
- Initial value if 'is_stmt': 1
- Line base: -5
- Line range: 14
- Opcode base: 13
+ Length: 106
+ DWARF version: 2
+ Prologue length: 43
+ Address size: 4
+ Segment selector size: 0
+ Min instruction length: 1
+ Max operations per instruction: 1
+ Initial value if 'is_stmt': 1
+ Line base: -5
+ Line range: 14
+ Opcode base: 13
Opcodes:
[ 1] 0 arguments
@@ -256,4 +262,888 @@
EOF
+# A .debug_line table with mininum instruction length > 1.
+#
+# = hello.c
+# #include <stdio.h>
+#
+# int
+# main (int argc, char **argv)
+# {
+# printf ("Hello, %s\n", (argc > 0
+# ? argv[1]: "World"));
+# return 0;
+# }
+#
+# clang version 5.0.1 (tags/RELEASE_501/final)
+# Target: powerpc64-unknown-linux-gnu
+# clang -g -O2 -o testfile-ppc64-min-instr hello.c
+testfiles testfile-ppc64-min-instr
+
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=line testfile-ppc64-min-instr <<\EOF
+
+DWARF section [29] '.debug_line' at offset 0xdf6:
+
+Table at offset 0:
+
+ Length: 69
+ DWARF version: 2
+ Prologue length: 30
+ Address size: 8
+ Segment selector size: 0
+ Min instruction length: 4
+ Max operations per instruction: 1
+ Initial value if 'is_stmt': 1
+ Line base: -5
+ Line range: 14
+ Opcode base: 13
+
+Opcodes:
+ [ 1] 0 arguments
+ [ 2] 1 argument
+ [ 3] 1 argument
+ [ 4] 1 argument
+ [ 5] 1 argument
+ [ 6] 0 arguments
+ [ 7] 0 arguments
+ [ 8] 0 arguments
+ [ 9] 1 argument
+ [10] 0 arguments
+ [11] 0 arguments
+ [12] 1 argument
+
+Directory table:
+
+File name table:
+ Entry Dir Time Size Name
+ 1 0 0 0 hello.c
+
+Line number statements:
+ [ 28] extended opcode 2: set address to 0x100005a4 <main>
+ [ 33] special opcode 22: address+0 = 0x100005a4 <main>, line+4 = 5
+ [ 34] set column to 27
+ [ 36] set prologue end flag
+ [ 37] special opcode 19: address+0 = 0x100005a4 <main>, line+1 = 6
+ [ 38] set column to 8
+ [ 3a] special opcode 47: address+8 = 0x100005ac <main+0x8>, line+1 = 7
+ [ 3b] set 'is_stmt' to 0
+ [ 3c] advance line by constant -7 to 0
+ [ 3e] special opcode 32: address+4 = 0x100005b0 <main+0xc>, line+0 = 0
+ [ 3f] set column to 3
+ [ 41] set 'is_stmt' to 1
+ [ 42] special opcode 108: address+24 = 0x100005c8 <main+0x24>, line+6 = 6
+ [ 43] special opcode 76: address+16 = 0x100005d8 <main+0x34>, line+2 = 8
+ [ 44] advance address by 32 to 0x100005f8
+ [ 46] extended opcode 1: end of sequence
+EOF
+
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=decodedline testfile-ppc64-min-instr <<\EOF
+
+DWARF section [29] '.debug_line' at offset 0xdf6:
+
+ CU [b] hello.c
+ line:col SBPE* disc isa op address (Statement Block Prologue Epilogue *End)
+ /home/fedora/mjw/hello.c (mtime: 0, length: 0)
+ 5:0 S 0 0 0 0x00000000100005a4 <main>
+ 6:27 S P 0 0 0 0x00000000100005a4 <main>
+ 7:8 S 0 0 0 0x00000000100005ac <main+0x8>
+ 0:8 0 0 0 0x00000000100005b0 <main+0xc>
+ 6:3 S 0 0 0 0x00000000100005c8 <main+0x24>
+ 8:3 S 0 0 0 0x00000000100005d8 <main+0x34>
+ 8:3 S * 0 0 0 0x00000000100005f7 <main+0x53>
+
+EOF
+
+# Two tests for the same code but encoded using DWARF4 or DWARF5.
+# Output is identical except for the section offset and CU numbers.
+# See tests/testfile-dwarf-45.source.
+
+testfiles testfile-dwarf-4 testfile-dwarf-5
+
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=decodedline testfile-dwarf-4 << \EOF
+
+DWARF section [29] '.debug_line' at offset 0x1734:
+
+ CU [b] hello.c
+ line:col SBPE* disc isa op address (Statement Block Prologue Epilogue *End)
+ /var/tmp/hello/hello.c (mtime: 0, length: 0)
+ 21:0 S 0 0 0 0x0000000000400510 <foo>
+ 22:1 S 0 0 0 0x0000000000400510 <foo>
+ 22:3 0 0 0 0x0000000000400510 <foo>
+ 25:6 0 0 0 0x0000000000400514 <foo+0x4>
+ 25:34 S 0 0 0 0x000000000040051a <foo+0xa>
+ 25:3 0 0 0 0x000000000040051a <foo+0xa>
+ 26:34 0 0 0 0x000000000040051e <foo+0xe>
+ 25:1 1 0 0 0x0000000000400528 <foo+0x18>
+ /var/tmp/hello/hello.h (mtime: 0, length: 0)
+ 7:18 S 0 0 0 0x000000000040052b <foo+0x1b>
+ 9:3 S 0 0 0 0x000000000040052b <foo+0x1b>
+ 9:3 0 0 0 0x000000000040052b <foo+0x1b>
+ 10:6 S 0 0 0 0x000000000040052f <foo+0x1f>
+ 10:5 0 0 0 0x000000000040052f <foo+0x1f>
+ 12:7 S 0 0 0 0x0000000000400531 <foo+0x21>
+ /var/tmp/hello/hello.c (mtime: 0, length: 0)
+ 10:3 S 0 0 0 0x0000000000400531 <foo+0x21>
+ 12:3 S 0 0 0 0x0000000000400531 <foo+0x21>
+ 12:3 0 0 0 0x0000000000400531 <foo+0x21>
+ 13:6 S 0 0 0 0x0000000000400535 <foo+0x25>
+ 13:5 0 0 0 0x0000000000400535 <foo+0x25>
+ 15:7 S 0 0 0 0x0000000000400539 <foo+0x29>
+ 22:3 S 0 0 0 0x0000000000400539 <foo+0x29>
+ 22:3 0 0 0 0x0000000000400539 <foo+0x29>
+ 23:6 S 0 0 0 0x000000000040053d <foo+0x2d>
+ 23:5 0 0 0 0x000000000040053d <foo+0x2d>
+ 9:12 S 0 0 0 0x0000000000400550 <baz>
+ 10:1 S 0 0 0 0x0000000000400550 <baz>
+ 12:3 S 0 0 0 0x0000000000400550 <baz>
+ 12:3 0 0 0 0x0000000000400550 <baz>
+ 13:9 0 0 0 0x0000000000400556 <baz+0x6>
+ 15:7 S 0 0 0 0x000000000040055f <baz+0xf>
+ 15:3 0 0 0 0x000000000040055f <baz+0xf>
+ 15:7 * 0 0 0 0x0000000000400560 <baz+0x10>
+
+ CU [21c] world.c
+ line:col SBPE* disc isa op address (Statement Block Prologue Epilogue *End)
+ /var/tmp/hello/world.c (mtime: 0, length: 0)
+ 15:0 S 0 0 0 0x0000000000400410 <main>
+ 16:1 S 0 0 0 0x0000000000400410 <main>
+ 17:3 S 0 0 0 0x0000000000400410 <main>
+ 15:3 0 0 0 0x0000000000400410 <main>
+ 17:1 0 0 0 0x0000000000400419 <main+0x9>
+ 18:6 S 0 0 0 0x000000000040041e <main+0xe>
+ 18:5 0 0 0 0x000000000040041e <main+0xe>
+ 22:7 S 0 0 0 0x0000000000400421 <main+0x11>
+ 22:3 S * 0 0 0 0x000000000040042f <main+0x1f>
+
+ 6:0 S 0 0 0 0x0000000000400570 <calc>
+ 7:1 S 0 0 0 0x0000000000400570 <calc>
+ 7:3 0 0 0 0x0000000000400570 <calc>
+ 7:6 1 0 0 0x0000000000400575 <calc+0x5>
+ 7:24 0 0 0 0x0000000000400578 <calc+0x8>
+ 10:17 S 0 0 0 0x000000000040057d <calc+0xd>
+ 10:3 0 0 0 0x000000000040057d <calc+0xd>
+ /var/tmp/hello/hello.h (mtime: 0, length: 0)
+ 10:10 0 0 0 0x0000000000400583 <calc+0x13>
+ /var/tmp/hello/world.c (mtime: 0, length: 0)
+ 10:7 0 0 0 0x0000000000400585 <calc+0x15>
+ /var/tmp/hello/hello.h (mtime: 0, length: 0)
+ 7:10 S 0 0 0 0x0000000000400588 <calc+0x18>
+ 9:3 S 0 0 0 0x0000000000400588 <calc+0x18>
+ 10:3 0 0 0 0x0000000000400588 <calc+0x18>
+ 12:7 S 0 0 0 0x000000000040058f <calc+0x1f>
+ 12:3 0 0 0 0x000000000040058f <calc+0x1f>
+ /var/tmp/hello/world.c (mtime: 0, length: 0)
+ 11:10 0 0 0 0x0000000000400598 <calc+0x28>
+ 11:1 * 0 0 0 0x000000000040059a <calc+0x2a>
+
+EOF
+
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=decodedline testfile-dwarf-5 << \EOF
+
+DWARF section [29] '.debug_line' at offset 0x171f:
+
+ CU [c] hello.c
+ line:col SBPE* disc isa op address (Statement Block Prologue Epilogue *End)
+ /var/tmp/hello/hello.c (mtime: 0, length: 0)
+ 21:0 S 0 0 0 0x0000000000400510 <foo>
+ 22:1 S 0 0 0 0x0000000000400510 <foo>
+ 22:3 0 0 0 0x0000000000400510 <foo>
+ 25:6 0 0 0 0x0000000000400514 <foo+0x4>
+ 25:34 S 0 0 0 0x000000000040051a <foo+0xa>
+ 25:3 0 0 0 0x000000000040051a <foo+0xa>
+ 26:34 0 0 0 0x000000000040051e <foo+0xe>
+ 25:1 1 0 0 0x0000000000400528 <foo+0x18>
+ /var/tmp/hello/hello.h (mtime: 0, length: 0)
+ 7:18 S 0 0 0 0x000000000040052b <foo+0x1b>
+ 9:3 S 0 0 0 0x000000000040052b <foo+0x1b>
+ 9:3 0 0 0 0x000000000040052b <foo+0x1b>
+ 10:6 S 0 0 0 0x000000000040052f <foo+0x1f>
+ 10:5 0 0 0 0x000000000040052f <foo+0x1f>
+ 12:7 S 0 0 0 0x0000000000400531 <foo+0x21>
+ /var/tmp/hello/hello.c (mtime: 0, length: 0)
+ 10:3 S 0 0 0 0x0000000000400531 <foo+0x21>
+ 12:3 S 0 0 0 0x0000000000400531 <foo+0x21>
+ 12:3 0 0 0 0x0000000000400531 <foo+0x21>
+ 13:6 S 0 0 0 0x0000000000400535 <foo+0x25>
+ 13:5 0 0 0 0x0000000000400535 <foo+0x25>
+ 15:7 S 0 0 0 0x0000000000400539 <foo+0x29>
+ 22:3 S 0 0 0 0x0000000000400539 <foo+0x29>
+ 22:3 0 0 0 0x0000000000400539 <foo+0x29>
+ 23:6 S 0 0 0 0x000000000040053d <foo+0x2d>
+ 23:5 0 0 0 0x000000000040053d <foo+0x2d>
+ 9:12 S 0 0 0 0x0000000000400550 <baz>
+ 10:1 S 0 0 0 0x0000000000400550 <baz>
+ 12:3 S 0 0 0 0x0000000000400550 <baz>
+ 12:3 0 0 0 0x0000000000400550 <baz>
+ 13:9 0 0 0 0x0000000000400556 <baz+0x6>
+ 15:7 S 0 0 0 0x000000000040055f <baz+0xf>
+ 15:3 0 0 0 0x000000000040055f <baz+0xf>
+ 15:7 * 0 0 0 0x0000000000400560 <baz+0x10>
+
+ CU [218] world.c
+ line:col SBPE* disc isa op address (Statement Block Prologue Epilogue *End)
+ /var/tmp/hello/world.c (mtime: 0, length: 0)
+ 15:0 S 0 0 0 0x0000000000400410 <main>
+ 16:1 S 0 0 0 0x0000000000400410 <main>
+ 17:3 S 0 0 0 0x0000000000400410 <main>
+ 15:3 0 0 0 0x0000000000400410 <main>
+ 17:1 0 0 0 0x0000000000400419 <main+0x9>
+ 18:6 S 0 0 0 0x000000000040041e <main+0xe>
+ 18:5 0 0 0 0x000000000040041e <main+0xe>
+ 22:7 S 0 0 0 0x0000000000400421 <main+0x11>
+ 22:3 S * 0 0 0 0x000000000040042f <main+0x1f>
+
+ 6:0 S 0 0 0 0x0000000000400570 <calc>
+ 7:1 S 0 0 0 0x0000000000400570 <calc>
+ 7:3 0 0 0 0x0000000000400570 <calc>
+ 7:6 1 0 0 0x0000000000400575 <calc+0x5>
+ 7:24 0 0 0 0x0000000000400578 <calc+0x8>
+ 10:17 S 0 0 0 0x000000000040057d <calc+0xd>
+ 10:3 0 0 0 0x000000000040057d <calc+0xd>
+ /var/tmp/hello/hello.h (mtime: 0, length: 0)
+ 10:10 0 0 0 0x0000000000400583 <calc+0x13>
+ /var/tmp/hello/world.c (mtime: 0, length: 0)
+ 10:7 0 0 0 0x0000000000400585 <calc+0x15>
+ /var/tmp/hello/hello.h (mtime: 0, length: 0)
+ 7:10 S 0 0 0 0x0000000000400588 <calc+0x18>
+ 9:3 S 0 0 0 0x0000000000400588 <calc+0x18>
+ 10:3 0 0 0 0x0000000000400588 <calc+0x18>
+ 12:7 S 0 0 0 0x000000000040058f <calc+0x1f>
+ 12:3 0 0 0 0x000000000040058f <calc+0x1f>
+ /var/tmp/hello/world.c (mtime: 0, length: 0)
+ 11:10 0 0 0 0x0000000000400598 <calc+0x28>
+ 11:1 * 0 0 0 0x000000000040059a <calc+0x2a>
+
+EOF
+
+# After discarding the different offsets in the line number statements,
+# the remaining difference between 4 and 5 is (besides the header/length)
+# Just the representation of the directory and line tables:
+
+# Directory table:
+# - /opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include
+# + [path(line_strp)]
+# + 0 /var/tmp/hello (90)
+# + 1 /opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include (17)
+#
+# File name table:
+# - Entry Dir Time Size Name
+# - 1 0 0 0 hello.c
+# - 2 0 0 0 hello.h
+# - 3 1 0 0 stddef.h
+# + [path(line_strp), directory_index(data1)]
+# + 0 hello.c (9), 0
+# + 1 hello.c (9), 0
+# + 2 hello.h (82), 0
+# + 3 stddef.h (0), 1
+#
+# Directory table:
+# - /usr/include
+# + [path(line_strp)]
+# + 0 /var/tmp/hello (90)
+# + 1 /usr/include (122)
+#
+# File name table:
+# - Entry Dir Time Size Name
+# - 1 0 0 0 world.c
+# - 2 0 0 0 hello.h
+# - 3 1 0 0 stdlib.h
+# + [path(line_strp), directory_index(data1)]
+# + 0 world.c (114), 0
+# + 1 world.c (114), 0
+# + 2 hello.h (82), 0
+# + 3 stdlib.h (105), 1
+
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=line testfile-dwarf-4 << \EOF
+
+DWARF section [29] '.debug_line' at offset 0x1734:
+
+Table at offset 0:
+
+ Length: 608
+ DWARF version: 4
+ Prologue length: 119
+ Address size: 8
+ Segment selector size: 0
+ Min instruction length: 1
+ Max operations per instruction: 1
+ Initial value if 'is_stmt': 1
+ Line base: -10
+ Line range: 242
+ Opcode base: 13
+
+Opcodes:
+ [ 1] 0 arguments
+ [ 2] 1 argument
+ [ 3] 1 argument
+ [ 4] 1 argument
+ [ 5] 1 argument
+ [ 6] 0 arguments
+ [ 7] 0 arguments
+ [ 8] 0 arguments
+ [ 9] 1 argument
+ [10] 0 arguments
+ [11] 0 arguments
+ [12] 1 argument
+
+Directory table:
+ /opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include
+
+File name table:
+ Entry Dir Time Size Name
+ 1 0 0 0 hello.c
+ 2 0 0 0 hello.h
+ 3 1 0 0 stddef.h
+
+Line number statements:
+ [ 81] extended opcode 2: set address to 0x400510 <foo>
+ [ 8c] special opcode 43: address+0 = 0x400510 <foo>, line+20 = 21
+ [ 8d] set column to 1
+ [ 8f] extended opcode 2: set address to 0x400510 <foo>
+ [ 9a] special opcode 24: address+0 = 0x400510 <foo>, line+1 = 22
+ [ 9b] set column to 3
+ [ 9d] extended opcode 2: set address to 0x400510 <foo>
+ [ a8] set 'is_stmt' to 0
+ [ a9] copy
+ [ aa] set column to 6
+ [ ac] extended opcode 2: set address to 0x400514 <foo+0x4>
+ [ b7] special opcode 26: address+0 = 0x400514 <foo+0x4>, line+3 = 25
+ [ b8] set column to 34
+ [ ba] extended opcode 2: set address to 0x40051a <foo+0xa>
+ [ c5] set 'is_stmt' to 1
+ [ c6] copy
+ [ c7] set column to 3
+ [ c9] extended opcode 2: set address to 0x40051a <foo+0xa>
+ [ d4] set 'is_stmt' to 0
+ [ d5] copy
+ [ d6] set column to 34
+ [ d8] extended opcode 2: set address to 0x40051e <foo+0xe>
+ [ e3] special opcode 24: address+0 = 0x40051e <foo+0xe>, line+1 = 26
+ [ e4] set column to 1
+ [ e6] extended opcode 2: set address to 0x400528 <foo+0x18>
+ [ f1] extended opcode 4: set discriminator to 1
+ [ f5] special opcode 22: address+0 = 0x400528 <foo+0x18>, line-1 = 25
+ [ f6] set column to 18
+ [ f8] extended opcode 2: set address to 0x40052b <foo+0x1b>
+ [ 103] set file to 2
+ [ 105] set 'is_stmt' to 1
+ [ 106] advance line by constant -18 to 7
+ [ 108] copy
+ [ 109] set column to 3
+ [ 10b] extended opcode 2: set address to 0x40052b <foo+0x1b>
+ [ 116] special opcode 25: address+0 = 0x40052b <foo+0x1b>, line+2 = 9
+ [ 117] set column to 3
+ [ 119] extended opcode 2: set address to 0x40052b <foo+0x1b>
+ [ 124] set 'is_stmt' to 0
+ [ 125] copy
+ [ 126] set column to 6
+ [ 128] extended opcode 2: set address to 0x40052f <foo+0x1f>
+ [ 133] extended opcode 4: set discriminator to 0
+ [ 137] set 'is_stmt' to 1
+ [ 138] special opcode 24: address+0 = 0x40052f <foo+0x1f>, line+1 = 10
+ [ 139] set column to 5
+ [ 13b] extended opcode 2: set address to 0x40052f <foo+0x1f>
+ [ 146] set 'is_stmt' to 0
+ [ 147] copy
+ [ 148] set column to 7
+ [ 14a] extended opcode 2: set address to 0x400531 <foo+0x21>
+ [ 155] set 'is_stmt' to 1
+ [ 156] special opcode 25: address+0 = 0x400531 <foo+0x21>, line+2 = 12
+ [ 157] set column to 3
+ [ 159] extended opcode 2: set address to 0x400531 <foo+0x21>
+ [ 164] set file to 1
+ [ 166] special opcode 21: address+0 = 0x400531 <foo+0x21>, line-2 = 10
+ [ 167] set column to 3
+ [ 169] extended opcode 2: set address to 0x400531 <foo+0x21>
+ [ 174] special opcode 25: address+0 = 0x400531 <foo+0x21>, line+2 = 12
+ [ 175] set column to 3
+ [ 177] extended opcode 2: set address to 0x400531 <foo+0x21>
+ [ 182] set 'is_stmt' to 0
+ [ 183] copy
+ [ 184] set column to 6
+ [ 186] extended opcode 2: set address to 0x400535 <foo+0x25>
+ [ 191] set 'is_stmt' to 1
+ [ 192] special opcode 24: address+0 = 0x400535 <foo+0x25>, line+1 = 13
+ [ 193] set column to 5
+ [ 195] extended opcode 2: set address to 0x400535 <foo+0x25>
+ [ 1a0] set 'is_stmt' to 0
+ [ 1a1] copy
+ [ 1a2] set column to 7
+ [ 1a4] extended opcode 2: set address to 0x400539 <foo+0x29>
+ [ 1af] set 'is_stmt' to 1
+ [ 1b0] special opcode 25: address+0 = 0x400539 <foo+0x29>, line+2 = 15
+ [ 1b1] set column to 3
+ [ 1b3] extended opcode 2: set address to 0x400539 <foo+0x29>
+ [ 1be] special opcode 30: address+0 = 0x400539 <foo+0x29>, line+7 = 22
+ [ 1bf] set column to 3
+ [ 1c1] extended opcode 2: set address to 0x400539 <foo+0x29>
+ [ 1cc] set 'is_stmt' to 0
+ [ 1cd] copy
+ [ 1ce] set column to 6
+ [ 1d0] extended opcode 2: set address to 0x40053d <foo+0x2d>
+ [ 1db] set 'is_stmt' to 1
+ [ 1dc] special opcode 24: address+0 = 0x40053d <foo+0x2d>, line+1 = 23
+ [ 1dd] set column to 5
+ [ 1df] extended opcode 2: set address to 0x40053d <foo+0x2d>
+ [ 1ea] set 'is_stmt' to 0
+ [ 1eb] copy
+ [ 1ec] set column to 12
+ [ 1ee] extended opcode 2: set address to 0x400550 <baz>
+ [ 1f9] set 'is_stmt' to 1
+ [ 1fa] advance line by constant -14 to 9
+ [ 1fc] copy
+ [ 1fd] set column to 1
+ [ 1ff] extended opcode 2: set address to 0x400550 <baz>
+ [ 20a] special opcode 24: address+0 = 0x400550 <baz>, line+1 = 10
+ [ 20b] set column to 3
+ [ 20d] extended opcode 2: set address to 0x400550 <baz>
+ [ 218] special opcode 25: address+0 = 0x400550 <baz>, line+2 = 12
+ [ 219] set column to 3
+ [ 21b] extended opcode 2: set address to 0x400550 <baz>
+ [ 226] set 'is_stmt' to 0
+ [ 227] copy
+ [ 228] set column to 9
+ [ 22a] extended opcode 2: set address to 0x400556 <baz+0x6>
+ [ 235] special opcode 24: address+0 = 0x400556 <baz+0x6>, line+1 = 13
+ [ 236] set column to 7
+ [ 238] extended opcode 2: set address to 0x40055f <baz+0xf>
+ [ 243] set 'is_stmt' to 1
+ [ 244] special opcode 25: address+0 = 0x40055f <baz+0xf>, line+2 = 15
+ [ 245] set column to 3
+ [ 247] extended opcode 2: set address to 0x40055f <baz+0xf>
+ [ 252] set 'is_stmt' to 0
+ [ 253] copy
+ [ 254] set column to 7
+ [ 256] extended opcode 2: set address to 0x400561
+ [ 261] extended opcode 1: end of sequence
+
+Table at offset 612:
+
+ Length: 450
+ DWARF version: 4
+ Prologue length: 67
+ Address size: 8
+ Segment selector size: 0
+ Min instruction length: 1
+ Max operations per instruction: 1
+ Initial value if 'is_stmt': 1
+ Line base: -10
+ Line range: 242
+ Opcode base: 13
+
+Opcodes:
+ [ 1] 0 arguments
+ [ 2] 1 argument
+ [ 3] 1 argument
+ [ 4] 1 argument
+ [ 5] 1 argument
+ [ 6] 0 arguments
+ [ 7] 0 arguments
+ [ 8] 0 arguments
+ [ 9] 1 argument
+ [10] 0 arguments
+ [11] 0 arguments
+ [12] 1 argument
+
+Directory table:
+ /usr/include
+
+File name table:
+ Entry Dir Time Size Name
+ 1 0 0 0 world.c
+ 2 0 0 0 hello.h
+ 3 1 0 0 stdlib.h
+
+Line number statements:
+ [ 2b1] extended opcode 2: set address to 0x400410 <main>
+ [ 2bc] special opcode 37: address+0 = 0x400410 <main>, line+14 = 15
+ [ 2bd] set column to 1
+ [ 2bf] extended opcode 2: set address to 0x400410 <main>
+ [ 2ca] special opcode 24: address+0 = 0x400410 <main>, line+1 = 16
+ [ 2cb] set column to 3
+ [ 2cd] extended opcode 2: set address to 0x400410 <main>
+ [ 2d8] special opcode 24: address+0 = 0x400410 <main>, line+1 = 17
+ [ 2d9] set column to 3
+ [ 2db] extended opcode 2: set address to 0x400410 <main>
+ [ 2e6] set 'is_stmt' to 0
+ [ 2e7] special opcode 21: address+0 = 0x400410 <main>, line-2 = 15
+ [ 2e8] set column to 1
+ [ 2ea] extended opcode 2: set address to 0x400419 <main+0x9>
+ [ 2f5] special opcode 25: address+0 = 0x400419 <main+0x9>, line+2 = 17
+ [ 2f6] set column to 6
+ [ 2f8] extended opcode 2: set address to 0x40041e <main+0xe>
+ [ 303] set 'is_stmt' to 1
+ [ 304] special opcode 24: address+0 = 0x40041e <main+0xe>, line+1 = 18
+ [ 305] set column to 5
+ [ 307] extended opcode 2: set address to 0x40041e <main+0xe>
+ [ 312] set 'is_stmt' to 0
+ [ 313] copy
+ [ 314] set column to 7
+ [ 316] extended opcode 2: set address to 0x400421 <main+0x11>
+ [ 321] set 'is_stmt' to 1
+ [ 322] special opcode 27: address+0 = 0x400421 <main+0x11>, line+4 = 22
+ [ 323] set column to 3
+ [ 325] extended opcode 2: set address to 0x400430 <_start>
+ [ 330] extended opcode 1: end of sequence
+ [ 333] extended opcode 2: set address to 0x400570 <calc>
+ [ 33e] special opcode 28: address+0 = 0x400570 <calc>, line+5 = 6
+ [ 33f] set column to 1
+ [ 341] extended opcode 2: set address to 0x400570 <calc>
+ [ 34c] special opcode 24: address+0 = 0x400570 <calc>, line+1 = 7
+ [ 34d] set column to 3
+ [ 34f] extended opcode 2: set address to 0x400570 <calc>
+ [ 35a] set 'is_stmt' to 0
+ [ 35b] copy
+ [ 35c] set column to 6
+ [ 35e] extended opcode 2: set address to 0x400575 <calc+0x5>
+ [ 369] extended opcode 4: set discriminator to 1
+ [ 36d] copy
+ [ 36e] set column to 24
+ [ 370] extended opcode 2: set address to 0x400578 <calc+0x8>
+ [ 37b] copy
+ [ 37c] set column to 17
+ [ 37e] extended opcode 2: set address to 0x40057d <calc+0xd>
+ [ 389] extended opcode 4: set discriminator to 0
+ [ 38d] set 'is_stmt' to 1
+ [ 38e] special opcode 26: address+0 = 0x40057d <calc+0xd>, line+3 = 10
+ [ 38f] set column to 3
+ [ 391] extended opcode 2: set address to 0x40057d <calc+0xd>
+ [ 39c] set 'is_stmt' to 0
+ [ 39d] copy
+ [ 39e] set column to 10
+ [ 3a0] extended opcode 2: set address to 0x400583 <calc+0x13>
+ [ 3ab] set file to 2
+ [ 3ad] copy
+ [ 3ae] set column to 7
+ [ 3b0] extended opcode 2: set address to 0x400585 <calc+0x15>
+ [ 3bb] set file to 1
+ [ 3bd] copy
+ [ 3be] set column to 10
+ [ 3c0] extended opcode 2: set address to 0x400588 <calc+0x18>
+ [ 3cb] set file to 2
+ [ 3cd] set 'is_stmt' to 1
+ [ 3ce] special opcode 20: address+0 = 0x400588 <calc+0x18>, line-3 = 7
+ [ 3cf] set column to 3
+ [ 3d1] extended opcode 2: set address to 0x400588 <calc+0x18>
+ [ 3dc] special opcode 25: address+0 = 0x400588 <calc+0x18>, line+2 = 9
+ [ 3dd] set column to 3
+ [ 3df] extended opcode 2: set address to 0x400588 <calc+0x18>
+ [ 3ea] set 'is_stmt' to 0
+ [ 3eb] special opcode 24: address+0 = 0x400588 <calc+0x18>, line+1 = 10
+ [ 3ec] set column to 7
+ [ 3ee] extended opcode 2: set address to 0x40058f <calc+0x1f>
+ [ 3f9] set 'is_stmt' to 1
+ [ 3fa] special opcode 25: address+0 = 0x40058f <calc+0x1f>, line+2 = 12
+ [ 3fb] set column to 3
+ [ 3fd] extended opcode 2: set address to 0x40058f <calc+0x1f>
+ [ 408] set 'is_stmt' to 0
+ [ 409] copy
+ [ 40a] set column to 10
+ [ 40c] extended opcode 2: set address to 0x400598 <calc+0x28>
+ [ 417] set file to 1
+ [ 419] special opcode 22: address+0 = 0x400598 <calc+0x28>, line-1 = 11
+ [ 41a] set column to 1
+ [ 41c] extended opcode 2: set address to 0x40059b
+ [ 427] extended opcode 1: end of sequence
+EOF
+
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=line testfile-dwarf-5 << \EOF
+
+DWARF section [29] '.debug_line' at offset 0x171f:
+
+Table at offset 0:
+
+ Length: 547
+ DWARF version: 5
+ Prologue length: 56
+ Address size: 8
+ Segment selector size: 0
+ Min instruction length: 1
+ Max operations per instruction: 1
+ Initial value if 'is_stmt': 1
+ Line base: -10
+ Line range: 242
+ Opcode base: 13
+
+Opcodes:
+ [ 1] 0 arguments
+ [ 2] 1 argument
+ [ 3] 1 argument
+ [ 4] 1 argument
+ [ 5] 1 argument
+ [ 6] 0 arguments
+ [ 7] 0 arguments
+ [ 8] 0 arguments
+ [ 9] 1 argument
+ [10] 0 arguments
+ [11] 0 arguments
+ [12] 1 argument
+
+Directory table:
+ [path(line_strp)]
+ 0 /var/tmp/hello (90)
+ 1 /opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include (17)
+
+File name table:
+ [path(line_strp), directory_index(data1)]
+ 0 hello.c (9), 0
+ 1 hello.c (9), 0
+ 2 hello.h (82), 0
+ 3 stddef.h (0), 1
+
+Line number statements:
+ [ 44] extended opcode 2: set address to 0x400510 <foo>
+ [ 4f] special opcode 43: address+0 = 0x400510 <foo>, line+20 = 21
+ [ 50] set column to 1
+ [ 52] extended opcode 2: set address to 0x400510 <foo>
+ [ 5d] special opcode 24: address+0 = 0x400510 <foo>, line+1 = 22
+ [ 5e] set column to 3
+ [ 60] extended opcode 2: set address to 0x400510 <foo>
+ [ 6b] set 'is_stmt' to 0
+ [ 6c] copy
+ [ 6d] set column to 6
+ [ 6f] extended opcode 2: set address to 0x400514 <foo+0x4>
+ [ 7a] special opcode 26: address+0 = 0x400514 <foo+0x4>, line+3 = 25
+ [ 7b] set column to 34
+ [ 7d] extended opcode 2: set address to 0x40051a <foo+0xa>
+ [ 88] set 'is_stmt' to 1
+ [ 89] copy
+ [ 8a] set column to 3
+ [ 8c] extended opcode 2: set address to 0x40051a <foo+0xa>
+ [ 97] set 'is_stmt' to 0
+ [ 98] copy
+ [ 99] set column to 34
+ [ 9b] extended opcode 2: set address to 0x40051e <foo+0xe>
+ [ a6] special opcode 24: address+0 = 0x40051e <foo+0xe>, line+1 = 26
+ [ a7] set column to 1
+ [ a9] extended opcode 2: set address to 0x400528 <foo+0x18>
+ [ b4] extended opcode 4: set discriminator to 1
+ [ b8] special opcode 22: address+0 = 0x400528 <foo+0x18>, line-1 = 25
+ [ b9] set column to 18
+ [ bb] extended opcode 2: set address to 0x40052b <foo+0x1b>
+ [ c6] set file to 2
+ [ c8] set 'is_stmt' to 1
+ [ c9] advance line by constant -18 to 7
+ [ cb] copy
+ [ cc] set column to 3
+ [ ce] extended opcode 2: set address to 0x40052b <foo+0x1b>
+ [ d9] special opcode 25: address+0 = 0x40052b <foo+0x1b>, line+2 = 9
+ [ da] set column to 3
+ [ dc] extended opcode 2: set address to 0x40052b <foo+0x1b>
+ [ e7] set 'is_stmt' to 0
+ [ e8] copy
+ [ e9] set column to 6
+ [ eb] extended opcode 2: set address to 0x40052f <foo+0x1f>
+ [ f6] extended opcode 4: set discriminator to 0
+ [ fa] set 'is_stmt' to 1
+ [ fb] special opcode 24: address+0 = 0x40052f <foo+0x1f>, line+1 = 10
+ [ fc] set column to 5
+ [ fe] extended opcode 2: set address to 0x40052f <foo+0x1f>
+ [ 109] set 'is_stmt' to 0
+ [ 10a] copy
+ [ 10b] set column to 7
+ [ 10d] extended opcode 2: set address to 0x400531 <foo+0x21>
+ [ 118] set 'is_stmt' to 1
+ [ 119] special opcode 25: address+0 = 0x400531 <foo+0x21>, line+2 = 12
+ [ 11a] set column to 3
+ [ 11c] extended opcode 2: set address to 0x400531 <foo+0x21>
+ [ 127] set file to 1
+ [ 129] special opcode 21: address+0 = 0x400531 <foo+0x21>, line-2 = 10
+ [ 12a] set column to 3
+ [ 12c] extended opcode 2: set address to 0x400531 <foo+0x21>
+ [ 137] special opcode 25: address+0 = 0x400531 <foo+0x21>, line+2 = 12
+ [ 138] set column to 3
+ [ 13a] extended opcode 2: set address to 0x400531 <foo+0x21>
+ [ 145] set 'is_stmt' to 0
+ [ 146] copy
+ [ 147] set column to 6
+ [ 149] extended opcode 2: set address to 0x400535 <foo+0x25>
+ [ 154] set 'is_stmt' to 1
+ [ 155] special opcode 24: address+0 = 0x400535 <foo+0x25>, line+1 = 13
+ [ 156] set column to 5
+ [ 158] extended opcode 2: set address to 0x400535 <foo+0x25>
+ [ 163] set 'is_stmt' to 0
+ [ 164] copy
+ [ 165] set column to 7
+ [ 167] extended opcode 2: set address to 0x400539 <foo+0x29>
+ [ 172] set 'is_stmt' to 1
+ [ 173] special opcode 25: address+0 = 0x400539 <foo+0x29>, line+2 = 15
+ [ 174] set column to 3
+ [ 176] extended opcode 2: set address to 0x400539 <foo+0x29>
+ [ 181] special opcode 30: address+0 = 0x400539 <foo+0x29>, line+7 = 22
+ [ 182] set column to 3
+ [ 184] extended opcode 2: set address to 0x400539 <foo+0x29>
+ [ 18f] set 'is_stmt' to 0
+ [ 190] copy
+ [ 191] set column to 6
+ [ 193] extended opcode 2: set address to 0x40053d <foo+0x2d>
+ [ 19e] set 'is_stmt' to 1
+ [ 19f] special opcode 24: address+0 = 0x40053d <foo+0x2d>, line+1 = 23
+ [ 1a0] set column to 5
+ [ 1a2] extended opcode 2: set address to 0x40053d <foo+0x2d>
+ [ 1ad] set 'is_stmt' to 0
+ [ 1ae] copy
+ [ 1af] set column to 12
+ [ 1b1] extended opcode 2: set address to 0x400550 <baz>
+ [ 1bc] set 'is_stmt' to 1
+ [ 1bd] advance line by constant -14 to 9
+ [ 1bf] copy
+ [ 1c0] set column to 1
+ [ 1c2] extended opcode 2: set address to 0x400550 <baz>
+ [ 1cd] special opcode 24: address+0 = 0x400550 <baz>, line+1 = 10
+ [ 1ce] set column to 3
+ [ 1d0] extended opcode 2: set address to 0x400550 <baz>
+ [ 1db] special opcode 25: address+0 = 0x400550 <baz>, line+2 = 12
+ [ 1dc] set column to 3
+ [ 1de] extended opcode 2: set address to 0x400550 <baz>
+ [ 1e9] set 'is_stmt' to 0
+ [ 1ea] copy
+ [ 1eb] set column to 9
+ [ 1ed] extended opcode 2: set address to 0x400556 <baz+0x6>
+ [ 1f8] special opcode 24: address+0 = 0x400556 <baz+0x6>, line+1 = 13
+ [ 1f9] set column to 7
+ [ 1fb] extended opcode 2: set address to 0x40055f <baz+0xf>
+ [ 206] set 'is_stmt' to 1
+ [ 207] special opcode 25: address+0 = 0x40055f <baz+0xf>, line+2 = 15
+ [ 208] set column to 3
+ [ 20a] extended opcode 2: set address to 0x40055f <baz+0xf>
+ [ 215] set 'is_stmt' to 0
+ [ 216] copy
+ [ 217] set column to 7
+ [ 219] extended opcode 2: set address to 0x400561
+ [ 224] extended opcode 1: end of sequence
+
+Table at offset 551:
+
+ Length: 441
+ DWARF version: 5
+ Prologue length: 56
+ Address size: 8
+ Segment selector size: 0
+ Min instruction length: 1
+ Max operations per instruction: 1
+ Initial value if 'is_stmt': 1
+ Line base: -10
+ Line range: 242
+ Opcode base: 13
+
+Opcodes:
+ [ 1] 0 arguments
+ [ 2] 1 argument
+ [ 3] 1 argument
+ [ 4] 1 argument
+ [ 5] 1 argument
+ [ 6] 0 arguments
+ [ 7] 0 arguments
+ [ 8] 0 arguments
+ [ 9] 1 argument
+ [10] 0 arguments
+ [11] 0 arguments
+ [12] 1 argument
+
+Directory table:
+ [path(line_strp)]
+ 0 /var/tmp/hello (90)
+ 1 /usr/include (122)
+
+File name table:
+ [path(line_strp), directory_index(data1)]
+ 0 world.c (114), 0
+ 1 world.c (114), 0
+ 2 hello.h (82), 0
+ 3 stdlib.h (105), 1
+
+Line number statements:
+ [ 26b] extended opcode 2: set address to 0x400410 <main>
+ [ 276] special opcode 37: address+0 = 0x400410 <main>, line+14 = 15
+ [ 277] set column to 1
+ [ 279] extended opcode 2: set address to 0x400410 <main>
+ [ 284] special opcode 24: address+0 = 0x400410 <main>, line+1 = 16
+ [ 285] set column to 3
+ [ 287] extended opcode 2: set address to 0x400410 <main>
+ [ 292] special opcode 24: address+0 = 0x400410 <main>, line+1 = 17
+ [ 293] set column to 3
+ [ 295] extended opcode 2: set address to 0x400410 <main>
+ [ 2a0] set 'is_stmt' to 0
+ [ 2a1] special opcode 21: address+0 = 0x400410 <main>, line-2 = 15
+ [ 2a2] set column to 1
+ [ 2a4] extended opcode 2: set address to 0x400419 <main+0x9>
+ [ 2af] special opcode 25: address+0 = 0x400419 <main+0x9>, line+2 = 17
+ [ 2b0] set column to 6
+ [ 2b2] extended opcode 2: set address to 0x40041e <main+0xe>
+ [ 2bd] set 'is_stmt' to 1
+ [ 2be] special opcode 24: address+0 = 0x40041e <main+0xe>, line+1 = 18
+ [ 2bf] set column to 5
+ [ 2c1] extended opcode 2: set address to 0x40041e <main+0xe>
+ [ 2cc] set 'is_stmt' to 0
+ [ 2cd] copy
+ [ 2ce] set column to 7
+ [ 2d0] extended opcode 2: set address to 0x400421 <main+0x11>
+ [ 2db] set 'is_stmt' to 1
+ [ 2dc] special opcode 27: address+0 = 0x400421 <main+0x11>, line+4 = 22
+ [ 2dd] set column to 3
+ [ 2df] extended opcode 2: set address to 0x400430 <_start>
+ [ 2ea] extended opcode 1: end of sequence
+ [ 2ed] extended opcode 2: set address to 0x400570 <calc>
+ [ 2f8] special opcode 28: address+0 = 0x400570 <calc>, line+5 = 6
+ [ 2f9] set column to 1
+ [ 2fb] extended opcode 2: set address to 0x400570 <calc>
+ [ 306] special opcode 24: address+0 = 0x400570 <calc>, line+1 = 7
+ [ 307] set column to 3
+ [ 309] extended opcode 2: set address to 0x400570 <calc>
+ [ 314] set 'is_stmt' to 0
+ [ 315] copy
+ [ 316] set column to 6
+ [ 318] extended opcode 2: set address to 0x400575 <calc+0x5>
+ [ 323] extended opcode 4: set discriminator to 1
+ [ 327] copy
+ [ 328] set column to 24
+ [ 32a] extended opcode 2: set address to 0x400578 <calc+0x8>
+ [ 335] copy
+ [ 336] set column to 17
+ [ 338] extended opcode 2: set address to 0x40057d <calc+0xd>
+ [ 343] extended opcode 4: set discriminator to 0
+ [ 347] set 'is_stmt' to 1
+ [ 348] special opcode 26: address+0 = 0x40057d <calc+0xd>, line+3 = 10
+ [ 349] set column to 3
+ [ 34b] extended opcode 2: set address to 0x40057d <calc+0xd>
+ [ 356] set 'is_stmt' to 0
+ [ 357] copy
+ [ 358] set column to 10
+ [ 35a] extended opcode 2: set address to 0x400583 <calc+0x13>
+ [ 365] set file to 2
+ [ 367] copy
+ [ 368] set column to 7
+ [ 36a] extended opcode 2: set address to 0x400585 <calc+0x15>
+ [ 375] set file to 1
+ [ 377] copy
+ [ 378] set column to 10
+ [ 37a] extended opcode 2: set address to 0x400588 <calc+0x18>
+ [ 385] set file to 2
+ [ 387] set 'is_stmt' to 1
+ [ 388] special opcode 20: address+0 = 0x400588 <calc+0x18>, line-3 = 7
+ [ 389] set column to 3
+ [ 38b] extended opcode 2: set address to 0x400588 <calc+0x18>
+ [ 396] special opcode 25: address+0 = 0x400588 <calc+0x18>, line+2 = 9
+ [ 397] set column to 3
+ [ 399] extended opcode 2: set address to 0x400588 <calc+0x18>
+ [ 3a4] set 'is_stmt' to 0
+ [ 3a5] special opcode 24: address+0 = 0x400588 <calc+0x18>, line+1 = 10
+ [ 3a6] set column to 7
+ [ 3a8] extended opcode 2: set address to 0x40058f <calc+0x1f>
+ [ 3b3] set 'is_stmt' to 1
+ [ 3b4] special opcode 25: address+0 = 0x40058f <calc+0x1f>, line+2 = 12
+ [ 3b5] set column to 3
+ [ 3b7] extended opcode 2: set address to 0x40058f <calc+0x1f>
+ [ 3c2] set 'is_stmt' to 0
+ [ 3c3] copy
+ [ 3c4] set column to 10
+ [ 3c6] extended opcode 2: set address to 0x400598 <calc+0x28>
+ [ 3d1] set file to 1
+ [ 3d3] special opcode 22: address+0 = 0x400598 <calc+0x28>, line-1 = 11
+ [ 3d4] set column to 1
+ [ 3d6] extended opcode 2: set address to 0x40059b
+ [ 3e1] extended opcode 1: end of sequence
+EOF
+
exit 0
diff --git a/tests/run-readelf-loc.sh b/tests/run-readelf-loc.sh
index 98870fc..8594b54 100755
--- a/tests/run-readelf-loc.sh
+++ b/tests/run-readelf-loc.sh
@@ -63,15 +63,40 @@
testfileloc<<\EOF
DWARF section [33] '.debug_loc' at offset 0xd2a:
- [ 0] 0x0000000000400480 <main>..0x000000000040048d <main+0xd> [ 0] reg5
- [ 23] 0x0000000000400485 <main+0x5>..0x000000000040048d <main+0xd> [ 0] reg5
- [ 46] 0x00000000004004b2 <say+0x12>..0x00000000004004ba <say+0x1a> [ 0] breg5 0
+
+ CU [ b] base: 0x0000000000400480 <main>
+ [ 0] range 0, d
+ 0x0000000000400480 <main>..
+ 0x000000000040048c <main+0xc>
+ [ 0] reg5
+ [ 23] range 5, d
+ 0x0000000000400485 <main+0x5>..
+ 0x000000000040048c <main+0xc>
+ [ 0] reg5
+
+ CU [ e0] base: 0x00000000004004a0 <say>
+ [ 46] range 12, 1a
+ 0x00000000004004b2 <say+0x12>..
+ 0x00000000004004b9 <say+0x19>
+ [ 0] breg5 0
DWARF section [34] '.debug_ranges' at offset 0xd94:
- [ 0] 0x0000000000400480 <main>..0x0000000000400482 <main+0x2>
- 0x0000000000400485 <main+0x5>..0x000000000040048d <main+0xd>
- [ 30] 0x00000000004004ad <say+0xd>..0x00000000004004af <say+0xf>
- 0x00000000004004b2 <say+0x12>..0x00000000004004ba <say+0x1a>
+
+ CU [ b] base: 0x0000000000400480 <main>
+ [ 0] range 0, 2
+ 0x0000000000400480 <main>..
+ 0x0000000000400481 <main+0x1>
+ range 5, d
+ 0x0000000000400485 <main+0x5>..
+ 0x000000000040048c <main+0xc>
+
+ CU [ e0] base: 0x00000000004004a0 <say>
+ [ 30] range d, f
+ 0x00000000004004ad <say+0xd>..
+ 0x00000000004004ae <say+0xe>
+ range 12, 1a
+ 0x00000000004004b2 <say+0x12>..
+ 0x00000000004004b9 <say+0x19>
EOF
# Don't resolve addresses to symbols.
@@ -79,15 +104,40 @@
testfileloc<<\EOF
DWARF section [33] '.debug_loc' at offset 0xd2a:
- [ 0] 0x0000000000400480..0x000000000040048d [ 0] reg5
- [ 23] 0x0000000000400485..0x000000000040048d [ 0] reg5
- [ 46] 0x00000000004004b2..0x00000000004004ba [ 0] breg5 0
+
+ CU [ b] base: 0x0000000000400480
+ [ 0] range 0, d
+ 0x0000000000400480..
+ 0x000000000040048c
+ [ 0] reg5
+ [ 23] range 5, d
+ 0x0000000000400485..
+ 0x000000000040048c
+ [ 0] reg5
+
+ CU [ e0] base: 0x00000000004004a0
+ [ 46] range 12, 1a
+ 0x00000000004004b2..
+ 0x00000000004004b9
+ [ 0] breg5 0
DWARF section [34] '.debug_ranges' at offset 0xd94:
- [ 0] 0x0000000000400480..0x0000000000400482
- 0x0000000000400485..0x000000000040048d
- [ 30] 0x00000000004004ad..0x00000000004004af
- 0x00000000004004b2..0x00000000004004ba
+
+ CU [ b] base: 0x0000000000400480
+ [ 0] range 0, 2
+ 0x0000000000400480..
+ 0x0000000000400481
+ range 5, d
+ 0x0000000000400485..
+ 0x000000000040048c
+
+ CU [ e0] base: 0x00000000004004a0
+ [ 30] range d, f
+ 0x00000000004004ad..
+ 0x00000000004004ae
+ range 12, 1a
+ 0x00000000004004b2..
+ 0x00000000004004b9
EOF
# Produce "raw" unprocessed content.
@@ -95,15 +145,1016 @@
testfileloc<<\EOF
DWARF section [33] '.debug_loc' at offset 0xd2a:
- [ 0] 000000000000000000..0x000000000000000d [ 0] reg5
- [ 23] 0x0000000000000005..0x000000000000000d [ 0] reg5
- [ 46] 0x0000000000000012..0x000000000000001a [ 0] breg5 0
+
+ CU [ b] base: 0x0000000000400480
+ [ 0] range 0, d
+ [ 0] reg5
+ [ 23] range 5, d
+ [ 0] reg5
+
+ CU [ e0] base: 0x00000000004004a0
+ [ 46] range 12, 1a
+ [ 0] breg5 0
DWARF section [34] '.debug_ranges' at offset 0xd94:
- [ 0] 000000000000000000..0x0000000000000002
- 0x0000000000000005..0x000000000000000d
- [ 30] 0x000000000000000d..0x000000000000000f
- 0x0000000000000012..0x000000000000001a
+
+ CU [ b] base: 0x0000000000400480
+ [ 0] range 0, 2
+ range 5, d
+
+ CU [ e0] base: 0x00000000004004a0
+ [ 30] range d, f
+ range 12, 1a
+EOF
+
+# .debug_rnglists (DWARF5), see tests/testfile-dwarf-45.source
+testfiles testfile-dwarf-5
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=loc testfile-dwarf-5<<\EOF
+
+DWARF section [31] '.debug_loclists' at offset 0x1c0c:
+Table at Offset 0x0:
+
+ Length: 96
+ DWARF version: 5
+ Address size: 8
+ Segment size: 0
+ Offset entries: 0
+ CU [ c] base: 0x0000000000400510 <foo>
+
+ Offset: c, Index: 0
+ offset_pair 0, a
+ 0x0000000000400510 <foo>..
+ 0x0000000000400519 <foo+0x9>
+ [ 0] reg5
+ offset_pair a, 34
+ 0x000000000040051a <foo+0xa>..
+ 0x0000000000400543 <foo+0x33>
+ [ 0] entry_value:
+ [ 0] reg5
+ [ 3] stack_value
+ end_of_list
+
+ Offset: 1a, Index: e
+ offset_pair 1b, 2d
+ 0x000000000040052b <foo+0x1b>..
+ 0x000000000040053c <foo+0x2c>
+ [ 0] addr 0x601038 <m>
+ end_of_list
+
+ Offset: 28, Index: 1c
+ offset_pair 1b, 21
+ 0x000000000040052b <foo+0x1b>..
+ 0x0000000000400530 <foo+0x20>
+ [ 0] reg5
+ end_of_list
+
+ Offset: 2e, Index: 22
+ offset_pair 1b, 27
+ 0x000000000040052b <foo+0x1b>..
+ 0x0000000000400536 <foo+0x26>
+ [ 0] reg5
+ offset_pair 29, 2d
+ 0x0000000000400539 <foo+0x29>..
+ 0x000000000040053c <foo+0x2c>
+ [ 0] reg5
+ end_of_list
+
+ Offset: 39, Index: 2d
+ offset_pair 21, 27
+ 0x0000000000400531 <foo+0x21>..
+ 0x0000000000400536 <foo+0x26>
+ [ 0] reg5
+ offset_pair 29, 2d
+ 0x0000000000400539 <foo+0x29>..
+ 0x000000000040053c <foo+0x2c>
+ [ 0] reg5
+ end_of_list
+
+ Offset: 44, Index: 38
+ offset_pair 21, 2d
+ 0x0000000000400531 <foo+0x21>..
+ 0x000000000040053c <foo+0x2c>
+ [ 0] reg5
+ end_of_list
+
+ Offset: 4a, Index: 3e
+ offset_pair 2d, 33
+ 0x000000000040053d <foo+0x2d>..
+ 0x0000000000400542 <foo+0x32>
+ [ 0] reg5
+ end_of_list
+
+ Offset: 50, Index: 44
+ offset_pair 40, 4f
+ 0x0000000000400550 <baz>..
+ 0x000000000040055e <baz+0xe>
+ [ 0] reg5
+ offset_pair 4f, 51
+ 0x000000000040055f <baz+0xf>..
+ 0x0000000000400560 <baz+0x10>
+ [ 0] entry_value:
+ [ 0] reg5
+ [ 3] stack_value
+ end_of_list
+
+ Offset: 5e, Index: 52
+ offset_pair 40, 50
+ 0x0000000000400550 <baz>..
+ 0x000000000040055f <baz+0xf>
+ [ 0] reg5
+ end_of_list
+
+Table at Offset 0x64:
+
+ Length: 159
+ DWARF version: 5
+ Address size: 8
+ Segment size: 0
+ Offset entries: 0
+ CU [ 218] base: 000000000000000000
+
+ Offset: 70, Index: 0
+ base_address 0x400410
+ 0x0000000000400410 <main>
+ offset_pair 0, 14
+ 0x0000000000400410 <main>..
+ 0x0000000000400423 <main+0x13>
+ [ 0] reg5
+ offset_pair 14, 20
+ 0x0000000000400424 <main+0x14>..
+ 0x000000000040042f <main+0x1f>
+ [ 0] entry_value:
+ [ 0] reg5
+ [ 3] stack_value
+ end_of_list
+
+ Offset: 87, Index: 17
+ base_address 0x400410
+ 0x0000000000400410 <main>
+ offset_pair 0, 18
+ 0x0000000000400410 <main>..
+ 0x0000000000400427 <main+0x17>
+ [ 0] reg4
+ offset_pair 18, 20
+ 0x0000000000400428 <main+0x18>..
+ 0x000000000040042f <main+0x1f>
+ [ 0] entry_value:
+ [ 0] reg4
+ [ 3] stack_value
+ end_of_list
+
+ Offset: 9e, Index: 2e
+ start_length 0x400421, 7
+ 0x0000000000400421 <main+0x11>..
+ 0x0000000000400427 <main+0x17>
+ [ 0] reg0
+ end_of_list
+
+ Offset: ab, Index: 3b
+ base_address 0x400570
+ 0x0000000000400570 <calc>
+ offset_pair 0, 8
+ 0x0000000000400570 <calc>..
+ 0x0000000000400577 <calc+0x7>
+ [ 0] reg5
+ offset_pair 8, 2b
+ 0x0000000000400578 <calc+0x8>..
+ 0x000000000040059a <calc+0x2a>
+ [ 0] entry_value:
+ [ 0] reg5
+ [ 3] stack_value
+ end_of_list
+
+ Offset: c2, Index: 52
+ start_length 0x400588, b
+ 0x0000000000400588 <calc+0x18>..
+ 0x0000000000400592 <calc+0x22>
+ [ 0] reg0
+ end_of_list
+
+ Offset: cf, Index: 5f
+ base_address 0x400588
+ 0x0000000000400588 <calc+0x18>
+ offset_pair 0, 2
+ 0x0000000000400588 <calc+0x18>..
+ 0x0000000000400589 <calc+0x19>
+ [ 0] reg1
+ offset_pair 2, 7
+ 0x000000000040058a <calc+0x1a>..
+ 0x000000000040058e <calc+0x1e>
+ [ 0] reg5
+ offset_pair 7, b
+ 0x000000000040058f <calc+0x1f>..
+ 0x0000000000400592 <calc+0x22>
+ [ 0] entry_value:
+ [ 0] reg5
+ [ 3] deref_size 1
+ [ 5] const1u 56
+ [ 7] shl
+ [ 8] const1u 56
+ [10] shra
+ [11] stack_value
+ end_of_list
+
+ Offset: f3, Index: 83
+ base_address 0x400588
+ 0x0000000000400588 <calc+0x18>
+ offset_pair 0, 2
+ 0x0000000000400588 <calc+0x18>..
+ 0x0000000000400589 <calc+0x19>
+ [ 0] reg1
+ offset_pair 2, b
+ 0x000000000040058a <calc+0x1a>..
+ 0x0000000000400592 <calc+0x22>
+ [ 0] reg5
+ end_of_list
+
+EOF
+
+# Same as above, but for DWARF4, note completely different encoding, but
+# the information is the same (check with diff -uwb).
+testfiles testfile-dwarf-4
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=loc testfile-dwarf-4<<\EOF
+
+DWARF section [31] '.debug_loc' at offset 0x1c86:
+
+ CU [ b] base: 0x0000000000400510 <foo>
+ [ 0] range 0, a
+ 0x0000000000400510 <foo>..
+ 0x0000000000400519 <foo+0x9>
+ [ 0] reg5
+ range a, 34
+ 0x000000000040051a <foo+0xa>..
+ 0x0000000000400543 <foo+0x33>
+ [ 0] GNU_entry_value:
+ [ 0] reg5
+ [ 3] stack_value
+ [ 39] range 1b, 2d
+ 0x000000000040052b <foo+0x1b>..
+ 0x000000000040053c <foo+0x2c>
+ [ 0] addr 0x601038 <m>
+ [ 64] range 1b, 21
+ 0x000000000040052b <foo+0x1b>..
+ 0x0000000000400530 <foo+0x20>
+ [ 0] reg5
+ [ 87] range 1b, 27
+ 0x000000000040052b <foo+0x1b>..
+ 0x0000000000400536 <foo+0x26>
+ [ 0] reg5
+ range 29, 2d
+ 0x0000000000400539 <foo+0x29>..
+ 0x000000000040053c <foo+0x2c>
+ [ 0] reg5
+ [ bd] range 21, 27
+ 0x0000000000400531 <foo+0x21>..
+ 0x0000000000400536 <foo+0x26>
+ [ 0] reg5
+ range 29, 2d
+ 0x0000000000400539 <foo+0x29>..
+ 0x000000000040053c <foo+0x2c>
+ [ 0] reg5
+ [ f3] range 21, 2d
+ 0x0000000000400531 <foo+0x21>..
+ 0x000000000040053c <foo+0x2c>
+ [ 0] reg5
+ [ 116] range 2d, 33
+ 0x000000000040053d <foo+0x2d>..
+ 0x0000000000400542 <foo+0x32>
+ [ 0] reg5
+ [ 139] range 40, 4f
+ 0x0000000000400550 <baz>..
+ 0x000000000040055e <baz+0xe>
+ [ 0] reg5
+ range 4f, 51
+ 0x000000000040055f <baz+0xf>..
+ 0x0000000000400560 <baz+0x10>
+ [ 0] GNU_entry_value:
+ [ 0] reg5
+ [ 3] stack_value
+ [ 172] range 40, 50
+ 0x0000000000400550 <baz>..
+ 0x000000000040055f <baz+0xf>
+ [ 0] reg5
+
+ CU [ 21c] base: 000000000000000000
+ [ 195] range 400410, 400424
+ 0x0000000000400410 <main>..
+ 0x0000000000400423 <main+0x13>
+ [ 0] reg5
+ range 400424, 400430
+ 0x0000000000400424 <main+0x14>..
+ 0x000000000040042f <main+0x1f>
+ [ 0] GNU_entry_value:
+ [ 0] reg5
+ [ 3] stack_value
+ [ 1ce] range 400410, 400428
+ 0x0000000000400410 <main>..
+ 0x0000000000400427 <main+0x17>
+ [ 0] reg4
+ range 400428, 400430
+ 0x0000000000400428 <main+0x18>..
+ 0x000000000040042f <main+0x1f>
+ [ 0] GNU_entry_value:
+ [ 0] reg4
+ [ 3] stack_value
+ [ 207] range 400421, 400428
+ 0x0000000000400421 <main+0x11>..
+ 0x0000000000400427 <main+0x17>
+ [ 0] reg0
+ [ 22a] range 400570, 400578
+ 0x0000000000400570 <calc>..
+ 0x0000000000400577 <calc+0x7>
+ [ 0] reg5
+ range 400578, 40059b
+ 0x0000000000400578 <calc+0x8>..
+ 0x000000000040059a <calc+0x2a>
+ [ 0] GNU_entry_value:
+ [ 0] reg5
+ [ 3] stack_value
+ [ 263] range 400588, 400593
+ 0x0000000000400588 <calc+0x18>..
+ 0x0000000000400592 <calc+0x22>
+ [ 0] reg0
+ [ 286] range 400588, 40058a
+ 0x0000000000400588 <calc+0x18>..
+ 0x0000000000400589 <calc+0x19>
+ [ 0] reg1
+ range 40058a, 40058f
+ 0x000000000040058a <calc+0x1a>..
+ 0x000000000040058e <calc+0x1e>
+ [ 0] reg5
+ range 40058f, 400593
+ 0x000000000040058f <calc+0x1f>..
+ 0x0000000000400592 <calc+0x22>
+ [ 0] GNU_entry_value:
+ [ 0] reg5
+ [ 3] deref_size 1
+ [ 5] const1u 56
+ [ 7] shl
+ [ 8] const1u 56
+ [10] shra
+ [11] stack_value
+ [ 2da] range 400588, 40058a
+ 0x0000000000400588 <calc+0x18>..
+ 0x0000000000400589 <calc+0x19>
+ [ 0] reg1
+ range 40058a, 400593
+ 0x000000000040058a <calc+0x1a>..
+ 0x0000000000400592 <calc+0x22>
+ [ 0] reg5
+EOF
+
+# Split DWARF5 variant. Note that the .debug_loclists moved to the .dwo file
+# and now uses an index and addrx indirections.
+testfiles testfile-splitdwarf-5 testfile-hello5.dwo testfile-world5.dwo
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=loc --dwarf-skeleton=testfile-splitdwarf-5 testfile-hello5.dwo testfile-world5.dwo <<\EOF
+
+testfile-hello5.dwo:
+
+
+DWARF section [ 3] '.debug_loclists.dwo' at offset 0x236:
+Table at Offset 0x0:
+
+ Length: 125
+ DWARF version: 5
+ Address size: 8
+ Segment size: 0
+ Offset entries: 9
+ CU [ 14] base: 0x0000000000401160 <foo>
+
+ Offsets starting at 0xc:
+ [ 0] 0x24
+ [ 1] 0x32
+ [ 2] 0x39
+ [ 3] 0x3f
+ [ 4] 0x4a
+ [ 5] 0x55
+ [ 6] 0x5b
+ [ 7] 0x61
+ [ 8] 0x6f
+
+ Offset: 30, Index: 24
+ startx_length f, a
+ 0x0000000000401160 <foo>..
+ 0x0000000000401169 <foo+0x9>
+ [ 0] reg5
+ startx_length 0, 2a
+ 0x000000000040116a <foo+0xa>..
+ 0x0000000000401193 <foo+0x33>
+ [ 0] entry_value:
+ [ 0] reg5
+ [ 3] stack_value
+ end_of_list
+
+ Offset: 3e, Index: 32
+ startx_length 11, 12
+ 0x000000000040117b <foo+0x1b>..
+ 0x000000000040118c <foo+0x2c>
+ [ 0] addrx [18] 0x404038 <m>
+ end_of_list
+
+ Offset: 45, Index: 39
+ startx_length 11, 6
+ 0x000000000040117b <foo+0x1b>..
+ 0x0000000000401180 <foo+0x20>
+ [ 0] reg5
+ end_of_list
+
+ Offset: 4b, Index: 3f
+ startx_length 11, c
+ 0x000000000040117b <foo+0x1b>..
+ 0x0000000000401186 <foo+0x26>
+ [ 0] reg5
+ startx_length 1, 4
+ 0x0000000000401189 <foo+0x29>..
+ 0x000000000040118c <foo+0x2c>
+ [ 0] reg5
+ end_of_list
+
+ Offset: 56, Index: 4a
+ startx_length 4, 6
+ 0x0000000000401181 <foo+0x21>..
+ 0x0000000000401186 <foo+0x26>
+ [ 0] reg5
+ startx_length 1, 4
+ 0x0000000000401189 <foo+0x29>..
+ 0x000000000040118c <foo+0x2c>
+ [ 0] reg5
+ end_of_list
+
+ Offset: 61, Index: 55
+ startx_length 4, c
+ 0x0000000000401181 <foo+0x21>..
+ 0x000000000040118c <foo+0x2c>
+ [ 0] reg5
+ end_of_list
+
+ Offset: 67, Index: 5b
+ startx_length 2, 6
+ 0x000000000040118d <foo+0x2d>..
+ 0x0000000000401192 <foo+0x32>
+ [ 0] reg5
+ end_of_list
+
+ Offset: 6d, Index: 61
+ startx_length 9, f
+ 0x00000000004011a0 <baz>..
+ 0x00000000004011ae <baz+0xe>
+ [ 0] reg5
+ startx_length 5, 2
+ 0x00000000004011af <baz+0xf>..
+ 0x00000000004011b0 <baz+0x10>
+ [ 0] entry_value:
+ [ 0] reg5
+ [ 3] stack_value
+ end_of_list
+
+ Offset: 7b, Index: 6f
+ startx_length 9, 10
+ 0x00000000004011a0 <baz>..
+ 0x00000000004011af <baz+0xf>
+ [ 0] reg5
+ end_of_list
+
+
+testfile-world5.dwo:
+
+
+DWARF section [ 3] '.debug_loclists.dwo' at offset 0x217:
+Table at Offset 0x0:
+
+ Length: 128
+ DWARF version: 5
+ Address size: 8
+ Segment size: 0
+ Offset entries: 7
+ CU [ 14] base: 000000000000000000
+
+ Offsets starting at 0xc:
+ [ 0] 0x1c
+ [ 1] 0x2a
+ [ 2] 0x38
+ [ 3] 0x3e
+ [ 4] 0x4c
+ [ 5] 0x52
+ [ 6] 0x6d
+
+ Offset: 28, Index: 1c
+ startx_length 2, 14
+ 0x0000000000401060 <main>..
+ 0x0000000000401073 <main+0x13>
+ [ 0] reg5
+ startx_length 4, c
+ 0x0000000000401074 <main+0x14>..
+ 0x000000000040107f <main+0x1f>
+ [ 0] entry_value:
+ [ 0] reg5
+ [ 3] stack_value
+ end_of_list
+
+ Offset: 36, Index: 2a
+ startx_length 2, 18
+ 0x0000000000401060 <main>..
+ 0x0000000000401077 <main+0x17>
+ [ 0] reg4
+ startx_length 7, 6
+ 0x0000000000401078 <main+0x18>..
+ 0x000000000040107d <main+0x1d>
+ [ 0] entry_value:
+ [ 0] reg4
+ [ 3] stack_value
+ end_of_list
+
+ Offset: 44, Index: 38
+ startx_length 3, 7
+ 0x0000000000401071 <main+0x11>..
+ 0x0000000000401077 <main+0x17>
+ [ 0] reg0
+ end_of_list
+
+ Offset: 4a, Index: 3e
+ startx_length d, 8
+ 0x00000000004011c0 <calc>..
+ 0x00000000004011c7 <calc+0x7>
+ [ 0] reg5
+ startx_length e, 23
+ 0x00000000004011c8 <calc+0x8>..
+ 0x00000000004011ea <calc+0x2a>
+ [ 0] entry_value:
+ [ 0] reg5
+ [ 3] stack_value
+ end_of_list
+
+ Offset: 58, Index: 4c
+ startx_length f, b
+ 0x00000000004011d8 <calc+0x18>..
+ 0x00000000004011e2 <calc+0x22>
+ [ 0] reg0
+ end_of_list
+
+ Offset: 5e, Index: 52
+ startx_length f, 2
+ 0x00000000004011d8 <calc+0x18>..
+ 0x00000000004011d9 <calc+0x19>
+ [ 0] reg1
+ startx_length 10, 5
+ 0x00000000004011da <calc+0x1a>..
+ 0x00000000004011de <calc+0x1e>
+ [ 0] reg5
+ startx_length 0, 4
+ 0x00000000004011df <calc+0x1f>..
+ 0x00000000004011e2 <calc+0x22>
+ [ 0] entry_value:
+ [ 0] reg5
+ [ 3] deref_size 1
+ [ 5] const1u 56
+ [ 7] shl
+ [ 8] const1u 56
+ [10] shra
+ [11] stack_value
+ end_of_list
+
+ Offset: 79, Index: 6d
+ startx_length f, 2
+ 0x00000000004011d8 <calc+0x18>..
+ 0x00000000004011d9 <calc+0x19>
+ [ 0] reg1
+ startx_length 10, 9
+ 0x00000000004011da <calc+0x1a>..
+ 0x00000000004011e2 <calc+0x22>
+ [ 0] reg5
+ end_of_list
+
+EOF
+
+# GNU DebugFission split-dwarf variant. Still uses .debug_loc, but now in
+# .dwo file, with somewhat similar, but different encoding from DWARF5.
+testfiles testfile-splitdwarf-4 testfile-hello4.dwo testfile-world4.dwo
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=loc --dwarf-skeleton=testfile-splitdwarf-4 testfile-hello4.dwo testfile-world4.dwo <<\EOF
+
+testfile-hello4.dwo:
+
+
+DWARF section [ 3] '.debug_loc.dwo' at offset 0x253:
+
+ CU [ b] base: 0x0000000000401160 <foo>
+ [ 0] range 401160, 40116a
+ 0x0000000000401160 <foo>..
+ 0x0000000000401169 <foo+0x9>
+ [ 0] reg5
+ range 40116a, 401194
+ 0x000000000040116a <foo+0xa>..
+ 0x0000000000401193 <foo+0x33>
+ [ 0] GNU_entry_value:
+ [ 0] reg5
+ [ 3] stack_value
+ [ 16] range 40117b, 40118d
+ 0x000000000040117b <foo+0x1b>..
+ 0x000000000040118c <foo+0x2c>
+ [ 0] GNU_addr_index [18] 0x404038 <m>
+ [ 21] range 40117b, 401181
+ 0x000000000040117b <foo+0x1b>..
+ 0x0000000000401180 <foo+0x20>
+ [ 0] reg5
+ [ 2b] range 40117b, 401187
+ 0x000000000040117b <foo+0x1b>..
+ 0x0000000000401186 <foo+0x26>
+ [ 0] reg5
+ range 401189, 40118d
+ 0x0000000000401189 <foo+0x29>..
+ 0x000000000040118c <foo+0x2c>
+ [ 0] reg5
+ [ 3e] range 401181, 401187
+ 0x0000000000401181 <foo+0x21>..
+ 0x0000000000401186 <foo+0x26>
+ [ 0] reg5
+ range 401189, 40118d
+ 0x0000000000401189 <foo+0x29>..
+ 0x000000000040118c <foo+0x2c>
+ [ 0] reg5
+ [ 51] range 401181, 40118d
+ 0x0000000000401181 <foo+0x21>..
+ 0x000000000040118c <foo+0x2c>
+ [ 0] reg5
+ [ 5b] range 40118d, 401193
+ 0x000000000040118d <foo+0x2d>..
+ 0x0000000000401192 <foo+0x32>
+ [ 0] reg5
+ [ 65] range 4011a0, 4011af
+ 0x00000000004011a0 <baz>..
+ 0x00000000004011ae <baz+0xe>
+ [ 0] reg5
+ range 4011af, 4011b1
+ 0x00000000004011af <baz+0xf>..
+ 0x00000000004011b0 <baz+0x10>
+ [ 0] GNU_entry_value:
+ [ 0] reg5
+ [ 3] stack_value
+ [ 7b] range 4011a0, 4011b0
+ 0x00000000004011a0 <baz>..
+ 0x00000000004011af <baz+0xf>
+ [ 0] reg5
+
+testfile-world4.dwo:
+
+
+DWARF section [ 3] '.debug_loc.dwo' at offset 0x225:
+
+ CU [ b] base: 000000000000000000
+ [ 0] range 401060, 401074
+ 0x0000000000401060 <main>..
+ 0x0000000000401073 <main+0x13>
+ [ 0] reg5
+ range 401074, 401080
+ 0x0000000000401074 <main+0x14>..
+ 0x000000000040107f <main+0x1f>
+ [ 0] GNU_entry_value:
+ [ 0] reg5
+ [ 3] stack_value
+ [ 16] range 401060, 401078
+ 0x0000000000401060 <main>..
+ 0x0000000000401077 <main+0x17>
+ [ 0] reg4
+ range 401078, 40107e
+ 0x0000000000401078 <main+0x18>..
+ 0x000000000040107d <main+0x1d>
+ [ 0] GNU_entry_value:
+ [ 0] reg4
+ [ 3] stack_value
+ [ 2c] range 401071, 401078
+ 0x0000000000401071 <main+0x11>..
+ 0x0000000000401077 <main+0x17>
+ [ 0] reg0
+ [ 36] range 4011c0, 4011c8
+ 0x00000000004011c0 <calc>..
+ 0x00000000004011c7 <calc+0x7>
+ [ 0] reg5
+ range 4011c8, 4011eb
+ 0x00000000004011c8 <calc+0x8>..
+ 0x00000000004011ea <calc+0x2a>
+ [ 0] GNU_entry_value:
+ [ 0] reg5
+ [ 3] stack_value
+ [ 4c] range 4011d8, 4011e3
+ 0x00000000004011d8 <calc+0x18>..
+ 0x00000000004011e2 <calc+0x22>
+ [ 0] reg0
+ [ 56] range 4011d8, 4011da
+ 0x00000000004011d8 <calc+0x18>..
+ 0x00000000004011d9 <calc+0x19>
+ [ 0] reg1
+ range 4011da, 4011df
+ 0x00000000004011da <calc+0x1a>..
+ 0x00000000004011de <calc+0x1e>
+ [ 0] reg5
+ range 4011df, 4011e3
+ 0x00000000004011df <calc+0x1f>..
+ 0x00000000004011e2 <calc+0x22>
+ [ 0] GNU_entry_value:
+ [ 0] reg5
+ [ 3] deref_size 1
+ [ 5] const1u 56
+ [ 7] shl
+ [ 8] const1u 56
+ [10] shra
+ [11] stack_value
+ [ 7d] range 4011d8, 4011da
+ 0x00000000004011d8 <calc+0x18>..
+ 0x00000000004011d9 <calc+0x19>
+ [ 0] reg1
+ range 4011da, 4011e3
+ 0x00000000004011da <calc+0x1a>..
+ 0x00000000004011e2 <calc+0x22>
+ [ 0] reg5
+EOF
+
+# Partial dwarf-4 and partial GNU DebugFission split-dwarf.
+#
+# = popcount.c =
+#
+# int popcount (unsigned char u)
+# {
+# int c = 0;
+# while (u != 0)
+# {
+# if ((u & 1) == 1)
+# c++;
+# u >>= 1;
+# }
+# return c;
+# }
+#
+# = splitdwarf4-not-split4.c =
+#
+# extern int popcount (unsigned char);
+#
+# int main (int argc, char **argv)
+# {
+# int i;
+# int p = argc;
+# for (i = 0; i < argc; ++i)
+# p += popcount (argv[i][0]);
+# i += p;
+# return i;
+# }
+#
+# gcc -gdwarf-4 -O2 -c popcount.c
+# gcc -gdwarf-4 -gsplit-dwarf -O2 -c splitdwarf4-not-split4.c
+# gcc -o testfile-splitdwarf4-not-split4 splitdwarf4-not-split4.o popcount.o
+# eu-strip -f testfile-splitdwarf4-not-split4.debug \
+# testfile-splitdwarf4-not-split4
+
+testfiles testfile-splitdwarf4-not-split4.debug
+testfiles splitdwarf4-not-split4.dwo
+
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=info+ --debug-dump=loc testfile-splitdwarf4-not-split4.debug <<\EOF
+
+DWARF section [28] '.debug_info' at offset 0x330:
+ [Offset]
+ Compilation unit at offset 0:
+ Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4
+ Unit type: skeleton (4), Unit id: 0x3d909d7bd0e69c0b
+ [ b] compile_unit abbrev: 1
+ ranges (sec_offset) range list [ 0]
+ low_pc (addr) 000000000000000000
+ stmt_list (sec_offset) 0
+ GNU_dwo_name (strp) "splitdwarf4-not-split4.dwo"
+ comp_dir (strp) "/tmp"
+ GNU_pubnames (flag_present) yes
+ GNU_addr_base (sec_offset) address base [ 0]
+ GNU_dwo_id (data8) 0x3d909d7bd0e69c0b
+ GNU_ranges_base (sec_offset) 0
+ Split compilation unit at offset 0:
+ Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4
+ Unit type: skeleton (4), Unit id: 0x3d909d7bd0e69c0b
+ { b} compile_unit abbrev: 1
+ producer (GNU_str_index) "GNU C17 9.0.0 20180528 (experimental) -mtune=generic -march=x86-64 -gdwarf-4 -gsplit-dwarf -O2"
+ language (data1) C99 (12)
+ name (GNU_str_index) "splitdwarf4-not-split4.c"
+ comp_dir (GNU_str_index) "/tmp"
+ GNU_dwo_id (data8) 0x3d909d7bd0e69c0b
+ { 18} subprogram abbrev: 2
+ external (flag_present) yes
+ name (GNU_str_index) "main"
+ decl_file (data1) splitdwarf4-not-split4.c (1)
+ decl_line (data1) 3
+ decl_column (data1) 5
+ prototyped (flag_present) yes
+ type (ref4) { 6d}
+ low_pc (GNU_addr_index) [4] 0x0000000000401050 <main>
+ high_pc (data8) 76 (0x000000000040109c <_start>)
+ frame_base (exprloc)
+ [ 0] call_frame_cfa
+ GNU_all_call_sites (flag_present) yes
+ sibling (ref4) { 6d}
+ { 30} formal_parameter abbrev: 3
+ name (GNU_str_index) "argc"
+ decl_file (data1) splitdwarf4-not-split4.c (1)
+ decl_line (data1) 3
+ decl_column (data1) 15
+ type (ref4) { 6d}
+ location (sec_offset) location list [ 0]
+ { 3d} formal_parameter abbrev: 3
+ name (GNU_str_index) "argv"
+ decl_file (data1) splitdwarf4-not-split4.c (1)
+ decl_line (data1) 3
+ decl_column (data1) 28
+ type (ref4) { 74}
+ location (sec_offset) location list [ 28]
+ { 4a} variable abbrev: 4
+ name (string) "i"
+ decl_file (data1) splitdwarf4-not-split4.c (1)
+ decl_line (data1) 5
+ decl_column (data1) 7
+ type (ref4) { 6d}
+ location (sec_offset) location list [ 47]
+ { 58} variable abbrev: 4
+ name (string) "p"
+ decl_file (data1) splitdwarf4-not-split4.c (1)
+ decl_line (data1) 6
+ decl_column (data1) 7
+ type (ref4) { 6d}
+ location (sec_offset) location list [ 73]
+ { 66} GNU_call_site abbrev: 5
+ low_pc (GNU_addr_index) [1] 0x000000000040107f <main+0x2f>
+ abstract_origin (ref4) { 84}
+ { 6d} base_type abbrev: 6
+ byte_size (data1) 4
+ encoding (data1) signed (5)
+ name (string) "int"
+ { 74} pointer_type abbrev: 7
+ byte_size (data1) 8
+ type (ref4) { 7a}
+ { 7a} pointer_type abbrev: 7
+ byte_size (data1) 8
+ type (ref4) { 80}
+ { 80} base_type abbrev: 8
+ byte_size (data1) 1
+ encoding (data1) signed_char (6)
+ name (GNU_str_index) "char"
+ { 84} subprogram abbrev: 9
+ external (flag_present) yes
+ declaration (flag_present) yes
+ linkage_name (GNU_str_index) "popcount"
+ name (GNU_str_index) "popcount"
+ decl_file (data1) splitdwarf4-not-split4.c (1)
+ decl_line (data1) 1
+ decl_column (data1) 12
+ Compilation unit at offset 52:
+ Version: 4, Abbreviation section offset: 29, Address size: 8, Offset size: 4
+ [ 3f] compile_unit abbrev: 1
+ producer (strp) "GNU C17 9.0.0 20180528 (experimental) -mtune=generic -march=x86-64 -gdwarf-4 -O2"
+ language (data1) C99 (12)
+ name (strp) "popcount.c"
+ comp_dir (strp) "/tmp"
+ low_pc (addr) 0x0000000000401180 <popcount>
+ high_pc (data8) 33 (0x00000000004011a1)
+ stmt_list (sec_offset) 145
+ [ 61] subprogram abbrev: 2
+ external (flag_present) yes
+ name (strp) "popcount"
+ decl_file (data1) popcount.c (1)
+ decl_line (data1) 1
+ decl_column (data1) 5
+ prototyped (flag_present) yes
+ type (ref4) [ a0]
+ low_pc (addr) 0x0000000000401180 <popcount>
+ high_pc (data8) 33 (0x00000000004011a1)
+ frame_base (exprloc)
+ [ 0] call_frame_cfa
+ GNU_all_call_sites (flag_present) yes
+ sibling (ref4) [ a0]
+ [ 83] formal_parameter abbrev: 3
+ name (string) "u"
+ decl_file (data1) popcount.c (1)
+ decl_line (data1) 1
+ decl_column (data1) 29
+ type (ref4) [ a7]
+ location (sec_offset) location list [ 0]
+ [ 91] variable abbrev: 4
+ name (string) "c"
+ decl_file (data1) popcount.c (1)
+ decl_line (data1) 3
+ decl_column (data1) 7
+ type (ref4) [ a0]
+ location (sec_offset) location list [ 60]
+ [ a0] base_type abbrev: 5
+ byte_size (data1) 4
+ encoding (data1) signed (5)
+ name (string) "int"
+ [ a7] base_type abbrev: 6
+ byte_size (data1) 1
+ encoding (data1) unsigned_char (8)
+ name (strp) "unsigned char"
+
+DWARF section [32] '.debug_loc' at offset 0x5ef:
+
+ CU [ 3f] base: 0x0000000000401180 <popcount>
+ [ 0] range 0, 9
+ 0x0000000000401180 <popcount>..
+ 0x0000000000401188 <popcount+0x8>
+ [ 0] reg5
+ range 9, 1b
+ 0x0000000000401189 <popcount+0x9>..
+ 0x000000000040119a <popcount+0x1a>
+ [ 0] reg1
+ range 1b, 1d
+ 0x000000000040119b <popcount+0x1b>..
+ 0x000000000040119c <popcount+0x1c>
+ [ 0] breg1 0
+ [ 2] lit1
+ [ 3] shr
+ [ 4] stack_value
+ range 1d, 21
+ 0x000000000040119d <popcount+0x1d>..
+ 0x00000000004011a0 <popcount+0x20>
+ [ 0] reg1
+ [ 60] range 0, 9
+ 0x0000000000401180 <popcount>..
+ 0x0000000000401188 <popcount+0x8>
+ [ 0] lit0
+ [ 1] stack_value
+ range 9, 20
+ 0x0000000000401189 <popcount+0x9>..
+ 0x000000000040119f <popcount+0x1f>
+ [ 0] reg0
+ range 20, 21
+ 0x00000000004011a0 <popcount+0x20>..
+ 0x00000000004011a0 <popcount+0x20>
+ [ 0] lit0
+ [ 1] stack_value
+EOF
+
+testrun_compare ${abs_top_builddir}/src/readelf --dwarf-skeleton=testfile-splitdwarf4-not-split4.debug --debug-dump=loc splitdwarf4-not-split4.dwo <<\EOF
+
+DWARF section [ 3] '.debug_loc.dwo' at offset 0x15b:
+
+ CU [ b] base: 000000000000000000
+ [ 0] range 401050, 40106e
+ 0x0000000000401050 <main>..
+ 0x000000000040106d <main+0x1d>
+ [ 0] reg5
+ range 40106e, 401086
+ 0x000000000040106e <main+0x1e>..
+ 0x0000000000401085 <main+0x35>
+ [ 0] reg12
+ range 401086, 401095
+ 0x0000000000401086 <main+0x36>..
+ 0x0000000000401094 <main+0x44>
+ [ 0] GNU_entry_value:
+ [ 0] reg5
+ [ 3] stack_value
+ range 401095, 40109c
+ 0x0000000000401095 <main+0x45>..
+ 0x000000000040109b <main+0x4b>
+ [ 0] reg5
+ [ 28] range 401050, 40106e
+ 0x0000000000401050 <main>..
+ 0x000000000040106d <main+0x1d>
+ [ 0] reg4
+ range 40106e, 401095
+ 0x000000000040106e <main+0x1e>..
+ 0x0000000000401094 <main+0x44>
+ [ 0] GNU_entry_value:
+ [ 0] reg4
+ [ 3] stack_value
+ range 401095, 40109c
+ 0x0000000000401095 <main+0x45>..
+ 0x000000000040109b <main+0x4b>
+ [ 0] reg4
+ [ 47] range 401050, 40106e
+ 0x0000000000401050 <main>..
+ 0x000000000040106d <main+0x1d>
+ [ 0] lit0
+ [ 1] stack_value
+ range 401086, 40108e
+ 0x0000000000401086 <main+0x36>..
+ 0x000000000040108d <main+0x3d>
+ [ 0] breg12 0
+ [ 2] breg6 0
+ [ 4] plus
+ [ 5] stack_value
+ range 40108e, 401095
+ 0x000000000040108e <main+0x3e>..
+ 0x0000000000401094 <main+0x44>
+ [ 0] reg0
+ range 401095, 40109c
+ 0x0000000000401095 <main+0x45>..
+ 0x000000000040109b <main+0x4b>
+ [ 0] lit0
+ [ 1] stack_value
+ [ 73] range 401050, 40106e
+ 0x0000000000401050 <main>..
+ 0x000000000040106d <main+0x1d>
+ [ 0] reg5
+ range 40106e, 401090
+ 0x000000000040106e <main+0x1e>..
+ 0x000000000040108f <main+0x3f>
+ [ 0] reg6
+ range 401095, 40109c
+ 0x0000000000401095 <main+0x45>..
+ 0x000000000040109b <main+0x4b>
+ [ 0] reg5
EOF
exit 0
diff --git a/tests/run-readelf-mixed-corenote.sh b/tests/run-readelf-mixed-corenote.sh
index 69d0c02..86171c4 100755
--- a/tests/run-readelf-mixed-corenote.sh
+++ b/tests/run-readelf-mixed-corenote.sh
@@ -582,4 +582,68 @@
LINUX 832 X86_XSTATE
EOF
+# To reproduce this core dump, do this on an m68k machine:
+# $ gcc -x c <(echo 'int main () { return *(int *)0x12345678; }')
+# $ ./a.out
+testfiles testfile-m68k-core
+testrun_compare ${abs_top_builddir}/src/readelf -n testfile-m68k-core <<\EOF
+
+Note segment of 1056 bytes at offset 0x1f4:
+ Owner Data size Type
+ CORE 154 PRSTATUS
+ info.si_signo: 11, info.si_code: 0, info.si_errno: 0, cursig: 11
+ sigpend: <>
+ sighold: <>
+ pid: 1963, ppid: 1084, pgrp: 1963, sid: 1084
+ utime: 0.000000, stime: 0.010000, cutime: 0.000000, cstime: 0.000000
+ fpvalid: 1
+ d1: 1 d2: 0 d3: -2146476616 d4: -2146476616
+ d5: 0 d6: -2147393212 d7: -2144827216 a0: 0x12345678
+ a1: 0xefe71460 a2: 0x00000000 a3: 0x80288df8 a4: 0x80000340
+ a5: 0xc017a000 a6: 0xefe71434 d0: -1073595312 a7: 0xefe71434
+ pc: 0x800003fe
+ CORE 124 PRPSINFO
+ state: 0, sname: R, zomb: 0, nice: 0, flag: 0x00400600
+ uid: 1000, gid: 501, pid: 1963, ppid: 1084, pgrp: 1963, sid: 1084
+ fname: a.out, psargs: ./a.out
+ CORE 128 SIGINFO
+ si_signo: 11, si_errno: 0, si_code: 1
+ fault address: 0x12345678
+ CORE 136 AUXV
+ HWCAP: 0
+ PAGESZ: 4096
+ CLKTCK: 100
+ PHDR: 0x80000034
+ PHENT: 32
+ PHNUM: 9
+ BASE: 0xc0000000
+ FLAGS: 0
+ ENTRY: 0x80000340
+ UID: 1000
+ EUID: 1000
+ GID: 501
+ EGID: 501
+ SECURE: 0
+ RANDOM: 0xefe716d9
+ EXECFN: 0xefe71ff4
+ NULL
+ CORE 281 FILE
+ 10 files:
+ 80000000-80001000 00000000 4096 /tmp/a.out
+ 80003000-80004000 00001000 4096 /tmp/a.out
+ 80004000-80005000 00002000 4096 /tmp/a.out
+ c0000000-c001c000 00000000 114688 /lib/ld-2.23.so
+ c001f000-c0020000 0001d000 4096 /lib/ld-2.23.so
+ c0020000-c0021000 0001e000 4096 /lib/ld-2.23.so
+ c0032000-c0177000 00000000 1331200 /lib/libc-2.23.so
+ c0177000-c0178000 00145000 4096 /lib/libc-2.23.so
+ c0178000-c017a000 00144000 8192 /lib/libc-2.23.so
+ c017a000-c017e000 00146000 16384 /lib/libc-2.23.so
+ CORE 108 FPREGSET
+ fp0: 0x7fff0000ffffffffffffffff fp1: 0x7fff0000ffffffffffffffff
+ fp2: 0x7fff0000ffffffffffffffff fp3: 0x7fff0000ffffffffffffffff
+ fp4: 0x7fff0000ffffffffffffffff fp5: 0x7fff0000ffffffffffffffff
+ fp6: 0x7fff0000ffffffffffffffff fp7: 0x7fff0000ffffffffffffffff
+EOF
+
exit 0
diff --git a/tests/run-readelf-ranges.sh b/tests/run-readelf-ranges.sh
new file mode 100755
index 0000000..ca3e302
--- /dev/null
+++ b/tests/run-readelf-ranges.sh
@@ -0,0 +1,236 @@
+#! /bin/sh
+# Copyright (C) 2018 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/>.
+
+. $srcdir/test-subr.sh
+
+# See run-readelf-loc.sh
+
+testfiles testfileloc
+
+# Process values as offsets from base addresses and resolve to symbols.
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=ranges testfileloc<<\EOF
+
+DWARF section [34] '.debug_ranges' at offset 0xd94:
+
+ CU [ b] base: 0x0000000000400480 <main>
+ [ 0] range 0, 2
+ 0x0000000000400480 <main>..
+ 0x0000000000400481 <main+0x1>
+ range 5, d
+ 0x0000000000400485 <main+0x5>..
+ 0x000000000040048c <main+0xc>
+
+ CU [ e0] base: 0x00000000004004a0 <say>
+ [ 30] range d, f
+ 0x00000000004004ad <say+0xd>..
+ 0x00000000004004ae <say+0xe>
+ range 12, 1a
+ 0x00000000004004b2 <say+0x12>..
+ 0x00000000004004b9 <say+0x19>
+EOF
+
+# Don't resolve addresses to symbols.
+testrun_compare ${abs_top_builddir}/src/readelf -N --debug-dump=ranges testfileloc<<\EOF
+
+DWARF section [34] '.debug_ranges' at offset 0xd94:
+
+ CU [ b] base: 0x0000000000400480
+ [ 0] range 0, 2
+ 0x0000000000400480..
+ 0x0000000000400481
+ range 5, d
+ 0x0000000000400485..
+ 0x000000000040048c
+
+ CU [ e0] base: 0x00000000004004a0
+ [ 30] range d, f
+ 0x00000000004004ad..
+ 0x00000000004004ae
+ range 12, 1a
+ 0x00000000004004b2..
+ 0x00000000004004b9
+EOF
+
+# Produce "raw" unprocessed content.
+testrun_compare ${abs_top_builddir}/src/readelf -U --debug-dump=ranges testfileloc<<\EOF
+
+DWARF section [34] '.debug_ranges' at offset 0xd94:
+
+ CU [ b] base: 0x0000000000400480
+ [ 0] range 0, 2
+ range 5, d
+
+ CU [ e0] base: 0x00000000004004a0
+ [ 30] range d, f
+ range 12, 1a
+EOF
+
+# .debug_rnglists (DWARF5), see tests/testfile-dwarf-45.source
+testfiles testfile-dwarf-5
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=ranges testfile-dwarf-5<<\EOF
+
+DWARF section [33] '.debug_rnglists' at offset 0x1d9a:
+Table at Offset 0x0:
+
+ Length: 45
+ DWARF version: 5
+ Address size: 8
+ Segment size: 0
+ Offset entries: 0
+ CU [ 218] base: 000000000000000000
+
+ Offset: c, Index: 0
+ base_address 0x400583
+ 0x0000000000400583 <calc+0x13>
+ offset_pair 0, 2
+ 0x0000000000400583 <calc+0x13>..
+ 0x0000000000400584 <calc+0x14>
+ offset_pair 5, 15
+ 0x0000000000400588 <calc+0x18>..
+ 0x0000000000400597 <calc+0x27>
+ end_of_list
+
+ Offset: 1c, Index: 10
+ start_length 0x400570, 2b
+ 0x0000000000400570 <calc>..
+ 0x000000000040059a <calc+0x2a>
+ start_length 0x400410, 20
+ 0x0000000000400410 <main>..
+ 0x000000000040042f <main+0x1f>
+ end_of_list
+
+EOF
+
+# Same as above, but for DWARF4, note no header, and base address is not
+# given, but ranges are the same.
+testfiles testfile-dwarf-4
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=ranges testfile-dwarf-4<<\EOF
+
+DWARF section [32] '.debug_ranges' at offset 0x1f96:
+
+ CU [ 21c] base: 000000000000000000
+ [ 0] range 400583, 400585
+ 0x0000000000400583 <calc+0x13>..
+ 0x0000000000400584 <calc+0x14>
+ range 400588, 400598
+ 0x0000000000400588 <calc+0x18>..
+ 0x0000000000400597 <calc+0x27>
+ [ 30] range 400570, 40059b
+ 0x0000000000400570 <calc>..
+ 0x000000000040059a <calc+0x2a>
+ range 400410, 400430
+ 0x0000000000400410 <main>..
+ 0x000000000040042f <main+0x1f>
+EOF
+
+# Now with split dwarf. See tests/testfile-dwarf-45.source.
+# Note that this will have an offsets table that the .dwo can refer to.
+testfiles testfile-splitdwarf-5 testfile-hello5.dwo testfile-world5.dwo
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=ranges testfile-splitdwarf-5<<\EOF
+
+DWARF section [35] '.debug_rnglists' at offset 0x393a:
+Table at Offset 0x0:
+
+ Length: 53
+ DWARF version: 5
+ Address size: 8
+ Segment size: 0
+ Offset entries: 2
+ CU [ 49] base: 000000000000000000
+
+ Offsets starting at 0xc:
+ [ 0] 0x8
+ [ 1] 0x18
+
+ Offset: 14, Index: 8
+ base_address 0x4011d3
+ 0x00000000004011d3 <calc+0x13>
+ offset_pair 0, 2
+ 0x00000000004011d3 <calc+0x13>..
+ 0x00000000004011d4 <calc+0x14>
+ offset_pair 5, 15
+ 0x00000000004011d8 <calc+0x18>..
+ 0x00000000004011e7 <calc+0x27>
+ end_of_list
+
+ Offset: 24, Index: 18
+ start_length 0x4011c0, 2b
+ 0x00000000004011c0 <calc>..
+ 0x00000000004011ea <calc+0x2a>
+ start_length 0x401060, 20
+ 0x0000000000401060 <main>..
+ 0x000000000040107f <main+0x1f>
+ end_of_list
+
+EOF
+
+# Note that the rnglist_base attribute of the second CU points to the offsets
+# above 0xc [c].
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=info testfile-splitdwarf-5<<\EOF
+
+DWARF section [28] '.debug_info' at offset 0x3102:
+ [Offset]
+ Compilation unit at offset 0:
+ Version: 5, Abbreviation section offset: 0, Address size: 8, Offset size: 4
+ Unit type: skeleton (4), Unit id: 0xc422aa5c31fec205
+ [ 14] skeleton_unit abbrev: 1
+ low_pc (addr) 0x0000000000401160 <foo>
+ high_pc (data8) 81 (0x00000000004011b1)
+ stmt_list (sec_offset) 0
+ dwo_name (strp) "testfile-hello5.dwo"
+ comp_dir (strp) "/home/mark/src/elfutils/tests"
+ GNU_pubnames (flag_present) yes
+ addr_base (sec_offset) address base [ 8]
+ Compilation unit at offset 53:
+ Version: 5, Abbreviation section offset: 21, Address size: 8, Offset size: 4
+ Unit type: skeleton (4), Unit id: 0xb6c8b9d97e6dfdfe
+ [ 49] skeleton_unit abbrev: 1
+ ranges (sec_offset) range list [ 24]
+ low_pc (addr) 000000000000000000
+ stmt_list (sec_offset) 655
+ dwo_name (strp) "testfile-world5.dwo"
+ comp_dir (strp) "/home/mark/src/elfutils/tests"
+ GNU_pubnames (flag_present) yes
+ addr_base (sec_offset) address base [ a8]
+ rnglists_base (sec_offset) range list [ c]
+EOF
+
+# Same for DWARF4 GNU DebugFission. But now we need to scan the .dwo
+# explicitly to know it will use the first ranges.
+testfiles testfile-splitdwarf-4 testfile-hello4.dwo testfile-world4.dwo
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=ranges testfile-splitdwarf-4<<\EOF
+
+DWARF section [32] '.debug_ranges' at offset 0x3611:
+
+ CU [ b] base: 000000000000000000
+ [ 0] range 4011d3, 4011d5
+ 0x00000000004011d3 <calc+0x13>..
+ 0x00000000004011d4 <calc+0x14>
+ range 4011d8, 4011e8
+ 0x00000000004011d8 <calc+0x18>..
+ 0x00000000004011e7 <calc+0x27>
+
+ CU [ 3f] base: 000000000000000000
+ [ 30] range 4011c0, 4011eb
+ 0x00000000004011c0 <calc>..
+ 0x00000000004011ea <calc+0x2a>
+ range 401060, 401080
+ 0x0000000000401060 <main>..
+ 0x000000000040107f <main+0x1f>
+EOF
+
+exit 0
diff --git a/tests/run-readelf-s.sh b/tests/run-readelf-s.sh
index 59407d1..82c3417 100755
--- a/tests/run-readelf-s.sh
+++ b/tests/run-readelf-s.sh
@@ -273,9 +273,20 @@
39: 0000000000000680 0 FUNC GLOBAL DEFAULT 11 _init
EOF
+# Display all symbol tables.
cat testfile.dynsym.in testfile.symtab.in \
| testrun_compare ${abs_top_builddir}/src/readelf -s testfilebaztab
+# Display just .dynsym
+cat testfile.dynsym.in \
+ | testrun_compare ${abs_top_builddir}/src/readelf \
+ --symbols=.dynsym testfilebaztab
+
+# Display just .symtab
+cat testfile.symtab.in \
+ | testrun_compare ${abs_top_builddir}/src/readelf \
+ --symbols=.symtab testfilebaztab
+
cat testfile.dynsym.in \
| testrun_compare ${abs_top_builddir}/src/readelf -s testfilebazdbg
diff --git a/tests/run-readelf-str.sh b/tests/run-readelf-str.sh
new file mode 100755
index 0000000..8b894e8
--- /dev/null
+++ b/tests/run-readelf-str.sh
@@ -0,0 +1,211 @@
+#! /bin/sh
+# Copyright (C) 2018 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/>.
+
+. $srcdir/test-subr.sh
+
+# See tests/testfile-dwarf-45.source
+testfiles testfile-splitdwarf-4 testfile-splitdwarf-5
+testfiles testfile-hello4.dwo testfile-hello5.dwo
+testfiles testfile-world4.dwo testfile-world5.dwo
+
+# DWARF4 GNU DebugFission No real table header.
+# We don't really need the skeleton, but we don't want any Warnings.
+testrun_compare ${abs_top_builddir}/src/readelf --dwarf-skeleton testfile-splitdwarf-4 --debug-dump=str testfile-hello4.dwo testfile-world4.dwo<<\EOF
+
+testfile-hello4.dwo:
+
+
+DWARF section [ 5] '.debug_str_offsets.dwo' at offset 0x335:
+Table at offset 0
+ Offsets start at 0x0:
+ [ 0] [ 0] "long long int"
+ [ 1] [ e] "frob"
+ [ 2] [ 13] "long unsigned int"
+ [ 3] [ 25] "/home/mark/src/elfutils/tests"
+ [ 4] [ 43] "wchar_t"
+ [ 5] [ 4b] "main"
+ [ 6] [ 50] "long int"
+ [ 7] [ 59] "GNU C17 9.0.0 20180515 (experimental) -mtune=generic -march=x86-64 -gdwarf-4 -gsplit-dwarf -gno-as-loc-support -gno-variable-location-views -O2"
+ [ 8] [ e9] "long double"
+ [ 9] [ f5] "hello.c"
+
+
+DWARF section [ 6] '.debug_str.dwo' at offset 0x35d:
+ Offset String
+ [ 0] "long long int"
+ [ e] "frob"
+ [ 13] "long unsigned int"
+ [ 25] "/home/mark/src/elfutils/tests"
+ [ 43] "wchar_t"
+ [ 4b] "main"
+ [ 50] "long int"
+ [ 59] "GNU C17 9.0.0 20180515 (experimental) -mtune=generic -march=x86-64 -gdwarf-4 -gsplit-dwarf -gno-as-loc-support -gno-variable-location-views -O2"
+ [ e9] "long double"
+ [ f5] "hello.c"
+
+testfile-world4.dwo:
+
+
+DWARF section [ 5] '.debug_str_offsets.dwo' at offset 0x2e7:
+Table at offset 0
+ Offsets start at 0x0:
+ [ 0] [ 0] "long long unsigned int"
+ [ 1] [ 17] "/home/mark/src/elfutils/tests"
+ [ 2] [ 35] "long long int"
+ [ 3] [ 43] "signed char"
+ [ 4] [ 4f] "long int"
+ [ 5] [ 58] "world.c"
+ [ 6] [ 60] "unsigned int"
+ [ 7] [ 6d] "long unsigned int"
+ [ 8] [ 7f] "short unsigned int"
+ [ 9] [ 92] "frob"
+ [10] [ 97] "calc"
+ [11] [ 9c] "unsigned char"
+ [12] [ aa] "short int"
+ [13] [ b4] "exit"
+ [14] [ b9] "GNU C17 9.0.0 20180515 (experimental) -mtune=generic -march=x86-64 -gdwarf-4 -gsplit-dwarf -gno-as-loc-support -gno-variable-location-views -O2"
+ [15] [ 149] "char"
+ [16] [ 14e] "word"
+ [17] [ 153] "argv"
+ [18] [ 158] "argc"
+ [19] [ 15d] "main"
+
+
+DWARF section [ 6] '.debug_str.dwo' at offset 0x337:
+ Offset String
+ [ 0] "long long unsigned int"
+ [ 17] "/home/mark/src/elfutils/tests"
+ [ 35] "long long int"
+ [ 43] "signed char"
+ [ 4f] "long int"
+ [ 58] "world.c"
+ [ 60] "unsigned int"
+ [ 6d] "long unsigned int"
+ [ 7f] "short unsigned int"
+ [ 92] "frob"
+ [ 97] "calc"
+ [ 9c] "unsigned char"
+ [ aa] "short int"
+ [ b4] "exit"
+ [ b9] "GNU C17 9.0.0 20180515 (experimental) -mtune=generic -march=x86-64 -gdwarf-4 -gsplit-dwarf -gno-as-loc-support -gno-variable-location-views -O2"
+ [ 149] "char"
+ [ 14e] "word"
+ [ 153] "argv"
+ [ 158] "argc"
+ [ 15d] "main"
+EOF
+
+# DWARF5 Real table header.
+# We don't really need the skeleton, but we don't want any Warnings.
+testrun_compare ${abs_top_builddir}/src/readelf --dwarf-skeleton testfile-splitdwarf-5 --debug-dump=str testfile-hello5.dwo testfile-world5.dwo<<\EOF
+
+testfile-hello5.dwo:
+
+
+DWARF section [ 5] '.debug_str_offsets.dwo' at offset 0x353:
+Table at offset 0
+
+ Length: 44
+ Offset size: 4
+ DWARF version: 5
+ Padding: 0
+
+ Offsets start at 0x8:
+ [ 0] [ 0] "long long int"
+ [ 1] [ e] "frob"
+ [ 2] [ 13] "long unsigned int"
+ [ 3] [ 25] "/home/mark/src/elfutils/tests"
+ [ 4] [ 43] "wchar_t"
+ [ 5] [ 4b] "main"
+ [ 6] [ 50] "long int"
+ [ 7] [ 59] "GNU C17 9.0.0 20180515 (experimental) -mtune=generic -march=x86-64 -gdwarf-5 -gsplit-dwarf -gno-as-loc-support -gno-variable-location-views -O2"
+ [ 8] [ e9] "long double"
+ [ 9] [ f5] "hello.c"
+
+
+DWARF section [ 6] '.debug_str.dwo' at offset 0x383:
+ Offset String
+ [ 0] "long long int"
+ [ e] "frob"
+ [ 13] "long unsigned int"
+ [ 25] "/home/mark/src/elfutils/tests"
+ [ 43] "wchar_t"
+ [ 4b] "main"
+ [ 50] "long int"
+ [ 59] "GNU C17 9.0.0 20180515 (experimental) -mtune=generic -march=x86-64 -gdwarf-5 -gsplit-dwarf -gno-as-loc-support -gno-variable-location-views -O2"
+ [ e9] "long double"
+ [ f5] "hello.c"
+
+testfile-world5.dwo:
+
+
+DWARF section [ 5] '.debug_str_offsets.dwo' at offset 0x313:
+Table at offset 0
+
+ Length: 84
+ Offset size: 4
+ DWARF version: 5
+ Padding: 0
+
+ Offsets start at 0x8:
+ [ 0] [ 0] "long long unsigned int"
+ [ 1] [ 17] "GNU C17 9.0.0 20180515 (experimental) -mtune=generic -march=x86-64 -gdwarf-5 -gsplit-dwarf -gno-as-loc-support -gno-variable-location-views -O2"
+ [ 2] [ a7] "/home/mark/src/elfutils/tests"
+ [ 3] [ c5] "long long int"
+ [ 4] [ d3] "signed char"
+ [ 5] [ df] "long int"
+ [ 6] [ e8] "world.c"
+ [ 7] [ f0] "unsigned int"
+ [ 8] [ fd] "long unsigned int"
+ [ 9] [ 10f] "short unsigned int"
+ [10] [ 122] "frob"
+ [11] [ 127] "calc"
+ [12] [ 12c] "unsigned char"
+ [13] [ 13a] "short int"
+ [14] [ 144] "exit"
+ [15] [ 149] "char"
+ [16] [ 14e] "word"
+ [17] [ 153] "argv"
+ [18] [ 158] "argc"
+ [19] [ 15d] "main"
+
+
+DWARF section [ 6] '.debug_str.dwo' at offset 0x36b:
+ Offset String
+ [ 0] "long long unsigned int"
+ [ 17] "GNU C17 9.0.0 20180515 (experimental) -mtune=generic -march=x86-64 -gdwarf-5 -gsplit-dwarf -gno-as-loc-support -gno-variable-location-views -O2"
+ [ a7] "/home/mark/src/elfutils/tests"
+ [ c5] "long long int"
+ [ d3] "signed char"
+ [ df] "long int"
+ [ e8] "world.c"
+ [ f0] "unsigned int"
+ [ fd] "long unsigned int"
+ [ 10f] "short unsigned int"
+ [ 122] "frob"
+ [ 127] "calc"
+ [ 12c] "unsigned char"
+ [ 13a] "short int"
+ [ 144] "exit"
+ [ 149] "char"
+ [ 14e] "word"
+ [ 153] "argv"
+ [ 158] "argc"
+ [ 15d] "main"
+EOF
+
+exit 0
diff --git a/tests/run-readelf-twofiles.sh b/tests/run-readelf-twofiles.sh
index 46eec7b..fc5f3e7 100755
--- a/tests/run-readelf-twofiles.sh
+++ b/tests/run-readelf-twofiles.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2011 Red Hat, Inc.
+# Copyright (C) 2011, 2018 Red Hat, Inc.
# This file is part of elfutils.
#
# This file is free software; you can redistribute it and/or modify
@@ -21,4 +21,45 @@
testrun >/dev/null ${abs_top_builddir}/src/readelf -w testfile14 testfile14
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=loc testfile14 testfile14 << EOF
+
+testfile14:
+
+
+DWARF section [33] '.debug_loc' at offset 0xca9:
+
+ CU [ b] base: 0x0000000000400468 <caller>
+ [ 0] range 34, 35
+ 0x000000000040049c <main>..
+ 0x000000000040049c <main>
+ [ 0] breg7 -8
+ range 35, 46
+ 0x000000000040049d <main+0x1>..
+ 0x00000000004004ad <main+0x11>
+ [ 0] breg7 0
+ range 46, 47
+ 0x00000000004004ae <main+0x12>..
+ 0x00000000004004ae <main+0x12>
+ [ 0] breg7 -8
+
+testfile14:
+
+
+DWARF section [33] '.debug_loc' at offset 0xca9:
+
+ CU [ b] base: 0x0000000000400468 <caller>
+ [ 0] range 34, 35
+ 0x000000000040049c <main>..
+ 0x000000000040049c <main>
+ [ 0] breg7 -8
+ range 35, 46
+ 0x000000000040049d <main+0x1>..
+ 0x00000000004004ad <main+0x11>
+ [ 0] breg7 0
+ range 46, 47
+ 0x00000000004004ae <main+0x12>..
+ 0x00000000004004ae <main+0x12>
+ [ 0] breg7 -8
+EOF
+
exit 0
diff --git a/tests/run-readelf-types.sh b/tests/run-readelf-types.sh
new file mode 100755
index 0000000..a7af573
--- /dev/null
+++ b/tests/run-readelf-types.sh
@@ -0,0 +1,122 @@
+#! /bin/sh
+# Copyright (C) 2018 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/>.
+
+. $srcdir/test-subr.sh
+
+# Make sure --debug-dump=info implies .debug_types, even when implicit.
+# See run-typeiter.sh
+testfiles testfile-debug-types
+
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=str --debug-dump=info testfile-debug-types<<\EOF
+
+DWARF section [28] '.debug_info' at offset 0x1089:
+ [Offset]
+ Compilation unit at offset 0:
+ Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4
+ [ b] compile_unit abbrev: 8
+ producer (strp) "GNU C++ 4.8.2 20140120 (Red Hat 4.8.2-16) -mtune=generic -march=x86-64 -g -fdebug-types-section"
+ language (data1) C_plus_plus (4)
+ comp_dir (strp) "/home/mark/src/elfutils/tests"
+ low_pc (addr) 0x00000000004005b0 <main>
+ high_pc (data8) 11 (0x00000000004005bb)
+ stmt_list (sec_offset) 0
+ [ 29] subprogram abbrev: 9
+ external (flag_present) yes
+ name (strp) "main"
+ decl_file (data1) <stdin> (1)
+ decl_line (data1) 1
+ type (ref4) [ 46]
+ low_pc (addr) 0x00000000004005b0 <main>
+ high_pc (data8) 11 (0x00000000004005bb)
+ frame_base (exprloc)
+ [ 0] call_frame_cfa
+ GNU_all_call_sites (flag_present) yes
+ [ 46] base_type abbrev: 10
+ byte_size (data1) 4
+ encoding (data1) signed (5)
+ name (string) "int"
+ [ 4d] variable abbrev: 11
+ name (string) "a"
+ decl_file (data1) <stdin> (1)
+ decl_line (data1) 1
+ type (ref_sig8) {18763953736e2de0}
+ external (flag_present) yes
+ location (exprloc)
+ [ 0] addr 0x601030 <a>
+ [ 64] variable abbrev: 11
+ name (string) "b"
+ decl_file (data1) <stdin> (1)
+ decl_line (data1) 1
+ type (ref_sig8) {7cf9bbf793fcaf13}
+ external (flag_present) yes
+ location (exprloc)
+ [ 0] addr 0x601031 <b>
+
+DWARF section [31] '.debug_str' at offset 0x11dd:
+ Offset String
+ [ 0] "/home/mark/src/elfutils/tests"
+ [ 1e] "GNU C++ 4.8.2 20140120 (Red Hat 4.8.2-16) -mtune=generic -march=x86-64 -g -fdebug-types-section"
+ [ 7e] "main"
+
+DWARF section [32] '.debug_types' at offset 0x1260:
+ [Offset]
+ Type unit at offset 0:
+ Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4
+ Type signature: 0x7cf9bbf793fcaf13, Type offset: 0x38 [38]
+ [ 17] type_unit abbrev: 1
+ language (data1) C_plus_plus (4)
+ GNU_odr_signature (data8) 4783233826607187165
+ stmt_list (sec_offset) 0
+ [ 25] structure_type abbrev: 2
+ name (string) "A"
+ signature (ref_sig8) {18763953736e2de0}
+ declaration (flag_present) yes
+ sibling (ref4) [ 38]
+ [ 34] structure_type abbrev: 3
+ name (string) "B"
+ declaration (flag_present) yes
+ [ 38] structure_type abbrev: 4
+ name (string) "B"
+ byte_size (data1) 1
+ decl_file (data1) <stdin> (1)
+ decl_line (data1) 1
+ specification (ref4) [ 34]
+ Type unit at offset 67:
+ Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4
+ Type signature: 0x18763953736e2de0, Type offset: 0x25 [25]
+ [ 5a] type_unit abbrev: 1
+ language (data1) C_plus_plus (4)
+ GNU_odr_signature (data8) 16005269134005989797
+ stmt_list (sec_offset) 0
+ [ 68] structure_type abbrev: 5
+ name (string) "A"
+ byte_size (data1) 1
+ decl_file (data1) <stdin> (1)
+ decl_line (data1) 1
+ [ 6e] structure_type abbrev: 6
+ name (string) "B"
+ declaration (flag_present) yes
+ signature (ref_sig8) {7cf9bbf793fcaf13}
+ [ 79] member abbrev: 7
+ name (string) "x"
+ decl_file (data1) <stdin> (1)
+ decl_line (data1) 1
+ type (ref4) [ 6e]
+ data_member_location (data1) 0
+EOF
+
+exit 0
diff --git a/tests/run-readelf-variant.sh b/tests/run-readelf-variant.sh
new file mode 100755
index 0000000..dcc0d5e
--- /dev/null
+++ b/tests/run-readelf-variant.sh
@@ -0,0 +1,89 @@
+#! /bin/sh
+# 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 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/>.
+
+. $srcdir/test-subr.sh
+
+# Tests exprloc for an Ada record variants byte_size.
+
+# = pck.ads
+#
+# with System;
+#
+# package Pck is
+#
+# type One_To_Five is range 1 .. 5;
+#
+# type Rec (Discr : One_To_Five) is
+# record
+# case Discr is
+# when 1 => Field1 : Integer;
+# when 4 => null;
+# when 3 => Field3 : Boolean;
+# when 5 => null;
+# when others => null;
+# end case;
+# end record;
+#
+# procedure Do_Nothing (A : System.Address);
+#
+# end Pck;
+
+# = pck.adb
+#
+# package body Pck is
+#
+# procedure Do_Nothing (A : System.Address) is
+# begin
+# null;
+# end Do_Nothing;
+#
+# end Pck;
+
+# = foo.adb
+#
+# with Pck; use Pck;
+#
+# procedure Foo is
+#
+# R : Rec (1);
+#
+# begin
+# Do_Nothing (R'Address);
+# end Foo;
+
+# gnatmake -g -fgnat-encodings=minimal foo.adb -cargs
+
+testfiles testfile-ada-variant
+
+tempfiles testfile.temp testfile2.temp
+
+testrun ${abs_top_builddir}/src/readelf --debug-dump=info \
+ testfile-ada-variant > testfile.temp
+
+grep -A6 byte_size testfile.temp | grep -A6 exprloc > testfile2.temp
+
+diff -u testfile2.temp - <<EOF
+ byte_size (exprloc)
+ [ 0] push_object_address
+ [ 1] deref_size 1
+ [ 3] call4 [ 95]
+ [ 8] plus_uconst 7
+ [10] const1s -4
+ [12] and
+EOF
+
+exit 0
diff --git a/tests/run-readelf-zdebug-rel.sh b/tests/run-readelf-zdebug-rel.sh
index 88ea5bf..3f20078 100755
--- a/tests/run-readelf-zdebug-rel.sh
+++ b/tests/run-readelf-zdebug-rel.sh
@@ -51,7 +51,7 @@
[Offset]
Compilation unit at offset 0:
Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4
- [ b] compile_unit
+ [ b] compile_unit abbrev: 1
producer (strp) "GNU C11 5.3.1 20151207 (Red Hat 5.3.1-2) -mtune=generic -march=x86-64 -g -Og"
language (data1) C99 (12)
name (strp) "testfile-zdebug-rel.c"
@@ -59,60 +59,60 @@
low_pc (addr) 000000000000000000
high_pc (data8) 24 (0x0000000000000018)
stmt_list (sec_offset) 0
- [ 2d] subprogram
- external (flag_present)
+ [ 2d] subprogram abbrev: 2
+ external (flag_present) yes
name (strp) "main"
- decl_file (data1) 1
+ decl_file (data1) testfile-zdebug-rel.c (1)
decl_line (data1) 4
- prototyped (flag_present)
+ prototyped (flag_present) yes
type (ref4) [ 80]
low_pc (addr) 000000000000000000
high_pc (data8) 24 (0x0000000000000018)
frame_base (exprloc)
- [ 0] call_frame_cfa
- GNU_all_call_sites (flag_present)
+ [ 0] call_frame_cfa
+ GNU_all_call_sites (flag_present) yes
sibling (ref4) [ 80]
- [ 4e] formal_parameter
+ [ 4e] formal_parameter abbrev: 3
name (strp) "argc"
- decl_file (data1) 1
+ decl_file (data1) testfile-zdebug-rel.c (1)
decl_line (data1) 4
type (ref4) [ 80]
location (sec_offset) location list [ 0]
- [ 5d] formal_parameter
+ [ 5d] formal_parameter abbrev: 4
name (strp) "argv"
- decl_file (data1) 1
+ decl_file (data1) testfile-zdebug-rel.c (1)
decl_line (data1) 4
type (ref4) [ 87]
location (exprloc)
- [ 0] reg4
- [ 6a] variable
+ [ 0] reg4
+ [ 6a] variable abbrev: 5
name (string) "a"
- decl_file (data1) 1
+ decl_file (data1) testfile-zdebug-rel.c (1)
decl_line (data1) 6
type (ref4) [ 9a]
- const_value (sdata) -9
- [ 74] variable
+ const_value (sdata) 18446744073709551607 (-9)
+ [ 74] variable abbrev: 6
name (string) "b"
- decl_file (data1) 1
+ decl_file (data1) testfile-zdebug-rel.c (1)
decl_line (data1) 7
type (ref4) [ 9a]
location (exprloc)
- [ 0] reg5
- [ 80] base_type
+ [ 0] reg5
+ [ 80] base_type abbrev: 7
byte_size (data1) 4
encoding (data1) signed (5)
name (string) "int"
- [ 87] pointer_type
+ [ 87] pointer_type abbrev: 8
byte_size (data1) 8
type (ref4) [ 8d]
- [ 8d] pointer_type
+ [ 8d] pointer_type abbrev: 8
byte_size (data1) 8
type (ref4) [ 93]
- [ 93] base_type
+ [ 93] base_type abbrev: 9
byte_size (data1) 1
encoding (data1) signed_char (6)
name (strp) "char"
- [ 9a] base_type
+ [ 9a] base_type abbrev: 9
byte_size (data1) 8
encoding (data1) unsigned (7)
name (strp) "long unsigned int"
@@ -127,12 +127,17 @@
cat > loc.out << \EOF
DWARF section [ 7] '.debug_loc' at offset 0x185:
- [ 0] 000000000000000000..0x0000000000000003 [ 0] reg5
- 0x0000000000000003..0x0000000000000010 [ 0] breg5 -42
- [ 2] stack_value
- 0x0000000000000010..0x0000000000000018 [ 0] GNU_entry_value:
- [ 0] reg5
- [ 3] stack_value
+
+ CU [ b] base: 000000000000000000
+ [ 0] range 0, 3
+ [ 0] reg5
+ range 3, 10
+ [ 0] breg5 -42
+ [ 2] stack_value
+ range 10, 18
+ [ 0] GNU_entry_value:
+ [ 0] reg5
+ [ 3] stack_value
EOF
cat loc.out | testrun_compare ${abs_top_builddir}/src/readelf -U --debug-dump=loc testfile-debug-rel.o
diff --git a/tests/run-readelf-zdebug.sh b/tests/run-readelf-zdebug.sh
index 37cf7ea..878e0ba 100755
--- a/tests/run-readelf-zdebug.sh
+++ b/tests/run-readelf-zdebug.sh
@@ -46,12 +46,17 @@
cat > loc.out << \EOF
DWARF section [30] '.debug_loc' at offset 0xa17:
- [ 0] 0x00000000004003c0..0x00000000004003c3 [ 0] reg5
- 0x00000000004003c3..0x00000000004003d6 [ 0] breg5 -42
- [ 2] stack_value
- 0x00000000004003d6..0x00000000004003d9 [ 0] GNU_entry_value:
- [ 0] reg5
- [ 3] stack_value
+
+ CU [ b] base: 000000000000000000
+ [ 0] range 4003c0, 4003c3
+ [ 0] reg5
+ range 4003c3, 4003d6
+ [ 0] breg5 -42
+ [ 2] stack_value
+ range 4003d6, 4003d9
+ [ 0] GNU_entry_value:
+ [ 0] reg5
+ [ 3] stack_value
EOF
cat loc.out | testrun_compare ${abs_top_builddir}/src/readelf -U --debug-dump=loc testfile-debug
@@ -80,7 +85,9 @@
cat > ranges.out << \EOF
DWARF section [32] '.debug_ranges' at offset 0xa95:
- [ 0] 0x00000000004003c0..0x00000000004003d9
+
+ CU [ b] base: 000000000000000000
+ [ 0] range 4003c0, 4003d9
EOF
cat ranges.out | testrun_compare ${abs_top_builddir}/src/readelf -U --debug-dump=ranges testfile-debug
@@ -354,15 +361,17 @@
Table at offset 0:
- Length: 70
- DWARF version: 2
- Prologue length: 40
- Minimum instruction length: 1
- Maximum operations per instruction: 1
- Initial value if 'is_stmt': 1
- Line base: -5
- Line range: 14
- Opcode base: 13
+ Length: 70
+ DWARF version: 2
+ Prologue length: 40
+ Address size: 8
+ Segment selector size: 0
+ Min instruction length: 1
+ Max operations per instruction: 1
+ Initial value if 'is_stmt': 1
+ Line base: -5
+ Line range: 14
+ Opcode base: 13
Opcodes:
[ 1] 0 arguments
@@ -476,15 +485,15 @@
def_cfa_offset 24
advance_loc 10 to 0x3b0
def_cfa_expression 11
- [ 0] breg7 8
- [ 2] breg16 0
- [ 4] lit15
- [ 5] and
- [ 6] lit11
- [ 7] ge
- [ 8] lit3
- [ 9] shl
- [ 10] plus
+ [ 0] breg7 8
+ [ 2] breg16 0
+ [ 4] lit15
+ [ 5] and
+ [ 6] lit11
+ [ 7] ge
+ [ 8] lit3
+ [ 9] shl
+ [10] plus
nop
nop
nop
diff --git a/tests/run-reloc-bpf.sh b/tests/run-reloc-bpf.sh
new file mode 100755
index 0000000..feb7557
--- /dev/null
+++ b/tests/run-reloc-bpf.sh
@@ -0,0 +1,33 @@
+#! /bin/sh
+# Copyright (C) 2018 Facebook, 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/>.
+
+. $srcdir/test-subr.sh
+
+# This test file is created with
+# $ cat t.c
+# struct tt {
+# int a;
+# char b;
+# };
+# int test(struct tt *t) {
+# return t->a;
+# }
+# $ clang -O2 -g -emit-llvm -c t.c -o - | llc -march=bpf -filetype=obj -o t.o
+# $ mv t.o testfile-bpf-reloc.o
+
+testfiles testfile-bpf-reloc.o testfile-bpf-reloc.expect
+testrun_compare ${abs_top_builddir}/src/objdump -r testfile-bpf-reloc.o < testfile-bpf-reloc.expect
diff --git a/tests/run-strip-g.sh b/tests/run-strip-g.sh
new file mode 100755
index 0000000..1303819
--- /dev/null
+++ b/tests/run-strip-g.sh
@@ -0,0 +1,102 @@
+#! /bin/sh
+# 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 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/>.
+
+. $srcdir/test-subr.sh
+
+# When stripping just the debug sections/symbols we keep the symtab
+# in the main ELF file. There should be no symbols pointing into the
+# debug sections and so there should not be a copy in the debug file
+# except for a NOBITS one.
+
+tempfiles a.out strip.out debug.out readelf.out
+
+echo Create debug a.out.
+echo "int main() { return 1; }" | gcc -g -xc -
+
+echo strip -g to file with debug file
+testrun ${abs_top_builddir}/src/strip -g -o strip.out -f debug.out ||
+ { echo "*** failed to strip -g -o strip.out -f debug.out a.out"; exit -1; }
+
+status=0
+testrun ${abs_top_builddir}/src/readelf -S strip.out > readelf.out
+grep SYMTAB readelf.out || status=$?
+echo $status
+if test $status -ne 0; then
+ echo no symtab found in strip.out
+ exit 1
+fi
+
+status=0
+testrun ${abs_top_builddir}/src/readelf -S debug.out > readelf.out
+grep SYMTAB readelf.out || status=$?
+echo $status
+if test $status -ne 1; then
+ echo symtab found in debug.out
+ exit 1
+fi
+
+# arm (with data marker in .debug_frame). See tests/run-addrcfi.sh
+testfiles testfilearm
+
+echo arm strip -g to file with debug file
+testrun ${abs_top_builddir}/src/strip -g -o strip.out -f debug.out testfilearm ||
+ { echo "*** failed to strip -g -o strip.out -f debug.out a.out"; exit -1; }
+
+status=0
+testrun ${abs_top_builddir}/src/readelf -S strip.out > readelf.out
+grep SYMTAB readelf.out || status=$?
+echo $status
+if test $status -ne 0; then
+ echo no symtab found in strip.out
+ exit 1
+fi
+
+status=0
+testrun ${abs_top_builddir}/src/readelf -S debug.out > readelf.out
+grep SYMTAB readelf.out || status=$?
+echo $status
+if test $status -ne 1; then
+ echo symtab found in debug.out
+ exit 1
+fi
+
+# aarch64 (with data marker in .debug_frame). See tests/run-addrcfi.sh
+testfiles testfileaarch64
+
+echo aarch64 strip -g to file with debug file
+testrun ${abs_top_builddir}/src/strip -g -o strip.out -f debug.out testfileaarch64 ||
+ { echo "*** failed to strip -g -o strip.out -f debug.out a.out"; exit -1; }
+
+status=0
+testrun ${abs_top_builddir}/src/readelf -S strip.out > readelf.out
+grep SYMTAB readelf.out || status=$?
+echo $status
+if test $status -ne 0; then
+ echo no symtab found in strip.out
+ exit 1
+fi
+
+status=0
+testrun ${abs_top_builddir}/src/readelf -S debug.out > readelf.out
+grep SYMTAB readelf.out || status=$?
+echo $status
+if test $status -ne 1; then
+ echo symtab found in debug.out
+ exit 1
+fi
+
+exit 0
diff --git a/tests/run-strip-nobitsalign.sh b/tests/run-strip-nobitsalign.sh
new file mode 100755
index 0000000..db9b1d9
--- /dev/null
+++ b/tests/run-strip-nobitsalign.sh
@@ -0,0 +1,35 @@
+#! /bin/sh
+# Copyright (C) Red Hat, Inc., 2016.
+# 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/>.
+
+# static unsigned char buffer[4096] __attribute((aligned (4096)));
+#
+# char
+# f (int i)
+# {
+# return buffer[i];
+# }
+#
+# int
+# main (int argc, char **argv)
+# {
+# return buffer[argc] == 0;
+# }
+
+original=testfile-nobitsalign
+stripped=testfile-nobitsalign.strip
+
+. $srcdir/run-strip-test.sh
diff --git a/tests/run-strip-nothing.sh b/tests/run-strip-nothing.sh
new file mode 100755
index 0000000..914fdfb
--- /dev/null
+++ b/tests/run-strip-nothing.sh
@@ -0,0 +1,62 @@
+#! /bin/sh
+# 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 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/>.
+
+. $srcdir/test-subr.sh
+
+# If there is nothing to strip then -o output should be identical to input.
+# And there should not be an (empty) -f debug file.
+
+tempfiles a.out strip.out debug.out
+
+# Create no-debug a.out.
+echo "int main() { return 1; }" | gcc -s -xc -
+
+# strip to file
+testrun ${abs_top_builddir}/src/strip -g -o strip.out ||
+ { echo "*** failed to strip -g -o strip.out a.out"; exit -1; }
+
+testrun ${abs_top_builddir}/src/elfcmp a.out strip.out ||
+ { echo "*** failed strip.out different from a.out"; exit -1; }
+
+# strip original
+testrun ${abs_top_builddir}/src/strip -g ||
+ { echo "*** failed to strip -g a.out"; exit -1; }
+
+testrun ${abs_top_builddir}/src/elfcmp strip.out a.out ||
+ { echo "*** failed a.out different from strip.out"; exit -1; }
+
+# strip to file with debug file
+testrun ${abs_top_builddir}/src/strip -g -o strip.out -f debug.out ||
+ { echo "*** failed to strip -g -o strip.out -f debug.out a.out"; exit -1; }
+
+testrun ${abs_top_builddir}/src/elfcmp a.out strip.out ||
+ { echo "*** failed strip.out different from a.out (with debug)"; exit -1; }
+
+test ! -f debug.out ||
+ { echo "*** failed strip.out and debug.out exist"; exit -1; }
+
+# strip original with debug file
+testrun ${abs_top_builddir}/src/strip -g -f debug.out ||
+ { echo "*** failed to strip -g -f debug.out a.out"; exit -1; }
+
+testrun ${abs_top_builddir}/src/elfcmp strip.out a.out ||
+ { echo "*** failed a.out different from strip.out (with debug)"; exit -1; }
+
+test ! -f debug.out ||
+ { echo "*** failed a.out and debug.out exist"; exit -1; }
+
+exit 0
diff --git a/tests/run-strip-reloc.sh b/tests/run-strip-reloc.sh
index a3245fd..b1c8534 100755
--- a/tests/run-strip-reloc.sh
+++ b/tests/run-strip-reloc.sh
@@ -18,7 +18,7 @@
. $srcdir/test-subr.sh
testfiles hello_i386.ko hello_x86_64.ko hello_ppc64.ko hello_s390.ko \
- hello_aarch64.ko
+ hello_aarch64.ko hello_m68k.ko hello_riscv64.ko
tempfiles readelf.out readelf.out1 readelf.out2
tempfiles out.stripped1 out.debug1 out.stripped2 out.debug2
@@ -102,9 +102,22 @@
runtest hello_ppc64.ko 1
runtest hello_s390.ko 1
runtest hello_aarch64.ko 1
+runtest hello_m68k.ko 1
+runtest hello_riscv64.ko 1
# self test, shouldn't impact non-ET_REL files at all.
runtest ${abs_top_builddir}/src/strip 0
runtest ${abs_top_builddir}/src/strip.o 1
+# Copy ET_REL file for self-test and make sure to run with/without
+# elf section compression.
+tempfiles strip-uncompressed.o strip-compressed.o
+testrun ${abs_top_builddir}/src/elfcompress -o strip-uncompressed.o -t none \
+ ${abs_top_builddir}/src/strip.o
+testrun ${abs_top_builddir}/src/elfcompress -o strip-compressed.o -t zlib \
+ --force ${abs_top_builddir}/src/strip.o
+
+runtest strip-uncompressed.o 1
+runtest strip-compressed.o 1
+
exit $status
diff --git a/tests/run-strip-remove-keep.sh b/tests/run-strip-remove-keep.sh
new file mode 100755
index 0000000..92647fa
--- /dev/null
+++ b/tests/run-strip-remove-keep.sh
@@ -0,0 +1,688 @@
+#! /bin/sh
+# 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 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/>.
+
+. $srcdir/test-subr.sh
+
+# strip -o output and -f debug files
+tempfiles testfile.elf testfile.debug
+
+# A random 32bit testfile
+testfiles testfile
+
+# Explicitly keep .strtab (but not .symtab, so .strtab will be in both). 32bit
+echo strip --keep-section=.strtab testfile
+testrun ${abs_top_builddir}/src/strip --keep-section=.strtab -o testfile.elf -f testfile.debug testfile
+echo elflint testfile.elf
+testrun ${abs_top_builddir}/src/elflint --gnu testfile.elf
+echo elflint testfile.debug
+testrun ${abs_top_builddir}/src/elflint --gnu -d testfile.debug
+echo readelf testfile.elf
+testrun_compare ${abs_top_builddir}/src/readelf -S testfile.elf <<\EOF
+There are 27 section headers, starting at offset 0xaf8:
+
+Section Headers:
+[Nr] Name Type Addr Off Size ES Flags Lk Inf Al
+[ 0] NULL 00000000 000000 000000 0 0 0 0
+[ 1] .interp PROGBITS 080480f4 0000f4 000013 0 A 0 0 1
+[ 2] .note.ABI-tag NOTE 08048108 000108 000020 0 A 0 0 4
+[ 3] .hash HASH 08048128 000128 000030 4 A 4 0 4
+[ 4] .dynsym DYNSYM 08048158 000158 000070 16 A 5 1 4
+[ 5] .dynstr STRTAB 080481c8 0001c8 00008e 0 A 0 0 1
+[ 6] .gnu.version GNU_versym 08048256 000256 00000e 2 A 4 0 2
+[ 7] .gnu.version_r GNU_verneed 08048264 000264 000030 0 A 5 1 4
+[ 8] .rel.got REL 08048294 000294 000008 8 A 4 19 4
+[ 9] .rel.plt REL 0804829c 00029c 000020 8 A 4 11 4
+[10] .init PROGBITS 080482bc 0002bc 000018 0 AX 0 0 4
+[11] .plt PROGBITS 080482d4 0002d4 000050 4 AX 0 0 4
+[12] .text PROGBITS 08048330 000330 00018c 0 AX 0 0 16
+[13] .fini PROGBITS 080484bc 0004bc 00001e 0 AX 0 0 4
+[14] .rodata PROGBITS 080484dc 0004dc 000008 0 A 0 0 4
+[15] .data PROGBITS 080494e4 0004e4 000010 0 WA 0 0 4
+[16] .eh_frame PROGBITS 080494f4 0004f4 000004 0 WA 0 0 4
+[17] .ctors PROGBITS 080494f8 0004f8 000008 0 WA 0 0 4
+[18] .dtors PROGBITS 08049500 000500 000008 0 WA 0 0 4
+[19] .got PROGBITS 08049508 000508 000020 4 WA 0 0 4
+[20] .dynamic DYNAMIC 08049528 000528 0000a0 8 WA 5 0 4
+[21] .bss NOBITS 080495c8 0005c8 00001c 0 WA 0 0 4
+[22] .comment PROGBITS 00000000 0005c8 000170 0 0 0 1
+[23] .note NOTE 00000000 000738 0000a0 0 0 0 1
+[24] .strtab STRTAB 00000000 0007d8 000235 0 0 0 1
+[25] .gnu_debuglink PROGBITS 00000000 000a10 000014 0 0 0 4
+[26] .shstrtab STRTAB 00000000 000a24 0000d1 0 0 0 1
+
+EOF
+echo readelf testfile.debug
+testrun_compare ${abs_top_builddir}/src/readelf -S testfile.debug <<\EOF
+There are 35 section headers, starting at offset 0x463c:
+
+Section Headers:
+[Nr] Name Type Addr Off Size ES Flags Lk Inf Al
+[ 0] NULL 00000000 000000 000000 0 0 0 0
+[ 1] .interp NOBITS 080480f4 0000f4 000013 0 A 0 0 1
+[ 2] .note.ABI-tag NOTE 08048108 0000f4 000020 0 A 0 0 4
+[ 3] .hash NOBITS 08048128 000114 000030 4 A 4 0 4
+[ 4] .dynsym NOBITS 08048158 000114 000070 16 A 5 1 4
+[ 5] .dynstr NOBITS 080481c8 000114 00008e 0 A 0 0 1
+[ 6] .gnu.version NOBITS 08048256 000114 00000e 2 A 4 0 2
+[ 7] .gnu.version_r NOBITS 08048264 000114 000030 0 A 5 1 4
+[ 8] .rel.got NOBITS 08048294 000114 000008 8 A 4 19 4
+[ 9] .rel.plt NOBITS 0804829c 000114 000020 8 A 4 11 4
+[10] .init NOBITS 080482bc 000114 000018 0 AX 0 0 4
+[11] .plt NOBITS 080482d4 000114 000050 4 AX 0 0 4
+[12] .text NOBITS 08048330 000120 00018c 0 AX 0 0 16
+[13] .fini NOBITS 080484bc 000120 00001e 0 AX 0 0 4
+[14] .rodata NOBITS 080484dc 000120 000008 0 A 0 0 4
+[15] .data NOBITS 080494e4 000120 000010 0 WA 0 0 4
+[16] .eh_frame NOBITS 080494f4 000120 000004 0 WA 0 0 4
+[17] .ctors NOBITS 080494f8 000120 000008 0 WA 0 0 4
+[18] .dtors NOBITS 08049500 000120 000008 0 WA 0 0 4
+[19] .got NOBITS 08049508 000120 000020 4 WA 0 0 4
+[20] .dynamic NOBITS 08049528 000120 0000a0 8 WA 5 0 4
+[21] .sbss PROGBITS 080495c8 000120 000000 0 W 0 0 1
+[22] .bss NOBITS 080495c8 000120 00001c 0 WA 0 0 4
+[23] .stab PROGBITS 00000000 000120 000720 12 24 0 4
+[24] .stabstr STRTAB 00000000 000840 001934 0 0 0 1
+[25] .comment NOBITS 00000000 002174 000170 0 0 0 1
+[26] .debug_aranges PROGBITS 00000000 002174 000060 0 0 0 1
+[27] .debug_pubnames PROGBITS 00000000 0021d4 000055 0 0 0 1
+[28] .debug_info PROGBITS 00000000 002229 001678 0 0 0 1
+[29] .debug_abbrev PROGBITS 00000000 0038a1 0001d2 0 0 0 1
+[30] .debug_line PROGBITS 00000000 003a73 000223 0 0 0 1
+[31] .note NOTE 00000000 003c96 0000a0 0 0 0 1
+[32] .shstrtab STRTAB 00000000 003d36 00012e 0 0 0 1
+[33] .symtab SYMTAB 00000000 003e64 0005a0 16 34 68 4
+[34] .strtab STRTAB 00000000 004404 000235 0 0 0 1
+
+EOF
+
+# Explicitly keep .symtab (pulls in .strtab, so they will both be in elf). 32bit
+echo strip --keep-section=.symtab testfile
+testrun ${abs_top_builddir}/src/strip --keep-section=.symtab -o testfile.elf -f testfile.debug testfile
+echo elflint testfile.elf
+testrun ${abs_top_builddir}/src/elflint --gnu testfile.elf
+echo elflint testfile.debug
+testrun ${abs_top_builddir}/src/elflint --gnu -d testfile.debug
+echo readelf testfile.elf
+testrun_compare ${abs_top_builddir}/src/readelf -S testfile.elf <<\EOF
+There are 28 section headers, starting at offset 0x1010:
+
+Section Headers:
+[Nr] Name Type Addr Off Size ES Flags Lk Inf Al
+[ 0] NULL 00000000 000000 000000 0 0 0 0
+[ 1] .interp PROGBITS 080480f4 0000f4 000013 0 A 0 0 1
+[ 2] .note.ABI-tag NOTE 08048108 000108 000020 0 A 0 0 4
+[ 3] .hash HASH 08048128 000128 000030 4 A 4 0 4
+[ 4] .dynsym DYNSYM 08048158 000158 000070 16 A 5 1 4
+[ 5] .dynstr STRTAB 080481c8 0001c8 00008e 0 A 0 0 1
+[ 6] .gnu.version GNU_versym 08048256 000256 00000e 2 A 4 0 2
+[ 7] .gnu.version_r GNU_verneed 08048264 000264 000030 0 A 5 1 4
+[ 8] .rel.got REL 08048294 000294 000008 8 A 4 19 4
+[ 9] .rel.plt REL 0804829c 00029c 000020 8 A 4 11 4
+[10] .init PROGBITS 080482bc 0002bc 000018 0 AX 0 0 4
+[11] .plt PROGBITS 080482d4 0002d4 000050 4 AX 0 0 4
+[12] .text PROGBITS 08048330 000330 00018c 0 AX 0 0 16
+[13] .fini PROGBITS 080484bc 0004bc 00001e 0 AX 0 0 4
+[14] .rodata PROGBITS 080484dc 0004dc 000008 0 A 0 0 4
+[15] .data PROGBITS 080494e4 0004e4 000010 0 WA 0 0 4
+[16] .eh_frame PROGBITS 080494f4 0004f4 000004 0 WA 0 0 4
+[17] .ctors PROGBITS 080494f8 0004f8 000008 0 WA 0 0 4
+[18] .dtors PROGBITS 08049500 000500 000008 0 WA 0 0 4
+[19] .got PROGBITS 08049508 000508 000020 4 WA 0 0 4
+[20] .dynamic DYNAMIC 08049528 000528 0000a0 8 WA 5 0 4
+[21] .bss NOBITS 080495c8 0005c8 00001c 0 WA 0 0 4
+[22] .comment PROGBITS 00000000 0005c8 000170 0 0 0 1
+[23] .note NOTE 00000000 000738 0000a0 0 0 0 1
+[24] .symtab SYMTAB 00000000 0007d8 000510 16 25 59 4
+[25] .strtab STRTAB 00000000 000ce8 000235 0 0 0 1
+[26] .gnu_debuglink PROGBITS 00000000 000f20 000014 0 0 0 4
+[27] .shstrtab STRTAB 00000000 000f34 0000d9 0 0 0 1
+
+EOF
+echo readelf testfile.debug
+testrun_compare ${abs_top_builddir}/src/readelf -S testfile.debug <<\EOF
+There are 35 section headers, starting at offset 0x3e64:
+
+Section Headers:
+[Nr] Name Type Addr Off Size ES Flags Lk Inf Al
+[ 0] NULL 00000000 000000 000000 0 0 0 0
+[ 1] .interp NOBITS 080480f4 0000f4 000013 0 A 0 0 1
+[ 2] .note.ABI-tag NOTE 08048108 0000f4 000020 0 A 0 0 4
+[ 3] .hash NOBITS 08048128 000114 000030 4 A 4 0 4
+[ 4] .dynsym NOBITS 08048158 000114 000070 16 A 5 1 4
+[ 5] .dynstr NOBITS 080481c8 000114 00008e 0 A 0 0 1
+[ 6] .gnu.version NOBITS 08048256 000114 00000e 2 A 4 0 2
+[ 7] .gnu.version_r NOBITS 08048264 000114 000030 0 A 5 1 4
+[ 8] .rel.got NOBITS 08048294 000114 000008 8 A 4 19 4
+[ 9] .rel.plt NOBITS 0804829c 000114 000020 8 A 4 11 4
+[10] .init NOBITS 080482bc 000114 000018 0 AX 0 0 4
+[11] .plt NOBITS 080482d4 000114 000050 4 AX 0 0 4
+[12] .text NOBITS 08048330 000120 00018c 0 AX 0 0 16
+[13] .fini NOBITS 080484bc 000120 00001e 0 AX 0 0 4
+[14] .rodata NOBITS 080484dc 000120 000008 0 A 0 0 4
+[15] .data NOBITS 080494e4 000120 000010 0 WA 0 0 4
+[16] .eh_frame NOBITS 080494f4 000120 000004 0 WA 0 0 4
+[17] .ctors NOBITS 080494f8 000120 000008 0 WA 0 0 4
+[18] .dtors NOBITS 08049500 000120 000008 0 WA 0 0 4
+[19] .got NOBITS 08049508 000120 000020 4 WA 0 0 4
+[20] .dynamic NOBITS 08049528 000120 0000a0 8 WA 5 0 4
+[21] .sbss PROGBITS 080495c8 000120 000000 0 W 0 0 1
+[22] .bss NOBITS 080495c8 000120 00001c 0 WA 0 0 4
+[23] .stab PROGBITS 00000000 000120 000720 12 24 0 4
+[24] .stabstr STRTAB 00000000 000840 001934 0 0 0 1
+[25] .comment NOBITS 00000000 002174 000170 0 0 0 1
+[26] .debug_aranges PROGBITS 00000000 002174 000060 0 0 0 1
+[27] .debug_pubnames PROGBITS 00000000 0021d4 000055 0 0 0 1
+[28] .debug_info PROGBITS 00000000 002229 001678 0 0 0 1
+[29] .debug_abbrev PROGBITS 00000000 0038a1 0001d2 0 0 0 1
+[30] .debug_line PROGBITS 00000000 003a73 000223 0 0 0 1
+[31] .note NOTE 00000000 003c96 0000a0 0 0 0 1
+[32] .shstrtab STRTAB 00000000 003d36 00012e 0 0 0 1
+[33] .symtab NOBITS 00000000 003e64 0005a0 16 34 68 4
+[34] .strtab NOBITS 00000000 003e64 000235 0 0 0 1
+
+EOF
+
+# A random 64bit testfile
+testfiles testfile69.so
+# Explicitly keep .strtab (but not .symtab, so .strtab will be in both). 64bit
+echo strip --keep-section=.strtab testfile69.so
+testrun ${abs_top_builddir}/src/strip --keep-section=.strtab -o testfile.elf -f testfile.debug testfile69.so
+echo elflint testfile.elf
+testrun ${abs_top_builddir}/src/elflint --gnu testfile.elf
+echo elflint testfile.debug
+testrun ${abs_top_builddir}/src/elflint --gnu -d testfile.debug
+echo readelf testfile.elf
+testrun_compare ${abs_top_builddir}/src/readelf -S testfile.elf <<\EOF
+There are 27 section headers, starting at offset 0xad8:
+
+Section Headers:
+[Nr] Name Type Addr Off Size ES Flags Lk Inf Al
+[ 0] NULL 0000000000000000 00000000 00000000 0 0 0 0
+[ 1] .note.gnu.build-id NOTE 0000000000000190 00000190 00000024 0 A 0 0 4
+[ 2] .gnu.hash GNU_HASH 00000000000001b8 000001b8 0000003c 0 A 3 0 8
+[ 3] .dynsym DYNSYM 00000000000001f8 000001f8 00000108 24 A 4 2 8
+[ 4] .dynstr STRTAB 0000000000000300 00000300 00000077 0 A 0 0 1
+[ 5] .gnu.version GNU_versym 0000000000000378 00000378 00000016 2 A 3 0 2
+[ 6] .gnu.version_r GNU_verneed 0000000000000390 00000390 00000020 0 A 4 1 8
+[ 7] .rela.dyn RELA 00000000000003b0 000003b0 00000060 24 A 3 0 8
+[ 8] .rela.plt RELA 0000000000000410 00000410 00000018 24 A 3 10 8
+[ 9] .init PROGBITS 0000000000000428 00000428 00000018 0 AX 0 0 4
+[10] .plt PROGBITS 0000000000000440 00000440 00000020 16 AX 0 0 16
+[11] .text PROGBITS 0000000000000460 00000460 00000128 0 AX 0 0 16
+[12] .fini PROGBITS 0000000000000588 00000588 0000000e 0 AX 0 0 4
+[13] .eh_frame_hdr PROGBITS 0000000000000598 00000598 00000024 0 A 0 0 4
+[14] .eh_frame PROGBITS 00000000000005c0 000005c0 00000084 0 A 0 0 8
+[15] .ctors PROGBITS 0000000000200648 00000648 00000010 0 WA 0 0 8
+[16] .dtors PROGBITS 0000000000200658 00000658 00000010 0 WA 0 0 8
+[17] .jcr PROGBITS 0000000000200668 00000668 00000008 0 WA 0 0 8
+[18] .data.rel.ro PROGBITS 0000000000200670 00000670 00000008 0 WA 0 0 8
+[19] .dynamic DYNAMIC 0000000000200678 00000678 00000180 16 WA 4 0 8
+[20] .got PROGBITS 00000000002007f8 000007f8 00000018 8 WA 0 0 8
+[21] .got.plt PROGBITS 0000000000200810 00000810 00000020 8 WA 0 0 8
+[22] .bss NOBITS 0000000000200830 00000830 00000010 0 WA 0 0 8
+[23] .comment PROGBITS 0000000000000000 00000830 0000002c 1 MS 0 0 1
+[24] .strtab STRTAB 0000000000000000 0000085c 00000175 0 0 0 1
+[25] .gnu_debuglink PROGBITS 0000000000000000 000009d4 00000014 0 0 0 4
+[26] .shstrtab STRTAB 0000000000000000 000009e8 000000ee 0 0 0 1
+
+EOF
+echo readelf testfile.debug
+testrun_compare ${abs_top_builddir}/src/readelf -S testfile.debug <<\EOF
+There are 27 section headers, starting at offset 0x918:
+
+Section Headers:
+[Nr] Name Type Addr Off Size ES Flags Lk Inf Al
+[ 0] NULL 0000000000000000 00000000 00000000 0 0 0 0
+[ 1] .note.gnu.build-id NOTE 0000000000000190 00000190 00000024 0 A 0 0 4
+[ 2] .gnu.hash NOBITS 00000000000001b8 000001b8 0000003c 0 A 3 0 8
+[ 3] .dynsym NOBITS 00000000000001f8 000001b8 00000108 24 A 4 2 8
+[ 4] .dynstr NOBITS 0000000000000300 000001b8 00000077 0 A 0 0 1
+[ 5] .gnu.version NOBITS 0000000000000378 000001b8 00000016 2 A 3 0 2
+[ 6] .gnu.version_r NOBITS 0000000000000390 000001b8 00000020 0 A 4 1 8
+[ 7] .rela.dyn NOBITS 00000000000003b0 000001b8 00000060 24 A 3 0 8
+[ 8] .rela.plt NOBITS 0000000000000410 000001b8 00000018 24 A 3 10 8
+[ 9] .init NOBITS 0000000000000428 000001b8 00000018 0 AX 0 0 4
+[10] .plt NOBITS 0000000000000440 000001c0 00000020 16 AX 0 0 16
+[11] .text NOBITS 0000000000000460 000001c0 00000128 0 AX 0 0 16
+[12] .fini NOBITS 0000000000000588 000001c0 0000000e 0 AX 0 0 4
+[13] .eh_frame_hdr NOBITS 0000000000000598 000001c0 00000024 0 A 0 0 4
+[14] .eh_frame NOBITS 00000000000005c0 000001c0 00000084 0 A 0 0 8
+[15] .ctors NOBITS 0000000000200648 000001c0 00000010 0 WA 0 0 8
+[16] .dtors NOBITS 0000000000200658 000001c0 00000010 0 WA 0 0 8
+[17] .jcr NOBITS 0000000000200668 000001c0 00000008 0 WA 0 0 8
+[18] .data.rel.ro NOBITS 0000000000200670 000001c0 00000008 0 WA 0 0 8
+[19] .dynamic NOBITS 0000000000200678 000001c0 00000180 16 WA 4 0 8
+[20] .got NOBITS 00000000002007f8 000001c0 00000018 8 WA 0 0 8
+[21] .got.plt NOBITS 0000000000200810 000001c0 00000020 8 WA 0 0 8
+[22] .bss NOBITS 0000000000200830 000001c0 00000010 0 WA 0 0 8
+[23] .comment NOBITS 0000000000000000 000001c0 0000002c 1 MS 0 0 1
+[24] .shstrtab STRTAB 0000000000000000 000001c0 000000e7 0 0 0 1
+[25] .symtab SYMTAB 0000000000000000 000002a8 000004f8 24 26 44 8
+[26] .strtab STRTAB 0000000000000000 000007a0 00000175 0 0 0 1
+
+EOF
+
+# Explicitly keep .symtab (pulls in .strtab, so they will both be in elf). 64bit
+# Use --remove-comment to make sure testfile.debug isn't empty.
+echo strip --keep-section=.symtab --remove-comment testfile69.so
+testrun ${abs_top_builddir}/src/strip --keep-section=.symtab --remove-comment -o testfile.elf -f testfile.debug testfile69.so
+echo elflint testfile.elf
+testrun ${abs_top_builddir}/src/elflint --gnu testfile.elf
+echo elflint testfile.debug
+testrun ${abs_top_builddir}/src/elflint --gnu -d testfile.debug
+echo readelf testfile.elf
+testrun_compare ${abs_top_builddir}/src/readelf -S testfile.elf <<\EOF
+There are 27 section headers, starting at offset 0xf90:
+
+Section Headers:
+[Nr] Name Type Addr Off Size ES Flags Lk Inf Al
+[ 0] NULL 0000000000000000 00000000 00000000 0 0 0 0
+[ 1] .note.gnu.build-id NOTE 0000000000000190 00000190 00000024 0 A 0 0 4
+[ 2] .gnu.hash GNU_HASH 00000000000001b8 000001b8 0000003c 0 A 3 0 8
+[ 3] .dynsym DYNSYM 00000000000001f8 000001f8 00000108 24 A 4 2 8
+[ 4] .dynstr STRTAB 0000000000000300 00000300 00000077 0 A 0 0 1
+[ 5] .gnu.version GNU_versym 0000000000000378 00000378 00000016 2 A 3 0 2
+[ 6] .gnu.version_r GNU_verneed 0000000000000390 00000390 00000020 0 A 4 1 8
+[ 7] .rela.dyn RELA 00000000000003b0 000003b0 00000060 24 A 3 0 8
+[ 8] .rela.plt RELA 0000000000000410 00000410 00000018 24 A 3 10 8
+[ 9] .init PROGBITS 0000000000000428 00000428 00000018 0 AX 0 0 4
+[10] .plt PROGBITS 0000000000000440 00000440 00000020 16 AX 0 0 16
+[11] .text PROGBITS 0000000000000460 00000460 00000128 0 AX 0 0 16
+[12] .fini PROGBITS 0000000000000588 00000588 0000000e 0 AX 0 0 4
+[13] .eh_frame_hdr PROGBITS 0000000000000598 00000598 00000024 0 A 0 0 4
+[14] .eh_frame PROGBITS 00000000000005c0 000005c0 00000084 0 A 0 0 8
+[15] .ctors PROGBITS 0000000000200648 00000648 00000010 0 WA 0 0 8
+[16] .dtors PROGBITS 0000000000200658 00000658 00000010 0 WA 0 0 8
+[17] .jcr PROGBITS 0000000000200668 00000668 00000008 0 WA 0 0 8
+[18] .data.rel.ro PROGBITS 0000000000200670 00000670 00000008 0 WA 0 0 8
+[19] .dynamic DYNAMIC 0000000000200678 00000678 00000180 16 WA 4 0 8
+[20] .got PROGBITS 00000000002007f8 000007f8 00000018 8 WA 0 0 8
+[21] .got.plt PROGBITS 0000000000200810 00000810 00000020 8 WA 0 0 8
+[22] .bss NOBITS 0000000000200830 00000830 00000010 0 WA 0 0 8
+[23] .symtab SYMTAB 0000000000000000 00000830 000004e0 24 24 43 8
+[24] .strtab STRTAB 0000000000000000 00000d10 00000175 0 0 0 1
+[25] .gnu_debuglink PROGBITS 0000000000000000 00000e88 00000014 0 0 0 4
+[26] .shstrtab STRTAB 0000000000000000 00000e9c 000000ed 0 0 0 1
+
+EOF
+echo readelf testfile.debug
+testrun_compare ${abs_top_builddir}/src/readelf -S testfile.debug <<\EOF
+There are 27 section headers, starting at offset 0x2d8:
+
+Section Headers:
+[Nr] Name Type Addr Off Size ES Flags Lk Inf Al
+[ 0] NULL 0000000000000000 00000000 00000000 0 0 0 0
+[ 1] .note.gnu.build-id NOTE 0000000000000190 00000190 00000024 0 A 0 0 4
+[ 2] .gnu.hash NOBITS 00000000000001b8 000001b8 0000003c 0 A 3 0 8
+[ 3] .dynsym NOBITS 00000000000001f8 000001b8 00000108 24 A 4 2 8
+[ 4] .dynstr NOBITS 0000000000000300 000001b8 00000077 0 A 0 0 1
+[ 5] .gnu.version NOBITS 0000000000000378 000001b8 00000016 2 A 3 0 2
+[ 6] .gnu.version_r NOBITS 0000000000000390 000001b8 00000020 0 A 4 1 8
+[ 7] .rela.dyn NOBITS 00000000000003b0 000001b8 00000060 24 A 3 0 8
+[ 8] .rela.plt NOBITS 0000000000000410 000001b8 00000018 24 A 3 10 8
+[ 9] .init NOBITS 0000000000000428 000001b8 00000018 0 AX 0 0 4
+[10] .plt NOBITS 0000000000000440 000001c0 00000020 16 AX 0 0 16
+[11] .text NOBITS 0000000000000460 000001c0 00000128 0 AX 0 0 16
+[12] .fini NOBITS 0000000000000588 000001c0 0000000e 0 AX 0 0 4
+[13] .eh_frame_hdr NOBITS 0000000000000598 000001c0 00000024 0 A 0 0 4
+[14] .eh_frame NOBITS 00000000000005c0 000001c0 00000084 0 A 0 0 8
+[15] .ctors NOBITS 0000000000200648 000001c0 00000010 0 WA 0 0 8
+[16] .dtors NOBITS 0000000000200658 000001c0 00000010 0 WA 0 0 8
+[17] .jcr NOBITS 0000000000200668 000001c0 00000008 0 WA 0 0 8
+[18] .data.rel.ro NOBITS 0000000000200670 000001c0 00000008 0 WA 0 0 8
+[19] .dynamic NOBITS 0000000000200678 000001c0 00000180 16 WA 4 0 8
+[20] .got NOBITS 00000000002007f8 000001c0 00000018 8 WA 0 0 8
+[21] .got.plt NOBITS 0000000000200810 000001c0 00000020 8 WA 0 0 8
+[22] .bss NOBITS 0000000000200830 000001c0 00000010 0 WA 0 0 8
+[23] .comment PROGBITS 0000000000000000 000001c0 0000002c 1 MS 0 0 1
+[24] .shstrtab STRTAB 0000000000000000 000001ec 000000e7 0 0 0 1
+[25] .symtab NOBITS 0000000000000000 000002d8 000004f8 24 26 44 8
+[26] .strtab NOBITS 0000000000000000 000002d8 00000175 0 0 0 1
+
+EOF
+
+# Explicitly remove .symtab (but not .strtab, so it will be in both). 32bit
+echo strip -g --remove-section=.symtab testfile
+testrun ${abs_top_builddir}/src/strip -g --remove-section=.symtab -o testfile.elf -f testfile.debug testfile
+echo elflint testfile.elf
+testrun ${abs_top_builddir}/src/elflint --gnu testfile.elf
+echo elflint testfile.debug
+testrun ${abs_top_builddir}/src/elflint --gnu -d testfile.debug
+echo readelf testfile.elf
+testrun_compare ${abs_top_builddir}/src/readelf -S testfile.elf <<\EOF
+There are 28 section headers, starting at offset 0xafc:
+
+Section Headers:
+[Nr] Name Type Addr Off Size ES Flags Lk Inf Al
+[ 0] NULL 00000000 000000 000000 0 0 0 0
+[ 1] .interp PROGBITS 080480f4 0000f4 000013 0 A 0 0 1
+[ 2] .note.ABI-tag NOTE 08048108 000108 000020 0 A 0 0 4
+[ 3] .hash HASH 08048128 000128 000030 4 A 4 0 4
+[ 4] .dynsym DYNSYM 08048158 000158 000070 16 A 5 1 4
+[ 5] .dynstr STRTAB 080481c8 0001c8 00008e 0 A 0 0 1
+[ 6] .gnu.version GNU_versym 08048256 000256 00000e 2 A 4 0 2
+[ 7] .gnu.version_r GNU_verneed 08048264 000264 000030 0 A 5 1 4
+[ 8] .rel.got REL 08048294 000294 000008 8 A 4 19 4
+[ 9] .rel.plt REL 0804829c 00029c 000020 8 A 4 11 4
+[10] .init PROGBITS 080482bc 0002bc 000018 0 AX 0 0 4
+[11] .plt PROGBITS 080482d4 0002d4 000050 4 AX 0 0 4
+[12] .text PROGBITS 08048330 000330 00018c 0 AX 0 0 16
+[13] .fini PROGBITS 080484bc 0004bc 00001e 0 AX 0 0 4
+[14] .rodata PROGBITS 080484dc 0004dc 000008 0 A 0 0 4
+[15] .data PROGBITS 080494e4 0004e4 000010 0 WA 0 0 4
+[16] .eh_frame PROGBITS 080494f4 0004f4 000004 0 WA 0 0 4
+[17] .ctors PROGBITS 080494f8 0004f8 000008 0 WA 0 0 4
+[18] .dtors PROGBITS 08049500 000500 000008 0 WA 0 0 4
+[19] .got PROGBITS 08049508 000508 000020 4 WA 0 0 4
+[20] .dynamic DYNAMIC 08049528 000528 0000a0 8 WA 5 0 4
+[21] .sbss PROGBITS 080495c8 0005c8 000000 0 W 0 0 1
+[22] .bss NOBITS 080495c8 0005c8 00001c 0 WA 0 0 4
+[23] .comment PROGBITS 00000000 0005c8 000170 0 0 0 1
+[24] .note NOTE 00000000 000738 0000a0 0 0 0 1
+[25] .strtab STRTAB 00000000 0007d8 000235 0 0 0 1
+[26] .gnu_debuglink PROGBITS 00000000 000a10 000014 0 0 0 4
+[27] .shstrtab STRTAB 00000000 000a24 0000d7 0 0 0 1
+
+EOF
+echo readelf testfile.debug
+testrun_compare ${abs_top_builddir}/src/readelf -S testfile.debug <<\EOF
+There are 35 section headers, starting at offset 0x463c:
+
+Section Headers:
+[Nr] Name Type Addr Off Size ES Flags Lk Inf Al
+[ 0] NULL 00000000 000000 000000 0 0 0 0
+[ 1] .interp NOBITS 080480f4 0000f4 000013 0 A 0 0 1
+[ 2] .note.ABI-tag NOTE 08048108 0000f4 000020 0 A 0 0 4
+[ 3] .hash NOBITS 08048128 000114 000030 4 A 4 0 4
+[ 4] .dynsym NOBITS 08048158 000114 000070 16 A 5 1 4
+[ 5] .dynstr NOBITS 080481c8 000114 00008e 0 A 0 0 1
+[ 6] .gnu.version NOBITS 08048256 000114 00000e 2 A 4 0 2
+[ 7] .gnu.version_r NOBITS 08048264 000114 000030 0 A 5 1 4
+[ 8] .rel.got NOBITS 08048294 000114 000008 8 A 4 19 4
+[ 9] .rel.plt NOBITS 0804829c 000114 000020 8 A 4 11 4
+[10] .init NOBITS 080482bc 000114 000018 0 AX 0 0 4
+[11] .plt NOBITS 080482d4 000114 000050 4 AX 0 0 4
+[12] .text NOBITS 08048330 000120 00018c 0 AX 0 0 16
+[13] .fini NOBITS 080484bc 000120 00001e 0 AX 0 0 4
+[14] .rodata NOBITS 080484dc 000120 000008 0 A 0 0 4
+[15] .data NOBITS 080494e4 000120 000010 0 WA 0 0 4
+[16] .eh_frame NOBITS 080494f4 000120 000004 0 WA 0 0 4
+[17] .ctors NOBITS 080494f8 000120 000008 0 WA 0 0 4
+[18] .dtors NOBITS 08049500 000120 000008 0 WA 0 0 4
+[19] .got NOBITS 08049508 000120 000020 4 WA 0 0 4
+[20] .dynamic NOBITS 08049528 000120 0000a0 8 WA 5 0 4
+[21] .sbss NOBITS 080495c8 000120 000000 0 W 0 0 1
+[22] .bss NOBITS 080495c8 000120 00001c 0 WA 0 0 4
+[23] .stab PROGBITS 00000000 000120 000720 12 24 0 4
+[24] .stabstr STRTAB 00000000 000840 001934 0 0 0 1
+[25] .comment NOBITS 00000000 002174 000170 0 0 0 1
+[26] .debug_aranges PROGBITS 00000000 002174 000060 0 0 0 1
+[27] .debug_pubnames PROGBITS 00000000 0021d4 000055 0 0 0 1
+[28] .debug_info PROGBITS 00000000 002229 001678 0 0 0 1
+[29] .debug_abbrev PROGBITS 00000000 0038a1 0001d2 0 0 0 1
+[30] .debug_line PROGBITS 00000000 003a73 000223 0 0 0 1
+[31] .note NOTE 00000000 003c96 0000a0 0 0 0 1
+[32] .shstrtab STRTAB 00000000 003d36 00012e 0 0 0 1
+[33] .symtab SYMTAB 00000000 003e64 0005a0 16 34 68 4
+[34] .strtab STRTAB 00000000 004404 000235 0 0 0 1
+
+EOF
+
+# Explicitly remove both .symtab and .strtab. Keep .stab and .stabstr 32bit
+echo strip -g --remove-section=".s[yt][mr]tab" --keep-section=".stab*" testfile
+testrun ${abs_top_builddir}/src/strip -g --remove-section=".s[yt][mr]tab" --keep-section=".stab*" -o testfile.elf -f testfile.debug testfile
+echo elflint testfile.elf
+testrun ${abs_top_builddir}/src/elflint --gnu testfile.elf
+echo elflint testfile.debug
+testrun ${abs_top_builddir}/src/elflint --gnu -d testfile.debug
+echo readelf testfile.elf
+testrun_compare ${abs_top_builddir}/src/readelf -S testfile.elf <<\EOF
+There are 29 section headers, starting at offset 0x2920:
+
+Section Headers:
+[Nr] Name Type Addr Off Size ES Flags Lk Inf Al
+[ 0] NULL 00000000 000000 000000 0 0 0 0
+[ 1] .interp PROGBITS 080480f4 0000f4 000013 0 A 0 0 1
+[ 2] .note.ABI-tag NOTE 08048108 000108 000020 0 A 0 0 4
+[ 3] .hash HASH 08048128 000128 000030 4 A 4 0 4
+[ 4] .dynsym DYNSYM 08048158 000158 000070 16 A 5 1 4
+[ 5] .dynstr STRTAB 080481c8 0001c8 00008e 0 A 0 0 1
+[ 6] .gnu.version GNU_versym 08048256 000256 00000e 2 A 4 0 2
+[ 7] .gnu.version_r GNU_verneed 08048264 000264 000030 0 A 5 1 4
+[ 8] .rel.got REL 08048294 000294 000008 8 A 4 19 4
+[ 9] .rel.plt REL 0804829c 00029c 000020 8 A 4 11 4
+[10] .init PROGBITS 080482bc 0002bc 000018 0 AX 0 0 4
+[11] .plt PROGBITS 080482d4 0002d4 000050 4 AX 0 0 4
+[12] .text PROGBITS 08048330 000330 00018c 0 AX 0 0 16
+[13] .fini PROGBITS 080484bc 0004bc 00001e 0 AX 0 0 4
+[14] .rodata PROGBITS 080484dc 0004dc 000008 0 A 0 0 4
+[15] .data PROGBITS 080494e4 0004e4 000010 0 WA 0 0 4
+[16] .eh_frame PROGBITS 080494f4 0004f4 000004 0 WA 0 0 4
+[17] .ctors PROGBITS 080494f8 0004f8 000008 0 WA 0 0 4
+[18] .dtors PROGBITS 08049500 000500 000008 0 WA 0 0 4
+[19] .got PROGBITS 08049508 000508 000020 4 WA 0 0 4
+[20] .dynamic DYNAMIC 08049528 000528 0000a0 8 WA 5 0 4
+[21] .sbss PROGBITS 080495c8 0005c8 000000 0 W 0 0 1
+[22] .bss NOBITS 080495c8 0005c8 00001c 0 WA 0 0 4
+[23] .stab PROGBITS 00000000 0005c8 000720 12 24 0 4
+[24] .stabstr STRTAB 00000000 000ce8 001934 0 0 0 1
+[25] .comment PROGBITS 00000000 00261c 000170 0 0 0 1
+[26] .note NOTE 00000000 00278c 0000a0 0 0 0 1
+[27] .gnu_debuglink PROGBITS 00000000 00282c 000014 0 0 0 4
+[28] .shstrtab STRTAB 00000000 002840 0000de 0 0 0 1
+
+EOF
+echo readelf testfile.debug
+testrun_compare ${abs_top_builddir}/src/readelf -S testfile.debug <<\EOF
+There are 35 section headers, starting at offset 0x25e8:
+
+Section Headers:
+[Nr] Name Type Addr Off Size ES Flags Lk Inf Al
+[ 0] NULL 00000000 000000 000000 0 0 0 0
+[ 1] .interp NOBITS 080480f4 0000f4 000013 0 A 0 0 1
+[ 2] .note.ABI-tag NOTE 08048108 0000f4 000020 0 A 0 0 4
+[ 3] .hash NOBITS 08048128 000114 000030 4 A 4 0 4
+[ 4] .dynsym NOBITS 08048158 000114 000070 16 A 5 1 4
+[ 5] .dynstr NOBITS 080481c8 000114 00008e 0 A 0 0 1
+[ 6] .gnu.version NOBITS 08048256 000114 00000e 2 A 4 0 2
+[ 7] .gnu.version_r NOBITS 08048264 000114 000030 0 A 5 1 4
+[ 8] .rel.got NOBITS 08048294 000114 000008 8 A 4 19 4
+[ 9] .rel.plt NOBITS 0804829c 000114 000020 8 A 4 11 4
+[10] .init NOBITS 080482bc 000114 000018 0 AX 0 0 4
+[11] .plt NOBITS 080482d4 000114 000050 4 AX 0 0 4
+[12] .text NOBITS 08048330 000120 00018c 0 AX 0 0 16
+[13] .fini NOBITS 080484bc 000120 00001e 0 AX 0 0 4
+[14] .rodata NOBITS 080484dc 000120 000008 0 A 0 0 4
+[15] .data NOBITS 080494e4 000120 000010 0 WA 0 0 4
+[16] .eh_frame NOBITS 080494f4 000120 000004 0 WA 0 0 4
+[17] .ctors NOBITS 080494f8 000120 000008 0 WA 0 0 4
+[18] .dtors NOBITS 08049500 000120 000008 0 WA 0 0 4
+[19] .got NOBITS 08049508 000120 000020 4 WA 0 0 4
+[20] .dynamic NOBITS 08049528 000120 0000a0 8 WA 5 0 4
+[21] .sbss NOBITS 080495c8 000120 000000 0 W 0 0 1
+[22] .bss NOBITS 080495c8 000120 00001c 0 WA 0 0 4
+[23] .stab NOBITS 00000000 000120 000720 12 24 0 4
+[24] .stabstr NOBITS 00000000 000120 001934 0 0 0 1
+[25] .comment NOBITS 00000000 000120 000170 0 0 0 1
+[26] .debug_aranges PROGBITS 00000000 000120 000060 0 0 0 1
+[27] .debug_pubnames PROGBITS 00000000 000180 000055 0 0 0 1
+[28] .debug_info PROGBITS 00000000 0001d5 001678 0 0 0 1
+[29] .debug_abbrev PROGBITS 00000000 00184d 0001d2 0 0 0 1
+[30] .debug_line PROGBITS 00000000 001a1f 000223 0 0 0 1
+[31] .note NOTE 00000000 001c42 0000a0 0 0 0 1
+[32] .shstrtab STRTAB 00000000 001ce2 00012e 0 0 0 1
+[33] .symtab SYMTAB 00000000 001e10 0005a0 16 34 68 4
+[34] .strtab STRTAB 00000000 0023b0 000235 0 0 0 1
+
+EOF
+
+# Explicitly remove .symtab (but not .strtab, so it will be in both). 64bit
+echo strip -g --remove-section=.symtab testfile69.so
+testrun ${abs_top_builddir}/src/strip -g --remove-section=.symtab -o testfile.elf -f testfile.debug testfile69.so
+echo elflint testfile.elf
+testrun ${abs_top_builddir}/src/elflint --gnu testfile.elf
+echo elflint testfile.debug
+testrun ${abs_top_builddir}/src/elflint --gnu -d testfile.debug
+echo readelf testfile.elf
+testrun_compare ${abs_top_builddir}/src/readelf -S testfile.elf <<\EOF
+There are 27 section headers, starting at offset 0xad8:
+
+Section Headers:
+[Nr] Name Type Addr Off Size ES Flags Lk Inf Al
+[ 0] NULL 0000000000000000 00000000 00000000 0 0 0 0
+[ 1] .note.gnu.build-id NOTE 0000000000000190 00000190 00000024 0 A 0 0 4
+[ 2] .gnu.hash GNU_HASH 00000000000001b8 000001b8 0000003c 0 A 3 0 8
+[ 3] .dynsym DYNSYM 00000000000001f8 000001f8 00000108 24 A 4 2 8
+[ 4] .dynstr STRTAB 0000000000000300 00000300 00000077 0 A 0 0 1
+[ 5] .gnu.version GNU_versym 0000000000000378 00000378 00000016 2 A 3 0 2
+[ 6] .gnu.version_r GNU_verneed 0000000000000390 00000390 00000020 0 A 4 1 8
+[ 7] .rela.dyn RELA 00000000000003b0 000003b0 00000060 24 A 3 0 8
+[ 8] .rela.plt RELA 0000000000000410 00000410 00000018 24 A 3 10 8
+[ 9] .init PROGBITS 0000000000000428 00000428 00000018 0 AX 0 0 4
+[10] .plt PROGBITS 0000000000000440 00000440 00000020 16 AX 0 0 16
+[11] .text PROGBITS 0000000000000460 00000460 00000128 0 AX 0 0 16
+[12] .fini PROGBITS 0000000000000588 00000588 0000000e 0 AX 0 0 4
+[13] .eh_frame_hdr PROGBITS 0000000000000598 00000598 00000024 0 A 0 0 4
+[14] .eh_frame PROGBITS 00000000000005c0 000005c0 00000084 0 A 0 0 8
+[15] .ctors PROGBITS 0000000000200648 00000648 00000010 0 WA 0 0 8
+[16] .dtors PROGBITS 0000000000200658 00000658 00000010 0 WA 0 0 8
+[17] .jcr PROGBITS 0000000000200668 00000668 00000008 0 WA 0 0 8
+[18] .data.rel.ro PROGBITS 0000000000200670 00000670 00000008 0 WA 0 0 8
+[19] .dynamic DYNAMIC 0000000000200678 00000678 00000180 16 WA 4 0 8
+[20] .got PROGBITS 00000000002007f8 000007f8 00000018 8 WA 0 0 8
+[21] .got.plt PROGBITS 0000000000200810 00000810 00000020 8 WA 0 0 8
+[22] .bss NOBITS 0000000000200830 00000830 00000010 0 WA 0 0 8
+[23] .comment PROGBITS 0000000000000000 00000830 0000002c 1 MS 0 0 1
+[24] .strtab STRTAB 0000000000000000 0000085c 00000175 0 0 0 1
+[25] .gnu_debuglink PROGBITS 0000000000000000 000009d4 00000014 0 0 0 4
+[26] .shstrtab STRTAB 0000000000000000 000009e8 000000ee 0 0 0 1
+
+EOF
+echo readelf testfile.debug
+testrun_compare ${abs_top_builddir}/src/readelf -S testfile.debug <<\EOF
+There are 27 section headers, starting at offset 0x918:
+
+Section Headers:
+[Nr] Name Type Addr Off Size ES Flags Lk Inf Al
+[ 0] NULL 0000000000000000 00000000 00000000 0 0 0 0
+[ 1] .note.gnu.build-id NOTE 0000000000000190 00000190 00000024 0 A 0 0 4
+[ 2] .gnu.hash NOBITS 00000000000001b8 000001b8 0000003c 0 A 3 0 8
+[ 3] .dynsym NOBITS 00000000000001f8 000001b8 00000108 24 A 4 2 8
+[ 4] .dynstr NOBITS 0000000000000300 000001b8 00000077 0 A 0 0 1
+[ 5] .gnu.version NOBITS 0000000000000378 000001b8 00000016 2 A 3 0 2
+[ 6] .gnu.version_r NOBITS 0000000000000390 000001b8 00000020 0 A 4 1 8
+[ 7] .rela.dyn NOBITS 00000000000003b0 000001b8 00000060 24 A 3 0 8
+[ 8] .rela.plt NOBITS 0000000000000410 000001b8 00000018 24 A 3 10 8
+[ 9] .init NOBITS 0000000000000428 000001b8 00000018 0 AX 0 0 4
+[10] .plt NOBITS 0000000000000440 000001c0 00000020 16 AX 0 0 16
+[11] .text NOBITS 0000000000000460 000001c0 00000128 0 AX 0 0 16
+[12] .fini NOBITS 0000000000000588 000001c0 0000000e 0 AX 0 0 4
+[13] .eh_frame_hdr NOBITS 0000000000000598 000001c0 00000024 0 A 0 0 4
+[14] .eh_frame NOBITS 00000000000005c0 000001c0 00000084 0 A 0 0 8
+[15] .ctors NOBITS 0000000000200648 000001c0 00000010 0 WA 0 0 8
+[16] .dtors NOBITS 0000000000200658 000001c0 00000010 0 WA 0 0 8
+[17] .jcr NOBITS 0000000000200668 000001c0 00000008 0 WA 0 0 8
+[18] .data.rel.ro NOBITS 0000000000200670 000001c0 00000008 0 WA 0 0 8
+[19] .dynamic NOBITS 0000000000200678 000001c0 00000180 16 WA 4 0 8
+[20] .got NOBITS 00000000002007f8 000001c0 00000018 8 WA 0 0 8
+[21] .got.plt NOBITS 0000000000200810 000001c0 00000020 8 WA 0 0 8
+[22] .bss NOBITS 0000000000200830 000001c0 00000010 0 WA 0 0 8
+[23] .comment NOBITS 0000000000000000 000001c0 0000002c 1 MS 0 0 1
+[24] .shstrtab STRTAB 0000000000000000 000001c0 000000e7 0 0 0 1
+[25] .symtab SYMTAB 0000000000000000 000002a8 000004f8 24 26 44 8
+[26] .strtab STRTAB 0000000000000000 000007a0 00000175 0 0 0 1
+
+EOF
+
+# Explicitly remove both .symtab and .strtab. Keep .comment section. 64bit
+echo strip -g --remove-section=".s[yt][mr]tab" --keep-section=.comment testfile69.so
+testrun ${abs_top_builddir}/src/strip -g --remove-section=".s[yt][mr]tab" --keep-section=.comment -o testfile.elf -f testfile.debug testfile69.so
+echo elflint testfile.elf
+testrun ${abs_top_builddir}/src/elflint --gnu testfile.elf
+echo elflint testfile.debug
+testrun ${abs_top_builddir}/src/elflint --gnu -d testfile.debug
+echo readelf testfile.elf
+testrun_compare ${abs_top_builddir}/src/readelf -S testfile.elf <<\EOF
+There are 26 section headers, starting at offset 0x958:
+
+Section Headers:
+[Nr] Name Type Addr Off Size ES Flags Lk Inf Al
+[ 0] NULL 0000000000000000 00000000 00000000 0 0 0 0
+[ 1] .note.gnu.build-id NOTE 0000000000000190 00000190 00000024 0 A 0 0 4
+[ 2] .gnu.hash GNU_HASH 00000000000001b8 000001b8 0000003c 0 A 3 0 8
+[ 3] .dynsym DYNSYM 00000000000001f8 000001f8 00000108 24 A 4 2 8
+[ 4] .dynstr STRTAB 0000000000000300 00000300 00000077 0 A 0 0 1
+[ 5] .gnu.version GNU_versym 0000000000000378 00000378 00000016 2 A 3 0 2
+[ 6] .gnu.version_r GNU_verneed 0000000000000390 00000390 00000020 0 A 4 1 8
+[ 7] .rela.dyn RELA 00000000000003b0 000003b0 00000060 24 A 3 0 8
+[ 8] .rela.plt RELA 0000000000000410 00000410 00000018 24 A 3 10 8
+[ 9] .init PROGBITS 0000000000000428 00000428 00000018 0 AX 0 0 4
+[10] .plt PROGBITS 0000000000000440 00000440 00000020 16 AX 0 0 16
+[11] .text PROGBITS 0000000000000460 00000460 00000128 0 AX 0 0 16
+[12] .fini PROGBITS 0000000000000588 00000588 0000000e 0 AX 0 0 4
+[13] .eh_frame_hdr PROGBITS 0000000000000598 00000598 00000024 0 A 0 0 4
+[14] .eh_frame PROGBITS 00000000000005c0 000005c0 00000084 0 A 0 0 8
+[15] .ctors PROGBITS 0000000000200648 00000648 00000010 0 WA 0 0 8
+[16] .dtors PROGBITS 0000000000200658 00000658 00000010 0 WA 0 0 8
+[17] .jcr PROGBITS 0000000000200668 00000668 00000008 0 WA 0 0 8
+[18] .data.rel.ro PROGBITS 0000000000200670 00000670 00000008 0 WA 0 0 8
+[19] .dynamic DYNAMIC 0000000000200678 00000678 00000180 16 WA 4 0 8
+[20] .got PROGBITS 00000000002007f8 000007f8 00000018 8 WA 0 0 8
+[21] .got.plt PROGBITS 0000000000200810 00000810 00000020 8 WA 0 0 8
+[22] .bss NOBITS 0000000000200830 00000830 00000010 0 WA 0 0 8
+[23] .comment PROGBITS 0000000000000000 00000830 0000002c 1 MS 0 0 1
+[24] .gnu_debuglink PROGBITS 0000000000000000 0000085c 00000014 0 0 0 4
+[25] .shstrtab STRTAB 0000000000000000 00000870 000000e6 0 0 0 1
+
+EOF
+echo readelf testfile.debug
+testrun_compare ${abs_top_builddir}/src/readelf -S testfile.debug <<\EOF
+There are 27 section headers, starting at offset 0x918:
+
+Section Headers:
+[Nr] Name Type Addr Off Size ES Flags Lk Inf Al
+[ 0] NULL 0000000000000000 00000000 00000000 0 0 0 0
+[ 1] .note.gnu.build-id NOTE 0000000000000190 00000190 00000024 0 A 0 0 4
+[ 2] .gnu.hash NOBITS 00000000000001b8 000001b8 0000003c 0 A 3 0 8
+[ 3] .dynsym NOBITS 00000000000001f8 000001b8 00000108 24 A 4 2 8
+[ 4] .dynstr NOBITS 0000000000000300 000001b8 00000077 0 A 0 0 1
+[ 5] .gnu.version NOBITS 0000000000000378 000001b8 00000016 2 A 3 0 2
+[ 6] .gnu.version_r NOBITS 0000000000000390 000001b8 00000020 0 A 4 1 8
+[ 7] .rela.dyn NOBITS 00000000000003b0 000001b8 00000060 24 A 3 0 8
+[ 8] .rela.plt NOBITS 0000000000000410 000001b8 00000018 24 A 3 10 8
+[ 9] .init NOBITS 0000000000000428 000001b8 00000018 0 AX 0 0 4
+[10] .plt NOBITS 0000000000000440 000001c0 00000020 16 AX 0 0 16
+[11] .text NOBITS 0000000000000460 000001c0 00000128 0 AX 0 0 16
+[12] .fini NOBITS 0000000000000588 000001c0 0000000e 0 AX 0 0 4
+[13] .eh_frame_hdr NOBITS 0000000000000598 000001c0 00000024 0 A 0 0 4
+[14] .eh_frame NOBITS 00000000000005c0 000001c0 00000084 0 A 0 0 8
+[15] .ctors NOBITS 0000000000200648 000001c0 00000010 0 WA 0 0 8
+[16] .dtors NOBITS 0000000000200658 000001c0 00000010 0 WA 0 0 8
+[17] .jcr NOBITS 0000000000200668 000001c0 00000008 0 WA 0 0 8
+[18] .data.rel.ro NOBITS 0000000000200670 000001c0 00000008 0 WA 0 0 8
+[19] .dynamic NOBITS 0000000000200678 000001c0 00000180 16 WA 4 0 8
+[20] .got NOBITS 00000000002007f8 000001c0 00000018 8 WA 0 0 8
+[21] .got.plt NOBITS 0000000000200810 000001c0 00000020 8 WA 0 0 8
+[22] .bss NOBITS 0000000000200830 000001c0 00000010 0 WA 0 0 8
+[23] .comment NOBITS 0000000000000000 000001c0 0000002c 1 MS 0 0 1
+[24] .shstrtab STRTAB 0000000000000000 000001c0 000000e7 0 0 0 1
+[25] .symtab SYMTAB 0000000000000000 000002a8 000004f8 24 26 44 8
+[26] .strtab STRTAB 0000000000000000 000007a0 00000175 0 0 0 1
+
+EOF
+
+exit 0
diff --git a/tests/run-strip-test.sh b/tests/run-strip-test.sh
index 43d27e5..280814e 100755
--- a/tests/run-strip-test.sh
+++ b/tests/run-strip-test.sh
@@ -34,13 +34,13 @@
cmp $stripped testfile.temp || status=$?
# Check elflint and the expected result.
-testrun ${abs_top_builddir}/src/elflint -q testfile.temp || status=$?
+testrun ${abs_top_builddir}/src/elflint --gnu -q testfile.temp || status=$?
test -z "$debugfile" || {
cmp $debugfile testfile.debug.temp || status=$?
# Check elflint and the expected result.
-testrun ${abs_top_builddir}/src/elflint -q -d testfile.debug.temp || status=$?
+testrun ${abs_top_builddir}/src/elflint --gnu -q -d testfile.debug.temp || status=$?
# Now test unstrip recombining those files.
testrun ${abs_top_builddir}/src/unstrip -o testfile.unstrip testfile.temp testfile.debug.temp
@@ -49,6 +49,14 @@
testrun ${abs_top_builddir}/src/elfcmp --hash-inexact $original testfile.unstrip
}
+# test strip -g
+testrun ${abs_top_builddir}/src/strip -g -o testfile.temp $original
+
+# Buggy eu-strip created multiple .shstrtab sections
+shstrtab_SECS=$(testrun ${abs_top_builddir}/src/readelf -S testfile.temp | grep '.shstrtab' | wc --lines)
+test $shstrtab_SECS -eq 1 ||
+ { echo "*** failure not just one '.shstrtab' testfile.temp ($shstrtab_SECS)"; status=1; }
+
# Now strip in-place and make sure it is smaller.
SIZE_original=$(stat -c%s $original)
testrun ${abs_top_builddir}/src/strip $original
diff --git a/tests/run-strip-test11.sh b/tests/run-strip-test11.sh
new file mode 100755
index 0000000..0b1b0ab
--- /dev/null
+++ b/tests/run-strip-test11.sh
@@ -0,0 +1,4 @@
+original=testfile-m68k
+stripped=testfile-m68k-s
+
+. $srcdir/run-strip-test.sh
diff --git a/tests/run-unit-info.sh b/tests/run-unit-info.sh
new file mode 100755
index 0000000..328fe78
--- /dev/null
+++ b/tests/run-unit-info.sh
@@ -0,0 +1,81 @@
+#! /bin/sh
+# Copyright (C) 2018 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/>.
+
+. $srcdir/test-subr.sh
+
+# See run-typeiter.sh
+testfiles testfile-debug-types
+
+testrun ${abs_builddir}/unit-info testfile-debug-types
+
+# see run-readelf-dwz-multi.sh
+testfiles testfile_multi_main testfile_multi.dwz
+
+testrun ${abs_builddir}/unit-info testfile_multi_main
+
+# see tests/run-dwflsyms.sh
+testfiles testfilebazdbgppc64.debug
+
+testrun ${abs_builddir}/unit-info testfilebazdbgppc64.debug
+
+# see tests/testfile-dwarf-45.source
+testfiles testfile-dwarf-4 testfile-dwarf-5
+testfiles testfile-splitdwarf-4 testfile-splitdwarf-5
+testfiles testfile-hello4.dwo testfile-hello5.dwo
+testfiles testfile-world4.dwo testfile-world5.dwo
+
+testrun ${abs_builddir}/unit-info testfile-dwarf-4
+testrun ${abs_builddir}/unit-info testfile-dwarf-5
+
+# The consistency checks should find most issue, but make sure the
+# output is also what we expect in case we break dwarf_get_units and
+# dwarf_cu_info at the same time.
+testrun_compare ${abs_builddir}/unit-info \
+ testfile-splitdwarf-4 testfile-splitdwarf-5 <<\EOF
+file: testfile-splitdwarf-4
+Iterate getting all info, compare with dwarf_cu_info.
+0 cu dietag: 11, subtag: 11, version 4, unit_type 4
+0 subdietag: 11, subtag: 0, version 4, unit_type 5
+1 cu dietag: 11, subtag: 11, version 4, unit_type 4
+1 subdietag: 11, subtag: 0, version 4, unit_type 5
+rechecking: testfile-splitdwarf-4
+Iterate no info, compare recorded info with dwarf_cu_info.
+0 re dietag: 11, subtag: 11, version 4, unit_type 4
+0 subdietag: 11, subtag: 0, version 4, unit_type 5
+1 re dietag: 11, subtag: 11, version 4, unit_type 4
+1 subdietag: 11, subtag: 0, version 4, unit_type 5
+
+file: testfile-splitdwarf-5
+Iterate getting all info, compare with dwarf_cu_info.
+0 cu dietag: 4a, subtag: 11, version 5, unit_type 4
+0 subdietag: 11, subtag: 0, version 5, unit_type 5
+1 cu dietag: 4a, subtag: 11, version 5, unit_type 4
+1 subdietag: 11, subtag: 0, version 5, unit_type 5
+rechecking: testfile-splitdwarf-5
+Iterate no info, compare recorded info with dwarf_cu_info.
+0 re dietag: 4a, subtag: 11, version 5, unit_type 4
+0 subdietag: 11, subtag: 0, version 5, unit_type 5
+1 re dietag: 4a, subtag: 11, version 5, unit_type 4
+1 subdietag: 11, subtag: 0, version 5, unit_type 5
+
+EOF
+
+# Self test (not on obj files, since those need relocation first).
+testrun_on_self_exe ${abs_builddir}/unit-info
+testrun_on_self_lib ${abs_builddir}/unit-info
+
+exit 0
diff --git a/tests/run-unstrip-test4.sh b/tests/run-unstrip-test4.sh
new file mode 100755
index 0000000..6ca5d0e
--- /dev/null
+++ b/tests/run-unstrip-test4.sh
@@ -0,0 +1,18 @@
+# Test whether unstrip can combine a stripped kernel object that has
+# limited .symtab/.strtab data, with a separate .debuginfo binary that
+# has full .symtab/.strtab data.
+#
+# This was generated as part of a Chromium OS kernel build:
+#
+# emerge-kevin chromeos-kernel-4_4
+#
+# Setup instructions:
+#
+# https://www.chromium.org/chromium-os/developer-guide
+# https://www.chromium.org/chromium-os/how-tos-and-troubleshooting/kernel-faq
+
+original=testfile-strtab
+stripped=testfile-strtab.stripped
+debugfile=testfile-strtab.debuginfo
+
+. $srcdir/run-unstrip-test.sh
diff --git a/tests/run-varlocs-self.sh b/tests/run-varlocs-self.sh
new file mode 100755
index 0000000..54b6a8d
--- /dev/null
+++ b/tests/run-varlocs-self.sh
@@ -0,0 +1,22 @@
+#! /bin/sh
+# 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 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/>.
+
+. $srcdir/test-subr.sh
+
+# Make sure varlocs doesn't crash, doesn't trigger self-check/asserts
+# or leaks running under valgrind.
+testrun_on_self_quiet ${abs_top_builddir}/tests/varlocs -e
diff --git a/tests/run-varlocs.sh b/tests/run-varlocs.sh
index 9c4b313..b262177 100755
--- a/tests/run-varlocs.sh
+++ b/tests/run-varlocs.sh
@@ -124,5 +124,481 @@
frame_base: {call_frame_cfa {bregx(7,8)}}
EOF
+# Multi CU DWARF5. See run-dwarf-ranges.sh.
+testfiles testfileranges5.debug
+testrun_compare ${abs_top_builddir}/tests/varlocs --debug -e testfileranges5.debug <<\EOF
+module 'testfileranges5.debug'
+[c] CU 'hello.c'@0
+ [2a] function 'no_say'@401160
+ frame_base: {call_frame_cfa {...}}
+ [4a] parameter 'prefix'
+ [401160,401169) {reg5}
+ [401169,40116a) {entry_value(1) {reg5}, stack_value}
+ [40116a,401175) {reg5}
+ [401175,40117a) {entry_value(1) {reg5}, stack_value}
+ [59] variable 'world'
+ [401160,40117a) {addr(0x402004), stack_value}
+ [bd] function 'main'@401050
+ frame_base: {call_frame_cfa {...}}
+ [dd] parameter 'argc'
+ [401050,401062) {reg5}
+ [401062,401067) {entry_value(1) {reg5}, stack_value}
+ [ec] parameter 'argv'
+ [401050,401066) {reg4}
+ [401066,401067) {entry_value(1) {reg4}, stack_value}
+ [fb] inlined function 'subject'@401053
+ [117] parameter 'count'
+ [401053,40105f) {reg5}
+ [120] parameter 'word'
+ [401053,40105f) {reg0}
+ [168] function 'subject'@401150
+ frame_base: {call_frame_cfa {...}}
+ [183] parameter 'word'
+ [401150,401160) {reg5}
+ [18a] parameter 'count'
+ [401150,401160) {reg4}
+module 'testfileranges5.debug'
+[1ab] CU 'world.c'@401180
+ [1cd] function 'no_main'@4011d0
+ frame_base: {call_frame_cfa {...}}
+ [1ef] parameter 'argc'
+ [4011d0,4011e2) {reg5}
+ [4011e2,4011e7) {entry_value(1) {reg5}, stack_value}
+ [1fe] parameter 'argv'
+ [4011d0,4011e6) {reg4}
+ [4011e6,4011e7) {entry_value(1) {reg4}, stack_value}
+ [20d] inlined function 'no_subject'@4011d3
+ [229] parameter 'count'
+ [4011d3,4011df) {reg5}
+ [232] parameter 'word'
+ [4011d3,4011df) {reg0}
+ [28d] function 'say'@401180
+ frame_base: {call_frame_cfa {...}}
+ [2af] parameter 'prefix'
+ [401180,40118e) {reg5}
+ [40118e,40119c) {reg3}
+ [40119c,4011a7) {entry_value(1) {reg5}, stack_value}
+ [4011a7,4011b5) {reg3}
+ [4011b5,4011c0) {entry_value(1) {reg5}, stack_value}
+ [2be] variable 'world'
+ [401193,40119b) {reg0}
+ [4011a7,4011b4) {reg0}
+ [2ce] inlined function 'happy'@40119b
+ [2e6] parameter 'w'
+ [4011a7,4011b4) {reg0}
+ [2ef] inlined function 'sad'@40119b
+ [303] parameter 'c'
+ [40119b,4011a6) {reg0}
+ [4011a6,4011a7) {entry_value(1) {reg5}}
+ [4011b4,4011bf) {reg0}
+ [36b] function 'no_subject'@4011c0
+ frame_base: {call_frame_cfa {...}}
+ [386] parameter 'word'
+ [4011c0,4011d0) {reg5}
+ [38d] parameter 'count'
+ [4011c0,4011d0) {reg4}
+EOF
+
+# Multi CU Split DWARF5. See run-dwarf-ranges.sh.
+# Note that the DIE numbers change, but the actual location addresses are
+# the same as above, even though the representation is totally different.
+testfiles testfilesplitranges5.debug
+testfiles testfile-ranges-hello5.dwo testfile-ranges-world5.dwo
+testrun_compare ${abs_top_builddir}/tests/varlocs --debug -e testfilesplitranges5.debug <<\EOF
+module 'testfilesplitranges5.debug'
+[14] CU 'hello.c'
+ [1d] function 'no_say'@401160
+ frame_base: {call_frame_cfa {...}}
+ [33] parameter 'prefix'
+ [401160,401169) {reg5}
+ [401169,40116a) {entry_value(1) {reg5}, stack_value}
+ [40116a,401175) {reg5}
+ [401175,40117a) {entry_value(1) {reg5}, stack_value}
+ [3c] variable 'world'
+ [401160,40117a) {addr: 0x402004, stack_value}
+ [7e] function 'main'@401050
+ frame_base: {call_frame_cfa {...}}
+ [94] parameter 'argc'
+ [401050,401062) {reg5}
+ [401062,401067) {entry_value(1) {reg5}, stack_value}
+ [9d] parameter 'argv'
+ [401050,401066) {reg4}
+ [401066,401067) {entry_value(1) {reg4}, stack_value}
+ [a6] inlined function 'subject'@401053
+ [bb] parameter 'count'
+ [401053,40105f) {reg5}
+ [c1] parameter 'word'
+ [401053,40105f) {reg0}
+ [f6] function 'subject'@401150
+ frame_base: {call_frame_cfa {...}}
+ [10a] parameter 'word'
+ [401150,401160) {reg5}
+ [111] parameter 'count'
+ [401150,401160) {reg4}
+module 'testfilesplitranges5.debug'
+[14] CU 'world.c'
+ [1d] function 'no_main'@4011d0
+ frame_base: {call_frame_cfa {...}}
+ [35] parameter 'argc'
+ [4011d0,4011e2) {reg5}
+ [4011e2,4011e7) {entry_value(1) {reg5}, stack_value}
+ [3e] parameter 'argv'
+ [4011d0,4011e6) {reg4}
+ [4011e6,4011e7) {entry_value(1) {reg4}, stack_value}
+ [47] inlined function 'no_subject'@4011d3
+ [5c] parameter 'count'
+ [4011d3,4011df) {reg5}
+ [62] parameter 'word'
+ [4011d3,4011df) {reg0}
+ [a7] function 'say'@401180
+ frame_base: {call_frame_cfa {...}}
+ [c2] parameter 'prefix'
+ [401180,40118e) {reg5}
+ [40118e,40119c) {reg3}
+ [40119c,4011a7) {entry_value(1) {reg5}, stack_value}
+ [4011a7,4011b5) {reg3}
+ [4011b5,4011c0) {entry_value(1) {reg5}, stack_value}
+ [cb] variable 'world'
+ [401193,40119b) {reg0}
+ [4011a7,4011b4) {reg0}
+ [d5] inlined function 'happy'@40119b
+ [e3] parameter 'w'
+ [4011a7,4011b4) {reg0}
+ [e9] inlined function 'sad'@40119b
+ [f3] parameter 'c'
+ [40119b,4011a6) {reg0}
+ [4011a6,4011a7) {entry_value(1) {reg5}}
+ [4011b4,4011bf) {reg0}
+ [147] function 'no_subject'@4011c0
+ frame_base: {call_frame_cfa {...}}
+ [15b] parameter 'word'
+ [4011c0,4011d0) {reg5}
+ [162] parameter 'count'
+ [4011c0,4011d0) {reg4}
+EOF
+
+# GNU DebugFissuon Multi CU Split DWARF. See run-dwarf-ranges.sh.
+testfiles testfilesplitranges4.debug
+testfiles testfile-ranges-hello.dwo testfile-ranges-world.dwo
+testrun_compare ${abs_top_builddir}/tests/varlocs --debug -e testfilesplitranges4.debug <<\EOF
+module 'testfilesplitranges4.debug'
+[b] CU 'hello.c'
+ [18] function 'no_say'@4004f0
+ frame_base: {call_frame_cfa {...}}
+ [2f] parameter 'prefix'
+ [4004f0,4004fa) {reg5}
+ [4004fa,4004ff) {GNU_entry_value(1) {reg5}, stack_value}
+ [3b] variable 'world'
+ <no value>
+ [60] function 'main'@4003e0
+ frame_base: {call_frame_cfa {...}}
+ [77] parameter 'argc'
+ [4003e0,4003f2) {reg5}
+ [4003f2,4003f7) {GNU_entry_value(1) {reg5}, stack_value}
+ [83] parameter 'argv'
+ [4003e0,4003f6) {reg4}
+ [4003f6,1004003f5) {GNU_entry_value(1) {reg4}, stack_value}
+ [8f] inlined function 'subject'@4003e3
+ [a3] parameter 'count'
+ [4003e3,4003ef) {reg5}
+ [ac] parameter 'word'
+ [4003e3,4003ef) {reg0}
+ [e7] function 'subject'@4004e0
+ frame_base: {call_frame_cfa {...}}
+ [fb] parameter 'word'
+ [4004e0,4004f0) {reg5}
+ [102] parameter 'count'
+ [4004e0,4004f0) {reg4}
+module 'testfilesplitranges4.debug'
+[b] CU 'world.c'
+ [18] function 'no_main'@400550
+ frame_base: {call_frame_cfa {...}}
+ [2f] parameter 'argc'
+ [400550,400562) {reg5}
+ [400562,400567) {GNU_entry_value(1) {reg5}, stack_value}
+ [3b] parameter 'argv'
+ [400550,400566) {reg4}
+ [400566,100400565) {GNU_entry_value(1) {reg4}, stack_value}
+ [47] inlined function 'no_subject'@400553
+ [5b] parameter 'count'
+ [400553,40055f) {reg5}
+ [64] parameter 'word'
+ [400553,40055f) {reg0}
+ [af] function 'say'@400500
+ frame_base: {call_frame_cfa {...}}
+ [c9] parameter 'prefix'
+ [400500,40050e) {reg5}
+ [40050e,40051c) {reg3}
+ [40051c,400527) {GNU_entry_value(1) {reg5}, stack_value}
+ [400527,400535) {reg3}
+ [400535,400540) {GNU_entry_value(1) {reg5}, stack_value}
+ [d5] variable 'world'
+ [400513,40051b) {reg0}
+ [400527,400534) {reg0}
+ [e1] inlined function 'happy'@40051c
+ [f1] parameter 'w'
+ [400527,400534) {reg0}
+ [fa] inlined function 'sad'@40051c
+ [106] parameter 'c'
+ [40051b,400526) {reg0}
+ [400526,400527) {GNU_entry_value(1) {reg5}}
+ [400534,40053f) {reg0}
+ [15c] function 'no_subject'@400540
+ frame_base: {call_frame_cfa {...}}
+ [170] parameter 'word'
+ [400540,400550) {reg5}
+ [177] parameter 'count'
+ [400540,400550) {reg4}
+EOF
+
+# DW_OP_addrx and DW_OP_constx testcases.
+#
+# int i, j, k;
+# __thread int l, m, n;
+#
+# int main ()
+# {
+# int r1 = i + j + k;
+# int r2 = l + m + n;
+# int res = r1 + r2;
+#
+# return res;
+# }
+#
+# gcc -O2 -gdwarf-5 -gsplit-dwarf -o addrx_constx-5.o -c addrx_constx.c
+# gcc -O2 -gdwarf-5 -gsplit-dwarf -o testfile-addrx_constx-5 addrx_constx-5.o
+# gcc -O2 -gdwarf-4 -gsplit-dwarf -o addrx_constx-4.o -c addrx_constx.c
+# gcc -O2 -gdwarf-4 -gsplit-dwarf -o testfile-addrx_constx-4 addrx_constx-4.o
+
+testfiles testfile-addrx_constx-5 addrx_constx-5.dwo
+testrun_compare ${abs_top_builddir}/tests/varlocs --exprlocs -e testfile-addrx_constx-5 <<\EOF
+module 'testfile-addrx_constx-5'
+[14] CU 'addrx_constx.c'
+ producer (strx)
+ language (data1)
+ name (strx)
+ comp_dir (strx)
+ [19] variable "i"
+ name (string)
+ decl_file (implicit_const)
+ decl_line (data1)
+ decl_column (data1)
+ type (ref4)
+ external (flag_present)
+ location (exprloc) {addr: 0x404038}
+ [25] base_type "int"
+ byte_size (data1)
+ encoding (data1)
+ name (string)
+ [2c] variable "j"
+ name (string)
+ decl_file (implicit_const)
+ decl_line (data1)
+ decl_column (data1)
+ type (ref4)
+ external (flag_present)
+ location (exprloc) {addr: 0x404034}
+ [38] variable "k"
+ name (string)
+ decl_file (implicit_const)
+ decl_line (data1)
+ decl_column (data1)
+ type (ref4)
+ external (flag_present)
+ location (exprloc) {addr: 0x40403c}
+ [44] variable "l"
+ name (string)
+ decl_file (implicit_const)
+ decl_line (data1)
+ decl_column (data1)
+ type (ref4)
+ external (flag_present)
+ location (exprloc) {const: 0x403e10, form_tls_address}
+ [51] variable "m"
+ name (string)
+ decl_file (implicit_const)
+ decl_line (data1)
+ decl_column (data1)
+ type (ref4)
+ external (flag_present)
+ location (exprloc) {const: 0x403e0c, form_tls_address}
+ [5e] variable "n"
+ name (string)
+ decl_file (implicit_const)
+ decl_line (data1)
+ decl_column (data1)
+ type (ref4)
+ external (flag_present)
+ location (exprloc) {const: 0x403e08, form_tls_address}
+ [6b] subprogram "main"
+ external (flag_present)
+ name (strx)
+ decl_file (data1)
+ decl_line (data1)
+ decl_column (data1)
+ type (ref4)
+ low_pc (addrx)
+ high_pc (data8)
+ frame_base (exprloc) {call_frame_cfa {bregx(7,8)}}
+ call_all_calls (flag_present)
+ [7f] variable "r1"
+ name (string)
+ decl_file (implicit_const)
+ decl_line (data1)
+ decl_column (implicit_const)
+ type (ref4)
+ location (exprloc) {addr: 0x404038, deref_size(4), addr: 0x404034, deref_size(4), plus, addr: 0x40403c, deref_size(4), plus, stack_value}
+ [98] variable "r2"
+ name (string)
+ decl_file (implicit_const)
+ decl_line (data1)
+ decl_column (implicit_const)
+ type (ref4)
+ location (exprloc) {form_tls_address, const: 0x403e10, deref_size(4), form_tls_address, const: 0x403e0c, deref_size(4), plus, form_tls_address, const: 0x403e08, deref_size(4), plus, stack_value}
+ [b4] variable "res"
+ name (string)
+ decl_file (implicit_const)
+ decl_line (data1)
+ decl_column (implicit_const)
+ type (ref4)
+ location (exprloc) {addr: 0x404038, deref_size(4), form_tls_address, const: 0x403e08, deref_size(4), plus, form_tls_address, const: 0x403e0c, deref_size(4), plus, form_tls_address, const: 0x403e10, deref_size(4), plus, addr: 0x404034, deref_size(4), plus, addr: 0x40403c, deref_size(4), plus, stack_value}
+EOF
+
+testfiles testfile-addrx_constx-4 addrx_constx-4.dwo
+testrun_compare ${abs_top_builddir}/tests/varlocs --exprlocs -e testfile-addrx_constx-4 <<\EOF
+module 'testfile-addrx_constx-4'
+[b] CU 'addrx_constx.c'
+ producer (GNU_str_index)
+ language (data1)
+ name (GNU_str_index)
+ comp_dir (GNU_str_index)
+ GNU_dwo_id (data8)
+ [18] variable "i"
+ name (string)
+ decl_file (data1)
+ decl_line (data1)
+ decl_column (data1)
+ type (ref4)
+ external (flag_present)
+ location (exprloc) {addr: 0x404038}
+ [25] base_type "int"
+ byte_size (data1)
+ encoding (data1)
+ name (string)
+ [2c] variable "j"
+ name (string)
+ decl_file (data1)
+ decl_line (data1)
+ decl_column (data1)
+ type (ref4)
+ external (flag_present)
+ location (exprloc) {addr: 0x404034}
+ [39] variable "k"
+ name (string)
+ decl_file (data1)
+ decl_line (data1)
+ decl_column (data1)
+ type (ref4)
+ external (flag_present)
+ location (exprloc) {addr: 0x40403c}
+ [46] variable "l"
+ name (string)
+ decl_file (data1)
+ decl_line (data1)
+ decl_column (data1)
+ type (ref4)
+ external (flag_present)
+ location (exprloc) {const: 0x403e10, GNU_push_tls_address}
+ [54] variable "m"
+ name (string)
+ decl_file (data1)
+ decl_line (data1)
+ decl_column (data1)
+ type (ref4)
+ external (flag_present)
+ location (exprloc) {const: 0x403e0c, GNU_push_tls_address}
+ [62] variable "n"
+ name (string)
+ decl_file (data1)
+ decl_line (data1)
+ decl_column (data1)
+ type (ref4)
+ external (flag_present)
+ location (exprloc) {const: 0x403e08, GNU_push_tls_address}
+ [70] subprogram "main"
+ external (flag_present)
+ name (GNU_str_index)
+ decl_file (data1)
+ decl_line (data1)
+ decl_column (data1)
+ type (ref4)
+ low_pc (GNU_addr_index)
+ high_pc (data8)
+ frame_base (exprloc) {call_frame_cfa {bregx(7,8)}}
+ GNU_all_call_sites (flag_present)
+ [84] variable "r1"
+ name (string)
+ decl_file (data1)
+ decl_line (data1)
+ decl_column (data1)
+ type (ref4)
+ location (exprloc) {addr: 0x404038, deref_size(4), addr: 0x404034, deref_size(4), plus, addr: 0x40403c, deref_size(4), plus, stack_value}
+ [9f] variable "r2"
+ name (string)
+ decl_file (data1)
+ decl_line (data1)
+ decl_column (data1)
+ type (ref4)
+ location (exprloc) {GNU_push_tls_address, const: 0x403e10, deref_size(4), GNU_push_tls_address, const: 0x403e0c, deref_size(4), plus, GNU_push_tls_address, const: 0x403e08, deref_size(4), plus, stack_value}
+ [bd] variable "res"
+ name (string)
+ decl_file (data1)
+ decl_line (data1)
+ decl_column (data1)
+ type (ref4)
+ location (exprloc) {addr: 0x404038, deref_size(4), GNU_push_tls_address, const: 0x403e08, deref_size(4), plus, GNU_push_tls_address, const: 0x403e0c, deref_size(4), plus, GNU_push_tls_address, const: 0x403e10, deref_size(4), plus, addr: 0x404034, deref_size(4), plus, addr: 0x40403c, deref_size(4), plus, stack_value}
+EOF
+
+# See run-readelf-loc.sh
+testfiles testfile-splitdwarf4-not-split4.debug
+testfiles splitdwarf4-not-split4.dwo
+
+testrun_compare ${abs_top_builddir}/tests/varlocs --debug -e testfile-splitdwarf4-not-split4.debug <<\EOF
+module 'testfile-splitdwarf4-not-split4.debug'
+[b] CU 'splitdwarf4-not-split4.c'
+ [18] function 'main'@401050
+ frame_base: {call_frame_cfa {...}}
+ [30] parameter 'argc'
+ [401050,40106e) {reg5}
+ [40106e,401086) {reg12}
+ [401086,401095) {GNU_entry_value(1) {reg5}, stack_value}
+ [401095,40109c) {reg5}
+ [3d] parameter 'argv'
+ [401050,40106e) {reg4}
+ [40106e,401095) {GNU_entry_value(1) {reg4}, stack_value}
+ [401095,40109c) {reg4}
+ [4a] variable 'i'
+ [401050,40106e) {lit0, stack_value}
+ [401086,40108e) {breg12(0), breg6(0), plus, stack_value}
+ [40108e,401095) {reg0}
+ [401095,40109c) {lit0, stack_value}
+ [58] variable 'p'
+ [401050,40106e) {reg5}
+ [40106e,401090) {reg6}
+ [401095,40109c) {reg5}
+module 'testfile-splitdwarf4-not-split4.debug'
+[3f] CU 'popcount.c'@401180
+ [61] function 'popcount'@401180
+ frame_base: {call_frame_cfa {...}}
+ [83] parameter 'u'
+ [401180,401189) {reg5}
+ [401189,40119b) {reg1}
+ [40119b,40119d) {breg1(0), lit1, shr, stack_value}
+ [40119d,4011a1) {reg1}
+ [91] variable 'c'
+ [401180,401189) {lit0, stack_value}
+ [401189,4011a0) {reg0}
+ [4011a0,4011a1) {lit0, stack_value}
+EOF
exit 0
diff --git a/tests/show-abbrev.c b/tests/show-abbrev.c
index b0af029..002ae25 100644
--- a/tests/show-abbrev.c
+++ b/tests/show-abbrev.c
@@ -51,6 +51,14 @@
/* Something went wrong. */
break;
+ /* Test something obviously wrong. */
+ Dwarf_Abbrev *a = dwarf_getabbrev (&die, (Dwarf_Off) -1, NULL);
+ if (a != NULL)
+ {
+ printf ("dwarf_getabbrev -1 succeeded?\n");
+ break;
+ }
+
Dwarf_Off offset = 0;
while (1)
diff --git a/tests/splitdwarf4-not-split4.dwo.bz2 b/tests/splitdwarf4-not-split4.dwo.bz2
new file mode 100644
index 0000000..4346b2e
--- /dev/null
+++ b/tests/splitdwarf4-not-split4.dwo.bz2
Binary files differ
diff --git a/tests/test-subr.sh b/tests/test-subr.sh
index f397aed..09f428d 100644
--- a/tests/test-subr.sh
+++ b/tests/test-subr.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2005-2015 Red Hat, Inc.
+# Copyright (C) 2005-2015, 2017 Red Hat, Inc.
# This file is part of elfutils.
#
# This file is free software; you can redistribute it and/or modify
@@ -115,16 +115,21 @@
echo "$*" | sed "${program_transform_name}"
}
-self_test_files=`echo ${abs_top_builddir}/src/addr2line \
-${abs_top_builddir}/src/elfcmp ${abs_top_builddir}/src/elflint \
-${abs_top_builddir}/src/nm ${abs_top_builddir}/src/objdump \
-${abs_top_builddir}/src/readelf \
-${abs_top_builddir}/src/size.o ${abs_top_builddir}/src/strip.o \
-${abs_top_builddir}/libelf/libelf.so \
+self_test_files_exe=`echo ${abs_top_builddir}/src/addr2line \
+${abs_top_builddir}/src/elfcmp \
+${abs_top_builddir}/src/objdump \
+${abs_top_builddir}/src/readelf`
+
+self_test_files_lib=`echo ${abs_top_builddir}/libelf/libelf.so \
${abs_top_builddir}/libdw/libdw.so \
${abs_top_builddir}/backends/libebl_i386.so \
${abs_top_builddir}/backends/libebl_x86_64.so`
+self_test_files_obj=`echo ${abs_top_builddir}/src/size.o \
+${abs_top_builddir}/src/strip.o`
+
+self_test_files="$self_test_files_exe $self_test_files_lib $self_test_files_obj"
+
# Provide a command to run on all self-test files with testrun.
testrun_on_self()
{
@@ -139,6 +144,50 @@
if test $exit_status != 0; then exit $exit_status; fi
}
+testrun_on_self_exe()
+{
+ exit_status=0
+
+ for file in $self_test_files_exe; do
+ testrun $* $file \
+ || { echo "*** failure in $* $file"; exit_status=1; }
+ done
+
+ # Only exit if something failed
+ if test $exit_status != 0; then exit $exit_status; fi
+}
+
+testrun_on_self_lib()
+{
+ exit_status=0
+
+ for file in $self_test_files_lib; do
+ testrun $* $file \
+ || { echo "*** failure in $* $file"; exit_status=1; }
+ done
+
+ # Only exit if something failed
+ if test $exit_status != 0; then exit $exit_status; fi
+}
+
+# Compress the files first. Compress both debug sections and symtab.
+testrun_on_self_compressed()
+{
+ exit_status=0
+
+ for file in $self_test_files; do
+ tempfiles ${file}z
+ testrun ${abs_top_builddir}/src/elfcompress -f -q -o ${file}z ${file}
+ testrun ${abs_top_builddir}/src/elfcompress -f -q --name='.s??tab' ${file}z
+
+ testrun $* ${file}z \
+ || { echo "*** failure in $* ${file}z"; exit_status=1; }
+ done
+
+ # Only exit if something failed
+ if test $exit_status != 0; then exit $exit_status; fi
+}
+
# Same as above, but redirects stdout to /dev/null
testrun_on_self_quiet()
{
diff --git a/tests/testfile-ada-variant.bz2 b/tests/testfile-ada-variant.bz2
new file mode 100644
index 0000000..459774d
--- /dev/null
+++ b/tests/testfile-ada-variant.bz2
Binary files differ
diff --git a/tests/testfile-addrx_constx-4.bz2 b/tests/testfile-addrx_constx-4.bz2
new file mode 100755
index 0000000..cf10fbb
--- /dev/null
+++ b/tests/testfile-addrx_constx-4.bz2
Binary files differ
diff --git a/tests/testfile-addrx_constx-5.bz2 b/tests/testfile-addrx_constx-5.bz2
new file mode 100755
index 0000000..eb2a1f1
--- /dev/null
+++ b/tests/testfile-addrx_constx-5.bz2
Binary files differ
diff --git a/tests/testfile-bpf-dis1.expect.bz2 b/tests/testfile-bpf-dis1.expect.bz2
new file mode 100644
index 0000000..21b55e9
--- /dev/null
+++ b/tests/testfile-bpf-dis1.expect.bz2
Binary files differ
diff --git a/tests/testfile-bpf-dis1.o.bz2 b/tests/testfile-bpf-dis1.o.bz2
new file mode 100644
index 0000000..94bb612
--- /dev/null
+++ b/tests/testfile-bpf-dis1.o.bz2
Binary files differ
diff --git a/tests/testfile-bpf-reloc.expect.bz2 b/tests/testfile-bpf-reloc.expect.bz2
new file mode 100644
index 0000000..0ff8cc4
--- /dev/null
+++ b/tests/testfile-bpf-reloc.expect.bz2
Binary files differ
diff --git a/tests/testfile-bpf-reloc.o.bz2 b/tests/testfile-bpf-reloc.o.bz2
new file mode 100644
index 0000000..295634f
--- /dev/null
+++ b/tests/testfile-bpf-reloc.o.bz2
Binary files differ
diff --git a/tests/testfile-const-values.debug.bz2 b/tests/testfile-const-values.debug.bz2
new file mode 100755
index 0000000..167da16
--- /dev/null
+++ b/tests/testfile-const-values.debug.bz2
Binary files differ
diff --git a/tests/testfile-dwarf-4.bz2 b/tests/testfile-dwarf-4.bz2
new file mode 100755
index 0000000..fd3aaea
--- /dev/null
+++ b/tests/testfile-dwarf-4.bz2
Binary files differ
diff --git a/tests/testfile-dwarf-45.source b/tests/testfile-dwarf-45.source
new file mode 100644
index 0000000..584c8f7
--- /dev/null
+++ b/tests/testfile-dwarf-45.source
@@ -0,0 +1,89 @@
+# Nonsensical program used to generate an example DWARF4 and DWARF5 file.
+# The generated code is the same, but the DWARF representation is different.
+
+# = hello.h =
+
+extern int m;
+extern int baz (int x);
+
+static inline int
+frob (int a, int b)
+{
+ int c = a;
+
+ if (a > b)
+ c -= b;
+
+ return baz (c);
+}
+
+# = hello.c =
+
+#include <stddef.h>
+#include "hello.h"
+
+extern int main (int, char **);
+int m = 2;
+
+wchar_t foo (wchar_t);
+int baz (int x)
+{
+ int r = x;
+
+ if (x > m)
+ r -= m;
+
+ r = foo (r);
+ return r;
+}
+
+wchar_t
+foo (wchar_t f)
+{
+ if (f < 0)
+ return main (f, NULL);
+
+ return f > 0 ? frob (f - 1, m) : 0;
+}
+
+# = world.c =
+
+#include "hello.h"
+#include <stdlib.h>
+
+int
+calc (const char *word)
+{
+ if (word == 0 || word[0] == '\0')
+ return 0;
+
+ return frob (word[0], m + 42);
+}
+
+int
+main (int argc, const char **argv)
+{
+ const char *n;
+ if (argc > 1)
+ n = argv[0];
+ else
+ n = "world";
+
+ exit (calc (n));
+}
+
+$ gcc -gdwarf-4 -gno-as-loc-support -gno-variable-location-views -O2 -c world.c
+$ gcc -gdwarf-4 -gno-as-loc-support -gno-variable-location-views -O2 -c hello.c
+$ gcc -o testfile-dwarf-4 hello.o world.o
+
+$ gcc -gdwarf-5 -gno-as-loc-support -gno-variable-location-views -O2 -c world.c
+$ gcc -gdwarf-5 -gno-as-loc-support -gno-variable-location-views -O2 -c hello.c
+$ gcc -o testfile-dwarf-5 hello.o world.o
+
+$ gcc -gdwarf-4 -gsplit-dwarf -gno-as-loc-support -gno-variable-location-views -O2 -o testfile-world4.o -c world.c
+$ gcc -gdwarf-4 -gsplit-dwarf -gno-as-loc-support -gno-variable-location-views -O2 -o testfile-hello4.o -c hello.c
+$ gcc -o testfile-splitdwarf-4 testfile-hello4.o testfile-world4.o
+
+$ gcc -gdwarf-5 -gsplit-dwarf -gno-as-loc-support -gno-variable-location-views -O2 -o testfile-world5.o -c world.c
+$ gcc -gdwarf-5 -gsplit-dwarf -gno-as-loc-support -gno-variable-location-views -O2 -o testfile-hello5.o -c hello.c
+$ gcc -o testfile-splitdwarf-5 testfile-hello5.o testfile-world5.o
diff --git a/tests/testfile-dwarf-5.bz2 b/tests/testfile-dwarf-5.bz2
new file mode 100755
index 0000000..689fa4f
--- /dev/null
+++ b/tests/testfile-dwarf-5.bz2
Binary files differ
diff --git a/tests/testfile-hello4.dwo.bz2 b/tests/testfile-hello4.dwo.bz2
new file mode 100644
index 0000000..fe02d65
--- /dev/null
+++ b/tests/testfile-hello4.dwo.bz2
Binary files differ
diff --git a/tests/testfile-hello5.dwo.bz2 b/tests/testfile-hello5.dwo.bz2
new file mode 100644
index 0000000..e911375
--- /dev/null
+++ b/tests/testfile-hello5.dwo.bz2
Binary files differ
diff --git a/tests/testfile-m68k-core.bz2 b/tests/testfile-m68k-core.bz2
new file mode 100644
index 0000000..eda79d7
--- /dev/null
+++ b/tests/testfile-m68k-core.bz2
Binary files differ
diff --git a/tests/testfile-m68k-s.bz2 b/tests/testfile-m68k-s.bz2
new file mode 100755
index 0000000..44c3799
--- /dev/null
+++ b/tests/testfile-m68k-s.bz2
Binary files differ
diff --git a/tests/testfile-m68k.bz2 b/tests/testfile-m68k.bz2
new file mode 100755
index 0000000..97a1b28
--- /dev/null
+++ b/tests/testfile-m68k.bz2
Binary files differ
diff --git a/tests/testfile-nobitsalign.bz2 b/tests/testfile-nobitsalign.bz2
new file mode 100755
index 0000000..7f0d424
--- /dev/null
+++ b/tests/testfile-nobitsalign.bz2
Binary files differ
diff --git a/tests/testfile-nobitsalign.strip.bz2 b/tests/testfile-nobitsalign.strip.bz2
new file mode 100755
index 0000000..f72000c
--- /dev/null
+++ b/tests/testfile-nobitsalign.strip.bz2
Binary files differ
diff --git a/tests/testfile-only-debug-line.bz2 b/tests/testfile-only-debug-line.bz2
new file mode 100644
index 0000000..a931bcd
--- /dev/null
+++ b/tests/testfile-only-debug-line.bz2
Binary files differ
diff --git a/tests/testfile-ppc64-min-instr.bz2 b/tests/testfile-ppc64-min-instr.bz2
new file mode 100755
index 0000000..85bef57
--- /dev/null
+++ b/tests/testfile-ppc64-min-instr.bz2
Binary files differ
diff --git a/tests/testfile-ranges-hello.dwo.bz2 b/tests/testfile-ranges-hello.dwo.bz2
new file mode 100644
index 0000000..fac2467
--- /dev/null
+++ b/tests/testfile-ranges-hello.dwo.bz2
Binary files differ
diff --git a/tests/testfile-ranges-hello5.dwo.bz2 b/tests/testfile-ranges-hello5.dwo.bz2
new file mode 100644
index 0000000..5e6e9e2
--- /dev/null
+++ b/tests/testfile-ranges-hello5.dwo.bz2
Binary files differ
diff --git a/tests/testfile-ranges-world.dwo.bz2 b/tests/testfile-ranges-world.dwo.bz2
new file mode 100644
index 0000000..27ad06d
--- /dev/null
+++ b/tests/testfile-ranges-world.dwo.bz2
Binary files differ
diff --git a/tests/testfile-ranges-world5.dwo.bz2 b/tests/testfile-ranges-world5.dwo.bz2
new file mode 100644
index 0000000..6bde196
--- /dev/null
+++ b/tests/testfile-ranges-world5.dwo.bz2
Binary files differ
diff --git a/tests/testfile-s390x-hash-both.bz2 b/tests/testfile-s390x-hash-both.bz2
new file mode 100755
index 0000000..86e0bcc
--- /dev/null
+++ b/tests/testfile-s390x-hash-both.bz2
Binary files differ
diff --git a/tests/testfile-sizes3.o.bz2 b/tests/testfile-sizes3.o.bz2
index 7fa6a8a..8633382 100644
--- a/tests/testfile-sizes3.o.bz2
+++ b/tests/testfile-sizes3.o.bz2
Binary files differ
diff --git a/tests/testfile-sizes4.o.bz2 b/tests/testfile-sizes4.o.bz2
new file mode 100644
index 0000000..046e0a2
--- /dev/null
+++ b/tests/testfile-sizes4.o.bz2
Binary files differ
diff --git a/tests/testfile-sizes4.s b/tests/testfile-sizes4.s
new file mode 100644
index 0000000..a243021
--- /dev/null
+++ b/tests/testfile-sizes4.s
@@ -0,0 +1,77 @@
+ .section .debug_info
+.Lcu1_begin:
+ .4byte .Lcu1_end - .Lcu1_start
+.Lcu1_start:
+ .2byte 4 /* Version */
+ .4byte .Labbrev1_begin /* Abbrevs */
+ .byte 8 /* Pointer size */
+ .uleb128 2 /* Abbrev (DW_TAG_compile_unit) */
+ .uleb128 3 /* Abbrev (DW_TAG_variable) */
+ .ascii "v\0"
+ .4byte .Llabel1 - .Lcu1_begin
+.Llabel1:
+ .uleb128 4 /* Abbrev (DW_TAG_array_type) */
+ .4byte .Llabel2 - .Lcu1_begin
+ .uleb128 5 /* Abbrev (DW_TAG_subrange_type) */
+ .byte -1
+ .2byte 255
+ .byte 0x0 /* Terminate children */
+.Llabel2:
+ .uleb128 6 /* Abbrev (DW_TAG_base_type) */
+ .byte 1
+ .byte 0x0 /* Terminate children */
+.Lcu1_end:
+ .section .note.gnu.build-id, "a", %note
+ .4byte 4
+ .4byte 8
+ .4byte 3
+ .ascii "GNU\0"
+ .byte 0x01
+ .byte 0x02
+ .byte 0x03
+ .byte 0x04
+ .byte 0x05
+ .byte 0x06
+ .byte 0x07
+ .byte 0x08
+ .section .debug_abbrev
+.Labbrev1_begin:
+ .uleb128 2 /* Abbrev start */
+ .uleb128 0x11 /* DW_TAG_compile_unit */
+ .byte 1 /* has_children */
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
+ .uleb128 3 /* Abbrev start */
+ .uleb128 0x34 /* DW_TAG_variable */
+ .byte 0 /* has_children */
+ .uleb128 0x03 /* DW_AT_name */
+ .uleb128 0x08 /* DW_FORM_string */
+ .uleb128 0x49 /* DW_AT_type */
+ .uleb128 0x13 /* DW_FORM_ref4 */
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
+ .uleb128 4 /* Abbrev start */
+ .uleb128 0x01 /* DW_TAG_array_type */
+ .byte 1 /* has_children */
+ .uleb128 0x49 /* DW_AT_type */
+ .uleb128 0x13 /* DW_FORM_ref4 */
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
+ .uleb128 5 /* Abbrev start */
+ .uleb128 0x21 /* DW_TAG_subrange_type */
+ .byte 0 /* has_children */
+ .uleb128 0x22 /* DW_AT_lower_bound */
+ .uleb128 0x0b /* DW_FORM_data1 */
+ .uleb128 0x2f /* DW_AT_upper_bound */
+ .uleb128 0x05 /* DW_FORM_data2 */
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
+ .uleb128 6 /* Abbrev start */
+ .uleb128 0x24 /* DW_TAG_base_type */
+ .byte 0 /* has_children */
+ .uleb128 0x0b /* DW_AT_byte_size */
+ .uleb128 0x0b /* DW_FORM_data1 */
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
diff --git a/tests/testfile-splitdwarf-4.bz2 b/tests/testfile-splitdwarf-4.bz2
new file mode 100755
index 0000000..a1871e6
--- /dev/null
+++ b/tests/testfile-splitdwarf-4.bz2
Binary files differ
diff --git a/tests/testfile-splitdwarf-5.bz2 b/tests/testfile-splitdwarf-5.bz2
new file mode 100755
index 0000000..27ff3bd
--- /dev/null
+++ b/tests/testfile-splitdwarf-5.bz2
Binary files differ
diff --git a/tests/testfile-splitdwarf4-not-split4.debug.bz2 b/tests/testfile-splitdwarf4-not-split4.debug.bz2
new file mode 100755
index 0000000..6f4d701
--- /dev/null
+++ b/tests/testfile-splitdwarf4-not-split4.debug.bz2
Binary files differ
diff --git a/tests/testfile-stridex.bz2 b/tests/testfile-stridex.bz2
new file mode 100755
index 0000000..ff909f4
--- /dev/null
+++ b/tests/testfile-stridex.bz2
Binary files differ
diff --git a/tests/testfile-strtab.bz2 b/tests/testfile-strtab.bz2
new file mode 100644
index 0000000..4eda14d
--- /dev/null
+++ b/tests/testfile-strtab.bz2
Binary files differ
diff --git a/tests/testfile-strtab.debuginfo.bz2 b/tests/testfile-strtab.debuginfo.bz2
new file mode 100644
index 0000000..6fb8164
--- /dev/null
+++ b/tests/testfile-strtab.debuginfo.bz2
Binary files differ
diff --git a/tests/testfile-strtab.stripped.bz2 b/tests/testfile-strtab.stripped.bz2
new file mode 100644
index 0000000..779bfdb
--- /dev/null
+++ b/tests/testfile-strtab.stripped.bz2
Binary files differ
diff --git a/tests/testfile-world4.dwo.bz2 b/tests/testfile-world4.dwo.bz2
new file mode 100644
index 0000000..297fe5f
--- /dev/null
+++ b/tests/testfile-world4.dwo.bz2
Binary files differ
diff --git a/tests/testfile-world5.dwo.bz2 b/tests/testfile-world5.dwo.bz2
new file mode 100644
index 0000000..d5c852c
--- /dev/null
+++ b/tests/testfile-world5.dwo.bz2
Binary files differ
diff --git a/tests/testfile11-debugframe.bz2 b/tests/testfile11-debugframe.bz2
new file mode 100644
index 0000000..5c07d16
--- /dev/null
+++ b/tests/testfile11-debugframe.bz2
Binary files differ
diff --git a/tests/testfile12-debugframe.bz2 b/tests/testfile12-debugframe.bz2
new file mode 100644
index 0000000..b8cc19c
--- /dev/null
+++ b/tests/testfile12-debugframe.bz2
Binary files differ
diff --git a/tests/testfileaarch64-debugframe.bz2 b/tests/testfileaarch64-debugframe.bz2
new file mode 100755
index 0000000..e77494a
--- /dev/null
+++ b/tests/testfileaarch64-debugframe.bz2
Binary files differ
diff --git a/tests/testfilearm-debugframe.bz2 b/tests/testfilearm-debugframe.bz2
new file mode 100755
index 0000000..51ce2d3
--- /dev/null
+++ b/tests/testfilearm-debugframe.bz2
Binary files differ
diff --git a/tests/testfileppc32-debugframe.bz2 b/tests/testfileppc32-debugframe.bz2
new file mode 100755
index 0000000..b6ae4ea
--- /dev/null
+++ b/tests/testfileppc32-debugframe.bz2
Binary files differ
diff --git a/tests/testfileppc64-debugframe.bz2 b/tests/testfileppc64-debugframe.bz2
new file mode 100755
index 0000000..85c80ac
--- /dev/null
+++ b/tests/testfileppc64-debugframe.bz2
Binary files differ
diff --git a/tests/testfileppc64attrs.o.bz2 b/tests/testfileppc64attrs.o.bz2
new file mode 100644
index 0000000..5af2ab6
--- /dev/null
+++ b/tests/testfileppc64attrs.o.bz2
Binary files differ
diff --git a/tests/testfileranges4.debug.bz2 b/tests/testfileranges4.debug.bz2
new file mode 100755
index 0000000..67ba573
--- /dev/null
+++ b/tests/testfileranges4.debug.bz2
Binary files differ
diff --git a/tests/testfileranges5.debug.bz2 b/tests/testfileranges5.debug.bz2
new file mode 100755
index 0000000..ef28efc
--- /dev/null
+++ b/tests/testfileranges5.debug.bz2
Binary files differ
diff --git a/tests/testfilesparc64attrs.o.bz2 b/tests/testfilesparc64attrs.o.bz2
new file mode 100644
index 0000000..7be7f88
--- /dev/null
+++ b/tests/testfilesparc64attrs.o.bz2
Binary files differ
diff --git a/tests/testfilesplitranges4.debug.bz2 b/tests/testfilesplitranges4.debug.bz2
new file mode 100755
index 0000000..df8e3ac
--- /dev/null
+++ b/tests/testfilesplitranges4.debug.bz2
Binary files differ
diff --git a/tests/testfilesplitranges5.debug.bz2 b/tests/testfilesplitranges5.debug.bz2
new file mode 100755
index 0000000..5796cbf
--- /dev/null
+++ b/tests/testfilesplitranges5.debug.bz2
Binary files differ
diff --git a/tests/unit-info.c b/tests/unit-info.c
new file mode 100644
index 0000000..4fb9a98
--- /dev/null
+++ b/tests/unit-info.c
@@ -0,0 +1,323 @@
+/* Test dwarf_cu_info properties.
+ Copyright (C) 2018 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/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <dwarf.h>
+#include ELFUTILS_HEADER(dw)
+#include <stdio.h>
+#include <inttypes.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+/* Yeah, lazy, 16K CUs should be enough for everybody... */
+#define MAX_UNITS 16384
+struct info
+{
+ int dietag;
+ int subtag;
+ Dwarf_Half version;
+ uint8_t unit_type;
+ uint64_t id;
+ uint8_t addr_size;
+ uint8_t off_size;
+};
+static struct info unit_info[MAX_UNITS];
+
+int
+main (int argc, char *argv[])
+{
+ for (int i = 1; i < argc; i++)
+ {
+ printf ("file: %s\n", argv[i]);
+ int fd = open (argv[i], O_RDONLY);
+ Dwarf *dbg = dwarf_begin (fd, DWARF_C_READ);
+ if (dbg == NULL)
+ {
+ printf ("%s not usable: %s\n", argv[i], dwarf_errmsg (-1));
+ return -1;
+ }
+
+ Dwarf_CU *cu = NULL;
+ Dwarf_Half version;
+ Dwarf_Die cudie, subdie;
+ uint8_t unit_type;
+ size_t u, units;
+ u = units = 0;
+ printf ("Iterate getting all info, compare with dwarf_cu_info.\n");
+ while (dwarf_get_units (dbg, cu, &cu, &version,
+ &unit_type, &cudie, &subdie) == 0)
+ {
+ int dietag = dwarf_tag (&cudie);
+ int subtag = dwarf_tag (&subdie);
+
+ unit_info[u].dietag = dietag;
+ unit_info[u].subtag = subtag;
+ unit_info[u].version = version;
+ unit_info[u].unit_type = unit_type;
+
+ printf ("%zu cu dietag: %x, subtag: %x, version %" PRIx32
+ ", unit_type %" PRIx8 "\n",
+ u, dietag, subtag, version, unit_type);
+
+ uint64_t unit_id;
+ uint8_t addr_size, off_size;
+ if (dwarf_cu_info (cu,
+ &version, &unit_type, &cudie, &subdie,
+ &unit_id, &addr_size, &off_size) != 0)
+ {
+ printf ("Invalid dwarf_cu_info: %s\n", dwarf_errmsg (-1));
+ return -1;
+ }
+
+ dietag = dwarf_tag (&cudie);
+ subtag = dwarf_tag (&subdie);
+
+ if (unit_info[u].dietag != dietag)
+ {
+ printf("Unequal dietags\n");
+ return -1;
+ }
+
+ if (unit_info[u].subtag != subtag)
+ {
+ printf("Unequal subtags\n");
+ return -1;
+ }
+
+ if (unit_info[u].version != version)
+ {
+ printf("Unequal versions\n");
+ return -1;
+ }
+
+ if (unit_info[u].unit_type != unit_type)
+ {
+ printf("Unequal unit_types\n");
+ return -1;
+ }
+
+ unit_info[u].id = unit_id;
+ unit_info[u].addr_size = addr_size;
+ unit_info[u].off_size = off_size;
+
+ if (unit_type == DW_UT_skeleton)
+ {
+ if (dwarf_cu_info (subdie.cu,
+ &version, &unit_type, &cudie, &subdie,
+ &unit_id, &addr_size, &off_size) != 0)
+ {
+ printf ("Invalid subdie dwarf_cu_info: %s\n",
+ dwarf_errmsg (-1));
+ return -1;
+ }
+
+ dietag = dwarf_tag (&cudie);
+ subtag = dwarf_tag (&subdie);
+
+ printf ("%zu subdietag: %x, subtag: %x, version %" PRIx32
+ ", unit_type %" PRIx8 "\n",
+ u, dietag, subtag, version, unit_type);
+
+ /* subdie is now cudie. */
+ if (unit_info[u].subtag != dietag)
+ {
+ printf ("Inconsistent subdie tag\n");
+ return -1;
+ }
+
+ if (unit_info[u].id != unit_id)
+ {
+ printf ("Unequal subdie ids\n");
+ return -1;
+ }
+
+ if (unit_info[u].addr_size != addr_size)
+ {
+ printf ("Unequal subdie addr_size\n");
+ return -1;
+ }
+
+ if (unit_info[u].off_size != off_size)
+ {
+ printf ("Unequal subdie off_size\n");
+ return -1;
+ }
+ }
+
+ if (u >= MAX_UNITS)
+ {
+ printf ("Oops, more than 16K units...\n");
+ return -1;
+ }
+ u = ++units;
+ }
+
+ dwarf_end (dbg);
+ close (fd);
+
+ /* And again... */
+ printf ("rechecking: %s\n", argv[i]);
+ fd = open (argv[i], O_RDONLY);
+ dbg = dwarf_begin (fd, DWARF_C_READ);
+ if (dbg == NULL)
+ {
+ printf ("%s not usable: %s\n", argv[i], dwarf_errmsg (-1));
+ return -1;
+ }
+
+ cu = NULL;
+ u = 0;
+ printf ("Iterate no info, compare recorded info with dwarf_cu_info.\n");
+ while (dwarf_get_units (dbg, cu, &cu, NULL, NULL, NULL, NULL) == 0)
+ {
+ if (u > units)
+ {
+ printf ("Got too many units???\n");
+ return -1;
+ }
+
+ uint64_t unit_id;
+ uint8_t addr_size, off_size;
+ if (dwarf_cu_info (cu,
+ &version, &unit_type, &cudie, &subdie,
+ &unit_id, &addr_size, &off_size) != 0)
+ {
+ printf ("Invalid dwarf_cu_info: %s\n", dwarf_errmsg (-1));
+ return -1;
+ }
+
+ int dietag = dwarf_tag (&cudie);
+ int subtag = dwarf_tag (&subdie);
+
+ printf ("%zu re dietag: %x, subtag: %x, version %" PRIx32
+ ", unit_type %" PRIx8 "\n",
+ u, dietag, subtag, version, unit_type);
+
+ if (unit_info[u].dietag != dietag)
+ {
+ printf("Unequal dietags %x != %x\n", unit_info[u].dietag, dietag);
+ return -1;
+ }
+
+ if (unit_info[u].subtag != subtag)
+ {
+ printf("Unequal subtags\n");
+ return -1;
+ }
+
+ if (unit_info[u].version != version)
+ {
+ printf("Unequal versions\n");
+ return -1;
+ }
+
+ if (unit_info[u].unit_type != unit_type)
+ {
+ printf("Unequal unit_types\n");
+ return -1;
+ }
+
+ if (unit_info[u].id != unit_id)
+ {
+ printf ("Unequal subdie ids\n");
+ return -1;
+ }
+
+ if (unit_info[u].addr_size != addr_size)
+ {
+ printf ("Unequal subdie addr_size\n");
+ return -1;
+ }
+
+ if (unit_info[u].off_size != off_size)
+ {
+ printf ("Unequal subdie off_size\n");
+ return -1;
+ }
+
+ if (unit_type == DW_UT_skeleton)
+ {
+ if (dwarf_cu_info (subdie.cu,
+ &version, &unit_type, &cudie, &subdie,
+ &unit_id, &addr_size, &off_size) != 0)
+ {
+ printf ("Invalid subdie dwarf_cu_info: %s\n",
+ dwarf_errmsg (-1));
+ return -1;
+ }
+
+ dietag = dwarf_tag (&cudie);
+ subtag = dwarf_tag (&subdie);
+
+ printf ("%zu subdietag: %x, subtag: %x, version %" PRIx32
+ ", unit_type %" PRIx8 "\n",
+ u, dietag, subtag, version, unit_type);
+
+ /* subdie is now cudie. */
+ subtag = dwarf_tag (&cudie);
+ if (unit_info[u].subtag != subtag)
+ {
+ printf ("Inconsistent subdie tag\n");
+ return -1;
+ }
+
+ if (unit_info[u].id != unit_id)
+ {
+ printf ("Unequal subdie ids\n");
+ return -1;
+ }
+
+ if (unit_info[u].addr_size != addr_size)
+ {
+ printf ("Unequal subdie addr_size\n");
+ return -1;
+ }
+
+ if (unit_info[u].off_size != off_size)
+ {
+ printf ("Unequal subdie off_size\n");
+ return -1;
+ }
+ }
+
+ if (u >= MAX_UNITS)
+ {
+ printf ("Oops, more than 16K units...\n");
+ return -1;
+ }
+ u++;
+ }
+
+ if (u != units)
+ {
+ printf ("Got not enough units???\n");
+ return -1;
+ }
+
+ dwarf_end (dbg);
+ close (fd);
+
+ printf ("\n");
+ }
+
+ return 0;
+}
diff --git a/tests/update3.c b/tests/update3.c
index d760687..7a4224d 100644
--- a/tests/update3.c
+++ b/tests/update3.c
@@ -1,5 +1,5 @@
/* Test program for elf_update function.
- Copyright (C) 2000, 2002, 2005 Red Hat, Inc.
+ Copyright (C) 2000, 2002, 2005, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2000.
@@ -28,7 +28,7 @@
#include <string.h>
#include <unistd.h>
-#include ELFUTILS_HEADER(ebl)
+#include ELFUTILS_HEADER(dwelf)
int
@@ -42,8 +42,8 @@
Elf_Scn *scn;
Elf32_Shdr *shdr;
Elf_Data *data;
- struct Ebl_Strtab *shst;
- struct Ebl_Strent *shstrtabse;
+ Dwelf_Strtab *shst;
+ Dwelf_Strent *shstrtabse;
int i;
fd = open (fname, O_RDWR | O_CREAT | O_TRUNC, 0666);
@@ -107,7 +107,7 @@
phdr[0].p_type = PT_PHDR;
elf_flagphdr (elf, ELF_C_SET, ELF_F_DIRTY);
- shst = ebl_strtabinit (true);
+ shst = dwelf_strtab_init (true);
scn = elf_newscn (elf);
if (scn == NULL)
@@ -122,7 +122,7 @@
exit (1);
}
- shstrtabse = ebl_strtabadd (shst, ".shstrtab", 0);
+ shstrtabse = dwelf_strtab_add (shst, ".shstrtab");
shdr->sh_type = SHT_STRTAB;
shdr->sh_flags = 0;
@@ -143,9 +143,9 @@
}
/* No more sections, finalize the section header string table. */
- ebl_strtabfinalize (shst, data);
+ dwelf_strtab_finalize (shst, data);
- shdr->sh_name = ebl_strtaboffset (shstrtabse);
+ shdr->sh_name = dwelf_strent_off (shstrtabse);
/* Let the library compute the internal structure information. */
if (elf_update (elf, ELF_C_NULL) < 0)
@@ -173,7 +173,7 @@
}
/* We don't need the string table anymore. */
- ebl_strtabfree (shst);
+ dwelf_strtab_free (shst);
/* And the data allocated in the .shstrtab section. */
free (data->d_buf);
diff --git a/tests/update4.c b/tests/update4.c
index 85de6c3..a9bd4bf 100644
--- a/tests/update4.c
+++ b/tests/update4.c
@@ -1,5 +1,5 @@
/* Test program for elf_update function.
- Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc.
+ Copyright (C) 2000, 2001, 2002, 2005, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2000.
@@ -28,7 +28,7 @@
#include <string.h>
#include <unistd.h>
-#include ELFUTILS_HEADER(ebl)
+#include ELFUTILS_HEADER(dwelf)
int
@@ -42,12 +42,12 @@
Elf_Scn *scn;
Elf32_Shdr *shdr;
Elf_Data *data;
- struct Ebl_Strtab *shst;
- struct Ebl_Strent *firstse;
- struct Ebl_Strent *secondse;
- struct Ebl_Strent *thirdse;
- struct Ebl_Strent *fourthse;
- struct Ebl_Strent *shstrtabse;
+ Dwelf_Strtab *shst;
+ Dwelf_Strent *firstse;
+ Dwelf_Strent *secondse;
+ Dwelf_Strent *thirdse;
+ Dwelf_Strent *fourthse;
+ Dwelf_Strent *shstrtabse;
int i;
fd = open (fname, O_RDWR | O_CREAT | O_TRUNC, 0666);
@@ -111,7 +111,7 @@
phdr[0].p_type = PT_PHDR;
elf_flagphdr (elf, ELF_C_SET, ELF_F_DIRTY);
- shst = ebl_strtabinit (true);
+ shst = dwelf_strtab_init (true);
scn = elf_newscn (elf);
if (scn == NULL)
@@ -126,7 +126,7 @@
exit (1);
}
- firstse = ebl_strtabadd (shst, ".first", 0);
+ firstse = dwelf_strtab_add (shst, ".first");
shdr->sh_type = SHT_PROGBITS;
shdr->sh_flags = SHF_ALLOC | SHF_EXECINSTR;
@@ -162,7 +162,7 @@
exit (1);
}
- secondse = ebl_strtabadd (shst, ".second", 0);
+ secondse = dwelf_strtab_add (shst, ".second");
shdr->sh_type = SHT_PROGBITS;
shdr->sh_flags = SHF_ALLOC | SHF_WRITE;
@@ -198,7 +198,7 @@
exit (1);
}
- thirdse = ebl_strtabadd (shst, ".third", 0);
+ thirdse = dwelf_strtab_add (shst, ".third");
shdr->sh_type = SHT_PROGBITS;
shdr->sh_flags = SHF_ALLOC | SHF_EXECINSTR;
@@ -234,7 +234,7 @@
exit (1);
}
- fourthse = ebl_strtabadd (shst, ".fourth", 0);
+ fourthse = dwelf_strtab_add (shst, ".fourth");
shdr->sh_type = SHT_NOBITS;
shdr->sh_flags = SHF_ALLOC | SHF_EXECINSTR;
@@ -271,7 +271,7 @@
exit (1);
}
- shstrtabse = ebl_strtabadd (shst, ".shstrtab", 0);
+ shstrtabse = dwelf_strtab_add (shst, ".shstrtab");
shdr->sh_type = SHT_STRTAB;
shdr->sh_flags = 0;
@@ -291,13 +291,13 @@
}
/* No more sections, finalize the section header string table. */
- ebl_strtabfinalize (shst, data);
+ dwelf_strtab_finalize (shst, data);
- elf32_getshdr (elf_getscn (elf, 1))->sh_name = ebl_strtaboffset (firstse);
- elf32_getshdr (elf_getscn (elf, 2))->sh_name = ebl_strtaboffset (secondse);
- elf32_getshdr (elf_getscn (elf, 3))->sh_name = ebl_strtaboffset (thirdse);
- elf32_getshdr (elf_getscn (elf, 4))->sh_name = ebl_strtaboffset (fourthse);
- shdr->sh_name = ebl_strtaboffset (shstrtabse);
+ elf32_getshdr (elf_getscn (elf, 1))->sh_name = dwelf_strent_off (firstse);
+ elf32_getshdr (elf_getscn (elf, 2))->sh_name = dwelf_strent_off (secondse);
+ elf32_getshdr (elf_getscn (elf, 3))->sh_name = dwelf_strent_off (thirdse);
+ elf32_getshdr (elf_getscn (elf, 4))->sh_name = dwelf_strent_off (fourthse);
+ shdr->sh_name = dwelf_strent_off (shstrtabse);
/* Let the library compute the internal structure information. */
if (elf_update (elf, ELF_C_NULL) < 0)
@@ -325,7 +325,7 @@
}
/* We don't need the string table anymore. */
- ebl_strtabfree (shst);
+ dwelf_strtab_free (shst);
/* And the data allocated in the .shstrtab section. */
free (data->d_buf);
diff --git a/tests/varlocs.c b/tests/varlocs.c
index c3fba89..2512439 100644
--- a/tests/varlocs.c
+++ b/tests/varlocs.c
@@ -1,5 +1,5 @@
/* Test program for dwarf location functions.
- Copyright (C) 2013, 2015 Red Hat, Inc.
+ Copyright (C) 2013, 2015, 2017, 2018 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -39,9 +39,13 @@
// Needed for DW_OP_call_frame_cfa.
static Dwarf *dw;
Dwarf_CFI *cfi_debug;
+Dwarf_Addr cfi_debug_bias;
Dwarf_CFI *cfi_eh;
Dwarf_Addr cfi_eh_bias;
+bool is_ET_REL;
+bool is_debug;
+
// Whether the current function has a DW_AT_frame_base defined.
// Needed for DW_OP_fbreg.
bool has_frame_base;
@@ -75,11 +79,51 @@
return NULL;
}
+static const char *
+dwarf_tag_string (unsigned int tag)
+{
+ switch (tag)
+ {
+#define DWARF_ONE_KNOWN_DW_TAG(NAME, CODE) case CODE: return #NAME;
+ DWARF_ALL_KNOWN_DW_TAG
+#undef DWARF_ONE_KNOWN_DW_TAG
+ default:
+ return NULL;
+ }
+}
+
+static const char *
+dwarf_attr_string (unsigned int attrnum)
+{
+ switch (attrnum)
+ {
+#define DWARF_ONE_KNOWN_DW_AT(NAME, CODE) case CODE: return #NAME;
+ DWARF_ALL_KNOWN_DW_AT
+#undef DWARF_ONE_KNOWN_DW_AT
+ default:
+ return NULL;
+ }
+}
+
+static const char *
+dwarf_form_string (unsigned int form)
+{
+ switch (form)
+ {
+#define DWARF_ONE_KNOWN_DW_FORM(NAME, CODE) case CODE: return #NAME;
+ DWARF_ALL_KNOWN_DW_FORM
+#undef DWARF_ONE_KNOWN_DW_FORM
+ default:
+ return NULL;
+ }
+}
+
/* BASE must be a base type DIE referenced by a typed DWARF expression op. */
static void
print_base_type (Dwarf_Die *base)
{
- assert (dwarf_tag (base) == DW_TAG_base_type);
+ if (dwarf_tag (base) != DW_TAG_base_type)
+ error (EXIT_FAILURE, 0, "not a base type");
Dwarf_Attribute encoding;
Dwarf_Word enctype = 0;
@@ -120,16 +164,16 @@
}
// Forward reference for print_expr_block.
-static void print_expr (Dwarf_Attribute *, Dwarf_Op *, Dwarf_Addr);
+static void print_expr (Dwarf_Attribute *, Dwarf_Op *, Dwarf_Addr, int);
static void
print_expr_block (Dwarf_Attribute *attr, Dwarf_Op *exprs, int len,
- Dwarf_Addr addr)
+ Dwarf_Addr addr, int depth)
{
printf ("{");
for (int i = 0; i < len; i++)
{
- print_expr (attr, &exprs[i], addr);
+ print_expr (attr, &exprs[i], addr, depth);
printf ("%s", (i + 1 < len ? ", " : ""));
}
printf ("}");
@@ -141,13 +185,17 @@
Dwarf_Op *exprs, int len)
{
printf (" [%" PRIx64 ",%" PRIx64 ") ", begin, end);
- print_expr_block (attr, exprs, len, begin);
+ print_expr_block (attr, exprs, len, begin, 0);
printf ("\n");
}
static void
-print_expr (Dwarf_Attribute *attr, Dwarf_Op *expr, Dwarf_Addr addr)
+print_expr (Dwarf_Attribute *attr, Dwarf_Op *expr, Dwarf_Addr addr, int depth)
{
+#define MAX_DEPTH 64
+ if (depth++ > MAX_DEPTH)
+ error (EXIT_FAILURE, 0, "print_expr recursion depth exceeded");
+
uint8_t atom = expr->atom;
const char *opname = dwarf_opcode_string (atom);
assert (opname != NULL);
@@ -215,24 +263,33 @@
error (EXIT_FAILURE, 0, "%s used in CFI", opname);
printf ("%s ", opname);
- if (cfi_eh == NULL && cfi_debug == NULL)
+ if (cfi_eh == NULL && cfi_debug == NULL && !is_debug)
error (EXIT_FAILURE, 0, "DW_OP_call_frame_cfa used but no cfi found.");
Dwarf_Frame *frame;
- if (dwarf_cfi_addrframe (cfi_eh, addr + cfi_eh_bias, &frame) != 0
- && dwarf_cfi_addrframe (cfi_debug, addr, &frame) != 0)
+ if (dwarf_cfi_addrframe (cfi_eh, addr + cfi_eh_bias, &frame) == 0
+ || dwarf_cfi_addrframe (cfi_debug, addr + cfi_debug_bias,
+ &frame) == 0)
+ {
+ Dwarf_Op *cfa_ops;
+ size_t cfa_nops;
+ if (dwarf_frame_cfa (frame, &cfa_ops, &cfa_nops) != 0)
+ error (EXIT_FAILURE, 0, "dwarf_frame_cfa 0x%" PRIx64 ": %s",
+ addr, dwarf_errmsg (-1));
+ if (cfa_nops < 1)
+ error (EXIT_FAILURE, 0, "dwarf_frame_cfa no ops");
+ print_expr_block (NULL, cfa_ops, cfa_nops, 0, depth);
+ free (frame);
+ }
+ else if (is_ET_REL || is_debug)
+ {
+ /* XXX In ET_REL files there might be an .eh_frame with relocations
+ we don't handle (e.g. X86_64_PC32). Maybe we should? */
+ printf ("{...}");
+ }
+ else
error (EXIT_FAILURE, 0, "dwarf_cfi_addrframe 0x%" PRIx64 ": %s",
addr, dwarf_errmsg (-1));
-
- Dwarf_Op *cfa_ops;
- size_t cfa_nops;
- if (dwarf_frame_cfa (frame, &cfa_ops, &cfa_nops) != 0)
- error (EXIT_FAILURE, 0, "dwarf_frame_cfa 0x%" PRIx64 ": %s",
- addr, dwarf_errmsg (-1));
- if (cfa_nops < 1)
- error (EXIT_FAILURE, 0, "dwarf_frame_cfa no ops");
- print_expr_block (NULL, cfa_ops, cfa_nops, 0);
- free (frame);
break;
case DW_OP_push_object_address:
@@ -290,7 +347,7 @@
dwarf_errmsg (-1));
printf ("%s([%" PRIx64 "]) ", opname, dwarf_dieoffset (&call_die));
- print_expr_block (&call_attr, call_ops, call_len, addr);
+ print_expr_block (&call_attr, call_ops, call_len, addr, depth);
}
break;
@@ -360,6 +417,7 @@
}
break;
+ case DW_OP_implicit_pointer:
case DW_OP_GNU_implicit_pointer:
/* Special, DIE offset, signed offset. Referenced DIE has a
location or const_value attribute. */
@@ -386,7 +444,7 @@
Dwarf_Die impl_die;
if (dwarf_getlocation_die (attr, expr, &impl_die) != 0)
- error (EXIT_FAILURE, 0, "dwarf_getlocation_due: %s",
+ error (EXIT_FAILURE, 0, "dwarf_getlocation_die: %s",
dwarf_errmsg (-1));
printf ("%s([%" PRIx64 "],%" PRId64 ") ", opname,
@@ -404,7 +462,7 @@
if (locs == 0)
printf ("<no location>"); // This means "optimized out".
else if (locs == 1)
- print_expr_block (&attrval, exprval, exprval_len, addr);
+ print_expr_block (&attrval, exprval, exprval_len, addr, depth);
else
error (EXIT_FAILURE, 0,
"dwarf_getlocation_addr attrval at addr 0x%" PRIx64
@@ -413,6 +471,47 @@
}
break;
+ case DW_OP_GNU_variable_value:
+ /* Special, DIE offset. Referenced DIE has a location or const_value
+ attribute. */
+ {
+ if (attr == NULL)
+ error (EXIT_FAILURE, 0, "%s used in CFI", opname);
+
+ Dwarf_Attribute attrval;
+ if (dwarf_getlocation_attr (attr, expr, &attrval) != 0)
+ error (EXIT_FAILURE, 0, "dwarf_getlocation_attr: %s",
+ dwarf_errmsg (-1));
+
+ Dwarf_Die impl_die;
+ if (dwarf_getlocation_die (attr, expr, &impl_die) != 0)
+ error (EXIT_FAILURE, 0, "dwarf_getlocation_die: %s",
+ dwarf_errmsg (-1));
+
+ printf ("%s([%" PRIx64 "]) ", opname, dwarf_dieoffset (&impl_die));
+
+ if (dwarf_whatattr (&attrval) == DW_AT_const_value)
+ printf ("<constant value>"); // Lookup type...
+ else
+ {
+ // Lookup the location description at the current address.
+ Dwarf_Op *exprval;
+ size_t exprval_len;
+ int locs = dwarf_getlocation_addr (&attrval, addr,
+ &exprval, &exprval_len, 1);
+ if (locs == 0)
+ printf ("<no location>"); // This means "optimized out".
+ else if (locs == 1)
+ print_expr_block (&attrval, exprval, exprval_len, addr, depth);
+ else
+ error (EXIT_FAILURE, 0,
+ "dwarf_getlocation_addr attrval at addr 0x%" PRIx64
+ ", locs (%d): %s", addr, locs, dwarf_errmsg (-1));
+ }
+ }
+ break;
+
+ case DW_OP_entry_value:
case DW_OP_GNU_entry_value:
/* Special, unsigned size plus expression block. All registers
inside the block should be interpreted as they had on
@@ -432,7 +531,7 @@
dwarf_errmsg (-1));
printf ("%s(%zd) ", opname, entry_len);
- print_expr_block (attr, entry_ops, entry_len, addr);
+ print_expr_block (attr, entry_ops, entry_len, addr, depth);
}
break;
@@ -451,11 +550,14 @@
// XXX actually lookup DW_TAG_GNU_call_site_parameter
printf ("%s[%" PRIx64 "]", opname, dwarf_dieoffset (¶m));
assert (expr->number == dwarf_cuoffset (¶m));
- assert (dwarf_tag (¶m) == DW_TAG_formal_parameter);
+ if (dwarf_tag (¶m) != DW_TAG_formal_parameter)
+ error (EXIT_FAILURE, 0, "Not a formal parameter");
}
break;
+ case DW_OP_convert:
case DW_OP_GNU_convert:
+ case DW_OP_reinterpret:
case DW_OP_GNU_reinterpret:
/* Special, unsigned CU relative DIE offset pointing to a
DW_TAG_base_type. Pops a value, converts or reinterprets the
@@ -480,6 +582,7 @@
}
break;
+ case DW_OP_regval_type:
case DW_OP_GNU_regval_type:
/* Special, unsigned register number plus unsigned CU relative
DIE offset pointing to a DW_TAG_base_type. */
@@ -495,9 +598,10 @@
}
break;
+ case DW_OP_deref_type:
case DW_OP_GNU_deref_type:
/* Special, unsigned size plus unsigned CU relative DIE offset
- pointing to a DW_TAG_base_type. */
+ pointing to a DW_TAG_base_type. */
{
Dwarf_Die type;
if (dwarf_getlocation_die (attr, expr, &type) != 0)
@@ -510,6 +614,21 @@
}
break;
+ case DW_OP_xderef_type:
+ /* Special, unsigned size plus unsigned DIE offset
+ pointing to a DW_TAG_base_type. */
+ {
+ Dwarf_Die type;
+ if (dwarf_getlocation_die (attr, expr, &type) != 0)
+ error (EXIT_FAILURE, 0, "dwarf_getlocation_die: %s",
+ dwarf_errmsg (-1));
+ // XXX check size against base_type size?
+ printf ("%s(%" PRIu64 ")", opname, expr->number);
+ print_base_type (&type);
+ }
+ break;
+
+ case DW_OP_const_type:
case DW_OP_GNU_const_type:
/* Special, unsigned CU relative DIE offset pointing to a
DW_TAG_base_type, an unsigned size length plus a block with
@@ -540,6 +659,42 @@
}
break;
+ case DW_OP_GNU_addr_index:
+ case DW_OP_addrx:
+ /* Address from the .debug_addr section (indexed based on CU). */
+ {
+ Dwarf_Attribute addr_attr;
+ if (dwarf_getlocation_attr (attr, expr, &addr_attr) != 0)
+ error (EXIT_FAILURE, 0, "dwarf_getlocation_attr for addr: %s",
+ dwarf_errmsg (-1));
+
+ Dwarf_Addr address;
+ if (dwarf_formaddr (&addr_attr, &address) != 0)
+ error (EXIT_FAILURE, 0, "dwarf_formaddr address failed: %s",
+ dwarf_errmsg (-1));
+
+ printf ("addr: 0x%" PRIx64, address);
+ }
+ break;
+
+ case DW_OP_GNU_const_index:
+ case DW_OP_constx:
+ /* Constant from the .debug_addr section (indexed based on CU). */
+ {
+ Dwarf_Attribute addr_attr;
+ if (dwarf_getlocation_attr (attr, expr, &addr_attr) != 0)
+ error (EXIT_FAILURE, 0, "dwarf_getlocation_attr for addr: %s",
+ dwarf_errmsg (-1));
+
+ Dwarf_Word constant;
+ if (dwarf_formudata (&addr_attr, &constant) != 0)
+ error (EXIT_FAILURE, 0, "dwarf_formudata constant failed: %s",
+ dwarf_errmsg (-1));
+
+ printf ("const: 0x%" PRIx64, constant);
+ }
+ break;
+
default:
error (EXIT_FAILURE, 0, "unhandled opcode: DW_OP_%s (0x%x)",
opname, atom);
@@ -572,7 +727,7 @@
if (entrypc == 0)
printf ("XXX zero address"); // XXX bad DWARF?
else
- print_expr_block (&fb_attr, fb_expr, fb_exprlen, entrypc);
+ print_expr_block (&fb_attr, fb_expr, fb_exprlen, entrypc, 0);
printf ("\n");
}
else
@@ -585,7 +740,7 @@
&fb_expr, &fb_exprlen)) > 0)
{
printf (" (%" PRIx64 ",%" PRIx64 ") ", start, end);
- print_expr_block (&fb_attr, fb_expr, fb_exprlen, start);
+ print_expr_block (&fb_attr, fb_expr, fb_exprlen, start, 0);
printf ("\n");
}
@@ -759,9 +914,162 @@
return DWARF_CB_OK;
}
+struct attr_arg
+{
+ int depth;
+ Dwarf_Addr entrypc;
+};
+
+static int
+handle_attr (Dwarf_Attribute *attr, void *arg)
+{
+ int depth = ((struct attr_arg *) arg)->depth;
+ Dwarf_Addr entrypc = ((struct attr_arg *) arg)->entrypc;
+
+ unsigned int code = dwarf_whatattr (attr);
+ unsigned int form = dwarf_whatform (attr);
+
+ printf ("%*s%s (%s)", depth * 2, "",
+ dwarf_attr_string (code), dwarf_form_string (form));
+
+ /* If we can get an DWARF expression (or location lists) from this
+ attribute we'll print it, otherwise we'll ignore it. But if
+ there is an error while the attribute has the "correct" form then
+ we'll report an error (we can only really check DW_FORM_exprloc
+ other forms can be ambiguous). */
+ Dwarf_Op *expr;
+ size_t exprlen;
+ bool printed = false;
+ int res = dwarf_getlocation (attr, &expr, &exprlen);
+ if (res == 0)
+ {
+ printf (" ");
+ print_expr_block (attr, expr, exprlen, entrypc, 0);
+ printf ("\n");
+ printed = true;
+ }
+ else if (form == DW_FORM_exprloc)
+ {
+ error (0, 0, "%s dwarf_getlocation failed: %s",
+ dwarf_attr_string (code), dwarf_errmsg (-1));
+ return DWARF_CB_ABORT;
+ }
+ else
+ {
+ Dwarf_Addr base, begin, end;
+ ptrdiff_t offset = 0;
+ while ((offset = dwarf_getlocations (attr, offset,
+ &base, &begin, &end,
+ &expr, &exprlen)) > 0)
+ {
+ if (! printed)
+ printf ("\n");
+ printf ("%*s", depth * 2, "");
+ print_expr_block_addrs (attr, begin, end, expr, exprlen);
+ printed = true;
+ }
+ }
+
+ if (! printed)
+ printf ("\n");
+
+ return DWARF_CB_OK;
+}
+
+static void
+handle_die (Dwarf_Die *die, int depth, bool outer_has_frame_base,
+ Dwarf_Addr outer_entrypc)
+{
+ /* CU DIE already printed. */
+ if (depth > 0)
+ {
+ const char *name = dwarf_diename (die);
+ if (name != NULL)
+ printf ("%*s[%" PRIx64 "] %s \"%s\"\n", depth * 2, "",
+ dwarf_dieoffset (die), dwarf_tag_string (dwarf_tag (die)),
+ name);
+ else
+ printf ("%*s[%" PRIx64 "] %s\n", depth * 2, "",
+ dwarf_dieoffset (die), dwarf_tag_string (dwarf_tag (die)));
+ }
+
+ struct attr_arg arg;
+ arg.depth = depth + 1;
+
+ /* The (lowest) address to use for (looking up) operands that depend
+ on address. */
+ Dwarf_Addr die_entrypc;
+ if (dwarf_entrypc (die, &die_entrypc) != 0 || die_entrypc == 0)
+ {
+ /* Try to get the lowest address of the first range covered. */
+ Dwarf_Addr base, start, end;
+ if (dwarf_ranges (die, 0, &base, &start, &end) <= 0 || start == 0)
+ die_entrypc = outer_entrypc;
+ else
+ die_entrypc = start;
+ }
+ arg.entrypc = die_entrypc;
+
+ /* Whether this or the any outer DIE has a frame base. Used as
+ sanity check when printing experssions that use DW_OP_fbreg. */
+ bool die_has_frame_base = dwarf_hasattr (die, DW_AT_frame_base);
+ die_has_frame_base |= outer_has_frame_base;
+ has_frame_base = die_has_frame_base;
+
+ /* Look through all attributes to find those that contain DWARF
+ expressions and print those. We expect to handle all attributes,
+ anything else is an error. */
+ if (dwarf_getattrs (die, handle_attr, &arg, 0) != 1)
+ error (EXIT_FAILURE, 0, "Couldn't get all attributes: %s",
+ dwarf_errmsg (-1));
+
+ /* Handle children and siblings recursively depth first. */
+ Dwarf_Die child;
+ if (dwarf_haschildren (die) != 0 && dwarf_child (die, &child) == 0)
+ handle_die (&child, depth + 1, die_has_frame_base, die_entrypc);
+
+ Dwarf_Die sibling;
+ if (dwarf_siblingof (die, &sibling) == 0)
+ handle_die (&sibling, depth, outer_has_frame_base, outer_entrypc);
+}
+
int
main (int argc, char *argv[])
{
+ /* With --exprlocs we process all DIEs looking for any attribute
+ which contains an DWARF expression (but not location lists) and
+ print those. Otherwise we process all function DIEs and print
+ all DWARF expressions and location lists associated with
+ parameters and variables). It must be the first argument,
+ or the second, after --debug. */
+ bool exprlocs = false;
+
+ /* With --debug we ignore not being able to find .eh_frame.
+ It must come as first argument. */
+ is_debug = false;
+ if (argc > 1)
+ {
+ if (strcmp ("--exprlocs", argv[1]) == 0)
+ {
+ exprlocs = true;
+ argv[1] = "";
+ }
+ else if (strcmp ("--debug", argv[1]) == 0)
+ {
+ is_debug = true;
+ argv[1] = "";
+ }
+ }
+
+ if (argc > 2)
+ {
+ if (strcmp ("--exprlocs", argv[2]) == 0)
+ {
+ exprlocs = true;
+ argv[2] = "";
+ }
+ }
+
int remaining;
Dwfl *dwfl;
(void) argp_parse (dwfl_standard_argp (), argc, argv, 0, &remaining,
@@ -770,14 +1078,27 @@
Dwarf_Die *cu = NULL;
Dwarf_Addr dwbias;
+ bool found_cu = false;
while ((cu = dwfl_nextcu (dwfl, cu, &dwbias)) != NULL)
{
/* Only walk actual compile units (not partial units) that
- contain code. */
+ contain code if we are only interested in the function variable
+ locations. */
+ Dwarf_Die cudie;
+ Dwarf_Die subdie;
+ uint8_t unit_type;
+ if (dwarf_cu_info (cu->cu, NULL, &unit_type, &cudie, &subdie,
+ NULL, NULL, NULL) != 0)
+ error (EXIT_FAILURE, 0, "dwarf_cu_info: %s", dwarf_errmsg (-1));
+ if (unit_type == DW_UT_skeleton)
+ cudie = subdie;
+
Dwarf_Addr cubase;
- if (dwarf_tag (cu) == DW_TAG_compile_unit
- && dwarf_lowpc (cu, &cubase) == 0)
+ if (dwarf_tag (&cudie) == DW_TAG_compile_unit
+ && (exprlocs || dwarf_lowpc (&cudie, &cubase) == 0))
{
+ found_cu = true;
+
Dwfl_Module *mod = dwfl_cumodule (cu);
Dwarf_Addr modbias;
dw = dwfl_module_getdwarf (mod, &modbias);
@@ -796,29 +1117,46 @@
? modname
: basename (mainfile));
printf ("module '%s'\n", name);
- print_die (cu, "CU", 0);
+ print_die (&cudie, "CU", 0);
Dwarf_Addr elfbias;
Elf *elf = dwfl_module_getelf (mod, &elfbias);
// CFI. We need both since sometimes neither is complete.
- cfi_debug = dwarf_getcfi (dw); // No bias needed, same file.
- cfi_eh = dwarf_getcfi_elf (elf);
- cfi_eh_bias = dwbias - elfbias;
+ cfi_debug = dwfl_module_dwarf_cfi (mod, &cfi_debug_bias);
+ cfi_eh = dwfl_module_eh_cfi (mod, &cfi_eh_bias);
- // Get the actual CU DIE and walk all functions inside it.
- Dwarf_Die cudie;
- uint8_t offsize;
- uint8_t addrsize;
- if (dwarf_diecu (cu, &cudie, &addrsize, &offsize) == NULL)
- error (EXIT_FAILURE, 0, "dwarf_diecu %s", dwarf_errmsg (-1));
+ // No bias needed, same file.
+ assert (cfi_debug == NULL || cfi_debug_bias == 0);
- if (dwarf_getfuncs (cu, handle_function, NULL, 0) != 0)
+ // We are a bit forgiving for object files. There might be
+ // relocations we don't handle that are needed in some
+ // places...
+ GElf_Ehdr ehdr_mem, *ehdr = gelf_getehdr (elf, &ehdr_mem);
+ is_ET_REL = ehdr->e_type == ET_REL;
+
+ if (exprlocs)
+ {
+ Dwarf_Addr entrypc;
+ if (dwarf_entrypc (&cudie, &entrypc) != 0)
+ entrypc = 0;
+
+ /* XXX - Passing true for has_frame_base is not really true.
+ We do it because we want to resolve all DIEs and all
+ attributes. Technically we should check that the DIE
+ (types) are referenced from variables that are defined in
+ a context (function) that has a frame base. */
+ handle_die (&cudie, 0, true /* Should be false */, entrypc);
+ }
+ else if (dwarf_getfuncs (&cudie, handle_function, NULL, 0) != 0)
error (EXIT_FAILURE, 0, "dwarf_getfuncs %s",
dwarf_errmsg (-1));
}
}
+ if (! found_cu)
+ error (EXIT_FAILURE, 0, "No DWARF CU found?");
+
dwfl_end (dwfl);
return 0;
}
diff --git a/tests/vendorelf.c b/tests/vendorelf.c
new file mode 100644
index 0000000..bc13cce
--- /dev/null
+++ b/tests/vendorelf.c
@@ -0,0 +1,197 @@
+/* Test program for adding a program header to a vendor specific ELF file.
+ Copyright (C) 2016 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/>. */
+
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <errno.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include ELFUTILS_HEADER(elf)
+#include <gelf.h>
+
+void
+check_elf (const char *fname, int class, int use_mmap)
+{
+ printf ("\nfname: %s\n", fname);
+
+ int fd = open (fname, O_RDWR | O_CREAT | O_TRUNC, 0666);
+ if (fd == -1)
+ {
+ printf ("cannot open `%s': %s\n", fname, strerror (errno));
+ exit (1);
+ }
+
+ Elf *elf = elf_begin (fd, use_mmap ? ELF_C_WRITE_MMAP : ELF_C_WRITE, NULL);
+ if (elf == NULL)
+ {
+ printf ("cannot create ELF descriptor: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ // Create an ELF header.
+ if (gelf_newehdr (elf, class) == 0)
+ {
+ printf ("cannot create ELF header: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ GElf_Ehdr ehdr_mem;
+ GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
+ if (ehdr == NULL)
+ {
+ printf ("cannot get ELF header: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ // Initialize header.
+ ehdr->e_ident[EI_DATA] = class == ELFCLASS64 ? ELFDATA2LSB : ELFDATA2MSB;
+ ehdr->e_ident[EI_OSABI] = ELFOSABI_GNU;
+ ehdr->e_type = ET_LOOS + 1;
+ ehdr->e_machine = EM_X86_64;
+ ehdr->e_version = EV_CURRENT;
+
+ if (gelf_update_ehdr (elf, ehdr) == 0)
+ {
+ printf ("cannot update ELF header: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ // Create a program header.
+ if (gelf_newphdr (elf, 1) == 0)
+ {
+ printf ("cannot create program header: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ GElf_Phdr phdr;
+ if (gelf_getphdr (elf, 0, &phdr) == NULL)
+ {
+ printf ("cannot get program header: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ // Some random values to check later.
+ phdr.p_type = PT_NULL;
+ phdr.p_offset = 0;
+ phdr.p_vaddr = 0;
+ phdr.p_paddr = 1;
+ phdr.p_filesz = 0;
+ phdr.p_memsz = 1024;
+ phdr.p_flags = PF_R;
+ phdr.p_align = 16;
+
+ if (gelf_update_phdr (elf, 0, &phdr) == 0)
+ {
+ printf ("cannot update program header: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ // Write everything to disk.
+ if (elf_update (elf, ELF_C_WRITE) < 0)
+ {
+ printf ("failure in elf_update(WRITE): %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ if (elf_end (elf) != 0)
+ {
+ printf ("failure in elf_end: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ close (fd);
+
+ /* Reread the ELF from disk now. */
+ fd = open (fname, O_RDONLY, 0666);
+ if (fd == -1)
+ {
+ printf ("cannot open `%s' read-only: %s\n", fname, strerror (errno));
+ exit (1);
+ }
+
+ elf = elf_begin (fd, use_mmap ? ELF_C_READ_MMAP : ELF_C_READ, NULL);
+ if (elf == NULL)
+ {
+ printf ("cannot create ELF descriptor read-only: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ // Is our phdr there?
+ size_t phnum;
+ if (elf_getphdrnum (elf, &phnum) != 0)
+ {
+ printf ("cannot get phdr num: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ if (phnum != 1)
+ {
+ printf ("Expected just 1 phdr, got: %zd\n", phnum);
+ exit (1);
+ }
+
+ if (gelf_getphdr (elf, 0, &phdr) == NULL)
+ {
+ printf ("cannot get program header from file: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ if (phdr.p_type != PT_NULL
+ || phdr.p_offset != 0
+ || phdr.p_vaddr != 0
+ || phdr.p_paddr != 1
+ || phdr.p_filesz != 0
+ || phdr.p_memsz != 1024
+ || phdr.p_flags != PF_R
+ || phdr.p_align != 16)
+ {
+ printf ("Unexpected phdr values\n");
+ exit (1);
+ }
+
+ if (elf_end (elf) != 0)
+ {
+ printf ("failure in elf_end: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
+
+ close (fd);
+
+ unlink (fname);
+}
+
+int
+main (int argc __attribute__ ((unused)),
+ char *argv[] __attribute__ ((unused)))
+{
+ elf_version (EV_CURRENT);
+
+ check_elf ("vendor.elf.32", ELFCLASS32, 0);
+ check_elf ("vendor.elf.32.mmap", ELFCLASS32, 1);
+ check_elf ("vendor.elf.64", ELFCLASS64, 0);
+ check_elf ("vendor.elf.64.mmap", ELFCLASS64, 1);
+
+ return 0;
+}
diff --git a/version.h b/version.h
index a1ee493..651f9fb 100644
--- a/version.h
+++ b/version.h
@@ -30,7 +30,7 @@
#ifndef _ELFUTILS_VERSION_H
#define _ELFUTILS_VERSION_H 1
-#define _ELFUTILS_VERSION 165
+#define _ELFUTILS_VERSION 173
#define _ELFUTILS_PREREQ(major, minor) \
(_ELFUTILS_VERSION >= ((major) * 1000 + (minor)))