Add a InitSections method to the streamer interface.

The ELF implementation now creates text, data and bss to match the gnu as
behavior.

The text streamer still has the old MachO specific behavior since
the testsuite checks that it will error when a directive is given
before a setting the current section for example.

A nice benefit is that -n is not required anymore when producing
ELF files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114027 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2010-09-15 21:48:40 +00:00
parent 06f264e504
commit d80781b98b
13 changed files with 116 additions and 13 deletions

View File

@ -739,7 +739,7 @@ void MCAssembler::Finish(MCObjectWriter *Writer) {
// Create dummy fragments to eliminate any empty sections, this simplifies
// layout.
if (it->getFragmentList().empty())
new MCFillFragment(0, 1, 0, it);
new MCDataFragment(it);
it->setOrdinal(SectionIndex++);
}