Commit Graph

45 Commits

Author SHA1 Message Date
Elliott Hughes 15aa7abd34 elf.h: add NT_RISCV_CSR and NT_RISCV_VECTOR constants
See Linux commit 9300f00439743c4a34d735e1a27118eb68a1504e ("RISC-V: Add
ptrace support for vectors").
2024-02-03 19:48:25 -05:00
Fangrui Song 25c4123629 elf.h: update RISC-V relocation types
Note: Some relocation types were only used by binutils and
accidentally exposed to previous versions of psABI. One of the values
has been reused by GOT32_PCREL.
2024-02-03 19:45:53 -05:00
Violet Purcell 6be76895f6 elf.h: add typedefs for Elf64_Relr and Elf32_Relr
These were overlooked when DT_RELR was added in commit
d32dadd60e, potentially breaking
software that treats presence of the DT_RELR macro as implying they
exist.
2023-11-06 08:02:59 -05:00
Fangrui Song c5f4b2dfea elf.h: add ELFCOMPRESS_ZSTD 2022-12-14 09:34:32 -05:00
Fangrui Song d32dadd60e ldso: support DT_RELR relative relocation format
this resolves DT_RELR relocations in non-ldso, dynamic-linked objects.
2022-08-02 17:27:45 -04:00
Szabolcs Nagy a8300f5d2a elf.h: add NT_ARM_PAC_ENABLED_KEYS from linux v5.13
see

  linux commit 201698626fbca1cf1a3b686ba14cf2a056500716
  arm64: Introduce prctl(PR_PAC_{SET,GET}_ENABLED_KEYS)
2022-03-08 17:21:26 -05:00
Szabolcs Nagy 8b29f02370 elf.h: add NT_ARM_TAGGED_ADDR_CTRL from linux v5.10
see

  linux commit 2200aa7154cb7ef76bac93e98326883ba64bfa2e
  arm64: mte: ptrace: Add NT_ARM_TAGGED_ADDR_CTRL regset
2021-02-15 09:16:06 -05:00
Szabolcs Nagy 6b1741aaf5 elf.h: add .note.gnu.property related definitions
On x86 and aarch64 GNU properties may be used to mark ELF objects.
2020-09-09 17:22:02 -04:00
Szabolcs Nagy 47bc7f0afe elf.h: add NT_ARM_PAC{A,G}_KEYS from linux v5.1
to request or change pointer auth keys for criu via ptrace, new in

  linux commit d0a060be573bfbf8753a15dca35497db5e968bb0
  arm64: add ptrace regsets for ptrauth key management
2019-07-01 14:16:49 -04:00
Rich Felker 0a48860c27 add riscv64 architecture support
Author: Alex Suykov <alex.suykov@gmail.com>
Author: Aric Belsito <lluixhi@gmail.com>
Author: Drew DeVault <sir@cmpwn.com>
Author: Michael Clark <mjc@sifive.com>
Author: Michael Forney <mforney@mforney.org>
Author: Stefan O'Rear <sorear2@gmail.com>

This port has involved the work of many people over several years. I
have tried to ensure that everyone with substantial contributions has
been credited above; if any omissions are found they will be noted
later in an update to the authors/contributors list in the COPYRIGHT
file.

The version committed here comes from the riscv/riscv-musl repo's
commit 3fe7e2c75df78eef42dcdc352a55757729f451e2, with minor changes by
me for issues found during final review:

- a_ll/a_sc atomics are removed (according to the ISA spec, lr/sc
  are not safe to use in separate inline asm fragments)

- a_cas[_p] is fixed to be a memory barrier

- the call from the _start assembly into the C part of crt1/ldso is
  changed to allow for the possibility that the linker does not place
  them nearby each other.

- DTP_OFFSET is defined correctly so that local-dynamic TLS works

- reloc.h LDSO_ARCH logic is simplified and made explicit.

- unused, non-functional crti/n asm files are removed.

- an empty .sdata section is added to crt1 so that the
  __global_pointer reference is resolvable.

- indentation style errors in some asm files are fixed.
2019-06-14 17:13:05 -04:00
Szabolcs Nagy 843e453c11 elf.h: add NT_ definitions from linux v5.0
NT_MIPS_MSA for ptrace access to mips simd arch reg set, added in linux
commit 3cd640832894b85b5929d5bda74505452c800421
NT_ARM_PAC_MASK for ptrace access to pointer auth code mask, added in
commit ec6e822d1a22d0eef1d1fa260dff751dba9a4258
2019-03-13 12:34:08 -04:00
Szabolcs Nagy 02f769b20d elf.h: update with C-SKY definitions
C-SKY support was added to binutils 2.32 in commit
b8891f8d622a31306062065813fc278d8a94fe21
the elf.h change was added to glibc 2.29 in commit
4975f0c3d0131fdf697be0b1631c265e5fd39088
2019-03-13 12:34:03 -04:00
Szabolcs Nagy 5640bc5bd5 elf.h: add new mips core dump note values from linux v4.19
NT_MIPS_FP_MODE is new in linux commit
1ae22a0e35636efceab83728ba30b013df761592

NT_MIPS_DSP is new in linux commit
44109c60176ae73924a42a6bef64ef151aba9095
2019-03-13 12:31:13 -04:00
Szabolcs Nagy 1de4788610 add NT_VMCOREDD to elf.h from linux v4.18
used for device driver dump in /proc/vmcore
new in linux commit 2724273e8fd00b512596a77ee063f49b25f36507
2018-12-09 22:30:05 -05:00
Szabolcs Nagy 836022b1c3 add AT_MINSIGSTKSZ to elf.h from linux v4.18
new in linux commit 94b07c1f8c39c6d839df35fa28ffd1785d385897

currently only supported on aarch64
2018-12-09 22:29:44 -05:00
Rich Felker d5e55ba332 add missing m68k relocation types in elf.h 2018-06-12 17:02:21 -04:00
Szabolcs Nagy 74ab4b8284 elf.h: add DT_SYMTAB_SHNDX
it's a recent addition to elf gabi:
http://sco.com/developers/gabi/latest/revision.html
based on discussions at
https://sourceware.org/bugzilla/show_bug.cgi?id=15835
2018-02-22 18:51:16 -05:00
Szabolcs Nagy dfeeeaf544 elf.h: syncronize DF_1_ flags with binutils
DF_1_STUB and DF_1_PIE were added in binutils-gdb commit
5c383f026242d25a3c21fdfda42e5ca218b346c8
2018-02-22 18:51:00 -05:00
Szabolcs Nagy eef5e4821d elf.h: update NT_* coredump elf notes for linux v4.15
NT_ARM_SVE and NT_S390_RI_CB are new in linux commits
43d4da2c45b2f5d62f8a79ff7c6f95089bb24656 and
262832bc5acda76fd8f901d39f4da1121d951222
the rest are older.
musl missed NT_PRFPREG because it followed the glibc api:
https://sourceware.org/bugzilla/show_bug.cgi?id=14890
2018-02-22 18:49:46 -05:00
Szabolcs Nagy 5024804176 elf.h: add PPC64_OPT_LOCALENTRY
allows calling extern functions without saving r2, for details see
glibc commit 0572433b5beb636de1a49ec6b4fdab830c38cdc5
2018-02-22 18:49:42 -05:00
Szabolcs Nagy e7bd039df2 elf.h: add AT_* auxval macros for cache geometry
AT_L1I_*, AT_L1D_*, AT_L2_* and AT_L3_* were added in linux v4.11 for
powerpc in commit 98a5f361b8625c6f4841d6ba013bbf0e80d08147.
2018-02-22 18:49:39 -05:00
Szabolcs Nagy 5a05f67599 elf.h: update EM_ elf machine defines and add R_BPF_ defines
sync with gabi: http://www.sco.com/developers/gabi/latest/ch4.eheader.html

EM_BPF is new in linux v4.8 and officially assigned:
https://lists.iovisor.org/pipermail/iovisor-dev/2016-June/000266.html
added related relocs too.
2016-10-20 01:27:46 -04:00
Rich Felker ee3f0c5516 make brace placement in public header typedef'd structs consistent
commit befa5866ee performed this change
for struct definitions that did not also involve typedef, but omitted
the latter.
2016-07-03 16:19:28 -04:00
Szabolcs Nagy 3c3b09980d add EF_SH_ sh specific macros to elf.h
last time elf.h was thoroughly updated sh was not yet supported
so these processor specific e_flags were missing.
2016-07-03 16:15:13 -04:00
Szabolcs Nagy 84fd4e4ffd add NT_ARM_SYSTEM_CALL to elf.h
new regset in linux v3.18 for ptrace.
2016-07-03 16:15:12 -04:00
Szabolcs Nagy c3be411df7 add missing x86 relocs to elf.h
see
https://sourceware.org/ml/libc-alpha/2016-01/msg00822.html
2016-07-03 16:15:12 -04:00
Szabolcs Nagy 7c3b67234c add DT_MIPS_RLD_MAP_REL to elf.h
marks different RLD_MAP for debugging PIE binaries.
2016-07-03 16:15:12 -04:00
Szabolcs Nagy af17dc40dd add SHF_COMPRESSED section flag to elf.h
following
http://www.sco.com/developers/gabi/latest/ch4.sheader.html
2016-07-03 16:15:12 -04:00
Szabolcs Nagy 29a96c1980 add powerpc tls optimization related definitions to elf.h
see
https://sourceware.org/ml/libc-alpha/2015-03/msg00580.html
2016-07-03 16:15:11 -04:00
Szabolcs Nagy 347d0617d1 add nios2 definitions to elf.h 2016-07-03 16:15:11 -04:00
Szabolcs Nagy abbdf0f51d update elf.h with mips abi flags support
following
https://sourceware.org/ml/libc-alpha/2014-05/msg00332.html
2016-07-03 16:15:11 -04:00
Szabolcs Nagy 49eb322425 update elf.h with new aarch64 relocs
add ilp32 related relocs and alternative names for a few macros following
https://sourceware.org/ml/libc-alpha/2014-11/msg00455.html
2016-07-03 16:15:10 -04:00
Szabolcs Nagy b921e0fd1f update elf.h with powerpc64 elfv2 abi related macros
see
https://sourceware.org/ml/libc-alpha/2013-11/msg00315.html
https://sourceware.org/ml/libc-alpha/2013-11/msg00314.html
2016-07-03 16:12:12 -04:00
Szabolcs Nagy 35b58194dc add new powerpc64 relocations to elf.h
following the corresponding binutils and glibc changes
https://sourceware.org/ml/binutils/2013-10/msg00372.html
2016-07-03 16:11:12 -04:00
Szabolcs Nagy 308e4bc618 add EM_OPENRISC again to elf.h
it was changed to EM_OR1K in 200d15479c
as that was meant to be the official name, but glibc and the latest
gabi spec still uses the EM_OPENRISC name:
http://www.sco.com/developers/gabi/latest/ch4.eheader.html
binutils defines both macros so we should do the same for backward
compatibility.
2016-07-03 16:11:05 -04:00
Rich Felker 17cdbc4e42 add sh relocation types needed for fdpic to elf.h 2015-09-12 02:49:02 +00:00
Rich Felker e98a54643e fix integer overflow in elf.h macro SHF_EXCLUDE 2015-05-01 13:35:51 -04:00
Stefan Kristiansson 200d15479c add or1k (OpenRISC 1000) architecture port
With the exception of a fenv implementation, the port is fully featured.
The port has been tested in or1ksim, the golden reference functional
simulator for OpenRISC 1000.
It passes all libc-test tests (except the math tests that
requires a fenv implementation).

The port assumes an or1k implementation that has support for
atomic instructions (l.lwa/l.swa).

Although it passes all the libc-test tests, the port is still
in an experimental state, and has yet experienced very little
'real-world' use.
2014-07-18 14:10:23 -04:00
Szabolcs Nagy a8a4e5c598 elf.h: add aarch64 relocations 2014-02-25 00:17:29 +01:00
Szabolcs Nagy d99c999322 elf.h: new elf header flag to mark 2008-NaN vs legacy-NaN on mips
see glibc commit 9c21573c02446b3d5cf6a34b67c8545e5be6a600
2014-02-25 00:12:39 +01:00
Szabolcs Nagy 268375c1c0 update include/elf.h following glibc changes
the changes were verified using various sources:
linux: include/uapi/linux/elf.h
binutils: include/elf/common.h
glibc: elf/elf.h
sysv gabi: http://www.sco.com/developers/gabi/latest/contents.html
sun linker docs: http://docs.oracle.com/cd/E18752_01/pdf/817-1984.pdf
and platform specific docs

- fixed:
EF_MIPS_* E_MIPS_* e_flags: fixed accoding to glibc and binutils

- added:
ELFOSABI_GNU for EI_OSABI entry: glibc, binutils and sysv gabi
EM_* e_machine values: updated according to linux and glibc
PN_XNUM e_phnum value: from glibc and linux, see oracle docs
NT_* note types: updated according to linux and glibc
DF_1_* flags for DT_FLAGS_1 entry: following glibc and oracle docs
AT_HWCAP2 auxv entry for more hwcap bits accoding to linux and glibc
R_386_SIZE32 relocation according to glibc and binutils
EF_ARM_ABI_FLOAT_* e_flags: added following glibc and binutils
R_AARCH64_* relocs: added following glibc and aarch64 elf specs
R_ARM_* relocs: according to glibc, binutils and arm elf specs
R_X86_64_* relocs: added missing relocs following glibc

- removed:
HWCAP_SPARC_* flags were moved to arch specific header in glibc
R_ARM_SWI24 reloc is marked as obsolete in glibc, not present in binutils
  not specified in arm elf spec, R_ARM_TLS_DESC reused its number
  see http://www.codesourcery.com/publications/RFC-TLSDESC-ARM.txt

- glibc changes not pulled in:
ELFOSABI_ARM_AEABI (bare-metal system, binutils and glibc disagrees about the name)
R_68K_* relocs for unsupported platform
R_SPARC_* ditto
EF_SH* ditto (e_flags)
EF_S390* ditto (e_flags)
R_390* ditto
R_MN10300* ditto
R_TILE* ditto
2013-09-16 15:16:55 +00:00
Rich Felker 21284ec75d microblaze TLS relocation support, completely untested 2012-10-15 21:01:48 -04:00
Rich Felker 8c0a3d9e5c microblaze port
based on initial work by rdp, with heavy modifications. some features
including threads are untested because qemu app-level emulation seems
to be broken and I do not have a proper system image for testing.
2012-09-29 01:05:31 -04:00
Rich Felker 57d5fff5f7 header file fixes: multiple include guard consistency and correctness
one file was reusing another file's macro name, and many had
inconsistent underscores and application of SYS prefix, etc.

patch by Szabolcs Nagy (nsz)
2012-06-15 21:52:53 -04:00
Rich Felker 0b44a0315b initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00