1 # Test SIZEOF in a linker script.
2 # By Ian Lance Taylor
, Cygnus Support
3 # Based
on a bug
report from anders.blomdell@control.lth.se.
7 if ![ld_assemble $as $srcdir
/$subdir
/sizeof.s tmpdir
/sizeof.o
] {
12 if ![ld_simple_link $
ld tmpdir
/sizeof
"-T $srcdir/$subdir/sizeof.t tmpdir/sizeof.o"] {
17 if ![ld_nm $nm tmpdir
/sizeof
] {
22 if {![info exists nm_output
(text_start
)] \
23 ||
![info exists nm_output
(text_end
)] \
24 ||
![info exists nm_output
(data_start
)] \
25 ||
![info exists nm_output
(data_end
)] \
26 ||
![info exists nm_output
(sizeof_text
)] \
27 ||
![info exists nm_output
(sizeof_data
)]} {
28 send_log
"bad output from nm\n"
29 verbose
"bad output from nm"
34 if {$nm_output
(text_end
) - $nm_output
(text_start
) != $nm_output
(sizeof_text
)} {
35 send_log
"text_end - text_start != sizeof_text\n"
36 verbose
"text_end - text_start != sizeof_text"
41 if {$nm_output
(data_end
) - $nm_output
(data_start
) != $nm_output
(sizeof_data
)} {
42 send_log
"data_end - data_start != sizeof_data\n"
43 verbose
"data_end - data_start != sizeof_data"
48 if {$nm_output
(sizeof_text
) != $nm_output
(sizeof_data
)} {
49 send_log
"sizeof_text != sizeof_data\n"
50 verbose
"sizeof_text != sizeof_data"