xref: /aosp_15_r20/external/elfutils/tests/run-readelf-A.sh (revision 7304104da70ce23c86437a01be71edd1a2d7f37e)
1*7304104dSAndroid Build Coastguard Worker#! /bin/sh
2*7304104dSAndroid Build Coastguard Worker# Copyright (C) 2014 Red Hat, Inc.
3*7304104dSAndroid Build Coastguard Worker# Copyright (C) 2016 Oracle, Inc.
4*7304104dSAndroid Build Coastguard Worker# This file is part of elfutils.
5*7304104dSAndroid Build Coastguard Worker#
6*7304104dSAndroid Build Coastguard Worker# This file is free software; you can redistribute it and/or modify
7*7304104dSAndroid Build Coastguard Worker# it under the terms of the GNU General Public License as published by
8*7304104dSAndroid Build Coastguard Worker# the Free Software Foundation; either version 3 of the License, or
9*7304104dSAndroid Build Coastguard Worker# (at your option) any later version.
10*7304104dSAndroid Build Coastguard Worker#
11*7304104dSAndroid Build Coastguard Worker# elfutils is distributed in the hope that it will be useful, but
12*7304104dSAndroid Build Coastguard Worker# WITHOUT ANY WARRANTY; without even the implied warranty of
13*7304104dSAndroid Build Coastguard Worker# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*7304104dSAndroid Build Coastguard Worker# GNU General Public License for more details.
15*7304104dSAndroid Build Coastguard Worker#
16*7304104dSAndroid Build Coastguard Worker# You should have received a copy of the GNU General Public License
17*7304104dSAndroid Build Coastguard Worker# along with this program.  If not, see <http://www.gnu.org/licenses/>.
18*7304104dSAndroid Build Coastguard Worker
19*7304104dSAndroid Build Coastguard Worker. $srcdir/test-subr.sh
20*7304104dSAndroid Build Coastguard Worker
21*7304104dSAndroid Build Coastguard Worker# See run-addrcfi.sh for testfilearm.
22*7304104dSAndroid Build Coastguard Worker
23*7304104dSAndroid Build Coastguard Worker# = testfileppc32attrs.s =
24*7304104dSAndroid Build Coastguard Worker# .gnu_attribute 8,1
25*7304104dSAndroid Build Coastguard Worker# .gnu_attribute 12,1
26*7304104dSAndroid Build Coastguard Worker#
27*7304104dSAndroid Build Coastguard Worker# gcc -m32 -c testfileppc32attrs.s
28*7304104dSAndroid Build Coastguard Worker
29*7304104dSAndroid Build Coastguard Worker# = testfilesparc64attrs.s =
30*7304104dSAndroid Build Coastguard Worker# .gnu_attribute 4,0x0aaaaaaa
31*7304104dSAndroid Build Coastguard Worker# .gnu_attribute 8,0x00000055
32*7304104dSAndroid Build Coastguard Worker#
33*7304104dSAndroid Build Coastguard Worker# gcc -c testfilesparc64attrs.s
34*7304104dSAndroid Build Coastguard Worker
35*7304104dSAndroid Build Coastguard Worker# = testfileppc64attrs.s =
36*7304104dSAndroid Build Coastguard Worker# .gnu_attribute 4,3
37*7304104dSAndroid Build Coastguard Worker#
38*7304104dSAndroid Build Coastguard Worker# gcc -c testfileppc64attrs.s
39*7304104dSAndroid Build Coastguard Worker
40*7304104dSAndroid Build Coastguard Workertestfiles testfilearm testfileppc32attrs.o testfilesparc64attrs.o testfileppc64attrs.o
41*7304104dSAndroid Build Coastguard Worker
42*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_top_builddir}/src/readelf -A testfilearm <<\EOF
43*7304104dSAndroid Build Coastguard Worker
44*7304104dSAndroid Build Coastguard WorkerObject attributes section [27] '.ARM.attributes' of 53 bytes at offset 0x718:
45*7304104dSAndroid Build Coastguard Worker  Owner          Size
46*7304104dSAndroid Build Coastguard Worker  aeabi            52
47*7304104dSAndroid Build Coastguard Worker    File:          42
48*7304104dSAndroid Build Coastguard Worker      CPU_name: 7-A
49*7304104dSAndroid Build Coastguard Worker      CPU_arch: v7
50*7304104dSAndroid Build Coastguard Worker      CPU_arch_profile: Application
51*7304104dSAndroid Build Coastguard Worker      ARM_ISA_use: Yes
52*7304104dSAndroid Build Coastguard Worker      THUMB_ISA_use: Thumb-2
53*7304104dSAndroid Build Coastguard Worker      VFP_arch: VFPv3-D16
54*7304104dSAndroid Build Coastguard Worker      ABI_PCS_wchar_t: 4
55*7304104dSAndroid Build Coastguard Worker      ABI_FP_rounding: Needed
56*7304104dSAndroid Build Coastguard Worker      ABI_FP_denormal: Needed
57*7304104dSAndroid Build Coastguard Worker      ABI_FP_exceptions: Needed
58*7304104dSAndroid Build Coastguard Worker      ABI_FP_number_model: IEEE 754
59*7304104dSAndroid Build Coastguard Worker      ABI_align8_needed: Yes
60*7304104dSAndroid Build Coastguard Worker      ABI_align8_preserved: Yes, except leaf SP
61*7304104dSAndroid Build Coastguard Worker      ABI_enum_size: int
62*7304104dSAndroid Build Coastguard Worker      ABI_HardFP_use: SP and DP
63*7304104dSAndroid Build Coastguard Worker      ABI_VFP_args: VFP registers
64*7304104dSAndroid Build Coastguard Worker      CPU_unaligned_access: v6
65*7304104dSAndroid Build Coastguard WorkerEOF
66*7304104dSAndroid Build Coastguard Worker
67*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_top_builddir}/src/readelf -A testfileppc32attrs.o <<\EOF
68*7304104dSAndroid Build Coastguard Worker
69*7304104dSAndroid Build Coastguard WorkerObject attributes section [ 4] '.gnu.attributes' of 18 bytes at offset 0x34:
70*7304104dSAndroid Build Coastguard Worker  Owner          Size
71*7304104dSAndroid Build Coastguard Worker  gnu              17
72*7304104dSAndroid Build Coastguard Worker    File:           9
73*7304104dSAndroid Build Coastguard Worker      GNU_Power_ABI_Vector: Generic
74*7304104dSAndroid Build Coastguard Worker      GNU_Power_ABI_Struct_Return: r3/r4
75*7304104dSAndroid Build Coastguard WorkerEOF
76*7304104dSAndroid Build Coastguard Worker
77*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_top_builddir}/src/readelf -A testfilesparc64attrs.o <<\EOF
78*7304104dSAndroid Build Coastguard Worker
79*7304104dSAndroid Build Coastguard WorkerObject attributes section [ 4] '.gnu.attributes' of 21 bytes at offset 0x40:
80*7304104dSAndroid Build Coastguard Worker  Owner          Size
81*7304104dSAndroid Build Coastguard Worker  gnu              20
82*7304104dSAndroid Build Coastguard Worker    File:          12
83*7304104dSAndroid Build Coastguard Worker      GNU_Sparc_HWCAPS: div32,v8plus,vis,asi_blk_init,vis3,random,fjfmau,asi_cache_sparing,des,camellia,sha1,sha512,mont,cbcond
84*7304104dSAndroid Build Coastguard Worker      GNU_Sparc_HWCAPS2: fjathplus,adp,mwait,xmont
85*7304104dSAndroid Build Coastguard WorkerEOF
86*7304104dSAndroid Build Coastguard Worker
87*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_top_builddir}/src/readelf -A testfileppc64attrs.o <<\EOF
88*7304104dSAndroid Build Coastguard Worker
89*7304104dSAndroid Build Coastguard WorkerObject attributes section [ 4] '.gnu.attributes' of 16 bytes at offset 0x40:
90*7304104dSAndroid Build Coastguard Worker  Owner          Size
91*7304104dSAndroid Build Coastguard Worker  gnu              15
92*7304104dSAndroid Build Coastguard Worker    File:           7
93*7304104dSAndroid Build Coastguard Worker      GNU_Power_ABI_FP: Single-precision hard float
94*7304104dSAndroid Build Coastguard WorkerEOF
95*7304104dSAndroid Build Coastguard Worker
96*7304104dSAndroid Build Coastguard Workerexit 0
97