[patch] Hide the stub created for MO_ExternalSymbol too.

David Fang fang at csl.cornell.edu
Wed Dec 4 14:54:09 PST 2013


Hi all,
 	I tested the patch on my powerpc-darwin8 branch.

With the following test case, I cross-compiled 
--target=i686-apple-darwin8 -no-integrated-as -save-temps:

struct foo { int x[500]; };
int main(void) { struct foo bar, bq; bq = bar; return 0; }

which emits a memcpy.

Before the patch, I was getting:
         .section        __IMPORT,__jump_table,symbol_stubs,pure_instructions+self_modifying_code,5
_memcpy$stub:
         .indirect_symbol        _memcpy
         .ascii  "\364\364\364\364\364"

after patch, I now get:
         .section        __IMPORT,__jump_table,symbol_stubs,pure_instructions+self_modifying_code,5
L_memcpy$stub:
         .indirect_symbol        _memcpy
         .ascii  "\364\364\364\364\364"

This looks fixed to me.  Is there any other testing I can help with?
Thanks for helping me keep darwin8 alive.

David

> On 2 December 2013 15:59, Nick Kledzik <kledzik at apple.com> wrote:
>> 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?
>
> My system doesn't need them, but it looks like clang still produces
> them on X86 for OS X < 10.5 :
>
> if (Subtarget->isPICStyleStubAny() &&
>               (!Subtarget->getTargetTriple().isMacOSX() ||
>                Subtarget->getTargetTriple().isMacOSXVersionLT(10, 5))) {
>      // PC-relative references to external symbols should go through $stub,
>      // unless we're building with the leopard linker or later, which
>      // automatically synthesizes these stubs.
>      OpFlags = X86II::MO_DARWIN_STUB;
>
> Cheers,
> Rafael
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>

-- 
David Fang
http://www.csl.cornell.edu/~fang/




More information about the llvm-commits mailing list