Re: programme header

2013-03-18 Thread ishare
On Mon, Mar 18, 2013 at 03:02:02PM -0700, Ian Lance Taylor wrote:
 On Sun, Mar 17, 2013 at 1:54 AM, ishare june.tune@gmail.com wrote:
 
 
when product a .so liberary , if there is not a programme header in the 
  linker script file,
will the linker automaticlly generate a deault one for use  ?
 
 Yes.
 
If I write the programme header manully , need I write it before writing  
  section command ?
 
 No.

  I am linking my kernel by a link script. its contens is as below:
  
*

VSYSCALL_BASE = 0xe000;

SECTIONS
{
  . = VSYSCALL_BASE + SIZEOF_HEADERS;

  .hash   : { *(.hash) }:text
  .dynsym : { *(.dynsym) }
  .dynstr : { *(.dynstr) }
  .gnu.version: { *(.gnu.version) }
  .gnu.version_d  : { *(.gnu.version_d) }
  .gnu.version_r  : { *(.gnu.version_r) }

  /* This linker script is used both with -r and with -shared.
 For the layouts to match, we need to skip more than enough
 space for the dynamic symbol table et al.  If this amount
 is insufficient, ld -shared will barf.  Just increase it here.  */
  . = VSYSCALL_BASE + 0x400;

  .text   : { *(.text) }:text =0x90909090

  .eh_frame_hdr   : { *(.eh_frame_hdr) }:text :eh_frame_hdr
  .eh_frame   : { KEEP (*(.eh_frame)) } :text
  .dynamic: { *(.dynamic) } :text :dynamic
  .useless: {
  *(.got.plt) *(.got)
  *(.data .data.* .gnu.linkonce.d.*)
  *(.dynbss)
  *(.bss .bss.* .gnu.linkonce.b.*)
  } :text
}

PHDRS
{
  text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */
  dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  eh_frame_hdr 0x6474e550; /* PT_GNU_EH_FRAME, but ld doesn't match the name */
}

***

 I think it will work ,but ld report that No enough room for programme 
header,what is the reason?
 what should I do ?

 thanks!



 Ian

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: programme header

2013-03-18 Thread Valdis . Kletnieks
On Tue, 19 Mar 2013 09:38:49 +0800, ishare said:

   I am linking my kernel by a link script. its contens is as below:

  I think it will work ,but ld report that No enough room for programme 
 header,what is the reason?
  what should I do ?

The first thing you do is ask yourself why you're using a link script
of your own, when most architectures come with a working link script already.

The second thing you do is *read the script* - there's a big copmment in there:

  /* This linker script is used both with -r and with -shared.
 For the layouts to match, we need to skip more than enough
 space for the dynamic symbol table et al.  If this amount
 is insufficient, ld -shared will barf.  Just increase it here.  */

Hope that helps.


pgpNxO3hcuU3n.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: programme header

2013-03-18 Thread ishare
On Mon, Mar 18, 2013 at 10:41:45PM -0400, valdis.kletni...@vt.edu wrote:
 On Tue, 19 Mar 2013 09:38:49 +0800, ishare said:
 
I am linking my kernel by a link script. its contens is as below:
 
   I think it will work ,but ld report that No enough room for programme 
  header,what is the reason?
   what should I do ?
 
 The first thing you do is ask yourself why you're using a link script
 of your own, when most architectures come with a working link script already.
 
 The second thing you do is *read the script* - there's a big copmment in 
 there:
 
   /* This linker script is used both with -r and with -shared.
  For the layouts to match, we need to skip more than enough
  space for the dynamic symbol table et al.  If this amount
  is insufficient, ld -shared will barf.  Just increase it here.  */
   
  because I need to generate a .so for sysenter used 

  thanks!


 
 Hope that helps.



___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: programme header

2013-03-18 Thread Valdis . Kletnieks
On Tue, 19 Mar 2013 12:44:36 +0800, ishare said:

   because I need to generate a .so for sysenter used

And that solves what problem for you, exactly?

Consider that most architectures that use sysenter manage to do so
without having to worry about a .so for it (or if they really do need
one, they already create a .so).  So what problem are you trying to
solve by using a .so?


pgplXadb05EFh.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies