public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [GOLD] How can I add a undefined symbol in target implementation, not by "-u SYM" from command line ?
@ 2012-08-13 10:51 Jiong WANG
  2012-08-13 14:11 ` Jiong WANG
  2012-08-13 15:39 ` Ian Lance Taylor
  0 siblings, 2 replies; 11+ messages in thread
From: Jiong WANG @ 2012-08-13 10:51 UTC (permalink / raw)
  To: binutils; +Cc: Ian Lance Taylor

Hi All,

  How can I predefine a undefined symbol in target implementation?

  actually, I am porting gold for tilegx, and our arch's tls
implementation requires predefiniation of "_tls_get_addr" because the
assembler generate relocation which use this symbol implicitly.

   I know there are interfaces,  "define_in_output_data/segment" to
predefined symbol with value, but there is no interface to predefine
"undefined" symbol ?

   gold linker do support this by command line "-u SYMBOL",  but it's
a compile time decision not link time.

   currently, I managed to support this by the following ugly code:

    options::parse_set(NULL, "_tls_get_addr",
(gold::options::String_set*)&parameters->options().undefined());

   which is bad, so, could anyone give me some suggestion on this?

   thanks very much

---
Regards,
WANG.Jiong

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

* Re: [GOLD] How can I add a undefined symbol in target implementation, not by "-u SYM" from command line ?
  2012-08-13 10:51 [GOLD] How can I add a undefined symbol in target implementation, not by "-u SYM" from command line ? Jiong WANG
@ 2012-08-13 14:11 ` Jiong WANG
  2012-08-13 15:39 ` Ian Lance Taylor
  1 sibling, 0 replies; 11+ messages in thread
From: Jiong WANG @ 2012-08-13 14:11 UTC (permalink / raw)
  To: binutils; +Cc: Ian Lance Taylor

2012/8/13 Jiong WANG <wong.kwongyuan@gmail.com>:
> Hi All,
>
>   How can I predefine a undefined symbol in target implementation?
>
>   actually, I am porting gold for tilegx, and our arch's tls
> implementation requires predefiniation of "_tls_get_addr" because the
> assembler generate relocation which use this symbol implicitly.
>
>    I know there are interfaces,  "define_in_output_data/segment" to
> predefined symbol with value, but there is no interface to predefine
> "undefined" symbol ?
>
>    gold linker do support this by command line "-u SYMBOL",  but it's
> a compile time decision not link time.
>
>    currently, I managed to support this by the following ugly code:
>
>     options::parse_set(NULL, "_tls_get_addr",
> (gold::options::String_set*)&parameters->options().undefined());
>
>    which is bad, so, could anyone give me some suggestion on this?


and it seems there is another problem:

  the symbol "_tls_get_addr" should get a dynamic sym index in
.dynsym,  but it not, just because it's added by the way of "-u XXX"

  I suspect this is caused by gold linker generate .dynsym in a
relatively early stage, just after it analyze all relocations and
symtabs from .o files, so that if there are some other symbols added
in the middle of linking stage, and some other relocations generated
against them for dynamic linking,  gold linker's .dynsym table does
not updated.

  Is this right?  and how could we solve this problem?

  thanks very much.

---
Regards,
WANG.Jiong


>
>    thanks very much
>
> ---
> Regards,
> WANG.Jiong

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

* Re: [GOLD] How can I add a undefined symbol in target implementation, not by "-u SYM" from command line ?
  2012-08-13 10:51 [GOLD] How can I add a undefined symbol in target implementation, not by "-u SYM" from command line ? Jiong WANG
  2012-08-13 14:11 ` Jiong WANG
@ 2012-08-13 15:39 ` Ian Lance Taylor
  2012-08-14  3:39   ` Jiong WANG
  1 sibling, 1 reply; 11+ messages in thread
From: Ian Lance Taylor @ 2012-08-13 15:39 UTC (permalink / raw)
  To: Jiong WANG; +Cc: binutils

On Mon, Aug 13, 2012 at 3:25 AM, Jiong WANG <wong.kwongyuan@gmail.com> wrote:
>
>   How can I predefine a undefined symbol in target implementation?
>
>   actually, I am porting gold for tilegx, and our arch's tls
> implementation requires predefiniation of "_tls_get_addr" because the
> assembler generate relocation which use this symbol implicitly.
>
>    I know there are interfaces,  "define_in_output_data/segment" to
> predefined symbol with value, but there is no interface to predefine
> "undefined" symbol ?
>
>    gold linker do support this by command line "-u SYMBOL",  but it's
> a compile time decision not link time.
>
>    currently, I managed to support this by the following ugly code:
>
>     options::parse_set(NULL, "_tls_get_addr",
> (gold::options::String_set*)&parameters->options().undefined());
>
>    which is bad, so, could anyone give me some suggestion on this?


I assume that the symbol is defined somewhere.  You probably want to
add a do_is_defined_by_abi method to your Target.  See the examples in
existing targets.

Ian

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

* Re: [GOLD] How can I add a undefined symbol in target implementation, not by "-u SYM" from command line ?
  2012-08-13 15:39 ` Ian Lance Taylor
@ 2012-08-14  3:39   ` Jiong WANG
  2012-08-14  4:54     ` Ian Lance Taylor
  0 siblings, 1 reply; 11+ messages in thread
From: Jiong WANG @ 2012-08-14  3:39 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: binutils

2012/8/13 Ian Lance Taylor <iant@google.com>:
> On Mon, Aug 13, 2012 at 3:25 AM, Jiong WANG <wong.kwongyuan@gmail.com> wrote:
>>
>>   How can I predefine a undefined symbol in target implementation?
>>
>>   actually, I am porting gold for tilegx, and our arch's tls
>> implementation requires predefiniation of "_tls_get_addr" because the
>> assembler generate relocation which use this symbol implicitly.
>>
>>    I know there are interfaces,  "define_in_output_data/segment" to
>> predefined symbol with value, but there is no interface to predefine
>> "undefined" symbol ?
>>
>>    gold linker do support this by command line "-u SYMBOL",  but it's
>> a compile time decision not link time.
>>
>>    currently, I managed to support this by the following ugly code:
>>
>>     options::parse_set(NULL, "_tls_get_addr",
>> (gold::options::String_set*)&parameters->options().undefined());
>>
>>    which is bad, so, could anyone give me some suggestion on this?
>
>
> I assume that the symbol is defined somewhere.  You probably want to
> add a do_is_defined_by_abi method to your Target.  See the examples in
> existing targets.

Hi Ian & all, thanks for your suggestion.

I have explored do_is_defined_by_abi, and found it's mostly to avoid
warning, but not for creating such a symbol

do_is_defined_by_abi has one argument of the type "const Symbol*",  so
when it's invoked, that symbol should already existed.

below is my ugly code to create a external symbol which is not from
any object files, but pretend to be

case elfcpp::R_TILEGX_TLS_GD_CALL:

    // FIXME:
    // ugly code to predefine _tls_get_addr
    // should be fixed later
    if (!target->tls_get_addr_sym_defined_) {
      Symbol* sym = NULL;
      options::parse_set(NULL, "__tls_get_addr",
(gold::options::String_set*)&parameters->options().undefined());
      symtab->add_undefined_symbols_from_command_line(layout);
      target->tls_get_addr_sym_defined_ = true;
      sym = symtab->lookup("__tls_get_addr");
      sym->set_in_reg();
    }
    target->make_plt_entry(symtab, layout, symtab->lookup("__tls_get_addr"));
    break;

  basically, I want to create a symbol which is neither against
section or segment, just a normally external function symbol.

  above code works when use gcc driver to invoke gold, because libc.so
are involved in.

  but it still failed, when use gold directly by:

      tile-ld -shared -o libtls.so tls.o
      tile-ld: internal error in get_symbol_index, at
../binutils/gold/output.cc:1031

  I think there maybe some other graceful and standard way to solve
this problem.

  please feel free to give any suggestion

  thanks very much !

---
Regards,
WANG.Jiong

>
> Ian

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

* Re: [GOLD] How can I add a undefined symbol in target implementation, not by "-u SYM" from command line ?
  2012-08-14  3:39   ` Jiong WANG
@ 2012-08-14  4:54     ` Ian Lance Taylor
  2012-08-14  5:26       ` WANG.Jiong
  0 siblings, 1 reply; 11+ messages in thread
From: Ian Lance Taylor @ 2012-08-14  4:54 UTC (permalink / raw)
  To: Jiong WANG; +Cc: binutils

On Mon, Aug 13, 2012 at 8:30 PM, Jiong WANG <wong.kwongyuan@gmail.com> wrote:
> 2012/8/13 Ian Lance Taylor <iant@google.com>:
>> On Mon, Aug 13, 2012 at 3:25 AM, Jiong WANG <wong.kwongyuan@gmail.com> wrote:
>>>
>>>   How can I predefine a undefined symbol in target implementation?
>>>
>>>   actually, I am porting gold for tilegx, and our arch's tls
>>> implementation requires predefiniation of "_tls_get_addr" because the
>>> assembler generate relocation which use this symbol implicitly.
>>>
>>>    I know there are interfaces,  "define_in_output_data/segment" to
>>> predefined symbol with value, but there is no interface to predefine
>>> "undefined" symbol ?
>>>
>>>    gold linker do support this by command line "-u SYMBOL",  but it's
>>> a compile time decision not link time.
>>>
>>>    currently, I managed to support this by the following ugly code:
>>>
>>>     options::parse_set(NULL, "_tls_get_addr",
>>> (gold::options::String_set*)&parameters->options().undefined());
>>>
>>>    which is bad, so, could anyone give me some suggestion on this?
>>
>>
>> I assume that the symbol is defined somewhere.  You probably want to
>> add a do_is_defined_by_abi method to your Target.  See the examples in
>> existing targets.
>
> Hi Ian & all, thanks for your suggestion.
>
> I have explored do_is_defined_by_abi, and found it's mostly to avoid
> warning, but not for creating such a symbol
>
> do_is_defined_by_abi has one argument of the type "const Symbol*",  so
> when it's invoked, that symbol should already existed.

> ...

>   basically, I want to create a symbol which is neither against
> section or segment, just a normally external function symbol.

I'm sorry, I don't understand what you mean.

If there is no reference to __tls_get_addr in the object files, why do
you care whether it is defined?

If there is a reference in the object files, then where is it defined?

You seem to be asking how to create an undefined symbol, as though
used with the -u option.  But that makes no sense.  Why would you want
that?  The purpose of the -u option is to add a reference to a symbol
in order to fetch the definition from an archive.

Ian

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

* Re: [GOLD] How can I add a undefined symbol in target implementation, not by "-u SYM" from command line ?
  2012-08-14  4:54     ` Ian Lance Taylor
@ 2012-08-14  5:26       ` WANG.Jiong
  2012-08-14  5:35         ` Ian Lance Taylor
  0 siblings, 1 reply; 11+ messages in thread
From: WANG.Jiong @ 2012-08-14  5:26 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: binutils

On 08/14/2012 12:39 PM, Ian Lance Taylor wrote:
> On Mon, Aug 13, 2012 at 8:30 PM, Jiong WANG <wong.kwongyuan@gmail.com> wrote:
>> 2012/8/13 Ian Lance Taylor <iant@google.com>:
>>> On Mon, Aug 13, 2012 at 3:25 AM, Jiong WANG <wong.kwongyuan@gmail.com> wrote:
>>>>    How can I predefine a undefined symbol in target implementation?
>>>>
>>>>    actually, I am porting gold for tilegx, and our arch's tls
>>>> implementation requires predefiniation of "_tls_get_addr" because the
>>>> assembler generate relocation which use this symbol implicitly.
>>>>
>>>>     I know there are interfaces,  "define_in_output_data/segment" to
>>>> predefined symbol with value, but there is no interface to predefine
>>>> "undefined" symbol ?
>>>>
>>>>     gold linker do support this by command line "-u SYMBOL",  but it's
>>>> a compile time decision not link time.
>>>>
>>>>     currently, I managed to support this by the following ugly code:
>>>>
>>>>      options::parse_set(NULL, "_tls_get_addr",
>>>> (gold::options::String_set*)&parameters->options().undefined());
>>>>
>>>>     which is bad, so, could anyone give me some suggestion on this?
>>>
>>> I assume that the symbol is defined somewhere.  You probably want to
>>> add a do_is_defined_by_abi method to your Target.  See the examples in
>>> existing targets.
>> Hi Ian & all, thanks for your suggestion.
>>
>> I have explored do_is_defined_by_abi, and found it's mostly to avoid
>> warning, but not for creating such a symbol
>>
>> do_is_defined_by_abi has one argument of the type "const Symbol*",  so
>> when it's invoked, that symbol should already existed.
>> ...
>>    basically, I want to create a symbol which is neither against
>> section or segment, just a normally external function symbol.
> I'm sorry, I don't understand what you mean.
>
> If there is no reference to __tls_get_addr in the object files, why do
> you care whether it is defined?
>
> If there is a reference in the object files, then where is it defined?
>
> You seem to be asking how to create an undefined symbol, as though
> used with the -u option.  But that makes no sense.  Why would you want
> that?  The purpose of the -u option is to add a reference to a symbol
> in order to fetch the definition from an archive.
Hi Ian,

   thanks for reply.

   suppose the following code:

   __thread int gd_v = 0x10;

   int cal(int a)
   {
      return a + gd_v;
   }

  tilegx gcc will generate the following relocation:

jal     tls_gd_call(gd_v),   tls_gd_call will actually need linker to 
treat it like plt@__tls_get_addr

while all other arch, arm/mips/x86 etc, will generate relocation against 
__tls_get_addr explictly

so, for tilegx arch,  the symbol "__tls_get_addr" will not exist in the 
.o file, while for other arches, it will.

from my understanding, I need to do the following two thing for tilegx arch:

   1.  when scaned the tls_gd_call relocation, I need to create the 
symbol "__tls_get_addr", and
        make a plt entry for it.
   2.  when apply relation for tls_gd_call, make the jal instruction 
jump to plt entry for "__tls_get_addr"

I found there are  interfaces like define_in_output_data etc which could 
predefine symbol, but It seems
they can not defined a symbol with GLOBAL/UND type which is the type of 
"__tls_get_addr"

this is my problem.

please point out if there are any mistunderstood

thanks

---
Regards,
WANG.Jiong


>
> Ian


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

* Re: [GOLD] How can I add a undefined symbol in target implementation, not by "-u SYM" from command line ?
  2012-08-14  5:26       ` WANG.Jiong
@ 2012-08-14  5:35         ` Ian Lance Taylor
  2012-08-14  6:34           ` WANG.Jiong
  2012-08-17  3:54           ` [GOLD] Where can I found other target's test result? WANG.Jiong
  0 siblings, 2 replies; 11+ messages in thread
From: Ian Lance Taylor @ 2012-08-14  5:35 UTC (permalink / raw)
  To: WANG.Jiong; +Cc: binutils

On Mon, Aug 13, 2012 at 9:53 PM, WANG.Jiong <wong.kwongyuan@gmail.com> wrote:
> On 08/14/2012 12:39 PM, Ian Lance Taylor wrote:
>>
>> On Mon, Aug 13, 2012 at 8:30 PM, Jiong WANG <wong.kwongyuan@gmail.com>
>> wrote:
>>>
>>> 2012/8/13 Ian Lance Taylor <iant@google.com>:
>>>>
>>>> On Mon, Aug 13, 2012 at 3:25 AM, Jiong WANG <wong.kwongyuan@gmail.com>
>>>> wrote:
>>>>>
>>>>>    How can I predefine a undefined symbol in target implementation?
>>>>>
>>>>>    actually, I am porting gold for tilegx, and our arch's tls
>>>>> implementation requires predefiniation of "_tls_get_addr" because the
>>>>> assembler generate relocation which use this symbol implicitly.
>>>>>
>>>>>     I know there are interfaces,  "define_in_output_data/segment" to
>>>>> predefined symbol with value, but there is no interface to predefine
>>>>> "undefined" symbol ?
>>>>>
>>>>>     gold linker do support this by command line "-u SYMBOL",  but it's
>>>>> a compile time decision not link time.
>>>>>
>>>>>     currently, I managed to support this by the following ugly code:
>>>>>
>>>>>      options::parse_set(NULL, "_tls_get_addr",
>>>>> (gold::options::String_set*)&parameters->options().undefined());
>>>>>
>>>>>     which is bad, so, could anyone give me some suggestion on this?
>>>>
>>>>
>>>> I assume that the symbol is defined somewhere.  You probably want to
>>>> add a do_is_defined_by_abi method to your Target.  See the examples in
>>>> existing targets.
>>>
>>> Hi Ian & all, thanks for your suggestion.
>>>
>>> I have explored do_is_defined_by_abi, and found it's mostly to avoid
>>> warning, but not for creating such a symbol
>>>
>>> do_is_defined_by_abi has one argument of the type "const Symbol*",  so
>>> when it's invoked, that symbol should already existed.
>>> ...
>>>    basically, I want to create a symbol which is neither against
>>> section or segment, just a normally external function symbol.
>>
>> I'm sorry, I don't understand what you mean.
>>
>> If there is no reference to __tls_get_addr in the object files, why do
>> you care whether it is defined?
>>
>> If there is a reference in the object files, then where is it defined?
>>
>> You seem to be asking how to create an undefined symbol, as though
>> used with the -u option.  But that makes no sense.  Why would you want
>> that?  The purpose of the -u option is to add a reference to a symbol
>> in order to fetch the definition from an archive.
>
> Hi Ian,
>
>   thanks for reply.
>
>   suppose the following code:
>
>   __thread int gd_v = 0x10;
>
>   int cal(int a)
>   {
>      return a + gd_v;
>   }
>
>  tilegx gcc will generate the following relocation:
>
> jal     tls_gd_call(gd_v),   tls_gd_call will actually need linker to treat
> it like plt@__tls_get_addr
>
> while all other arch, arm/mips/x86 etc, will generate relocation against
> __tls_get_addr explictly
>
> so, for tilegx arch,  the symbol "__tls_get_addr" will not exist in the .o
> file, while for other arches, it will.
>
> from my understanding, I need to do the following two thing for tilegx arch:
>
>   1.  when scaned the tls_gd_call relocation, I need to create the symbol
> "__tls_get_addr", and
>        make a plt entry for it.
>   2.  when apply relation for tls_gd_call, make the jal instruction jump to
> plt entry for "__tls_get_addr"
>
> I found there are  interfaces like define_in_output_data etc which could
> predefine symbol, but It seems
> they can not defined a symbol with GLOBAL/UND type which is the type of
> "__tls_get_addr"
>
> this is my problem.

I see.  So you have a relocation type that refers to a symbol with a
magic name.  That seems like a bad design to me.  Can you change it?

If you can't change it, there is a phase ordering problem.  Gold reads
all the symbol tables, including fetching objects out of archives,
before it does the relocation processing.  You will only know that you
need the symbol when you are doing relocation processing.  At that
time, it is too late.

As far as I can see, you will have to make the symbol always be
undefined, as though the linker were always invoke with -u
__tls_get_addr.  That will cause the object defining the symbol to
always be brought into the link, but I don't see how to avoid that.
You just need to call symtab->add_undefined_symbol_from_command_line,
one way or another, and you need to do it early in the link, e.g.,
when your Target is constructed.

Ian

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

* Re: [GOLD] How can I add a undefined symbol in target implementation, not by "-u SYM" from command line ?
  2012-08-14  5:35         ` Ian Lance Taylor
@ 2012-08-14  6:34           ` WANG.Jiong
  2012-08-17  3:54           ` [GOLD] Where can I found other target's test result? WANG.Jiong
  1 sibling, 0 replies; 11+ messages in thread
From: WANG.Jiong @ 2012-08-14  6:34 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: binutils

On 08/14/2012 01:26 PM, Ian Lance Taylor wrote:
> On Mon, Aug 13, 2012 at 9:53 PM, WANG.Jiong <wong.kwongyuan@gmail.com> wrote:
>> On 08/14/2012 12:39 PM, Ian Lance Taylor wrote:
>>> On Mon, Aug 13, 2012 at 8:30 PM, Jiong WANG <wong.kwongyuan@gmail.com>
>>> wrote:
>>>> 2012/8/13 Ian Lance Taylor <iant@google.com>:
>>>>> On Mon, Aug 13, 2012 at 3:25 AM, Jiong WANG <wong.kwongyuan@gmail.com>
>>>>> wrote:
>>>>>>     How can I predefine a undefined symbol in target implementation?
>>>>>>
>>>>>>     actually, I am porting gold for tilegx, and our arch's tls
>>>>>> implementation requires predefiniation of "_tls_get_addr" because the
>>>>>> assembler generate relocation which use this symbol implicitly.
>>>>>>
>>>>>>      I know there are interfaces,  "define_in_output_data/segment" to
>>>>>> predefined symbol with value, but there is no interface to predefine
>>>>>> "undefined" symbol ?
>>>>>>
>>>>>>      gold linker do support this by command line "-u SYMBOL",  but it's
>>>>>> a compile time decision not link time.
>>>>>>
>>>>>>      currently, I managed to support this by the following ugly code:
>>>>>>
>>>>>>       options::parse_set(NULL, "_tls_get_addr",
>>>>>> (gold::options::String_set*)&parameters->options().undefined());
>>>>>>
>>>>>>      which is bad, so, could anyone give me some suggestion on this?
>>>>>
>>>>> I assume that the symbol is defined somewhere.  You probably want to
>>>>> add a do_is_defined_by_abi method to your Target.  See the examples in
>>>>> existing targets.
>>>> Hi Ian & all, thanks for your suggestion.
>>>>
>>>> I have explored do_is_defined_by_abi, and found it's mostly to avoid
>>>> warning, but not for creating such a symbol
>>>>
>>>> do_is_defined_by_abi has one argument of the type "const Symbol*",  so
>>>> when it's invoked, that symbol should already existed.
>>>> ...
>>>>     basically, I want to create a symbol which is neither against
>>>> section or segment, just a normally external function symbol.
>>> I'm sorry, I don't understand what you mean.
>>>
>>> If there is no reference to __tls_get_addr in the object files, why do
>>> you care whether it is defined?
>>>
>>> If there is a reference in the object files, then where is it defined?
>>>
>>> You seem to be asking how to create an undefined symbol, as though
>>> used with the -u option.  But that makes no sense.  Why would you want
>>> that?  The purpose of the -u option is to add a reference to a symbol
>>> in order to fetch the definition from an archive.
>> Hi Ian,
>>
>>    thanks for reply.
>>
>>    suppose the following code:
>>
>>    __thread int gd_v = 0x10;
>>
>>    int cal(int a)
>>    {
>>       return a + gd_v;
>>    }
>>
>>   tilegx gcc will generate the following relocation:
>>
>> jal     tls_gd_call(gd_v),   tls_gd_call will actually need linker to treat
>> it like plt@__tls_get_addr
>>
>> while all other arch, arm/mips/x86 etc, will generate relocation against
>> __tls_get_addr explictly
>>
>> so, for tilegx arch,  the symbol "__tls_get_addr" will not exist in the .o
>> file, while for other arches, it will.
>>
>> from my understanding, I need to do the following two thing for tilegx arch:
>>
>>    1.  when scaned the tls_gd_call relocation, I need to create the symbol
>> "__tls_get_addr", and
>>         make a plt entry for it.
>>    2.  when apply relation for tls_gd_call, make the jal instruction jump to
>> plt entry for "__tls_get_addr"
>>
>> I found there are  interfaces like define_in_output_data etc which could
>> predefine symbol, but It seems
>> they can not defined a symbol with GLOBAL/UND type which is the type of
>> "__tls_get_addr"
>>
>> this is my problem.
> I see.  So you have a relocation type that refers to a symbol with a
> magic name.  That seems like a bad design to me.  Can you change it?
>
> If you can't change it, there is a phase ordering problem.  Gold reads
> all the symbol tables, including fetching objects out of archives,
> before it does the relocation processing.  You will only know that you
> need the symbol when you are doing relocation processing.  At that
> time, it is too late.
>
> As far as I can see, you will have to make the symbol always be
> undefined, as though the linker were always invoke with -u
> __tls_get_addr.  That will cause the object defining the symbol to
> always be brought into the link, but I don't see how to avoid that.
> You just need to call symtab->add_undefined_symbol_from_command_line,
> one way or another, and you need to do it early in the link, e.g.,
> when your Target is constructed.

Thanks Ian,

   got it. then I will temporarily handle this situation by using 
add_undefined_symbol_from_command_line.

   yeah, I also think it's a bad design to generate such style 
relocation. In old bfd linker, we support this by some tricky hacking also.

   I will talk with our gcc guy to change this.

---
Regards,
WANG.Jiong




>
> Ian


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

* [GOLD] Where can I found other target's test result?
  2012-08-14  5:35         ` Ian Lance Taylor
  2012-08-14  6:34           ` WANG.Jiong
@ 2012-08-17  3:54           ` WANG.Jiong
  2012-08-17  6:29             ` Ian Lance Taylor
  1 sibling, 1 reply; 11+ messages in thread
From: WANG.Jiong @ 2012-08-17  3:54 UTC (permalink / raw)
  To: binutils

Hi All,

   Currently, tilegx gold get the following test result:

   (all ifunc test, and non-pic shared library test disabled)

============================
3 of 127 tests failed
See testsuite/test-suite.log
============================

the failed testcases are:

FAIL: icf_safe_test.sh (exit: 1)
FAIL: icf_safe_so_test.sh (exit: 1)
FAIL: memory_test.sh (exit: 1)

my question is:

   where can I found other target's test results?  especially those 
non-x86 target, like sparc/powerpc, because I think some testcases like 
memory_test.sh is designed for x86 feature ?

   thanks very much

---
Regards,
WANG.Jiong


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

* Re: [GOLD] Where can I found other target's test result?
  2012-08-17  3:54           ` [GOLD] Where can I found other target's test result? WANG.Jiong
@ 2012-08-17  6:29             ` Ian Lance Taylor
  2012-08-17  9:32               ` Jiong WANG
  0 siblings, 1 reply; 11+ messages in thread
From: Ian Lance Taylor @ 2012-08-17  6:29 UTC (permalink / raw)
  To: WANG.Jiong; +Cc: binutils

On Thu, Aug 16, 2012 at 8:09 PM, WANG.Jiong <wong.kwongyuan@gmail.com> wrote:
>
>   Currently, tilegx gold get the following test result:
>
>   (all ifunc test, and non-pic shared library test disabled)
>
> ============================
> 3 of 127 tests failed
> See testsuite/test-suite.log
> ============================
>
> the failed testcases are:
>
> FAIL: icf_safe_test.sh (exit: 1)
> FAIL: icf_safe_so_test.sh (exit: 1)
> FAIL: memory_test.sh (exit: 1)
>
> my question is:
>
>   where can I found other target's test results?  especially those non-x86
> target, like sparc/powerpc, because I think some testcases like
> memory_test.sh is designed for x86 feature ?

I think you'll have to build gold for the target you are interested
in, and run the testsuite.  I'm not aware of anybody tracking gold
testsuite behaviour on different targets.

I don't see anything especially x86-specific in memory_test.sh.  Of
course there may be something.

The ICF tests do have an architecture-specific aspect; take a look at
the .sh files.

Ian

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

* Re: [GOLD] Where can I found other target's test result?
  2012-08-17  6:29             ` Ian Lance Taylor
@ 2012-08-17  9:32               ` Jiong WANG
  0 siblings, 0 replies; 11+ messages in thread
From: Jiong WANG @ 2012-08-17  9:32 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: binutils

2012/8/17 Ian Lance Taylor <iant@google.com>:
> On Thu, Aug 16, 2012 at 8:09 PM, WANG.Jiong <wong.kwongyuan@gmail.com> wrote:
>>
>>   Currently, tilegx gold get the following test result:
>>
>>   (all ifunc test, and non-pic shared library test disabled)
>>
>> ============================
>> 3 of 127 tests failed
>> See testsuite/test-suite.log
>> ============================
>>
>> the failed testcases are:
>>
>> FAIL: icf_safe_test.sh (exit: 1)
>> FAIL: icf_safe_so_test.sh (exit: 1)
>> FAIL: memory_test.sh (exit: 1)
>>
>> my question is:
>>
>>   where can I found other target's test results?  especially those non-x86
>> target, like sparc/powerpc, because I think some testcases like
>> memory_test.sh is designed for x86 feature ?
>
> I think you'll have to build gold for the target you are interested
> in, and run the testsuite.  I'm not aware of anybody tracking gold
> testsuite behaviour on different targets.
>
> I don't see anything especially x86-specific in memory_test.sh.  Of
> course there may be something.
>
> The ICF tests do have an architecture-specific aspect; take a look at
> the .sh files.
>

Hi Ian,

I checked icf_save_test.sh and got understand of how ICF works, after
refine my "possible_function_pointer_reloc" implementation, all icf
testcases passed, now only memory_test.sh failed.

thanks for clarification.

---
Regards,
WANG.Jiong


> Ian

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

end of thread, other threads:[~2012-08-17  8:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-13 10:51 [GOLD] How can I add a undefined symbol in target implementation, not by "-u SYM" from command line ? Jiong WANG
2012-08-13 14:11 ` Jiong WANG
2012-08-13 15:39 ` Ian Lance Taylor
2012-08-14  3:39   ` Jiong WANG
2012-08-14  4:54     ` Ian Lance Taylor
2012-08-14  5:26       ` WANG.Jiong
2012-08-14  5:35         ` Ian Lance Taylor
2012-08-14  6:34           ` WANG.Jiong
2012-08-17  3:54           ` [GOLD] Where can I found other target's test result? WANG.Jiong
2012-08-17  6:29             ` Ian Lance Taylor
2012-08-17  9:32               ` Jiong WANG

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