Michael Eager | 29 Nov 15:20 2015

Building for older systems

I'm trying to build packages (gcc, etc.) on a newer
version of Linux which can run on an older Linux system
with an older glibc.  I've run into the memcpy versioning

Changes to memcpy in glibc-2.14 broke some programs which
used it incorrectly, so the modified memcpy was versioned
memcpy <at> GLIBC_2.14, which prevented old copies of these
buggy program from getting the new memcpy().  All well and

This also means new programs compiled on a current glibc
require memcpy <at> GLIBC_2.14, even if they would work without
problem with the memcpy() from the older glibc.

I've been trying every way I can think of to build packages
with a current glibc which will run on an pre-2.14 glibc.
This includes adding a static memcpy.o to the executable.
This doesn't work, because the executable inherits the
requirements for memcpy <at> GLIBC_2.14 from libc.so.

Adding .symver statements is impractical, but also would
not work for the same reason.

Any solutions to building for an older glibc?


Michael Eager	 eager@...
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

(Continue reading)

Meho | 27 Nov 21:05 2015

theoretically question: is dlopen() loading a update lib or send back the old handler?

Hello mailing-list,

i have a theoretically question to the function dlopen()!
The manual describes that a loaded library is not loaded again in the
main memory, if dlopen() is called again. A Handler take a reference
back to the loaded library.

But what do the function if the library is updated while using? An example:

Program A is started and loaded the library libfoo.so in main memory.
Now I update the system and the
libfoo.so (only new release). Program B is starting and call dlopen().
What will happen?
Noticed dlopen() the new file and load the new release of the library in
the memory or get it the handler
of the loaded library back?

I loaded the glibc-2.12-1.166.el6.src.rpm from the oracle mirrow and
tried to study the c-code.
But my c-skills are not well enoth.

Thank you very much for a answer!

Best regard Meho

Ian Pilcher | 26 Nov 23:21 2015

Using asprintf without memory leaks

asprintf(3) says:

   When successful, these functions return the number of bytes printed,
   just like sprintf(3).  If memory allocation wasn't possible, or some
   other error occurs, these functions will return -1, and the contents
   of strp is undefined.

If -1 is returned, can I at least assume that any memory that was
allocated has been freed?  If not, it's hard to see how asprintf can
be used without risking memory leaks.


Ian Pilcher                                         arequipeno@...
-------- "I grew up before Mark Zuckerberg invented friendship" --------

Carlos O'Donell | 26 Nov 15:59 2015

glibc patchwork instance not processing my patches.

On 11/25/2015 07:46 PM, Carlos Eduardo Seo wrote:
> I noticed my patches are not getting tracked by Patchwork. Who should
> I talk to about this?

In general the glibc community maintains patchwork, which mostly means
Siddhesh and I maintain the day-to-day administration parts. 


So you're talking to the right people. 

I'm TO'ing libc-help so we have a public record of this.

Let us look at the problem right now. I see no recent patches from you at
all. I see only: http://patchwork.sourceware.org/patch/7079/
Which I marked superseded because later patches fixed it.

Your most recent patch should have been this one:

The attachment requirements are here:

Your Apple Mail client is using:
Content-Type: application/octet-stream;
Content-Transfer-Encoding: quoted-printable

I expect the combination of application/octet-stream and
quoted-printable is causing your patches to be dropped.
(Continue reading)

Bill Ross | 25 Nov 17:54 2015

modifying ld.so to pre-process elf file, concurrency problem / SIGSEGV


I am modifying ld.so to load a custom library to pre-process elf files based
on header flags, to perform elf segment hash verification…

Exact Question: What is the proper way to invoke _dl_open() from within
ld.so such that internal ld.so structs are maintained / mutexed properly?

Eglibc 2.19, file rtld.c, x86_64

Line # 1546

      /* If we have any auditing modules, announce that we already
                have two objects loaded.  */
      if (__builtin_expect (GLRO(dl_naudit) > 0, 0))
                  struct link_map *ls[2] = { main_map, &GL(dl_rtld_map) };

                  for (unsigned int outer = 0; outer < 2; ++outer)
                      struct audit_ifaces *afct = GLRO(dl_audit);
                      for (unsigned int cnt = 0; cnt < GLRO(dl_naudit);
                                  if (afct->objopen != NULL)
(Continue reading)

刘本熙 | 12 Nov 08:14 2015

Is it possible to build ld.so alone?

Hi! I changed some code of dynamic linker(ld.so), and I want to build
and debug it. I find it extremely costly to build the entire glibc, so
I'm looking forward to build it alone. But the makefiles are so
complicated that I can't figure it out. Is that any possible way to do

Alastair Hughes | 10 Nov 07:55 2015

Difficulties building a static glibc

Hi all!

I'm trying to cross compile a static glibc (building for mips from an x86_64 machine).
I've successfully built a cross compiled system using the musl libc before, however there appeared to be a
few bugs in the libc or gcc or something in the way I configured the various bits of software. Since I'm
mostly unfamiliar with MIPS assembly, I figured that a sensible debugging step would be to build an
alternative libc and compare the two.
Unfortunately, I've run into a few issues.

The first issue is that glibc for mips doesn't correctly generate libc-modules.h, needed for building the
libc. This appears to be due to a patchset posted late last year:
which appears to have made it into glibc-2.22.
Unfortunately, for a static build, libc-modules.h is not generated, breaking the build.

What would be an appropriate workaround?

I'm configuring glibc with:
--prefix=/usr \
--build=x86_64-unknown-linux-gnu \
--host=mips-linux-gnu \
--libexecdir=/usr/lib \
--libdir=/usr/lib \
--bindir=/usr/lib \
--includedir=/usr/include \
--with-headers=${sysroot}/usr/include \
--with-binutils=${sysroot}/bin \
--without-tls \
--disable-werror \
--disable-shared \
(Continue reading)

Florian Weimer | 9 Nov 09:08 2015

Raise errors from ELF constructors

Is there a way to raise an error from an ELF constructor so that the
error is reported by dlopen and can be inspected by dlerror?

Florian Weimer | 3 Nov 12:39 2015

Concurrency semantics of fork

Does fork behave as if it performs an acquire load of the process memory
regions it duplicates?


Florian Weimer | 2 Nov 14:42 2015

Forcing BIND_NOW for a symbol

Is there a way to tell the dynamic linker to resolve a function symbol
at load time, and not later, when the function is called?

I'm interested in both the case where this is a completely new symbol
(so we can do anything we want to make this happen), and existing
versioned function symbol.

The idea is to ensure that if there is an IFUNC handler for the symbol,
the handler is called at load time, and not later during program execution.


Christer Solskogen | 31 Oct 22:20 2015

Shared libgcc instead of static


I'm having some fun trying to create a linux system that uses shared 
libraries as much as possible, trying to avoid static ones.
glibc will fail without libgcc.a - even if libgcc.so is available. Is 
there a technical reason for that?