After commit
f9c8b11ed7726b858cd7b7cea0d3d7c5233d78cf
"nss: Access nss_files through direct references",
when building with -Os, multiple conform/.../linknamespace tests
and elf/check-localplt are failing:
Extra PLT reference: libc.so: fgetc_unlocked
Extra PLT reference: libc.so: getline
Or e.g.:
[initial] glob -> [libc.a(glob.o)] __getpwnam_r -> [libc.a(getpwnam_r.o)] __nss_database_custom -> [libc.a(nsswitch.o)] __nss_module_get_function -> [libc.a(nss_module.o)] __nss_files_functions -> [libc.a(nss_files_functions.o)] _nss_files_endaliasent -> [libc.a(files-alias.o)] feof_unlocked
[initial] glob -> [libc.a(glob.o)] __getpwnam_r -> [libc.a(getpwnam_r.o)] __nss_database_custom -> [libc.a(nsswitch.o)] __nss_module_get_function -> [libc.a(nss_module.o)] __nss_files_functions -> [libc.a(nss_files_functions.o)] _nss_files_endaliasent -> [libc.a(files-alias.o)] fgetc_unlocked
[initial] glob -> [libc.a(glob.o)] __getpwnam_r -> [libc.a(getpwnam_r.o)] __nss_database_custom -> [libc.a(nsswitch.o)] __nss_module_get_function -> [libc.a(nss_module.o)] __nss_files_functions -> [libc.a(nss_files_functions.o)] _nss_files_endnetgrent -> [libc.a(files-netgrp.o)] getline
This patch is using the hidden symbols where possible.
Instead of fputc_unlocked, __putc_unlocked is used.
(Compare to commit
eeaa19f75e52d2d48074ae0c423f2311d67c42c6
"mntent: Use __putc_unlocked instead of fputc_unlocked")
if (listfile != NULL
&& (old_line = __strdup (line)) != NULL)
{
- while (! feof_unlocked (listfile))
+ while (! __feof_unlocked (listfile))
{
if (room_left < 2)
{
just read character. */
int ch;
- ch = fgetc_unlocked (stream);
+ ch = __getc_unlocked (stream);
if (ch == EOF || ch == '\n' || !isspace (ch))
{
size_t cnt;
{
fpos_t pos;
fgetpos (stream, &pos);
- ssize_t n = getline (&line, &linelen, stream);
+ ssize_t n = __getline (&line, &linelen, stream);
if (n < 0)
{
- if (! feof_unlocked (stream))
+ if (! __feof_unlocked (stream))
status = ((*errnop = errno) == ENOMEM
? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL);
break;
status = NSS_STATUS_NOTFOUND;
result->cursor = result->data;
- while (!feof_unlocked (fp))
+ while (!__feof_unlocked (fp))
{
- ssize_t curlen = getline (&line, &line_len, fp);
+ ssize_t curlen = __getline (&line, &line_len, fp);
int found;
if (curlen < 0)
result->cursor -= 2;
/* Get next line. */
- curlen = getline (&line, &line_len, fp);
+ curlen = __getline (&line, &line_len, fp);
if (curlen <= 0)
break;
buf[len - 1] = '\xff'; /* Marker to recognize truncation. */
if (__fgets_unlocked (buf, len, fp) == NULL)
{
- if (feof_unlocked (fp))
+ if (__feof_unlocked (fp))
{
__set_errno (ENOENT);
return ENOENT;