Linux MIPS Architecture development
 help / color / mirror / Atom feed
* is there any docs/manuals for linker scripts symbols
@ 2003-06-24 10:00 ik
  2003-06-24 10:00 ` ik
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: ik @ 2003-06-24 10:00 UTC (permalink / raw)
  To: kernelnewbies, linux-mips

Hi All,

Is there any documentation for the symbols in the ld.script linker
scripts for the linux kernel. 

I'm porting Linux kernel to a mips board for which I need to understand
the various symbols used in the kernel.

For example what is the use of the following symbols
`__init_begin'
`__init_end'
`__initcall_start
`__initcall_end'
`_ftext'
`__setup_start'
`__setup_end'

I'm not good in these linker scripts... any help pointers would be of
great help to me ! (I'm referrring gnu ld  manual pages ... still have a
long way to go :(

Thanks in advance !
Indu

^ permalink raw reply	[flat|nested] 9+ messages in thread

* is there any docs/manuals for linker scripts symbols
  2003-06-24 10:00 is there any docs/manuals for linker scripts symbols ik
@ 2003-06-24 10:00 ` ik
  2003-06-24 12:00 ` Ralf Baechle
  2003-06-25  2:01 ` Fuxin Zhang
  2 siblings, 0 replies; 9+ messages in thread
From: ik @ 2003-06-24 10:00 UTC (permalink / raw)
  To: kernelnewbies, linux-mips

Hi All,

Is there any documentation for the symbols in the ld.script linker
scripts for the linux kernel. 

I'm porting Linux kernel to a mips board for which I need to understand
the various symbols used in the kernel.

For example what is the use of the following symbols
`__init_begin'
`__init_end'
`__initcall_start
`__initcall_end'
`_ftext'
`__setup_start'
`__setup_end'

I'm not good in these linker scripts... any help pointers would be of
great help to me ! (I'm referrring gnu ld  manual pages ... still have a
long way to go :(

Thanks in advance !
Indu

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: is there any docs/manuals for linker scripts symbols
  2003-06-24 10:00 is there any docs/manuals for linker scripts symbols ik
  2003-06-24 10:00 ` ik
@ 2003-06-24 12:00 ` Ralf Baechle
  2003-06-25 12:01   ` ik
  2003-06-25  2:01 ` Fuxin Zhang
  2 siblings, 1 reply; 9+ messages in thread
From: Ralf Baechle @ 2003-06-24 12:00 UTC (permalink / raw)
  To: ik; +Cc: kernelnewbies, linux-mips

On Tue, Jun 24, 2003 at 06:00:16AM -0400, ik@cyberspace.org wrote:

> I'm porting Linux kernel to a mips board for which I need to understand
> the various symbols used in the kernel.
> 
> For example what is the use of the following symbols
> `__init_begin'
> `__init_end'
> `__initcall_start
> `__initcall_end'
> `_ftext'
> `__setup_start'
> `__setup_end'
> 
> I'm not good in these linker scripts... any help pointers would be of
> great help to me ! (I'm referrring gnu ld  manual pages ... still have a
> long way to go :(

You'll find more information in the GNU info pages than in the man page
which is sort of an option summary only.  Of course both only cover ld,
not the way it's actually being used in Linux.

_ftext is the start of the executable kernel code.  __init_begin and
__init_end wrap the kernel's initialization code which will be freed after
full initialization.  See arch/mips/mm/init.c:__init_begin() and
arch/mips/mm/init.c:free_initmem() for how it's used.

__initcall_start and __initcall_end are used for the initcalls in
init/main.c.  See how those symbols are used in init/main.c:do_initcalls().
__setup_start and __setup_end are used in similarly obscure way to mark
start and end of the .setup.init section; see init/main.c:checksetup()
and <linux/init.h> for it's use.

  Ralf

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: is there any docs/manuals for linker scripts symbols
  2003-06-24 10:00 is there any docs/manuals for linker scripts symbols ik
  2003-06-24 10:00 ` ik
  2003-06-24 12:00 ` Ralf Baechle
@ 2003-06-25  2:01 ` Fuxin Zhang
  2 siblings, 0 replies; 9+ messages in thread
From: Fuxin Zhang @ 2003-06-25  2:01 UTC (permalink / raw)
  To: ik; +Cc: kernelnewbies, linux-mips

info ld give much more information than man ld.

for those symbols,you need to learn something about ELF file format
(its concept of sections)

ik@cyberspace.org wrote:

>Hi All,
>
>Is there any documentation for the symbols in the ld.script linker
>scripts for the linux kernel. 
>
>I'm porting Linux kernel to a mips board for which I need to understand
>the various symbols used in the kernel.
>
>For example what is the use of the following symbols
>`__init_begin'
>`__init_end'
>`__initcall_start
>`__initcall_end'
>`_ftext'
>`__setup_start'
>`__setup_end'
>
>I'm not good in these linker scripts... any help pointers would be of
>great help to me ! (I'm referrring gnu ld  manual pages ... still have a
>long way to go :(
>
>Thanks in advance !
>Indu
>
>
>
>
>  
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: is there any docs/manuals for linker scripts symbols
  2003-06-24 12:00 ` Ralf Baechle
@ 2003-06-25 12:01   ` ik
  2003-06-25 12:01     ` ik
  2003-06-25 12:18     ` Ralf Baechle
  0 siblings, 2 replies; 9+ messages in thread
From: ik @ 2003-06-25 12:01 UTC (permalink / raw)
  To: ralf; +Cc: linux-mips

Thanks Ralf for your insights !

My board has a boot loader (rom) that enforce/restricts the sections in
the elf header, hence I cannot use the default linker script that comes
wit the kernel(arch/mips/). 

I'm refereing the ld manual at
http://www.gnu.org/manual/ld-2.9.1/html_mono/ld.html

I think your reply could be put as a howto/faqs in
http://www.linux-mips.org (for the global symbols
used in linux kernel).

Thanks,
Indu

On Tue, 24 Jun 2003 ralf@linux-mips.org wrote:

> On Tue, Jun 24, 2003 at 06:00:16AM -0400, ik@cyberspace.org wrote:
> 
> > I'm porting Linux kernel to a mips board for which I need to understand
> > the various symbols used in the kernel.
> > 
> > For example what is the use of the following symbols
> > `__init_begin'
> > `__init_end'
> > `__initcall_start
> > `__initcall_end'
> > `_ftext'
> > `__setup_start'
> > `__setup_end'
> > 
> > I'm not good in these linker scripts... any help pointers would be of
> > great help to me ! (I'm referrring gnu ld  manual pages ... still have a
> > long way to go :(
> 
> You'll find more information in the GNU info pages than in the man page
> which is sort of an option summary only.  Of course both only cover ld,
> not the way it's actually being used in Linux.
> 
> _ftext is the start of the executable kernel code.  __init_begin and
> __init_end wrap the kernel's initialization code which will be freed after
> full initialization.  See arch/mips/mm/init.c:__init_begin() and
> arch/mips/mm/init.c:free_initmem() for how it's used.
> 
> __initcall_start and __initcall_end are used for the initcalls in
> init/main.c.  See how those symbols are used in init/main.c:do_initcalls().
> __setup_start and __setup_end are used in similarly obscure way to mark
> start and end of the .setup.init section; see init/main.c:checksetup()
> and <linux/init.h> for it's use.
> 
>   Ralf
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: is there any docs/manuals for linker scripts symbols
  2003-06-25 12:01   ` ik
@ 2003-06-25 12:01     ` ik
  2003-06-25 12:18     ` Ralf Baechle
  1 sibling, 0 replies; 9+ messages in thread
From: ik @ 2003-06-25 12:01 UTC (permalink / raw)
  To: ralf; +Cc: linux-mips

Thanks Ralf for your insights !

My board has a boot loader (rom) that enforce/restricts the sections in
the elf header, hence I cannot use the default linker script that comes
wit the kernel(arch/mips/). 

I'm refereing the ld manual at
http://www.gnu.org/manual/ld-2.9.1/html_mono/ld.html

I think your reply could be put as a howto/faqs in
http://www.linux-mips.org (for the global symbols
used in linux kernel).

Thanks,
Indu

On Tue, 24 Jun 2003 ralf@linux-mips.org wrote:

> On Tue, Jun 24, 2003 at 06:00:16AM -0400, ik@cyberspace.org wrote:
> 
> > I'm porting Linux kernel to a mips board for which I need to understand
> > the various symbols used in the kernel.
> > 
> > For example what is the use of the following symbols
> > `__init_begin'
> > `__init_end'
> > `__initcall_start
> > `__initcall_end'
> > `_ftext'
> > `__setup_start'
> > `__setup_end'
> > 
> > I'm not good in these linker scripts... any help pointers would be of
> > great help to me ! (I'm referrring gnu ld  manual pages ... still have a
> > long way to go :(
> 
> You'll find more information in the GNU info pages than in the man page
> which is sort of an option summary only.  Of course both only cover ld,
> not the way it's actually being used in Linux.
> 
> _ftext is the start of the executable kernel code.  __init_begin and
> __init_end wrap the kernel's initialization code which will be freed after
> full initialization.  See arch/mips/mm/init.c:__init_begin() and
> arch/mips/mm/init.c:free_initmem() for how it's used.
> 
> __initcall_start and __initcall_end are used for the initcalls in
> init/main.c.  See how those symbols are used in init/main.c:do_initcalls().
> __setup_start and __setup_end are used in similarly obscure way to mark
> start and end of the .setup.init section; see init/main.c:checksetup()
> and <linux/init.h> for it's use.
> 
>   Ralf
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: is there any docs/manuals for linker scripts symbols
  2003-06-25 12:01   ` ik
  2003-06-25 12:01     ` ik
@ 2003-06-25 12:18     ` Ralf Baechle
  2003-07-01 12:39       ` ik
  1 sibling, 1 reply; 9+ messages in thread
From: Ralf Baechle @ 2003-06-25 12:18 UTC (permalink / raw)
  To: ik; +Cc: linux-mips

On Wed, Jun 25, 2003 at 08:01:24AM -0400, ik@cyberspace.org wrote:

> My board has a boot loader (rom) that enforce/restricts the sections in
> the elf header, hence I cannot use the default linker script that comes
> wit the kernel(arch/mips/). 

Are you sure the loader actually looks at the sections?  That seems plain
wrong.  Normally a loader should only look at all the PT_LOAD entries in
the ELF program header table for loading.

> I think your reply could be put as a howto/faqs in
> http://www.linux-mips.org (for the global symbols
> used in linux kernel).

So many things that deserve some well written documentation - yet so little
exists ...

  Ralf

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: is there any docs/manuals for linker scripts symbols
  2003-06-25 12:18     ` Ralf Baechle
@ 2003-07-01 12:39       ` ik
  2003-07-01 12:39         ` ik
  0 siblings, 1 reply; 9+ messages in thread
From: ik @ 2003-07-01 12:39 UTC (permalink / raw)
  To: ralf; +Cc: linux-mips

Hi Ralf,

On Wed, 25 Jun 2003 ralf@linux-mips.org wrote:

> On Wed, Jun 25, 2003 at 08:01:24AM -0400, ik@cyberspace.org wrote:
> 
> > My board has a boot loader (rom) that enforce/restricts the sections in
> > the elf header, hence I cannot use the default linker script that comes
> > wit the kernel(arch/mips/). 
> 
> Are you sure the loader actually looks at the sections?  That seems plain
> wrong.  Normally a loader should only look at all the PT_LOAD entries in
> the ELF program header table for loading.

I use the device available in my company (which is proprietary), 
I know my point here would be abstract for u...sorry abt that !

Thanks for the reply !
Indu
> 
> > I think your reply could be put as a howto/faqs in
> > http://www.linux-mips.org (for the global symbols
> > used in linux kernel).
> 
> So many things that deserve some well written documentation - yet so little
> exists ...
> 
>   Ralf
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: is there any docs/manuals for linker scripts symbols
  2003-07-01 12:39       ` ik
@ 2003-07-01 12:39         ` ik
  0 siblings, 0 replies; 9+ messages in thread
From: ik @ 2003-07-01 12:39 UTC (permalink / raw)
  To: ralf; +Cc: linux-mips

Hi Ralf,

On Wed, 25 Jun 2003 ralf@linux-mips.org wrote:

> On Wed, Jun 25, 2003 at 08:01:24AM -0400, ik@cyberspace.org wrote:
> 
> > My board has a boot loader (rom) that enforce/restricts the sections in
> > the elf header, hence I cannot use the default linker script that comes
> > wit the kernel(arch/mips/). 
> 
> Are you sure the loader actually looks at the sections?  That seems plain
> wrong.  Normally a loader should only look at all the PT_LOAD entries in
> the ELF program header table for loading.

I use the device available in my company (which is proprietary), 
I know my point here would be abstract for u...sorry abt that !

Thanks for the reply !
Indu
> 
> > I think your reply could be put as a howto/faqs in
> > http://www.linux-mips.org (for the global symbols
> > used in linux kernel).
> 
> So many things that deserve some well written documentation - yet so little
> exists ...
> 
>   Ralf
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-07-01 12:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-24 10:00 is there any docs/manuals for linker scripts symbols ik
2003-06-24 10:00 ` ik
2003-06-24 12:00 ` Ralf Baechle
2003-06-25 12:01   ` ik
2003-06-25 12:01     ` ik
2003-06-25 12:18     ` Ralf Baechle
2003-07-01 12:39       ` ik
2003-07-01 12:39         ` ik
2003-06-25  2:01 ` Fuxin Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox