Commit Graph

303 Commits

Author SHA1 Message Date
Paul Pluzhnikov
630da022cb Fix misspellings in elf/ -- BZ 25337
Applying this commit results in bit-identical libc.so.6.
The elf/ld-linux-x86-64.so.2 does change, but only in .note.gnu.build-id

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2023-05-29 23:00:12 +00:00
Joseph Myers
8754a4133e Add AT_RSEQ_* from Linux 6.3 to elf.h
Linux 6.3 adds constants AT_RSEQ_FEATURE_SIZE and AT_RSEQ_ALIGN; add
them to glibc's elf.h.  (Recall that, although elf.h is a
system-independent header, so far we've put AT_* constants there even
if Linux-specific, as discussed in bug 15794.  So rather than making
any attempt to fix that issue, the new constants are just added there
alongside the existing ones.)

Tested for x86_64.
2023-05-26 15:03:31 +00:00
Florian Weimer
bf88b47ecb Revert "riscv: Resolve symbols directly for symbols with STO_RISCV_VARIANT_CC."
This reverts commit 117e8b341c.

Reason for revert: Causes elf/tst-glibcelf and elf/tst-relro-*
to fail on all architectures.
2023-05-07 14:16:03 +02:00
Hsiangkai Wang
117e8b341c
riscv: Resolve symbols directly for symbols with STO_RISCV_VARIANT_CC.
In some cases, we do not want to go through the resolver for function
calls. For example, functions with vector arguments will use vector
registers to pass arguments. In the resolver, we do not save/restore the
vector argument registers for lazy binding efficiency. To avoid ruining
the vector arguments, functions with vector arguments will not go
through the resolver.

To achieve the goal, we will annotate the function symbols with
STO_RISCV_VARIANT_CC flag and add DT_RISCV_VARIANT_CC tag in the dynamic
section. In the first pass on PLT relocations, we do not set up to call
_dl_runtime_resolve. Instead, we resolve the functions directly.

Signed-off-by: Hsiangkai Wang <kai.wang@sifive.com>
Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Link: https://inbox.sourceware.org/libc-alpha/20230314162512.35802-1-kito.cheng@sifive.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-04-28 07:02:42 -07:00
Indu Bhagat
2fa7fd1af7 elf.h: add PT_GNU_SFRAME
Support for SFrame format is available in Binutils 2.40.  The GNU ld merges
the input .sframe sections and creates an output .sframe section in a
segment PT_GNU_SFRAME.
2023-04-28 10:53:05 +02:00
caiyinyu
83d49a53aa LoongArch: Add new relocation types. 2023-02-03 09:37:07 +08:00
Joseph Myers
6d7e8eda9b Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
Shahab Vahedi
6ae0737d43 ARC: update definitions in elf/elf.h
While porting ARCv2 to elfutils [1], it was brought up that the
necessary changes to the project's libelf/elf.h must come from
glibc, because they sync it from glibc [2].  Therefore, this patch
is to update ARC entries in elf/elf.h.

The majority of the update is about adding new definitions,
specially for the relocations.  However, there is one rename, one
deletion, and one change:

- R_ARC_JUMP_SLOT renamed to R_ARC_JMP_SLOT to match binutils.
- R_ARC_B26 removed because it is unused and deprecated.
- R_ARC_TLS_DTPOFF_S9 changed from 0x4a to the correct value 0x49.

Finally, a specific SHT class for ARC has been added to glibcelf.py.
Else, it would result in a collision:

  _register_elf_h(Sht, ranges=True,
 File "/src/glibc/scripts/glibcelf.py", line x, in _register_elf_h
   raise ValueError('duplicate value {}: {}, {}'.format(
                    ValueError: duplicate value 1879048193:
                    SHT_ARC_ATTRIBUTES, SHT_X86_64_UNWIND

[1]
https://sourceware.org/pipermail/elfutils-devel/2022q4/005530.html

[2]
https://sourceware.org/pipermail/elfutils-devel/2022q4/005548.html

No regression has been observed after applying this patch.  Below
follows the result:

UNSUPPORTED: crypt/cert
UNSUPPORTED: elf/tst-audit22
FAIL: elf/tst-audit25a
FAIL: elf/tst-audit25b
FAIL: elf/tst-bz15311
FAIL: elf/tst-bz28937
FAIL: elf/tst-dlmopen4
UNSUPPORTED: elf/tst-dlopen-self-container
UNSUPPORTED: elf/tst-dlopen-tlsmodid-container
UNSUPPORTED: elf/tst-glibc-hwcaps-prepend-cache
UNSUPPORTED: elf/tst-ldconfig-bad-aux-cache
UNSUPPORTED: elf/tst-ldconfig-ld_so_conf-update
UNSUPPORTED: elf/tst-pldd
UNSUPPORTED: elf/tst-preload-pthread-libc
XPASS: elf/tst-protected1a
XPASS: elf/tst-protected1b
FAIL: elf/tst-tls-allocation-failure-static-patched
FAIL: elf/tst-tls1
FAIL: elf/tst-tls3
FAIL: elf/tst-tlsalign-extern
UNSUPPORTED: elf/tst-valgrind-smoke
UNSUPPORTED: grp/tst-initgroups1
UNSUPPORTED: grp/tst-initgroups2
UNSUPPORTED: io/tst-getcwd-smallbuff
UNSUPPORTED: locale/tst-localedef-path-norm
FAIL: localedata/sort-test
UNSUPPORTED: localedata/tst-localedef-hardlinks
FAIL: malloc/tst-malloc-thread-fail-malloc-check
FAIL: malloc/tst-malloc_info-malloc-check
UNSUPPORTED: math/test-fesetexcept-traps
UNSUPPORTED: math/test-fexcept-traps
UNSUPPORTED: math/test-nearbyint-except
UNSUPPORTED: math/test-nearbyint-except-2
UNSUPPORTED: misc/tst-adjtimex
UNSUPPORTED: misc/tst-clock_adjtime
FAIL: misc/tst-misalign-clone
FAIL: misc/tst-misalign-clone-internal
UNSUPPORTED: misc/tst-ntp_adjtime
UNSUPPORTED: misc/tst-pkey
UNSUPPORTED: misc/tst-rseq
UNSUPPORTED: misc/tst-rseq-disable
UNSUPPORTED: misc/tst-syslog
UNSUPPORTED: misc/tst-ttyname
FAIL: nptl/test-cond-printers
FAIL: nptl/test-condattr-printers
FAIL: nptl/test-mutex-printers
FAIL: nptl/test-mutexattr-printers
FAIL: nptl/test-rwlock-printers
FAIL: nptl/test-rwlockattr-printers
UNSUPPORTED: nptl/tst-pthread-gdb-attach
UNSUPPORTED: nptl/tst-pthread-gdb-attach-static
UNSUPPORTED: nptl/tst-pthread-getattr
UNSUPPORTED: nptl/tst-rseq-nptl
UNSUPPORTED: nss/tst-nss-compat1
UNSUPPORTED: nss/tst-nss-db-endgrent
UNSUPPORTED: nss/tst-nss-db-endpwent
UNSUPPORTED: nss/tst-nss-files-hosts-long
UNSUPPORTED: nss/tst-nss-gai-actions
UNSUPPORTED: nss/tst-nss-test3
UNSUPPORTED: nss/tst-reload1
UNSUPPORTED: nss/tst-reload2
UNSUPPORTED: posix/bug-ga2
UNSUPPORTED: posix/bug-ga2-mem
FAIL: posix/globtest
UNSUPPORTED: posix/tst-vfork3
UNSUPPORTED: posix/tst-vfork3-mem
UNSUPPORTED: resolv/mtrace-tst-leaks2
UNSUPPORTED: resolv/tst-leaks2
UNSUPPORTED: resolv/tst-resolv-ai_idn
UNSUPPORTED: resolv/tst-resolv-ai_idn-latin1
UNSUPPORTED: resolv/tst-resolv-res_init
UNSUPPORTED: resolv/tst-resolv-res_init-thread
UNSUPPORTED: rt/tst-bz28213
UNSUPPORTED: rt/tst-mqueue1
UNSUPPORTED: rt/tst-mqueue10
UNSUPPORTED: rt/tst-mqueue2
UNSUPPORTED: rt/tst-mqueue3
UNSUPPORTED: rt/tst-mqueue4
UNSUPPORTED: rt/tst-mqueue5
UNSUPPORTED: rt/tst-mqueue6
UNSUPPORTED: rt/tst-mqueue8
UNSUPPORTED: rt/tst-mqueue8x
UNSUPPORTED: rt/tst-mqueue9
UNSUPPORTED: stdlib/test-bz22786
UNSUPPORTED: stdlib/tst-system
UNSUPPORTED: string/test-bcopy
UNSUPPORTED: string/test-memmove
UNSUPPORTED: string/tst-memmove-overflow
UNSUPPORTED: string/tst-strerror
UNSUPPORTED: string/tst-strsignal
UNSUPPORTED: time/tst-clock_settime
UNSUPPORTED: time/tst-settimeofday
Summary of test results:
     21 FAIL
   4184 PASS
     69 UNSUPPORTED
     16 XFAIL
      2 XPASS

Signed-off-by: Shahab Vahedi <shahab@synopsys.com>
Signed-off-by: Vineet Gupta <vineet.gupta@linux.dev>
2022-11-29 14:33:56 -08:00
caiyinyu
fb6ee7ba81 LoongArch: Fix ABI related macros in elf.h to keep consistent with binutils[1].
[1]:
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=c4a7e6b56218e1d5a858682186b542e2eae01a4a;hp=0d94a8735055432029237612a6eb9165db1ec9dd
[2]:
Reference: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html#_e_flags_identifies_abi_type_and_version
2022-11-03 21:02:56 +08:00
Joseph Myers
ba0ca36132 Add NT_S390_PV_CPU_DATA from Linux 6.0 to elf.h
Add the new NT_S390_PV_CPU_DATA constant from Linux 6.0 to glibc's
elf.h.

Tested for x86_64.
2022-10-12 14:28:47 +00:00
Florian Weimer
29eb796119 elf.h: Remove duplicate definition of VER_FLG_WEAK
This did not cause a warning before because the token sequence for
the two definitions was identical.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2022-09-05 15:02:09 +02:00
Joseph Myers
025a8cce63 Add NT_LOONGARCH_* from Linux 5.19 to elf.h
Add the new NT_LOONGARCH_* constants from Linux 5.19 to glibc's elf.h.

Tested for x86_64.
2022-08-24 18:19:13 +00:00
Fangrui Song
61d2066c19 elf.h: Add ELFCOMPRESS_ZSTD
From the approved generic ABI proposal
https://groups.google.com/g/generic-abi/c/satyPkuMisk
("Add new ch_type value: ELFCOMPRESS_ZSTD").

Reviewed-by: Florian Weimer <fweimer@redhat.com>
2022-08-10 21:46:09 -07:00
caiyinyu
2d83247d90 LoongArch: Add relocations and ELF flags to elf.h and scripts/glibcelf.py 2022-07-26 12:35:12 -03:00
Joseph Myers
603e5c8ba7 Add PT_AARCH64_MEMTAG_MTE from Linux 5.18 to elf.h
Linux 5.18 defines a new AArch64 ELF segment type
PT_AARCH64_MEMTAG_MTE; add it to elf.h.

Tested with build-many-glibcs.py for aarch64-linux-gnu.
2022-06-06 14:45:34 +00:00
Andreas Schwab
0b6c675073 Update RISC-V specific ELF definitions
The definitions are taken from the 1.0-rc2 version of the ELF psABI.
2022-05-16 15:51:57 +02:00
H.J. Lu
4610b24f5e elf: Define DT_RELR related macros and types 2022-04-26 10:16:11 -07:00
Stafford Horne
8e1ad8073a elf: Add reloc for OpenRISC
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2022-01-05 06:40:05 +09:00
Paul Eggert
581c785bf3 Update copyright dates with scripts/update-copyrights
I used these shell commands:

../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright
(cd ../glibc && git commit -am"[this commit message]")

and then ignored the output, which consisted lines saying "FOO: warning:
copyright statement not found" for each of 7061 files FOO.

I then removed trailing white space from math/tgmath.h,
support/tst-support-open-dev-null-range.c, and
sysdeps/x86_64/multiarch/strlen-vec.S, to work around the following
obscure pre-commit check failure diagnostics from Savannah.  I don't
know why I run into these diagnostics whereas others evidently do not.

remote: *** 912-#endif
remote: *** 913:
remote: *** 914-
remote: *** error: lines with trailing whitespace found
...
remote: *** error: sysdeps/unix/sysv/linux/statx_cp.c: trailing lines
2022-01-01 11:40:24 -08:00
H.J. Lu
268d812c19 elf: Remove AArch64 from comment for AT_MINSIGSTKSZ
Remove AArch64 from comment for AT_MINSIGSTKSZ to match

commit 7cd60e43a6def40ecb75deb8decc677995970d0b
Author: Chang S. Bae <chang.seok.bae@intel.com>
Date:   Tue May 18 13:03:15 2021 -0700

    uapi/auxvec: Define the aux vector AT_MINSIGSTKSZ

    Define AT_MINSIGSTKSZ in the generic uapi header. It is already used
    as generic ABI in glibc's generic elf.h, and this define will prevent
    future namespace conflicts. In particular, x86 is also using this
    generic definition.

in Linux kernel 5.14.
2021-12-23 06:48:24 -08:00
Luca Boccassi
0656b649c5 elf: add definition for ELF_NOTE_FDO and NT_FDO_PACKAGING_METADATA note
As defined on: https://systemd.io/COREDUMP_PACKAGE_METADATA/
this note will be used starting from Fedora 36.

Signed-off-by: Luca Boccassi <bluca@debian.org>
2021-12-02 23:01:51 +01:00
H.J. Lu
1bd888d0b7 Initial support for GNU_PROPERTY_1_NEEDED
1. Add GNU_PROPERTY_1_NEEDED:

 #define GNU_PROPERTY_1_NEEDED      GNU_PROPERTY_UINT32_OR_LO

to indicate the needed properties by the object file.
2. Add GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS:

 #define GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS (1U << 0)

to indicate that the object file requires canonical function pointers and
cannot be used with copy relocation.
3. Scan GNU_PROPERTY_1_NEEDED property and store it in l_1_needed.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-10-07 10:26:08 -07:00
Joseph Myers
bba4383c6b Add NT_ARM_PAC_ENABLED_KEYS to elf.h
This patch adds the new NT_ARM_PAC_ENABLED_KEYS constant from Linux
5.13 to glibc's elf.h.

Tested for x86_64.
2021-07-08 17:36:27 +00:00
H.J. Lu
9cbe4ed14e elf: Add EM_INTELGT for Intel Graphics Technology
Add EM_INTELGT (205) for Intel Graphics Technology which has been added
to gABI:

https://groups.google.com/g/generic-abi/c/ofBevXA48dM
2021-03-19 11:09:18 -07:00
Joseph Myers
339f7fea92 Add NT_ARM_TAGGED_ADDR_CTRL from Linux 5.10 to elf.h.
This patch adds the new NT_ARM_TAGGED_ADDR_CTRL constant from Linux
5.10 to glibc's elf.h.

Tested for x86_64.
2021-02-05 01:47:57 +00:00
H.J. Lu
ecce11aa07 x86: Support GNU_PROPERTY_X86_ISA_1_V[234] marker [BZ #26717]
GCC 11 supports -march=x86-64-v[234] to enable x86 micro-architecture ISA
levels:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97250

and -mneeded to emit GNU_PROPERTY_X86_ISA_1_NEEDED property with
GNU_PROPERTY_X86_ISA_1_V[234] marker:

https://gitlab.com/x86-psABIs/x86-64-ABI/-/merge_requests/13

Binutils support for GNU_PROPERTY_X86_ISA_1_V[234] marker were added by

commit b0ab06937385e0ae25cebf1991787d64f439bf12
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Oct 30 06:49:57 2020 -0700

    x86: Support GNU_PROPERTY_X86_ISA_1_BASELINE marker

and

commit 32930e4edbc06bc6f10c435dbcc63131715df678
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Oct 9 05:05:57 2020 -0700

    x86: Support GNU_PROPERTY_X86_ISA_1_V[234] marker

GNU_PROPERTY_X86_ISA_1_NEEDED property in x86 ELF binaries indicate the
micro-architecture ISA level required to execute the binary.  The marker
must be added by programmers explicitly in one of 3 ways:

1. Pass -mneeded to GCC.
2. Add the marker in the linker inputs as this patch does.
3. Pass -z x86-64-v[234] to the linker.

Add GNU_PROPERTY_X86_ISA_1_BASELINE and GNU_PROPERTY_X86_ISA_1_V[234]
marker support to ld.so if binutils 2.32 or newer is used to build glibc:

1. Add GNU_PROPERTY_X86_ISA_1_BASELINE and GNU_PROPERTY_X86_ISA_1_V[234]
markers to elf.h.
2. Add GNU_PROPERTY_X86_ISA_1_BASELINE and GNU_PROPERTY_X86_ISA_1_V[234]
marker to abi-note.o based on the ISA level used to compile abi-note.o,
assuming that the same ISA level is used to compile the whole glibc.
3. Add isa_1 to cpu_features to record the supported x86 ISA level.
4. Rename _dl_process_cet_property_note to _dl_process_property_note and
add GNU_PROPERTY_X86_ISA_1_V[234] marker detection.
5. Update _rtld_main_check and _dl_open_check to check loaded objects
with the incompatible ISA level.
6. Add a testcase to verify that dlopen an x86-64-v4 shared object fails
on lesser platforms.
7. Use <get-isa-level.h> in dl-hwcaps-subdirs.c and tst-glibc-hwcaps.c.

Tested under i686, x32 and x86-64 modes on x86-64-v2, x86-64-v3 and
x86-64-v4 machines.

Marked elf/tst-isa-level-1 with x86-64-v4, ran it on x86-64-v3 machine
and got:

[hjl@gnu-cfl-2 build-x86_64-linux]$ ./elf/tst-isa-level-1
./elf/tst-isa-level-1: CPU ISA level is lower than required
[hjl@gnu-cfl-2 build-x86_64-linux]$
2021-01-07 13:10:13 -08:00
Paul Eggert
2b778ceb40 Update copyright dates with scripts/update-copyrights
I used these shell commands:

../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright
(cd ../glibc && git commit -am"[this commit message]")

and then ignored the output, which consisted lines saying "FOO: warning:
copyright statement not found" for each of 6694 files FOO.
I then removed trailing white space from benchtests/bench-pthread-locks.c
and iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c, to work around this
diagnostic from Savannah:
remote: *** pre-commit check failed ...
remote: *** error: lines with trailing whitespace found
remote: error: hook declined to update refs/heads/master
2021-01-02 12:17:34 -08:00
Mark Wielaard
5a96fe2e02 elf.h: Remove SHF_GNU_BUILD_NOTE.
SHF_GNU_BUILD_NOTE was a binutils experiment.  And it is no longer
needed. It was also removed from binutils.
2020-12-12 14:39:44 +01:00
Dmitry V. Levin
30bc003316 elf.h: fix spelling typos in comments
Since elf.h is a public header file copied to other projects,
try to make it free from spelling typos.

This change fixes the following spelling typos in comments of elf.h:

Auxialiary -> Auxiliary
tenatively -> tentatively
compatability -> compatibility
2020-12-12 00:30:00 +00:00
Dmitry V. Levin
14ef9c185b treewide: fix incorrect spelling of indices in comments
Replace 'indeces' with 'indices', the most annoying of these typos were
those found in elf.h which is a public header file copied to other
projects.
2020-12-11 02:00:00 +00:00
Florian Weimer
c41d197ec4 elf: Synchronize <elf.h> section header flags with binutils
binutils 2.36 will add SHF_GNU_RETAIN support.  SHF_GNU_BUILD_NOTE
was also missing from the glibc header.
2020-12-03 14:17:29 +01:00
Florian Weimer
be5365e87b elf.h: Fix spelling of EM_TILE64 comment
Reported-By: Jakub Jelinek <jakub@redhat.com>
2020-12-02 13:58:08 +01:00
Érico Rolim
9538f6b95a Make elf.h header self contained.
The elf/elf.h header is shared, verbatim, by the elfutils project.
However, elfutils can be used on systems with libcs other than glibc,
making the presence of __BEGIN_DECLS, __END_DECLS and <features.h> in
the file something that downstream distros may have to add patches for.

Furthermore, this file doesn't declare anything with language linkage,
so `extern "C" {}` blocks aren't necessary; it also doesn't have any
conditional definitions based on feature test macros, making inclusion
of features.h unnecessary.
2020-10-28 11:29:16 +01:00
Mark Wielaard
721a853415 elf.h: Add aarch64 bti/pac dynamic tag constants
Constants double checked against binutils and the ELF for the Arm 64-bit
Architecture (AArch64) Release 2020Q2 document.

Only BTI PLT is used in glibc, there's no PAC PLT with glibc, and people
are expected to use BIND_NOW.
2020-09-07 09:12:04 +02:00
Szabolcs Nagy
03acbc1f71 elf.h: add aarch64 property definitions
These property values are specified by the AArch64 ELF ABI and
binutils can create binaries marked with them.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2020-05-21 09:55:43 +01:00
Szabolcs Nagy
7787a35fd0 elf.h: Add PT_GNU_PROPERTY
This program header type is already used in binaries on x86 and
aarch64 targets.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2020-05-21 09:55:43 +01:00
Vineet Gupta
e8a0f5831e ARC: add definitions to elf/elf.h
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2020-03-25 18:48:48 -07:00
Fangrui Song
ec44e1efcd elf.h: Add R_RISCV_IRELATIVE
The number has been officially assigned by
https://github.com/riscv/riscv-elf-psabi-doc/pull/131
d21ca40a7f
2020-02-12 01:14:38 -05:00
Joseph Myers
d614a75396 Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
Paul Eggert
5a82c74822 Prefer https to http for gnu.org and fsf.org URLs
Also, change sources.redhat.com to sourceware.org.
This patch was automatically generated by running the following shell
script, which uses GNU sed, and which avoids modifying files imported
from upstream:

sed -ri '
  s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g
  s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g
' \
  $(find $(git ls-files) -prune -type f \
      ! -name '*.po' \
      ! -name 'ChangeLog*' \
      ! -path COPYING ! -path COPYING.LIB \
      ! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \
      ! -path manual/texinfo.tex ! -path scripts/config.guess \
      ! -path scripts/config.sub ! -path scripts/install-sh \
      ! -path scripts/mkinstalldirs ! -path scripts/move-if-change \
      ! -path INSTALL ! -path  locale/programs/charmap-kw.h \
      ! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \
      ! '(' -name configure \
            -execdir test -f configure.ac -o -f configure.in ';' ')' \
      ! '(' -name preconfigure \
            -execdir test -f preconfigure.ac ';' ')' \
      -print)

and then by running 'make dist-prepare' to regenerate files built
from the altered files, and then executing the following to cleanup:

  chmod a+x sysdeps/unix/sysv/linux/riscv/configure
  # Omit irrelevant whitespace and comment-only changes,
  # perhaps from a slightly-different Autoconf version.
  git checkout -f \
    sysdeps/csky/configure \
    sysdeps/hppa/configure \
    sysdeps/riscv/configure \
    sysdeps/unix/sysv/linux/csky/configure
  # Omit changes that caused a pre-commit check to fail like this:
  # remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines
  git checkout -f \
    sysdeps/powerpc/powerpc64/ppc-mcount.S \
    sysdeps/unix/sysv/linux/s390/s390-64/syscall.S
  # Omit change that caused a pre-commit check to fail like this:
  # remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline
  git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
2019-09-07 02:43:31 -07:00
Mihailo Stojanovic
23c1c256ae MIPS support for GNU hash
This patch is a reimplementation of [1], which was submitted back in
2015. Copyright issue has been sorted [2] last year. It proposed a new
section (.gnu.xhash) and related dynamic tag (GT_GNU_XHASH). The new
section would be virtually identical to the existing .gnu.hash except
for the translation table (xlat) which would contain correct MIPS
.dynsym indexes corresponding to the hashvals in chains. This is because
MIPS ABI imposes a different ordering of the dynsyms than the one
expected by the .gnu.hash section. Another addition would be a leading
word at the beggining of the section, which would contain the number of
entries in the translation table.

In this patch, the new section name and dynamic tag are changed to
reflect the fact that the section should be treated as MIPS specific
(.MIPS.xhash and DT_MIPS_XHASH).

This patch addresses the alignment issue reported in [3] which is caused
by the leading word of the .MIPS.xhash section. Leading word is now
removed in the corresponding binutils patch, and the number of entries
in the translation table is computed using DT_MIPS_SYMTABNO dynamic tag.

Since the MIPS specific dl-lookup.c file was removed following the
initial patch submission, I opted for the definition of three new macros
in the generic ldsodefs.h. ELF_MACHINE_GNU_HASH_ADDRIDX defines the
index of the dynamic tag in the l_info array. ELF_MACHINE_HASH_SYMIDX is
used to calculate the index of a symbol in GNU hash. On MIPS, it is
defined to look up the symbol index in the translation table.
ELF_MACHINE_XHASH_SETUP is defined for MIPS only. It initializes the
.MIPS.xhash pointer in the link_map_machine struct.

The other major change is bumping the highest EI_ABIVERSION value for
MIPS to suggest that the dynamic linker now supports GNU hash.

The patch was tested by running the glibc testsuite for the three MIPS
ABIs (o32, n32 and n64) and for x86_64-linux-gnu.

[1] https://sourceware.org/ml/binutils/2015-10/msg00057.html
[2] https://sourceware.org/ml/binutils/2018-03/msg00025.html
[3] https://sourceware.org/ml/binutils/2016-01/msg00006.html

	* elf/dl-addr.c (determine_info): Calculate the symbol index
	using the newly defined ELF_MACHINE_HASH_SYMIDX macro.
	* elf/dl-lookup.c (do_lookup_x): Ditto.
	(_dl_setup_hash): Initialize MIPS xhash translation table.
	* elf/elf.h (SHT_MIPS_XHASH): New define.
	(DT_MIPS_XHASH): New define.
	* sysdeps/generic/ldsodefs.h (ELF_MACHINE_GNU_HASH_ADDRIDX): New
	define.
	(ELF_MACHINE_HASH_SYMIDX): Ditto.
	(ELF_MACHINE_XHASH_SETUP): Ditto.
	* sysdeps/mips/ldsodefs.h (ELF_MACHINE_GNU_HASH_ADDRIDX): New
	define.
	(ELF_MACHINE_HASH_SYMIDX): Ditto.
	(ELF_MACHINE_XHASH_SETUP): Ditto.
	* sysdeps/mips/linkmap.h (struct link_map_machine): New member.
	* sysdeps/unix/sysv/linux/mips/ldsodefs.h: Increment valid ABI
	version.
	* sysdeps/unix/sysv/linux/mips/libc-abis: New ABI version.
2019-08-29 20:11:42 +00:00
Szabolcs Nagy
55f82d328d aarch64: add STO_AARCH64_VARIANT_PCS and DT_AARCH64_VARIANT_PCS
STO_AARCH64_VARIANT_PCS is a non-visibility st_other flag for marking
symbols that reference functions that may follow a variant PCS with
different register usage convention from the base PCS.

DT_AARCH64_VARIANT_PCS is a dynamic tag that marks ELF modules that
have R_*_JUMP_SLOT relocations for symbols marked with
STO_AARCH64_VARIANT_PCS (i.e. have variant PCS calls via a PLT).

	* elf/elf.h (STO_AARCH64_VARIANT_PCS): Define.
	(DT_AARCH64_VARIANT_PCS): Define.
2019-06-13 09:44:44 +01:00
Joseph Myers
1388600877 Add NT_ARM_PACA_KEYS and NT_ARM_PACG_KEYS from Linux 5.1 to elf.h.
This patch adds the new NT_ARM_PACA_KEYS and NT_ARM_PACG_KEYS from
Linux 5.1 to glibc's elf.h.

Tested for x86_64.

	* elf/elf.h (NT_ARM_PACA_KEYS): New macro.
	(NT_ARM_PACG_KEYS): Likewise.
2019-05-20 11:51:58 +00:00
Joseph Myers
9ac2de697e Add NT_ARM_PAC_MASK and NT_MIPS_MSA from Linux 5.0 to elf.h.
This patch adds two new NT_* macros from Linux 5.0 to elf.h.

Tested for x86_64.

	* elf/elf.h (NT_ARM_PAC_MASK): New macro.
	(NT_MIPS_MSA): Likewise.
2019-03-25 13:15:56 +00:00
Florian Weimer
38b52865d4 elf: Add DF_1_KMOD, DF_1_WEAKFILTER, DF_1_NOCOMMON to <elf.h>
These constants (originally from Solaris) were part of the binutils
2.31 release.
2019-03-12 12:06:01 +01:00
Mao Han
5fbcd76351 C-SKY: add elf header definition for elfutils
This patch adds some defines relate to machine flag and section information,
which is used by elfutils elflint check. A C-SKY typo is also fixed with
this patch.

	* elf/elf.h (EF_CSKY_ABIMASK, EF_CSKY_OTHER, EF_CSKY_PROCESSOR)
	(EF_CSKY_ABIV1, EF_CSKY_ABIV2, SHT_CSKY_ATTRIBUTES): New defines.
2019-03-11 09:54:34 +08:00
Joseph Myers
04277e02d7 Update copyright dates with scripts/update-copyrights.
* All files with FSF copyright notices: Update copyright dates
	using scripts/update-copyrights.
	* locale/programs/charmap-kw.h: Regenerated.
	* locale/programs/locfile-kw.h: Likewise.
2019-01-01 00:11:28 +00:00
Mao Han
4975f0c3d0 C-SKY: Add dynamic relocations to elf.h
* elf/elf.h (EM_CSKY, R_CKCORE_NONE, R_CKCORE_ADDR32)
	(R_CKCORE_PCRELIMM8BY4, R_CKCORE_PCRELIMM11BY2, R_CKCORE_PCREL32)
	(R_CKCORE_PCRELJSR_IMM11BY2, R_CKCORE_RELATIVE, R_CKCORE_COPY)
	(R_CKCORE_GLOB_DAT, R_CKCORE_JUMP_SLOT, R_CKCORE_GOTOFF)
	(R_CKCORE_GOTPC, R_CKCORE_GOT32, R_CKCORE_PLT32, R_CKCORE_ADDRGOT)
	(R_CKCORE_ADDRPLT, R_CKCORE_PCREL_IMM26BY2, R_CKCORE_PCREL_IMM16BY2)
	(R_CKCORE_PCREL_IMM16BY4, R_CKCORE_PCREL_IMM10BY2)
	(R_CKCORE_PCREL_IMM10BY4, R_CKCORE_ADDR_HI16, R_CKCORE_ADDR_LO16)
	(R_CKCORE_GOTPC_HI16, R_CKCORE_GOTPC_LO16, R_CKCORE_GOTOFF_HI16)
	(R_CKCORE_GOTOFF_LO16, R_CKCORE_GOT12, R_CKCORE_GOT_HI16)
	(R_CKCORE_GOT_LO16, R_CKCORE_PLT12, R_CKCORE_PLT_HI16)
	(R_CKCORE_PLT_LO16, R_CKCORE_ADDRGOT_HI16, R_CKCORE_ADDRGOT_LO16)
	(R_CKCORE_ADDRPLT_HI16, R_CKCORE_ADDRPLT_LO16)
	(R_CKCORE_PCREL_JSR_IMM26BY2, R_CKCORE_TOFFSET_LO16)
	(R_CKCORE_DOFFSET_LO16, R_CKCORE_PCREL_IMM18BY2)
	(R_CKCORE_DOFFSET_IMM18, R_CKCORE_DOFFSET_IMM18BY2)
	(R_CKCORE_DOFFSET_IMM18BY4, R_CKCORE_GOT_IMM18BY4)
	(R_CKCORE_PLT_IMM18BY4, R_CKCORE_PCREL_IMM7BY4, R_CKCORE_TLS_LE32)
	(R_CKCORE_TLS_IE32, R_CKCORE_TLS_GD32, R_CKCORE_TLS_LDM32)
	(R_CKCORE_TLS_LDO32, R_CKCORE_TLS_DTPMOD32, R_CKCORE_TLS_DTPOFF32)
	(R_CKCORE_TLS_TPOFF32): New defines.
2018-11-29 17:32:13 +00:00
Joseph Myers
5b784e8834 Add new ELF note types from Linux 4.19 to elf.h.
This patch adds NT_MIPS_DSP and NT_MIPS_FP_MODE from Linux 4.19 to
elf.h.

Tested for x86_64.

	* elf/elf.h (NT_MIPS_DSP): New macro.
	(NT_MIPS_FP_MODE): Likewise.
2018-10-25 11:55:23 +00:00
Joseph Myers
174195409d Add NT_VMCOREDD, AT_MINSIGSTKSZ from Linux 4.18 to elf.h.
This patch adds two new constants from Linux 4.18 to elf.h,
NT_VMCOREDD and AT_MINSIGSTKSZ.

Tested for x86_64.

	* elf/elf.c (NT_VMCOREDD): New macro.
	(AT_MINSIGSTKSZ): Likewise.
2018-08-20 15:46:26 +00:00