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: Various changes for PIC code on ARM...


Richard Earnshaw wrote:
> 
> > Good day,
> >
> > The following patches are Corel's changes to get PIC code generation for ELF on
> > ARMLinux.  These should be used with patches submitted earlier by Phil Blundell.
> >
> > Scott
> >
> > 1999-02-16  Scott Bambrough <scottb@corelcomputer.com>
> >
> >         * gcc/config/arm/arm.c: Various changes for PIC code generation.
> > Modified
> >         generated calls to abort to be PLT based if PIC compilation.
> >
> >         * gcc/config/arm/arm.h: Added SYMBOL_REF_LOCAL.  Needed to distinguish
> >         between cases which require GOT or GOTOFF relocs.  Modified macro
> >         OUTPUT_INST_ADDR_CONST to use GOT and GOTOFF relocs during PIC
> > compilation.
> >
> >         * gcc/config/arm/arm.md: Added wrapper around constant pool generation
> >         (bMakingConstTable).  Need to know, in order to generate GOT or GOTOFF
> >         references to the data.  Other changes to generate PLT based calls to
> >         symbols when compiling PIC code.
> 
> Your changes as given will break PIC support on other platforms which
> don't use this "(PLT)" stuff.  If marking symbols with PLT is really
> necessary, then it needs to be made conditional on compiling for Linux.
> My personal opinion is that this can all be handled in the assembler
> without needing to hack the compiler output in this manner -- NetBSD
> manages this OK, so why does the Linux port need it?

My changes are modelled after the way the i386 guys did their PIC support.  It
seemed like the best way at the time, as they seemed to be driving the
compiler/assembler/linker forward.  How do the NetBSD guys mark a branch as
having to go through the PLT, or whether something needs a GOT or GOTOFF reloc?

Scott


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