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.
5 # Free Software Foundation
, Inc.
7 # This file is free software
; you can redistribute it and
/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation
; either version
2 of the License
, or
10 #
(at your option
) any later version.
12 # This
program is distributed in the hope that it will be useful
,
13 # but WITHOUT
ANY WARRANTY
; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License
for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this
program; if not
, write to the Free Software
19 # Foundation
, Inc.
, 59 Temple Place
- Suite
330, Boston
, MA
02111-1307, USA.
23 if ![ld_assemble $as $srcdir
/$subdir
/sizeof.s tmpdir
/sizeof.o
] {
28 if ![ld_simple_link $
ld tmpdir
/sizeof
"-T $srcdir/$subdir/sizeof.t tmpdir/sizeof.o"] {
33 if ![ld_nm $nm
"" tmpdir/sizeof] {
38 if {![info exists nm_output
(text_start
)] \
39 ||
![info exists nm_output
(text_end
)] \
40 ||
![info exists nm_output
(data_start
)] \
41 ||
![info exists nm_output
(data_end
)] \
42 ||
![info exists nm_output
(sizeof_text
)] \
43 ||
![info exists nm_output
(sizeof_data
)]} {
44 send_log
"bad output from nm\n"
45 verbose
"bad output from nm"
50 if {$nm_output
(text_end
) - $nm_output
(text_start
) != $nm_output
(sizeof_text
)} {
51 send_log
"text_end - text_start != sizeof_text\n"
52 verbose
"text_end - text_start != sizeof_text"
57 if {$nm_output
(data_end
) - $nm_output
(data_start
) != $nm_output
(sizeof_data
)} {
58 send_log
"data_end - data_start != sizeof_data\n"
59 verbose
"data_end - data_start != sizeof_data"
64 if {$nm_output
(sizeof_text
) != $nm_output
(sizeof_data
)} {
65 send_log
"sizeof_text != sizeof_data\n"
66 verbose
"sizeof_text != sizeof_data"