This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


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

Re: .init/.text/.fini vs. .text/.init/.fini


> Mail-Followup-To: binutils@sourceware.cygnus.com,
>   geoffk@cygnus.com
> Date: 13 Apr 2000 17:33:48 -0700
> From: Ian Lance Taylor <ian@zembu.com>
> CC: binutils@sourceware.cygnus.com
> 
>    Date: Thu, 13 Apr 2000 16:45:33 -0700
>    From: Geoff Keating <geoffk@cygnus.com>
> 
>    If the .init section is before .text, then when users write
>    (say) -Ttext=0x70000000, they discover to their surprise that
> 
> -Ttext simply doesn't work very well with ELF.  Nor do -Tdata and
> -Tbss, for that matter.  Those options are really only useful with
> a.out or some such system.  Your patch makes a few more things work,
> but it doesn't fix the general problem.
> 
> If you have some specific important case which is solved by this
> patch, then it may be OK.  It's hard to be certain, since some code
> may currently rely on putting their start address in the .init
> section.  If you are trying to fix something you happened across, then
> I would prefer that people simply use a linker script.

The problem I noticed was that GCC for powerpc-eabi* passes -Ttext on
MVME, for the simulator, and for Solaris, because apparently these all
like different start addresses to the default (of course, all the
addresses are different).  

I'm happy to change these---I think the right thing to do is to change
the start address for elf32ppc linker script to be right for SVR4,
make a ldscript for the sim, and remove the option for Solaris (since
Solaris should support SVR4 binaries)---but it involves changing GCC
and binutils simultaneously.  This is no problem for cygnus (we have
one unified GCC and binutils tree, and we don't make separate
releases) but a little inconvenient for someone trying to use FSF releases.

The proposed alternative change, then, is to add this as elf32ppcsim.sh:

TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-powerpc"
TEXT_START_ADDR=0x10000000
MAXPAGESIZE=0x10000
ARCH=powerpc
MACHINE=
BSS_PLT=
EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);'
OTHER_BSS_END_SYMBOLS='__end = .;'
OTHER_READONLY_SECTIONS='
  .fixup	: { *(.fixup) }
'
OTHER_READWRITE_SECTIONS='
  .got1		: { *(.got1) }
  .got2		: { *(.got2) }
'

and add it into configure.tgt.  Does that sound OK?

-- 
- Geoffrey Keating <geoffk@cygnus.com>

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