llvm-project/bolt/lib
Job Noorman 54ab954149 [BOLT] Reject symbols pointing to section end
Sometimes, symbols are present that point to the end of a section (i.e.,
one-past the highest valid address). Currently, BOLT either rejects
those symbols when they don't point to another existing section, or errs
when they do and the other section is not executable. I suppose BOLT
would accept the symbol when it points to an executable section.

In any case, these symbols should not be considered while discovering
functions and should not result in an error. This patch implements that.

Note that this patch checks explicitly for symbols whose value equals
the end of their section. It might make more sense to verify that the
symbol's value is within [section start, section end). However, I'm not
sure if this could every happen *and* its value does not equal the end.

Another way to implement this is to verify that the BinarySection we
find at the symbol's address actually corresponds to the symbol's
section. I'm not sure what the best approach is so feedback is welcome.

Reviewed By: yota9, rafauler

Differential Revision: https://reviews.llvm.org/D146215
2023-03-21 13:59:39 +04:00
..
Core [BOLT] Add .relr.dyn section support 2023-03-17 17:24:19 +04:00
Passes Use *{Map,Set}::contains (NFC) 2023-03-15 22:55:35 -07:00
Profile Use *{Map,Set}::contains (NFC) 2023-03-15 22:55:35 -07:00
Rewrite [BOLT] Reject symbols pointing to section end 2023-03-21 13:59:39 +04:00
RuntimeLibs
Target [BOLT][NFC] Move addRelocation{X86,AArch64} into MCPlusBuilder 2023-03-14 17:34:25 -07:00
Utils [BOLT][CMake] Add dependency on llvm_vcsrevision_h 2023-02-01 12:57:50 -08:00
CMakeLists.txt