Description of problem: This was found while attempting to bring up Fedora on ia64. To make things easier I have a reproducer method that can be done under RHEL5.1 since we don't have complete Fedora bits for ia64 yet. The gcc patch: gcc41-build-id.patch creates a regression on ia64 that causes a segv when compiling the kernel. It is a very simple .S file it is compiling as a check. I will attach the .S file here. # gcc -nostdlib -static -Wl,-T./check-segrel.lds ./check-segrel.S collect2: ld terminated with signal 11 [Segmentation fault] It appears that something doesn't like having the --build-id argument passed in as this bit of patch is what introduced the problem: --- gcc/config/ia64/linux.h.~1~ +++ gcc/config/ia64/linux.h @@ -56,7 +56,7 @@ do { \ Signalize that because we have fde-glibc, we don't need all C shared libs linked against -lgcc_s. */ #undef LINK_EH_SPEC -#define LINK_EH_SPEC "" +#define LINK_EH_SPEC "%{!r:--build-id} " #define MD_UNWIND_SUPPORT "config/ia64/linux-unwind.h" when I back this bit out the segv no longer happens Version-Release number of selected component (if applicable): gcc-4.1.2-31.src.rpm How reproducible: 100% Steps to Reproduce: Easiest to reproduce is to install RHEL5.1 and do the following: 1. install gcc-4.1.2-31.src.rpm 2. rpmbuild -bp --nodeps gcc41.spec 3. cd ../BUILD/gcc-4.1.2-20070925 4. mkdir build 5. cd build 6. ../configure --prefix=/usr/local --enable-languages=c 7. make -j4 8. make install 9. /usr/local/bin/gcc -nostdlib -static \ -Wl,-T./check-segrel.lds ./check-segrel.S Actual results: SEGV Expected results: should compile quietly Additional info:
Created attachment 231161 [details] file to be used in reproducer as described in original report
Adding Roland to the CC since it appears this was his patch. Roland, any idea why this causes a problem? Would there be any problems with pulling this out at least for ia64?
This doesn't have much to do with gcc, it is ld that segfaulted. What version of ld (nvr of binutils) are you using?
Created attachment 231431 [details] linker script The important thing to the bug is probably the linker script, not the assembly source.
Probably a sufficient workaround for the ld problem is to change: .rodata : { *(.rodata) } :ro to: .rodata : { *(.rodata) *(.note*) } :ro in check-segrel.lds.
(In reply to comment #3) > This doesn't have much to do with gcc, it is ld that segfaulted. What version > of ld (nvr of binutils) are you using? I saw this with binutils-2.17.50.0.18-1, I should note that when I reproduced this on RHEL5.1 I had to update to that version of binutils or I would get errors such as "unrecognized option '--build-id'" since the ld on RHEL5.1 doesn't recognize that option. The specific version of ld I am using is: # ld --version GNU ld version 2.17.50.0.6-5.el5 20061020
binutils-2.17.50.0.18-1 on x86_64 reproduces a crash
Created attachment 231471 [details] linker script for test case
Created attachment 231481 [details] machine-neutral assembly source test case as -o s.o s.s; ld --build-id -T s.lds s.o
no longer seeing a segfault here, calling it closed.