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

Nick Kledzik kledzik at apple.com
Mon Apr 11 09:42:04 PDT 2011


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




More information about the llvm-dev mailing list