Binutils: Always skip only 1 byte for CIE version 1's return address register.
authorTamar Christina <tamar.christina@arm.com>
Fri, 1 Mar 2019 11:37:51 +0000 (11:37 +0000)
committerTamar Christina <tamar.christina@arm.com>
Fri, 1 Mar 2019 11:38:22 +0000 (11:38 +0000)
commit4ffd290906608e72fd98d627a24aa2c2b6ecf4ce
tree6f51b7151ba46dfe875a57988b79d6e122fc4526
parentb24cc4146e4de9f3b66e2e2fb8379db46eff89c9
Binutils: Always skip only 1 byte for CIE version 1's return address register.

According to the specification for the CIE entries, when the CIE version is 1 then
the return address register field is always 1 byte.  Readelf does this correctly in
read_cie in dwarf.c but ld does this incorrectly and always tries to read a
skip_leb128.  If the value here has the top bit set then ld will incorrectly read
at least another byte, causing either an assert failure or an incorrect address to
be used in eh_frame.

I'm not sure how to generate a generic test for this as I'd need to write assembly,
and it's a bit hard to trigger. Essentially the relocated value needs to start with
something that & 0x70 != 0x10 while trying to write a personality.

bfd/ChangeLog:

* elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Correct CIE parse.
bfd/ChangeLog
bfd/elf-eh-frame.c
This page took 0.026415 seconds and 4 git commands to generate.