Commit | Line | Data |
---|---|---|
d85bf2ba NC |
1 | /* Assembler source used to create an object file for testing readelf's |
2 | and objdump's ability to process separate dwarf object files. | |
3 | ||
b3adc24a | 4 | Copyright (C) 2017-2020 Free Software Foundation, Inc. |
d85bf2ba NC |
5 | |
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. | |
10 | ||
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. | |
15 | ||
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/>. */ | |
18 | ||
19 | ||
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. */ | |
23 | ||
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: | |
33 | ||
34 | /* Create a .debug_info section that contains the dwo links. */ | |
35 | ||
36 | .section .debug_info,"",%progbits | |
50ea0877 NC |
37 | .4byte debugE1 - debugS1 ;# Length of Compilation Unit Info |
38 | debugS1: | |
d85bf2ba NC |
39 | .short 0x4 ;# DWARF version number. |
40 | .4byte 0x0 ;# Offset into .debug_abbrev section. | |
41 | .byte 0x4 ;# Pointer Size (in bytes). | |
42 | ||
43 | .uleb128 0x1 ;# Use abbrev #1. This needs strings from the .debug_str section. | |
44 | .4byte string1 | |
45 | .4byte string2 | |
50ea0877 NC |
46 | debugE1: |
47 | ||
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). | |
d85bf2ba NC |
53 | |
54 | .uleb128 0x2 ;# Use abbrev #2. | |
55 | .asciz "file.dwo" | |
56 | .4byte string3 | |
57 | .8byte 0x12345678aabbccdd | |
58 | ||
59 | ;# Minimal section alignment on alpha-* is 2, so ensure no new invalid CU | |
60 | ;# will be started. | |
61 | .balign 2, 0 | |
50ea0877 | 62 | debugE2: |
d85bf2ba NC |
63 | |
64 | .section .debug_abbrev,"",%progbits | |
65 | ||
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 | |
76 | ||
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 | |
89 | ||
90 | .byte 0x0 ;# Abbrevs terminator | |
91 |