[ELF] Use pcrel format for eh_frame_ptr field encoding
authorSimon Atanasyan <simon@atanasyan.com>
Mon, 16 Mar 2015 21:07:46 +0000 (21:07 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Mon, 16 Mar 2015 21:07:46 +0000 (21:07 +0000)
commit4b4706b6018217b17f9e3f8d6653486c5100e23e
tree8e3dab42640e3dac04b192c32fba6be17db3cced
parent9255a5535a52da9ca96d804926538e858bcc8b0a
[ELF] Use pcrel format for eh_frame_ptr field encoding

The `eh_frame_ptr` field in the `.eh_frame_hdr` section contains an address
of the `.eh_frame` section. Using an absolute 32-bit format for encoding
of this field does not work for 64-bit targets. It is better to use a
relative format because it covers both 32-bit and 64-bit cases. Sure
this work if a distance between `.eh_frame_hdr` and `.eh_frame` sections
is less than 4 Gb but it is a rather correct assumption.

http://reviews.llvm.org/D8352

llvm-svn: 232414
lld/lib/ReaderWriter/ELF/SectionChunks.h
lld/test/elf/eh_frame_hdr.test