sparc: define _GLOBAL_OFFSET_TABLE_ when referenced
[binutils-gdb.git] / binutils / testsuite / binutils-all / dwo.s
blob0cd18d4fddaca1f784a51bce405ab707a233cae1
1 /* Assembler source used to create an object file for testing readelf's
2 and objdump's ability to process separate dwarf object files.
4 Copyright (C) 2017-2025 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* Create a .debug_str section for local use. This is also to check
21 the ability to dump the same section twice, if it exists in
22 both the main file and the separate debug info file. */
24 .section .debug_str,"MS",%progbits,1
25 string1:
26 .asciz "debugfile.dwo"
27 string2:
28 .asciz "/path/to/dwo/files"
29 string3:
30 .asciz "/another/path/"
31 .balign 2
32 string_end:
34 /* Create a .debug_info section that contains the dwo links. */
36 .section .debug_info,"",%progbits
37 .4byte debugE1 - debugS1 ;# Length of Compilation Unit Info
38 debugS1:
39 .short 0x4 ;# DWARF version number.
40 .4byte 0x0 ;# Offset into .debug_abbrev section.
41 .byte 0x4 ;# Pointer Size (in bytes).
43 .uleb128 0x1 ;# Use abbrev #1. This needs strings from the .debug_str section.
44 .4byte string1
45 .4byte string2
46 debugE1:
48 .4byte debugE2 - debugS2 ;# Length of Compilation Unit Info
49 debugS2:
50 .short 0x4 ;# DWARF version number.
51 .4byte 0x0 ;# Offset into .debug_abbrev section.
52 .byte 0x4 ;# Pointer Size (in bytes).
54 .uleb128 0x2 ;# Use abbrev #2.
55 .asciz "file.dwo"
56 .4byte string3
57 .8byte 0x12345678aabbccdd
59 ;# Minimal section alignment on alpha-* is 2, so ensure no new invalid CU
60 ;# will be started.
61 .balign 2, 0
62 debugE2:
64 .section .debug_abbrev,"",%progbits
66 /* Create an abbrev containing a DWARF5 style dwo link. */
67 .uleb128 0x01 ;# Abbrev code.
68 .uleb128 0x11 ;# DW_TAG_compile_unit
69 .byte 0x00 ;# DW_children_no
70 .uleb128 0x76 ;# DW_AT_dwo_name
71 .uleb128 0x0e ;# DW_FORM_strp
72 .uleb128 0x1b ;# DW_AT_comp_dir
73 .uleb128 0x0e ;# DW_FORM_strp
74 .byte 0x00 ;# End of abbrev
75 .byte 0x00
77 /* Create an abbrev containing a GNU style dwo link. */
78 .uleb128 0x02 ;# Abbrev code.
79 .uleb128 0x11 ;# DW_TAG_compile_unit
80 .byte 0x00 ;# DW_children_no
81 .uleb128 0x2130 ;# DW_AT_GNU_dwo_name
82 .uleb128 0x08 ;# DW_FORM_string
83 .uleb128 0x1b ;# DW_AT_comp_dir
84 .uleb128 0x0e ;# DW_FORM_strp
85 .uleb128 0x2131 ;# DW_AT_GNU_dwo_id
86 .uleb128 0x07 ;# DW_FORM_data8
87 .byte 0x00 ;# End of abbrev
88 .byte 0x00
90 .byte 0x0 ;# Abbrevs terminator