This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Question about ld script file behaviour
- From: Matthew Gretton-Dann <matthew dot gretton-dann at arm dot com>
- To: binutils at sourceware dot org
- Date: Fri, 17 Sep 2010 11:59:18 +0100
- Subject: Question about ld script file behaviour
All,
The following patch causes the ld-arm/script-type test to fail (target
any arm*-*-*):
http://sourceware.org/ml/binutils/2010-08/msg00169.html
The test case defines some symbols in an object and then in a linker
script causes other symbols to be defined based upon those symbols:
SECTIONS {
foo_a = bar_a;
foo_t = bar_t;
foo_o = bar_o;
.text : { *(.text) }
.ARM.attribues 0 : { *(.ARM.attributes) }
}
The currently expected output is:
Symbol table '.symtab' contains 13 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00000000 0 SECTION LOCAL DEFAULT 1
2: 00000000 0 SECTION LOCAL DEFAULT 2
3: 00000000 0 NOTYPE LOCAL DEFAULT 1 \$a
4: 00000010 0 NOTYPE LOCAL DEFAULT 1 \$d
5: 00000014 0 NOTYPE LOCAL DEFAULT 1 \$a
6: 00000020 0 NOTYPE LOCAL DEFAULT 1 \$t
7: 00000010 0 OBJECT GLOBAL DEFAULT 1 bar_o
8: 00000021 0 FUNC GLOBAL DEFAULT 1 bar_t
9: 00000000 0 FUNC GLOBAL DEFAULT 1 foo_a
10: 00000021 0 FUNC GLOBAL DEFAULT 1 foo_t
11: 00000010 0 OBJECT GLOBAL DEFAULT 1 foo_o
12: 00000000 0 FUNC GLOBAL DEFAULT 1 bar_a
Following the above change foo_a, foo_t, and foo_o are now absolute
symbols so the appropriate rows of the symbol table look like this:
9: 00000000 0 FUNC GLOBAL DEFAULT ABS foo_a
10: 00000021 0 FUNC GLOBAL DEFAULT ABS foo_t
11: 00000010 0 OBJECT GLOBAL DEFAULT ABS foo_o
>From following the email thread associated with the above patch I
believe the change is valid, but don't understand linker scripts well
enough to be 100% sure.
So can someone who understands linker scripting please confirm the
change in output is expected and valid?
Thanks,
Matt
--
Matthew Gretton-Dann
Principal Engineer - PDSW Tools
ARM Ltd