Fix phantom TEXTREL in libcoreclr.so (#8347)
authorJan Vorlicek <janvorli@microsoft.com>
Tue, 29 Nov 2016 14:12:02 +0000 (15:12 +0100)
committerJan Kotas <jkotas@microsoft.com>
Tue, 29 Nov 2016 14:12:02 +0000 (06:12 -0800)
commita60661ea96f6760d6cfd8e1e86c370f7e7052ed0
tree0d796352c2da7cbe4267b80104542dc12dc6d95e
parent6c870a3e37bead1aecf2fa898fcefbefd8e7543a
Fix phantom TEXTREL in libcoreclr.so (#8347)

This change fixes the problem where scanelf tool reported that libcoreclr.s
contains TEXTRELs, however it was unable to find any.
It turns out there actually were TEXTRELs, but not in the program code or
program data, but rather in the DWARF tables. The NESTED_ENTRY macro for
ARM64 and AMD64 uses .cfi_personality with encoding 0, which means
absolute address. This is the source of the TEXTREL.
Changing the encoding to 0x1b - DW_EH_PE_pcrel | DW_EH_PE_sdata4 fixes the
problem - the scanelf tool no longer reports any TEXTRELs in libcoreclr.so.
src/pal/inc/unixasmmacrosamd64.inc
src/pal/inc/unixasmmacrosarm64.inc