* programme header
[not found] ` <CAKOQZ8xhEagntf7BXM9A7kU0b9zyEbHtc2dv2gDkKAGUuUCc9w@mail.gmail.com>
@ 2013-03-19 1:38 ` ishare
2013-03-19 2:41 ` Valdis.Kletnieks at vt.edu
0 siblings, 1 reply; 4+ messages in thread
From: ishare @ 2013-03-19 1:38 UTC (permalink / raw)
To: kernelnewbies
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.sea@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 = 0xffffe000;
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* programme header
2013-03-19 1:38 ` programme header ishare
@ 2013-03-19 2:41 ` Valdis.Kletnieks at vt.edu
2013-03-19 4:44 ` ishare
0 siblings, 1 reply; 4+ messages in thread
From: Valdis.Kletnieks at vt.edu @ 2013-03-19 2:41 UTC (permalink / raw)
To: kernelnewbies
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 865 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130318/f98835e3/attachment.bin
^ permalink raw reply [flat|nested] 4+ messages in thread
* programme header
2013-03-19 2:41 ` Valdis.Kletnieks at vt.edu
@ 2013-03-19 4:44 ` ishare
2013-03-19 5:14 ` Valdis.Kletnieks at vt.edu
0 siblings, 1 reply; 4+ messages in thread
From: ishare @ 2013-03-19 4:44 UTC (permalink / raw)
To: kernelnewbies
On Mon, Mar 18, 2013 at 10:41:45PM -0400, Valdis.Kletnieks at 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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* programme header
2013-03-19 4:44 ` ishare
@ 2013-03-19 5:14 ` Valdis.Kletnieks at vt.edu
0 siblings, 0 replies; 4+ messages in thread
From: Valdis.Kletnieks at vt.edu @ 2013-03-19 5:14 UTC (permalink / raw)
To: kernelnewbies
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?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 865 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130319/25802d77/attachment.bin
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-03-19 5:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20130317085400.GA5176@debian.localdomain>
[not found] ` <CAKOQZ8xhEagntf7BXM9A7kU0b9zyEbHtc2dv2gDkKAGUuUCc9w@mail.gmail.com>
2013-03-19 1:38 ` programme header ishare
2013-03-19 2:41 ` Valdis.Kletnieks at vt.edu
2013-03-19 4:44 ` ishare
2013-03-19 5:14 ` Valdis.Kletnieks at vt.edu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.