summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/elf.h
Commit message (Collapse)AuthorAgeFilesLines
* Convert machine/elf.h, machine/frame.h, machine/sigframe.h,kib2013-02-201-121/+3
| | | | | | | | | | | | | | machine/signal.h and machine/ucontext.h into common x86 includes, copying from amd64 and merging with i386. Kernel-only compat definitions are kept in the i386/include/sigframe.h and i386/include/signal.h, to reduce amd64 kernel namespace pollution. The amd64 compat uses its own definitions so far. The _MACHINE_ELF_WANT_32BIT definition is to allow the sys/boot/userboot/userboot/elf32_freebsd.c to use i386 ELF definitions on the amd64 compile host. The same hack could be usefully abused by other code too.
* Reserve AT_TIMEKEEP auxv entry for providing usermode the pointer tokib2012-06-221-0/+1
| | | | | | timekeeping information. MFC after: 1 week
* Add AT_STACKPROT elf aux vector. Will be used to inform rtld about thekib2011-01-071-1/+2
| | | | initial stack protection set by the kernel image activator.
* Supply some useful information to the started image using ELF aux vectors.kib2010-08-171-2/+8
| | | | | | | | In particular, provide pagesize and pagesizes array, the canary value for SSP use, number of host CPUs and osreldate. Tested by: marius (sparc64) MFC after: 1 month
* Provide groundwork for 32-bit binary compatibility on non-x86 platforms,nwhitehorn2010-03-111-0/+1
| | | | | | | | | for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32 option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts of the kernel and enhances the freebsd32 compatibility code to support big-endian platforms. Reviewed by: kib, jhb
* Define architectural load bases for PIE binaries. Addresses were selectedkib2009-10-101-0/+6
| | | | | | | | | | by looking at the bases used for non-relocatable executables by gnu ld(1), and adjusting it slightly. Discussed with: bz Reviewed by: kan Tested by: bz (i386, amd64), bsam (linux) MFC after: some time
* Add AT_EXECPATH ELF auxinfo entry type. The value's a_ptr is a pointerkib2009-03-171-4/+2
| | | | | | | | | | to the full path of the image that is being executed. Increase AT_COUNT. Remove no longer true comment about types used in Linux ELF binaries, listed types contain FreeBSD-specific entries. Reviewed by: kan
* AT_DEBUG and AT_BRK were OBE like 10 years ago, so retire them.imp2008-12-171-12/+0
| | | | Reviewed by: peter
* PR:jb2006-10-041-25/+0
| | | | | | | | | | | | | | Submitted by: Reviewed by: Approved by: Obtained from: MFC after: Security: Move the relocation definitions to the common elf header so that DTrace can use them on one architecture targeted to a different one. Add the additional ELF types defines in Sun's "Linker and Libraries" manual.
* Add style(9) foolishness.dfr2004-08-031-8/+8
|
* Add definitions for TLS relocations.dfr2004-08-021-2/+10
|
* Add sysentvec->sv_fixlimits() hook so that we can catch cases on 64 bitpeter2003-09-251-12/+0
| | | | | | | | | | | | | | | | | | | | | systems where the data/stack/etc limits are too big for a 32 bit process. Move the 5 or so identical instances of ELF_RTLD_ADDR() into imgact_elf.c. Supply an ia32_fixlimits function. Export the clip/default values to sysctl under the compat.ia32 heirarchy. Have mmap(0, ...) respect the current p->p_limits[RLIMIT_DATA].rlim_max value rather than the sysctl tweakable variable. This allows mmap to place mappings at sensible locations when limits have been reduced. Have the imgact_elf.c ld-elf.so.1 placement algorithm use the same method as mmap(0, ...) now does. Note that we cannot remove all references to the sysctl tweakable maxdsiz etc variables because /etc/login.conf specifies a datasize of 'unlimited'. And that causes exec etc to fail since it can no longer find space to mmap things.
* Add BASIC i386 binary support for the amd64 kernel. This is largelypeter2003-05-141-2/+16
| | | | | | | | | | | | | | | | | | | | | | stolen from the ia64/ia32 code (indeed there was a repocopy), but I've redone the MD parts and added and fixed a few essential syscalls. It is sufficient to run i386 binaries like /bin/ls, /usr/bin/id (dynamic) and p4. The ia64 code has not implemented signal delivery, so I had to do that. Before you say it, yes, this does need to go in a common place. But we're in a freeze at the moment and I didn't want to risk breaking ia64. I will sort this out after the freeze so that the common code is in a common place. On the AMD64 side, this required adding segment selector context switch support and some other support infrastructure. The %fs/%gs etc code is hairy because loading %gs will clobber the kernel's current MSR_GSBASE setting. The segment selectors are not used by the kernel, so they're only changed at context switch time or when changing modes. This still needs to be optimized. Approved by: re (amd64/* blanket)
* Commit MD parts of a loosely functional AMD64 port. This is based onpeter2003-05-011-22/+27
| | | | | | | | | | | | | | | | | | | | | | a heavily stripped down FreeBSD/i386 (brutally stripped down actually) to attempt to get a stable base to start from. There is a lot missing still. Worth noting: - The kernel runs at 1GB in order to cheat with the pmap code. pmap uses a variation of the PAE code in order to avoid having to worry about 4 levels of page tables yet. - It boots in 64 bit "long mode" with a tiny trampoline embedded in the i386 loader. This simplifies locore.s greatly. - There are still quite a few fragments of i386-specific code that have not been translated yet, and some that I cheated and wrote dumb C versions of (bcopy etc). - It has both int 0x80 for syscalls (but using registers for argument passing, as is native on the amd64 ABI), and the 'syscall' instruction for syscalls. int 0x80 preserves all registers, 'syscall' does not. - I have tried to minimize looking at the NetBSD code, except in a couple of places (eg: to find which register they use to replace the trashed %rcx register in the syscall instruction). As a result, there is not a lot of similarity. I did look at NetBSD a few times while debugging to get some ideas about what I might have done wrong in my first attempt.
* Move the definition of ElfN_Hashelt to common headers. The only platformdfr2002-05-301-11/+0
| | | | which has a different definition for this is alpha.
* Make MAXTSIZ, DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ, SGROWSIZ loaderps2001-10-101-1/+1
| | | | | | | tunable. Reviewed by: peter MFC after: 2 weeks
* Use a machine dependent type, Elf_Hashelt, for the elements of the elfjake2001-07-311-0/+11
| | | | | | | | dynamic symbol table buckets and chains. The sparc64 toolchain uses 32 bit .hash entries, unlike other 64 bits architectures (alpha), which use 64 bit entries. Discussed with: dfr, jdp
* Fix style of defines.obrien2001-06-091-38/+38
|
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-291-2/+2
| | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* On the i386, load the ELF dynamic linker where an mmap(0, ...) wouldjdp1999-02-191-5/+7
| | | | | | | | | put it, just like on the Alpha. It was wrong to load it at the fixed address 0x08000000. That should only be done if the dynamic linker is an executable (not a shared object) with a specific load address encoded in the object file itself. This fixes the recent breakage in the Linux emulator.
* Change the load address of the ELF dynamic linker from "2L*MAXDSIZ"jdp1999-02-071-1/+11
| | | | | | | | | | | | | | | | | | | | | | | to an architecture-specific value defined in <machine/elf.h>. This solves problems on large-memory systems that have a high value for MAXDSIZ. The load address is controlled by a new macro ELF_RTLD_ADDR(vmspace). On the i386 it is hard-wired to 0x08000000, which is the standard SVR4 location for the dynamic linker. On the Alpha, the dynamic linker is loaded MAXDSIZ bytes beyond the start of the program's data segment. This is the same place a userland mmap(0, ...) call would put it, so it ends up just below all the shared libraries. The rationale behind the calculation is that it allows room for the data segment to grow to its maximum possible size. These changes have been tested on the i386 for several months without problems. They have been tested on the Alpha as well, though not for nearly as long. I would like to merge the changes into 3.1 within a week if no problems have surfaced as a result of them.
* Add an ELF_MACHINE_OK() macro for compatability with the Alpha version.peter1998-10-181-1/+3
|
* Add generic defines ELF_ARCH, ELF_CLASS, and ELF_DATA. These givejdp1998-09-141-1/+3
| | | | | | | | the relevant characteristics of the native machine, for building and checking Elf_Ehdr structures. Add structures to represent ELF "note" headers. Add defines for the note types used in ELF core files.
* Revamp the ELF include files to better support architecture-independentjdp1998-08-161-1/+6
| | | | | | | | | | | | | | | | | | | | | applications. Here's how it works. The kernel should include <machine/elf.h> to get the definitions for the native architecture. It can reference the various ELF structures with generic names like Elf_Sym, Elf_Shdr, etc. A define __ELF_WORD_SIZE is also available with the value 32 or 64 as appropriate for the native architecture. Generic applications should include <elf.h>, which is just a wrapper for <machine/elf.h>. Applications such as object file dumpers that need to deal with foreign ELF files can include <sys/elf32.h> and/or <sys/elf64.h>. Both can be included from the same source file if desired. The structure names must be referenced using wordsize-specific names like Elf32_Sym, Elf64_Shdr, etc. I haven't change the alpha stuff, but I haven't broken it either.
* Define some machine characteristics using symbol naming on conventionspeter1997-08-301-1/+7
| | | | in place in the other BSD's.
* Fill out the ELF header files to make them more or less complete.jdp1997-05-211-0/+106
Fix a macro name that was misspelled both in brandelf.c and imgact_elf.h.
OpenPOWER on IntegriCloud