From d664038aa4fa4081ec005086761c73d0b9eb5a27 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 28 Aug 2016 22:07:49 +0000 Subject: [PATCH] * don't add ".reference" assembler directives on Darwin for symbols that are in sections marked as "no_dead_strip" git-svn-id: trunk@34387 - --- compiler/aasmcnst.pas | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/compiler/aasmcnst.pas b/compiler/aasmcnst.pas index c75f4a16e4..876d39e99c 100644 --- a/compiler/aasmcnst.pas +++ b/compiler/aasmcnst.pas @@ -949,8 +949,15 @@ implementation kept via the linker script) } if tcalo_no_dead_strip in options then begin - if target_info.system in systems_darwin then - prelist.concat(tai_directive.Create(asd_reference,sym.name)) + if (target_info.system in systems_darwin) then + begin + { Objective-C section declarations contain "no_dead_strip" + attributes if none of their symbols need to be stripped -> don't + add extra ".reference" statement for their symbols (gcc/clang + don't either) } + if not(section in [low(TObjCAsmSectionType)..high(TObjCAsmSectionType)]) then + prelist.concat(tai_directive.Create(asd_reference,sym.name)) + end else if section<>sec_fpc then internalerror(2015101402); end;