into HOST_CPPFLAGS, and remove the hacky list of files to build
with it. this matches what the real GCC build does, and fixes build
problems seen on OSX.
- provide an exec_prot_support() routine so $ARCH can indicate whether
it supports execution protection or not, and skip test accordingly.
- have a trivial 'return_one' shellcode to copy anywhere in a page, and
call it. The decision to keep the assembly solution is mine, reasons are
twofold:
- all pure-C implementations cannot be controlled easily:
bounds detection (beginning/end) of return_one is unpredictable,
or requires the use of overkill solutions like libelf. Using
dlsym(3) was a good proposal, however I can't use it to know the
end address of the payload. It makes copying of the shellcode a bit
more difficult: using a constant may be too small (code has not been
entirely copied, and can lead to errors that can be erroneously
detected as "test passed"), or too big (depending on where it is mapped
in memory, copying past the end of the function may trigger SIGSEGV).
- I have to ensure that the resulting assembly is the most compact
possible, especially as it will be reused to test other parts of
memory (stack, data, rodata, etc.).
Only i386 and amd64 are implemented so far. Others will come in due time.
FWIW, writing the exec_prot_support() callback and the return_one payload
should be enough. Writing callback requires good knowledge of the platform,
depending on chip revision, CPU, board, MMU... the protection level may vary.
Current files are put under lib/libc/arch/* and lib/libc/common/. Feel free to
move them around the tests/ tree. Keep in mind that the common/ and arch/ code
will be used outside of libc, so please do not hide them too deep in the tree.
I checked a few architectures via build.sh cross-compile, and will keep an
eye on buildbot for potential build breakage. Feel free to contact me in
case you see any, of course.
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
This should fix cross-build problems, but I can't really test
that now, so I am not re-enabling the inclusion of v7fs support
in makefs.
- make everything static
- knf
- consistently check for == -1 for syscall errors
- isatty(fd) == tcgetattr(fd), don't do it twice
- make error messages more consistent
- use sig_atomic_t for variable set inside signal handler
for exception handling rather than register_frame_info -- this is
what other OSes are doing, and what is supposedly more efficient.
committed generated files for i386 only