|Summary:||Simply ARM EABI application with missing .rel.plt ouput section description crashes ld|
|Product:||binutils||Reporter:||Meador Inge <meadori>|
|Component:||ld||Assignee:||Nick Clifton <nickc>|
Convert assertion into an error message
Refreshed patch with test cases.
Description Meador Inge 2012-07-24 23:18:22 UTC
Created attachment 6555 [details] Reproduction case The attached test case was constructed via some assembly files from the ARM ld testsuite. The only real change I made was to take the linker script from `arm-none-eabi-ld --verbose` and comment out the output section description for '.rel.plt'. The problem can be reproduced as follows (with binutils built from HEAD): $ tar xvfj arm-none-eabi-no-rel-plt-crash.tar.bz2 arm-app.s arm-lib.s Makefile my.ld $ make arm-none-eabi-as -o arm-app.o arm-app.s arm-none-eabi-as -o arm-lib.o arm-lib.s arm-none-eabi-ld -shared -o arm-lib.so arm-lib.o arm-none-eabi-ld -o arm-app -T my.ld arm-app.o arm-lib.so arm-none-eabi-ld: BFD (GNU Binutils) 220.127.116.1120724 assertion fail /home/meadori/Code/src/binutils/bfd/elf32-arm.c:14086 make: *** [arm-app] Segmentation fault (core dumped) make: *** Deleting file `arm-app'
Comment 1 Nick Clifton 2012-07-25 14:32:30 UTC
Created attachment 6556 [details] Convert assertion into an error message Hi Meador, Please could you try out the uploaded patch which converts the assertion into an error message. Cheers Nick
Comment 2 Meador Inge 2012-07-25 16:25:05 UTC
Created attachment 6557 [details] Refreshed patch with test cases. Hi Nick, That fixed it and is much simpler than what I was trying to do. The output should say "linker script" instead of "linker map", though. Here is a refreshed patch with a few nits fixed plus test cases. I ran the binutils suite and saw no regressions. I also tested the patch against the original real world application that caused me to notice this issue and the error message triggered as expected. Thanks for coming up with a patch for this so quickly.
Comment 3 firstname.lastname@example.org 2012-07-26 13:43:30 UTC
CVSROOT: /cvs/src Module name: src Changes by: email@example.com 2012-07-26 13:43:24 Modified files: ld/testsuite : ChangeLog bfd : ChangeLog elf32-arm.c ld/testsuite/ld-arm: arm-elf.exp Added files: ld/testsuite/ld-arm: arm-no-rel-plt.ld arm-no-rel-plt.out Log message: PR ld/14397 * elf32-arm.c (elf32_arm_finish_dynamic_sections): Report an error if a required section is missing from the linker script. * ld-arm/arm-elf.exp: Add tests of linking without .rel.plt. * ld-arm/arm-no-rel-plt.out: Linker script without .rel.plt section. * ld-arm/arm-no-rel-plt.out: Expected output. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ChangeLog.diff?cvsroot=src&r1=1.1578&r2=1.1579 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.5756&r2=1.5757 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf32-arm.c.diff?cvsroot=src&r1=1.297&r2=1.298 http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-arm/arm-no-rel-plt.ld.diff?cvsroot=src&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-arm/arm-no-rel-plt.out.diff?cvsroot=src&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-arm/arm-elf.exp.diff?cvsroot=src&r1=1.95&r2=1.96
Comment 4 Nick Clifton 2012-07-26 13:46:29 UTC
Hi Meador, > That fixed it and is much simpler than what I was trying to do. > The output should say "linker script" instead of "linker map", though. Doh - yes, sorry about that. > Here is a refreshed patch with a few nits fixed plus test cases. Thanks - I have applied your patch with one small change - I left the error message as one long line, rather than splitting it over two lines. The reason for doing this is that it makes it easier for the translators when converting the message into other languages. Cheers Nick
Comment 5 Meador Inge 2012-07-26 15:26:06 UTC
On 07/26/2012 08:46 AM, nickc at redhat dot com wrote: > Thanks - I have applied your patch with one small change Thanks! -- Meador