Chromium Code Reviews| Index: src/IceELFObjectWriter.cpp |
| diff --git a/src/IceELFObjectWriter.cpp b/src/IceELFObjectWriter.cpp |
| index 6fbf1dfe50bf7b013b41c36979090f706497a424..5d6537fa5887a083ecffd78b7cd3db978eae49ca 100644 |
| --- a/src/IceELFObjectWriter.cpp |
| +++ b/src/IceELFObjectWriter.cpp |
| @@ -218,9 +218,11 @@ void ELFObjectWriter::writeFunctionCode(const IceString &FuncName, |
| assert(!SectionNumbersAssigned); |
| ELFTextSection *Section = nullptr; |
| ELFRelocationSection *RelSection = nullptr; |
| - if (TextSections.empty()) { |
| - // TODO(jvoung): handle ffunction-sections. |
| + bool FunctionSections = Ctx.getFlags().getFunctionSections(); |
|
Jim Stichnoth
2015/02/24 05:09:32
const?
jvoung (off chromium)
2015/02/24 16:50:37
Done.
|
| + if (TextSections.empty() || FunctionSections) { |
| IceString SectionName = ".text"; |
| + if (FunctionSections) |
| + SectionName += "." + FuncName; |
| bool IsELF64 = isELF64(Ctx.getTargetArch()); |
| const Elf64_Xword ShFlags = SHF_ALLOC | SHF_EXECINSTR; |
| // TODO(jvoung): Should be bundle size. Grab it from that target? |
| @@ -254,9 +256,8 @@ void ELFObjectWriter::writeFunctionCode(const IceString &FuncName, |
| OffsetInSection, SymbolSize); |
| StrTab->add(FuncName); |
| - // Create a relocation section for the text section if needed, and copy the |
| - // fixup information from per-function Assembler memory to the object |
| - // writer's memory, for writing later. |
| + // Copy the fixup information from per-function Assembler memory to the |
| + // object writer's memory, for writing later. |
| if (!Asm->fixups().empty()) { |
| RelSection->addRelocations(OffsetInSection, Asm->fixups()); |
| } |