Blame tests/run-readelf-A.sh

Packit 032894
#! /bin/sh
Packit 032894
# Copyright (C) 2014 Red Hat, Inc.
Packit 032894
# Copyright (C) 2016 Oracle, Inc.
Packit 032894
# This file is part of elfutils.
Packit 032894
#
Packit 032894
# This file is free software; you can redistribute it and/or modify
Packit 032894
# it under the terms of the GNU General Public License as published by
Packit 032894
# the Free Software Foundation; either version 3 of the License, or
Packit 032894
# (at your option) any later version.
Packit 032894
#
Packit 032894
# elfutils is distributed in the hope that it will be useful, but
Packit 032894
# WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 032894
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 032894
# GNU General Public License for more details.
Packit 032894
#
Packit 032894
# You should have received a copy of the GNU General Public License
Packit 032894
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit 032894
Packit 032894
. $srcdir/test-subr.sh
Packit 032894
Packit 032894
# See run-addrcfi.sh for testfilearm.
Packit 032894
Packit 032894
# = testfileppc32attrs.s =
Packit 032894
# .gnu_attribute 8,1
Packit 032894
# .gnu_attribute 12,1
Packit 032894
#
Packit 032894
# gcc -m32 -c testfileppc32attrs.s
Packit 032894
Packit 032894
# = testfilesparc64attrs.s =
Packit 032894
# .gnu_attribute 4,0x0aaaaaaa
Packit 032894
# .gnu_attribute 8,0x00000055
Packit 032894
#
Packit 032894
# gcc -c testfilesparc64attrs.s
Packit 032894
Packit 032894
# = testfileppc64attrs.s =
Packit 032894
# .gnu_attribute 4,3
Packit 032894
#
Packit 032894
# gcc -c testfileppc64attrs.s
Packit 032894
Packit 032894
testfiles testfilearm testfileppc32attrs.o testfilesparc64attrs.o testfileppc64attrs.o
Packit 032894
Packit 032894
testrun_compare ${abs_top_builddir}/src/readelf -A testfilearm <<\EOF
Packit 032894
Packit 032894
Object attributes section [27] '.ARM.attributes' of 53 bytes at offset 0x718:
Packit 032894
  Owner          Size
Packit 032894
  aeabi            52
Packit 032894
    File:          42
Packit 032894
      CPU_name: 7-A
Packit 032894
      CPU_arch: v7
Packit 032894
      CPU_arch_profile: Application
Packit 032894
      ARM_ISA_use: Yes
Packit 032894
      THUMB_ISA_use: Thumb-2
Packit 032894
      VFP_arch: VFPv3-D16
Packit 032894
      ABI_PCS_wchar_t: 4
Packit 032894
      ABI_FP_rounding: Needed
Packit 032894
      ABI_FP_denormal: Needed
Packit 032894
      ABI_FP_exceptions: Needed
Packit 032894
      ABI_FP_number_model: IEEE 754
Packit 032894
      ABI_align8_needed: Yes
Packit 032894
      ABI_align8_preserved: Yes, except leaf SP
Packit 032894
      ABI_enum_size: int
Packit 032894
      ABI_HardFP_use: SP and DP
Packit 032894
      ABI_VFP_args: VFP registers
Packit 032894
      CPU_unaligned_access: v6
Packit 032894
EOF
Packit 032894
Packit 032894
testrun_compare ${abs_top_builddir}/src/readelf -A testfileppc32attrs.o <<\EOF
Packit 032894
Packit 032894
Object attributes section [ 4] '.gnu.attributes' of 18 bytes at offset 0x34:
Packit 032894
  Owner          Size
Packit 032894
  gnu              17
Packit 032894
    File:           9
Packit 032894
      GNU_Power_ABI_Vector: Generic
Packit 032894
      GNU_Power_ABI_Struct_Return: r3/r4
Packit 032894
EOF
Packit 032894
Packit 032894
testrun_compare ${abs_top_builddir}/src/readelf -A testfilesparc64attrs.o <<\EOF
Packit 032894
Packit 032894
Object attributes section [ 4] '.gnu.attributes' of 21 bytes at offset 0x40:
Packit 032894
  Owner          Size
Packit 032894
  gnu              20
Packit 032894
    File:          12
Packit 032894
      GNU_Sparc_HWCAPS: div32,v8plus,vis,asi_blk_init,vis3,random,fjfmau,asi_cache_sparing,des,camellia,sha1,sha512,mont,cbcond
Packit 032894
      GNU_Sparc_HWCAPS2: fjathplus,adp,mwait,xmont
Packit 032894
EOF
Packit 032894
Packit 032894
testrun_compare ${abs_top_builddir}/src/readelf -A testfileppc64attrs.o <<\EOF
Packit 032894
Packit 032894
Object attributes section [ 4] '.gnu.attributes' of 16 bytes at offset 0x40:
Packit 032894
  Owner          Size
Packit 032894
  gnu              15
Packit 032894
    File:           7
Packit 032894
      GNU_Power_ABI_FP: Single-precision hard float
Packit 032894
EOF
Packit 032894
Packit 032894
exit 0