Make folly/experimental/symbolizer/test:elf_tests work if compiled as PIE.
Summary: If the binary is compiled as PIE, such as in the case of TSAN, the kStringValue symbol's value, which is an address that in turn points to the "coconuts" character array, may be stored as 0 in the binary file, and rely on the dynamic linker to relocate at loading time. The corresponding relocation entry (in the .rela.dyn section) contains the relative offset instead. We do not seem to have implemented parsing of the relocation section, so this diff changes the test to be more lenient, and upon seeing a zero will just verify the address of the symbol against the live binary. Reviewed By: yfeldblum Differential Revision: D22782080 fbshipit-source-id: ffbfc7c23b84865fb29bbfb782feb896d687594b
Showing
Please register or sign in to comment