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.
4 # Copyright
2001, 2005, 2007
5 # Free Software Foundation
, Inc.
7 # This file is part of the GNU Binutils.
9 # This
program is free software
; you can redistribute it and
/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation
; either version
3 of the License
, or
12 #
(at your option
) any later version.
14 # This
program is distributed in the hope that it will be useful
,
15 # but WITHOUT
ANY WARRANTY
; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License
for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this
program; if not
, write to the Free Software
21 # Foundation
, Inc.
, 51 Franklin Street
- Fifth Floor
, Boston
,
26 if ![ld_assemble $as $srcdir
/$subdir
/sizeof.s tmpdir
/sizeof.o
] {
31 if ![ld_simple_link $
ld tmpdir
/sizeof
"-T $srcdir/$subdir/sizeof.t tmpdir/sizeof.o"] {
36 if ![ld_nm $nm
"" tmpdir/sizeof] {
41 if {![info exists nm_output
(text_start
)] \
42 ||
![info exists nm_output
(text_end
)] \
43 ||
![info exists nm_output
(data_start
)] \
44 ||
![info exists nm_output
(data_end
)] \
45 ||
![info exists nm_output
(sizeof_text
)] \
46 ||
![info exists nm_output
(sizeof_data
)]} {
47 send_log
"bad output from nm\n"
48 verbose
"bad output from nm"
53 if {$nm_output
(text_end
) - $nm_output
(text_start
) != $nm_output
(sizeof_text
)} {
54 send_log
"text_end - text_start != sizeof_text\n"
55 verbose
"text_end - text_start != sizeof_text"
60 if {$nm_output
(data_end
) - $nm_output
(data_start
) != $nm_output
(sizeof_data
)} {
61 send_log
"data_end - data_start != sizeof_data\n"
62 verbose
"data_end - data_start != sizeof_data"
67 if {$nm_output
(sizeof_text
) != $nm_output
(sizeof_data
)} {
68 send_log
"sizeof_text != sizeof_data\n"
69 verbose
"sizeof_text != sizeof_data"