forked from OSchip/llvm-project
[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:
parent
50f32d949b
commit
b6a6bdab20
|
@ -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;
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
static int a = 0;
|
||||
|
||||
int b = 10;
|
Binary file not shown.
|
@ -0,0 +1,6 @@
|
|||
int sdata1 = 10;
|
||||
int sdata2 = 20;
|
||||
int sdata3 = 30;
|
||||
|
||||
int sbss1 = 0;
|
||||
|
Binary file not shown.
|
@ -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: }
|
Loading…
Reference in New Issue