Archive (library) with syscalls?

Freddie Chopin
Fri Sep 25 14:04:00 GMT 2015

On Friday 25 of September 2015 00:34:10 Mike Frysinger wrote:
> what you describe is expected linker behavior -- when you have an archive
> of objects, then things get pulled out only when explicitly requested.
> you should post to the binutils mailing list to ask for suggestions as
> this is not specific to newlib.

OK, I've posted my request to binutils mailing list, but I still think that in 
here someone might know how to solve it. I'm wondering whether the thing I 
want to do is at all possible? Maybe I should either recompile the toolchain 
with REENTRANT_SYSCALLS_PROVIDED defined for newlib (so there would be no 
syscalls in the toolchain) or maybe the proper way in my situation is to 
redefine _sbrk(), _write(), etc. instead of _sbrk_r(), _write_r() and other 
reentrant syscalls? The second option seems easier, because I wouldn't have to 
recompile the toolchain, but in some of the syscalls access to reent structure 
would be needed, so going from toolchain's _xxx_r() to my _xxx() syscall just 
to read the _REENT again seems like a waste of time and code... On the other 
hand only a few syscalls may need any data from this structure...

Thanks in advance!


More information about the Newlib mailing list