summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf/xmalloc.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r262277:davidxu2014-02-271-7/+5
| | | | | | | | | | | | | | | | | | malloc_aligned() may not leave enough space for pointer to allocated memory, saving the pointer will overwrite bytes belongs to another memory block unexpectly, to fix the problem, use (allocated address + sizeof(void *)) as initial value, and slip to next aligned address, so maximum extra bytes is sizeof(void *) + align - 1. Tested by: Andre Albsmeier < mail at ma17 dot ata dot myota dot orgndre > MFC r262334: Increase alignment to size of pointer if the alignment is too small. Some modules do not align data at least to size of pointer, they uses a smaller alignment, but our pointer should be aligned to its native boundary, otherwise on some platforms, hardware alignment checking will cause bus error.
* MFC r259043:kib2013-12-131-0/+30
| | | | | Build an allocator for the aligned memory on top of the rtld-private malloc.
* Implement xstrdup() using strlen()/xmalloc()/memcpy() alreadykib2012-03-231-7/+8
| | | | | | | presented in rtld, instead of pulling in libc strdup(). Submitted by: bde MFC after: 2 weeks
* Use xmalloc() instead of malloc() in the places where malloc() callskib2012-03-221-6/+9
| | | | | | | | | | | | | | | are assumed to not fail. Make the xcalloc() calling conventions follow the calloc(3) calling conventions and replace unchecked calls to calloc() with calls to xcalloc(). Remove redundand declarations from xmalloc.c, which are already present in rtld.h. Reviewed by: kan Discussed with: bde MFC after: 2 weeks
* Rtld links with the specially built pic static libc library to get somekib2011-08-241-5/+11
| | | | | | | | | | | | | | | | | C runtime services, like printf(). Unfortunately, the multithread-safeness measures in the libc do not work in rtld environment. Rip the kernel printf() implementation and use it in the rtld instead of libc version. This printf does not require any shared global data and thus is mt-safe. Systematically use rtld_printf() and related functions, remove the calls to err(3). Note that stdio is still pulled from libc due to libmap implementaion using fopen(). This is safe but unoptimal, and can be changed later. Reported and tested by: pgj Diagnosed and reviewed by: kan (previous version) Approved by: re (bz)
* Add function prototypes.mdodd2003-06-191-0/+2
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Import the ELF dynamic linker. This is the ElfKit version withjdp1998-03-071-0/+57
quite a few enhancements and bug fixes. There are still some known deficiencies, but it should be adequate to get us started with ELF. Submitted by: John Polstra <jdp@polstra.com>
OpenPOWER on IntegriCloud