[LLVMdev] gcroot + `section not found for addresss ...' ???

Duncan Sands baldrick at free.fr
Mon Apr 11 23:27:29 PDT 2011


Hi Bill,

> However, there isn't a personality function associated here. This conflicts with the fact that there's an LSDA associated with the function. It's not really feasible that there would be an LSDA but no personality function.

GCC recently added support for this, i.e. a situation in which there are only
cleanups to be run: it uses the C personality function even if the language
being compiled is not C.

> I don't know enough about GC stuff to say what should happen here. Though it looks like we at least need the gc_cleanup to generate an llvm.eh.selector call at the very least...The question becomes which personality function it should call, because that's language-specific.

One reason I added lowering for "unwind" in DwarfEHPrepare was to help handle
this situation: an invoke followed by some cleanup code followed by unwind.  I
had GC lowering in mind.  I think the only thing missing is having the code
generators use the C personality function by default if there is no personality
function, but as I didn't work on this for a while I don't recall exactly how
far I got.

Ciao, Duncan.


>
> -bw
>
> On Apr 11, 2011, at 9:42 AM, Nick Kledzik wrote:
>
>> The linker is going off in the weeds trying to parse the dwarf unwind info.   The CIE has:
>>
>>
>> Leh_frame_common_begin0:
>> 	.long	0                       ## CIE Identifier Tag
>> 	.byte	1                       ## DW_CIE_VERSION
>> 	.asciz	 "zLR"                  ## CIE Augmentation
>> 	.byte	1                       ## CIE Code Alignment Factor
>> 	.byte	120                     ## CIE Data Alignment Factor
>> 	.byte	16                      ## CIE Return Address Column
>> 	.byte	2                       ## Augmentation Size
>> 	.byte	16                      ## LSDA Encoding = pcrel
>> 	.byte	16                      ## FDE Encoding = pcrel
>>
>>
>> But the FDE has:
>>
>> 	.byte	 0                       ## Augmentation size
>>
>> The linker is expecting that since the CIE said there was an LSDA in each FDE that is pcrel encoded, that there would in fact be an LSDA in each FDE.  But in this case, the compiler is trying to omit the LSDA by marking that the FDE has a zero sized augmentation data.
>>
>> I'll have to research if this is a valid dwarf unwind optimization.  Even if it is, it is tripping up the existing linker.
>>
>> -Nick
>>
>>
>> On Apr 10, 2011, at 6:06 AM, Nicolas Ojeda Bar wrote:
>>> Hi,
>>>
>>> If I type
>>>
>>> define i32 @main() gc "shadow-stack" {
>>> entry:
>>> %0 = alloca i8*
>>> %1 = call i8* @malloc(i64 1)
>>> store i8* %1, i8** %0
>>> call void @llvm.gcroot(i8** %0, i8* null)
>>> ret i32 0
>>> }
>>>
>>> declare i8* @malloc(i64)
>>>
>>> declare void @llvm.gcroot(i8**, i8*) nounwind
>>>
>>> in test.ll
>>>
>>> and then do
>>>
>>>> llc test.ll
>>>> gcc test.s
>>>
>>> I get the error
>>>
>>> ld: in /var/folders/Ea/EakEx6b+GBSo6cUn2AnFZk+++TI/-Tmp-//cc5d3RCx.o, section not found for address 0x64200E00000004CD
>>>
>>> If I remove line containing malloc and the line after that, no such error happens. If I remove
>>> the gcroot line then no such error happens.
>>>
>>> Any hints as to what this error means would be great!
>>>
>>> Cheers,
>>> N
>>> _______________________________________________
>>> LLVM Developers mailing list
>>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list