- 06 12月, 2012 2 次提交
- 26 11月, 2012 2 次提交
-
-
由 Rich Felker 提交于
-
由 Rich Felker 提交于
these structures are purely for use by trace/debug tools and tools working with core files. the definition of fpregset_t, which was previously here, has been removed because it was wrong; fpregset_t should be the type used in mcontext_t, not the type used in ptrace/core stuff.
-
- 24 11月, 2012 4 次提交
-
-
由 Rich Felker 提交于
aside from microblaze, these should be roughly correct for all archs now. some misc junk macros and typedefs are missing, which should probably be added for max compatibility with trace/debug tools.
-
由 Rich Felker 提交于
-
由 Rich Felker 提交于
with these changes, the members/types of mcontext_t and related stuff should closely match the glibc definitions. unlike glibc, however, the definitions here avoid using typedefs as much as possible and work directly with the underlying types, to minimize namespace pollution from signal.h in the default (_BSD_SOURCE) profile. this is a first step in improving compatibility with applications which poke at context/register information -- mainly debuggers, trace utilities, etc. additional definitions in ucontext.h and other headers may be needed later. if feature test macros are used to request a conforming namespace, mcontext_t is replaced with an opaque structure of the equivalent size and alignment; conforming programs cannot examine its contents anyway.
-
由 Rich Felker 提交于
-
- 22 11月, 2012 1 次提交
-
-
由 Rich Felker 提交于
unlike the previous definition, NSIG/_NSIG is supposed to be one more than the highest signal number. adding this will allow simplifying libc-internal code that makes signal-related syscalls, which can be done as a later step. some apps might use it too; while this usage is questionable, it's at least not insane.
-
- 19 11月, 2012 1 次提交
-
-
由 Rich Felker 提交于
apparently some other archs have sys/io.h and should not break just because they don't have the x86 port io functions. provide a blank bits/io.h everywhere for now.
-
- 18 11月, 2012 1 次提交
-
-
由 rofl0r 提交于
put some macros that do not differ between architectures in the main header and remove from bits. restructure mips header so it has the same structure as the others.
-
- 16 11月, 2012 1 次提交
-
-
由 Rich Felker 提交于
although a number is reserved for it, this option is not implemented on Linux and does not work. defining it causes some applications to use it, and subsequently break due to its failure.
-
- 06 11月, 2012 1 次提交
-
-
由 Rich Felker 提交于
-
- 19 10月, 2012 2 次提交
-
-
由 Rich Felker 提交于
these macros are supported by more compilers
-
由 Rich Felker 提交于
-
- 16 10月, 2012 1 次提交
-
-
由 Rich Felker 提交于
despite documentation that makes it sound a lot different, the only ABI-constraint difference between TLS variants II and I seems to be that variant II stores the initial TLS segment immediately below the thread pointer (i.e. the thread pointer points to the end of it) and variant I stores the initial TLS segment above the thread pointer, requiring the thread descriptor to be stored below. the actual value stored in the thread pointer register also tends to have per-arch random offsets applied to it for silly micro-optimization purposes. with these changes applied, TLS should be basically working on all supported archs except microblaze. I'm still working on getting the necessary information and a working toolchain that can build TLS binaries for microblaze, but in theory, static-linked programs with TLS and dynamic-linked programs where only the main executable uses TLS should already work on microblaze. alignment constraints have not yet been heavily tested, so it's possible that this code does not always align TLS segments correctly on archs that need TLS variant I.
-
- 05 10月, 2012 1 次提交
-
-
由 Rich Felker 提交于
currently, only i386 is tested. x86_64 and arm should probably work. the necessary relocation types for mips and microblaze have not been added because I don't understand how they're supposed to work, and I'm not even sure if it's defined yet on microblaze. I may be able to reverse engineer the requirements out of gcc/binutils output.
-
- 22 9月, 2012 1 次提交
-
-
由 Rich Felker 提交于
not tested on mips and arm; they may still be broken. x86_64 should be ok now.
-
- 16 9月, 2012 1 次提交
-
-
由 Rich Felker 提交于
the linux O_PATH mode provides the necessary semantics for both the O_SEARCH and O_EXEC modes defined and required by POSIX 2008.
-
- 15 9月, 2012 1 次提交
-
-
由 Rich Felker 提交于
if same register is used for input/output, the compiler must be told. otherwise is generates random junk code that clobbers the result. in pure syscall-wrapper functions, nothing went wrong, but in more complex functions where register allocation is non-trivial, things broke badly.
-
- 14 9月, 2012 1 次提交
-
-
由 Rich Felker 提交于
I'm not 100% sure that Linux's O_PATH meets the POSIX requirements for O_SEARCH, but it seems very close if not perfect. and old kernels ignore it, so O_SEARCH will still work as desired as long as the caller has read permissions to the directory.
-
- 11 9月, 2012 2 次提交
-
-
由 Rich Felker 提交于
by using the "ir" constraint (immediate or register) and the carefully constructed instruction addu $2,$0,%2 which can take either an immediate or a register for %2, the new inline asm admits maximal optimization with no register spillage to the stack when the compiler successfully performs constant propagration, but still works by allocating a register when the syscall number cannot be recognized as a constant. in the case of syscalls with 0-3 arguments it barely matters, but for 4-argument syscalls, using an immediate for the syscall number avoids creating a stack frame for the syscall wrapper function.
-
由 Rich Felker 提交于
all past and current kernel versions have done so, but there seems to be no reason it's necessary and the sentiment from everyone I've asked has been that we should not rely on it. instead, use r7 (an argument register) which will necessarily be preserved upon syscall restart. however this only works for 0-3 argument syscalls, and we have to resort to the function call for 4-argument syscalls.
-
- 09 9月, 2012 2 次提交
-
-
由 Rich Felker 提交于
this drastically reduces the size of some functions which are purely syscall wrappers. disabled for clang due to known bugs satisfying register constraints.
-
由 Rich Felker 提交于
now public syscall.h only exposes __NR_* and SYS_* constants and the variadic syscall function. no macros or inline functions, no __syscall_ret or other internal details, no 16-/32-bit legacy syscall renaming, etc. this logic has all been moved to src/internal/syscall.h with the arch-specific parts in arch/$(ARCH)/syscall_arch.h, and the amount of arch-specific stuff has been reduced to a minimum. changes still need to be reviewed/double-checked. minimal testing on i386 and mips has already been performed.
-
- 08 9月, 2012 1 次提交
-
-
由 Rich Felker 提交于
clang does not presently support the "v" constraint we want to use to get the result from $3, and trying to use register...__asm__("$3") to do the same invokes serious compiler bugs. so for now, i'm working around the issue with an extra temp register and putting $3 in the clobber list instead of using it as output. when the bugs in clang are fixed, this issue should be revisited to generate smaller/faster code like what gcc gets.
-
- 03 9月, 2012 1 次提交
-
-
由 Rich Felker 提交于
while musl itself requires a c99 compiler, some applications insist on being compiled with c89 compilers, and use of "inline" in the headers was breaking them. much of this had been avoided already by just skipping the inline keyword in pre-c99 compilers or modes, but this new unified solution is cleaner and may/should result in better code generation in the default gcc configuration.
-
- 12 8月, 2012 1 次提交
-
-
由 Rich Felker 提交于
linux guarantees ll/sc are always available. on mips1, they will be emulated by the kernel. thus they are part of the linux mips1 abi and safe to use.
-
- 11 8月, 2012 1 次提交
-
-
由 Rich Felker 提交于
-
- 10 8月, 2012 1 次提交
-
-
由 Rich Felker 提交于
yet another gratuitous mips incompatibility...
-
- 08 8月, 2012 2 次提交
-
-
由 Rich Felker 提交于
untested; hopefully it's right now
-
由 Rich Felker 提交于
-
- 06 8月, 2012 3 次提交
-
-
由 Rich Felker 提交于
why does mips have to be gratuitously incompatible in every possible imaginable way?
-
由 Rich Felker 提交于
-
由 Rich Felker 提交于
not heavily tested, but the basics are working. the basic concept is that the dynamic linker entry point code invokes a pure-PIC (no global accesses) C function in reloc.h to perform the early GOT relocations needed to make the dynamic linker itself functional, then invokes __dynlink like on other archs. since mips uses some ugly arch-specific hacks to optimize relocating the GOT (rather than just using the normal DT_REL[A] tables like on other archs), the dynamic linker has been modified slightly to support calling arch-specific relocation code in reloc.h. most of the actual mips-specific behavior was developed by reading the output of readelf on libc.so and simple executable files. i could not find good reference information on which relocation types need to be supported or their semantics, so it's possible that some legitimate usage cases will not work yet.
-
- 23 7月, 2012 1 次提交
-
-
由 Rich Felker 提交于
also fix the alignment of jmp_buf to meet the abi. linux always emulates fpu on mips if it's not present, so enabling this code unconditionally is "safe" but may be slow. in the long term it may be preferable to find a way to disable it on soft float builds.
-
- 13 7月, 2012 4 次提交
-
-
由 Rich Felker 提交于
sc was overwriting the result
-
由 Rich Felker 提交于
the fields in the mcontext_t are long long (for no good reason) even on 32-bit mips, so the offset of the instruction pointer (as a word) varies depending on endianness.
-
由 Rich Felker 提交于
the kernel wrongly expects the cmsg length field to be size_t instead of socklen_t. in order to work around the issue, we have to impose a length limit and copy to a local buffer. the length limit should be more than sufficient for any real-world use; these headers are only used for passing file descriptors and permissions between processes over unix sockets.
-
由 Rich Felker 提交于
this fix is easier than trying to reorder the header stuff
-