This is the mail archive of the mailing list for the elfutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/5] Use -fPIC instead of -fpic when generating PIC code.

    >     > This avoids relocation overflows in sparc/sparc64 targets while
    >     > linking,  where the reachable data using -fpic is only 4kb.
    >     I think this is OK. -fpic/-fPIC only changes things on m68k, PowerPC
    >     and SPARC.  So the only other arch we currently support that this
    >     might impact is powerpc. Is there any disadvantage on that platform
    >     of using -fPIC instead of -fpic?
    > I am not sure of the details in powerpc, but in RISC architectures with
    > fixed-width 32-bit instructions using -fPIC usually translates into
    > larger text sections, as it requires using more instructions to handle
    > the GOT table offsets when compared with -fpic.
    > For example, in SPARC -fPIC uses three instructions for each GOT
    > reference, while -fpic uses just one instruction.
    OK, so this only is an actual change for some 32bit architectures?

No.  Both ppc64 and sparc64 use 32-bit instructions even if they are
64-bit arches.

    In that case I think it is fine to use -fPIC everywhere. Then only
    sparc32 and ppc32 will see an actual change in code generated. Unless
    someone sees a problem with that.

If the change bothers the ppc folks we can always discriminate by
host_cpu in and subst a $(PIC_FLAG) accordingly...

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