diff options
author | Adhemerval Zanella <azanella@linux.vnet.ibm.com> | 2015-06-17 13:46:07 +0000 |
---|---|---|
committer | Adhemerval Zanella <azanella@linux.vnet.ibm.com> | 2015-06-17 13:46:07 +0000 |
commit | 9c5831f3de4359d807ee33a37512795817f8689e (patch) | |
tree | ae85a1850ff68d84f49c1d866b4367fec08ea360 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 1a1083285cf00c38380f1045707d5da8eead367b (diff) | |
download | llvm-9c5831f3de4359d807ee33a37512795817f8689e.zip llvm-9c5831f3de4359d807ee33a37512795817f8689e.tar.gz llvm-9c5831f3de4359d807ee33a37512795817f8689e.tar.bz2 |
[ELF] Fix wrong TBSS size
This patch fixes the wrong .tbss segment size generated for cases where
multiple modules have non initialized threads variables. For instance:
* t0.c
__thread int x0;
__thread int x1;
__thread int x2;
extern __thread int e0;
extern __thread int e1;
extern __thread int e2;
extern __thread int e3;
int foo0 ()
{
return x0;
}
int main ()
{
return x0;
}
* t1.c
__thread int e0;
__thread int e1;
__thread int e2;
__thread int e3;
lld is generating (for aarch64):
[14] .tbss NOBITS 0000000000401000 00001000
0000000000000010 0000000000000000 WAT 0 0 4
Where is just taking in consideration the largest tbss segment, not all
from all objects. ld generates a correct output:
[17] .tbss NOBITS 0000000000410dec 00000dec
000000000000001c 0000000000000000 WAT 0 0 4
This issue is at 'lib/ReaderWriter/ELF/SegmentChunks.cpp' where
Segment<ELFT>::assignVirtualAddress is setting wrong slice values, not taking care
of although tbss segments file size does noy play role in other segment virtual
address placement, its size should still be considered.
llvm-svn: 239906
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions