summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2016-09-15 22:59:03 +0200
committerMark Wielaard <[email protected]>2016-09-15 22:59:03 +0200
commit51928153ab88f1816a39c5eaf75dc045e08e50c6 (patch)
treeec3e0a8e9490d53005e932ea20c1b4659cdf0d77
parente54140c7cda200dbc2aaa84506577da55941e0ac (diff)
parent4512aba06f73704d53cc2ba86f47b9340914e0f2 (diff)
Merge tag 'elfutils-0.167' into mjw/RH-DTS
elfutils 0.167 release Conflicts: libebl/eblopenbackend.c src/Makefile.am tests/Makefile.am tests/run-readelf-A.sh
-rw-r--r--.gitignore4
-rw-r--r--CONTRIBUTING53
-rw-r--r--ChangeLog25
-rw-r--r--NEWS12
-rw-r--r--backends/ChangeLog35
-rw-r--r--backends/Makefile.am23
-rw-r--r--backends/bpf_init.c60
-rw-r--r--backends/bpf_regs.c (renamed from libebl/eblobjecttypename.c)53
-rw-r--r--backends/bpf_reloc.def (renamed from libebl/eblshflagscombine.c)18
-rw-r--r--backends/common-reloc.c7
-rw-r--r--backends/linux-core-note.c10
-rw-r--r--backends/m68k_corenote.c72
-rw-r--r--backends/m68k_init.c60
-rw-r--r--backends/m68k_regs.c96
-rw-r--r--backends/m68k_reloc.def70
-rw-r--r--backends/m68k_retval.c153
-rw-r--r--backends/m68k_symbol.c70
-rw-r--r--backends/sparc_attrs.c74
-rw-r--r--config/ChangeLog8
-rw-r--r--config/elfutils.spec.in13
-rw-r--r--configure.ac44
-rw-r--r--libasm/ChangeLog21
-rw-r--r--libasm/Makefile.am5
-rw-r--r--libasm/asm_begin.c6
-rw-r--r--libasm/asm_end.c46
-rw-r--r--libasm/asm_newabssym.c4
-rw-r--r--libasm/asm_newcomsym.c4
-rw-r--r--libasm/asm_newscn.c6
-rw-r--r--libasm/asm_newscngrp.c6
-rw-r--r--libasm/asm_newsym.c8
-rw-r--r--libasm/disasm_cb.c4
-rw-r--r--libasm/libasmP.h14
-rw-r--r--libasm/symbolhash.c4
-rw-r--r--libasm/symbolhash.h2
-rw-r--r--libcpu/ChangeLog12
-rw-r--r--libcpu/Makefile.am6
-rw-r--r--libcpu/bpf_disasm.c481
-rw-r--r--libcpu/i386_disasm.c3
-rw-r--r--libdw/ChangeLog6
-rw-r--r--libdw/libdw.map11
-rw-r--r--libdwelf/ChangeLog14
-rw-r--r--libdwelf/Makefile.am3
-rw-r--r--libdwelf/dwelf_strtab.c (renamed from libebl/eblstrtab.c)99
-rw-r--r--libdwelf/libdwelf.h55
-rw-r--r--libdwfl/ChangeLog14
-rw-r--r--libdwfl/dwfl_module_getsrc_file.c2
-rw-r--r--libdwfl/link_map.c7
-rw-r--r--libdwfl/linux-proc-maps.c5
-rw-r--r--libebl/ChangeLog40
-rw-r--r--libebl/Makefile.am8
-rw-r--r--libebl/ebl-hooks.h10
-rw-r--r--libebl/eblgstrtab.c365
-rw-r--r--libebl/eblopenbackend.c25
-rw-r--r--libebl/eblwstrtab.c359
-rw-r--r--libebl/libebl.h79
-rw-r--r--libelf/ChangeLog35
-rw-r--r--libelf/elf-knowledge.h26
-rw-r--r--libelf/elf.h281
-rw-r--r--libelf/elf32_updatenull.c26
-rw-r--r--libelf/elf_compress.c8
-rw-r--r--libelf/elf_end.c5
-rw-r--r--libelf/elf_getphdrnum.c58
-rw-r--r--libelf/elf_nextscn.c38
-rw-r--r--libelf/libelfP.h10
-rw-r--r--po/ChangeLog13
-rw-r--r--po/Makevars3
-rw-r--r--po/POTFILES.in6
-rw-r--r--po/de.po1187
-rw-r--r--po/es.po1685
-rw-r--r--po/ja.po1622
-rw-r--r--po/pl.po1674
-rw-r--r--po/uk.po1653
-rw-r--r--src/ChangeLog54
-rw-r--r--src/Makefile.am83
-rw-r--r--src/elf32-i386.script229
-rw-r--r--src/elfcmp.c2
-rw-r--r--src/elfcompress.c31
-rw-r--r--src/elflint.c2
-rw-r--r--src/i386_ld.c1102
-rw-r--r--src/ld.c1607
-rw-r--r--src/ld.h1135
-rw-r--r--src/ldgeneric.c7132
-rw-r--r--src/ldlex.l353
-rw-r--r--src/ldscript.y803
-rw-r--r--src/libld_elf_i386.map7
-rw-r--r--src/none_ld.c1
-rw-r--r--src/sectionhash.c73
-rw-r--r--src/sectionhash.h27
-rw-r--r--src/strip.c46
-rw-r--r--src/symbolhash.c33
-rw-r--r--src/symbolhash.h28
-rw-r--r--src/unaligned.h102
-rw-r--r--src/unstrip.c52
-rw-r--r--src/versionhash.c32
-rw-r--r--src/versionhash.h26
-rw-r--r--src/xelf.h391
-rw-r--r--tests/ChangeLog85
-rw-r--r--tests/Makefile.am29
-rw-r--r--tests/alldts.c24
-rw-r--r--tests/backtrace-child.c18
-rw-r--r--tests/backtrace.c39
-rw-r--r--tests/elfshphehdr.c2
-rw-r--r--tests/elfstrmerge.c31
-rw-r--r--tests/emptyfile.c277
-rw-r--r--tests/hello_m68k.ko.bz2bin0 -> 26549 bytes
-rwxr-xr-xtests/run-allregs.sh1
-rwxr-xr-xtests/run-disasm-bpf.sh63
-rwxr-xr-xtests/run-readelf-A.sh1
-rwxr-xr-xtests/run-strip-reloc.sh11
-rwxr-xr-xtests/run-strip-test11.sh4
-rw-r--r--tests/testfile-bpf-dis1.expect.bz2bin0 -> 1467 bytes
-rw-r--r--tests/testfile-bpf-dis1.o.bz2bin0 -> 737 bytes
-rw-r--r--tests/testfile-m68k-core.bz2bin0 -> 22041 bytes
-rwxr-xr-xtests/testfile-m68k-s.bz2bin0 -> 1590 bytes
-rwxr-xr-xtests/testfile-m68k.bz2bin0 -> 3659 bytes
-rw-r--r--tests/testfilesparc64attrs.o.bz2bin0 -> 242 bytes
-rw-r--r--tests/update3.c18
-rw-r--r--tests/update4.c42
-rw-r--r--tests/vendorelf.c197
119 files changed, 6053 insertions, 19164 deletions
diff --git a/.gitignore b/.gitignore
index 75043fe4..c583347f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -60,10 +60,6 @@ Makefile.in
/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
diff --git a/CONTRIBUTING b/CONTRIBUTING
index 3f5e5aa6..f267a544 100644
--- a/CONTRIBUTING
+++ b/CONTRIBUTING
@@ -46,3 +46,56 @@ using your real name (sorry, no pseudonyms or anonymous contributions.)
git commit --signoff will add such a Signed-off-by line at the end of
the commit log message for you.
+
+The ideal patch contains a ChangeLog entry and a test case for the
+bug fixed or feature added.
+
+The testsuite (make check) is expected to have zero failing tests.
+Do not knowingly add tests that FAIL. If there are architectures or
+configurations where a tests is not supported make sure they are
+skipped instead of failing. Adding "exit 77" in the test shell wrapper
+indicates that a test was SKIPPED.
+
+We do allow binaries in the testsuite for tests that only need to
+read ELF or DWARF data and if generating the data in the testcase
+itself is difficult or would be architecture specific.
+The binaries should be bzip2 compressed. Add a note in the test
+wrapper run-<testcase>.sh script how to regenerate the binary.
+
+After sending your patch to the mailinglist one of the committers
+to the project will review it, give feedback, and if perfect they
+will commit it for you.
+
+The current maintainers/committers can be found at:
+https://admin.fedoraproject.org/accounts/group/members/gitelfutils/*
+
+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 an FAS account at:
+https://admin.fedoraproject.org/accounts/
+Upload a SSH public key and have an existing maintainer sponsor you
+for the Elf Utils Group (gitelfutils).
+
+committers can push patches through:
+ssh://<fasname>@git.fedorahosted.org/git/elfutils.git
+
+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 <fasname>/...
+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 31f346f3..07e8f577 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2016-08-04 Mark Wielaard <[email protected]>
+
+ * configure.ac: Set version to 0.167.
+ * NEWS: Add 0.167 section.
+
+2016-07-06 Mark Wielaard <[email protected]>
+
+ * .gitignore: Remove src/ld. ldlex.c, ldscript.c and ldscript.h.
+ * configure.ac (enable generic): Removed.
+
+2016-06-28 Richard Henderson <[email protected]>
+
+ * configure.ac (HAVE_LINUX_BPF_H): New test and conditional.
+
+2016-06-10 Mark Wielaard <[email protected]>
+
+ * CONTRIBUTING: Extend patch, committer and maintainer guidelines.
+
+2016-05-02 Filipe Brandenburger <[email protected]>
+
+ * 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 <[email protected]>
* configure.ac: Set version to 0.166.
diff --git a/NEWS b/NEWS
index 1a55d3a6..599970b9 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,15 @@
+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-.
diff --git a/backends/ChangeLog b/backends/ChangeLog
index cf70a52f..53d29081 100644
--- a/backends/ChangeLog
+++ b/backends/ChangeLog
@@ -1,3 +1,38 @@
+2016-08-09 Jose E. Marchesi <[email protected]>
+
+ * 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 <[email protected]>
+
+ * 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 <[email protected]>
+
+ * 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 <[email protected]>
+
+ * 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 <[email protected]>
* sparc_initreg.c (EBLHOOK): Provide a dummy
diff --git a/backends/Makefile.am b/backends/Makefile.am
index 695694a2..54ddd78f 100644
--- a/backends/Makefile.am
+++ b/backends/Makefile.am
@@ -33,11 +33,12 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
- tilegx
+ tilegx m68k bpf
libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
- libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a
+ libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
+ libebl_m68k_pic.a libebl_bpf_pic.a
noinst_LIBRARIES = $(libebl_pic)
noinst_DATA = $(libebl_pic:_pic.a=.so)
lib_LIBRARIES = libebl_static_pic.a
@@ -66,7 +67,7 @@ static_SRCS = i386_init.c i386_symbol.c i386_corenote.c i386_cfi.c \
ppc64_resolve_sym.c \
s390_init.c s390_symbol.c s390_regs.c s390_retval.c \
s390_corenote.c s390x_corenote.c s390_cfi.c s390_initreg.c \
- s390_unwind.c
+ s390_unwind.c bpf_init.c bpf_regs.c
libebl_static_pic_a_SOURCES = $(static_SRCS)
am_libebl_static_pic_a_OBJECTS = $(static_SRCS:.c=.os)
@@ -138,6 +139,21 @@ tilegx_SRCS = tilegx_init.c tilegx_symbol.c tilegx_regs.c \
libebl_tilegx_pic_a_SOURCES = $(tilegx_SRCS)
am_libebl_tilegx_pic_a_OBJECTS = $(tilegx_SRCS:.c=.os)
+m68k_SRCS = m68k_init.c m68k_symbol.c m68k_regs.c \
+ m68k_retval.c m68k_corenote.c
+libebl_m68k_pic_a_SOURCES = $(m68k_SRCS)
+am_libebl_m68k_pic_a_OBJECTS = $(m68k_SRCS:.c=.os)
+
+bpf_SRCS = bpf_init.c bpf_regs.c
+# The disam hook depends on this if we have linux/bpf.h.
+if HAVE_LINUX_BPF_H
+cpu_bpf = ../libcpu/libcpu_bpf.a
+else
+cpu_bpf =
+endif
+libebl_bpf_pic_a_SOURCES = $(bpf_SRCS)
+am_libebl_bpf_pic_a_OBJECTS = $(bpf_SRCS:.c=.os)
+
libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
@rm -f $(@:.so=.map)
@@ -151,6 +167,7 @@ libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
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/bpf_init.c b/backends/bpf_init.c
new file mode 100644
index 00000000..22842e26
--- /dev/null
+++ b/backends/bpf_init.c
@@ -0,0 +1,60 @@
+/* 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);
+#ifdef HAVE_LINUX_BPF_H
+ HOOK (eh, disasm);
+#endif
+
+ return MODVERSION;
+}
diff --git a/libebl/eblobjecttypename.c b/backends/bpf_regs.c
index b0fd3724..180af83b 100644
--- a/libebl/eblobjecttypename.c
+++ b/backends/bpf_regs.c
@@ -1,7 +1,5 @@
-/* Return object file type name.
- Copyright (C) 2001, 2002 Red Hat, Inc.
+/* Register names and numbers for BPF DWARF.
This file is part of elfutils.
- Written by Ulrich Drepper <[email protected]>, 2001.
This file is free software; you can redistribute it and/or modify
it under the terms of either
@@ -32,28 +30,35 @@
#endif
#include <stdio.h>
-#include <libeblP.h>
+#include <string.h>
+#ifdef HAVE_LINUX_BPF_H
+#include <linux/bpf.h>
+#else
+#define MAX_BPF_REG 10
+#endif
+
+#define BACKEND bpf_
+#include "libebl_CPU.h"
-const char *
-ebl_object_type_name (Ebl *ebl, int object, char *buf, size_t len)
+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)
{
- 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;
+ 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
index 4deaaaac..a410da97 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 <[email protected]>, 2001.
This file is free software; you can redistribute it and/or modify
it under the terms of either
@@ -27,15 +25,7 @@
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 (MAP_FD, REL|EXEC|DYN)
diff --git a/backends/common-reloc.c b/backends/common-reloc.c
index 3317b6c9..096ed1c7 100644
--- a/backends/common-reloc.c
+++ b/backends/common-reloc.c
@@ -124,12 +124,13 @@ EBLHOOK(reloc_valid_use) (Elf *elf, int reloc)
return type > ET_NONE && type < ET_CORE && (uses & (1 << (type - 1)));
}
-
+#ifndef NO_COPY_RELOC
bool
EBLHOOK(copy_reloc_p) (int reloc)
{
return reloc == R_TYPE (COPY);
}
+#endif
bool
EBLHOOK(none_reloc_p) (int reloc)
@@ -151,8 +152,10 @@ EBLHOOK(init_reloc) (Ebl *ebl)
ebl->reloc_type_name = EBLHOOK(reloc_type_name);
ebl->reloc_type_check = EBLHOOK(reloc_type_check);
ebl->reloc_valid_use = EBLHOOK(reloc_valid_use);
- ebl->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/linux-core-note.c b/backends/linux-core-note.c
index ff2b226f..a4ec0be0 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 @@ struct EBLHOOK(prstatus)
#endif
;
FIELD (INT, pr_fpvalid);
-};
+}
+#ifdef ALIGN_PRSTATUS
+ __attribute__ ((packed, aligned (ALIGN_PRSTATUS)))
+#endif
+;
#define FNAMESZ 16
#define PRARGSZ 80
diff --git a/backends/m68k_corenote.c b/backends/m68k_corenote.c
new file mode 100644
index 00000000..3c1d019f
--- /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 00000000..943478fb
--- /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 00000000..cb99f552
--- /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 00000000..b7cc4df8
--- /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 00000000..2dd285a0
--- /dev/null
+++ b/backends/m68k_retval.c
@@ -0,0 +1,153 @@
+/* Function return value location for Linux/m68k ABI.
+ This file is part of elfutils.
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <assert.h>
+#include <dwarf.h>
+
+#define BACKEND m68k_
+#include "libebl_CPU.h"
+
+
+/* %d0, or pair %d0, %d1. */
+static const Dwarf_Op loc_intreg[] =
+ {
+ { .atom = DW_OP_reg0 }, { .atom = DW_OP_piece, .number = 4 },
+ { .atom = DW_OP_reg1 }, { .atom = DW_OP_piece, .number = 4 },
+ };
+#define nloc_intreg 1
+#define nloc_intregpair 4
+
+/* %a0. */
+static const Dwarf_Op loc_ptrreg[] =
+ {
+ { .atom = DW_OP_reg8 }
+ };
+#define nloc_ptrreg 1
+
+/* %fp0. */
+static const Dwarf_Op loc_fpreg[] =
+ {
+ { .atom = DW_OP_reg16 }
+ };
+#define nloc_fpreg 1
+
+/* The return value is a structure and is actually stored in stack space
+ passed in a hidden argument by the caller. But, the compiler
+ helpfully returns the address of that space in %a0. */
+static const Dwarf_Op loc_aggregate[] =
+ {
+ { .atom = DW_OP_reg8 }
+ };
+#define nloc_aggregate 1
+
+int
+m68k_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+{
+ /* Start with the function's type, and get the DW_AT_type attribute,
+ which is the type of the return value. */
+ Dwarf_Die die_mem, *typedie = &die_mem;
+ int tag = dwarf_peeled_die_type (functypedie, typedie);
+ if (tag <= 0)
+ return tag;
+
+ switch (tag)
+ {
+ case -1:
+ return -1;
+
+ case DW_TAG_subrange_type:
+ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
+ {
+ Dwarf_Attribute attr_mem, *attr;
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
+ typedie = dwarf_formref_die (attr, &die_mem);
+ tag = DWARF_TAG_OR_RETURN (typedie);
+ }
+ /* Fall through. */
+
+ case DW_TAG_base_type:
+ case DW_TAG_enumeration_type:
+ case DW_TAG_pointer_type:
+ case DW_TAG_ptr_to_member_type:
+ {
+ Dwarf_Word size;
+ Dwarf_Attribute attr_mem;
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
+ {
+ if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
+ size = 4;
+ else
+ return -1;
+ }
+ if (tag == DW_TAG_base_type)
+ {
+ Dwarf_Word encoding;
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
+ &attr_mem),
+ &encoding) != 0)
+ return -1;
+ if (encoding == DW_ATE_float)
+ {
+ if (size > 12)
+ return -2;
+ *locp = loc_fpreg;
+ return nloc_fpreg;
+ }
+ }
+ if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
+ {
+ *locp = loc_ptrreg;
+ return nloc_ptrreg;
+ }
+ *locp = loc_intreg;
+ if (size <= 4)
+ return nloc_intreg;
+ if (size <= 8)
+ return nloc_intregpair;
+
+ /* Else fall through. */
+ }
+
+ case DW_TAG_structure_type:
+ case DW_TAG_class_type:
+ case DW_TAG_union_type:
+ case DW_TAG_array_type:
+ *locp = loc_aggregate;
+ return nloc_aggregate;
+ }
+
+ /* XXX We don't have a good way to return specific errors from ebl calls.
+ This value means we do not understand the type, but it is well-formed
+ DWARF and might be valid. */
+ return -2;
+}
diff --git a/backends/m68k_symbol.c b/backends/m68k_symbol.c
new file mode 100644
index 00000000..269d12e5
--- /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/sparc_attrs.c b/backends/sparc_attrs.c
index e95b577b..974e8fb0 100644
--- a/backends/sparc_attrs.c
+++ b/backends/sparc_attrs.c
@@ -41,33 +41,63 @@ sparc_check_object_attribute (Ebl *ebl __attribute__ ((unused)),
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/config/ChangeLog b/config/ChangeLog
index 5357f224..2ca25bc3 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,11 @@
+2016-08-04 Mark Wielaard <[email protected]>
+
+ * elfutils.spec.in: Update for 0.167.
+
+2016-07-06 Mark Wielaard <[email protected]>
+
+ * elfutils.spec.in: Remove eu-ld.
+
2016-03-31 Mark Wielaard <[email protected]>
* elfutils.spec.in: Update for 0.166.
diff --git a/config/elfutils.spec.in b/config/elfutils.spec.in
index 9b00c476..9b87d05b 100644
--- a/config/elfutils.spec.in
+++ b/config/elfutils.spec.in
@@ -134,7 +134,6 @@ chmod +x ${RPM_BUILD_ROOT}%{_prefix}/%{_lib}/elfutils/lib*.so*
# 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 +175,6 @@ rm -rf ${RPM_BUILD_ROOT}
%{_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
@@ -228,7 +226,16 @@ rm -rf ${RPM_BUILD_ROOT}
%config(noreplace) %{_sysctldir}/10-default-yama-scope.conf
%changelog
-* Thu Mar 31 2016 Mark Wielaard <[email protected]> 0.166-1
+* Thu Aug 4 2016 Mark Wielaard <[email protected]> 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 <[email protected]> 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.
diff --git a/configure.ac b/configure.ac
index 86a69c66..e5503f10 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,7 +17,7 @@ dnl GNU General Public License for more details.
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.166],[https://bugzilla.redhat.com/],[elfutils])
+AC_INIT([elfutils],[0.167],[https://bugzilla.redhat.com/],[elfutils])
# We want eu- as default program prefix if none was given by the user.
# But if the user explicitly provided --program-prefix="" then pretend
@@ -144,36 +144,6 @@ dnl tests, because the choice of the file model can (in principle) affect
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
- ;;
- *)
- 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)
-
dnl enable debugging of branch prediction.
AC_ARG_ENABLE([debugpred],
AS_HELP_STRING([--enable-debugpred],[build binaries with support to debug branch prediction]),
@@ -298,7 +268,7 @@ AS_IF([test "x$enable_symbol_versioning" = "xno"],
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"])
@@ -319,7 +289,7 @@ AM_CONDITIONAL(SANE_LOGICAL_OP_WARNING,
# -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"
+CFLAGS="$CFLAGS -Wduplicated-cond -Werror"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],
ac_cv_duplicated_cond=yes, ac_cv_duplicated_cond=no)
CFLAGS="$old_CFLAGS"])
@@ -329,7 +299,7 @@ AM_CONDITIONAL(HAVE_DUPLICATED_COND_WARNING,
# -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"
+CFLAGS="$CFLAGS -Wnull-dereference -Werror"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],
ac_cv_null_dereference=yes, ac_cv_null_dereference=no)
CFLAGS="$old_CFLAGS"])
@@ -340,7 +310,7 @@ 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"]
@@ -361,6 +331,10 @@ else
fi
AC_SUBST([argp_LDADD])
+dnl Check if we have <linux/bpf.h> for EM_BPF disassembly.
+AC_CHECK_HEADERS(linux/bpf.h)
+AM_CONDITIONAL(HAVE_LINUX_BPF_H, [test "x$ac_cv_header_linux_bpf_h" = "xyes"])
+
dnl The directories with content.
dnl Documentation.
diff --git a/libasm/ChangeLog b/libasm/ChangeLog
index a8ac2c7c..4c6cb286 100644
--- a/libasm/ChangeLog
+++ b/libasm/ChangeLog
@@ -1,3 +1,24 @@
+2016-07-08 Mark Wielaard <[email protected]>
+
+ * 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 <[email protected]>
+
+ * disasm_cb.c (disasm_cb): Pass ebl to disasm hook.
+
2016-02-12 Mark Wielaard <[email protected]>
* asm_begin.c (prepare_text_output): Only call __fsetlocking when
diff --git a/libasm/Makefile.am b/libasm/Makefile.am
index 64973d1e..f46399f5 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
@@ -66,7 +66,8 @@ 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 \
-Wl,--soname,$@.$(VERSION) \
- ../libebl/libebl.a ../libelf/libelf.so $(libasm_so_LDLIBS)
+ ../libebl/libebl.a ../libelf/libelf.so ../libdw/libdw.so \
+ $(libasm_so_LDLIBS)
@$(textrel_check)
$(AM_V_at)ln -fs $@ $@.$(VERSION)
diff --git a/libasm/asm_begin.c b/libasm/asm_begin.c
index dc83cd8b..6248786c 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 <[email protected]>, 2002.
@@ -115,8 +115,8 @@ prepare_binary_output (AsmCtx_t *result, Ebl *ebl)
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 d21a70a3..191a535a 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 <[email protected]>, 2002.
@@ -62,11 +62,11 @@ static int
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 @@ binary_end (AsmCtx_t *ctx)
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 @@ binary_end (AsmCtx_t *ctx)
}
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 @@ binary_end (AsmCtx_t *ctx)
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 @@ binary_end (AsmCtx_t *ctx)
(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 @@ binary_end (AsmCtx_t *ctx)
/* 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 @@ binary_end (AsmCtx_t *ctx)
}
/* 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 @@ binary_end (AsmCtx_t *ctx)
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 @@ binary_end (AsmCtx_t *ctx)
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 @@ binary_end (AsmCtx_t *ctx)
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 @@ binary_end (AsmCtx_t *ctx)
/* 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;
@@ -600,8 +602,8 @@ __libasm_finictx (AsmCtx_t *ctx)
(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 c5b7beaa..34fef3e3 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 <[email protected]>, 2002.
@@ -80,7 +80,7 @@ asm_newabssym (AsmCtx_t *ctx, const char *name, GElf_Xword size,
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 ee5c1409..ee3b6966 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 <[email protected]>, 2002.
@@ -82,7 +82,7 @@ asm_newcomsym (AsmCtx_t *ctx, const char *name, GElf_Xword size,
/* 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 e2367693..ddbb25df 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 <[email protected]>, 2002.
@@ -129,8 +129,8 @@ binary_newscn (AsmScn_t *result, GElf_Word type, GElf_Xword flags,
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 c5968c1f..80757a9a 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 <[email protected]>, 2002.
@@ -67,8 +67,8 @@ asm_newscngrp (AsmCtx_t *ctx, const char *grpname, AsmSym_t *signature,
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 7f522910..332432a9 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 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <[email protected]>, 2002.
@@ -83,8 +83,8 @@ asm_newsym (AsmScn_t *asmscn, const char *name, GElf_Xword size,
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 +118,7 @@ asm_newsym (AsmScn_t *asmscn, const char *name, GElf_Xword size,
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 eb3689c7..cf278c71 100644
--- a/libasm/disasm_cb.c
+++ b/libasm/disasm_cb.c
@@ -173,7 +173,7 @@ disasm_cb (DisasmCtx_t *ctx, const uint8_t **startp, const uint8_t *end,
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/libasmP.h b/libasm/libasmP.h
index 49b64846..54460cf9 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 @@ struct AsmScn
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 @@ struct AsmCtx
/* 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 @@ struct AsmSym
size_t symidx;
/* Reference to name of the symbol. */
- struct Ebl_Strent *strent;
+ Dwelf_Strent *strent;
};
@@ -215,7 +217,7 @@ struct AsmSym
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 1c954182..57c9e76d 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 <[email protected]>, 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 a5bceffb..d05a40a5 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 c953c7b3..9f3566c0 100644
--- a/libcpu/ChangeLog
+++ b/libcpu/ChangeLog
@@ -1,3 +1,15 @@
+2016-08-10 Richard Henderson <[email protected]>
+
+ * bpf_disasm.c (bpf_disasm): Rearrange the printing of instructions
+ to use exactly the operands required.
+
+2016-06-28 Richard Henderson <[email protected]>
+
+ * 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 <[email protected]>
* Makefile.am (%_defs): Add AM_V_GEN and AM_V_at silencers.
diff --git a/libcpu/Makefile.am b/libcpu/Makefile.am
index 4dd2fb4a..cd3933e0 100644
--- a/libcpu/Makefile.am
+++ b/libcpu/Makefile.am
@@ -47,6 +47,12 @@ i386_gendis_SOURCES = i386_gendis.c i386_lex.l i386_parse.y
i386_disasm.o: i386.mnemonics $(srcdir)/i386_dis.h
x86_64_disasm.o: x86_64.mnemonics $(srcdir)/x86_64_dis.h
+if HAVE_LINUX_BPF_H
+noinst_LIBRARIES += libcpu_bpf.a
+libcpu_bpf_a_SOURCES = bpf_disasm.c
+libcpu_bpf_a_CFLAGS = $(AM_CFLAGS) -Wno-format-nonliteral
+endif
+
%_defs: $(srcdir)/defs/i386
$(AM_V_GEN)m4 -D$* -DDISASSEMBLER $< > $@T
$(AM_V_at)mv -f $@T $@
diff --git a/libcpu/bpf_disasm.c b/libcpu/bpf_disasm.c
new file mode 100644
index 00000000..153dba9d
--- /dev/null
+++ b/libcpu/bpf_disasm.c
@@ -0,0 +1,481 @@
+/* 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 <linux/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 832241f2..ceb5164f 100644
--- a/libcpu/i386_disasm.c
+++ b/libcpu/i386_disasm.c
@@ -313,7 +313,8 @@ struct output_data
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)
{
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 36c332ae..8071fc14 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,9 @@
+2016-07-08 Mark Wielaard <[email protected]>
+
+ * 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 <[email protected]>
* dwarf_getsrclines.c (read_srclines): Calculate ndirs first, then
diff --git a/libdw/libdw.map b/libdw/libdw.map
index 1681b6b5..83cb1d97 100644
--- a/libdw/libdw.map
+++ b/libdw/libdw.map
@@ -327,3 +327,14 @@ ELFUTILS_0.165 {
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;
diff --git a/libdwelf/ChangeLog b/libdwelf/ChangeLog
index fe8af1b4..4211023c 100644
--- a/libdwelf/ChangeLog
+++ b/libdwelf/ChangeLog
@@ -1,3 +1,17 @@
+2016-07-08 Mark Wielaard <[email protected]>
+
+ * 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 <[email protected]>
* Makefile.am (libdwelf_a_SOURCES): Add
diff --git a/libdwelf/Makefile.am b/libdwelf/Makefile.am
index 44d866ac..74a0042a 100644
--- a/libdwelf/Makefile.am
+++ b/libdwelf/Makefile.am
@@ -41,7 +41,8 @@ noinst_HEADERS = libdwelfP.h
libdwelf_a_CFLAGS = -fpic -fvisibility=hidden $(AM_CFLAGS)
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
index 798c34c3..c1b93d4a 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 <[email protected]>, 2000.
@@ -40,7 +40,7 @@
#include <unistd.h>
#include <sys/param.h>
-#include "libebl.h"
+#include "libdwelfP.h"
#include <system.h>
#ifndef MIN
@@ -48,13 +48,13 @@
#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 +67,16 @@ struct memoryblock
};
-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 +87,8 @@ static size_t ps;
#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 +96,8 @@ ebl_strtabinit (bool nullstr)
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 +114,7 @@ ebl_strtabinit (bool nullstr)
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 +136,7 @@ morememory (struct Ebl_Strtab *st, size_t len)
void
-ebl_strtabfree (struct Ebl_Strtab *st)
+dwelf_strtab_free (Dwelf_Strtab *st)
{
struct memoryblock *mb = st->memory;
@@ -151,26 +151,26 @@ ebl_strtabfree (struct Ebl_Strtab *st)
}
-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 +180,8 @@ newstring (struct Ebl_Strtab *st, const char *str, size_t len)
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 +190,8 @@ newstring (struct Ebl_Strtab *st, const char *str, size_t len)
/* 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 +214,30 @@ searchstring (struct Ebl_Strent **sep, struct Ebl_Strent *newstr)
/* 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 +283,20 @@ ebl_strtabadd (struct Ebl_Strtab *st, const char *str, size_t len)
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 +306,7 @@ copystrings (struct Ebl_Strent *nodep, char **freep, size_t *offsetp)
*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 +318,15 @@ copystrings (struct Ebl_Strent *nodep, char **freep, size_t *offsetp)
}
-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 +346,20 @@ ebl_strtabfinalize (struct Ebl_Strtab *st, Elf_Data *data)
if (st->root)
copystrings (st->root, &endp, &copylen);
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 7f7f679a..72089dbf 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 @@ extern ssize_t dwelf_elf_gnu_build_id (Elf *elf, const void **build_idp);
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 5d400bb1..3332db7a 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,17 @@
+2016-08-12 Mark Wielaard <[email protected]>
+
+ * link_map.c (dwfl_link_map_report): Fix assert, set in.d_size.
+
+2016-04-14 Mark Wielaard <[email protected]>
+
+ * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Free match
+ on invalid DWARF if we allocated it.
+
+2016-04-14 Mark Wielaard <[email protected]>
+
+ * linux-proc-maps.c (proc_maps_report): Free last_file on bad file
+ mapping.
+
2016-03-01 Steven Chamberlain <[email protected]>
* linux-pid-attach.c: Removed unused pid_thread_callbacks,
diff --git a/libdwfl/dwfl_module_getsrc_file.c b/libdwfl/dwfl_module_getsrc_file.c
index 21a59159..4eaaeaff 100644
--- a/libdwfl/dwfl_module_getsrc_file.c
+++ b/libdwfl/dwfl_module_getsrc_file.c
@@ -87,6 +87,8 @@ dwfl_module_getsrc_file (Dwfl_Module *mod,
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/link_map.c b/libdwfl/link_map.c
index 28d7382f..794668fc 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
@@ -843,7 +843,10 @@ dwfl_link_map_report (Dwfl *dwfl, const void *auxv, size_t auxv_size,
}
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-proc-maps.c b/libdwfl/linux-proc-maps.c
index 94b26d59..4ae1e74a 100644
--- a/libdwfl/linux-proc-maps.c
+++ b/libdwfl/linux-proc-maps.c
@@ -250,7 +250,10 @@ proc_maps_report (Dwfl *dwfl, FILE *f, GElf_Addr sysinfo_ehdr, pid_t pid)
{
/* 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
diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index 26a4f941..0560c6ac 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -1,3 +1,43 @@
+2016-07-08 Mark Wielaard <[email protected]>
+
+ * 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 <[email protected]>
+
+ * 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 <[email protected]>
+
+ * ebl-hooks.h (EBLHOOK(disasm)): Add ebl parameter.
+ * eblopenbackend.c (machines): Add EM_BPF entry.
+
+2016-05-20 Andreas Schwab <[email protected]>
+
+ * eblopenbackend.c (machines) [EM_68K]: Set class and data.
+
2016-02-12 Mark Wielaard <[email protected]>
* eblobjnotetypename.c (ebl_object_note_type_name): Check name is
diff --git a/libebl/Makefile.am b/libebl/Makefile.am
index 300d26a7..7034b61c 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 Red Hat, Inc.
## This file is part of elfutils.
##
## This file is free software; you can redistribute it and/or modify
@@ -37,13 +37,11 @@ lib_LIBRARIES = libebl.a
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 \
diff --git a/libebl/ebl-hooks.h b/libebl/ebl-hooks.h
index 2e314464..b7253748 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 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 @@ const char *EBLHOOK(dynamic_tag_name) (int64_t, char *, size_t);
/* 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);
@@ -150,7 +144,7 @@ int EBLHOOK(syscall_abi) (Ebl *ebl, int *sp, int *pc,
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/eblgstrtab.c b/libebl/eblgstrtab.c
deleted file mode 100644
index 0d92c00a..00000000
--- 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 <[email protected]>, 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, &copylen);
- assert (copylen == st->total * st->width + nulllen);
-}
-
-
-size_t
-ebl_gstrtaboffset (struct Ebl_GStrent *se)
-{
- return se->offset;
-}
diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c
index 5aec99e0..4259dbe5 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-2016 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -48,6 +48,7 @@ const char *ppc64_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen);
const char *ia64_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen);
const char *s390_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen);
const char *aarch64_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen);
+const char *bpf_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen);
/* This table should contain the complete list of architectures as far
as the ELF specification is concerned. */
@@ -80,7 +81,7 @@ static const struct
{ s390_init, "ebl_s390", "s390", 4, EM_S390, 0, 0 },
{ NULL, "elf_m32", "m32", 3, EM_M32, 0, 0 },
- { NULL, "elf_m68k", "m68k", 4, EM_68K, 0, 0 },
+ { NULL, "elf_m68k", "m68k", 4, EM_68K, ELFCLASS32, ELFDATA2MSB },
{ NULL, "elf_m88k", "m88k", 4, EM_88K, 0, 0 },
{ NULL, "elf_i860", "i860", 4, EM_860, 0, 0 },
{ NULL, "ebl_s370", "s370", 4, EM_S370, 0, 0 },
@@ -139,6 +140,7 @@ static const struct
{ NULL, "elf_arc_a5", "arc_a5", 6, EM_ARC_A5, 0, 0 },
{ NULL, "elf_xtensa", "xtensa", 6, EM_XTENSA, 0, 0 },
{ aarch64_init, "elf_aarch64", "aarch64", 7, EM_AARCH64, ELFCLASS64, 0 },
+ { bpf_init, "elf_bpf", "bpf", 3, EM_BPF, 0, 0 },
};
#define nmachines (sizeof (machines) / sizeof (machines[0]))
@@ -146,8 +148,6 @@ static const struct
#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);
@@ -169,7 +169,6 @@ static const char *default_symbol_binding_name (int ignore, char *buf,
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,
@@ -216,7 +215,6 @@ static int default_abi_cfi (Ebl *ebl, Dwarf_CIE *abi_info);
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;
@@ -233,7 +231,6 @@ fill_defaults (Ebl *result)
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;
@@ -405,14 +402,6 @@ ebl_openbackend_emulation (const char *emulation)
/* 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)))
@@ -529,12 +518,6 @@ default_dynamic_tag_check (int64_t ignore __attribute__ ((unused)))
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)))
{
diff --git a/libebl/eblwstrtab.c b/libebl/eblwstrtab.c
deleted file mode 100644
index 08e0ba77..00000000
--- 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 <[email protected]>, 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, &copylen);
- 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 efcb6d60..c8e01fe9 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 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -89,10 +89,6 @@ extern int ebl_get_elfdata (Ebl *ebl) __attribute__ ((__pure__));
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);
@@ -163,10 +159,6 @@ extern bool ebl_check_special_symbol (Ebl *ebl, GElf_Ehdr *ehdr,
/* 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 +287,6 @@ extern int ebl_syscall_abi (Ebl *ebl, int *sp, int *pc,
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 350e4eb1..77991446 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -1,3 +1,38 @@
+2016-08-07 Mark Wielaard <[email protected]>
+
+ * 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 <[email protected]>
+
+ * elf-knowledge.h (SH_FLAGS_COMBINE): Removed.
+ (SH_FLAGS_IMPORTANT): Likewise.
+
+2016-07-06 Mark Wielaard <[email protected]>
+
+ * 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 <[email protected]>
+
+ * 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 <[email protected]>
+
+ * elf.h: Update from glibc. Add lots of new EM_* definitions.
+
+2016-04-14 Mark Wielaard <[email protected]>
+
+ * elf_compress.c (__libelf_compress): Free out_buf if deflateInit
+ fails.
+
2016-02-13 Mark Wielaard <[email protected]>
* elf32_updatefile.c (updatemmap): Free scns when out of memory.
diff --git a/libelf/elf-knowledge.h b/libelf/elf-knowledge.h
index 24534b38..64f58878 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 <[email protected]>, 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 ce96bd5d..b6112d9d 100644
--- a/libelf/elf.h
+++ b/libelf/elf.h
@@ -172,89 +172,200 @@ typedef struct
/* 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_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_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_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
+#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_BPF 247 /* Linux BPF -- in-kernel virtual machine */
+
+#define EM_NUM 248
+
+/* 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
@@ -3566,6 +3677,10 @@ enum
#define R_TILEGX_NUM 130
+/* BPF specific declarations. */
+
+#define R_BPF_NONE 0 /* No reloc */
+#define R_BPF_MAP_FD 1 /* Map fd to pointer */
__END_DECLS
diff --git a/libelf/elf32_updatenull.c b/libelf/elf32_updatenull.c
index 03de0321..939aa13e 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 <[email protected]>, 2000.
@@ -140,21 +140,10 @@ __elfw2(LIBELFBITS,updatenull_wrlock) (Elf *elf, int *change_bop, size_t shnum)
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 @@ __elfw2(LIBELFBITS,updatenull_wrlock) (Elf *elf, int *change_bop, size_t shnum)
if (shnum > 0)
{
+ struct Elf_Scn *scn1 = NULL;
Elf_ScnList *list;
bool first = true;
@@ -198,10 +188,16 @@ __elfw2(LIBELFBITS,updatenull_wrlock) (Elf *elf, int *change_bop, size_t shnum)
/* 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
{
diff --git a/libelf/elf_compress.c b/libelf/elf_compress.c
index 4c7c35e1..3aebe820 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
@@ -117,6 +117,7 @@ __libelf_compress (Elf_Scn *scn, size_t hsize, int ei_data,
int zrc = deflateInit (&z, Z_BEST_COMPRESSION);
if (zrc != Z_OK)
{
+ free (out_buf);
__libelf_seterrno (ELF_E_COMPRESS_ERROR);
return NULL;
}
@@ -294,6 +295,7 @@ __libelf_decompress_elf (Elf_Scn *scn, size_t *size_out, size_t *addralign)
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 +315,12 @@ __libelf_reset_rawdata (Elf_Scn *scn, void *buf, size_t size, size_t align,
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 fde17b50..160f0b88 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 <[email protected]>, 1998.
@@ -166,7 +166,8 @@ elf_end (Elf *elf)
/* 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_getphdrnum.c b/libelf/elf_getphdrnum.c
index 061183bb..f91cba98 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,35 +84,39 @@ __elf_getphdrnum_chk_rdlock (Elf *elf, size_t *dst)
{
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;
+ }
+
+ /* 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;
}
- 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;
- }
-
- /* 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_nextscn.c b/libelf/elf_nextscn.c
index 62cb8914..d2f3e7cb 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 @@ elf_nextscn (Elf *elf, Elf_Scn *scn)
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
+ 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)
{
- Elf_ScnList *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 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/libelfP.h b/libelf/libelfP.h
index 57ccbce4..44599827 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 <[email protected]>, 1998.
@@ -233,7 +233,13 @@ struct Elf_Scn
} 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. */
diff --git a/po/ChangeLog b/po/ChangeLog
index c83d53bb..c3a2cb57 100644
--- a/po/ChangeLog
+++ b/po/ChangeLog
@@ -1,3 +1,16 @@
+2016-08-24 Mark Wielaard <[email protected]>
+
+ * *.po: Regenerate.
+
+2016-08-04 Mark Wielaard <[email protected]>
+
+ * *.po: Update for 0.167.
+
+2016-07-06 Mark Wielaard <[email protected]>
+
+ * 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 <[email protected]>
* *.po: Update for 0.166.
diff --git a/po/Makevars b/po/Makevars
index 8a8ebc60..15d5d318 100644
--- a/po/Makevars
+++ b/po/Makevars
@@ -9,7 +9,8 @@ top_builddir = ..
# 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
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 02433f9f..648e6828 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -13,7 +13,6 @@ libdwfl/libdwflP.h
libebl/eblbackendname.c
libebl/eblcorenotetypename.c
libebl/ebldynamictagname.c
-libebl/eblobjecttypename.c
libebl/eblobjnote.c
libebl/eblobjnotetypename.c
libebl/eblosabiname.c
@@ -30,12 +29,9 @@ src/ar.c
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 5f79feee..15cb6556 100644
--- a/po/de.po
+++ b/po/de.po
@@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: elfutils VERSION\n"
"Report-Msgid-Bugs-To: http://bugzilla.redhat.com/\n"
-"POT-Creation-Date: 2016-03-31 10:50+0200\n"
+"POT-Creation-Date: 2016-08-25 18:09+0200\n"
"PO-Revision-Date: 2009-06-29 15:15+0200\n"
"Last-Translator: Michael Münch <[email protected]>\n"
"Language-Team: German\n"
@@ -43,7 +43,7 @@ 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:3291
-#: src/readelf.c:3682 src/readelf.c:8430 src/unstrip.c:2233 src/unstrip.c:2438
+#: src/readelf.c:3682 src/readelf.c:8430 src/unstrip.c:2237 src/unstrip.c:2442
#, c-format
msgid "memory exhausted"
msgstr "Kein Speicher mehr verfügbar"
@@ -58,8 +58,7 @@ msgstr "kein Fehler"
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 +70,7 @@ msgstr "ungültiger Parameter"
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"
@@ -247,7 +245,7 @@ msgstr "ungültiger Operand"
msgid "not a CU (unit) DIE"
msgstr ""
-#: libdwfl/argp-std.c:46 src/stack.c:642 src/unstrip.c:2380
+#: libdwfl/argp-std.c:46 src/stack.c:642 src/unstrip.c:2384
msgid "Input selection options:"
msgstr "Eingabeauswahloptionen:"
@@ -289,6 +287,7 @@ msgstr "Nur eine Option von -e, -p, -k, -K, oder --core erlaubt"
msgid "cannot load kernel symbols"
msgstr "Konnte Kernel Symbole nicht laden"
+#. Non-fatal to have no modules since we do have the kernel.
#: libdwfl/argp-std.c:234
msgid "cannot find kernel modules"
msgstr "Konnte Kernel Module nicht finden"
@@ -478,11 +477,10 @@ msgstr "Ungültige ELF Datei"
msgid "No backend"
msgstr "Kein Backend"
-#: libebl/eblcorenotetypename.c:99 libebl/eblobjecttypename.c:53
-#: 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
+#: libebl/eblcorenotetypename.c:99 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>"
@@ -536,6 +534,7 @@ msgstr ""
msgid " Build ID: "
msgstr " Build ID: "
+#. A non-null terminated version string.
#: libebl/eblobjnote.c:152
#, c-format
msgid " Linker version: %.*s\n"
@@ -795,19 +794,21 @@ msgstr ""
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
+#: src/findtextrel.c:162 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:219
+#: src/unstrip.c:233
#, c-format
msgid ""
"Copyright (C) %s Red Hat, Inc.\n"
@@ -820,9 +821,9 @@ msgstr ""
"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
+#: src/findtextrel.c:167 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:224
+#: src/unstrip.c:238
#, c-format
msgid "Written by %s.\n"
msgstr "Geschrieben von %s.\n"
@@ -932,10 +933,12 @@ msgstr "Vollständigen Pfad für Dateiabgleich verwenden."
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...]"
@@ -1070,7 +1073,7 @@ msgstr ""
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:1259 src/objdump.c:253
#, c-format
msgid "cannot open %s"
msgstr "Konnte %s nicht öffnen"
@@ -1108,6 +1111,7 @@ msgstr ""
msgid "%s (default)"
msgstr ""
+#. The archive is too big.
#: src/arlib.c:209
#, c-format
msgid "the archive '%s' is too large"
@@ -1144,10 +1148,12 @@ msgstr ""
msgid "Output nothing; yield exit status only"
msgstr ""
+#. Short description of program.
#: src/elfcmp.c:77
msgid "Compare relevant parts of two ELF files for equality."
msgstr ""
+#. Strings for arguments in help texts.
#: src/elfcmp.c:81
#, fuzzy
msgid "FILE1 FILE2"
@@ -1297,10 +1303,9 @@ msgstr ""
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:732 src/findtextrel.c:221 src/nm.c:378 src/ranlib.c:157
+#: src/size.c:289 src/strings.c:186 src/strip.c:467 src/strip.c:504
+#: src/unstrip.c:2033 src/unstrip.c:2062
#, c-format
msgid "cannot open '%s'"
msgstr "'%s' kann nicht geöffnet werden"
@@ -1330,6 +1335,75 @@ msgstr ""
msgid "cannot get relocation: %s"
msgstr ""
+#: src/elfcompress.c:121 src/strip.c:255 src/unstrip.c:121
+#, c-format
+msgid "-o option specified twice"
+msgstr ""
+
+#: src/elfcompress.c:128
+#, fuzzy, c-format
+msgid "-t option specified twice"
+msgstr "Option -d zweimal angegeben"
+
+#: src/elfcompress.c:137
+#, fuzzy, c-format
+msgid "unknown compression type '%s'"
+msgstr "unbekannter Typ"
+
+#. We need at least one input file.
+#: src/elfcompress.c:149 src/elfcompress.c:1310
+#, fuzzy, c-format
+msgid "No input file given"
+msgstr "Eingabedatei '%s' ignoriert"
+
+#: src/elfcompress.c:155 src/elfcompress.c:1315
+#, c-format
+msgid "Only one input file allowed together with '-o'"
+msgstr ""
+
+#: src/elfcompress.c:1272
+msgid "Place (de)compressed output into FILE"
+msgstr ""
+
+#: src/elfcompress.c:1275
+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:1278
+msgid ""
+"SECTION name to (de)compress, SECTION is an extended wildcard pattern "
+"(defaults to '.?(z)debug*')"
+msgstr ""
+
+#: src/elfcompress.c:1281
+msgid "Print a message for each section being (de)compressed"
+msgstr ""
+
+#: src/elfcompress.c:1284
+msgid "Force compression of section even if it would become larger"
+msgstr ""
+
+#: src/elfcompress.c:1287 src/strip.c:88
+msgid "Relax a few rules to handle slightly broken ELF files"
+msgstr ""
+
+#: src/elfcompress.c:1290
+#, 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:1299 src/elflint.c:78 src/readelf.c:126
+msgid "FILE..."
+msgstr "DATEI..."
+
+#: src/elfcompress.c:1300
+msgid "Compress or decompress sections in an ELF file."
+msgstr ""
+
#: src/elflint.c:64
msgid "Be extremely strict, flag level 2 features."
msgstr ""
@@ -1348,14 +1422,11 @@ msgid ""
"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
#, c-format
msgid "cannot open input file"
@@ -1384,6 +1455,7 @@ msgstr "Dateiname fehlt.\n"
msgid " error while freeing sub-ELF descriptor: %s\n"
msgstr ""
+#. We cannot do anything.
#: src/elflint.c:306
#, fuzzy, c-format
msgid "Not an ELF file - it has the wrong magic bytes at the start\n"
@@ -1583,6 +1655,7 @@ msgid ""
"st_shndx (%<PRIu32>)\n"
msgstr ""
+#. || sym->st_shndx > SHN_HIRESERVE always false
#: src/elflint.c:725
#, c-format
msgid "section [%2d] '%s': symbol %zu: invalid section index\n"
@@ -1699,6 +1772,9 @@ msgid ""
"'%s'\n"
msgstr ""
+#. 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:991
#, c-format
msgid ""
@@ -2531,6 +2607,7 @@ msgid ""
"section [%2d] '%s': offset %zu: invalid length in attribute subsection\n"
msgstr ""
+#. Tag_File
#: src/elflint.c:3512
#, c-format
msgid ""
@@ -3072,12 +3149,14 @@ msgstr ""
msgid "Use PATH as root of debuginfo hierarchy"
msgstr ""
+#. Short description of program.
#: src/findtextrel.c:72
msgid "Locate source of text relocations in FILEs (a.out by default)."
msgstr ""
+#. Strings for arguments in help texts.
#: src/findtextrel.c:76 src/nm.c:108 src/objdump.c:71 src/size.c:83
-#: src/strings.c:88 src/strip.c:95
+#: src/strings.c:88 src/strip.c:96
msgid "[FILE...]"
msgstr ""
@@ -3162,706 +3241,7 @@ 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:66 src/strip.c:68
msgid "Output selection:"
msgstr ""
@@ -3928,7 +3308,7 @@ msgstr "Kennzeichne schwache Symbole"
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:91 src/size.c:71 src/strip.c:73 src/unstrip.c:73
msgid "Output options:"
msgstr "Ausgabeoptionen:"
@@ -3948,6 +3328,7 @@ msgstr "Sortierreihenfolge umkehren"
msgid "Decode low-level symbol names into source code names"
msgstr ""
+#. Short description of program.
#: src/nm.c:105
msgid "List symbols from FILEs (a.out by default)."
msgstr ""
@@ -3957,22 +3338,23 @@ msgstr ""
msgid "Output formatting"
msgstr "Ausgabeformat:"
-#: src/nm.c:140 src/objdump.c:103 src/size.c:108 src/strip.c:127
+#: src/nm.c:140 src/objdump.c:103 src/size.c:108 src/strip.c:128
#, 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:2282
+#: src/strip.c:2300
#, 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:417 src/objdump.c:292 src/strip.c:392
#, c-format
msgid "%s: File format not recognized"
msgstr "%s: Dateiformat nicht erkannt"
+#. Note: 0 is no valid offset.
#: src/nm.c:457
#, fuzzy
msgid ""
@@ -4012,11 +3394,12 @@ msgstr "Kann Suchbaum nicht erstellen"
#: src/readelf.c:1878 src/readelf.c:2068 src/readelf.c:2309 src/readelf.c:2567
#: src/readelf.c:2643 src/readelf.c:2730 src/readelf.c:3310 src/readelf.c:3360
#: src/readelf.c:3423 src/readelf.c:8334 src/readelf.c:9434 src/readelf.c:9637
-#: src/readelf.c:9705 src/size.c:413 src/size.c:482 src/strip.c:520
+#: src/readelf.c:9705 src/size.c:413 src/size.c:482 src/strip.c:521
#, c-format
msgid "cannot get section header string table index"
msgstr ""
+#. We always print this prolog.
#: src/nm.c:787
#, c-format
msgid ""
@@ -4030,6 +3413,7 @@ msgstr ""
"Symbole aus %s:\n"
"\n"
+#. The header line.
#: src/nm.c:790
#, c-format
msgid ""
@@ -4052,6 +3436,7 @@ msgstr "%s: entry size in section `%s' is not what we expect"
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:1542
#, c-format
msgid "%s%s%s%s: Invalid operation"
@@ -4087,6 +3472,7 @@ msgstr "Eingabeauswahloptionen:"
msgid "Only display information for section NAME."
msgstr ""
+#. Short description of program.
#: src/objdump.c:67
msgid "Show information from FILEs (a.out by default)."
msgstr ""
@@ -4130,10 +3516,12 @@ msgstr "Inhalt des Abschnitts %s:\n"
msgid "cannot disassemble"
msgstr "Disassemblieren nicht möglich"
+#. Short description of program.
#: src/ranlib.c:65
msgid "Generate an index to speed access to archives."
msgstr "Erstelle einen Index zur Beschleunigung des Zugriffs auf Archive."
+#. Strings for arguments in help texts.
#: src/ranlib.c:68
msgid "ARCHIVE"
msgstr "ARCHIV"
@@ -4266,6 +3654,7 @@ msgid ""
"decompress section before dumping data (when used with -p or -x)"
msgstr ""
+#. Short description of program.
#: src/readelf.c:122
msgid "Print information from ELF file in human-readable form."
msgstr "Informationen aus der ELF-Datei in menschenlesbarer Form ausgeben."
@@ -4280,16 +3669,21 @@ msgstr ""
msgid "cannot generate Elf descriptor: %s"
msgstr "konnte Elf-Deskriptor nicht erzeugen: %s"
+#: src/readelf.c:536 src/readelf.c:852 src/strip.c:590
+#, c-format
+msgid "cannot determine number of sections: %s"
+msgstr ""
+
#: src/readelf.c:554 src/readelf.c:1145 src/readelf.c:1347
#, c-format
msgid "cannot get section: %s"
msgstr ""
#: src/readelf.c:563 src/readelf.c:1152 src/readelf.c:1355 src/readelf.c:9657
-#: 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/unstrip.c:388 src/unstrip.c:419 src/unstrip.c:468 src/unstrip.c:578
+#: src/unstrip.c:595 src/unstrip.c:632 src/unstrip.c:830 src/unstrip.c:1119
+#: src/unstrip.c:1311 src/unstrip.c:1371 src/unstrip.c:1492 src/unstrip.c:1545
+#: src/unstrip.c:1660 src/unstrip.c:1800 src/unstrip.c:1895
#, c-format
msgid "cannot get section header: %s"
msgstr ""
@@ -4390,6 +3784,7 @@ msgstr ""
msgid "OS Specific: (%x)\n"
msgstr ""
+#. && e_type <= ET_HIPROC always true
#: src/readelf.c:959
#, c-format
msgid "Processor Specific: (%x)\n"
@@ -4513,6 +3908,7 @@ msgstr ""
msgid " (%<PRIu32> in [0].sh_size)"
msgstr ""
+#. We managed to get the zeroth section.
#: src/readelf.c:1060
#, c-format
msgid " (%<PRIu32> in [0].sh_link)"
@@ -4600,7 +3996,7 @@ msgid ""
" Segment Sections..."
msgstr ""
-#: src/readelf.c:1336 src/unstrip.c:1950 src/unstrip.c:1992 src/unstrip.c:1999
+#: src/readelf.c:1336 src/unstrip.c:1954 src/unstrip.c:1996 src/unstrip.c:2003
#, c-format
msgid "cannot get program header: %s"
msgstr ""
@@ -4713,6 +4109,12 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
+#. 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:1896 src/readelf.c:2086
#, c-format
msgid ""
@@ -4836,6 +4238,7 @@ msgstr ""
msgid " %#06x: Parent %d: %s\n"
msgstr ""
+#. Print the header.
#: src/readelf.c:2957
#, c-format
msgid ""
@@ -4955,11 +4358,13 @@ msgstr ""
msgid " %-13s %4<PRIu32>\n"
msgstr " %-13s %4<PRIu32>\n"
+#. Unknown subsection, print and skip.
#: src/readelf.c:3520
#, c-format
msgid " %-4u %12<PRIu32>\n"
msgstr " %-4u %12<PRIu32>\n"
+#. Tag_File
#: src/readelf.c:3525
#, c-format
msgid " File: %11<PRIu32>\n"
@@ -5238,6 +4643,8 @@ msgstr ""
msgid " [%6tx] empty list\n"
msgstr " [%6tx] %s..%s\n"
+#. We have an address range entry.
+#. First address range entry in a list.
#: src/readelf.c:5016
#, c-format
msgid " [%6tx] %s..%s\n"
@@ -5377,6 +4784,7 @@ msgstr ""
msgid "cannot get line data section data: %s"
msgstr ""
+#. Print what we got so far.
#: src/readelf.c:6565
#, c-format
msgid ""
@@ -5464,11 +4872,13 @@ msgstr ""
msgid " set discriminator to %u\n"
msgstr ""
+#. Unknown, ignore it.
#: src/readelf.c:6841
#, fuzzy
msgid " unknown opcode"
msgstr "unbekannter Typ"
+#. Takes no argument.
#: src/readelf.c:6853
msgid " copy"
msgstr ""
@@ -5503,6 +4913,7 @@ msgstr ""
msgid " set '%s' to %<PRIuFAST8>\n"
msgstr ""
+#. Takes no argument.
#: src/readelf.c:6910
msgid " set basic block flag"
msgstr ""
@@ -5522,10 +4933,12 @@ msgstr ""
msgid " advance address by fixed value %u to %s\n"
msgstr ""
+#. Takes no argument.
#: src/readelf.c:6954
msgid " set prologue end flag"
msgstr ""
+#. Takes no argument.
#: src/readelf.c:6959
msgid " set epilogue begin flag"
msgstr ""
@@ -5535,6 +4948,9 @@ msgstr ""
msgid " set isa to %u\n"
msgstr ""
+#. 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:6977
#, c-format
msgid " unknown opcode with %<PRIu8> parameter:"
@@ -5547,6 +4963,7 @@ msgstr[1] ""
msgid "cannot get .debug_loc content: %s"
msgstr ""
+#. First entry in a list.
#: src/readelf.c:7084
#, c-format
msgid " [%6tx] %s..%s"
@@ -5938,6 +5355,7 @@ msgstr ""
msgid "Display the total sizes (bsd only)"
msgstr ""
+#. Short description of program.
#: src/size.c:79
msgid "List section sizes of FILEs (a.out by default)."
msgstr ""
@@ -6112,6 +5530,7 @@ msgstr ""
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 ""
@@ -6146,513 +5565,521 @@ msgstr "mprotect fehlgeschlagen"
msgid "Skipping section %zd '%s' data outside file"
msgstr ""
-#: src/strip.c:68
+#: src/strip.c:69
msgid "Place stripped output into FILE"
msgstr ""
-#: src/strip.c:69
+#: src/strip.c:70
msgid "Extract the removed sections into FILE"
msgstr ""
-#: src/strip.c:70
+#: src/strip.c:71
msgid "Embed name FILE instead of -f argument"
msgstr ""
-#: src/strip.c:74
+#: src/strip.c:75
msgid "Remove all debugging symbols"
msgstr ""
-#: src/strip.c:78
+#: src/strip.c:79
msgid "Remove section headers (not recommended)"
msgstr ""
-#: src/strip.c:80
+#: src/strip.c:81
msgid "Copy modified/access timestamps to the output"
msgstr ""
-#: src/strip.c:82
+#: src/strip.c:83
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:85
msgid "Remove .comment section"
msgstr ""
-#: src/strip.c:87
-msgid "Relax a few rules to handle slightly broken ELF files"
-msgstr ""
-
-#: src/strip.c:92
+#. Short description of program.
+#: src/strip.c:93
msgid "Discard symbols from object files."
msgstr ""
-#: src/strip.c:186
+#: src/strip.c:187
#, c-format
msgid "--reloc-debug-sections used without -f"
msgstr ""
-#: src/strip.c:200
+#: src/strip.c:201
#, c-format
msgid "Only one input file allowed together with '-o' and '-f'"
msgstr ""
-#: src/strip.c:236
+#: src/strip.c:237
#, c-format
msgid "-f option specified twice"
msgstr ""
-#: src/strip.c:245
+#: src/strip.c:246
#, c-format
msgid "-F option specified twice"
msgstr ""
-#: src/strip.c:254 src/unstrip.c:120
-#, c-format
-msgid "-o option specified twice"
-msgstr ""
-
-#: src/strip.c:278
+#: src/strip.c:279
#, c-format
msgid "-R option supports only .comment section"
msgstr ""
-#: src/strip.c:320 src/strip.c:344
+#: src/strip.c:321 src/strip.c:345
#, c-format
msgid "cannot stat input file '%s'"
msgstr ""
-#: src/strip.c:334
+#: src/strip.c:335
#, c-format
msgid "while opening '%s'"
msgstr ""
-#: src/strip.c:372
+#: src/strip.c:373
#, 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:385
#, 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:484
#, c-format
msgid "cannot open EBL backend"
msgstr ""
-#: src/strip.c:528
+#: src/strip.c:529
#, 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:545 src/strip.c:569
#, c-format
msgid "cannot create new file '%s': %s"
msgstr ""
-#: src/strip.c:634
+#: src/strip.c:635
#, c-format
msgid "illformed file '%s'"
msgstr ""
-#: src/strip.c:968 src/strip.c:1067
+#: src/strip.c:969 src/strip.c:1068
#, c-format
msgid "while generating output file: %s"
msgstr ""
-#: src/strip.c:1033 src/strip.c:2073
+#: src/strip.c:1034 src/strip.c:2091
#, c-format
msgid "%s: error while creating ELF header: %s"
msgstr ""
-#: src/strip.c:1050
+#: src/strip.c:1051
#, c-format
msgid "while preparing output for '%s'"
msgstr ""
-#: src/strip.c:1108 src/strip.c:1171
+#: src/strip.c:1109 src/strip.c:1172
#, c-format
msgid "while create section header section: %s"
msgstr ""
-#: src/strip.c:1117
+#: src/strip.c:1118
#, c-format
msgid "cannot allocate section data: %s"
msgstr ""
-#: src/strip.c:1183
+#: src/strip.c:1184
#, c-format
msgid "while create section header string table: %s"
msgstr ""
-#: src/strip.c:1863
+#: src/strip.c:1191
+#, c-format
+msgid "no memory to create section header string table"
+msgstr ""
+
+#: src/strip.c:1877
#, fuzzy, c-format
msgid "bad relocation"
msgstr "Relocations anzeigen"
-#: src/strip.c:1984 src/strip.c:2097
+#: src/strip.c:2002 src/strip.c:2115
#, c-format
msgid "while writing '%s': %s"
msgstr ""
-#: src/strip.c:1995
+#: src/strip.c:2013
#, c-format
msgid "while creating '%s'"
msgstr ""
-#: src/strip.c:2018
+#: src/strip.c:2036
#, c-format
msgid "while computing checksum for debug information"
msgstr ""
-#: src/strip.c:2082
+#: src/strip.c:2100
#, c-format
msgid "%s: error while reading the file: %s"
msgstr ""
-#: src/strip.c:2122 src/strip.c:2142
+#: src/strip.c:2140 src/strip.c:2160
#, fuzzy, c-format
msgid "while writing '%s'"
msgstr "beim Schliessen von '%s'"
-#: src/strip.c:2179 src/strip.c:2186
+#: src/strip.c:2197 src/strip.c:2204
#, c-format
msgid "error while finishing '%s': %s"
msgstr ""
-#: src/strip.c:2203 src/strip.c:2275
+#: src/strip.c:2221 src/strip.c:2293
#, 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:253
#, c-format
msgid "cannot create ELF header: %s"
msgstr ""
-#: src/unstrip.c:257
+#: src/unstrip.c:258
#, c-format
msgid "cannot copy ELF header: %s"
msgstr ""
-#: src/unstrip.c:261 src/unstrip.c:1939 src/unstrip.c:1982
+#: src/unstrip.c:262 src/unstrip.c:1943 src/unstrip.c:1986
#, 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:267 src/unstrip.c:1947
#, c-format
msgid "cannot create program headers: %s"
msgstr "konnte Programm-Kopf nicht erstellen: %s"
-#: src/unstrip.c:272
+#: src/unstrip.c:273
#, c-format
msgid "cannot copy program header: %s"
msgstr "konnte Programm-Kopf nicht kopieren: %s"
-#: src/unstrip.c:282
+#: src/unstrip.c:283
#, c-format
msgid "cannot copy section header: %s"
msgstr ""
-#: src/unstrip.c:285 src/unstrip.c:1576
+#: src/unstrip.c:286 src/unstrip.c:1578
#, 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:288 src/unstrip.c:1580
#, c-format
msgid "cannot copy section data: %s"
msgstr "konnte Abschnittsdaten nicht kopieren: %s"
-#: src/unstrip.c:311
+#: src/unstrip.c:312
#, 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:384 src/unstrip.c:804 src/unstrip.c:1612
#, 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:400 src/unstrip.c:621 src/unstrip.c:642 src/unstrip.c:654
+#: src/unstrip.c:1633 src/unstrip.c:1809 src/unstrip.c:1833
#, c-format
msgid "cannot update symbol table: %s"
msgstr "konnte Symboltabelle nicht aktualisieren: %s"
-#: src/unstrip.c:409
+#: src/unstrip.c:410
#, c-format
msgid "cannot update section header: %s"
msgstr ""
-#: src/unstrip.c:448 src/unstrip.c:459
+#: src/unstrip.c:449 src/unstrip.c:460
#, c-format
msgid "cannot update relocation: %s"
msgstr ""
-#: src/unstrip.c:547
+#: src/unstrip.c:548
#, c-format
msgid "cannot get symbol version: %s"
msgstr ""
-#: src/unstrip.c:560
+#: src/unstrip.c:561
#, c-format
msgid "unexpected section type in [%zu] with sh_link to symtab"
msgstr ""
-#: src/unstrip.c:809
+#: src/unstrip.c:810
#, 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:968 src/unstrip.c:1315
#, 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:1009 src/unstrip.c:1028 src/unstrip.c:1063
#, c-format
msgid "cannot read '.gnu.prelink_undo' section: %s"
msgstr ""
-#: src/unstrip.c:1048
+#: src/unstrip.c:1049
#, c-format
msgid "invalid contents in '%s' section"
msgstr ""
-#: src/unstrip.c:1054
+#: src/unstrip.c:1055
#, c-format
msgid "overflow with shnum = %zu in '%s' section"
msgstr ""
-#: src/unstrip.c:1108 src/unstrip.c:1433
+#: src/unstrip.c:1109 src/unstrip.c:1435
#, 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:1234 src/unstrip.c:1249 src/unstrip.c:1516 src/unstrip.c:1768
#, c-format
msgid "cannot add section name to string table: %s"
msgstr ""
-#: src/unstrip.c:1257
+#: src/unstrip.c:1258
#, c-format
msgid "cannot update section header string table data: %s"
msgstr ""
-#: src/unstrip.c:1284 src/unstrip.c:1288
+#: src/unstrip.c:1286 src/unstrip.c:1290
#, 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:1294 src/unstrip.c:1298 src/unstrip.c:1531
#, c-format
msgid "cannot get section count: %s"
msgstr ""
-#: src/unstrip.c:1299
+#: src/unstrip.c:1301
#, 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:1360 src/unstrip.c:1450
#, c-format
msgid "cannot read section header string table: %s"
msgstr ""
-#: src/unstrip.c:1508
+#: src/unstrip.c:1510
#, c-format
msgid "cannot add new section: %s"
msgstr ""
-#: src/unstrip.c:1618
+#: src/unstrip.c:1620
#, fuzzy, c-format
msgid "symbol [%zu] has invalid section index"
msgstr "ungültiger Abschnittsindex"
-#: src/unstrip.c:1900
+#: src/unstrip.c:1904
#, fuzzy, c-format
msgid "cannot read section data: %s"
msgstr "konnte Abschnittsdaten nicht holen: %s"
-#: src/unstrip.c:1921
+#: src/unstrip.c:1925
#, c-format
msgid "cannot get ELF header: %s"
msgstr ""
-#: src/unstrip.c:1953
+#: src/unstrip.c:1933
+#, c-format
+msgid "cannot update ELF header: %s"
+msgstr ""
+
+#: src/unstrip.c:1957
#, 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:1962 src/unstrip.c:2044
#, c-format
msgid "cannot write output file: %s"
msgstr ""
-#: src/unstrip.c:2009
+#: src/unstrip.c:2013
#, c-format
msgid "DWARF data not adjusted for prelinking bias; consider prelink -u"
msgstr ""
-#: src/unstrip.c:2012
+#: src/unstrip.c:2016
#, 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:2035 src/unstrip.c:2086 src/unstrip.c:2098 src/unstrip.c:2184
#, c-format
msgid "cannot create ELF descriptor: %s"
msgstr ""
-#: src/unstrip.c:2073
+#: src/unstrip.c:2077
msgid "WARNING: "
msgstr ""
-#: src/unstrip.c:2075
+#: src/unstrip.c:2079
msgid ", use --force"
msgstr ""
-#: src/unstrip.c:2098
+#: src/unstrip.c:2102
msgid "ELF header identification (e_ident) different"
msgstr ""
-#: src/unstrip.c:2101
+#: src/unstrip.c:2105
msgid "ELF header type (e_type) different"
msgstr ""
-#: src/unstrip.c:2104
+#: src/unstrip.c:2108
msgid "ELF header machine type (e_machine) different"
msgstr ""
-#: src/unstrip.c:2107
+#: src/unstrip.c:2111
msgid "stripped program header (e_phnum) smaller than unstripped"
msgstr ""
-#: src/unstrip.c:2137
+#: src/unstrip.c:2141
#, c-format
msgid "cannot find stripped file for module '%s': %s"
msgstr ""
-#: src/unstrip.c:2141
+#: src/unstrip.c:2145
#, c-format
msgid "cannot open stripped file '%s' for module '%s': %s"
msgstr ""
-#: src/unstrip.c:2156
+#: src/unstrip.c:2160
#, c-format
msgid "cannot find debug file for module '%s': %s"
msgstr ""
-#: src/unstrip.c:2160
+#: src/unstrip.c:2164
#, c-format
msgid "cannot open debug file '%s' for module '%s': %s"
msgstr ""
-#: src/unstrip.c:2173
+#: src/unstrip.c:2177
#, c-format
msgid "module '%s' file '%s' is not stripped"
msgstr ""
-#: src/unstrip.c:2204
+#: src/unstrip.c:2208
#, c-format
msgid "cannot cache section addresses for module '%s': %s"
msgstr ""
-#: src/unstrip.c:2337
+#: src/unstrip.c:2341
#, c-format
msgid "no matching modules found"
msgstr "kein passendes Modul gefunden"
-#: src/unstrip.c:2346
+#: src/unstrip.c:2350
#, c-format
msgid "matched more than one module"
msgstr "mehr als ein passendes Modul"
-#: src/unstrip.c:2390
+#: src/unstrip.c:2394
msgid ""
"STRIPPED-FILE DEBUG-FILE\n"
"[MODULE...]"
msgstr ""
-#: src/unstrip.c:2391
+#: src/unstrip.c:2395
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"
@@ -6679,7 +6106,7 @@ msgid ""
"was found, or . if FILE contains the debug information."
msgstr ""
-#: tests/backtrace.c:427
+#: tests/backtrace.c:430
msgid "Run executable"
msgstr ""
@@ -6691,6 +6118,60 @@ msgstr ""
msgid "Show instances of inlined functions"
msgstr ""
+#~ 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"
diff --git a/po/es.po b/po/es.po
index 28f696e5..ea6ca63f 100644
--- a/po/es.po
+++ b/po/es.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: elfutils.master.es\n"
"Report-Msgid-Bugs-To: http://bugzilla.redhat.com/\n"
-"POT-Creation-Date: 2016-03-31 10:50+0200\n"
+"POT-Creation-Date: 2016-08-25 18:09+0200\n"
"PO-Revision-Date: 2011-01-10 15:17-0300\n"
"Last-Translator: Claudio Rodrigo Pereyra Diaz <claudiorodrigo@pereyradiaz."
"com.ar>\n"
@@ -45,7 +45,7 @@ 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:3291
-#: src/readelf.c:3682 src/readelf.c:8430 src/unstrip.c:2233 src/unstrip.c:2438
+#: src/readelf.c:3682 src/readelf.c:8430 src/unstrip.c:2237 src/unstrip.c:2442
#, c-format
msgid "memory exhausted"
msgstr "memoria agotada"
@@ -60,8 +60,7 @@ msgstr "ningún error"
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 +72,7 @@ msgstr "Parámetro inválido"
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"
@@ -248,7 +246,7 @@ msgstr "operando inválido"
msgid "not a CU (unit) DIE"
msgstr ""
-#: libdwfl/argp-std.c:46 src/stack.c:642 src/unstrip.c:2380
+#: libdwfl/argp-std.c:46 src/stack.c:642 src/unstrip.c:2384
msgid "Input selection options:"
msgstr "Opciones de selección de entrada:"
@@ -292,6 +290,7 @@ msgstr "Sólo uno de -e, -p, -k, -K, ó --core está permitido"
msgid "cannot load kernel symbols"
msgstr "No se pueden cargar símbolos de kernel"
+#. Non-fatal to have no modules since we do have the kernel.
#: libdwfl/argp-std.c:234
msgid "cannot find kernel modules"
msgstr "no se pueden hallar módulos de kernel"
@@ -475,11 +474,10 @@ msgstr "no es un archivo ELF válido"
msgid "No backend"
msgstr "No hay segundo plano (Backend)"
-#: libebl/eblcorenotetypename.c:99 libebl/eblobjecttypename.c:53
-#: 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
+#: libebl/eblcorenotetypename.c:99 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>"
@@ -533,6 +531,7 @@ msgstr ""
msgid " Build ID: "
msgstr " Build ID: "
+#. A non-null terminated version string.
#: libebl/eblobjnote.c:152
#, c-format
msgid " Linker version: %.*s\n"
@@ -796,6 +795,7 @@ msgstr ""
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)."
@@ -803,14 +803,15 @@ msgstr ""
"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
+#: src/findtextrel.c:162 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:219
+#: src/unstrip.c:233
#, c-format
msgid ""
"Copyright (C) %s Red Hat, Inc.\n"
@@ -824,9 +825,9 @@ msgstr ""
"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
+#: src/findtextrel.c:167 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:224
+#: src/unstrip.c:238
#, c-format
msgid "Written by %s.\n"
msgstr "Escrito por %s.\n"
@@ -935,10 +936,12 @@ msgstr "Usar la ruta total para fichero coincidente."
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...]"
@@ -1073,7 +1076,7 @@ msgstr "no se encuentra miembro de posición %s "
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:1259 src/objdump.c:253
#, c-format
msgid "cannot open %s"
msgstr "no sepuede abrir %s"
@@ -1111,6 +1114,7 @@ msgstr ""
msgid "%s (default)"
msgstr ""
+#. The archive is too big.
#: src/arlib.c:209
#, c-format
msgid "the archive '%s' is too large"
@@ -1149,10 +1153,12 @@ msgstr ""
msgid "Output nothing; yield exit status only"
msgstr "Nada de salida; producir estado de salida únicamente"
+#. Short description of program.
#: src/elfcmp.c:77
msgid "Compare relevant parts of two ELF files for equality."
msgstr "Comparar partes relevantes de dos ficheros ELF para igualdad."
+#. Strings for arguments in help texts.
#: src/elfcmp.c:81
msgid "FILE1 FILE2"
msgstr "FICHERO1 FICHERO2"
@@ -1304,10 +1310,9 @@ msgstr "%s %s differ: brecha"
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:732 src/findtextrel.c:221 src/nm.c:378 src/ranlib.c:157
+#: src/size.c:289 src/strings.c:186 src/strip.c:467 src/strip.c:504
+#: src/unstrip.c:2033 src/unstrip.c:2062
#, c-format
msgid "cannot open '%s'"
msgstr "Imposible abrir '%s'"
@@ -1337,6 +1342,77 @@ msgstr "No se puede obtener contenido de sección %zu: %s"
msgid "cannot get relocation: %s"
msgstr "No se puede obtener reubicación: %s"
+#: src/elfcompress.c:121 src/strip.c:255 src/unstrip.c:121
+#, c-format
+msgid "-o option specified twice"
+msgstr "opción -o especificada dos veces"
+
+#: src/elfcompress.c:128
+#, fuzzy, c-format
+msgid "-t option specified twice"
+msgstr "opción -f especificada dos veces"
+
+#: src/elfcompress.c:137
+#, fuzzy, c-format
+msgid "unknown compression type '%s'"
+msgstr "tipo desconocido"
+
+#. We need at least one input file.
+#: src/elfcompress.c:149 src/elfcompress.c:1310
+#, fuzzy, c-format
+msgid "No input file given"
+msgstr "archivo de entrada vacío"
+
+#: src/elfcompress.c:155 src/elfcompress.c:1315
+#, 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:1272
+#, fuzzy
+msgid "Place (de)compressed output into FILE"
+msgstr "Colocar la salida obtenida en FICHERO"
+
+#: src/elfcompress.c:1275
+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:1278
+msgid ""
+"SECTION name to (de)compress, SECTION is an extended wildcard pattern "
+"(defaults to '.?(z)debug*')"
+msgstr ""
+
+#: src/elfcompress.c:1281
+msgid "Print a message for each section being (de)compressed"
+msgstr ""
+
+#: src/elfcompress.c:1284
+msgid "Force compression of section even if it would become larger"
+msgstr ""
+
+#: src/elfcompress.c:1287 src/strip.c:88
+msgid "Relax a few rules to handle slightly broken ELF files"
+msgstr "Relaja algunas reglas para manejar ficheros ELF rotos"
+
+#: src/elfcompress.c:1290
+#, 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:1299 src/elflint.c:78 src/readelf.c:126
+msgid "FILE..."
+msgstr "FICHERO..."
+
+#: src/elfcompress.c:1300
+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."
@@ -1357,14 +1433,11 @@ msgstr ""
"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
#, c-format
msgid "cannot open input file"
@@ -1393,6 +1466,7 @@ msgstr "Falta el nombre de archivo.\n"
msgid " error while freeing sub-ELF descriptor: %s\n"
msgstr " error al liberar descriptor sub-ELF: %s\n"
+#. We cannot do anything.
#: src/elflint.c:306
#, c-format
msgid "Not an ELF file - it has the wrong magic bytes at the start\n"
@@ -1609,6 +1683,7 @@ msgstr ""
"Sección [%2d] '%s': símbolo %zu: XINDEX es utilizado para índice que pueda "
"caber en st_shndx (%<PRIu32>)\n"
+#. || sym->st_shndx > SHN_HIRESERVE always false
#: src/elflint.c:725
#, c-format
msgid "section [%2d] '%s': symbol %zu: invalid section index\n"
@@ -1749,6 +1824,9 @@ msgstr ""
"Sección [%2d] '%s': símbolo _GLOBAL_OFFSET_TABLE_ se refiere a sección [%2d] "
"'%s'\n"
+#. 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:991
#, c-format
msgid ""
@@ -2729,6 +2807,7 @@ msgstr ""
"Sección [%2d] '%s': compensación %zu: longitud inválida en sub-sección de "
"atributo\n"
+#. Tag_File
#: src/elflint.c:3512
#, c-format
msgid ""
@@ -3361,13 +3440,15 @@ msgstr "Agregar RUTA a todos los nombres de ficheros"
msgid "Use PATH as root of debuginfo hierarchy"
msgstr "Usar RUTA como root de jerarquía de debuginfo"
+#. Short description of program.
#: src/findtextrel.c:72
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)."
+#. Strings for arguments in help texts.
#: src/findtextrel.c:76 src/nm.c:108 src/objdump.c:71 src/size.c:83
-#: src/strings.c:88 src/strip.c:95
+#: src/strings.c:88 src/strip.c:96
msgid "[FILE...]"
msgstr "[FICHERO...]"
@@ -3462,751 +3543,7 @@ msgstr ""
"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:66 src/strip.c:68
msgid "Output selection:"
msgstr "Selección de salida:"
@@ -4271,7 +3608,7 @@ msgstr "Marcar símbolos débiles"
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:91 src/size.c:71 src/strip.c:73 src/unstrip.c:73
msgid "Output options:"
msgstr "Opciones de salida:"
@@ -4291,6 +3628,7 @@ msgstr "Invertir el orden"
msgid "Decode low-level symbol names into source code names"
msgstr ""
+#. Short description of program.
#: src/nm.c:105
msgid "List symbols from FILEs (a.out by default)."
msgstr "Listar símbolos de FICHEROS (a.out por defecto)."
@@ -4300,22 +3638,23 @@ msgstr "Listar símbolos de FICHEROS (a.out por defecto)."
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:140 src/objdump.c:103 src/size.c:108 src/strip.c:128
#, 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:2282
+#: src/strip.c:2300
#, 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:417 src/objdump.c:292 src/strip.c:392
#, c-format
msgid "%s: File format not recognized"
msgstr "%s: No se reconoce el formato del fichero"
+#. Note: 0 is no valid offset.
#: src/nm.c:457
#, fuzzy
msgid ""
@@ -4355,11 +3694,12 @@ msgstr "No se puede crear el árbol de búsqueda"
#: src/readelf.c:1878 src/readelf.c:2068 src/readelf.c:2309 src/readelf.c:2567
#: src/readelf.c:2643 src/readelf.c:2730 src/readelf.c:3310 src/readelf.c:3360
#: src/readelf.c:3423 src/readelf.c:8334 src/readelf.c:9434 src/readelf.c:9637
-#: src/readelf.c:9705 src/size.c:413 src/size.c:482 src/strip.c:520
+#: src/readelf.c:9705 src/size.c:413 src/size.c:482 src/strip.c:521
#, c-format
msgid "cannot get section header string table index"
msgstr "no se puede obtener índice de cadena de encabezamiento de sección"
+#. We always print this prolog.
#: src/nm.c:787
#, c-format
msgid ""
@@ -4373,6 +3713,7 @@ msgstr ""
"Símbolos de %s:\n"
"\n"
+#. The header line.
#: src/nm.c:790
#, c-format
msgid ""
@@ -4399,6 +3740,7 @@ 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:1542
#, c-format
msgid "%s%s%s%s: Invalid operation"
@@ -4434,6 +3776,7 @@ msgstr "Selección de opción de salida:"
msgid "Only display information for section NAME."
msgstr "Sólo muestra información para NOMBRE de sección."
+#. Short description of program.
#: src/objdump.c:67
msgid "Show information from FILEs (a.out by default)."
msgstr "Muestra información de FICHEROS (a.out por defecto)."
@@ -4480,10 +3823,12 @@ msgstr "Contenido de la sección %s:\n"
msgid "cannot disassemble"
msgstr "No se puede desensamblar"
+#. Short description of program.
#: src/ranlib.c:65
msgid "Generate an index to speed access to archives."
msgstr " Generar un índice para acelerar el acceso a los archivos."
+#. Strings for arguments in help texts.
#: src/ranlib.c:68
msgid "ARCHIVE"
msgstr "ARCHIVO "
@@ -4618,6 +3963,7 @@ msgid ""
"decompress section before dumping data (when used with -p or -x)"
msgstr ""
+#. Short description of program.
#: src/readelf.c:122
msgid "Print information from ELF file in human-readable form."
msgstr ""
@@ -4634,16 +3980,21 @@ msgstr "Sección de depuración DWARF desconocida `%s'.\n"
msgid "cannot generate Elf descriptor: %s"
msgstr "no se puede crear descriptor ELF: %s"
+#: src/readelf.c:536 src/readelf.c:852 src/strip.c:590
+#, c-format
+msgid "cannot determine number of sections: %s"
+msgstr "no se pudieron determinar el número de secciones: %s"
+
#: src/readelf.c:554 src/readelf.c:1145 src/readelf.c:1347
#, 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:9657
-#: 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/unstrip.c:388 src/unstrip.c:419 src/unstrip.c:468 src/unstrip.c:578
+#: src/unstrip.c:595 src/unstrip.c:632 src/unstrip.c:830 src/unstrip.c:1119
+#: src/unstrip.c:1311 src/unstrip.c:1371 src/unstrip.c:1492 src/unstrip.c:1545
+#: src/unstrip.c:1660 src/unstrip.c:1800 src/unstrip.c:1895
#, c-format
msgid "cannot get section header: %s"
msgstr "No se puede obtener encabezamiento de sección: %s"
@@ -4744,6 +4095,7 @@ msgstr "CORE (Fichero núcleo)"
msgid "OS Specific: (%x)\n"
msgstr "OS Specific: (%x)\n"
+#. && e_type <= ET_HIPROC always true
#: src/readelf.c:959
#, c-format
msgid "Processor Specific: (%x)\n"
@@ -4873,6 +4225,7 @@ msgstr " Cantidad de entradas en los encabezamientos de sección: %<PRId16>"
msgid " (%<PRIu32> in [0].sh_size)"
msgstr " (%<PRIu32> en [0].sh_size)"
+#. We managed to get the zeroth section.
#: src/readelf.c:1060
#, c-format
msgid " (%<PRIu32> in [0].sh_link)"
@@ -4975,7 +4328,7 @@ msgstr ""
" 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:1336 src/unstrip.c:1954 src/unstrip.c:1996 src/unstrip.c:2003
#, c-format
msgid "cannot get program header: %s"
msgstr "no se puede obtener memoria para encabezamiento del programa: %s"
@@ -5112,6 +4465,12 @@ msgstr[1] ""
"Sección de reubicación [%2zu] '%s' para sección [%2u] '%s' en compensación "
"%#0<PRIx64> contiene entradas %d:\n"
+#. 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:1896 src/readelf.c:2086
#, c-format
msgid ""
@@ -5262,6 +4621,7 @@ msgstr ""
msgid " %#06x: Parent %d: %s\n"
msgstr " %#06x: Principal %d: %s\n"
+#. Print the header.
#: src/readelf.c:2957
#, c-format
msgid ""
@@ -5415,11 +4775,13 @@ msgstr " Propietario Tamaño\n"
msgid " %-13s %4<PRIu32>\n"
msgstr " %-13s %4<PRIu32>\n"
+#. Unknown subsection, print and skip.
#: src/readelf.c:3520
#, c-format
msgid " %-4u %12<PRIu32>\n"
msgstr " %-4u %12<PRIu32>\n"
+#. Tag_File
#: src/readelf.c:3525
#, c-format
msgid " File: %11<PRIu32>\n"
@@ -5713,6 +5075,8 @@ msgstr " [%6tx] (dirección base) %s\n"
msgid " [%6tx] empty list\n"
msgstr " [%6tx] lista vacía\n"
+#. We have an address range entry.
+#. First address range entry in a list.
#: src/readelf.c:5016
#, c-format
msgid " [%6tx] %s..%s\n"
@@ -5872,6 +5236,7 @@ msgstr ""
msgid "cannot get line data section data: %s"
msgstr "No se puede obtener sección de datos de línea: %s"
+#. Print what we got so far.
#: src/readelf.c:6565
#, c-format
msgid ""
@@ -5982,11 +5347,13 @@ msgstr ""
msgid " set discriminator to %u\n"
msgstr " establecer discriminador a %u\n"
+#. Unknown, ignore it.
#: src/readelf.c:6841
#, fuzzy
msgid " unknown opcode"
msgstr "código operativo desconocido "
+#. Takes no argument.
#: src/readelf.c:6853
msgid " copy"
msgstr "Copiar"
@@ -6021,6 +5388,7 @@ msgstr " Establecer columna a %<PRIu64>\n"
msgid " set '%s' to %<PRIuFAST8>\n"
msgstr "Establecer '%s' a %<PRIuFAST8>\n"
+#. Takes no argument.
#: src/readelf.c:6910
msgid " set basic block flag"
msgstr "Establecer bandera de bloque básico"
@@ -6040,10 +5408,12 @@ msgstr "Dirección de avance por constante %u a %s\n"
msgid " advance address by fixed value %u to %s\n"
msgstr "dirección de avance por valor corregido %u a %s\n"
+#. Takes no argument.
#: src/readelf.c:6954
msgid " set prologue end flag"
msgstr " Establecer bandera prologue_end"
+#. Takes no argument.
#: src/readelf.c:6959
msgid " set epilogue begin flag"
msgstr " Establecer bandera epilogue_begin"
@@ -6053,6 +5423,9 @@ msgstr " Establecer bandera epilogue_begin"
msgid " set isa to %u\n"
msgstr " establecer isa para %u\n"
+#. 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:6977
#, c-format
msgid " unknown opcode with %<PRIu8> parameter:"
@@ -6065,6 +5438,7 @@ msgstr[1] " opcódigo con parámetros %<PRIu8> desconocido:"
msgid "cannot get .debug_loc content: %s"
msgstr "no es posible obtener contenido de .debug_loc: %s"
+#. First entry in a list.
#: src/readelf.c:7084
#, c-format
msgid " [%6tx] %s..%s"
@@ -6515,6 +5889,7 @@ msgstr ""
msgid "Display the total sizes (bsd only)"
msgstr "Muestra el tamaño total (bsd solamente)"
+#. Short description of program.
#: src/size.c:79
msgid "List section sizes of FILEs (a.out by default)."
msgstr "Lista los tamaños de sección de FICHEROS (por defecto a.out). "
@@ -6692,6 +6067,7 @@ msgstr "Imprimir ubicación de la cadena en base 8, 10, o 16 respectivamente."
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."
@@ -6726,442 +6102,450 @@ msgstr "mprotect falló"
msgid "Skipping section %zd '%s' data outside file"
msgstr ""
-#: src/strip.c:68
+#: src/strip.c:69
msgid "Place stripped output into FILE"
msgstr "Colocar la salida obtenida en FICHERO"
-#: src/strip.c:69
+#: src/strip.c:70
msgid "Extract the removed sections into FILE"
msgstr "Extraer secciones eliminadas en FICHERO"
-#: src/strip.c:70
+#: src/strip.c:71
msgid "Embed name FILE instead of -f argument"
msgstr "Incorporar nombre FILE en lugar de argumento -f"
-#: src/strip.c:74
+#: src/strip.c:75
msgid "Remove all debugging symbols"
msgstr "Elimina todos los símbolos de depuración"
-#: src/strip.c:78
+#: src/strip.c:79
msgid "Remove section headers (not recommended)"
msgstr "Quitar sección de cabeceras (no recomendado)"
-#: src/strip.c:80
+#: src/strip.c:81
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:83
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:85
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:92
+#. Short description of program.
+#: src/strip.c:93
msgid "Discard symbols from object files."
msgstr "Descarta símbolos de archivos objeto."
-#: src/strip.c:186
+#: src/strip.c:187
#, c-format
msgid "--reloc-debug-sections used without -f"
msgstr ""
-#: src/strip.c:200
+#: src/strip.c:201
#, 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:237
#, c-format
msgid "-f option specified twice"
msgstr "opción -f especificada dos veces"
-#: src/strip.c:245
+#: src/strip.c:246
#, 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:278
+#: src/strip.c:279
#, 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:321 src/strip.c:345
#, c-format
msgid "cannot stat input file '%s'"
msgstr "no sepuede stat fichero de entrada '%s'"
-#: src/strip.c:334
+#: src/strip.c:335
#, c-format
msgid "while opening '%s'"
msgstr "mientras se abría '%s'"
-#: src/strip.c:372
+#: src/strip.c:373
#, 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:385
#, 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:484
#, c-format
msgid "cannot open EBL backend"
msgstr "No se puede abrir el segundo plano EBL"
-#: src/strip.c:528
+#: src/strip.c:529
#, 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:545 src/strip.c:569
#, 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:635
#, c-format
msgid "illformed file '%s'"
msgstr "Fichero illformed '%s'"
-#: src/strip.c:968 src/strip.c:1067
+#: src/strip.c:969 src/strip.c:1068
#, c-format
msgid "while generating output file: %s"
msgstr "al generar fichero de salida: %s"
-#: src/strip.c:1033 src/strip.c:2073
+#: src/strip.c:1034 src/strip.c:2091
#, 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:1051
#, 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:1109 src/strip.c:1172
#, 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:1118
#, 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:1184
#, 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:1863
+#: src/strip.c:1191
+#, 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:1877
#, fuzzy, c-format
msgid "bad relocation"
msgstr "Mostrar reubicaciones"
-#: src/strip.c:1984 src/strip.c:2097
+#: src/strip.c:2002 src/strip.c:2115
#, c-format
msgid "while writing '%s': %s"
msgstr "al escribir '%s': %s"
-#: src/strip.c:1995
+#: src/strip.c:2013
#, c-format
msgid "while creating '%s'"
msgstr "al crear '%s'"
-#: src/strip.c:2018
+#: src/strip.c:2036
#, 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:2082
+#: src/strip.c:2100
#, c-format
msgid "%s: error while reading the file: %s"
msgstr "%s: error al leer el fichero: %s"
-#: src/strip.c:2122 src/strip.c:2142
+#: src/strip.c:2140 src/strip.c:2160
#, c-format
msgid "while writing '%s'"
msgstr "al escribir '%s'"
-#: src/strip.c:2179 src/strip.c:2186
+#: src/strip.c:2197 src/strip.c:2204
#, c-format
msgid "error while finishing '%s': %s"
msgstr "Error al terminar '%s': %s"
-#: src/strip.c:2203 src/strip.c:2275
+#: src/strip.c:2221 src/strip.c:2293
#, 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:253
#, c-format
msgid "cannot create ELF header: %s"
msgstr "no se puede crear el encabezamiento ELF: %s"
-#: src/unstrip.c:257
+#: src/unstrip.c:258
#, 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:262 src/unstrip.c:1943 src/unstrip.c:1986
#, 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:267 src/unstrip.c:1947
#, c-format
msgid "cannot create program headers: %s"
msgstr "No pueden crear encabezamientos de programa: %s"
-#: src/unstrip.c:272
+#: src/unstrip.c:273
#, c-format
msgid "cannot copy program header: %s"
msgstr "no puede copiar encabezamiento de programa: %s"
-#: src/unstrip.c:282
+#: src/unstrip.c:283
#, 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:286 src/unstrip.c:1578
#, 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:288 src/unstrip.c:1580
#, c-format
msgid "cannot copy section data: %s"
msgstr "no pueden copiar datos de sección: %s"
-#: src/unstrip.c:311
+#: src/unstrip.c:312
#, 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:384 src/unstrip.c:804 src/unstrip.c:1612
#, 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:400 src/unstrip.c:621 src/unstrip.c:642 src/unstrip.c:654
+#: src/unstrip.c:1633 src/unstrip.c:1809 src/unstrip.c:1833
#, 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:410
#, 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:449 src/unstrip.c:460
#, c-format
msgid "cannot update relocation: %s"
msgstr "no se puede actualizar reubicación: %s"
-#: src/unstrip.c:547
+#: src/unstrip.c:548
#, 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:561
#, 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:810
#, 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:968 src/unstrip.c:1315
#, 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:1009 src/unstrip.c:1028 src/unstrip.c:1063
#, 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
+#: src/unstrip.c:1049
#, c-format
msgid "invalid contents in '%s' section"
msgstr "contenido inválido en sección '%s'"
-#: src/unstrip.c:1054
+#: src/unstrip.c:1055
#, c-format
msgid "overflow with shnum = %zu in '%s' section"
msgstr ""
-#: src/unstrip.c:1108 src/unstrip.c:1433
+#: src/unstrip.c:1109 src/unstrip.c:1435
#, 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:1234 src/unstrip.c:1249 src/unstrip.c:1516 src/unstrip.c:1768
#, 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:1258
#, 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:1286 src/unstrip.c:1290
#, 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:1294 src/unstrip.c:1298 src/unstrip.c:1531
#, 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:1301
#, 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:1360 src/unstrip.c:1450
#, 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:1510
#, 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:1620
#, 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:1904
#, 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:1925
#, c-format
msgid "cannot get ELF header: %s"
msgstr "no se puede leer encabezamiento ELF: %s"
-#: src/unstrip.c:1953
+#: src/unstrip.c:1933
+#, c-format
+msgid "cannot update ELF header: %s"
+msgstr "No se puede actualizar encabezamiento ELF: %s"
+
+#: src/unstrip.c:1957
#, 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:1962 src/unstrip.c:2044
#, 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:2013
#, 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:2016
#, c-format
msgid ""
"DWARF data in '%s' not adjusted for prelinking bias; consider prelink -u"
@@ -7169,77 +6553,77 @@ msgstr ""
"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:2035 src/unstrip.c:2086 src/unstrip.c:2098 src/unstrip.c:2184
#, c-format
msgid "cannot create ELF descriptor: %s"
msgstr "no se puede crear un descriptor ELF: %s"
-#: src/unstrip.c:2073
+#: src/unstrip.c:2077
msgid "WARNING: "
msgstr ""
-#: src/unstrip.c:2075
+#: src/unstrip.c:2079
msgid ", use --force"
msgstr ""
-#: src/unstrip.c:2098
+#: src/unstrip.c:2102
msgid "ELF header identification (e_ident) different"
msgstr ""
-#: src/unstrip.c:2101
+#: src/unstrip.c:2105
msgid "ELF header type (e_type) different"
msgstr ""
-#: src/unstrip.c:2104
+#: src/unstrip.c:2108
msgid "ELF header machine type (e_machine) different"
msgstr ""
-#: src/unstrip.c:2107
+#: src/unstrip.c:2111
msgid "stripped program header (e_phnum) smaller than unstripped"
msgstr ""
-#: src/unstrip.c:2137
+#: src/unstrip.c:2141
#, 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:2145
#, 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:2160
#, 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:2164
#, 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:2177
#, 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:2208
#, 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:2341
#, c-format
msgid "no matching modules found"
msgstr "No se encontraron módulos coincidentes"
-#: src/unstrip.c:2346
+#: src/unstrip.c:2350
#, c-format
msgid "matched more than one module"
msgstr "coincidió con más de un módulo"
-#: src/unstrip.c:2390
+#: src/unstrip.c:2394
msgid ""
"STRIPPED-FILE DEBUG-FILE\n"
"[MODULE...]"
@@ -7247,7 +6631,7 @@ msgstr ""
"STRIPPED-FILE DEBUG-FILE\n"
"[MODULE...]"
-#: src/unstrip.c:2391
+#: src/unstrip.c:2395
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"
@@ -7297,7 +6681,7 @@ msgstr ""
"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:430
msgid "Run executable"
msgstr ""
@@ -7310,6 +6694,511 @@ msgstr "También mostrar nombres de función"
msgid "Show instances of inlined functions"
msgstr ""
+#~ msgid "cannot allocate PLT section: %s"
+#~ msgstr "No se puede asignar sección PLT: %s"
+
+#~ 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"
diff --git a/po/ja.po b/po/ja.po
index 976bc69b..921622c7 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ja\n"
"Report-Msgid-Bugs-To: http://bugzilla.redhat.com/\n"
-"POT-Creation-Date: 2016-03-31 10:50+0200\n"
+"POT-Creation-Date: 2016-08-25 18:09+0200\n"
"PO-Revision-Date: 2009-09-20 15:32+0900\n"
"Last-Translator: Hyu_gabaru Ryu_ichi <[email protected]>\n"
"Language-Team: Japanese <[email protected]>\n"
@@ -40,7 +40,7 @@ msgid "cannot allocate memory"
msgstr "PLT セクションを割り当てられません: %s"
#: lib/xmalloc.c:53 lib/xmalloc.c:66 lib/xmalloc.c:78 src/readelf.c:3291
-#: src/readelf.c:3682 src/readelf.c:8430 src/unstrip.c:2233 src/unstrip.c:2438
+#: src/readelf.c:3682 src/readelf.c:8430 src/unstrip.c:2237 src/unstrip.c:2442
#, c-format
msgid "memory exhausted"
msgstr "メモリー消費済み"
@@ -55,8 +55,7 @@ msgstr "エラー無し"
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 +67,7 @@ msgstr "不当なパラメーター"
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 "出力ファイルの名前を変更できません"
@@ -243,7 +241,7 @@ msgstr "不当なオペランド"
msgid "not a CU (unit) DIE"
msgstr ""
-#: libdwfl/argp-std.c:46 src/stack.c:642 src/unstrip.c:2380
+#: libdwfl/argp-std.c:46 src/stack.c:642 src/unstrip.c:2384
msgid "Input selection options:"
msgstr "選択オプションを入力してください:"
@@ -287,6 +285,7 @@ msgstr "-e か、-p、-k、-K、--core のひとつだけが認められます"
msgid "cannot load kernel symbols"
msgstr "カーネルシンボルをロードできません"
+#. Non-fatal to have no modules since we do have the kernel.
#: libdwfl/argp-std.c:234
msgid "cannot find kernel modules"
msgstr "カーネルモジュールを見つけられません"
@@ -476,11 +475,10 @@ msgstr "不当な ELF ファイル"
msgid "No backend"
msgstr "バックエンドがありません"
-#: libebl/eblcorenotetypename.c:99 libebl/eblobjecttypename.c:53
-#: 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
+#: libebl/eblcorenotetypename.c:99 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 "<不明>"
@@ -534,6 +532,7 @@ msgstr ""
msgid " Build ID: "
msgstr " ビルト ID: "
+#. A non-null terminated version string.
#: libebl/eblobjnote.c:152
#, c-format
msgid " Linker version: %.*s\n"
@@ -795,19 +794,21 @@ msgstr ""
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
+#: src/findtextrel.c:162 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:219
+#: src/unstrip.c:233
#, c-format
msgid ""
"Copyright (C) %s Red Hat, Inc.\n"
@@ -819,9 +820,9 @@ msgstr ""
"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
+#: src/findtextrel.c:167 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:224
+#: src/unstrip.c:238
#, c-format
msgid "Written by %s.\n"
msgstr "%s によって書かれました。\n"
@@ -930,10 +931,12 @@ msgstr "ファイル照合にフルパスを使う。"
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 "[メンバー] [合計] アーカイブ [ファイル...]"
@@ -1068,7 +1071,7 @@ msgstr "位置メンバー %s が見つかりません"
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:1259 src/objdump.c:253
#, c-format
msgid "cannot open %s"
msgstr "%s を開けません"
@@ -1106,6 +1109,7 @@ msgstr ""
msgid "%s (default)"
msgstr ""
+#. The archive is too big.
#: src/arlib.c:209
#, c-format
msgid "the archive '%s' is too large"
@@ -1142,10 +1146,12 @@ msgstr ""
msgid "Output nothing; yield exit status only"
msgstr ""
+#. Short description of program.
#: src/elfcmp.c:77
msgid "Compare relevant parts of two ELF files for equality."
msgstr ""
+#. Strings for arguments in help texts.
#: src/elfcmp.c:81
msgid "FILE1 FILE2"
msgstr ""
@@ -1296,10 +1302,9 @@ msgstr ""
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:732 src/findtextrel.c:221 src/nm.c:378 src/ranlib.c:157
+#: src/size.c:289 src/strings.c:186 src/strip.c:467 src/strip.c:504
+#: src/unstrip.c:2033 src/unstrip.c:2062
#, c-format
msgid "cannot open '%s'"
msgstr "'%s' を開けません"
@@ -1329,6 +1334,76 @@ msgstr ""
msgid "cannot get relocation: %s"
msgstr ""
+#: src/elfcompress.c:121 src/strip.c:255 src/unstrip.c:121
+#, c-format
+msgid "-o option specified twice"
+msgstr "-o オプションが 2 回指定されています"
+
+#: src/elfcompress.c:128
+#, fuzzy, c-format
+msgid "-t option specified twice"
+msgstr "-f オプションが 2 回指定されています"
+
+#: src/elfcompress.c:137
+#, fuzzy, c-format
+msgid "unknown compression type '%s'"
+msgstr "不明なタイプ"
+
+#. We need at least one input file.
+#: src/elfcompress.c:149 src/elfcompress.c:1310
+#, fuzzy, c-format
+msgid "No input file given"
+msgstr "入力ファイルが空です"
+
+#: src/elfcompress.c:155 src/elfcompress.c:1315
+#, fuzzy, c-format
+msgid "Only one input file allowed together with '-o'"
+msgstr "'-o' と '-f' と一緒の場合は入力ファイルは 1 つしか認められません"
+
+#: src/elfcompress.c:1272
+#, fuzzy
+msgid "Place (de)compressed output into FILE"
+msgstr "はぎ取った出力を ふぁいる に置く"
+
+#: src/elfcompress.c:1275
+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:1278
+msgid ""
+"SECTION name to (de)compress, SECTION is an extended wildcard pattern "
+"(defaults to '.?(z)debug*')"
+msgstr ""
+
+#: src/elfcompress.c:1281
+msgid "Print a message for each section being (de)compressed"
+msgstr ""
+
+#: src/elfcompress.c:1284
+msgid "Force compression of section even if it would become larger"
+msgstr ""
+
+#: src/elfcompress.c:1287 src/strip.c:88
+msgid "Relax a few rules to handle slightly broken ELF files"
+msgstr "少し壊れた ELF ファイルを取り扱うためにルールを少し緩和する"
+
+#: src/elfcompress.c:1290
+#, fuzzy
+msgid "Be silent when a section cannot be compressed"
+msgstr "セクション [%2d] '%s': セクションデータを得られません\n"
+
+#. Strings for arguments in help texts.
+#: src/elfcompress.c:1299 src/elflint.c:78 src/readelf.c:126
+msgid "FILE..."
+msgstr "ふぁいる..."
+
+#: src/elfcompress.c:1300
+msgid "Compress or decompress sections in an ELF file."
+msgstr ""
+
#: src/elflint.c:64
msgid "Be extremely strict, flag level 2 features."
msgstr "非常に厳密にやってください、フラグレベル 2 機能。"
@@ -1348,14 +1423,11 @@ msgid ""
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
#, c-format
msgid "cannot open input file"
@@ -1384,6 +1456,7 @@ msgstr "ファイル名がありません。\n"
msgid " error while freeing sub-ELF descriptor: %s\n"
msgstr "副-ELF 記述子を解放している時にエラー: %s\n"
+#. We cannot do anything.
#: src/elflint.c:306
#, c-format
msgid "Not an ELF file - it has the wrong magic bytes at the start\n"
@@ -1596,6 +1669,7 @@ msgstr ""
"セクション [%2d] '%s': シンボル %zu: st_shndx (%<PRIu32>) に適合するインデッ"
"クス用に使われる XINDEX\n"
+#. || sym->st_shndx > SHN_HIRESERVE always false
#: src/elflint.c:725
#, c-format
msgid "section [%2d] '%s': symbol %zu: invalid section index\n"
@@ -1740,6 +1814,9 @@ msgstr ""
"セクション [%2d] '%s': _GLOBAL_OFFSET_TABLE_ シンボルはセクション [%2d] '%s' "
"を参照しています\n"
+#. 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:991
#, c-format
msgid ""
@@ -2611,6 +2688,7 @@ msgid ""
"section [%2d] '%s': offset %zu: invalid length in attribute subsection\n"
msgstr ""
+#. Tag_File
#: src/elflint.c:3512
#, c-format
msgid ""
@@ -3152,12 +3230,14 @@ msgstr ""
msgid "Use PATH as root of debuginfo hierarchy"
msgstr ""
+#. Short description of program.
#: src/findtextrel.c:72
msgid "Locate source of text relocations in FILEs (a.out by default)."
msgstr ""
+#. Strings for arguments in help texts.
#: src/findtextrel.c:76 src/nm.c:108 src/objdump.c:71 src/size.c:83
-#: src/strings.c:88 src/strip.c:95
+#: src/strings.c:88 src/strip.c:96
msgid "[FILE...]"
msgstr "[ふぁいる...]"
@@ -3242,721 +3322,7 @@ 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:66 src/strip.c:68
msgid "Output selection:"
msgstr "出力選択:"
@@ -4021,7 +3387,7 @@ msgstr "弱いシンボルに印を点ける"
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:91 src/size.c:71 src/strip.c:73 src/unstrip.c:73
msgid "Output options:"
msgstr "出力オプション:"
@@ -4041,6 +3407,7 @@ msgstr "並べ替えの意味を逆にする"
msgid "Decode low-level symbol names into source code names"
msgstr ""
+#. Short description of program.
#: src/nm.c:105
msgid "List symbols from FILEs (a.out by default)."
msgstr "ふぁいる からシンボルを表示 (デフォルトではa.out)。"
@@ -4050,22 +3417,23 @@ msgstr "ふぁいる からシンボルを表示 (デフォルトではa.out)。
msgid "Output formatting"
msgstr "出力形式:"
-#: src/nm.c:140 src/objdump.c:103 src/size.c:108 src/strip.c:127
+#: src/nm.c:140 src/objdump.c:103 src/size.c:108 src/strip.c:128
#, 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:2282
+#: src/strip.c:2300
#, c-format
msgid "while closing '%s'"
msgstr "'%s' を閉じている最中"
-#: src/nm.c:417 src/objdump.c:292 src/strip.c:391
+#: src/nm.c:417 src/objdump.c:292 src/strip.c:392
#, c-format
msgid "%s: File format not recognized"
msgstr "%s: ファイル形式を認識できませんでした"
+#. Note: 0 is no valid offset.
#: src/nm.c:457
#, fuzzy
msgid ""
@@ -4105,11 +3473,12 @@ msgstr "検索ツリーを生成できません"
#: src/readelf.c:1878 src/readelf.c:2068 src/readelf.c:2309 src/readelf.c:2567
#: src/readelf.c:2643 src/readelf.c:2730 src/readelf.c:3310 src/readelf.c:3360
#: src/readelf.c:3423 src/readelf.c:8334 src/readelf.c:9434 src/readelf.c:9637
-#: src/readelf.c:9705 src/size.c:413 src/size.c:482 src/strip.c:520
+#: src/readelf.c:9705 src/size.c:413 src/size.c:482 src/strip.c:521
#, c-format
msgid "cannot get section header string table index"
msgstr "セクションヘッダー文字列テーブル索引が得られません"
+#. We always print this prolog.
#: src/nm.c:787
#, c-format
msgid ""
@@ -4123,6 +3492,7 @@ msgstr ""
"%s からのシンボル:\n"
"\n"
+#. The header line.
#: src/nm.c:790
#, c-format
msgid ""
@@ -4147,6 +3517,7 @@ msgstr "%s: セクション `%s' の大きさは項目の大きさの整数倍�
msgid "%s: entries (%zd) in section %zd `%s' is too large"
msgstr "%s: セクションの項目の大きさ `%s' は予期したものとは異なります"
+#. XXX Add machine specific object file types.
#: src/nm.c:1542
#, c-format
msgid "%s%s%s%s: Invalid operation"
@@ -4182,6 +3553,7 @@ msgstr "出力選択:"
msgid "Only display information for section NAME."
msgstr ""
+#. Short description of program.
#: src/objdump.c:67
msgid "Show information from FILEs (a.out by default)."
msgstr ""
@@ -4225,10 +3597,12 @@ msgstr ""
msgid "cannot disassemble"
msgstr ""
+#. Short description of program.
#: src/ranlib.c:65
msgid "Generate an index to speed access to archives."
msgstr ""
+#. Strings for arguments in help texts.
#: src/ranlib.c:68
msgid "ARCHIVE"
msgstr ""
@@ -4365,6 +3739,7 @@ msgid ""
"decompress section before dumping data (when used with -p or -x)"
msgstr ""
+#. Short description of program.
#: src/readelf.c:122
msgid "Print information from ELF file in human-readable form."
msgstr "ELF ファイルから人間が読める形で情報を印刷する。"
@@ -4379,16 +3754,21 @@ msgstr "不明な DWARF デバッグセクション `%s'.\n"
msgid "cannot generate Elf descriptor: %s"
msgstr "Elf 記述子を生成できません: %s"
+#: src/readelf.c:536 src/readelf.c:852 src/strip.c:590
+#, c-format
+msgid "cannot determine number of sections: %s"
+msgstr "セクション数を決定できません: %s"
+
#: src/readelf.c:554 src/readelf.c:1145 src/readelf.c:1347
#, c-format
msgid "cannot get section: %s"
msgstr "セクションを得られません: %s"
#: src/readelf.c:563 src/readelf.c:1152 src/readelf.c:1355 src/readelf.c:9657
-#: 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/unstrip.c:388 src/unstrip.c:419 src/unstrip.c:468 src/unstrip.c:578
+#: src/unstrip.c:595 src/unstrip.c:632 src/unstrip.c:830 src/unstrip.c:1119
+#: src/unstrip.c:1311 src/unstrip.c:1371 src/unstrip.c:1492 src/unstrip.c:1545
+#: src/unstrip.c:1660 src/unstrip.c:1800 src/unstrip.c:1895
#, c-format
msgid "cannot get section header: %s"
msgstr "セクションヘッダーを得られません: %s"
@@ -4489,6 +3869,7 @@ msgstr "CORE (コアファイル)"
msgid "OS Specific: (%x)\n"
msgstr "OS 固有: (%x)\n"
+#. && e_type <= ET_HIPROC always true
#: src/readelf.c:959
#, c-format
msgid "Processor Specific: (%x)\n"
@@ -4616,6 +3997,7 @@ msgstr " セクションヘッダー項目の数 : %<PRId16>"
msgid " (%<PRIu32> in [0].sh_size)"
msgstr " ([0].sh_size の %<PRIu32>)"
+#. We managed to get the zeroth section.
#: src/readelf.c:1060
#, c-format
msgid " (%<PRIu32> in [0].sh_link)"
@@ -4719,7 +4101,7 @@ msgstr ""
" セクションからセグメントへのマッビング:\n"
" セグメント セクション..."
-#: src/readelf.c:1336 src/unstrip.c:1950 src/unstrip.c:1992 src/unstrip.c:1999
+#: src/readelf.c:1336 src/unstrip.c:1954 src/unstrip.c:1996 src/unstrip.c:2003
#, c-format
msgid "cannot get program header: %s"
msgstr "プログラムヘッダーを得られません: %s"
@@ -4843,6 +4225,12 @@ msgstr[0] ""
"オフセット %5$#0<PRIx64> のセクション [%3$2u] '%4$s' 用のリロケーションセク"
"ション [%1$2zu] '%2$s' には %6$d 個の項目があります:\n"
+#. 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:1896 src/readelf.c:2086
#, c-format
msgid ""
@@ -4974,6 +4362,7 @@ msgstr " %#06x: バージョン: %hd フラグ: %s 索引: %hd 数: %hd 名
msgid " %#06x: Parent %d: %s\n"
msgstr " %#06x: 親 %d: %s\n"
+#. Print the header.
#: src/readelf.c:2957
#, c-format
msgid ""
@@ -5111,11 +4500,13 @@ msgstr " 所有者 大きさ\n"
msgid " %-13s %4<PRIu32>\n"
msgstr " %-13s %4<PRIu32>\n"
+#. Unknown subsection, print and skip.
#: src/readelf.c:3520
#, c-format
msgid " %-4u %12<PRIu32>\n"
msgstr " %-4u %12<PRIu32>\n"
+#. Tag_File
#: src/readelf.c:3525
#, c-format
msgid " File: %11<PRIu32>\n"
@@ -5408,6 +4799,8 @@ msgstr ""
"\n"
" [%6tx] ゼロ終端\n"
+#. We have an address range entry.
+#. First address range entry in a list.
#: src/readelf.c:5016
#, c-format
msgid " [%6tx] %s..%s\n"
@@ -5566,6 +4959,7 @@ msgstr ""
msgid "cannot get line data section data: %s"
msgstr "ラインデータセクションデータを得られません: %s"
+#. Print what we got so far.
#: src/readelf.c:6565
#, fuzzy, c-format
msgid ""
@@ -5672,11 +5066,13 @@ msgstr ""
msgid " set discriminator to %u\n"
msgstr "カラムを %<PRIu64> に設定する\n"
+#. Unknown, ignore it.
#: src/readelf.c:6841
#, fuzzy
msgid " unknown opcode"
msgstr "不明な命令コード"
+#. Takes no argument.
#: src/readelf.c:6853
msgid " copy"
msgstr "複写"
@@ -5711,6 +5107,7 @@ msgstr "カラムを %<PRIu64> に設定する\n"
msgid " set '%s' to %<PRIuFAST8>\n"
msgstr " '%s' を %<PRIuFAST8> に設定する\n"
+#. Takes no argument.
#: src/readelf.c:6910
msgid " set basic block flag"
msgstr "基本ブロックフラグを設定する"
@@ -5730,10 +5127,12 @@ msgstr "アドレスを定数 %u だけ済めて %s にする\n"
msgid " advance address by fixed value %u to %s\n"
msgstr "アドレスを固定値 %u だけ進めて %s にする\n"
+#. Takes no argument.
#: src/readelf.c:6954
msgid " set prologue end flag"
msgstr "プロローグ終了フラグを設定する"
+#. Takes no argument.
#: src/readelf.c:6959
msgid " set epilogue begin flag"
msgstr "エピローグ開始フラグを設定する"
@@ -5743,6 +5142,9 @@ msgstr "エピローグ開始フラグを設定する"
msgid " set isa to %u\n"
msgstr " ファイルを %<PRIu64> に設定する\n"
+#. 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:6977
#, c-format
msgid " unknown opcode with %<PRIu8> parameter:"
@@ -5754,6 +5156,7 @@ msgstr[0] " %<PRIu8> 個のパラメーターのある不明な命令コード:"
msgid "cannot get .debug_loc content: %s"
msgstr ".debug_loc の内容を得られません: %s"
+#. First entry in a list.
#: src/readelf.c:7084
#, c-format
msgid " [%6tx] %s..%s"
@@ -6209,6 +5612,7 @@ msgstr "ロード可能セグメントのための印刷の大きさと許可フ
msgid "Display the total sizes (bsd only)"
msgstr "合計の大きさを表示 (bsd のみ)"
+#. Short description of program.
#: src/size.c:79
msgid "List section sizes of FILEs (a.out by default)."
msgstr "ふぁいる のセクションの大きさの一覧 (省略値は a.out)"
@@ -6385,6 +5789,7 @@ msgstr ""
msgid "Alias for --radix=o"
msgstr ""
+#. Short description of program.
#: src/strings.c:84
msgid "Print the strings of printable characters in files."
msgstr ""
@@ -6419,513 +5824,521 @@ msgstr ""
msgid "Skipping section %zd '%s' data outside file"
msgstr ""
-#: src/strip.c:68
+#: src/strip.c:69
msgid "Place stripped output into FILE"
msgstr "はぎ取った出力を ふぁいる に置く"
-#: src/strip.c:69
+#: src/strip.c:70
msgid "Extract the removed sections into FILE"
msgstr "抽出した取り除いたセクションを ふぁいる に置く"
-#: src/strip.c:70
+#: src/strip.c:71
msgid "Embed name FILE instead of -f argument"
msgstr "-f パラメーターの代わりに 名前 ふぁいる を有効にする"
-#: src/strip.c:74
+#: src/strip.c:75
msgid "Remove all debugging symbols"
msgstr "デバッグ用のシンボルを全て取り除く"
-#: src/strip.c:78
+#: src/strip.c:79
msgid "Remove section headers (not recommended)"
msgstr ""
-#: src/strip.c:80
+#: src/strip.c:81
msgid "Copy modified/access timestamps to the output"
msgstr "修正/アクセスタイムスタンプを出力へ複写する"
-#: src/strip.c:82
+#: src/strip.c:83
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:85
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:92
+#. Short description of program.
+#: src/strip.c:93
msgid "Discard symbols from object files."
msgstr "オブジェクトファイルからシンボルを破棄する"
-#: src/strip.c:186
+#: src/strip.c:187
#, c-format
msgid "--reloc-debug-sections used without -f"
msgstr ""
-#: src/strip.c:200
+#: src/strip.c:201
#, c-format
msgid "Only one input file allowed together with '-o' and '-f'"
msgstr "'-o' と '-f' と一緒の場合は入力ファイルは 1 つしか認められません"
-#: src/strip.c:236
+#: src/strip.c:237
#, c-format
msgid "-f option specified twice"
msgstr "-f オプションが 2 回指定されています"
-#: src/strip.c:245
+#: src/strip.c:246
#, 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:278
+#: src/strip.c:279
#, c-format
msgid "-R option supports only .comment section"
msgstr "-R オプションは .comment セクションのみをサポートします"
-#: src/strip.c:320 src/strip.c:344
+#: src/strip.c:321 src/strip.c:345
#, c-format
msgid "cannot stat input file '%s'"
msgstr "入力ファイル '%s' を stat できません"
-#: src/strip.c:334
+#: src/strip.c:335
#, c-format
msgid "while opening '%s'"
msgstr "'%s' を開いている間"
-#: src/strip.c:372
+#: src/strip.c:373
#, 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:385
#, fuzzy, c-format
msgid "%s: no support for stripping archive"
msgstr "%s: アーカイブから抜き出している時は -o や -f は使えません"
-#: src/strip.c:483
+#: src/strip.c:484
#, c-format
msgid "cannot open EBL backend"
msgstr "EBL バックエンドを開けません"
-#: src/strip.c:528
+#: src/strip.c:529
#, fuzzy, c-format
msgid "cannot get number of phdrs"
msgstr "セクション数を決定できません: %s"
-#: src/strip.c:544 src/strip.c:568
+#: src/strip.c:545 src/strip.c:569
#, c-format
msgid "cannot create new file '%s': %s"
msgstr "新しいファイル '%s' を生成できません: %s"
-#: src/strip.c:634
+#: src/strip.c:635
#, c-format
msgid "illformed file '%s'"
msgstr "不適格なファイル '%s'"
-#: src/strip.c:968 src/strip.c:1067
+#: src/strip.c:969 src/strip.c:1068
#, c-format
msgid "while generating output file: %s"
msgstr "出力ファイルを生成している間: %s"
-#: src/strip.c:1033 src/strip.c:2073
+#: src/strip.c:1034 src/strip.c:2091
#, c-format
msgid "%s: error while creating ELF header: %s"
msgstr "%s: ELF ヘッダーを生成している間にエラー: %s"
-#: src/strip.c:1050
+#: src/strip.c:1051
#, c-format
msgid "while preparing output for '%s'"
msgstr "'%s' のための出力を準備している間"
-#: src/strip.c:1108 src/strip.c:1171
+#: src/strip.c:1109 src/strip.c:1172
#, c-format
msgid "while create section header section: %s"
msgstr "セクションヘッダーセクションを生成している間: %s"
-#: src/strip.c:1117
+#: src/strip.c:1118
#, c-format
msgid "cannot allocate section data: %s"
msgstr "セクションデータを割り当てられません: %s"
-#: src/strip.c:1183
+#: src/strip.c:1184
#, c-format
msgid "while create section header string table: %s"
msgstr "セクションヘッダー文字列テーブルを生成中: %s"
-#: src/strip.c:1863
+#: src/strip.c:1191
+#, fuzzy, c-format
+msgid "no memory to create section header string table"
+msgstr "セクションヘッダー文字列テーブルを生成中: %s"
+
+#: src/strip.c:1877
#, fuzzy, c-format
msgid "bad relocation"
msgstr "リロケーションを表示"
-#: src/strip.c:1984 src/strip.c:2097
+#: src/strip.c:2002 src/strip.c:2115
#, c-format
msgid "while writing '%s': %s"
msgstr "'%s' を書込み中: %s"
-#: src/strip.c:1995
+#: src/strip.c:2013
#, c-format
msgid "while creating '%s'"
msgstr "'%s' を生成中"
-#: src/strip.c:2018
+#: src/strip.c:2036
#, c-format
msgid "while computing checksum for debug information"
msgstr "デバッグ情報のチェックサムを計算中"
-#: src/strip.c:2082
+#: src/strip.c:2100
#, c-format
msgid "%s: error while reading the file: %s"
msgstr "%s: ファイルを読込み中にエラー: %s"
-#: src/strip.c:2122 src/strip.c:2142
+#: src/strip.c:2140 src/strip.c:2160
#, fuzzy, c-format
msgid "while writing '%s'"
msgstr "'%s' を書込み中: %s"
-#: src/strip.c:2179 src/strip.c:2186
+#: src/strip.c:2197 src/strip.c:2204
#, c-format
msgid "error while finishing '%s': %s"
msgstr "'%s' の終了中にエラー: %s"
-#: src/strip.c:2203 src/strip.c:2275
+#: src/strip.c:2221 src/strip.c:2293
#, 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:253
#, c-format
msgid "cannot create ELF header: %s"
msgstr ""
-#: src/unstrip.c:257
+#: src/unstrip.c:258
#, c-format
msgid "cannot copy ELF header: %s"
msgstr ""
-#: src/unstrip.c:261 src/unstrip.c:1939 src/unstrip.c:1982
+#: src/unstrip.c:262 src/unstrip.c:1943 src/unstrip.c:1986
#, fuzzy, c-format
msgid "cannot get number of program headers: %s"
msgstr "セクション数を決定できません: %s"
-#: src/unstrip.c:266 src/unstrip.c:1943
+#: src/unstrip.c:267 src/unstrip.c:1947
#, c-format
msgid "cannot create program headers: %s"
msgstr ""
-#: src/unstrip.c:272
+#: src/unstrip.c:273
#, c-format
msgid "cannot copy program header: %s"
msgstr ""
-#: src/unstrip.c:282
+#: src/unstrip.c:283
#, c-format
msgid "cannot copy section header: %s"
msgstr ""
-#: src/unstrip.c:285 src/unstrip.c:1576
+#: src/unstrip.c:286 src/unstrip.c:1578
#, c-format
msgid "cannot get section data: %s"
msgstr ""
-#: src/unstrip.c:287 src/unstrip.c:1578
+#: src/unstrip.c:288 src/unstrip.c:1580
#, c-format
msgid "cannot copy section data: %s"
msgstr ""
-#: src/unstrip.c:311
+#: src/unstrip.c:312
#, c-format
msgid "cannot create directory '%s'"
msgstr ""
-#: src/unstrip.c:383 src/unstrip.c:803 src/unstrip.c:1610
+#: src/unstrip.c:384 src/unstrip.c:804 src/unstrip.c:1612
#, 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:400 src/unstrip.c:621 src/unstrip.c:642 src/unstrip.c:654
+#: src/unstrip.c:1633 src/unstrip.c:1809 src/unstrip.c:1833
#, c-format
msgid "cannot update symbol table: %s"
msgstr ""
-#: src/unstrip.c:409
+#: src/unstrip.c:410
#, c-format
msgid "cannot update section header: %s"
msgstr ""
-#: src/unstrip.c:448 src/unstrip.c:459
+#: src/unstrip.c:449 src/unstrip.c:460
#, c-format
msgid "cannot update relocation: %s"
msgstr ""
-#: src/unstrip.c:547
+#: src/unstrip.c:548
#, c-format
msgid "cannot get symbol version: %s"
msgstr ""
-#: src/unstrip.c:560
+#: src/unstrip.c:561
#, c-format
msgid "unexpected section type in [%zu] with sh_link to symtab"
msgstr ""
-#: src/unstrip.c:809
+#: src/unstrip.c:810
#, 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:968 src/unstrip.c:1315
#, 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:1009 src/unstrip.c:1028 src/unstrip.c:1063
#, c-format
msgid "cannot read '.gnu.prelink_undo' section: %s"
msgstr ""
-#: src/unstrip.c:1048
+#: src/unstrip.c:1049
#, c-format
msgid "invalid contents in '%s' section"
msgstr ""
-#: src/unstrip.c:1054
+#: src/unstrip.c:1055
#, c-format
msgid "overflow with shnum = %zu in '%s' section"
msgstr ""
-#: src/unstrip.c:1108 src/unstrip.c:1433
+#: src/unstrip.c:1109 src/unstrip.c:1435
#, 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:1234 src/unstrip.c:1249 src/unstrip.c:1516 src/unstrip.c:1768
#, c-format
msgid "cannot add section name to string table: %s"
msgstr ""
-#: src/unstrip.c:1257
+#: src/unstrip.c:1258
#, c-format
msgid "cannot update section header string table data: %s"
msgstr ""
-#: src/unstrip.c:1284 src/unstrip.c:1288
+#: src/unstrip.c:1286 src/unstrip.c:1290
#, 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:1294 src/unstrip.c:1298 src/unstrip.c:1531
#, c-format
msgid "cannot get section count: %s"
msgstr ""
-#: src/unstrip.c:1299
+#: src/unstrip.c:1301
#, 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:1360 src/unstrip.c:1450
#, c-format
msgid "cannot read section header string table: %s"
msgstr ""
-#: src/unstrip.c:1508
+#: src/unstrip.c:1510
#, c-format
msgid "cannot add new section: %s"
msgstr ""
-#: src/unstrip.c:1618
+#: src/unstrip.c:1620
#, fuzzy, c-format
msgid "symbol [%zu] has invalid section index"
msgstr "不当なセクション索引"
-#: src/unstrip.c:1900
+#: src/unstrip.c:1904
#, fuzzy, c-format
msgid "cannot read section data: %s"
msgstr "セクションデータを割り当てられません: %s"
-#: src/unstrip.c:1921
+#: src/unstrip.c:1925
#, c-format
msgid "cannot get ELF header: %s"
msgstr ""
-#: src/unstrip.c:1953
+#: src/unstrip.c:1933
+#, c-format
+msgid "cannot update ELF header: %s"
+msgstr "ELF ヘッダーを更新できません: %s"
+
+#: src/unstrip.c:1957
#, c-format
msgid "cannot update program header: %s"
msgstr ""
-#: src/unstrip.c:1958 src/unstrip.c:2040
+#: src/unstrip.c:1962 src/unstrip.c:2044
#, c-format
msgid "cannot write output file: %s"
msgstr ""
-#: src/unstrip.c:2009
+#: src/unstrip.c:2013
#, c-format
msgid "DWARF data not adjusted for prelinking bias; consider prelink -u"
msgstr ""
-#: src/unstrip.c:2012
+#: src/unstrip.c:2016
#, 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:2035 src/unstrip.c:2086 src/unstrip.c:2098 src/unstrip.c:2184
#, c-format
msgid "cannot create ELF descriptor: %s"
msgstr ""
-#: src/unstrip.c:2073
+#: src/unstrip.c:2077
msgid "WARNING: "
msgstr ""
-#: src/unstrip.c:2075
+#: src/unstrip.c:2079
msgid ", use --force"
msgstr ""
-#: src/unstrip.c:2098
+#: src/unstrip.c:2102
msgid "ELF header identification (e_ident) different"
msgstr ""
-#: src/unstrip.c:2101
+#: src/unstrip.c:2105
msgid "ELF header type (e_type) different"
msgstr ""
-#: src/unstrip.c:2104
+#: src/unstrip.c:2108
msgid "ELF header machine type (e_machine) different"
msgstr ""
-#: src/unstrip.c:2107
+#: src/unstrip.c:2111
msgid "stripped program header (e_phnum) smaller than unstripped"
msgstr ""
-#: src/unstrip.c:2137
+#: src/unstrip.c:2141
#, c-format
msgid "cannot find stripped file for module '%s': %s"
msgstr ""
-#: src/unstrip.c:2141
+#: src/unstrip.c:2145
#, c-format
msgid "cannot open stripped file '%s' for module '%s': %s"
msgstr ""
-#: src/unstrip.c:2156
+#: src/unstrip.c:2160
#, c-format
msgid "cannot find debug file for module '%s': %s"
msgstr ""
-#: src/unstrip.c:2160
+#: src/unstrip.c:2164
#, c-format
msgid "cannot open debug file '%s' for module '%s': %s"
msgstr ""
-#: src/unstrip.c:2173
+#: src/unstrip.c:2177
#, c-format
msgid "module '%s' file '%s' is not stripped"
msgstr ""
-#: src/unstrip.c:2204
+#: src/unstrip.c:2208
#, c-format
msgid "cannot cache section addresses for module '%s': %s"
msgstr ""
-#: src/unstrip.c:2337
+#: src/unstrip.c:2341
#, c-format
msgid "no matching modules found"
msgstr ""
-#: src/unstrip.c:2346
+#: src/unstrip.c:2350
#, c-format
msgid "matched more than one module"
msgstr ""
-#: src/unstrip.c:2390
+#: src/unstrip.c:2394
msgid ""
"STRIPPED-FILE DEBUG-FILE\n"
"[MODULE...]"
msgstr ""
-#: src/unstrip.c:2391
+#: src/unstrip.c:2395
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"
@@ -6952,7 +6365,7 @@ msgid ""
"was found, or . if FILE contains the debug information."
msgstr ""
-#: tests/backtrace.c:427
+#: tests/backtrace.c:430
msgid "Run executable"
msgstr ""
@@ -6965,6 +6378,479 @@ msgstr "出力選択:"
msgid "Show instances of inlined functions"
msgstr ""
+#~ msgid "cannot allocate PLT section: %s"
+#~ msgstr "PLT セクションを割り当てられません: %s"
+
+#~ 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 "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 "バージョンスクリプト '%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 "検索ツリーを生成できません"
diff --git a/po/pl.po b/po/pl.po
index 2d27dc19..05be1b7e 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -1,4 +1,6 @@
-# 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 <[email protected]>, 2003-2007.
# Piotr Drąg <[email protected]>, 2010-2016.
#
@@ -6,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: elfutils\n"
"Report-Msgid-Bugs-To: http://bugzilla.redhat.com/\n"
-"POT-Creation-Date: 2016-03-31 10:50+0200\n"
-"PO-Revision-Date: 2016-01-07 15:44+0100\n"
+"POT-Creation-Date: 2016-08-25 18:09+0200\n"
+"PO-Revision-Date: 2016-08-18 15:32+0200\n"
"Last-Translator: Piotr Drąg <[email protected]>\n"
"Language-Team: Polish <[email protected]>\n"
"Language: pl\n"
@@ -45,7 +47,7 @@ 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:3291
-#: src/readelf.c:3682 src/readelf.c:8430 src/unstrip.c:2233 src/unstrip.c:2438
+#: src/readelf.c:3682 src/readelf.c:8430 src/unstrip.c:2237 src/unstrip.c:2442
#, c-format
msgid "memory exhausted"
msgstr "pamięć wyczerpana"
@@ -60,8 +62,7 @@ msgstr "brak błędu"
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 +74,7 @@ msgstr "nieprawidłowy parametr"
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"
@@ -157,7 +157,7 @@ msgstr "nieprawidłowy DWARF"
#: libdw/dwarf_error.c:75
msgid "no string data"
-msgstr "brak danych w postaci ciągu"
+msgstr "brak danych w postaci ciągu"
#: libdw/dwarf_error.c:76
msgid "no address value"
@@ -247,33 +247,33 @@ msgstr "nieprawidłowa instrukcja"
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
+#: libdwfl/argp-std.c:46 src/stack.c:642 src/unstrip.c:2384
msgid "Input selection options:"
msgstr "Opcje wyboru wejścia:"
#: libdwfl/argp-std.c:47
msgid "Find addresses in FILE"
-msgstr "Wyszukuje adresy w PLIKU"
+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"
+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"
+msgstr "Wyszukuje adresy w plikach zmapowanych do PID procesów"
#: libdwfl/argp-std.c:53
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
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
msgid "Kernel with all modules"
@@ -285,12 +285,13 @@ msgstr "Wyszukuje ścieżkę dla oddzielnych plików debuginfo"
#: libdwfl/argp-std.c:157
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
msgid "cannot load kernel symbols"
msgstr "nie można wczytać symboli jądra"
+#. Non-fatal to have no modules since we do have the kernel.
#: libdwfl/argp-std.c:234
msgid "cannot find kernel modules"
msgstr "nie można odnaleźć modułów jądra"
@@ -310,7 +311,7 @@ msgstr "Za mało pamięci"
#: libdwfl/argp-std.c:323
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
msgid "See errno"
@@ -382,7 +383,7 @@ msgstr "Brak nagłówków programu ELF"
#: libdwfl/libdwflP.h:73
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
msgid "image truncated"
@@ -410,11 +411,11 @@ msgstr "uszkodzone dane sekcji .gnu.prelink_undo"
#: libdwfl/libdwflP.h:82
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
msgid "Missing data in core file"
-msgstr "Brak danych w pliku core"
+msgstr "Brak danych w pliku core"
#: libdwfl/libdwflP.h:84
msgid "Invalid register"
@@ -468,11 +469,10 @@ msgstr "Nie jest plikiem ELF ET_CORE"
msgid "No backend"
msgstr "Brak zaplecza"
-#: libebl/eblcorenotetypename.c:99 libebl/eblobjecttypename.c:53
-#: 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
+#: libebl/eblcorenotetypename.c:99 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>"
@@ -526,6 +526,7 @@ msgstr " Parametry: "
msgid " Build ID: "
msgstr " Identyfikator kopii: "
+#. A non-null terminated version string.
#: libebl/eblobjnote.c:152
#, c-format
msgid " Linker version: %.*s\n"
@@ -584,7 +585,7 @@ 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"
+msgstr "nieprawidłowe pole fmag w nagłówku archiwum"
#: libelf/elf_error.c:119
msgid "invalid archive file"
@@ -600,7 +601,7 @@ msgstr "brak dostępnego indeksu"
#: libelf/elf_error.c:131
msgid "cannot read data from file"
-msgstr "nie można odczytać danych z pliku"
+msgstr "nie można odczytać danych z pliku"
#: libelf/elf_error.c:135
msgid "cannot write data to file"
@@ -684,7 +685,7 @@ msgstr "tylko relokowalne pliki mogą zawierać grupy sekcji"
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
@@ -753,7 +754,7 @@ msgstr "Wyświetla także nazwy symboli lub sekcji"
#: 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"
@@ -770,32 +771,34 @@ msgstr ""
#: 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/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
+#: src/findtextrel.c:162 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:219
+#: src/unstrip.c:233
#, c-format
msgid ""
"Copyright (C) %s Red Hat, Inc.\n"
@@ -804,14 +807,14 @@ msgid ""
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"
+"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
+#: src/findtextrel.c:167 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:224
+#: src/unstrip.c:238
#, c-format
msgid "Written by %s.\n"
msgstr "Napisane przez %s.\n"
@@ -842,15 +845,15 @@ msgstr "Polecenia:"
#: 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."
@@ -858,7 +861,7 @@ msgstr "Szybko dodaje pliki do archiwum."
#: 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."
@@ -866,7 +869,7 @@ msgstr "Wyświetla zawartość archiwum."
#: 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:"
@@ -918,12 +921,14 @@ msgstr "Używa pełnej ścieżki do dopasowywania plików."
#: 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…]"
@@ -931,17 +936,17 @@ msgstr "[ELEMENT] [LICZNIK] ARCHIWUM [PLIK…]"
#: 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
@@ -956,7 +961,7 @@ msgstr "nieprawidłowy parametr LICZNIK %s"
#: 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
@@ -996,7 +1001,7 @@ msgstr "nie można wykonać stat na archiwum „%s”"
#: src/ar.c:434
#, 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
#, c-format
@@ -1006,7 +1011,7 @@ msgstr "nie można utworzyć tabeli mieszającej"
#: src/ar.c:494 src/ar.c:936 src/ar.c:1138
#, 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
#, c-format
@@ -1056,9 +1061,9 @@ msgstr "nie odnaleziono położenia elementu %s"
#: src/ar.c:1230
#, 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:1259 src/objdump.c:253
#, c-format
msgid "cannot open %s"
msgstr "nie można otworzyć %s"
@@ -1085,17 +1090,18 @@ msgstr "nie można odczytać %s: %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)"
+#. The archive is too big.
#: src/arlib.c:209
#, c-format
msgid "the archive '%s' is too large"
@@ -1119,25 +1125,27 @@ 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
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:69
msgid "Ignore differences in build ID"
-msgstr "Ignorowanie różnic w identyfikatorze kopii"
+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"
+#. Short description of program.
#: src/elfcmp.c:77
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."
+#. Strings for arguments in help texts.
#: src/elfcmp.c:81
msgid "FILE1 FILE2"
msgstr "PLIK1 PLIK2"
@@ -1189,17 +1197,17 @@ msgstr "%s %s różnią się: nagłówek sekcji [%zu] „%s”"
#: src/elfcmp.c:324 src/elfcmp.c:330
#, 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
#, 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” posiada zerowe sh_entsize"
#: src/elfcmp.c:351 src/elfcmp.c:357
#, 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
#, c-format
@@ -1219,7 +1227,7 @@ msgstr "%s %s różnią się: liczba notatek sekcji [%zu] „%s”"
#: 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
#, c-format
@@ -1264,12 +1272,12 @@ msgstr "%s %s różnią się: różna liczba ważnych sekcji"
#: src/elfcmp.c:579 src/elfcmp.c:584
#, 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
#, 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
#, c-format
@@ -1286,10 +1294,9 @@ msgstr "%s %s różnią się: luka"
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:732 src/findtextrel.c:221 src/nm.c:378 src/ranlib.c:157
+#: src/size.c:289 src/strings.c:186 src/strip.c:467 src/strip.c:504
+#: src/unstrip.c:2033 src/unstrip.c:2062
#, c-format
msgid "cannot open '%s'"
msgstr "nie można otworzyć „%s”"
@@ -1319,13 +1326,86 @@ msgstr "nie można uzyskać zawartości sekcji %zu: %s"
msgid "cannot get relocation: %s"
msgstr "nie można uzyskać relokacji: %s"
+#: src/elfcompress.c:121 src/strip.c:255 src/unstrip.c:121
+#, c-format
+msgid "-o option specified twice"
+msgstr "Opcję -o podano dwukrotnie"
+
+#: src/elfcompress.c:128
+#, c-format
+msgid "-t option specified twice"
+msgstr "Opcję -t podano dwukrotnie"
+
+#: src/elfcompress.c:137
+#, c-format
+msgid "unknown compression type '%s'"
+msgstr "nieznany typ kompresji „%s”"
+
+#. We need at least one input file.
+#: src/elfcompress.c:149 src/elfcompress.c:1310
+#, c-format
+msgid "No input file given"
+msgstr "Nie podano pliku wejściowego"
+
+#: src/elfcompress.c:155 src/elfcompress.c:1315
+#, c-format
+msgid "Only one input file allowed together with '-o'"
+msgstr "Tylko jeden plik wejściowy jest dozwolony z „-o”"
+
+#: src/elfcompress.c:1272
+msgid "Place (de)compressed output into FILE"
+msgstr "Umieszcza zdekompresowane wyjście w PLIKU"
+
+#: src/elfcompress.c:1275
+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:1278
+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:1281
+msgid "Print a message for each section being (de)compressed"
+msgstr "Wyświetla komunikat dla każdej (de)kompresowanej sekcji"
+
+#: src/elfcompress.c:1284
+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:1287 src/strip.c:88
+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:1290
+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:1299 src/elflint.c:78 src/readelf.c:126
+msgid "FILE..."
+msgstr "PLIK…"
+
+#: src/elfcompress.c:1300
+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"
@@ -1337,17 +1417,14 @@ msgid ""
"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
#, c-format
msgid "cannot open input file"
@@ -1376,6 +1453,7 @@ msgstr "Brak nazwy pliku.\n"
msgid " error while freeing sub-ELF descriptor: %s\n"
msgstr " błąd podczas zwalniania deskryptora pod-ELF: %s\n"
+#. We cannot do anything.
#: src/elflint.c:306
#, c-format
msgid "Not an ELF file - it has the wrong magic bytes at the start\n"
@@ -1435,7 +1513,7 @@ msgstr "nieprawidłowy offset nagłówka programu\n"
#, 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:427
#, c-format
@@ -1503,7 +1581,7 @@ 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:577
#, c-format
@@ -1540,7 +1618,7 @@ msgstr ""
#: src/elflint.c:641
#, 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:650
#, c-format
@@ -1551,7 +1629,7 @@ msgstr "sekcja [%2d] „%s”: nie można uzyskać symbolu %d: %s\n"
#: src/elflint.c:667 src/elflint.c:670
#, 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:673
#, c-format
@@ -1584,8 +1662,9 @@ msgid ""
"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"
+#. || sym->st_shndx > SHN_HIRESERVE always false
#: src/elflint.c:725
#, c-format
msgid "section [%2d] '%s': symbol %zu: invalid section index\n"
@@ -1612,7 +1691,7 @@ msgstr ""
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:756
@@ -1624,7 +1703,7 @@ msgstr "sekcja [%2d] „%s”: symbol %zu: lokalne symbole COMMON to nonsens\n"
#, 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:811
#, c-format
@@ -1637,7 +1716,7 @@ 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:826
@@ -1689,8 +1768,8 @@ 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:911
#, c-format
@@ -1698,8 +1777,8 @@ 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:918
#, c-format
@@ -1724,6 +1803,9 @@ msgstr ""
"sekcja [%2d] „%s”: symbol _GLOBAL_OFFSET_TABLE_ odnosi się do sekcji [%2d] "
"„%s”\n"
+#. 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:991
#, c-format
msgid ""
@@ -1775,13 +1857,13 @@ 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:1046
#, 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:1084
#, c-format
@@ -1846,7 +1928,7 @@ msgstr ""
#: src/elflint.c:1273
#, 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:1333
#, c-format
@@ -1880,7 +1962,7 @@ 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:1411
@@ -1909,7 +1991,7 @@ msgstr ""
#, 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:1502 src/elflint.c:1553
#, c-format
@@ -1933,7 +2015,7 @@ msgstr ""
#: src/elflint.c:1655
#, 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:1660 src/elflint.c:1949
#, c-format
@@ -1996,8 +2078,8 @@ 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:1815 src/elflint.c:1843
#, c-format
@@ -2017,13 +2099,13 @@ msgstr "sekcja [%2d] „%s”: brak sekcji skrótów\n"
#: src/elflint.c:1851 src/elflint.c:1858
#, 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:1868 src/elflint.c:1872
#, 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:1878
@@ -2071,7 +2153,7 @@ msgstr "nie można uzyskać danych dla sekcji symboli\n"
#: src/elflint.c:1935
#, 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:1944
#, c-format
@@ -2086,7 +2168,7 @@ 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:1976
@@ -2179,7 +2261,7 @@ 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:2214
@@ -2187,7 +2269,7 @@ msgstr ""
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:2223
@@ -2195,7 +2277,7 @@ msgstr ""
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:2253
@@ -2208,14 +2290,14 @@ msgstr "sekcja [%2d] „%s”: łańcuch skrótu dla kubełka %zu jest spoza zak
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:2264
#, 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:2277
#, c-format
@@ -2258,7 +2340,7 @@ msgstr ""
#, 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:2390 src/elflint.c:2455 src/elflint.c:2490
#, c-format
@@ -2293,7 +2375,7 @@ msgstr "sekcja mieszania [%2zu] „%s” nieprawidłowe sh_entsize\n"
#: src/elflint.c:2534 src/elflint.c:2538
#, 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:2545
#, c-format
@@ -2301,8 +2383,8 @@ 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:2557
#, c-format
@@ -2310,8 +2392,8 @@ 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:2573
#, c-format
@@ -2323,7 +2405,7 @@ msgstr "sekcja [%2d] „%s”: niezerowe sh_%s dla sekcji NULL\n"
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:2604
@@ -2335,12 +2417,12 @@ msgstr "sekcja [%2d] „%s”: nie można uzyskać tabeli symboli: %s\n"
#, 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 posiada tabeli symboli\n"
#: src/elflint.c:2615
#, 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:2620
#, c-format
@@ -2392,7 +2474,7 @@ msgstr "sekcja [%2d] „%s”: grupa sekcji bez elementów\n"
#: src/elflint.c:2672
#, 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:2683
#, c-format
@@ -2427,7 +2509,7 @@ msgstr ""
#: src/elflint.c:2724
#, 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:2914
#, c-format
@@ -2435,7 +2517,7 @@ 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:2926
@@ -2454,12 +2536,12 @@ msgstr "sekcja [%2d] „%s”: symbol %d: nie można odczytać danych wersji\n"
#: src/elflint.c:2958
#, 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:2966
#, 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:2980
#, c-format
@@ -2488,7 +2570,7 @@ msgstr "obecna jest więcej niż jedna sekcja odniesienia wersji\n"
#: src/elflint.c:3056 src/elflint.c:3203
#, 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:3081 src/elflint.c:3257
#, c-format
@@ -2564,7 +2646,7 @@ msgid ""
"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"
+"sh_info zawiera informacje o więcej wpisów\n"
#: src/elflint.c:3195
#, c-format
@@ -2610,14 +2692,14 @@ msgstr "sekcja [%2d] „%s”: wpis %d posiada powtórzoną nazwę wersji „%s�
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 posiada nieprawidłowe odniesienie do nazwy "
+"w danych dodatkowych\n"
#: src/elflint.c:3331
#, 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 "
+"sekcja [%2d] „%s”: wpis %d posiada błędne następne pole w danych "
"dodatkowych\n"
#: src/elflint.c:3364
@@ -2645,13 +2727,13 @@ msgstr "sekcja [%2d] „%s”: nierozpoznany format atrybutu\n"
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:3439
#, 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:3451
#, c-format
@@ -2663,7 +2745,7 @@ msgstr "sekcja [%2d] „%s”: offset %zu: niezakończony ciąg nazwy producenta
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:3477
@@ -2676,15 +2758,16 @@ msgstr "sekcja [%2d] „%s”: offset %zu: skrócona sekcja atrybutów\n"
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:3501
#, 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"
+#. Tag_File
#: src/elflint.c:3512
#, c-format
msgid ""
@@ -2697,12 +2780,12 @@ msgstr ""
#, 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:3541
#, 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:3554
#, c-format
@@ -2776,7 +2859,7 @@ 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 "
+"sekcja zerowa posiada niezerową wartość rozmiaru, a nagłówek ELF posiada "
"niezerową wartość shnum\n"
#: src/elflint.c:3686
@@ -2785,8 +2868,8 @@ 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 posiada niezerową wartość dowiązań, a nagłówek ELF nie "
+"wskazuje przepełnienia w shstrndx\n"
#: src/elflint.c:3690
#, c-format
@@ -2794,8 +2877,8 @@ 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 posiada niezerową wartość dowiązań, a nagłówek ELF nie "
+"wskazuje przepełnienia w phnum\n"
#: src/elflint.c:3708
#, c-format
@@ -2822,13 +2905,13 @@ msgstr "sekcja [%2zu] „%s” posiada błędne flagi: oczekiwano %s, jest %s\n"
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 "
+"sekcja [%2zu] „%s” posiada błędne flagi: oczekiwano %s i być może %s, jest "
"%s\n"
#: src/elflint.c:3798
#, 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:3804 src/elflint.c:3836
#, c-format
@@ -2851,7 +2934,7 @@ msgstr ""
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:3860
@@ -2908,13 +2991,13 @@ msgstr "sekcja [%2zu] „%s”: skompresowana sekcja bez nagłówka kompresji: %
#, 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:3937
#, 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:3944
@@ -2938,12 +3021,12 @@ msgstr ""
#: src/elflint.c:3976
#, 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:3983
#, 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:4014
#, c-format
@@ -2951,7 +3034,7 @@ 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:4024
@@ -2960,8 +3043,8 @@ 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” posiada typ NOBITS, a jest odczytywana z pliku "
+"w segmencie wpisu %d nagłówka programu\n"
#: src/elflint.c:4050
#, c-format
@@ -2969,8 +3052,8 @@ 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” posiada typ NOBITS, ale jest odczytywana z pliku "
+"w segmencie wpisu %d nagłówka programu, a zawartość pliku jest niezerowa\n"
#: src/elflint.c:4061
#, c-format
@@ -2978,25 +3061,25 @@ 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 posiada typu NOBITS, a nie jest odczytywana z pliku "
+"w segmencie wpisu %d nagłówka programu\n"
#: src/elflint.c:4072
#, 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:4082
#, 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:4092
#, 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 "
+"sekcja [%2zu] „%s”: posiada flagę alloc, ale sekcja nie jest w żadnym "
"segmencie wczytywalnym\n"
#: src/elflint.c:4098
@@ -3123,7 +3206,7 @@ msgstr "sekcja [%2d] „%s”: dodatkowe %<PRIu64> bajtów po ostatniej notatce\
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ą posiadać "
"nagłówki programu\n"
#: src/elflint.c:4418
@@ -3140,12 +3223,12 @@ msgstr ""
#: src/elflint.c:4438
#, 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:4446
#, 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:4453
#, c-format
@@ -3156,17 +3239,17 @@ msgstr "statyczny plik wykonywalny nie może posiadać sekcji dynamicznych\n"
#, 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"
+"odniesienie sekcji dynamicznej w nagłówku programu posiada błędny offset\n"
#: src/elflint.c:4470
#, 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:4480
#, 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:4501
#, c-format
@@ -3194,21 +3277,21 @@ msgstr "segment %s nie zawiera się we wczytywalnym segmencie\n"
#, 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:4582
#, 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 posiada "
"błędny offset\n"
#: src/elflint.c:4585
#, 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:4598
#, c-format
@@ -3261,7 +3344,7 @@ 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:4658
@@ -3270,7 +3353,7 @@ 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 "
+"plik wykonywalny/DSO z sekcją .eh_frame_hdr nie posiada wpisu nagłówka "
"programu PT_GNU_EH_FRAME"
#: src/elflint.c:4692
@@ -3295,12 +3378,14 @@ msgstr "Dołącza ŚCIEŻKĘ do wszystkich nazw plików"
msgid "Use PATH as root of debuginfo hierarchy"
msgstr "Używa ŚCIEŻKI jako korzenia dla hierarchii debuginfo"
+#. Short description of program.
#: src/findtextrel.c:72
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)."
+#. Strings for arguments in help texts.
#: src/findtextrel.c:76 src/nm.c:108 src/objdump.c:71 src/size.c:83
-#: src/strings.c:88 src/strip.c:95
+#: src/strings.c:88 src/strip.c:96
msgid "[FILE...]"
msgstr "[PLIK…]"
@@ -3327,7 +3412,7 @@ msgstr "nie można odczytać sekcji dynamicznej: %s"
#: src/findtextrel.c:313
#, 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
#, c-format
@@ -3347,23 +3432,23 @@ msgstr "nie można uzyskać indeksu nagłówka programu pod offsetem %zd: %s"
#: src/findtextrel.c:421
#, 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
#, 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
#, 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
#, 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
#, c-format
@@ -3371,7 +3456,7 @@ 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
#, c-format
@@ -3380,735 +3465,17 @@ msgid ""
"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
#, 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:66 src/strip.c:68
msgid "Output selection:"
msgstr "Wybór wyjścia:"
@@ -4134,7 +3501,7 @@ msgstr "Wyświetla tylko nieokreślone symbole"
#: src/nm.c:75
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
msgid "Output format:"
@@ -4172,7 +3539,7 @@ msgstr "Oznacza specjalne symbole"
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:91 src/size.c:71 src/strip.c:73 src/unstrip.c:73
msgid "Output options:"
msgstr "Opcje wyjścia:"
@@ -4192,30 +3559,32 @@ msgstr "Odwraca kierunek porządkowania"
msgid "Decode low-level symbol names into source code names"
msgstr "Dekoduje niskopoziomowe nazwy symboli na nazwy kodu źródłowego"
+#. Short description of program.
#: src/nm.c:105
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
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:140 src/objdump.c:103 src/size.c:108 src/strip.c:128
#, 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:2282
+#: src/strip.c:2300
#, 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:417 src/objdump.c:292 src/strip.c:392
#, c-format
msgid "%s: File format not recognized"
msgstr "%s: nie rozpoznano formatu pliku"
+#. Note: 0 is no valid offset.
#: src/nm.c:457
msgid ""
"\n"
@@ -4232,12 +3601,12 @@ msgstr "nieprawidłowy offset %zu dla symbolu %s"
#: src/nm.c:471
#, c-format
msgid "%s in %s\n"
-msgstr "%s w %s\n"
+msgstr "%s w %s\n"
#: src/nm.c:479
#, 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
#, c-format
@@ -4254,11 +3623,12 @@ msgstr "nie można utworzyć drzewa wyszukiwania"
#: src/readelf.c:1878 src/readelf.c:2068 src/readelf.c:2309 src/readelf.c:2567
#: src/readelf.c:2643 src/readelf.c:2730 src/readelf.c:3310 src/readelf.c:3360
#: src/readelf.c:3423 src/readelf.c:8334 src/readelf.c:9434 src/readelf.c:9637
-#: src/readelf.c:9705 src/size.c:413 src/size.c:482 src/strip.c:520
+#: src/readelf.c:9705 src/size.c:413 src/size.c:482 src/strip.c:521
#, c-format
msgid "cannot get section header string table index"
msgstr "nie można uzyskać indeksu tabeli ciągów nagłówków sekcji"
+#. We always print this prolog.
#: src/nm.c:787
#, c-format
msgid ""
@@ -4269,9 +3639,10 @@ msgid ""
msgstr ""
"\n"
"\n"
-"Symbole z %s:\n"
+"Symbole z %s:\n"
"\n"
+#. The header line.
#: src/nm.c:790
#, c-format
msgid ""
@@ -4284,7 +3655,7 @@ msgstr ""
#: src/nm.c:1232
#, 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
#, c-format
@@ -4292,10 +3663,11 @@ 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:1316
-#, fuzzy, c-format
+#, c-format
msgid "%s: entries (%zd) in section %zd `%s' is too large"
-msgstr "%s: rozmiar wpisu w sekcji %zd „%s” nie jest tym, czego oczekiwano"
+msgstr "%s: wpisy (%zd) w sekcji %zd „%s” są za duże"
+#. XXX Add machine specific object file types.
#: src/nm.c:1542
#, c-format
msgid "%s%s%s%s: Invalid operation"
@@ -4312,7 +3684,7 @@ msgstr "Wybór trybu:"
#: src/objdump.c:53
msgid "Display relocation information."
-msgstr "Wyświetla informacje o relokacji."
+msgstr "Wyświetla informacje o relokacji."
#: src/objdump.c:55
msgid "Display the full contents of all sections requested"
@@ -4328,11 +3700,12 @@ msgstr "Wybór zawartości wyjścia:"
#: src/objdump.c:61
msgid "Only display information for section NAME."
-msgstr "Wyświetla tylko informacje o sekcji NAZWA."
+msgstr "Wyświetla tylko informacje o sekcji NAZWA."
+#. Short description of program.
#: src/objdump.c:67
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
msgid "No operation specified.\n"
@@ -4376,10 +3749,12 @@ msgstr "Zawartość sekcji %s:\n"
msgid "cannot disassemble"
msgstr "nie można deasemblować"
+#. Short description of program.
#: src/ranlib.c:65
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."
+#. Strings for arguments in help texts.
#: src/ranlib.c:68
msgid "ARCHIVE"
msgstr "ARCHIWUM"
@@ -4448,7 +3823,7 @@ msgstr "Wyświetla tabelę symboli"
#: src/readelf.c:89
msgid "Display versioning information"
-msgstr "Wyświetla informacje o wersjonowaniu"
+msgstr "Wyświetla informacje o wersji"
#: src/readelf.c:90
msgid "Display the ELF notes"
@@ -4472,7 +3847,7 @@ msgid ""
"decodedaranges, frame, gdb_index, 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"
@@ -4494,13 +3869,13 @@ msgstr "Kontrola wyjścia:"
#: src/readelf.c:111
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
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
@@ -4512,13 +3887,14 @@ 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)"
+#. Short description of program.
#: src/readelf.c:122
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
#, c-format
@@ -4530,16 +3906,21 @@ msgstr "Nieznana sekcja debugowania DWARF „%s”.\n"
msgid "cannot generate Elf descriptor: %s"
msgstr "nie można utworzyć deskryptora ELF: %s"
+#: src/readelf.c:536 src/readelf.c:852 src/strip.c:590
+#, c-format
+msgid "cannot determine number of sections: %s"
+msgstr "nie można określić liczby sekcji: %s"
+
#: src/readelf.c:554 src/readelf.c:1145 src/readelf.c:1347
#, 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:9657
-#: 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/unstrip.c:388 src/unstrip.c:419 src/unstrip.c:468 src/unstrip.c:578
+#: src/unstrip.c:595 src/unstrip.c:632 src/unstrip.c:830 src/unstrip.c:1119
+#: src/unstrip.c:1311 src/unstrip.c:1371 src/unstrip.c:1492 src/unstrip.c:1545
+#: src/unstrip.c:1660 src/unstrip.c:1800 src/unstrip.c:1895
#, c-format
msgid "cannot get section header: %s"
msgstr "nie można uzyskać nagłówka sekcji: %s"
@@ -4583,7 +3964,7 @@ 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”"
+msgstr "Brak sekcji „%s” w „%s”"
#: src/readelf.c:778
#, c-format
@@ -4640,6 +4021,7 @@ msgstr "CORE (plik core)"
msgid "OS Specific: (%x)\n"
msgstr "Zależny od systemu: (%x)\n"
+#. && e_type <= ET_HIPROC always true
#: src/readelf.c:959
#, c-format
msgid "Processor Specific: (%x)\n"
@@ -4712,7 +4094,7 @@ msgstr " Początek nagłówków programu: %<PRId64> %s\n"
#: src/readelf.c:1009 src/readelf.c:1012
msgid "(bytes into file)"
-msgstr "(bajtów w pliku)"
+msgstr "(bajtów w pliku)"
#: src/readelf.c:1011
#, c-format
@@ -4746,7 +4128,7 @@ msgstr " Liczba wpisów nagłówków programu: %<PRId16>"
#: src/readelf.c:1030
#, 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
msgid " ([0] not available)"
@@ -4765,12 +4147,13 @@ msgstr " Liczba wpisów nagłówków sekcji: %<PRId16>"
#: src/readelf.c:1047
#, c-format
msgid " (%<PRIu32> in [0].sh_size)"
-msgstr " (%<PRIu32> w [0].sh_size)"
+msgstr " (%<PRIu32> w [0].sh_size)"
+#. We managed to get the zeroth section.
#: src/readelf.c:1060
#, c-format
msgid " (%<PRIu32> in [0].sh_link)"
-msgstr " (%<PRIu32> w [0].sh_link)"
+msgstr " (%<PRIu32> w [0].sh_link)"
#: src/readelf.c:1068
#, c-format
@@ -4871,7 +4254,7 @@ msgstr ""
" 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:1336 src/unstrip.c:1954 src/unstrip.c:1996 src/unstrip.c:2003
#, c-format
msgid "cannot get program header: %s"
msgstr "nie można uzyskać nagłówka programu: %s"
@@ -4886,13 +4269,13 @@ msgid_plural ""
"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
#, c-format
@@ -4904,13 +4287,13 @@ msgid_plural ""
"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
msgid "<INVALID SYMBOL>"
@@ -4926,15 +4309,15 @@ msgid "Couldn't uncompress section"
msgstr "Nie można dekompresować sekcji"
#: src/readelf.c:1534 src/readelf.c:2248 src/readelf.c:3331
-#, fuzzy, c-format
+#, c-format
msgid "cannot get section [%zd] header: %s"
-msgstr "nie można uzyskać nagłówka sekcji: %s"
+msgstr "nie można uzyskać nagłówka sekcji [%zd]: %s"
#: src/readelf.c:1678 src/readelf.c:2315 src/readelf.c:2573 src/readelf.c:2649
#: src/readelf.c:2953 src/readelf.c:3027 src/readelf.c:4729
#, 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:1681
#, c-format
@@ -5023,6 +4406,12 @@ msgstr[2] ""
"Sekcja relokacji [%2zu] „%s” dla sekcji [%2u] „%s” pod offsetem %#0<PRIx64> "
"zawiera %d wpisów:\n"
+#. 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:1896 src/readelf.c:2086
#, c-format
msgid ""
@@ -5189,6 +4578,7 @@ msgstr ""
msgid " %#06x: Parent %d: %s\n"
msgstr " %#06x: Rodzic %d: %s\n"
+#. Print the header.
#: src/readelf.c:2957
#, c-format
msgid ""
@@ -5234,19 +4624,19 @@ msgid_plural ""
" 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"
@@ -5283,17 +4673,17 @@ msgstr "nie można uzyskać danych dla sekcji %d: %s"
#: src/readelf.c:3102
#, 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:3157
#, 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:3215
#, 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:3282
#, c-format
@@ -5354,11 +4744,13 @@ msgstr " Właściciel Rozmiar\n"
msgid " %-13s %4<PRIu32>\n"
msgstr " %-13s %4<PRIu32>\n"
+#. Unknown subsection, print and skip.
#: src/readelf.c:3520
#, c-format
msgid " %-4u %12<PRIu32>\n"
msgstr " %-4u %12<PRIu32>\n"
+#. Tag_File
#: src/readelf.c:3525
#, c-format
msgid " File: %11<PRIu32>\n"
@@ -5456,22 +4848,22 @@ msgstr "%*s[%4<PRIuMAX>] %s <SKRÓCONE>\n"
#: src/readelf.c:4508
#, 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:4515
#, 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:4522
#, 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:4611
#, 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:4619
#, c-format
@@ -5574,7 +4966,7 @@ msgstr ""
#: src/readelf.c:4814 src/readelf.c:5552 src/readelf.c:6519
#, 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:4830
#, c-format
@@ -5659,6 +5051,8 @@ msgstr " [%6tx] adres podstawowy %s\n"
msgid " [%6tx] empty list\n"
msgstr " [%6tx] pusta lista\n"
+#. We have an address range entry.
+#. First address range entry in a list.
#: src/readelf.c:5016
#, c-format
msgid " [%6tx] %s..%s\n"
@@ -5685,7 +5079,7 @@ msgid ""
"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:5574
#, c-format
@@ -5777,7 +5171,7 @@ msgstr ""
#: src/readelf.c:6287
#, 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"
+msgstr "nie można uzyskać DIE pod offsetem %<PRIu64> w sekcji „%s”: %s"
#: src/readelf.c:6301
#, c-format
@@ -5788,7 +5182,7 @@ msgstr "nie można uzyskać offsetu DIE: %s"
#, c-format
msgid "cannot get tag of DIE at offset %<PRIu64> 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:6342
#, c-format
@@ -5816,6 +5210,7 @@ msgstr ""
msgid "cannot get line data section data: %s"
msgstr "nie można uzyskać danych sekcji danych wiersza: %s"
+#. Print what we got so far.
#: src/readelf.c:6565
#, c-format
msgid ""
@@ -5848,7 +5243,7 @@ msgstr ""
#: src/readelf.c:6586
#, 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:6601
#, c-format
@@ -5926,10 +5321,12 @@ msgstr ""
msgid " set discriminator to %u\n"
msgstr " ustawienie dyskryminatora na %u\n"
+#. Unknown, ignore it.
#: src/readelf.c:6841
msgid " unknown opcode"
msgstr " nieznana instrukcja"
+#. Takes no argument.
#: src/readelf.c:6853
msgid " copy"
msgstr " kopiowanie"
@@ -5937,17 +5334,17 @@ msgstr " kopiowanie"
#: src/readelf.c:6864
#, 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"
+msgstr " zwiększenie adresu o %u do %s, op_index do %u\n"
#: src/readelf.c:6868
#, c-format
msgid " advance address by %u to %s\n"
-msgstr " zwiększenie adresu o %u do %s\n"
+msgstr " zwiększenie adresu o %u do %s\n"
#: src/readelf.c:6879
#, 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:6887
#, c-format
@@ -5964,6 +5361,7 @@ msgstr " ustawienie kolumny na %<PRIu64>\n"
msgid " set '%s' to %<PRIuFAST8>\n"
msgstr " ustawienie „%s” na %<PRIuFAST8>\n"
+#. Takes no argument.
#: src/readelf.c:6910
msgid " set basic block flag"
msgstr " ustawienie podstawowej flagi bloku"
@@ -5971,22 +5369,24 @@ msgstr " ustawienie podstawowej flagi bloku"
#: src/readelf.c:6923
#, 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"
+msgstr " zwiększenie adresu o stałą %u do %s, op_index do %u\n"
#: src/readelf.c:6927
#, c-format
msgid " advance address by constant %u to %s\n"
-msgstr " zwiększenie adresu o stałą %u do %s\n"
+msgstr " zwiększenie adresu o stałą %u do %s\n"
#: src/readelf.c:6945
#, c-format
msgid " advance address by fixed value %u to %s\n"
-msgstr " zwiększenie adresu o stałą wartość %u do %s\n"
+msgstr " zwiększenie adresu o stałą wartość %u do %s\n"
+#. Takes no argument.
#: src/readelf.c:6954
msgid " set prologue end flag"
msgstr " ustawienie flagi końca prologu"
+#. Takes no argument.
#: src/readelf.c:6959
msgid " set epilogue begin flag"
msgstr " ustawienie flagi początku epilogu"
@@ -5996,19 +5396,23 @@ msgstr " ustawienie flagi początku epilogu"
msgid " set isa to %u\n"
msgstr " ustawienie isa na %u\n"
+#. 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:6977
#, 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:7009
#, c-format
msgid "cannot get .debug_loc content: %s"
msgstr "nie można uzyskać zawartości .debug_log: %s"
+#. First entry in a list.
#: src/readelf.c:7084
#, c-format
msgid " [%6tx] %s..%s"
@@ -6026,7 +5430,7 @@ msgstr " <NIEPRAWIDŁOWE DANE>\n"
#: src/readelf.c:7145 src/readelf.c:7307
#, 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:7225
#, c-format
@@ -6288,7 +5692,7 @@ msgid ""
"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:9469
@@ -6298,7 +5702,7 @@ msgid ""
"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:9515
#, c-format
@@ -6408,7 +5812,7 @@ msgstr ""
#: src/readelf.c:9763
#, 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:9768
#, c-format
@@ -6444,16 +5848,17 @@ msgstr "To samo, co „--radix=16”"
#: src/size.c:69
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
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
msgid "Display the total sizes (bsd only)"
msgstr "Wyświetla całkowite rozmiary (tylko bsd)"
+#. Short description of program.
#: src/size.c:79
msgid "List section sizes of FILEs (a.out by default)."
msgstr "Wyświetla listę rozmiarów sekcji PLIKU (domyślnie a.out)."
@@ -6510,7 +5915,7 @@ msgstr "-1 wymaga identyfikatora wątku podanego za pomocą opcji -p."
#: src/stack.c:574
#, 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
msgid "Show stack of process PID"
@@ -6518,7 +5923,7 @@ msgstr "Wyświetla stos numeru PID procesu"
#: src/stack.c:646
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
msgid "(optional) EXECUTABLE that produced COREFILE"
@@ -6546,11 +5951,11 @@ msgstr ""
#: src/stack.c:660
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
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
msgid ""
@@ -6558,7 +5963,7 @@ msgid ""
"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
msgid "Do not resolve address to function symbol name"
@@ -6567,11 +5972,11 @@ msgstr "Nie rozwiązuje nazw symboli adresów do funkcji"
#: src/stack.c:668
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
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
msgid "Show the backtrace of only one thread"
@@ -6586,8 +5991,8 @@ msgstr ""
#: src/stack.c:676
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
msgid ""
@@ -6599,14 +6004,14 @@ msgid ""
"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 "
+"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 "
+"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."
+"parametrów, to zakończy on działanie z kodem zwrotnym 64."
#: src/stack.c:757
#, c-format
@@ -6624,14 +6029,14 @@ msgstr "Przeszukuje cały plik, nie tylko wczytane sekcje"
#: 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ęcej 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
@@ -6640,15 +6045,16 @@ msgstr "Wyświetla nazwę pliku przed każdym ciągiem."
#: 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
#, c-format
@@ -6680,520 +6086,528 @@ msgstr "mprotect się nie powiodło"
msgid "Skipping section %zd '%s' data outside file"
msgstr "Pomijanie sekcji %zd „%s” dane poza plikiem"
-#: src/strip.c:68
+#: src/strip.c:69
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:70
msgid "Extract the removed sections into FILE"
msgstr "Wydobywa usunięte sekcje do PLIKU"
-#: src/strip.c:70
+#: src/strip.c:71
msgid "Embed name FILE instead of -f argument"
msgstr "Osadza nazwę PLIKU zamiast parametru -f"
-#: src/strip.c:74
+#: src/strip.c:75
msgid "Remove all debugging symbols"
msgstr "Usuwa wszystkie symbole debugowania"
-#: src/strip.c:78
+#: src/strip.c:79
msgid "Remove section headers (not recommended)"
msgstr "Usuwa nagłówki sekcji (niezalecane)"
-#: src/strip.c:80
+#: src/strip.c:81
msgid "Copy modified/access timestamps to the output"
msgstr "Kopiuje czasy modyfikacji/dostępu do wyjścia"
-#: src/strip.c:82
+#: src/strip.c:83
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:85
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:92
+#. Short description of program.
+#: src/strip.c:93
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:187
#, 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:201
#, 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:237
#, c-format
msgid "-f option specified twice"
msgstr "Opcję -f podano dwukrotnie"
-#: src/strip.c:245
+#: src/strip.c:246
#, 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:278
+#: src/strip.c:279
#, 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:321 src/strip.c:345
#, 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:335
#, c-format
msgid "while opening '%s'"
msgstr "podczas otwierania „%s”"
-#: src/strip.c:372
+#: src/strip.c:373
#, 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:385
#, c-format
msgid "%s: no support for stripping archive"
msgstr "%s: brak obsługi okrajania archiwum"
-#: src/strip.c:483
+#: src/strip.c:484
#, c-format
msgid "cannot open EBL backend"
msgstr "nie można otworzyć zaplecza EBL"
-#: src/strip.c:528
+#: src/strip.c:529
#, 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:545 src/strip.c:569
#, 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:635
#, c-format
msgid "illformed file '%s'"
msgstr "plik „%s” posiada błędny format"
-#: src/strip.c:968 src/strip.c:1067
+#: src/strip.c:969 src/strip.c:1068
#, c-format
msgid "while generating output file: %s"
msgstr "podczas tworzenia pliku wyjściowego: %s"
-#: src/strip.c:1033 src/strip.c:2073
+#: src/strip.c:1034 src/strip.c:2091
#, 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:1051
#, 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:1109 src/strip.c:1172
#, c-format
msgid "while create section header section: %s"
msgstr "podczas tworzenia sekcji nagłówka sekcji: %s"
-#: src/strip.c:1117
+#: src/strip.c:1118
#, c-format
msgid "cannot allocate section data: %s"
msgstr "nie można przydzielić danych sekcji: %s"
-#: src/strip.c:1183
+#: src/strip.c:1184
#, c-format
msgid "while create section header string table: %s"
msgstr "podczas tworzenia tabeli ciągów nagłówka sekcji: %s"
-#: src/strip.c:1863
+#: src/strip.c:1191
+#, 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:1877
#, c-format
msgid "bad relocation"
msgstr "błędna relokacja"
-#: src/strip.c:1984 src/strip.c:2097
+#: src/strip.c:2002 src/strip.c:2115
#, c-format
msgid "while writing '%s': %s"
msgstr "podczas zapisywania „%s”: %s"
-#: src/strip.c:1995
+#: src/strip.c:2013
#, c-format
msgid "while creating '%s'"
msgstr "podczas tworzenia „%s”"
-#: src/strip.c:2018
+#: src/strip.c:2036
#, c-format
msgid "while computing checksum for debug information"
msgstr "podczas obliczania sumy kontrolnej dla informacji debugowania"
-#: src/strip.c:2082
+#: src/strip.c:2100
#, c-format
msgid "%s: error while reading the file: %s"
msgstr "%s: błąd podczas odczytywania pliku: %s"
-#: src/strip.c:2122 src/strip.c:2142
+#: src/strip.c:2140 src/strip.c:2160
#, c-format
msgid "while writing '%s'"
msgstr "podczas zapisywania „%s”"
-#: src/strip.c:2179 src/strip.c:2186
+#: src/strip.c:2197 src/strip.c:2204
#, c-format
msgid "error while finishing '%s': %s"
msgstr "błąd podczas kończenia „%s”: %s"
-#: src/strip.c:2203 src/strip.c:2275
+#: src/strip.c:2221 src/strip.c:2293
#, c-format
msgid "cannot set access and modification date of '%s'"
-msgstr "nie można ustawić czasu dostępu i modyfikacji „%s”"
+msgstr "nie można ustawić czasu dostępu i modyfikacji „%s”"
-#: src/unstrip.c:69
+#: 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"
+msgstr "Dopasowuje MODUŁY do nazw plików, a nie nazwy modułów"
-#: src/unstrip.c:70
+#: 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"
+msgstr "Umieszcza wyjście w PLIKU"
-#: src/unstrip.c:75
+#: src/unstrip.c:76
msgid "Create multiple output files under DIRECTORY"
-msgstr "Tworzy wiele plików wyjściowych w KATALOGU"
+msgstr "Tworzy wiele plików wyjściowych w KATALOGU"
-#: src/unstrip.c:76
+#: 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"
-#: 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:253
#, c-format
msgid "cannot create ELF header: %s"
msgstr "nie można utworzyć nagłówka ELF: %s"
-#: src/unstrip.c:257
+#: src/unstrip.c:258
#, 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:262 src/unstrip.c:1943 src/unstrip.c:1986
#, 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:267 src/unstrip.c:1947
#, 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:273
#, c-format
msgid "cannot copy program header: %s"
msgstr "nie można skopiować nagłówka programu: %s"
-#: src/unstrip.c:282
+#: src/unstrip.c:283
#, 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:286 src/unstrip.c:1578
#, 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:288 src/unstrip.c:1580
#, c-format
msgid "cannot copy section data: %s"
msgstr "nie można skopiować danych sekcji: %s"
-#: src/unstrip.c:311
+#: src/unstrip.c:312
#, 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:384 src/unstrip.c:804 src/unstrip.c:1612
#, 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:400 src/unstrip.c:621 src/unstrip.c:642 src/unstrip.c:654
+#: src/unstrip.c:1633 src/unstrip.c:1809 src/unstrip.c:1833
#, c-format
msgid "cannot update symbol table: %s"
msgstr "nie można zaktualizować tabeli symboli: %s"
-#: src/unstrip.c:409
+#: src/unstrip.c:410
#, 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:449 src/unstrip.c:460
#, c-format
msgid "cannot update relocation: %s"
msgstr "nie można zaktualizować relokacji: %s"
-#: src/unstrip.c:547
+#: src/unstrip.c:548
#, c-format
msgid "cannot get symbol version: %s"
msgstr "nie można uzyskać wersji symbolu: %s"
-#: src/unstrip.c:560
+#: src/unstrip.c:561
#, 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:810
#, 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:968 src/unstrip.c:1315
#, 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:1009 src/unstrip.c:1028 src/unstrip.c:1063
#, c-format
msgid "cannot read '.gnu.prelink_undo' section: %s"
msgstr "nie można odczytać sekcji „.gnu.prelink_undo”: %s"
-#: src/unstrip.c:1048
+#: src/unstrip.c:1049
#, c-format
msgid "invalid contents in '%s' section"
-msgstr "nieprawidłowa zawartość w sekcji „%s”"
+msgstr "nieprawidłowa zawartość w sekcji „%s”"
-#: src/unstrip.c:1054
+#: src/unstrip.c:1055
#, 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:1109 src/unstrip.c:1435
#, 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:1234 src/unstrip.c:1249 src/unstrip.c:1516 src/unstrip.c:1768
#, 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:1258
#, 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:1286 src/unstrip.c:1290
#, 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:1294 src/unstrip.c:1298 src/unstrip.c:1531
#, c-format
msgid "cannot get section count: %s"
msgstr "nie można uzyskać licznika sekcji: %s"
-#: src/unstrip.c:1299
+#: src/unstrip.c:1301
#, 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:1360 src/unstrip.c:1450
#, 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:1510
#, c-format
msgid "cannot add new section: %s"
msgstr "nie można dodać nowej sekcji: %s"
-#: src/unstrip.c:1618
+#: src/unstrip.c:1620
#, c-format
msgid "symbol [%zu] has invalid section index"
msgstr "symbol [%zu] posiada nieprawidłowy indeks sekcji"
-#: src/unstrip.c:1900
+#: src/unstrip.c:1904
#, c-format
msgid "cannot read section data: %s"
msgstr "nie można odczytać danych sekcji: %s"
-#: src/unstrip.c:1921
+#: src/unstrip.c:1925
#, c-format
msgid "cannot get ELF header: %s"
msgstr "nie można uzyskać nagłówka ELF: %s"
-#: src/unstrip.c:1953
+#: src/unstrip.c:1933
+#, c-format
+msgid "cannot update ELF header: %s"
+msgstr "nie można zaktualizować nagłówka ELF: %s"
+
+#: src/unstrip.c:1957
#, 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:1962 src/unstrip.c:2044
#, c-format
msgid "cannot write output file: %s"
msgstr "nie można zapisać pliku wyjściowego: %s"
-#: src/unstrip.c:2009
+#: src/unstrip.c:2013
#, 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:2016
#, 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:2035 src/unstrip.c:2086 src/unstrip.c:2098 src/unstrip.c:2184
#, c-format
msgid "cannot create ELF descriptor: %s"
msgstr "nie można utworzyć deskryptora ELF: %s"
-#: src/unstrip.c:2073
+#: src/unstrip.c:2077
msgid "WARNING: "
msgstr "OSTRZEŻENIE: "
-#: src/unstrip.c:2075
+#: src/unstrip.c:2079
msgid ", use --force"
msgstr ", należy użyć opcji --force"
-#: src/unstrip.c:2098
+#: src/unstrip.c:2102
msgid "ELF header identification (e_ident) different"
msgstr "Różna identyfikacja nagłówka ELF (e_ident)"
-#: src/unstrip.c:2101
+#: src/unstrip.c:2105
msgid "ELF header type (e_type) different"
msgstr "Różne typy nagłówka ELF (e_type)"
-#: src/unstrip.c:2104
+#: src/unstrip.c:2108
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:2111
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:2141
#, 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:2145
#, 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:2160
#, 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:2164
#, 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:2177
#, 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:2208
#, 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:2341
#, c-format
msgid "no matching modules found"
msgstr "nie odnaleziono pasujących modułów"
-#: src/unstrip.c:2346
+#: src/unstrip.c:2350
#, c-format
msgid "matched more than one module"
msgstr "pasuje więcej niż jeden moduł"
-#: src/unstrip.c:2390
+#: src/unstrip.c:2394
msgid ""
"STRIPPED-FILE DEBUG-FILE\n"
"[MODULE...]"
@@ -7201,7 +6615,7 @@ msgstr ""
"OKROJONY-PLIK PLIK-DEBUGOWANIA\n"
"[MODUŁ…]"
-#: src/unstrip.c:2391
+#: src/unstrip.c:2395
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"
@@ -7227,34 +6641,34 @@ msgid ""
"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 "
+"Łączy okrojone pliki z oddzielnymi symbolami i informacjami debugowania."
+"\vPierwsza 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 "
+"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"
+"nazwy modułów, w innym przypadku posiadają 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:430
msgid "Run executable"
msgstr "Uruchamia plik wykonywalny"
diff --git a/po/uk.po b/po/uk.po
index 2bf4e431..baf1fbfd 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: http://bugzilla.redhat.com/\n"
-"POT-Creation-Date: 2016-03-31 10:50+0200\n"
+"POT-Creation-Date: 2016-08-25 18:09+0200\n"
"PO-Revision-Date: 2015-09-26 16:41+0300\n"
"Last-Translator: Yuri Chornoivan <[email protected]>\n"
"Language-Team: Ukrainian <[email protected]>\n"
@@ -47,7 +47,7 @@ msgid "cannot allocate memory"
msgstr "не вдалося розподілити пам’ять"
#: lib/xmalloc.c:53 lib/xmalloc.c:66 lib/xmalloc.c:78 src/readelf.c:3291
-#: src/readelf.c:3682 src/readelf.c:8430 src/unstrip.c:2233 src/unstrip.c:2438
+#: src/readelf.c:3682 src/readelf.c:8430 src/unstrip.c:2237 src/unstrip.c:2442
#, c-format
msgid "memory exhausted"
msgstr "пам’ять вичерпано"
@@ -62,8 +62,7 @@ msgstr "без помилок"
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 +74,7 @@ msgstr "некоректний параметр"
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 "не вдалося перейменувати файл виводу даних"
@@ -249,7 +247,7 @@ msgstr "некоректний код операції"
msgid "not a CU (unit) DIE"
msgstr "не є DIE CU (модуля)"
-#: libdwfl/argp-std.c:46 src/stack.c:642 src/unstrip.c:2380
+#: libdwfl/argp-std.c:46 src/stack.c:642 src/unstrip.c:2384
msgid "Input selection options:"
msgstr "Вибір параметрів виведення даних:"
@@ -294,6 +292,7 @@ msgstr ""
msgid "cannot load kernel symbols"
msgstr "не вдалося завантажити символи ядра"
+#. Non-fatal to have no modules since we do have the kernel.
#: libdwfl/argp-std.c:234
msgid "cannot find kernel modules"
msgstr "не вдалося виявити модулі ядра"
@@ -472,11 +471,10 @@ msgstr "Не є файлом ET_CORE ELF"
msgid "No backend"
msgstr "Немає сервера"
-#: libebl/eblcorenotetypename.c:99 libebl/eblobjecttypename.c:53
-#: 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
+#: libebl/eblcorenotetypename.c:99 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 "<невідомо>"
@@ -530,6 +528,7 @@ msgstr " Арг.: "
msgid " Build ID: "
msgstr " Ід. збирання: "
+#. A non-null terminated version string.
#: libebl/eblobjnote.c:152
#, c-format
msgid " Linker version: %.*s\n"
@@ -790,19 +789,21 @@ msgstr "Вивести усі дані у один рядок і додати в
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
+#: src/findtextrel.c:162 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:219
+#: src/unstrip.c:233
#, c-format
msgid ""
"Copyright (C) %s Red Hat, Inc.\n"
@@ -815,9 +816,9 @@ msgstr ""
"гарантій, зокрема гарантій працездатності або придатності для певної мети.\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
+#: src/findtextrel.c:167 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:224
+#: src/unstrip.c:238
#, c-format
msgid "Written by %s.\n"
msgstr "Автор — %s.\n"
@@ -926,10 +927,12 @@ msgstr "Використовувати для порівняння повний
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 "[ЕЛЕМЕНТ] [НОМЕР] АРХІВ [ФАЙЛ...]"
@@ -1067,7 +1070,7 @@ msgstr "не виявлено елемента позиції %s"
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:1259 src/objdump.c:253
#, c-format
msgid "cannot open %s"
msgstr "не вдалося відкрити %s"
@@ -1107,6 +1110,7 @@ msgstr ""
msgid "%s (default)"
msgstr "%s (типово)"
+#. The archive is too big.
#: src/arlib.c:209
#, c-format
msgid "the archive '%s' is too large"
@@ -1145,10 +1149,12 @@ msgstr "Ігнорувати відмінності у ідентифікато�
msgid "Output nothing; yield exit status only"
msgstr "Нічого не виводити; визначити лише стан виходу"
+#. Short description of program.
#: src/elfcmp.c:77
msgid "Compare relevant parts of two ELF files for equality."
msgstr "Порівнює відповідні частини двох файлів ELF."
+#. Strings for arguments in help texts.
#: src/elfcmp.c:81
msgid "FILE1 FILE2"
msgstr "ФАЙЛ1 ФАЙЛ2"
@@ -1298,10 +1304,9 @@ msgstr "%s %s diff: проміжок"
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:732 src/findtextrel.c:221 src/nm.c:378 src/ranlib.c:157
+#: src/size.c:289 src/strings.c:186 src/strip.c:467 src/strip.c:504
+#: src/unstrip.c:2033 src/unstrip.c:2062
#, c-format
msgid "cannot open '%s'"
msgstr "не вдалося відкрити «%s»"
@@ -1331,6 +1336,79 @@ msgstr "не вдалося отримати вміст розділу %zu: %s"
msgid "cannot get relocation: %s"
msgstr "не вдалося отримати пересування: %s"
+#: src/elfcompress.c:121 src/strip.c:255 src/unstrip.c:121
+#, c-format
+msgid "-o option specified twice"
+msgstr "параметр -o вказано двічі"
+
+#: src/elfcompress.c:128
+#, fuzzy, c-format
+msgid "-t option specified twice"
+msgstr "параметр -f вказано двічі"
+
+#: src/elfcompress.c:137
+#, fuzzy, c-format
+msgid "unknown compression type '%s'"
+msgstr "невизначений тип"
+
+#. We need at least one input file.
+#: src/elfcompress.c:149 src/elfcompress.c:1310
+#, fuzzy, c-format
+msgid "No input file given"
+msgstr "вхідний файл є порожнім"
+
+#: src/elfcompress.c:155 src/elfcompress.c:1315
+#, fuzzy, c-format
+msgid "Only one input file allowed together with '-o'"
+msgstr ""
+"Разом з «-o» або «-f» можна використовувати лише один файл вхідних даних"
+
+#: src/elfcompress.c:1272
+#, fuzzy
+msgid "Place (de)compressed output into FILE"
+msgstr "Вивести дані після вилучення до ФАЙЛа"
+
+#: src/elfcompress.c:1275
+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:1278
+msgid ""
+"SECTION name to (de)compress, SECTION is an extended wildcard pattern "
+"(defaults to '.?(z)debug*')"
+msgstr ""
+
+#: src/elfcompress.c:1281
+msgid "Print a message for each section being (de)compressed"
+msgstr ""
+
+#: src/elfcompress.c:1284
+msgid "Force compression of section even if it would become larger"
+msgstr ""
+
+#: src/elfcompress.c:1287 src/strip.c:88
+msgid "Relax a few rules to handle slightly broken ELF files"
+msgstr ""
+"Знехтувати декількома правилами для обробки трохи пошкоджених файлів ELF"
+
+#: src/elfcompress.c:1290
+#, fuzzy
+msgid "Be silent when a section cannot be compressed"
+msgstr ""
+"розділ [%2zu] «%s»: адреса розділів локальних даних потоків не є нульовою\n"
+
+#. Strings for arguments in help texts.
+#: src/elfcompress.c:1299 src/elflint.c:78 src/readelf.c:126
+msgid "FILE..."
+msgstr "ФАЙЛ..."
+
+#: src/elfcompress.c:1300
+msgid "Compress or decompress sections in an ELF file."
+msgstr ""
+
#: src/elflint.c:64
msgid "Be extremely strict, flag level 2 features."
msgstr "Висока строгість, увімкнути можливості рівня 2."
@@ -1351,15 +1429,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
#, c-format
msgid "cannot open input file"
@@ -1388,6 +1463,7 @@ msgstr "Не вказано назви файла.\n"
msgid " error while freeing sub-ELF descriptor: %s\n"
msgstr " помилка під час спроби вивільнення дескриптора суб-ELF: %s\n"
+#. We cannot do anything.
#: src/elflint.c:306
#, c-format
msgid "Not an ELF file - it has the wrong magic bytes at the start\n"
@@ -1601,6 +1677,7 @@ msgstr ""
"розділ [%2d] «%s»: символ %zu: XINDEX використано для індексування, яке не "
"відповідає st_shndx (%<PRIu32>)\n"
+#. || sym->st_shndx > SHN_HIRESERVE always false
#: src/elflint.c:725
#, c-format
msgid "section [%2d] '%s': symbol %zu: invalid section index\n"
@@ -1745,6 +1822,9 @@ msgstr ""
"розділ [%2d] «%s»: символ _GLOBAL_OFFSET_TABLE_ посилається на розділ [%2d] "
"'%s'\n"
+#. 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:991
#, c-format
msgid ""
@@ -2717,6 +2797,7 @@ msgid ""
msgstr ""
"розділ [%2d] «%s»: зміщення %zu: некоректна довжина у підрозділі атрибутів\n"
+#. Tag_File
#: src/elflint.c:3512
#, c-format
msgid ""
@@ -3338,12 +3419,14 @@ msgstr "Додавати ШЛЯХ до всіх назв файлів"
msgid "Use PATH as root of debuginfo hierarchy"
msgstr "Використовувати ШЛЯХ як кореневий каталог для ієрархії debuginfo"
+#. Short description of program.
#: src/findtextrel.c:72
msgid "Locate source of text relocations in FILEs (a.out by default)."
msgstr "Шукає джерело пересуваного тексту у ФАЙЛАХ (типово, a.out)."
+#. Strings for arguments in help texts.
#: src/findtextrel.c:76 src/nm.c:108 src/objdump.c:71 src/size.c:83
-#: src/strings.c:88 src/strip.c:95
+#: src/strings.c:88 src/strip.c:96
msgid "[FILE...]"
msgstr "[ФАЙЛ...]"
@@ -3436,735 +3519,7 @@ msgstr ""
"пересування призводить до зміни запису пам’яті за зміщенням %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:66 src/strip.c:68
msgid "Output selection:"
msgstr "Вибір виводу:"
@@ -4228,7 +3583,7 @@ msgstr "Позначати спеціальні символи"
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:91 src/size.c:71 src/strip.c:73 src/unstrip.c:73
msgid "Output options:"
msgstr "Параметри виводу:"
@@ -4248,6 +3603,7 @@ msgstr "Змінити порядок на протилежний"
msgid "Decode low-level symbol names into source code names"
msgstr "Визначати за низькорівневими назвами символів назви у початковому коді"
+#. Short description of program.
#: src/nm.c:105
msgid "List symbols from FILEs (a.out by default)."
msgstr "Показати список символів з ФАЙЛів (типово з a.out)."
@@ -4256,22 +3612,23 @@ msgstr "Показати список символів з ФАЙЛів (типо
msgid "Output formatting"
msgstr "Форматування виводу"
-#: src/nm.c:140 src/objdump.c:103 src/size.c:108 src/strip.c:127
+#: src/nm.c:140 src/objdump.c:103 src/size.c:108 src/strip.c:128
#, 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:2282
+#: src/strip.c:2300
#, c-format
msgid "while closing '%s'"
msgstr "під час закриття «%s»"
-#: src/nm.c:417 src/objdump.c:292 src/strip.c:391
+#: src/nm.c:417 src/objdump.c:292 src/strip.c:392
#, c-format
msgid "%s: File format not recognized"
msgstr "%s: не вдалося розпізнати формат файла"
+#. Note: 0 is no valid offset.
#: src/nm.c:457
msgid ""
"\n"
@@ -4310,11 +3667,12 @@ msgstr "не вдалося створити дерево пошуку"
#: src/readelf.c:1878 src/readelf.c:2068 src/readelf.c:2309 src/readelf.c:2567
#: src/readelf.c:2643 src/readelf.c:2730 src/readelf.c:3310 src/readelf.c:3360
#: src/readelf.c:3423 src/readelf.c:8334 src/readelf.c:9434 src/readelf.c:9637
-#: src/readelf.c:9705 src/size.c:413 src/size.c:482 src/strip.c:520
+#: src/readelf.c:9705 src/size.c:413 src/size.c:482 src/strip.c:521
#, c-format
msgid "cannot get section header string table index"
msgstr "не вдалося визначити індекс заголовка розділу у таблиці рядків"
+#. We always print this prolog.
#: src/nm.c:787
#, c-format
msgid ""
@@ -4328,6 +3686,7 @@ msgstr ""
"Символи з %s:\n"
"\n"
+#. The header line.
#: src/nm.c:790
#, c-format
msgid ""
@@ -4352,6 +3711,7 @@ msgstr "%s: розмір розділу %zd «%s» не є кратним до �
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:1542
#, c-format
msgid "%s%s%s%s: Invalid operation"
@@ -4386,6 +3746,7 @@ msgstr "Вибір виведених даних:"
msgid "Only display information for section NAME."
msgstr "Показати інформацію лише з розділу НАЗВА."
+#. Short description of program.
#: src/objdump.c:67
msgid "Show information from FILEs (a.out by default)."
msgstr "Показати інформацію з ФАЙЛів (типово a.out)."
@@ -4432,10 +3793,12 @@ msgstr "Вміст розділу %s:\n"
msgid "cannot disassemble"
msgstr "не вдалося дизасемблювати"
+#. Short description of program.
#: src/ranlib.c:65
msgid "Generate an index to speed access to archives."
msgstr "Створювати покажчик для пришвидшення доступу до архівів."
+#. Strings for arguments in help texts.
#: src/ranlib.c:68
msgid "ARCHIVE"
msgstr "АРХІВ"
@@ -4569,6 +3932,7 @@ msgid ""
"decompress section before dumping data (when used with -p or -x)"
msgstr ""
+#. Short description of program.
#: src/readelf.c:122
msgid "Print information from ELF file in human-readable form."
msgstr "Виводити відомості з файла ELF у придатному для читання форматі."
@@ -4583,16 +3947,21 @@ msgstr "Невідомий діагностичний розділ DWARF «%s».
msgid "cannot generate Elf descriptor: %s"
msgstr "не вдалося створити дескриптор Elf: %s"
+#: src/readelf.c:536 src/readelf.c:852 src/strip.c:590
+#, c-format
+msgid "cannot determine number of sections: %s"
+msgstr "не вдалося визначити кількість розділів: %s"
+
#: src/readelf.c:554 src/readelf.c:1145 src/readelf.c:1347
#, c-format
msgid "cannot get section: %s"
msgstr "не вдалося отримати розділ: %s"
#: src/readelf.c:563 src/readelf.c:1152 src/readelf.c:1355 src/readelf.c:9657
-#: 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/unstrip.c:388 src/unstrip.c:419 src/unstrip.c:468 src/unstrip.c:578
+#: src/unstrip.c:595 src/unstrip.c:632 src/unstrip.c:830 src/unstrip.c:1119
+#: src/unstrip.c:1311 src/unstrip.c:1371 src/unstrip.c:1492 src/unstrip.c:1545
+#: src/unstrip.c:1660 src/unstrip.c:1800 src/unstrip.c:1895
#, c-format
msgid "cannot get section header: %s"
msgstr "не вдалося отримати заголовок розділу: %s"
@@ -4693,6 +4062,7 @@ msgstr "CORE (Файл ядра)"
msgid "OS Specific: (%x)\n"
msgstr "ОС-специфічне: (%x)\n"
+#. && e_type <= ET_HIPROC always true
#: src/readelf.c:959
#, c-format
msgid "Processor Specific: (%x)\n"
@@ -4820,6 +4190,7 @@ msgstr " Кількість записів заголовків розділі�
msgid " (%<PRIu32> in [0].sh_size)"
msgstr " (%<PRIu32> у [0].sh_size)"
+#. We managed to get the zeroth section.
#: src/readelf.c:1060
#, c-format
msgid " (%<PRIu32> in [0].sh_link)"
@@ -4923,7 +4294,7 @@ msgstr ""
" Відображення розділів на сегмент:\n"
" Розділи сегмента..."
-#: src/readelf.c:1336 src/unstrip.c:1950 src/unstrip.c:1992 src/unstrip.c:1999
+#: src/readelf.c:1336 src/unstrip.c:1954 src/unstrip.c:1996 src/unstrip.c:2003
#, c-format
msgid "cannot get program header: %s"
msgstr "не вдалося отримати заголовок програми: %s"
@@ -5072,6 +4443,12 @@ msgstr[2] ""
"Розділ пересування [%2zu] «%s» для розділу [%2u] «%s» за зміщенням "
"%#0<PRIx64> містить %d записів:\n"
+#. 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:1896 src/readelf.c:2086
#, c-format
msgid ""
@@ -5231,6 +4608,7 @@ msgstr " %#06x: Версія: %hd Прап.: %s Індекс: %hd К-ть: %
msgid " %#06x: Parent %d: %s\n"
msgstr " %#06x: батьківський %d: %s\n"
+#. Print the header.
#: src/readelf.c:2957
#, c-format
msgid ""
@@ -5393,11 +4771,13 @@ msgstr " Власник Розмір\n"
msgid " %-13s %4<PRIu32>\n"
msgstr " %-13s %4<PRIu32>\n"
+#. Unknown subsection, print and skip.
#: src/readelf.c:3520
#, c-format
msgid " %-4u %12<PRIu32>\n"
msgstr " %-4u %12<PRIu32>\n"
+#. Tag_File
#: src/readelf.c:3525
#, c-format
msgid " File: %11<PRIu32>\n"
@@ -5698,6 +5078,8 @@ msgstr " [%6tx] базова адреса %s\n"
msgid " [%6tx] empty list\n"
msgstr " [%6tx] порожній список\n"
+#. We have an address range entry.
+#. First address range entry in a list.
#: src/readelf.c:5016
#, c-format
msgid " [%6tx] %s..%s\n"
@@ -5855,6 +5237,7 @@ msgstr ""
msgid "cannot get line data section data: %s"
msgstr "не вдалося отримати дані розділу лінійних даних: %s"
+#. Print what we got so far.
#: src/readelf.c:6565
#, c-format
msgid ""
@@ -5966,10 +5349,12 @@ msgstr ""
msgid " set discriminator to %u\n"
msgstr " встановити розрізнення для %u\n"
+#. Unknown, ignore it.
#: src/readelf.c:6841
msgid " unknown opcode"
msgstr " невідомий код операції"
+#. Takes no argument.
#: src/readelf.c:6853
msgid " copy"
msgstr " копія"
@@ -6004,6 +5389,7 @@ msgstr " встановити значення стовпчика %<PRIu64>\n"
msgid " set '%s' to %<PRIuFAST8>\n"
msgstr " встановити «%s» у %<PRIuFAST8>\n"
+#. Takes no argument.
#: src/readelf.c:6910
msgid " set basic block flag"
msgstr " встановити прапорець базового блоку"
@@ -6023,10 +5409,12 @@ msgstr " збільшити адресу на сталу величину %u д�
msgid " advance address by fixed value %u to %s\n"
msgstr " збільшити адресу на фіксовану величину %u до %s\n"
+#. Takes no argument.
#: src/readelf.c:6954
msgid " set prologue end flag"
msgstr " встановити прапорець кінця вступу"
+#. Takes no argument.
#: src/readelf.c:6959
msgid " set epilogue begin flag"
msgstr " встановити прапорець початку епілогу"
@@ -6036,6 +5424,9 @@ msgstr " встановити прапорець початку епілогу"
msgid " set isa to %u\n"
msgstr " встановити isa у %u\n"
+#. 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:6977
#, c-format
msgid " unknown opcode with %<PRIu8> parameter:"
@@ -6049,6 +5440,7 @@ msgstr[2] " невідомий код операції з %<PRIu8> параме�
msgid "cannot get .debug_loc content: %s"
msgstr "не вдалося отримати вміст .debug_loc: %s"
+#. First entry in a list.
#: src/readelf.c:7084
#, c-format
msgid " [%6tx] %s..%s"
@@ -6495,6 +5887,7 @@ msgstr ""
msgid "Display the total sizes (bsd only)"
msgstr "Показувати загальні розміри (лише bsd)"
+#. Short description of program.
#: src/size.c:79
msgid "List section sizes of FILEs (a.out by default)."
msgstr "Показати розміри розділів ФАЙЛів (типово a.out)."
@@ -6690,6 +6083,7 @@ msgstr "Виводити адресу рядка за основами 8, 10 т�
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 "Вивести рядки файлів з символів, придатних для друку."
@@ -6724,31 +6118,31 @@ msgstr "помилка mprotect"
msgid "Skipping section %zd '%s' data outside file"
msgstr "Пропускаємо дані %zd «%s» поза файлом"
-#: src/strip.c:68
+#: src/strip.c:69
msgid "Place stripped output into FILE"
msgstr "Вивести дані після вилучення до ФАЙЛа"
-#: src/strip.c:69
+#: src/strip.c:70
msgid "Extract the removed sections into FILE"
msgstr "Видобути вилучені розділи до ФАЙЛа"
-#: src/strip.c:70
+#: src/strip.c:71
msgid "Embed name FILE instead of -f argument"
msgstr "Вбудувати назву ФАЙЛа замість аргументу -f"
-#: src/strip.c:74
+#: src/strip.c:75
msgid "Remove all debugging symbols"
msgstr "Вилучити всі символи зневаджування"
-#: src/strip.c:78
+#: src/strip.c:79
msgid "Remove section headers (not recommended)"
msgstr "Вилучити заголовки розділів (не рекомендовано)"
-#: src/strip.c:80
+#: src/strip.c:81
msgid "Copy modified/access timestamps to the output"
msgstr "Скопіювати часові позначки зміни/доступу до виведених даних"
-#: src/strip.c:82
+#: src/strip.c:83
msgid ""
"Resolve all trivial relocations between debug sections if the removed "
"sections are placed in a debug file (only relevant for ET_REL files, "
@@ -6758,417 +6152,424 @@ msgstr ""
"вилучені розділи було розташовано у діагностичному файлі (стосується лише "
"файлів ET_REL, скасувати дію неможливо, потребує параметра -f)"
-#: src/strip.c:84
+#: src/strip.c:85
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:92
+#. Short description of program.
+#: src/strip.c:93
msgid "Discard symbols from object files."
msgstr "Відкинути символи з об’єктних файлів"
-#: src/strip.c:186
+#: src/strip.c:187
#, c-format
msgid "--reloc-debug-sections used without -f"
msgstr "--reloc-debug-sections використано без -f"
-#: src/strip.c:200
+#: src/strip.c:201
#, c-format
msgid "Only one input file allowed together with '-o' and '-f'"
msgstr ""
"Разом з «-o» або «-f» можна використовувати лише один файл вхідних даних"
-#: src/strip.c:236
+#: src/strip.c:237
#, c-format
msgid "-f option specified twice"
msgstr "параметр -f вказано двічі"
-#: src/strip.c:245
+#: src/strip.c:246
#, 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:278
+#: src/strip.c:279
#, c-format
msgid "-R option supports only .comment section"
msgstr "Для параметра -R передбачено підтримку лише розділу .comment"
-#: src/strip.c:320 src/strip.c:344
+#: src/strip.c:321 src/strip.c:345
#, c-format
msgid "cannot stat input file '%s'"
msgstr "не вдалося отримати дані з вхідного файла «%s» за допомогою stat"
-#: src/strip.c:334
+#: src/strip.c:335
#, c-format
msgid "while opening '%s'"
msgstr "під час спроби відкриття «%s»"
-#: src/strip.c:372
+#: src/strip.c:373
#, 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:385
#, c-format
msgid "%s: no support for stripping archive"
msgstr "%s: підтримки вилучення додаткового вмісту з архіву не передбачено"
-#: src/strip.c:483
+#: src/strip.c:484
#, c-format
msgid "cannot open EBL backend"
msgstr "не вдалося відкрити канал сервера EBL"
-#: src/strip.c:528
+#: src/strip.c:529
#, c-format
msgid "cannot get number of phdrs"
msgstr "не вдалося отримати кількість phdr"
-#: src/strip.c:544 src/strip.c:568
+#: src/strip.c:545 src/strip.c:569
#, c-format
msgid "cannot create new file '%s': %s"
msgstr "не вдалося створити файл «%s»: %s"
-#: src/strip.c:634
+#: src/strip.c:635
#, c-format
msgid "illformed file '%s'"
msgstr "помилкове форматування файла «%s»"
-#: src/strip.c:968 src/strip.c:1067
+#: src/strip.c:969 src/strip.c:1068
#, c-format
msgid "while generating output file: %s"
msgstr "під час спроби створення файла з виведеними даними: %s"
-#: src/strip.c:1033 src/strip.c:2073
+#: src/strip.c:1034 src/strip.c:2091
#, c-format
msgid "%s: error while creating ELF header: %s"
msgstr "%s: помилка під час створення заголовка ELF: %s"
-#: src/strip.c:1050
+#: src/strip.c:1051
#, c-format
msgid "while preparing output for '%s'"
msgstr "під час приготування виведених даних для «%s»"
-#: src/strip.c:1108 src/strip.c:1171
+#: src/strip.c:1109 src/strip.c:1172
#, c-format
msgid "while create section header section: %s"
msgstr "під час створення розділу заголовка розділу: %s"
-#: src/strip.c:1117
+#: src/strip.c:1118
#, c-format
msgid "cannot allocate section data: %s"
msgstr "не вдалося розмістити дані розділу: %s"
-#: src/strip.c:1183
+#: src/strip.c:1184
#, c-format
msgid "while create section header string table: %s"
msgstr "під час створення таблиці рядків заголовка розділу: %s"
-#: src/strip.c:1863
+#: src/strip.c:1191
+#, fuzzy, c-format
+msgid "no memory to create section header string table"
+msgstr "під час створення таблиці рядків заголовка розділу: %s"
+
+#: src/strip.c:1877
#, c-format
msgid "bad relocation"
msgstr "помилкове пересування"
-#: src/strip.c:1984 src/strip.c:2097
+#: src/strip.c:2002 src/strip.c:2115
#, c-format
msgid "while writing '%s': %s"
msgstr "під час запису «%s»: %s"
-#: src/strip.c:1995
+#: src/strip.c:2013
#, c-format
msgid "while creating '%s'"
msgstr "під час спроби створення «%s»"
-#: src/strip.c:2018
+#: src/strip.c:2036
#, c-format
msgid "while computing checksum for debug information"
msgstr "під час обчислення контрольної суми для діагностичних даних"
-#: src/strip.c:2082
+#: src/strip.c:2100
#, c-format
msgid "%s: error while reading the file: %s"
msgstr "%s: помилка під час читання файла: %s"
-#: src/strip.c:2122 src/strip.c:2142
+#: src/strip.c:2140 src/strip.c:2160
#, c-format
msgid "while writing '%s'"
msgstr "під час спроби запису «%s»"
-#: src/strip.c:2179 src/strip.c:2186
+#: src/strip.c:2197 src/strip.c:2204
#, c-format
msgid "error while finishing '%s': %s"
msgstr "помилка під час завершення «%s»: %s"
-#: src/strip.c:2203 src/strip.c:2275
+#: src/strip.c:2221 src/strip.c:2293
#, 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:253
#, c-format
msgid "cannot create ELF header: %s"
msgstr "не вдалося створити заголовок ELF: %s"
-#: src/unstrip.c:257
+#: src/unstrip.c:258
#, 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:262 src/unstrip.c:1943 src/unstrip.c:1986
#, c-format
msgid "cannot get number of program headers: %s"
msgstr "не вдалося отримати кількість заголовків програми: %s"
-#: src/unstrip.c:266 src/unstrip.c:1943
+#: src/unstrip.c:267 src/unstrip.c:1947
#, c-format
msgid "cannot create program headers: %s"
msgstr "не вдалося створити заголовки програми: %s"
-#: src/unstrip.c:272
+#: src/unstrip.c:273
#, c-format
msgid "cannot copy program header: %s"
msgstr "не вдалося скопіювати заголовок програми: %s"
-#: src/unstrip.c:282
+#: src/unstrip.c:283
#, c-format
msgid "cannot copy section header: %s"
msgstr "не вдалося скопіювати заголовок розділу: %s"
-#: src/unstrip.c:285 src/unstrip.c:1576
+#: src/unstrip.c:286 src/unstrip.c:1578
#, c-format
msgid "cannot get section data: %s"
msgstr "не вдалося отримати дані розділу: %s"
-#: src/unstrip.c:287 src/unstrip.c:1578
+#: src/unstrip.c:288 src/unstrip.c:1580
#, c-format
msgid "cannot copy section data: %s"
msgstr "не вдалося скопіювати дані розділу: %s"
-#: src/unstrip.c:311
+#: src/unstrip.c:312
#, c-format
msgid "cannot create directory '%s'"
msgstr "не вдалося створити каталог «%s»"
-#: src/unstrip.c:383 src/unstrip.c:803 src/unstrip.c:1610
+#: src/unstrip.c:384 src/unstrip.c:804 src/unstrip.c:1612
#, 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:400 src/unstrip.c:621 src/unstrip.c:642 src/unstrip.c:654
+#: src/unstrip.c:1633 src/unstrip.c:1809 src/unstrip.c:1833
#, c-format
msgid "cannot update symbol table: %s"
msgstr "не вдалося оновити таблицю символів: %s"
-#: src/unstrip.c:409
+#: src/unstrip.c:410
#, c-format
msgid "cannot update section header: %s"
msgstr "не вдалося оновити заголовок розділу: %s"
-#: src/unstrip.c:448 src/unstrip.c:459
+#: src/unstrip.c:449 src/unstrip.c:460
#, c-format
msgid "cannot update relocation: %s"
msgstr "не вдалося оновити пересування: %s"
-#: src/unstrip.c:547
+#: src/unstrip.c:548
#, c-format
msgid "cannot get symbol version: %s"
msgstr "не вдалося отримати версію символу: %s"
-#: src/unstrip.c:560
+#: src/unstrip.c:561
#, 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:810
#, c-format
msgid "invalid string offset in symbol [%zu]"
msgstr "некоректне зміщення рядка у символі [%zu]"
-#: src/unstrip.c:967 src/unstrip.c:1313
+#: src/unstrip.c:968 src/unstrip.c:1315
#, 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:1009 src/unstrip.c:1028 src/unstrip.c:1063
#, c-format
msgid "cannot read '.gnu.prelink_undo' section: %s"
msgstr "не вдалося прочитати розділ «.gnu.prelink_undo»: %s"
-#: src/unstrip.c:1048
+#: src/unstrip.c:1049
#, c-format
msgid "invalid contents in '%s' section"
msgstr "некоректний вміст розділу «%s»"
-#: src/unstrip.c:1054
+#: src/unstrip.c:1055
#, c-format
msgid "overflow with shnum = %zu in '%s' section"
msgstr ""
-#: src/unstrip.c:1108 src/unstrip.c:1433
+#: src/unstrip.c:1109 src/unstrip.c:1435
#, 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:1234 src/unstrip.c:1249 src/unstrip.c:1516 src/unstrip.c:1768
#, c-format
msgid "cannot add section name to string table: %s"
msgstr "не вдалося додати назву розділу до таблиці рядків: %s"
-#: src/unstrip.c:1257
+#: src/unstrip.c:1258
#, c-format
msgid "cannot update section header string table data: %s"
msgstr "не вдалося оновити дані заголовка розділу у таблиці рядків: %s"
-#: src/unstrip.c:1284 src/unstrip.c:1288
+#: src/unstrip.c:1286 src/unstrip.c:1290
#, 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:1294 src/unstrip.c:1298 src/unstrip.c:1531
#, c-format
msgid "cannot get section count: %s"
msgstr "не вдалося отримати кількість розділів: %s"
-#: src/unstrip.c:1299
+#: src/unstrip.c:1301
#, 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:1360 src/unstrip.c:1450
#, c-format
msgid "cannot read section header string table: %s"
msgstr "не вдалося прочитати таблицю рядків заголовка розділу: %s"
-#: src/unstrip.c:1508
+#: src/unstrip.c:1510
#, c-format
msgid "cannot add new section: %s"
msgstr "не вдалося додати новий розділ: %s"
-#: src/unstrip.c:1618
+#: src/unstrip.c:1620
#, c-format
msgid "symbol [%zu] has invalid section index"
msgstr "символ [%zu] має некоректний індекс розділу"
-#: src/unstrip.c:1900
+#: src/unstrip.c:1904
#, c-format
msgid "cannot read section data: %s"
msgstr "не вдалося прочитати дані розділу: %s"
-#: src/unstrip.c:1921
+#: src/unstrip.c:1925
#, c-format
msgid "cannot get ELF header: %s"
msgstr "не вдалося отримати заголовок ELF: %s"
-#: src/unstrip.c:1953
+#: src/unstrip.c:1933
+#, c-format
+msgid "cannot update ELF header: %s"
+msgstr "не вдалося оновити заголовок ELF: %s"
+
+#: src/unstrip.c:1957
#, c-format
msgid "cannot update program header: %s"
msgstr "не вдалося оновити заголовок програми: %s"
-#: src/unstrip.c:1958 src/unstrip.c:2040
+#: src/unstrip.c:1962 src/unstrip.c:2044
#, c-format
msgid "cannot write output file: %s"
msgstr "не вдалося записати файл виведених даних: %s"
-#: src/unstrip.c:2009
+#: src/unstrip.c:2013
#, c-format
msgid "DWARF data not adjusted for prelinking bias; consider prelink -u"
msgstr ""
"Дані DWARF не скориговано відповідно до відхилення перед компонуванням; "
"спробуйте виправити це командою prelink -u"
-#: src/unstrip.c:2012
+#: src/unstrip.c:2016
#, c-format
msgid ""
"DWARF data in '%s' not adjusted for prelinking bias; consider prelink -u"
@@ -7176,76 +6577,76 @@ msgstr ""
"Дані DWARF у «%s» не скориговано відповідно до відхилення перед "
"компонуванням; спробуйте виправити це командою prelink -u"
-#: src/unstrip.c:2031 src/unstrip.c:2082 src/unstrip.c:2094 src/unstrip.c:2180
+#: src/unstrip.c:2035 src/unstrip.c:2086 src/unstrip.c:2098 src/unstrip.c:2184
#, c-format
msgid "cannot create ELF descriptor: %s"
msgstr "не вдалося створити дескриптор ELF: %s"
-#: src/unstrip.c:2073
+#: src/unstrip.c:2077
msgid "WARNING: "
msgstr "УВАГА: "
-#: src/unstrip.c:2075
+#: src/unstrip.c:2079
msgid ", use --force"
msgstr ", скористайтеся --force"
-#: src/unstrip.c:2098
+#: src/unstrip.c:2102
msgid "ELF header identification (e_ident) different"
msgstr "Різні ідентифікатори заголовків ELF (e_ident)"
-#: src/unstrip.c:2101
+#: src/unstrip.c:2105
msgid "ELF header type (e_type) different"
msgstr "Різні типи заголовків ELF (e_type)"
-#: src/unstrip.c:2104
+#: src/unstrip.c:2108
msgid "ELF header machine type (e_machine) different"
msgstr "Різні типи архітектур заголовків ELF (e_machine)"
-#: src/unstrip.c:2107
+#: src/unstrip.c:2111
msgid "stripped program header (e_phnum) smaller than unstripped"
msgstr "очищений заголовок програми (e_phnum) є меншим за неочищений"
-#: src/unstrip.c:2137
+#: src/unstrip.c:2141
#, c-format
msgid "cannot find stripped file for module '%s': %s"
msgstr "не вдалося знайти очищений файл для модуля «%s»: %s"
-#: src/unstrip.c:2141
+#: src/unstrip.c:2145
#, c-format
msgid "cannot open stripped file '%s' for module '%s': %s"
msgstr "не вдалося відкрити очищений файл «%s» для модуля «%s»: %s"
-#: src/unstrip.c:2156
+#: src/unstrip.c:2160
#, c-format
msgid "cannot find debug file for module '%s': %s"
msgstr "не вдалося знайти файл діагностичних даних для модуля «%s»: %s"
-#: src/unstrip.c:2160
+#: src/unstrip.c:2164
#, c-format
msgid "cannot open debug file '%s' for module '%s': %s"
msgstr "не вдалося відкрити файл діагностичних даних «%s» для модуля «%s»: %s"
-#: src/unstrip.c:2173
+#: src/unstrip.c:2177
#, c-format
msgid "module '%s' file '%s' is not stripped"
msgstr "у модулі «%s» файл «%s» не очищено strip"
-#: src/unstrip.c:2204
+#: src/unstrip.c:2208
#, c-format
msgid "cannot cache section addresses for module '%s': %s"
msgstr "не вдалося кешувати адреси розділів для модуля «%s»: %s"
-#: src/unstrip.c:2337
+#: src/unstrip.c:2341
#, c-format
msgid "no matching modules found"
msgstr "відповідних модулів не виявлено"
-#: src/unstrip.c:2346
+#: src/unstrip.c:2350
#, c-format
msgid "matched more than one module"
msgstr "встановлено відповідність декількох модулів"
-#: src/unstrip.c:2390
+#: src/unstrip.c:2394
msgid ""
"STRIPPED-FILE DEBUG-FILE\n"
"[MODULE...]"
@@ -7253,7 +6654,7 @@ msgstr ""
"ОЧИЩЕНИЙ-ФАЙЛ ФАЙЛ-DEBUG\n"
"[МОДУЛЬ...]"
-#: src/unstrip.c:2391
+#: src/unstrip.c:2395
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"
@@ -7309,7 +6710,7 @@ msgstr ""
"окремого файла діагностичних даних або «-», якщо файла діагностичних даних "
"не вдалося знайти, і «.», якщо ФАЙЛ сам містить діагностичні дані."
-#: tests/backtrace.c:427
+#: tests/backtrace.c:430
msgid "Run executable"
msgstr "Запустити виконуваний файл"
@@ -7321,6 +6722,492 @@ msgstr "Додатково вивести назви функцій"
msgid "Show instances of inlined functions"
msgstr "Вивести екземпляри вбудованих функцій"
+#~ msgid "cannot allocate PLT section: %s"
+#~ msgstr "не вдалося розмістити PLT-розділ: %s"
+
+#~ 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"
diff --git a/src/ChangeLog b/src/ChangeLog
index f74b5dcb..e5b3b202 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,57 @@
+2016-08-25 Mark Wielaard <[email protected]>
+
+ * strip.c (handle_elf): Recompress with ELF_CHF_FORCE.
+
+2016-08-06 Mark Wielaard <[email protected]>
+
+ * strip.c (handle_elf): Uncompress and recompress relocation target
+ section if necessary.
+
+2016-07-08 Mark Wielaard <[email protected]>
+
+ * 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 <[email protected]>
+
+ * 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 <[email protected]>
+
+ * unstrip.c (copy_elided_sections): Use unstripped_strent[] from
+ index zero, instead of one.
+
+2016-06-28 Richard Henderson <[email protected]>
+
+ * elflint.c (valid_e_machine): Add EM_BPF.
+
+2016-04-11 David Abdurachmanov <[email protected]>
+
+ * elfcmp.c (main): Fix self-comparison error with GCC 6.
+
2016-03-21 Mark Wielaard <[email protected]>
* nm.c (show_symbols): Check for malloc size argument overflow.
diff --git a/src/Makefile.am b/src/Makefile.am
index 9f69956e..deba8dca 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_CPPFLAGS += -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
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
@@ -87,11 +55,6 @@ if DEMANGLE
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
@@ -110,13 +73,7 @@ readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl \
$(demanglelib)
size_LDADD = $(libelf) $(libeu) $(argp_LDADD)
-strip_LDADD = $(libebl) $(libdw_static) $(libelf) $(libeu) $(argp_LDADD) -ldl
-ld_LDADD = $(libebl) $(libdw_static) $(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) $(libdw) $(libelf) $(libeu) $(argp_LDADD) -ldl
elflint_LDADD = $(libebl) $(libdw_static) $(libelf) $(libeu) $(argp_LDADD) -ldl
findtextrel_LDADD = $(libdw) $(libelf) $(argp_LDADD)
addr2line_LDADD = $(libdw) $(libelf) $(argp_LDADD) $(demanglelib)
@@ -129,31 +86,6 @@ unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) -ldl
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 \
@@ -170,10 +102,7 @@ installcheck-binPROGRAMS: $(bin_PROGRAMS)
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/elf32-i386.script b/src/elf32-i386.script
deleted file mode 100644
index 2083278f..00000000
--- 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 852b92f5..7b5d39ce 100644
--- a/src/elfcmp.c
+++ b/src/elfcmp.c
@@ -368,7 +368,7 @@ main (int argc, char *argv[])
&& 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:
diff --git a/src/elfcompress.c b/src/elfcompress.c
index d0ca469c..86cc7165 100644
--- a/src/elfcompress.c
+++ b/src/elfcompress.c
@@ -32,6 +32,7 @@
#include <unistd.h>
#include ELFUTILS_HEADER(elf)
#include ELFUTILS_HEADER(ebl)
+#include ELFUTILS_HEADER(dwelf)
#include <gelf.h>
#include "system.h"
@@ -265,9 +266,9 @@ process_file (const char *fname)
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. */
@@ -308,7 +309,7 @@ process_file (const char *fname)
free (snamebuf);
if (names != NULL)
{
- ebl_strtabfree (names);
+ dwelf_strtab_free (names);
free (scnstrents);
free (symstrents);
free (namesbuf);
@@ -524,14 +525,14 @@ process_file (const char *fname)
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 *));
}
@@ -870,7 +871,7 @@ process_file (const char *fname)
/* 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);
@@ -916,7 +917,7 @@ process_file (const char *fname)
}
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;
@@ -938,7 +939,7 @@ process_file (const char *fname)
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");
@@ -970,7 +971,11 @@ process_file (const char *fname)
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;
@@ -984,7 +989,7 @@ process_file (const char *fname)
/* 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;
@@ -1099,7 +1104,7 @@ process_file (const char *fname)
}
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)
{
@@ -1133,7 +1138,7 @@ process_file (const char *fname)
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 15b12f6f..8c298c93 100644
--- a/src/elflint.c
+++ b/src/elflint.c
@@ -344,7 +344,7 @@ static const int valid_e_machine[] =
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
};
#define nvalid_e_machine \
(sizeof (valid_e_machine) / sizeof (valid_e_machine[0]))
diff --git a/src/i386_ld.c b/src/i386_ld.c
deleted file mode 100644
index d196177a..00000000
--- 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 <[email protected]>, 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 59dccb54..00000000
--- 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 <[email protected]>, 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 29f4031b..00000000
--- 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 <[email protected]>, 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 1b5d0f9b..00000000
--- 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 <[email protected]>, 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 835c2dc1..00000000
--- 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 <[email protected]>, 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 3502ce19..00000000
--- 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 <[email protected]>, 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 703af6d8..00000000
--- 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/none_ld.c b/src/none_ld.c
deleted file mode 100644
index fb0f0fb2..00000000
--- a/src/none_ld.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Nothing here. This is just a testimony of automake inflexibility. */
diff --git a/src/sectionhash.c b/src/sectionhash.c
deleted file mode 100644
index 83a7cca6..00000000
--- 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 <[email protected]>, 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 96da3367..00000000
--- 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 <[email protected]>, 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/strip.c b/src/strip.c
index a6042445..da093e97 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 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <[email protected]>, 2000.
@@ -42,6 +42,7 @@
#include <elf-knowledge.h>
#include <libebl.h>
+#include "libdwelf.h"
#include <system.h>
typedef uint8_t GElf_Byte;
@@ -432,7 +433,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
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 +444,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
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;
@@ -1043,7 +1044,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
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,7 +1072,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
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. */
@@ -1083,7 +1084,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
if (debug_fname != NULL && !remove_shdrs)
{
/* 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 +1147,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
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 +1184,12 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
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,7 +1205,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
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. */
@@ -1785,10 +1791,18 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
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)
@@ -1970,6 +1984,10 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
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);
}
}
}
@@ -2171,7 +2189,7 @@ while computing checksum for debug information"));
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)
diff --git a/src/symbolhash.c b/src/symbolhash.c
deleted file mode 100644
index 3fd96499..00000000
--- 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 <[email protected]>, 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 062dadec..00000000
--- 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 <[email protected]>, 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 29166530..00000000
--- 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 <[email protected]>, 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 85e0a1da..46737381 100644
--- a/src/unstrip.c
+++ b/src/unstrip.c
@@ -48,6 +48,7 @@
#include <gelf.h>
#include <libebl.h>
#include <libdwfl.h>
+#include "libdwelf.h"
#include "system.h"
#ifndef _
@@ -686,7 +687,7 @@ struct section
Elf_Scn *scn;
const char *name;
Elf_Scn *outscn;
- struct Ebl_Strent *strent;
+ Dwelf_Strent *strent;
GElf_Shdr shdr;
};
@@ -757,7 +758,7 @@ struct symbol
union
{
const char *name;
- struct Ebl_Strent *strent;
+ Dwelf_Strent *strent;
};
union
{
@@ -1214,12 +1215,12 @@ static Elf_Data *
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 < &sections[stripped_shnum - 1];
@@ -1228,7 +1229,7 @@ new_shstrtab (Elf *unstripped, size_t unstripped_shnum,
{
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 +1244,7 @@ new_shstrtab (Elf *unstripped, size_t unstripped_shnum,
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 +1256,8 @@ new_shstrtab (Elf *unstripped, size_t unstripped_shnum,
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 +1266,7 @@ new_shstrtab (Elf *unstripped, size_t unstripped_shnum,
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);
@@ -1456,7 +1458,7 @@ more sections in stripped file than debug file -- arguments reversed?"));
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 < &sections[stripped_shnum - 1];
++sec)
@@ -1508,8 +1510,8 @@ more sections in stripped file than debug file -- arguments reversed?"));
_("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 +1572,7 @@ more sections in stripped file than debug file -- arguments reversed?"));
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 +1643,7 @@ more sections in stripped file than debug file -- arguments reversed?"));
/* 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 +1723,13 @@ more sections in stripped file than debug file -- arguments reversed?"));
/* 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 +1754,7 @@ more sections in stripped file than debug file -- arguments reversed?"));
/* 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 +1763,22 @@ more sections in stripped file than debug file -- arguments reversed?"));
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 +1789,7 @@ more sections in stripped file than debug file -- arguments reversed?"));
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 +1814,7 @@ more sections in stripped file than debug file -- arguments reversed?"));
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 +1963,13 @@ more sections in stripped file than debug file -- arguments reversed?"));
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 ();
diff --git a/src/versionhash.c b/src/versionhash.c
deleted file mode 100644
index cc4d2833..00000000
--- 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 <[email protected]>, 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 4434e055..00000000
--- 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 <[email protected]>, 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 f292327d..00000000
--- 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 <[email protected]>, 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 bcc296f1..2e9aa0d0 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,88 @@
+2016-08-25 Mark Wielaard <[email protected]>
+
+ * 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 <[email protected]>
+
+ * Makefile.am (EXTRA_DIST): Add testfilesparc64attrs.o.bz2.
+
+2016-08-09 Jose E. Marchesi <[email protected]>
+
+ * testfilesparc64attrs.o.bz2: New file.
+ * run-readelf-A.sh: Check attributes in a sparc object.
+
+2016-08-06 Mark Wielaard <[email protected]>
+
+ * run-strip-reloc.sh: Add explicit compressed and uncompressed
+ test cases.
+
+2016-08-10 Richard Henderson <[email protected]>
+
+ * file-bpf-dis1.expect.bz2: Fix expected mod and endian operations
+ output.
+
+2016-07-08 Mark Wielaard <[email protected]>
+
+ * 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 <[email protected]>
+
+ * 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 <[email protected]>
+
+ * 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 <[email protected]>
+
+ * Makefile.am (check_PROGRAMS): Add emptyfile.
+ (TESTS): Likewise.
+ (emptyfile_LDADD): New variable.
+ * emptyfile.c: New test.
+
+2016-06-28 Richard Henderson <[email protected]>
+
+ * 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 <[email protected]>
* testfile-s390x-hash-both.bz2: New testfile.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8643c3d6..76502fb6 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -53,7 +53,7 @@ check_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \
buildid deleted deleted-lib.so aggregate_size vdsosyms \
getsrc_die strptr newdata elfstrtab dwfl-proc-attach \
elfshphehdr elfstrmerge dwelfgnucompressed elfgetchdr \
- elfgetzdata elfputzdata zstrptr
+ elfgetzdata elfputzdata zstrptr emptyfile vendorelf
asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \
asm-tst6 asm-tst7 asm-tst8 asm-tst9
@@ -126,7 +126,8 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \
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
if !BIARCH
export ELFUTILS_DISABLE_BIARCH = 1
@@ -148,6 +149,9 @@ endif
if HAVE_LIBASM
check_PROGRAMS += $(asm_TESTS)
TESTS += $(asm_TESTS)
+if HAVE_LINUX_BPF_H
+TESTS += run-disasm-bpf.sh
+endif
endif
EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
@@ -163,11 +167,12 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
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-nobitsalign.sh \
+ run-strip-test9.sh run-strip-test10.sh run-strip-test11.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 \
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 \
@@ -310,6 +315,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
run-aggregate-size.sh testfile-sizes1.o.bz2 testfile-sizes2.o.bz2 \
testfile-sizes3.o.bz2 \
run-readelf-A.sh testfileppc32attrs.o.bz2 \
+ testfilesparc64attrs.o.bz2 \
testfile-debug-types.bz2 \
run-getsrc-die.sh run-strptr.sh \
testfile-x32-core.bz2 testfile-x32.bz2 \
@@ -322,7 +328,10 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
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 \
+ testfile-m68k-core.bz2 testfile-m68k.bz2 testfile-m68k-s.bz2
if USE_VALGRIND
valgrind_cmd='valgrind -q --leak-check=full --error-exitcode=1'
@@ -399,8 +408,8 @@ early_offscn_LDADD = $(libelf)
ecp_LDADD = $(libelf)
update1_LDADD = $(libelf)
update2_LDADD = $(libelf)
-update3_LDADD = $(libebl) $(libdw_static) $(libelf)
-update4_LDADD = $(libebl) $(libdw_static) $(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)
@@ -439,7 +448,7 @@ dwarf_getstring_LDADD = $(libdw)
addrcfi_LDADD = $(libdw) $(libebl) $(libelf) $(argp_LDADD) -ldl
test_flag_nobits_LDADD = $(libelf)
rerequest_tag_LDADD = $(libdw)
-alldts_LDADD = $(libebl) $(libdw_static) $(libelf)
+alldts_LDADD = $(libdw) $(libelf)
md5_sha1_test_LDADD = $(libeu)
typeiter_LDADD = $(libdw) $(libelf)
typeiter2_LDADD = $(libdw) $(libelf)
@@ -472,12 +481,14 @@ elfstrtab_LDADD = $(libelf)
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)
# We want to test the libelf header against the system elf.h header.
# Don't include any -I CPPFLAGS.
diff --git a/tests/alldts.c b/tests/alldts.c
index eaecaf57..28b3063c 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 <[email protected]>, 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 @@ int
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 @@ main (void)
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 @@ main (void)
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 @@ main (void)
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 @@ main (void)
}
/* 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 @@ main (void)
}
/* 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/backtrace-child.c b/tests/backtrace-child.c
index 40e7b32d..cf4547ca 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,8 +67,17 @@
# 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>
@@ -130,7 +140,7 @@ dummy1 (void)
asm volatile ("");
}
-#ifdef __x86_64__
+#ifdef RAISE_JMP_PATCHING
static NOINLINE_NOCLONE USED void
jmp (void)
{
@@ -157,7 +167,7 @@ stdarg (int f UNUSED, ...)
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.c b/tests/backtrace.c
index 12476430..2440ab34 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 @@ dump_modules (Dwfl_Module *mod, void **userdata __attribute__ ((unused)),
return DWARF_CB_OK;
}
-static bool is_x86_64_native;
+static bool use_raise_jmp_patching;
static pid_t check_tid;
static void
@@ -93,7 +93,7 @@ callback_verify (pid_t tid, unsigned frameno, Dwarf_Addr pc,
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 +112,8 @@ callback_verify (pid_t tid, unsigned frameno, Dwarf_Addr pc,
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);
@@ -138,7 +138,7 @@ callback_verify (pid_t tid, unsigned frameno, Dwarf_Addr pc,
// 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 +243,10 @@ see_exec_module (Dwfl_Module *mod, void **userdata __attribute__ ((unused)),
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 +254,17 @@ see_exec_module (Dwfl_Module *mod, void **userdata __attribute__ ((unused)),
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 +282,7 @@ prepare_thread (pid_t pid2 __attribute__ ((unused)),
assert (got == pid2);
assert (WIFSTOPPED (status));
assert (WSTOPSIG (status) == SIGUSR1);
-#endif /* __x86_64__ */
+#endif /* RAISE_JMP_PATCHING */
}
#include <asm/unistd.h>
@@ -370,21 +374,20 @@ exec_dump (const char *exec)
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/elfshphehdr.c b/tests/elfshphehdr.c
index 0d92934b..5a297e0d 100644
--- a/tests/elfshphehdr.c
+++ b/tests/elfshphehdr.c
@@ -126,7 +126,7 @@ test (Elf *elf, int class, bool layout)
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);
diff --git a/tests/elfstrmerge.c b/tests/elfstrmerge.c
index 4149ca6e..c2c3fb97 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
@@ -30,7 +30,8 @@
#include <unistd.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 +44,13 @@ static int fdnew = -1;
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 +63,7 @@ release (void)
{
/* The new string table. */
if (strings != NULL)
- ebl_strtabfree (strings);
+ dwelf_strtab_free (strings);
free (scnstrents);
free (symstrents);
@@ -241,7 +242,7 @@ main (int argc, char **argv)
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 +250,7 @@ main (int argc, char **argv)
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 +276,8 @@ main (int argc, char **argv)
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 +296,7 @@ main (int argc, char **argv)
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 +310,7 @@ main (int argc, char **argv)
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 +318,7 @@ main (int argc, char **argv)
/* 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 +454,7 @@ main (int argc, char **argv)
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 +529,7 @@ main (int argc, char **argv)
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. */
diff --git a/tests/emptyfile.c b/tests/emptyfile.c
new file mode 100644
index 00000000..6d086246
--- /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/hello_m68k.ko.bz2 b/tests/hello_m68k.ko.bz2
new file mode 100644
index 00000000..2da3d17b
--- /dev/null
+++ b/tests/hello_m68k.ko.bz2
Binary files differ
diff --git a/tests/run-allregs.sh b/tests/run-allregs.sh
index 544c7594..a56e6126 100755
--- a/tests/run-allregs.sh
+++ b/tests/run-allregs.sh
@@ -2489,4 +2489,5 @@ x87 registers:
39: %st6 (st6), float 80 bits
40: %st7 (st7), float 80 bits
EOF
+
exit 0
diff --git a/tests/run-disasm-bpf.sh b/tests/run-disasm-bpf.sh
new file mode 100755
index 00000000..8ca89d53
--- /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-readelf-A.sh b/tests/run-readelf-A.sh
index 88f87adb..933292e4 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
diff --git a/tests/run-strip-reloc.sh b/tests/run-strip-reloc.sh
index a3245fd8..5c847a4d 100755
--- a/tests/run-strip-reloc.sh
+++ b/tests/run-strip-reloc.sh
@@ -107,4 +107,15 @@ runtest hello_aarch64.ko 1
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-test11.sh b/tests/run-strip-test11.sh
new file mode 100755
index 00000000..0b1b0ab9
--- /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/testfile-bpf-dis1.expect.bz2 b/tests/testfile-bpf-dis1.expect.bz2
new file mode 100644
index 00000000..21b55e94
--- /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 00000000..94bb612b
--- /dev/null
+++ b/tests/testfile-bpf-dis1.o.bz2
Binary files differ
diff --git a/tests/testfile-m68k-core.bz2 b/tests/testfile-m68k-core.bz2
new file mode 100644
index 00000000..eda79d73
--- /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 00000000..44c37993
--- /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 00000000..97a1b289
--- /dev/null
+++ b/tests/testfile-m68k.bz2
Binary files differ
diff --git a/tests/testfilesparc64attrs.o.bz2 b/tests/testfilesparc64attrs.o.bz2
new file mode 100644
index 00000000..7be7f88d
--- /dev/null
+++ b/tests/testfilesparc64attrs.o.bz2
Binary files differ
diff --git a/tests/update3.c b/tests/update3.c
index d760687a..7a4224dd 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 <[email protected]>, 2000.
@@ -28,7 +28,7 @@
#include <string.h>
#include <unistd.h>
-#include ELFUTILS_HEADER(ebl)
+#include ELFUTILS_HEADER(dwelf)
int
@@ -42,8 +42,8 @@ main (int argc, char *argv[] __attribute__ ((unused)))
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 @@ main (int argc, char *argv[] __attribute__ ((unused)))
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 @@ main (int argc, char *argv[] __attribute__ ((unused)))
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 @@ main (int argc, char *argv[] __attribute__ ((unused)))
}
/* 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 @@ main (int argc, char *argv[] __attribute__ ((unused)))
}
/* 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 85de6c35..a9bd4bf9 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 <[email protected]>, 2000.
@@ -28,7 +28,7 @@
#include <string.h>
#include <unistd.h>
-#include ELFUTILS_HEADER(ebl)
+#include ELFUTILS_HEADER(dwelf)
int
@@ -42,12 +42,12 @@ main (int argc, char *argv[] __attribute__ ((unused)))
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 @@ main (int argc, char *argv[] __attribute__ ((unused)))
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 @@ main (int argc, char *argv[] __attribute__ ((unused)))
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 @@ main (int argc, char *argv[] __attribute__ ((unused)))
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 @@ main (int argc, char *argv[] __attribute__ ((unused)))
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 @@ main (int argc, char *argv[] __attribute__ ((unused)))
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 @@ main (int argc, char *argv[] __attribute__ ((unused)))
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 @@ main (int argc, char *argv[] __attribute__ ((unused)))
}
/* 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 @@ main (int argc, char *argv[] __attribute__ ((unused)))
}
/* 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/vendorelf.c b/tests/vendorelf.c
new file mode 100644
index 00000000..bc13cce3
--- /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;
+}