Home | History | Annotate | Download | only in sys
History log of /src/sys/sys/exec_elf.h
RevisionDateAuthorComments
 1.177  27-May-2025  christos st_value should be Elf_Addr in both 32 and 64 bit variants.
 1.176  14-May-2025  andvar s/STMicroeletronics/STMicroelectronics/ in comment.
 1.175  02-May-2025  riastradh sys/exec_elf.h: Add RELR definitions.

The SHT_RELR .relr.dyn section, identified in DT_RELR dynamic tag,
holds compressed R_*_RELATIVE-type relocations, substantially
reducing the disk space occupied by many programs.

Reference:

Rahul Chaudhry, `Re: Proposal for a new section type SHT_RELR',
generic-abi mailing list, 2018-02-07.

https://groups.google.com/g/generic-abi/c/bX460iggiKg/m/Jnz1lgLJAgAJ
https://web.archive.org/web/20241213012330/https://groups.google.com/g/generic-abi/c/bX460iggiKg/m/Jnz1lgLJAgAJ

Proposed on tech-userlevel:
https://mail-index.NetBSD.org/tech-userlevel/2025/04/27/msg014727.html

PR bin/59360: ld.elf_so(8): missing RELR support
 1.174  27-Apr-2025  riastradh sys/exec_elf.h: Add some missing numbers from the ELF gABI.

Fix the meta-number DT_ENCODING while here: it is defined to be 32,
not 31; it is a name for the smallest DT_* tag that follows the rule
of only even-numbered tags using d_ptr, and odd-numbered tags using
either nothing or d_val. Nothing uses DT_ENCODING directly, though,
so this shouldn't affect anything.

https://www.sco.com/developers/gabi/latest/ch5.dynamic.html

Preparation for:

PR bin/59360: ld.elf_so(8): missing RELR support
 1.173  27-Apr-2025  riastradh sys/exec_elf.h: Nix trailing whitespace.

No functional change intended.

Preparation for:

PR bin/59360: ld.elf_so(8): missing RELR support
 1.172  17-Mar-2025  andvar s/micorprocessor/microprocessor/ in comments.
 1.171  08-Jan-2023  christos sync machine list with spec
 1.170  08-Jun-2022  rin Do not warn for ELF note for FDO packaging metadata
(https://systemd.io/COREDUMP_PACKAGE_METADATA/),
found in userland binaries of Fedora 36.
 1.169  28-May-2022  andvar s/hidding/hiding/
 1.168  19-Oct-2020  christos Arrange so that no options COREDUMP and no options PTRACE work together.
Thanks to Paul Goyette for testing.
 1.167  10-Oct-2020  thorpej Rename:
- EM_ALPHA (41) -> EM_OLD_ALPHA
- EM_ALPHA_EXP (36902) -> EM_ALPHA

36902 has been the value in common usage for a long time, and this naming
aligns with binutils, etc.

PR port-alpha/51926
 1.166  29-Feb-2020  kamil Add defines for MIPS_XHASH (.MIPS.xhash)

MIPS version of GNU_HASH as supported by GNU toolchain.
 1.165  27-Feb-2020  kamil Register DT_GNU_HASH

GNU-style hash table is supported in GNU and LLVM toolchains.

https://sourceware.org/ml/binutils/2006-10/msg00377.html
 1.164  02-Jan-2020  kamil branches: 1.164.2;
Sync the e_ident[EI_OSABI] magic values with the ELF specification

source: http://www.sco.com/developers/gabi/latest/ch4.eheader.html
 1.163  02-Jan-2020  kamil Update e_machine magic values with the ELF specification

source: http://www.sco.com/developers/gabi/latest/ch4.eheader.html
 1.162  02-Jan-2020  kamil Fix the EM_TILEGX number in the ELF header

source: http://www.sco.com/developers/gabi/latest/ch4.eheader.html

191 is confirmed in LLVM, GNU toolchain, FreeBSD.
 1.161  07-Jun-2019  christos deduplicate the elf auxv builder code, welcome to 8.99.43
 1.160  24-May-2018  christos branches: 1.160.2;
Complete the list of DF_1 flags.
 1.159  12-Apr-2018  christos There have never been binaries with a checksum tag for NetBSD.
These days the equivalent functionality is provided by the build
id tag. It was incorrect in the first place to overload tag #2
(which used to be the emulation name) with a different meaning, so
actually document the meaning that was once used (because binaries
with that tag exist).

Tag existance noticed by kre@
 1.158  06-Nov-2017  christos branches: 1.158.2;
Since _RUMPKERNEL is really userland code it needs ARCH_ELFSIZE,
not KERN_ELFSIZE, make it so!
 1.157  06-Nov-2017  christos Use KERN_ELFSIZE if we are in the kernel.
 1.156  03-Sep-2016  christos Add mips abiflags section
 1.155  31-May-2016  christos Add an ElfW() macro like linux.
 1.154  24-May-2016  christos Add a note for the auxv array so we can find our load location from a
core file of a PIE binary.
 1.153  19-Feb-2016  christos Intel MCU.
 1.152  06-Feb-2016  riastradh Don't do _BSD_SIZE_T_ dance here. Use <stddef.h> in userland.

This file is used in tools, where _BSD_SIZE_T_ is unreliable. In the
kernel, <sys/types.h> will define size_t anyway. Outside the kernel,
<stddef.h> is the standard way to get size_t.
 1.151  01-Nov-2015  christos Ignore the ancient 01.01 tag that gnuc used to put in old NetBSD binaries.
 1.150  01-Nov-2015  christos Add buildid Go note
 1.149  30-Jul-2015  maxv Revamp PaX:
- don't confuse between ELF flags and proc flags. Introduce the proc-
specific P_PAX_ASLR, P_PAX_MPROTECT and P_PAX_GUARD flags.
- introduce pax_setup_elf_flags(), which takes as argument the PaX flag
of the ELF PaX note section, and which sets the proc flag as
appropriate. Also introduce a couple of other functions used for that
purpose.
- modify pax_aslr_active(), and all the other similar pieces of code, so
that it checks the proc flag directly, without extra ELF computation

In addition to making PaX clearer, the combination of these changes fixes
the following bug: if a non-PaX'ed process is launched, and then someone
sets security.pax.{aslr,mprotect,segvguard}.global=1, the process becomes
PaX'ed while its address space hasn't been randomized, which is not likely
to be a good idea.

Now, only the proc flag is checked at runtime, which means the process's
PaX status won't be altered during the execution.

Also:
- declare PAX_DPRINTF, makes it more readable
- fix a typo in exec_elf.h
 1.148  24-Jul-2015  matt Remove unofficial AVR32
 1.147  24-Jul-2015  matt Add a few more EM_*
 1.146  20-May-2015  matt add struct exec_package;
 1.145  23-Oct-2014  martin branches: 1.145.2;
Add standard size_t dance
 1.144  19-Sep-2014  matt Add EM_RISCV
 1.143  25-Aug-2014  joerg Add basic support for indirect functions. It allows providing a public
function symbol with an implementation choosen at run time.
Refactor calls to functions by address in ld.elf_so to create temporary
function descriptors on the stack, if the address is not leaked outside.

Limitations:
- no support for initialising static storage with function pointers
- no support for unnamed resolver functions

Inspired by FreeBSD's r228435 by kib@freebsd.org.
 1.142  19-Aug-2014  matt EM_OPENRISC is now EM_OR1K but keep a define of EM_OPENRISC to EM_OR1K around.
 1.141  08-Jul-2014  maxv branches: 1.141.2;
Define ELF_MAXNOTESIZE, ELF_MAXSHNUM and ELF_MAXPHNUM in <sys/exec_elf.h>, so
that it can be used externally.
 1.140  09-Mar-2014  christos branches: 1.140.2;
Add more definitions, needed by the new elf toolchain.
 1.139  15-Feb-2014  maxv Remove the last argument of elf_check_header(). It is easier - and faster - to
check the e_type field in the calling function. Other BSD's already do this.

ok christos@
 1.138  11-Feb-2014  skrll Fix typo in DF_STATIC_TLS. From Elliott Hughes on tech-userlevel.
 1.137  03-Jan-2014  dsl Fix bug in previous (panic during process core dump).
Change the interface to ELFNAMEEND(coredump_savenote) so that the caller
doesn't need to know the type of the elf note header.
Simplifies the calling code somewhat.
 1.136  03-Jan-2014  dsl Instead of generating all the 'note' sections twice (and hoping that the
'fast path' size on the first path matches the actual size on the second)
save all the notes (mostly the cpu registers for all the LWPs) in
malloced memory on the first pass.
Sanity check that the number of memory segments matches written matches
the count obtained earlier. If gcore() is used they could differ.
(Not sure that returning ENOMEM is ideal, but it is better than a crash.)
 1.135  03-Jan-2014  dsl Remove the incorrect and unused Elf64_Shalf.
At one time it was used for a 32bit item - but that definition has long
since been changed to use a reasonable 32bit type.
 1.134  02-Jan-2014  christos Add more gnu sections
 1.133  01-Jan-2014  dsl Change the type of the 'cookie' that holds the state of the core dump file
from 'void *' to the actual type 'struct coredump_iostate *'.
In most of the code the contents of the structure are still unknown.
This just stops the wrong type of pointer being passed to the 'void *'
parameter.
I hope I've found everything, amd64 GENERIC and i386 GENERIC & ALL compile.
 1.132  05-Nov-2013  martin Define a new NetBSD specific note to encode the code model used for a binary.
Allow MD code to check these notes in the exec path.
 1.131  29-Oct-2013  christos Add EM_AARCH64 from Elliott Hughes
 1.130  28-Oct-2013  matt Add DF_* values for DT_FLAGS
 1.129  10-Sep-2013  matt Add a NetBSD note variant for recording the machine_arch for which the
executable was built. (currently only used by earm variants)
 1.128  21-Jun-2013  christos branches: 1.128.2;
Add the ARM processor-specific sections:
http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044e/IHI0044E_aaelf.pdf
 1.127  30-Jan-2013  matt Add DT_PREINIT_ARRAY/DT_PREINIT_ARRAYSZ and few other missing ones.
 1.126  05-Aug-2012  matt branches: 1.126.2;
back out elf note changes and use EF_ARM_ABIVERS to determine EABI usage.
 1.125  04-Aug-2012  skrll define<tab> consistency
 1.124  03-Aug-2012  matt Add a elf note to describe the ARM ABI in use. If encounters on arm,
set EXEC_ARM_AAPCS bit in exec_package's ep_flags.
XXX kind of gross but it there's isn't a MD hook for notes so ...
 1.123  22-May-2012  christos - Recognize the SuSE ABI note.
- Restructure the code to do the checking in the appropriate note type,
and harmonize all the checks to be positive.
- Print only the tag data being careful not to overrun the allocated buffer.
 1.122  04-Feb-2012  joerg Add AuxInfo record with the base address of the main thread.
 1.121  21-Jan-2012  njoly Kill duplicate SHF_MASKOS/SHF_MASKPROC defines.
 1.120  19-Jan-2012  christos Add more SHF_ and whitespace align SHT_
 1.119  19-Jan-2012  christos whitespace diffs [and comments]
 1.118  25-Nov-2011  joerg branches: 1.118.2;
Add SHT_GNU_HASH.
 1.117  03-Aug-2011  enami branches: 1.117.2;
Replace the word `NetBSD' with `SuSE' in the rest of comments
for the cpp macro constatnt ELF_NOTE_SUSE_*.
 1.116  02-Aug-2011  christos Add SuSE note
 1.115  19-Jul-2011  christos define<tab>
 1.114  19-Jul-2011  christos document all the notes we know about in a consistent fashion.
XXX: someone please document the checksum tags.
 1.113  25-Jun-2011  nonaka PR/45015: ld.elf_so: support ELF symbol versioning
Applied latest patch.
 1.112  26-May-2011  nonaka fix ELFxx_M_SIZE macro.
 1.111  26-May-2011  nonaka fix spelling.
 1.110  04-Mar-2011  joerg Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
 1.109  16-Feb-2011  christos add the rest of the gnu specific pt sections.
 1.108  24-Dec-2010  skrll branches: 1.108.2; 1.108.4;
Add support for DF_1_BIND_NOW, DF_1_NODELETE and DF_1_NOOPEN marked
objects, and the RTLD_NODELETE and RTLD_NOLOAD flags to dlopen(3).

Mark libpthread as DF_1_NOOPEN and use it to test the functionality.

Somewhat taken from FreeBSD.

Fixes PR 42029.

OK from christos and joerg.
 1.107  13-Dec-2010  joerg Add PT_GNU_EH_FRAME definition
 1.106  16-Oct-2010  skrll Implement dl_iterate_phdr.

Somewhat taken from FreeBSD. Manual page from OpenBSD.
 1.105  14-Oct-2010  skrll Define PT_TLS.
 1.104  30-Sep-2010  skrll Introduce a new type Elf_Symindx for use in decoding the symbol hash table
section and allow this type to be overridden.

The ELF specification says it should always be uint32_t (Elf_Word), but
alpha decided to be different (not sure why). Define Elf_Symindx to be
uint64_t on alpha.

Alpha no longer uses non-standard definitions of Elf64_Sword and
Elf64_Word. Remove the ability to override these types.

Fixes ld.elf_so after Herculean effort from me and martin.
 1.103  28-Aug-2010  joerg Replace the current usage of Elf64_Half with Elf64_Word and rename
NetBSD specific Elf64_Quarter to Elf64_Half. This restores compatibility
with the common ELF specifications.
 1.102  01-Mar-2010  skrll branches: 1.102.2;
Use #define<tab> consistently.
 1.101  01-Mar-2010  darran DTrace: fix a few problems introduced by the recent ZFS update (expected
problems from the OpenSolaris merge).
 1.100  20-Dec-2009  thorpej branches: 1.100.2;
Add defns for Elf{32,64}_Syminfo.
 1.99  19-Dec-2009  thorpej Add some definitions, from FreeBSD.
 1.98  24-Nov-2009  pooka fix comments: st_name is index in .strtab
 1.97  22-May-2009  martin Add a signed offset type
 1.96  12-Nov-2008  ad branches: 1.96.4;
Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.95  28-Apr-2008  martin branches: 1.95.6; 1.95.8; 1.95.10; 1.95.14;
Remove clause 3 and 4 from TNF licenses
 1.94  26-Dec-2007  christos branches: 1.94.6; 1.94.8; 1.94.10;
Add PaX ASLR (Address Space Layout Randomization) [from elad and myself]

For regular (non PIE) executables randomization is enabled for:
1. The data segment
2. The stack

For PIE executables(*) randomization is enabled for:
1. The program itself
2. All shared libraries
3. The data segment
4. The stack

(*) To generate a PIE executable:
- compile everything with -fPIC
- link with -shared-libgcc -Wl,-pie

This feature is experimental, and might change. To use selectively add
options PAX_ASLR=0
in your kernel.

Currently we are using 12 bits for the stack, program, and data segment and
16 or 24 bits for mmap, depending on __LP64__.
 1.93  07-Dec-2007  ad branches: 1.93.4;
rtld changes for PR bin/37347:

- Apply patch from J.T. Conklin to execute .init/.fini functions in order.
- Support DF_1_INITFIRST and mark libc with DF_1_INITFIRST. Shared libs
should be recording a dependency on libc, but it's too late to do that.

Ok christos@.
 1.92  03-Dec-2007  christos branches: 1.92.2;
- add an elf aux vector entry for implementing $ORIGIN.
- the code to convert from a vnode to a path is commented out now until
a better solution is implemented. Only absolute paths work for now
(which is most of the cases).

requested by core
 1.91  19-Aug-2007  matt branches: 1.91.2; 1.91.8;
Add EM_AVR32
 1.90  24-Jun-2007  christos branches: 1.90.2; 1.90.6;
Use an elf note to handle pax arguments. This is a temporary solution to
avoid wasting OS flag bits. In the future we'll probably use fileassoc to
achieve this (once there is a way to make fileassoc persistent) or in the
shorter term libelf, so that we can add and remove the note on demand instead
of burning bits on each binary. Of course since this is a tool, this means
that we'll need to think about how to handle libelf...
 1.89  22-Nov-2006  riz branches: 1.89.2; 1.89.8; 1.89.10; 1.89.12; 1.89.16;
Make sys/exec_elf.h and machine/elf_machdep.h available to host
tools, and allow paxctl to use them when compiled as a host
tool. This fixes the build on MacOS X (and perhaps other platforms)
 1.88  22-Nov-2006  elad Damn, missed in previous commit. Add PaX Segvguard flags.
 1.87  30-Aug-2006  matt branches: 1.87.2; 1.87.4;
Regen.
 1.86  16-May-2006  elad Introduce PaX MPROTECT -- mprotect(2) restrictions used to strengthen
W^X mappings.

Disabled by default.

First proposed in:

http://mail-index.netbsd.org/tech-security/2005/12/18/0000.html

More information in:

http://pax.grsecurity.net/docs/mprotect.txt

Read relevant parts of options(4) and sysctl(3) before using!

Lots of thanks to the PaX author and Matt Thomas.
 1.85  18-Dec-2005  christos branches: 1.85.4; 1.85.6; 1.85.8; 1.85.12;
there is no elf64_read_from.
 1.84  11-Dec-2005  christos merge ktrace-lwp.
 1.83  17-Aug-2005  matt Add NetBSD checksum notes.
 1.82  10-Jun-2005  matt branches: 1.82.2;
Rework the coredump code to have no explicit knownledge of how coredump
i/o is done. Instead, pass an opaque cookie which is then passed to a
new routine, coredump_write, which does the actual i/o. This allows the
method of doing i/o to change without affecting any future MD code.
Also, make netbsd32_core.c [re]use core_netbsd.c (in a similar manner that
core_elf64.c uses core_elf32.c) and eliminate that code duplication.
cpu_coredump{,32} is now called twice, first with a NULL iocookie to fill
the core structure and a second to actually write md parts of the coredump.
All i/o is nolonger random access and is suitable for shipping over a stream.
 1.81  26-Feb-2005  perry nuke trailing whitespace
 1.80  03-Feb-2005  perry de-__P
 1.79  28-Dec-2004  thorpej branches: 1.79.2; 1.79.4;
Use uint32_t casts, rather than Elf_Byte, in ELF_ST_BIND() and ELF_ST_TYPE()
so we don't get screwed by promotion rules (and makes nlist_elf32.ln build
again).
 1.78  27-Dec-2004  christos According to the ELF docs, ELF{32,64}_ST_{BIND,TYPE,INFO,VISIBILITY} are
parts of the public interface. Define them in terms of ELF_ST_*.
Add STN_UNDEF which is part of the public interface also.
 1.77  26-Dec-2004  mycroft Remove ELFn_ST_{BIND,TYPE,INFO}(), and instead add a generic ELF_ST_*() that
works with an Elf_Byte. Also add ELF_ST_VISIBILITY() and STV_* types.
 1.76  17-May-2004  mrg add EI_NIDENT (16) as seen in other <elf.h> headers.
 1.75  13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.74  10-Feb-2004  pooka fix typo in comment: magic numbers are indexed EI_MAG0 through EI_MAG3,
not ELFMAG0 through ELFMAG3 (which are the contents)
 1.73  31-Oct-2003  drochner introduce another "magic" ELF address to tell that the file has to be
mapped at the address it was linked for
 1.72  08-Aug-2003  christos - Add execsw es_setup_stack
- gc all the rest of the setup stack functions.
 1.71  06-Aug-2003  manu Make elf{32|64}_check_header public, as it will be used by irix_elf32_probe.
While we are there, cut to 80 chars, and ANSIfy prototypes
 1.70  29-Jun-2003  fvdl branches: 1.70.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.69  28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.68  20-May-2003  nathanw Add a field to netbsd_elfcore_procinfo that identifies the LWP targeted
by the killing signal.
 1.67  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.66  27-Nov-2002  wiz Fix typo in comment.
 1.65  27-Nov-2002  junyoung Program header types 0x60000000 ~ 0x6fffffff are reserved for
OS-specific semantics.
 1.64  05-Oct-2002  bjh21 Update URLs again (serves me right for committing an old change
without checking it). Back to sco.com, but with a different path.
 1.63  05-Oct-2002  bjh21 Update URLs for ELF spec (sco.com -> caldera.com).
 1.62  26-Aug-2002  christos - pass struct proc to copyargs
- rename aux vector entries AT_{R,E}{U,G}ID from AT_SYUN_{R,}P{U,G}ID
- update new aux vector size.
 1.61  14-Jun-2002  ragge Add official machine numbers for PDP10 and PDP11.
 1.60  28-Jan-2002  thorpej branches: 1.60.8;
Define ELF32_EHDR_FLAGS_OK()/ELF64_EHDR_FLAGS_OK() and use it
as an added measure to make sure that we can execute a binary.
These default to (1) if elf_machdep.h does not override them.

On Sun2, ELF32_EHDR_FLAGS_OK() checks for the presense of EF_M68000,
since the 68010 cannot run binaries for the 68020-and-up.
 1.59  09-Dec-2001  thorpej Add support for dumping ELF-cormat core files.
 1.58  31-Oct-2001  thorpej Rather than using a NetBSD-specific header file <machine/int_types.h>
and non-standard inttype-like types, pull in <sys/types.h> if
_KERNEL or _STANDALONE and <inttypes.h> otherwise, and use standard
inttype types.

Discussed with and OK'd by Christos.
 1.57  31-Oct-2001  thorpej Use <machine/elf_machdep.h> to override Elf64_Word and Elf64_Sword
on the Alpha (which uses a non-standard definitions for historical
reasons), rather than #ifdef __alpha__ (which is not cross-tool safe).
 1.56  31-Oct-2001  thorpej Include <machine/elf_machdep.h> earlier, at the beginning of the file,
after the inttypes header.
 1.55  29-Oct-2001  simonb Add EM_NS32K for the ns32k series CPUs.
 1.54  30-Jul-2001  pooka branches: 1.54.4;
make elf64_copyargs() of type int also per the recent copyargs changes
 1.53  29-Jul-2001  christos adjust to the new copyargs footprint
 1.52  14-Jul-2001  christos - add exec_read_from and make exec_elf32 use it.
- add a macho probe function
 1.51  20-Jun-2001  simonb branches: 1.51.2;
Fix up comment botch.
_Never_ fix a simple formatting thing _after_ a test compile.
 1.50  20-Jun-2001  simonb Add some more e_machine values and a reference to the SCO website with
ELF ABI information.
 1.49  20-Jun-2001  fvdl X8664 -> X86_64
 1.48  20-Jun-2001  fvdl Elf64_Word should be 32 bits; alpha is the exception rather than
the rule, so change the ifdef to reflect this.
 1.47  19-Jun-2001  fvdl Fix botched commit; I forgot to bring this up to date to -current
before committing it.
 1.46  19-Jun-2001  fvdl Add IDs for x86-64.
 1.45  25-Apr-2001  kleink ElfNN_RelA -> ElfNN_Rela, which I missed in the Great Renaming;
noticed by Juan Jose Garcia-Ripoll in PR standards/12274.
 1.44  22-Apr-2001  pooka Fix misinformation in comment
 1.43  13-Apr-2001  kleink Slight readability improvement to rev. 1.39.
 1.42  13-Apr-2001  pooka Describe possible section types with a few words.
 1.41  14-Mar-2001  christos populate OSABI list
 1.40  15-Dec-2000  mycroft branches: 1.40.2;
Tighten up the ELF signature checks, and actually look for the ABI tag added
in newer glibc versions.
 1.39  26-Jul-2000  mycroft Introduce Elf64_Xword and Elf64_Sxword, and use them in various places instead
of Elf64_Word.
Make Elf64_Word be 32 bits on sparc64. (XXXX Need to determine what it's
supposed to be on other, but it's current used to size entries in DT_HASH,
which is 32 bits on sparc64 and 64 bits on alpha.)
 1.38  27-Jun-2000  kleink Be less invasive and use private names for exact-width integer types.
 1.37  22-Feb-2000  augustss branches: 1.37.4;
Make this file possible to use again.
 1.36  22-Feb-2000  kleink * Add more OS ABI constants and dynamic array tags from D1998-04-29.
* Enhance readibility: define data structures first, followed member value
constants, and add more comments.
 1.35  22-Feb-2000  kleink Add OS ABI constants from the 1998-04-29 draft.
 1.34  22-Jan-2000  mycroft Delint.
 1.33  30-Dec-1999  eeh Make sure the elf_args strucure is appropriate for the size of the ELF binary.
 1.32  10-Nov-1999  thorpej Define ELF_ST_*() to ELF{32,64}_ST_* as appropriate. They evaluate to
the same thing, but this provides consistency with everything else.
 1.31  09-Nov-1999  kleink Fix comment typo introduced in rev. 1.27.
 1.30  01-Nov-1999  mycroft Fix obvious typos.
 1.29  27-Oct-1999  simonb Add a few comments from <mips/elf.h>.
 1.28  26-Oct-1999  kleink Add ELF64 versions of st_info manipulation macros I missed in previous.
 1.27  25-Oct-1999  kleink As discussed with Christos, rename the definitions in this file to match those
found in various SVR4 ABIs.
 1.26  23-Oct-1999  erh Move ELFNAME macros out of #ifdef _KERNEL.
 1.25  13-Sep-1999  itojun branches: 1.25.2; 1.25.4; 1.25.6;
Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.24  21-Aug-1999  matt Add the newly blessed magic number for VAX.
 1.23  23-Dec-1998  christos Add NetBSD note constants.
 1.22  03-Oct-1998  christos Add a few new machine numbers and aux vectors.
 1.21  01-Oct-1998  erh Move elf function name building macros here (ELFNAME, ELFNAME2, etc...) Add defines related to elf note sections for use in determining executable type/emulation.
 1.20  13-Sep-1998  christos Fix copyright typos...
 1.19  05-Sep-1998  christos Assign copyright to TNF.
 1.18  11-Aug-1998  kleink Oops, change previous to use the registered name found in the System V ABI,
draft edition as of April 29, 1998.
 1.17  11-Aug-1998  kleink Add machine identifier for the PA.
 1.16  10-Aug-1998  matt Add machine identifier for ARM. Add (commented out) real ident
for Alpha as well.
 1.15  29-Jul-1998  mrg add Elf_em_sparc64 at 43 (from solaris 2.7)
 1.14  12-Jul-1998  veego Remove a trailing ',' in an enum declaration.
 1.13  25-Jun-1998  eeh Addes support for sparc32plus ELF executables: v9 in v8's clothing.
 1.12  22-Jan-1998  thorpej Generate dependencies on the exec format options EXEC_AOUT, EXEC_ECOFF,
EXEC_ELF32, EXEC_ELF64, and EXEC_SCRIPT.
 1.11  10-Jun-1997  thorpej Add Section Attribute Flags (SHF_*) as defined in _System V Application
Binary Interface, Third Edition_, section 4, page 16.
 1.10  21-Mar-1997  cgd define Elf{,32,64}_Note as appropriate, add a constant for NetBSD-specific
notes' 'name' fields, and add a couple of NetBSD-specific note types.
 1.9  03-Oct-1996  cgd rename the ELF section type constants to be Elf_* rather than Elf32_*,
since they're shared between ELF32 and ELF64. (Thought i checked this in
earlier, but apparently didn't!)
 1.8  03-Oct-1996  cgd fix typo in definition of Elf32_e_ident
 1.7  30-Sep-1996  ws PowerPC port
 1.6  27-Sep-1996  cgd fix up section header type enum/values
 1.5  26-Sep-1996  cgd add and use a machine-dependent header, which currently defines some
macros to use to remove #ifdefs from the machine ID case check.
Eventually, these headers will contain other information, e.g.
machine-dependent relocation information, etc.
 1.4  26-Sep-1996  cgd add definitions for 64-bit ELF. Provided by Matt Thomas, then integrated
and cleaned up a fair bit.
 1.3  13-Jun-1996  christos - Add definitions for Elf section headers.
- Add prototype for elf_read_from.
- KNF.
 1.2  16-Jan-1996  fvdl Attempt #2 :-( (where did that tag come from..)
 1.1  22-Jun-1995  fvdl Generic ELF exec include file, like the other exec_xxx include files.
 1.25.6.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.25.4.1  15-Nov-1999  fvdl Sync with -current
 1.25.2.5  23-Apr-2001  bouyer Sync with HEAD.
 1.25.2.4  21-Apr-2001  bouyer Sync with HEAD
 1.25.2.3  27-Mar-2001  bouyer Sync with HEAD.
 1.25.2.2  05-Jan-2001  bouyer Sync with HEAD
 1.25.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.37.4.3  07-Mar-2002  he Pull up revision 1.41 (requested by jonathan):
Recognize FreeBSD ELFOSABI marked executables.
 1.37.4.2  01-May-2001  he Pull up revision 1.45 (requested by kleink):
Rename ElfNN_RelA to ElfNN_Rela, which is what SVR4 ABIs and the
rest of the world uses. Fixes PR#12274.
 1.37.4.1  26-Jul-2000  mycroft Approved by thorpej:
Introduce Elf64_Xword and Elf64_Sxword, and use them in various places instead
of Elf64_Word.
Make Elf64_Word be 32 bits on sparc64. (XXXX Need to determine what it's
supposed to be on other, but it's current used to size entries in DT_HASH,
which is 32 bits on sparc64 and 64 bits on alpha.)

syssrc/sys/sys/exec_elf.h 1.38 -> 1.39
 1.40.2.12  11-Dec-2002  thorpej Sync with HEAD.
 1.40.2.11  18-Oct-2002  nathanw Catch up to -current.
 1.40.2.10  27-Aug-2002  nathanw Catch up to -current.
 1.40.2.9  20-Jun-2002  nathanw Catch up to -current.
 1.40.2.8  28-Feb-2002  nathanw Catch up to -current.
 1.40.2.7  11-Jan-2002  nathanw Update coredump_elf64() prototype to LWP.
 1.40.2.6  09-Jan-2002  nathanw Adapt new coredump interface to LWPs.
 1.40.2.5  08-Jan-2002  nathanw Catch up to -current.
 1.40.2.4  14-Nov-2001  nathanw Catch up to -current.
 1.40.2.3  24-Aug-2001  nathanw Catch up with -current.
 1.40.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.40.2.1  09-Apr-2001  nathanw Catch up with -current.
 1.51.2.5  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.51.2.4  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.51.2.3  11-Feb-2002  jdolecek Sync w/ -current.
 1.51.2.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.51.2.1  03-Aug-2001  lukem update to -current
 1.54.4.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.60.8.2  29-Aug-2002  gehenna catch up with -current.
 1.60.8.1  20-Jun-2002  gehenna catch up with -current.
 1.70.2.10  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.70.2.9  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.70.2.8  04-Feb-2005  skrll Sync with HEAD.
 1.70.2.7  17-Jan-2005  skrll Sync with HEAD.
 1.70.2.6  18-Nov-2004  skrll Remove WIP from previous commit.
 1.70.2.5  21-Sep-2004  skrll Fix the sync with head I botched.
 1.70.2.4  18-Sep-2004  skrll Sync with HEAD.
 1.70.2.3  25-Aug-2004  skrll Sync with HEAD.
 1.70.2.2  03-Aug-2004  skrll Sync with HEAD
 1.70.2.1  02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.79.4.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.79.4.1  12-Feb-2005  yamt sync with head.
 1.79.2.1  29-Apr-2005  kent sync with -current
 1.82.2.5  21-Jan-2008  yamt sync with head
 1.82.2.4  07-Dec-2007  yamt sync with head
 1.82.2.3  03-Sep-2007  yamt sync with head.
 1.82.2.2  30-Dec-2006  yamt sync with head.
 1.82.2.1  21-Jun-2006  yamt sync with head.
 1.85.12.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.85.8.2  03-Sep-2006  yamt sync with head.
 1.85.8.1  24-May-2006  yamt sync with head.
 1.85.6.1  01-Jun-2006  kardel Sync with head.
 1.85.4.1  09-Sep-2006  rpaulo sync with head
 1.87.4.1  10-Dec-2006  yamt sync with head.
 1.87.2.1  12-Jan-2007  ad Sync with head.
 1.89.16.1  03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.89.12.1  09-Dec-2007  reinoud Pullup to HEAD
 1.89.10.1  11-Jul-2007  mjf Sync with head.
 1.89.8.2  20-Aug-2007  ad Sync with HEAD.
 1.89.8.1  15-Jul-2007  ad Sync with head.
 1.89.2.1  09-Jul-2007  liamjfoy Pull up following revision(s) (requested by christos in ticket #755):
sys/sys/pax.h: revision 1.9
sys/sys/exec_elf.h: revision 1.90
usr.sbin/paxctl/paxctl.c: revision 1.2
sys/kern/kern_pax.c: revision 1.16
sys/sys/exec.h: revision 1.117
sys/kern/exec_elf32.c: revision 1.124
libexec/ld.elf_so/sysident.h: revision 1.14
Use an elf note to handle pax arguments. This is a temporary solution to
avoid wasting OS flag bits. In the future we'll probably use fileassoc to
achieve this (once there is a way to make fileassoc persistent) or in the
shorter term libelf, so that we can add and remove the note on demand instead
of burning bits on each binary. Of course since this is a tool, this means
that we'll need to think about how to handle libelf...
 1.90.6.3  09-Dec-2007  jmcneill Sync with HEAD.
 1.90.6.2  03-Dec-2007  joerg Sync with HEAD.
 1.90.6.1  03-Sep-2007  jmcneill Sync with HEAD.
 1.90.2.1  03-Sep-2007  skrll Sync with HEAD.
 1.91.8.2  18-Feb-2008  mjf Sync with HEAD.
 1.91.8.1  08-Dec-2007  mjf Sync with HEAD.
 1.91.2.1  09-Jan-2008  matt sync with HEAD
 1.92.2.1  08-Dec-2007  ad Sync with head.
 1.93.4.1  02-Jan-2008  bouyer Sync with HEAD
 1.94.10.5  09-Oct-2010  yamt sync with head
 1.94.10.4  11-Mar-2010  yamt sync with head
 1.94.10.3  20-Jun-2009  yamt sync with head
 1.94.10.2  04-May-2009  yamt sync with head.
 1.94.10.1  16-May-2008  yamt sync with head.
 1.94.8.1  18-May-2008  yamt sync with head.
 1.94.6.2  17-Jan-2009  mjf Sync with HEAD.
 1.94.6.1  02-Jun-2008  mjf Sync with HEAD.
 1.95.14.1  02-Apr-2014  matt Support coredumps with >= 65535 psections.
 1.95.10.1  17-Mar-2012  bouyer Pull up following revision(s) via patch (requested by skrll in ticket #1724):
rescue/list.ldd: revision 1.4
lib/libc/dlfcn/dlfcn_elf.c: revision 1.7
libexec/ld.elf_so/arch/mips/mips_reloc.c: revision 1.57
distrib/sets/lists/comp/mi: revision 1.1512
share/man/man3/Makefile: revision 1.56
libexec/ld.elf_so/arch/mips/mips_reloc.c: revision 1.58
usr.bin/ldd/ldd.c: revision 1.15
libexec/ld.elf_so/rtld.h: revision 1.84
share/man/man3/dl_iterate_phdr.3: revision 1.1
libexec/ld.elf_so/rtld.c: revision 1.129
libexec/ld.elf_so/arch/powerpc/ppc_reloc.c: revision 1.44
libexec/ld.elf_so/rtld.h: revision 1.89
libexec/ld.elf_so/arch/x86_64/mdreloc.c: revision 1.36
libexec/ld.elf_so/map_object.c: revision 1.41
libexec/ld.elf_so/arch/x86_64/mdreloc.c: revision 1.37
libexec/ld.elf_so/arch/sparc64/mdreloc.c: revision 1.46
include/link_elf.h: revision 1.10
libexec/ld.elf_so/arch/i386/mdreloc.c: revision 1.29
libexec/ld.elf_so/arch/vax/mdreloc.c: revision 1.26
libexec/ld.elf_so/arch/alpha/alpha_reloc.c: revision 1.34
libexec/ld.elf_so/arch/hppa/hppa_reloc.c: revision 1.31
libexec/ld.elf_so/arch/alpha/alpha_reloc.c: revision 1.35
libexec/ld.elf_so/Makefile: revision 1.94
libexec/ld.elf_so/arch/hppa/hppa_reloc.c: revision 1.32
libexec/ld.elf_so/Makefile: revision 1.95
libexec/ld.elf_so/arch/arm/mdreloc.c: revision 1.31
libexec/ld.elf_so/Makefile: revision 1.96
libexec/ld.elf_so/arch/arm/mdreloc.c: revision 1.32
libexec/ld.elf_so/reloc.c: revision 1.98
libexec/ld.elf_so/arch/arm/mdreloc.c: revision 1.33
sys/sys/exec_elf.h: revision 1.106
libexec/ld.elf_so/rtld.c: revision 1.130
libexec/ld.elf_so/load.c: revision 1.37
libexec/ld.elf_so/rtld.c: revision 1.131
libexec/ld.elf_so/load.c: revision 1.38
libexec/ld.elf_so/rtld.h: revision 1.90
libexec/ld.elf_so/headers.c: revision 1.36
libexec/ld.elf_so/rtld.h: revision 1.95
libexec/ld.elf_so/arch/i386/mdreloc.c: revision 1.30
libexec/ld.elf_so/arch/m68k/mdreloc.c: revision 1.25
libexec/ld.elf_so/symbol.c: revision 1.50
libexec/ld.elf_so/symbol.c: revision 1.51
libexec/ld.elf_so/arch/sparc/mdreloc.c: revision 1.43
libexec/ld.elf_so/symbol.c: revision 1.52
libexec/ld.elf_so/arch/sh3/mdreloc.c: revision 1.27
libexec/ld.elf_so/symbol.c: revision 1.54
PR/39240: Satoshi Suetake: Don't fail when attempting to resolve weak symbols
when we are doing immediate binding, leave them alone and they will be dealt
with later during lazy binding. From skrll@
Implement negative cache checks for symbol lookups.
Uses the Donelist idea from FreeBSD.
Use alloca(3) instead of local xmalloc for creating our DoneLists.
This allows threaded programs to use us a little better, PR lib/43005.
Implement dl_iterate_phdr.
Somewhat taken from FreeBSD. Manual page from OpenBSD.
 1.95.8.1  19-Jan-2009  skrll Sync with HEAD.
 1.95.6.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.96.4.1  23-Jul-2009  jym Sync with HEAD.
 1.100.2.2  22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.100.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.102.2.2  31-May-2011  rmind sync with head
 1.102.2.1  05-Mar-2011  rmind sync with head
 1.108.4.2  05-Mar-2011  bouyer Sync with HEAD
 1.108.4.1  17-Feb-2011  bouyer Sync with HEAD
 1.108.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.117.2.3  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.117.2.2  23-May-2012  yamt sync with head.
 1.117.2.1  17-Apr-2012  yamt sync with head
 1.118.2.2  02-Jun-2012  mrg sync to latest -current.
 1.118.2.1  18-Feb-2012  mrg merge to -current.
 1.126.2.4  03-Dec-2017  jdolecek update from HEAD
 1.126.2.3  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.126.2.2  23-Jun-2013  tls resync from head
 1.126.2.1  25-Feb-2013  tls resync with head
 1.128.2.1  18-May-2014  rmind sync with head
 1.140.2.1  10-Aug-2014  tls Rebase.
 1.141.2.3  16-May-2017  snj Pull up following revision to fix fallout from ticket #1406:
sys/sys/exec_elf.h: revision 1.156
Add mips abiflags section
 1.141.2.2  07-Mar-2016  msaitoh Pullup the following revision (requested by htodd in ticket #1132):

sys/sys/exec_elf.h 1.143

Add definition of STT_GNU_IFUNC. This change fixes build break caused by
ticket 1126.
 1.141.2.1  08-Nov-2015  riz Pull up following revision(s) (requested by christos in ticket #1019):
sys/kern/exec_elf.c: revision 1.79
sys/sys/exec_elf.h: revision 1.150
sys/sys/exec_elf.h: revision 1.151
sys/kern/exec_elf.c: revision 1.80
Ignore the ancient 01.01 tag that gnuc used to put in old NetBSD binaries.
Add buildid Go note
 1.145.2.7  05-Oct-2016  skrll Sync with HEAD
 1.145.2.6  09-Jul-2016  skrll Sync with HEAD
 1.145.2.5  29-May-2016  skrll Sync with HEAD
 1.145.2.4  19-Mar-2016  skrll Sync with HEAD
 1.145.2.3  27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.145.2.2  22-Sep-2015  skrll Sync with HEAD
 1.145.2.1  06-Jun-2015  skrll Sync with HEAD
 1.158.2.2  25-Jun-2018  pgoyette Sync with HEAD
 1.158.2.1  16-Apr-2018  pgoyette Sync with HEAD, resolve some conflicts
 1.160.2.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.160.2.1  10-Jun-2019  christos Sync with HEAD
 1.164.2.1  29-Feb-2020  ad Sync with head.

RSS XML Feed