8714
|
|
|
Zach Zundel |
3 years ago
|
|
|
8713
|
|
|
Dan Melnic |
3 years ago
|
|
|
8712
|
|
|
Christopher Gist |
3 years ago
|
|
|
8711
|
|
|
Mark Santaniello |
3 years ago
|
|
|
8710
|
|
|
Nathan Bronson |
3 years ago
|
|
|
8709
|
|
|
Nathan Bronson |
3 years ago
|
|
|
8708
|
|
|
Robin Cheng |
3 years ago
|
|
|
8707
|
|
|
Robin Cheng |
3 years ago
|
|
|
8706
|
|
|
Pranav Thulasiram Bh... |
3 years ago
|
|
|
8705
|
|
|
Eric Niebler |
3 years ago
|
|
|
8704
|
|
|
Yedidya Feldblum |
3 years ago
|
|
|
8703
|
|
|
Yedidya Feldblum |
3 years ago
|
|
|
8702
|
|
Fix a previously introduced bug in ElfTests related to PIE and addresses.
Summary: This failed on mode/opt, because the `- sh_addr + sh_offset` was actually using the address and offset of the *symbol table section*, not the *data section* (where the kStringValue variable actually is). It still worked, because for mapped sections, the `offset - address` just happens to be the same for all sections, so it didn't matter what section we used; in debug mode, we use dynamic linking, so the symbol section is called .dynsym and is loaded in memory, but in opt mode, the symbol section is called .symtab and is *not* loaded, so sh_addr is zero, and that formula no longer works.
The goal there was really just to subtract the binary base address encoded in the ELF file. ElfFile already provides this via getBaseAddress(), and that's also how we can identify whether the loaded ELF (in this case, the same as the current executable) is PIE; so switched both the calculation and the if condition to use this result.
Reviewed By: yfeldblum
Differential Revision: D23020998
fbshipit-source-id: f7e66bb554c62aa13d7d2fc1017cb31542507be9
|
Robin Cheng |
3 years ago
|
|
|
8701
|
|
|
Dan Melnic |
3 years ago
|
|
|
8700
|
|
|
Dan Melnic |
3 years ago
|
|
|
8699
|
|
|
Xun Li |
3 years ago
|
|
|
8698
|
|
|
Misha Shneerson |
3 years ago
|
|
|
8697
|
|
|
Chad Austin |
3 years ago
|
|
|
8696
|
|
|
Misha Shneerson |
3 years ago
|
|
|
8695
|
|
|
Robin Cheng |
3 years ago
|
|
|