Matt | 21 Jul 20:40 2016

Gcc 5.4 Compilation failure with -fPIC: undefined reference to `getrpcbynumber'


I've been trying various branches (master branch, 2.23 tag) and
various configurations in order to compile libc on ubuntu 16.04 with
gcc-5.real (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609 with -fPIC
(I want to create a shared library statically linking some glibc

I came up with this command:
$ CFLAGS=" -fPIC  -O2 -fno-stack-protector -U_FORTIFY_SOURCE "
LD_LIBRARY_PATH="" ../configure --prefix=/home/teto/libcinstall
--disable-shared --enable-static-nss --enable-obsolete-rpc

but I keep ending up with:
make[2]: Entering directory '/home/teto/glibc/nss'
gcc -nostdlib -nostartfiles -static -o /home/teto/glibc/d/nss/getent
 /home/teto/glibc/d/csu/crt1.o /home/teto/glibc/d/csu/crti.o `gcc
--print-file-name=crtbeginT.o` /home/teto/glibc/d/nss/getent.o
-Wl,--start-group /home/teto/glibc/d/libc.a -lgcc -lgcc_eh
-Wl,--end-group `gcc  --print-file-name=crtend.o`
/home/teto/glibc/d/nss/getent.o: In function `rpc_keys':
getent.c:(.text+0xc37): undefined reference to `getrpcbynumber'
getent.c:(.text+0xc64): undefined reference to `getrpcbyname'
getent.c:(.text+0xc93): undefined reference to `setrpcent'
getent.c:(.text+0xca9): undefined reference to `getrpcent'
getent.c:(.text+0xcb3): undefined reference to `endrpcent'
collect2: error: ld returned 1 exit status
(Continue reading)

Rafał Długołęcki | 15 Jul 10:51 2016

What is the correct way of creating custom gconv module?

Manual (
describes implementation of 3 functions. As I understand I will need
to write them by hand.

I also found that there are iconv/loop.c and iconv/skeleton.c which
could be used relatively easy for custom module. But in commit:
5fe8e359 added on 2015-01-27 09:37:04 +0100, there was in loop.c
> #include <libc-internal.h>

This raised my doubts if these files should be used only internally by
glibc developers.
My question is: could I use loop.c and skeleton.c or should this be avoided?

Best wishes,
Rafał Długołęcki

Florian Weimer | 28 Jun 16:12 2016

How to detect symbol interposition?

I need a way to detect symbol interposition from within libc.

It seems that this is not directly distinguishable from interposition 
based on addresses alone:

#include <stdio.h>
#include <stdlib.h>

main (void)
   printf ("main malloc: %p\n", malloc);

If I have a hidden alias of malloc within libc (say, __libc_malloc), so 
that I can get the original address, it will be not equal to malloc 
because malloc in the entire process will point to the PLT stub.  The 
PLT stub will call malloc, of course, but you cannot tell this from its 

Any suggestions?


Joël Krähemann | 24 Jun 23:22 2016

free thread related memory created by pthread_create()

Hi all

The very last entry of following shows the issue with pthread_create():

The threads are detached and leaks I believe this could be the cause
of performance problems with GSequencer.


Huang Pei | 17 Jun 11:05 2016

One more question for BZ 19550

Hi,I have one more question for bug fix 19550 on N32's mmap64.

After bug fix 19550, N32' mmap64 can handle  2GB<= offset < 4GB,but it

can not handle 4GB <= offset < 2^44 - 1( offset is off64_t, the last arg 
of mmap64)

which is not identical to o32's mmap64. Since mips n32 does not have 

syscall, if a O32 mmap64 application is transplanted into  N32, do we 
need to handle

this in N32's mmap64?

Carlo Kok | 12 Jun 00:12 2016

sigsegv dereferencing l_addr in link_map

On some (ubuntu 14.04.4, libc 2.19-0ubuntu6.9) systems I'm getting a 
sigsegv when casting the link_map's l_addr to Elf64_Ehdr. This is 
something libgc does and works fine on most linux systems, but not all.

What am I missing here, and if this isn't guaranteed to work, how else 
can I get all the loaded data segments.

Code like this shows it:

#include <link.h>
#include <stdio.h>

# pragma weak _DYNAMIC
extern Elf64_Dyn _DYNAMIC[];

int main() {
   int tag;
   Elf64_Dyn* dp;
   struct link_map* cachedResult;
   for( dp = _DYNAMIC; (tag = dp->d_tag) != 0; dp++ ) {
     if( tag == DT_DEBUG ) {
        struct link_map *lm = ((struct r_debug 
        if( lm != 0 ) cachedResult = lm->l_next; /* might be NULL */
   printf("%p cached result; %p dyn \n", cachedResult, dp->d_un.d_ptr);
   while(cachedResult) {
     printf("%p %p %s\n", cachedResult->l_addr, cachedResult->l_ld, 
(Continue reading)

YuGiOhJCJ Mailing-List | 9 Jun 04:38 2016

Why stdarg.h is part of GCC instead of libc?


I was checking from what package the headers I am using for a program are provided:
* ctype.h: It is part of libc [1]
* errno.h: It is part of libc
* getopt.h: It is part of libc
* limits.h: It is part of libc
* ...

Then I was amazed to discover that:
* stdarg.h: It is part of gcc [2]

I don't understand why.
Maybe it is an historical reason or something like that.
I don't see any reason to make the stdarg.h header part of GCC instead of libc.
AFAIK, all these headers are standards C headers.
In other words, they should not be specific to the compiler.

Someone can explain me why stdarg.h is part of GCC instead of libc?
Is it documented somewhere that stdarg.h is not part of libc?
Are there other standard C headers like this one that are not part of libc?

Thank you.
Best regards.



parse_dup_op duplicates the tree exponentially when using repeated +

Hi guys,

I reported this bug:

I'm wondering if I reported it to the proper place. It's a variant of a bug
raised/reported by Jim Meyering
( In that case, the
issue was a memory problem (the repeated repetition operators consumed memory
exponentially, leading to memory allocation failures and null pointer

Which I think was also assigned a CVE number:

This case is a cpu usage problem. Given enough repetition operators, the
program will consume exponential amounts of cpu time (since for every repetiton
operator, it duplicates the data structure that holds the regex, or part of

I'm not even sure why regcomp in libc allows for repeated use of +'s or {n,m}
like that. The regcomp implementation in FreeBSD has a similar issue (check the
BUGS section here:
), but at least it treats the .++ case for ERE correctly (as an invalid


Eduardo Bustamante

(Continue reading)

Michael Williamson | 1 Jun 19:50 2016

sscanf ~1000 slower that strtol


I have a question. I was comparing the speed of reading some ASCII
integers by different methods, and I found that using sscanf (with the
characters consumed operand (%n)) is ~1000
slower than the fastest method, strtol. Why is it so slow?

I am using version ldd (Ubuntu EGLIBC 2.15-0ubuntu10.12) 2.15.

Attachment (rs.cpp): text/x-c++src, 5126 bytes
Sreyan Chakravarty | 28 May 19:39 2016

Make Error - gnu_indirect_function not recognized

I am trying to build GLIBC on a Linux 2.6.25 machine. My configure has
completed without any errors but my make fails with the message-:

../sysdeps/x86_64/multiarch/strcspn.S:47: Error: unrecognized symbol
type "gnu_indirect_function"
make[2]: *** [/home/Sreyan/Desktop/glibc-2.14/build/string/strcspn.o] Error 1
make[2]: Leaving directory `/home/Sreyan/Desktop/glibc-2.14/string'
make[1]: *** [string/subdir_lib] Error 2
(more detail in attached file)

Any idea on how to solve this ? I am using gcc 4.3.0 for the build.
What can I do to solve this ?

The config.log (attached) states that gnu_indirect_function is not
supported. Shouldn't the configure script failed if that was not
available ?

Sreyan Chakravarty
../sysdeps/x86_64/multiarch/strchr.S: Assembler messages:
../sysdeps/x86_64/multiarch/strchr.S:28: Error: unrecognized symbol type "gnu_indirect_function"
make[2]: *** [/home/Sreyan/Desktop/glibc-2.14/build/string/strchr.o] Error 1
make[2]: *** Waiting for unfinished jobs....
../sysdeps/x86_64/multiarch/strcpy.S: Assembler messages:
../sysdeps/x86_64/multiarch/strcpy.S:61: Error: unrecognized symbol type "gnu_indirect_function"
make[2]: *** [/home/Sreyan/Desktop/glibc-2.14/build/string/strcpy.o] Error 1
../sysdeps/x86_64/multiarch/strcmp.S: Assembler messages:
../sysdeps/x86_64/multiarch/strcmp.S:88: Error: unrecognized symbol type "gnu_indirect_function"
(Continue reading)

Preston Moore | 24 May 20:47 2016

Where is free() implemented?

Hey everyone,

Hopefully this is a quick question with a quick answer. Where is free() implemented? I’ve just found a
bunch of extern references in the glibc source I have. This is Ubuntu 14.04 LTS 32 bit.

Preston Moore