mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-12 18:02:43 +00:00
[JITLink][MachO] Fix common symbol size plumbing.
This fixes the underlying bug that was exposed by 298e183e81
.
This commit is contained in:
parent
de21704ba9
commit
d9220b580b
@ -873,7 +873,7 @@ public:
|
||||
uint64_t Alignment, bool IsLive) {
|
||||
auto &Sym = Symbol::constructCommon(
|
||||
Allocator.Allocate<Symbol>(),
|
||||
createBlock(Section, Address, Size, Alignment, 0), Name, Size, S,
|
||||
createBlock(Section, Size, Address, Alignment, 0), Name, Size, S,
|
||||
IsLive);
|
||||
Section.addSymbol(Sym);
|
||||
return Sym;
|
||||
|
@ -313,7 +313,7 @@ Error MachOLinkGraphBuilder::graphifyRegularSymbols() {
|
||||
return make_error<JITLinkError>("Anonymous common symbol at index " +
|
||||
Twine(KV.first));
|
||||
NSym.GraphSymbol = &G->addCommonSymbol(
|
||||
*NSym.Name, NSym.S, getCommonSection(), NSym.Value, 0,
|
||||
*NSym.Name, NSym.S, getCommonSection(), 0, NSym.Value,
|
||||
1ull << MachO::GET_COMM_ALIGN(NSym.Desc),
|
||||
NSym.Desc & MachO::N_NO_DEAD_STRIP);
|
||||
} else {
|
||||
|
@ -4,6 +4,11 @@
|
||||
|
||||
.section __TEXT,__text,regular,pure_instructions
|
||||
|
||||
# Check that common symbols work.
|
||||
# jitlink-check: *{4}common_symbol = 0
|
||||
# jitlink-check: common_symbol[1:0] = 0
|
||||
.comm common_symbol,4,2
|
||||
|
||||
.align 4, 0x90
|
||||
Lanon_func:
|
||||
retq
|
||||
|
Loading…
Reference in New Issue
Block a user