llvm.org GIT mirror llvm / 803e94e
[JITLink][MachO] Honor the no-dead-strip flag on nlist entries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360618 91177308-0d34-0410-b5e6-96231b3b80d8 Lang Hames 1 year, 6 months ago
2 changed file(s) with 17 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
251251
252252 DA.setCallable(*SymType & object::SymbolRef::ST_Function);
253253
254 // Check alt-entry.
254 // Check NDesc flags.
255255 {
256256 uint16_t NDesc = 0;
257257 if (Obj.is64Bit())
258258 NDesc = Obj.getSymbolTableEntry(SymI->getRawDataRefImpl()).n_desc;
259259 else
260260 NDesc = Obj.getSymbolTableEntry(SymI->getRawDataRefImpl()).n_desc;
261
262 // Record atom for alt-entry post-processing (where the layout-next
263 // constraints will be added).
261264 if (NDesc & MachO::N_ALT_ENTRY)
262265 AltEntryAtoms.push_back(&DA);
266
267 // If this atom has a no-dead-strip attr attached then mark it live.
268 if (NDesc & MachO::N_NO_DEAD_STRIP)
269 DA.setLive(true);
263270 }
264271
265272 LLVM_DEBUG({
271271 .section __DATA,__nds_test_sect,regular,no_dead_strip
272272 .quad 0
273273
274 # Check that unreferenced local symbols that have been marked no-dead-strip are
275 # not dead-striped.
276 #
277 # jitlink-check: *{8}section_addr(macho_reloc.o, __nds_test_nlst) = 0
278 .section __DATA,__nds_test_nlst,regular
279 .no_dead_strip no_dead_strip_test_symbol
280 no_dead_strip_test_symbol:
281 .quad 0
282
274283 # Check that explicit zero-fill symbols are supported
275284 # jitlink-check: *{8}zero_fill_test = 0
276285 .globl zero_fill_test