[PATCH 00/46] Support for cut-down Linux syscalls

Mike Frysinger vapier at gentoo.org
Sun Nov 25 05:31:42 UTC 2012


On Wed, Nov 21, 2012 at 10:51 AM, Markos Chandras wrote:
> On Sat, Nov 17, 2012 at 8:23 PM, Mike Frysinger wrote:
>> On Tuesday 13 November 2012 06:31:09 Markos Chandras wrote:
>>> The following patches prefer the old system call if both syscalls are
>>> present. For example, if __NR_open and __NR_openat are defined, then
>>> open() will use the __NR_open syscall. If the __NR_open syscall is not
>>> defined, then open() will use __NR_openat internally. This way we "protect"
>>> existing architectures and preserve old behavior.
>>
>> a semi-quick scan shows that you're missing hidden symbol aliases
>>
>> for example, in your chmod change, you call fchmodat (which is fine), but
>> there's no addition of libc_hidden_{proto,def} for fchmodat.
>>
>> to check for this, you can run `readelf -r` on the libc.so file and look at all
>> the function relocs.  the only ones in that list you should see are malloc
>> related (malloc/free/calloc/etc...).  if you see other symbols, they're most
>> likely missing the libc_hidden stuff.
>
> If I understand correctly, these macros don't need to be between
> #ifndef chmod/#endif clauses right? I mean, calls to fchmodat within
> libc should always bypass the plt so adding libc_hidden_{proto,def}
> unconditionally seems to correct approach. I am a bit confused on why
> these macros are not already used for these functions but I guess
> because until now they were not called within libc.

yes, have the proto in the header file be in the same condition as
fchmodat itself (the line right after the prototype), and have the def
live in the fchmodat file itself
-mike


More information about the uClibc mailing list