public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* [Slightly OT]  Need help with GNU ld
@ 2010-04-02  1:40 Ben Kamen
  2010-04-02  6:28 ` Christopher Faylor
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Kamen @ 2010-04-02  1:40 UTC (permalink / raw)
  To: cygwin

Hi all,

  I'm sort of lost as to where I might even start with this, and since this group is so fluent (I'm guessing) with GCC, I'm hoping someone here can either answer or point me to where I can go look.

(I'm looking on the gnu.org's gplusplus list and am not sure if that's a good source since it seems kind of dead)

Anyway - here's my problem.

I'm working on an embedded app that uses GCC for its compiler.

I have 2 pieces of code that share common library functions from libc.a like memcpy and strlen

Because the two pieces are a bootloader and the application, I would like the bootloader to be linked with a completely private set of functions which INCLUDEs the library calls they make.

This would duplicate those libc.a calls like memcpy() and strlen() inside the bootloader portion.

So my question is (and I might be looking in the wrong place to do this, but it seems like 'ld' would take care of it):

How do I tell the ld that for bootloader.o, all library references like memcpy() should be inlined/included with that function. I've got all the functions in the bootloader corralled into the memory space I want, but the functions called in libc.a are shared.

'static' only works for the immediate function while any calls to a libc.a function get shared with the main application.

I've already tried the forum for the micro-controller I'm using.. but apparently, it's new enough that I'm too far ahead on the curve for anyone else to help me. (even from the company)

Thanks in advance and sorry for bugging all of you here.. if I hear crickets, I'll try and keep digging elsewhere.

  -Ben


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: [Slightly OT]  Need help with GNU ld
  2010-04-02  1:40 [Slightly OT] Need help with GNU ld Ben Kamen
@ 2010-04-02  6:28 ` Christopher Faylor
  2010-04-02 14:06   ` Ben Kamen
  0 siblings, 1 reply; 4+ messages in thread
From: Christopher Faylor @ 2010-04-02  6:28 UTC (permalink / raw)
  To: cygwin

On Thu, Apr 01, 2010 at 08:40:30PM -0500, Ben Kamen wrote:
>I'm sort of lost as to where I might even start with this, and since
>this group is so fluent (I'm guessing) with GCC, I'm hoping someone
>here can either answer or point me to where I can go look.
>
>(I'm looking on the gnu.org's gplusplus list and am not sure if that's
>a good source since it seems kind of dead)
>
>Anyway - here's my problem.
>
>I'm working on an embedded app that uses GCC for its compiler.
>
>I have 2 pieces of code that share common library functions from libc.a
>like memcpy and strlen
>
>Because the two pieces are a bootloader and the application, I would
>like the bootloader to be linked with a completely private set of
>functions which INCLUDEs the library calls they make.
>
>This would duplicate those libc.a calls like memcpy() and strlen()
>inside the bootloader portion.
>
>So my question is (and I might be looking in the wrong place to do
>this, but it seems like 'ld' would take care of it):
>
>How do I tell the ld that for bootloader.o, all library references like
>memcpy() should be inlined/included with that function.  I've got all
>the functions in the bootloader corralled into the memory space I want,
>but the functions called in libc.a are shared.
>
>'static' only works for the immediate function while any calls to a
>libc.a function get shared with the main application.
>
>I've already tried the forum for the micro-controller I'm using..  but
>apparently, it's new enough that I'm too far ahead on the curve for
>anyone else to help me.  (even from the company)
>
>Thanks in advance and sorry for bugging all of you here..  if I hear
>crickets, I'll try and keep digging elsewhere.

This is more than slightly offtopic here.  It's completely offtopic.

Please find another forum.  Sorry.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: [Slightly OT]  Need help with GNU ld
  2010-04-02  6:28 ` Christopher Faylor
@ 2010-04-02 14:06   ` Ben Kamen
  2010-04-02 17:00     ` Dave Korn
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Kamen @ 2010-04-02 14:06 UTC (permalink / raw)
  To: cygwin

On 4/2/2010 1:20 AM, Christopher Faylor wrote:
>
> This is more than slightly offtopic here.  It's completely offtopic.
>
> Please find another forum.  Sorry.

Not really. I figured there could be a few here who are somewhat gcc saavy. Maybe I'd be lucky enough to find someone who could help me learn this... offlist.

Never hurts to ask?

Anyway - sorry to bother.

Moving along...

  -Ben

-- 
Ben Kamen - O.D.T., S.P.
======================================================================
Email: bkamen AT benjammin DOT net       Web: http://www.benjammin.net

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: [Slightly OT]  Need help with GNU ld
  2010-04-02 14:06   ` Ben Kamen
@ 2010-04-02 17:00     ` Dave Korn
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Korn @ 2010-04-02 17:00 UTC (permalink / raw)
  To: cygwin

On 02/04/2010 15:06, Ben Kamen wrote:
> On 4/2/2010 1:20 AM, Christopher Faylor wrote:
>>
>> This is more than slightly offtopic here.  It's completely offtopic.
>>
>> Please find another forum.  Sorry.
> 
> Not really. I figured there could be a few here who are somewhat gcc
> saavy. 

  From the title of your post, it sounds like you want help with GNU ld.  Try
the binutils list: see the foot of the page for subscribe/address/archive details:

  http://sourceware.org/binutils/

    cheers,
      DaveK

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

end of thread, other threads:[~2010-04-02 17:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-02  1:40 [Slightly OT] Need help with GNU ld Ben Kamen
2010-04-02  6:28 ` Christopher Faylor
2010-04-02 14:06   ` Ben Kamen
2010-04-02 17:00     ` Dave Korn

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).