#
262334 |
|
22-Feb-2014 |
davidxu |
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.
|
#
262277 |
|
21-Feb-2014 |
davidxu |
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 >
|
#
225152 |
|
24-Aug-2011 |
kib |
Rtld links with the specially built pic static libc library to get some 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)
|