[ELF][Hexagon] typeZeroFillQuick is not associated with bss section.

We need to increase the memory and the filesize when we add a typeZeroFillQuick
atom.

llvm-svn: 200369
This commit is contained in:
Shankar Easwaran 2014-01-29 04:04:27 +00:00
parent 50f32d949b
commit b6a6bdab20
6 changed files with 28 additions and 1 deletions

View File

@ -288,6 +288,7 @@ const lld::AtomLayout &AtomSection<ELFT>::appendAtom(const Atom *atom) {
case DefinedAtom::typeConstant:
case DefinedAtom::typeData:
case DefinedAtom::typeDataFast:
case DefinedAtom::typeZeroFillFast:
case DefinedAtom::typeGOT:
case DefinedAtom::typeStub:
case DefinedAtom::typeResolver:
@ -312,7 +313,6 @@ const lld::AtomLayout &AtomSection<ELFT>::appendAtom(const Atom *atom) {
break;
case DefinedAtom::typeThreadZeroFill:
case DefinedAtom::typeZeroFill:
case DefinedAtom::typeZeroFillFast:
_atoms.push_back(new (_alloc) lld::AtomLayout(atom, mOffset, 0));
this->_msize = mOffset + definedAtom->size();
break;

View File

@ -0,0 +1,3 @@
static int a = 0;
int b = 10;

Binary file not shown.

View File

@ -0,0 +1,6 @@
int sdata1 = 10;
int sdata2 = 20;
int sdata3 = 30;
int sbss1 = 0;

Binary file not shown.

View File

@ -0,0 +1,18 @@
# This tests that a typeZeroFillFast atom is associated with a section that has
# the correct memory size.
RUN: lld -flavor gnu -target hexagon %p/Inputs/sdata1.o %p/Inputs/sdata2.o \
RUN: -o %t --noinhibit-exec -static
RUN: llvm-readobj -sections %t | FileCheck -check-prefix=CHECKSECTIONSANDSIZE %s
CHECKSECTIONSANDSIZE: Section {
CHECKSECTIONSANDSIZE: Name: .sdata (13)
CHECKSECTIONSANDSIZE: Address: 0x1000
CHECKSECTIONSANDSIZE: Offset: 0x1000
CHECKSECTIONSANDSIZE: Size: 20
CHECKSECTIONSANDSIZE: }
CHECKSECTIONSANDSIZE: Section {
CHECKSECTIONSANDSIZE: Name: .bss (20)
CHECKSECTIONSANDSIZE: Address: 0x1018
CHECKSECTIONSANDSIZE: Offset: 0x1018
CHECKSECTIONSANDSIZE: }