tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] [PATCH] TCC arm64 back end


From: Thomas Preud'homme
Subject: Re: [Tinycc-devel] [PATCH] TCC arm64 back end
Date: Wed, 15 Apr 2015 23:27:24 +0800
User-agent: KMail/4.14.1 (Linux/3.16.0-4-amd64; KDE/4.14.2; x86_64; ; )

Le mardi 14 avril 2015, 15:46:28 Michael Matz a écrit :
> Hi,

Hi Michael,

> >
> > Nope. Try it for yourself:
> Huh, indeed.  IMHO that's inconsistent with the symbol resolution
> behaviour of GNU ld (only looking in level0 libs for symbols, not in those
> DT_NEEDED by them, unless --copy-dt-needed-entries is active), but so be
> it.

I did the test with gcc so I was describing ld's behavior. Ld will export
everything that solve an exported symbol in any library. Note that I'm only
talking about what symbols are exported in the program, not what DT_NEEDED are
added. DT_NEEDED are added based on -lfoo specified on the command line, even
if no symbol is used as shown with the following setup:

% cat foo.c
int
foo (void)
{
  return 0;
}


% cat main.c
int
main (void)
{
  return 0;
}

Compile foo.c as libfoo.so and make main with main.c and -lfoo and you'll see
a DT_NEEDED added. If libfoo.so were to depend on another library this is not
added to the program (only library explicitely linked are added). I believe
that's what tcc does, but I didn't check.

>
> > Thanks for teaching me, I really appreciate. It seems that despite what
> > you told, you understand tcc's linker at least as well as me. Anyway, if
> > you don't mind I'd still like to be the one to improve its organisation.
> > I'll appreciate any review of my changes though.

Got a patch and would appreciate some feedback. Only tested on x86-64 so far
[1] so I would also appreciate testing on other targets (even i386).

[1] I know it's a shame, but my desktop machine is (still) an x86_64 so it's
easier to test this one. I'll give it a try on my AC100 (ARMv7-a) later in the
week but I'm hoping Christian and/or Edmund can give the patch a try.

Best regards,

Thomas

Attachment: library_symbol_resolved_by_prog.diff
Description: Text Data

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]