[patch] Hide the stub created for MO_ExternalSymbol too.

Nick Kledzik kledzik at apple.com
Mon Dec 2 12:59:03 PST 2013


Rafael,

Mach-O has not needed stubs in object files for many years.  The Apple released clang does not generate stubs.  Perhaps you have some odd configuration that still produces stubs?

-Nick

On Nov 28, 2013, at 12:40 PM, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:
> I noticed that given
> 
> declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1)
> declare void @foo()
> define void @bar() {
>  call void @foo()
>  call void @llvm.memset.p0i8.i32(i8* null, i8 0, i32 188, i32 1, i1 false)
>  ret void
> }
> 
> We produce for 32 bit mach-o:
> 
> L_foo$stub:
>        .indirect_symbol        _foo
>        .ascii  "\364\364\364\364\364"
> 
> _memset$stub:
>        .indirect_symbol        _memset
>        .ascii  "\364\364\364\364\364"
> 
> I.E., for foo we hide the stub, but for memset we do not. This is
> almost certainly a bug since from the linker perspective it shouldn't
> matter if the undefined reference was created in LLVM's codegen or
> not.
> 
> The attached patch fixes it.
> 
> Cheers,
> Rafael
> <t.patch>





More information about the llvm-commits mailing list