public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* compile question
@ 2013-01-06  5:26 horseriver
  2013-01-06  9:28 ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: horseriver @ 2013-01-06  5:26 UTC (permalink / raw)
  To: gcc-help

hi:

  when I use gcc compiling a .c file to a .o file , will it call  ld to  do some link work ?

  
thanks!

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

* Re: compile question
  2013-01-06  5:26 compile question horseriver
@ 2013-01-06  9:28 ` Ian Lance Taylor
       [not found]   ` <20130106010523.GA2459@debian.localdomain>
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Lance Taylor @ 2013-01-06  9:28 UTC (permalink / raw)
  To: horseriver; +Cc: gcc-help

On Sat, Jan 5, 2013 at 11:18 AM, horseriver <horserivers@gmail.com> wrote:
>
>   when I use gcc compiling a .c file to a .o file , will it call  ld to  do some link work ?

If you run "gcc -o foo.o -c foo.c", or simply "gcc -c foo.c", it will
not run ld.

You can see all the subprograms that gcc runs by using the -v option.

Ian

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

* Re: compile question
       [not found]     ` <CAKOQZ8yCsOYqLFgy=TotwsZ7VTS-SefE9pK48+5C77ctqCumeQ@mail.gmail.com>
@ 2013-01-07 14:28       ` horseriver
  2013-01-07 21:33         ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: horseriver @ 2013-01-07 14:28 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

On Sun, Jan 06, 2013 at 10:18:23AM -0800, Ian Lance Taylor wrote:
> On Sat, Jan 5, 2013 at 5:05 PM, horseriver <horserivers@gmail.com> wrote:
> > On Sat, Jan 05, 2013 at 09:26:08PM -0800, Ian Lance Taylor wrote:
> >> On Sat, Jan 5, 2013 at 11:18 AM, horseriver <horserivers@gmail.com> wrote:
> >> >
> >> >   when I use gcc compiling a .c file to a .o file , will it call  ld to  do some link work ?
> >>
> >> If you run "gcc -o foo.o -c foo.c", or simply "gcc -c foo.c", it will
> >> not run ld.
> >
> > thanks!
> >
> > If the object flie is .so ,will ld be called by gcc ?
> >
> > I am trying to compile linux kernel , in arch/i386/kernel ,
> >   kbuild  need to build a vsyscall_int80.so , but it give this error :
> >
> >   ld: arch/i386/kernel/vsyscall-int80.so: Not enough room for program headers
> >
> > how to do for this issure ?
> 
> 
> Please reply to the mailing list, not just to me.  Thanks.
> 
> 
> The name of the result is irrelevant to how the gcc driver behaves.  A
> file named .so is usually a shared library; to create a shared
> library, pass the option -shared to the gcc driver.
> 
> I don't know what is wrong with your build of the Linux kernel.  That
> kind of problem normally indicates a discrepancy between the linker
> script and the specific linker that you are using.  It can also mean
> that the compiler is generating sections that the linker script does
> not expect.

thanks!

how can I get to know which ld-script files are used by ld when build this .so file ?

I think this would help .
> 
> Ian

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

* Re: compile question
  2013-01-07 14:28       ` horseriver
@ 2013-01-07 21:33         ` Ian Lance Taylor
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 2013-01-07 21:33 UTC (permalink / raw)
  To: horseriver; +Cc: gcc-help

On Sun, Jan 6, 2013 at 8:07 AM, horseriver <horserivers@gmail.com> wrote:
>> >
>> > I am trying to compile linux kernel , in arch/i386/kernel ,
>> >   kbuild  need to build a vsyscall_int80.so , but it give this error :
>> >
>> >   ld: arch/i386/kernel/vsyscall-int80.so: Not enough room for program headers
>>
>> I don't know what is wrong with your build of the Linux kernel.  That
>> kind of problem normally indicates a discrepancy between the linker
>> script and the specific linker that you are using.  It can also mean
>> that the compiler is generating sections that the linker script does
>> not expect.
>
> thanks!
>
> how can I get to know which ld-script files are used by ld when build this .so file ?

This is a question about the Linux kernel build.  I think if you run
"make V=1" or something like that you will see the exact comment being
used to invoke the linker.  The linker script will probably be passed
as a -T option.

Ian

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

end of thread, other threads:[~2013-01-07 21:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-06  5:26 compile question horseriver
2013-01-06  9:28 ` Ian Lance Taylor
     [not found]   ` <20130106010523.GA2459@debian.localdomain>
     [not found]     ` <CAKOQZ8yCsOYqLFgy=TotwsZ7VTS-SefE9pK48+5C77ctqCumeQ@mail.gmail.com>
2013-01-07 14:28       ` horseriver
2013-01-07 21:33         ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).