Also check e_machine when merging sections
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 30 Sep 2015 12:32:12 +0000 (05:32 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 30 Sep 2015 12:37:49 +0000 (05:37 -0700)
commit9865bd0da6e59c3a1c55605b5a6a9283ed4d542c
tree00cfc33b4e09eef4d71758d73f7fc0555ac04d73
parent2ec6d9e621ca468d56ac92df8ec2ec510d21f6da
Also check e_machine when merging sections

When we check consistency for merge ELF sections, we should not only
check EI_CLASS, but also compatible e_machine.

bfd/

PR ld/19013
* elflink.c (_bfd_elf_merge_sections): Only merge input bfds
that have the compatible ELF machine code with the output bfd.

ld/testsuite/

PR ld/19013
* ld-x86-64/pr19013-nacl.d: New file.
* ld-x86-64/pr19013-x32.d: Likewise.
* ld-x86-64/pr19013.d: Likewise.
* ld-x86-64/pr19013.s: Likewise.
* ld-x86-64/x86-64.exp: Run PR ld/19013 tests.
bfd/ChangeLog
bfd/elflink.c
ld/testsuite/ChangeLog
ld/testsuite/ld-x86-64/pr19013-nacl.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr19013-x32.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr19013.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr19013.s [new file with mode: 0644]
ld/testsuite/ld-x86-64/x86-64.exp