[llvm-commits] patch: teach deadargelim to work on externally visible functions!

Rafael Espindola espindola at google.com
Mon Jan 11 10:06:05 PST 2010


> Right, we shouldn't change the ELF visibility, however we could avoid
> emitting the @PLT for in-module calls (Dan says in another mail that it
> wouldn't
> affect function pointer compares).

It is probably a good option to have, but I am not sure it fully
captures the semantics of protected. Consider

--------------------------------
typedef void (*h)(void);

void __attribute__((visibility ("protected"))) g(void);
void f(void) {
   h p = g;
   p();
}
-----------------------------

If the p=g assignment uses the PLT entry, the p() function call will
be overwritten at runtime. Not sure how gcc avoids this.

> Best regards,
> --Edwin
>
>

Cheers,
-- 
Rafael Ávila de Espíndola




More information about the llvm-commits mailing list