From ac03979000cd12513d84d258e5b2dd36ef9e80d5 Mon Sep 17 00:00:00 2001 From: Pete Cooper Date: Thu, 7 Jan 2016 21:07:26 +0000 Subject: Don't emit relocs for the __eh_frame section as they can be implicit. The __eh_frame section contains relocations which can always be implicitly generated. This patch tracks whether sections have only implicitly relocations and skips emitting them to the object file if that is the case. The test case here ensures that this is the case for __eh_frame sections. Reviewed by Lang Hames. http://reviews.llvm.org/D15594 llvm-svn: 257099 --- lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp') diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp index 1c4bb1d4f6a..f9499b60321 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp @@ -1034,7 +1034,8 @@ void relocatableSectionInfoForContentType(DefinedAtom::ContentType atomType, StringRef &segmentName, StringRef §ionName, SectionType §ionType, - SectionAttr §ionAttrs) { + SectionAttr §ionAttrs, + bool &relocsToDefinedCanBeImplicit) { for (const MachORelocatableSectionToAtomType *p = sectsToAtomType ; p->atomType != DefinedAtom::typeUnknown; ++p) { @@ -1047,8 +1048,11 @@ void relocatableSectionInfoForContentType(DefinedAtom::ContentType atomType, sectionName = p->sectionName; sectionType = p->sectionType; sectionAttrs = 0; + relocsToDefinedCanBeImplicit = false; if (atomType == DefinedAtom::typeCode) sectionAttrs = S_ATTR_PURE_INSTRUCTIONS; + if (atomType == DefinedAtom::typeCFI) + relocsToDefinedCanBeImplicit = true; return; } llvm_unreachable("content type not yet supported"); -- cgit v1.2.3