This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: objc handle_class_ref correction for powerpc -mrelocatable


Stan Shebs <shebs@apple.com> writes:

> Geoffrey Keating wrote:
> > 
> > +  /* Make a decl for the address.  */
> > +  sprintf (string, "%sobjc_class_ref_%s",
> > +          (flag_next_runtime ? "." : "__"), name);
> 
> Overall the change looks sensible (thanks!), but I'm not clear on
> why you need to do a second sprintf into the string.  Can't you just
> call get_identifier a second time using the same string?

You'd get incorrect assembler; the code is creating a new variable
which is initialised by the ADDR_EXPR.

        .section        ".data"
        .align 2
        .type   __objc_class_ref_Object,@object
        .size   __objc_class_ref_Object,4
__objc_class_ref_Object:
        .long __objc_class_name_Object

-- 
- Geoffrey Keating <geoffk@geoffk.org>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]