This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: building glibc with gold linker & -frecord-gcc-switches results in internal error
> The Makefile rules for crti.o do some massaging of the assembly with
> sed. I wonder if something is going haywire there.
That's exactly what's happening. Here's the code for initfini.s...
.file "initfini.c"
.section .GCC.command.line,"MS",@progbits,1
.ascii "-nostdinc"
.zero 1
.ascii "-I ../include"
.zero 1
.ascii "-I /var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.11.1-r3/"
.ascii "work/build-default-i686-pc-linux-gnu-nptl/csu"
.zero 1
[...snip...]
.ascii "-finhibit-size-directive"
.zero 1
.ascii "-fno-exceptions"
.zero 1
#APP
#include "defs.h"
/*@HEADER_ENDS*/
/*@TESTS_BEGIN*/
#NO_APP
.text
.p2align 2,,3
.globl dummy
.type dummy, @function
dummy:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
movl 8(%ebp), %eax
testl %eax, %eax
je .L1
call *%eax
.L1:
leave
ret
#APP
/*@TESTS_END*/
/*@_init_PROLOG_BEGINS*/
#NO_APP
.p2align 2,,3
.type call_gmon_start, @function
call_gmon_start:
pushl %ebp
movl %esp, %ebp
pushl %ebx
pushl %edx
call .L6
[...]
The glibc/csu/Makefile runs this code through a sed script that
deletes everything between HEADER_ENDS and _init_PROLOG_BEGINS, which
loses the ".text" directive, and the code for call_gmon_start ends up
placed in the .GCC.command.line section.
Refile this as a glibc bug (although we'll keep this one open for the
assert failure that should be a reasonable error message).
-cary