This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, ARM/ld]Linker should return with error if failed to merge arch attribute

Hi there,

As shown by the case in patch, current linker continues to finish the
linking even after generating an error message about arch conflicting.
The trouble is that it returns code 0 which indicates a successful
run, despite the produced elf file contains illegal information.

Below is my screen paste to demonstrate this issue:

terguo01@terry-pc01:case$ arm-none-eabi-ld m.o f.o -e main -o test.elf
arm-none-eabi-ld: error: f.o: Conflicting CPU architectures 13/0
terguo01@terry-pc01:case$ echo $?

terguo01@terry-pc01:case$ arm-none-eabi-readelf -A test.elf
Attribute Section: aeabi
File Attributes
Segmentation fault (core dumped)

The attached patch intends to fix this issue. It is tested with
Binutils regression test and no regressions.

OK to commit?



2014-09-15  Terry Guo  <>

     * elf32-arm.c (elf32_arm_merge_eabi_attributes): Return false if
failed to merge.


2014-09-15  Terry Guo  <>

     * ld-arm/attr-merge-arch-2.d: New test case.
     * ld-arm/attr-merge-arch-2a.s: New test case source file.
     * ld-arm/attr-merge-arch-2b.s: Likewise.
     * ld-arm/arm-elf.exp: Run new test case.

Attachment: merge-arch-attr-v1.txt
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]