On Thu, Dec 2, 2010 at 1:28 PM, H.J. Lu <hjl.to...@gmail.com> wrote: >> For every new routine that the gcc backend generates a new call to, it >> ought to know which library that routine is defined in, and should be >> able to add that library after the generated object(s) during the >> all-symbols-read callback. We really don't want to support arbitrary >> interposition at that point, because a user-supplied replacement might >> invalidate some assumptions that were made during optimization. >> > > It sounds reasonable. We have to add those libraries very carefully. > > For example, with "gcc -static" on Linux, the reference to glibc should > be passed to linker as "--start-group -lgcc -lgcc_eh -lc --end-group". > >
One approach is to use [...@gnu-6 pr12245-6]$ cat libc_static.a GROUP (-lgcc -lgcc_eh -lc) [...@gnu-6 pr12245-6]$ instead of "--start-group -lgcc -lgcc_eh -lc --end-group". -- H.J.