1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

[JITLink][MachO] Honor the no-dead-strip flag on nlist entries.

llvm-svn: 360618
This commit is contained in:
Lang Hames 2019-05-13 20:52:30 +00:00
parent 62f76a0edf
commit 0725bbb70a
2 changed files with 17 additions and 1 deletions

View File

@ -252,15 +252,22 @@ Error MachOAtomGraphBuilder::addNonCustomAtoms() {
DA.setCallable(*SymType & object::SymbolRef::ST_Function);
// Check alt-entry.
// Check NDesc flags.
{
uint16_t NDesc = 0;
if (Obj.is64Bit())
NDesc = Obj.getSymbolTableEntry(SymI->getRawDataRefImpl()).n_desc;
else
NDesc = Obj.getSymbolTableEntry(SymI->getRawDataRefImpl()).n_desc;
// Record atom for alt-entry post-processing (where the layout-next
// constraints will be added).
if (NDesc & MachO::N_ALT_ENTRY)
AltEntryAtoms.push_back(&DA);
// If this atom has a no-dead-strip attr attached then mark it live.
if (NDesc & MachO::N_NO_DEAD_STRIP)
DA.setLive(true);
}
LLVM_DEBUG({

View File

@ -272,6 +272,15 @@ subtractor_with_alt_entry_subtrahend_quad_B:
.section __DATA,__nds_test_sect,regular,no_dead_strip
.quad 0
# Check that unreferenced local symbols that have been marked no-dead-strip are
# not dead-striped.
#
# jitlink-check: *{8}section_addr(macho_reloc.o, __nds_test_nlst) = 0
.section __DATA,__nds_test_nlst,regular
.no_dead_strip no_dead_strip_test_symbol
no_dead_strip_test_symbol:
.quad 0
# Check that explicit zero-fill symbols are supported
# jitlink-check: *{8}zero_fill_test = 0
.globl zero_fill_test