linkcmds symbol file with unknown symbol type '?'

Till Straumann strauman at slac.stanford.edu
Wed Sep 6 05:16:07 UTC 2017


For this application (creating a symbol table for cexpsh) 
--unresolved-symbols=ignore-all
is not dangerous but exactly what we want: find all symbols that are 
exported by the start files
and the linker script.

The '?' results from symbols having been defined in sections that have 
not linked any
input sections such as

.some_section {
   some_section_begin = .;
   *(.some_section*);
   some_section_end = .;
}

If no '.some_section' is linked then the linker doesn't know how to classify
'some_section_begin/some_section_end' (data?, text?)

Traditionally we had defined such symbols *outside* of a section:

some_section_begin = .;
.some_section{
   *(.some_section*);
}
some_section_end = .;

and I believe in this case they would be classified as 'A' (absolute;
not further relocated)

I realize that this is a fringe-use-case and a request to rewrite the
scripts seems unwarranted. A simple work-around is mapping '?' to 'A'
in the final 'startfiles.nm'.

- Till

On 09/05/2017 09:57 PM, Sebastian Huber wrote:
> On 05/09/17 21:42, Jianxun Yan wrote:
>
>> Hi,
>>
>> My application needs to compile linkcmds and create a symbols file. 
>> Here are how I did.
>>
>> $ arm-rtems4.11-g++ 
>> -B/home/yanjx/workspace/rtems411/arm-rtems4.11/altcycv_devkit/lib/ 
>> -specs bsp_specs -qrtems -Wall -O2 -g -march=armv7-a -mthumb 
>> -mfpu=vfp -mfloat-abi=softfp -mtune=cortex-a9 -I. -Invram 
>> -nodefaultlibs -o o-optimize/startfiles.obj 
>> -Wl,--unresolved-symbols=ignore-all -T`arm-rtems4.11-gcc --pipe 
>> -B/home/yanjx/workspace/rtems411/arm-rtems4.11/altcycv_devkit/lib/ 
>> -specs bsp_specs -qrtems -print-file-name=linkcmds`
>>
>
> This -Wl,--unresolved-symbols=ignore-all sounds a bit dangerous.
>
>> $ arm-rtems4.11-nm -g -fposix o-optimize/startfiles.obj > 
>> o-optimize/startfiles.nm
>>
>> After created the startfiles.nm file, I found there some symbols with 
>> unknown type of '?'
>>
>> bsp_section_rodata_begin ? 00300204
>>
>> bsp_section_rodata_end D 00300214
>>
>> bsp_section_rodata_load_begin A 00300204
>>
>> bsp_section_rodata_load_end A 00300214
>>
>> bsp_section_rodata_size A 00000010
>>
>> bsp_section_rwbarrier_align A 00100000
>>
>> bsp_section_stack_begin ? 40000000
>>
>> bsp_section_stack_end ? 40000000
>>
>> ......
>>
>> __deregister_frame_info w
>>
>> __dso_handle D 00401400
>>
>> __exidx_end ? 00300204
>>
>> __exidx_start ? 00300204
>>
>> .....
>>
>> Dose anyone know what causes the problem? and how to solve it?
>>
>
> Maybe these are the ignored undefined symbols?
>




More information about the users mailing list