aboutsummaryrefslogtreecommitdiff
path: root/gdb/arm-tdep.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2018-07-21 22:21:57 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2018-07-21 22:23:33 -0400
commit17cbafdbbef78d7e05ade53d4cc867fa8ac2f432 (patch)
tree38dba452d4deebca5321a41fa7a2f11a2181a1a8 /gdb/arm-tdep.c
parentdcc0660f04bb74948299fb33c98620cfd1ceabb2 (diff)
downloadgdb-17cbafdbbef78d7e05ade53d4cc867fa8ac2f432.zip
gdb-17cbafdbbef78d7e05ade53d4cc867fa8ac2f432.tar.gz
gdb-17cbafdbbef78d7e05ade53d4cc867fa8ac2f432.tar.bz2
Fix -Wunused-variable warnings related to conditional compilation
Some variables are not used when !HAVE_ELF, so avoid declaring them in that case. gdb/ChangeLog: * arm-tdep.c (arm_gdbarch_init): Declare attr_arch and attr_profile in HAVE_ELF. * rs6000-tdep.c (bfd_uses_spe_extensions): Declare vector_abi in HAVE_ELF.
Diffstat (limited to 'gdb/arm-tdep.c')
-rw-r--r--gdb/arm-tdep.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index fdfb360..049a887 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -8955,7 +8955,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
else if (ei_osabi == ELFOSABI_NONE || ei_osabi == ELFOSABI_GNU)
{
int eabi_ver = EF_ARM_EABI_VERSION (e_flags);
- int attr_arch, attr_profile;
switch (eabi_ver)
{
@@ -9026,11 +9025,13 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
executable file includes build attributes; GCC does
copy them to the executable, but e.g. RealView does
not. */
- attr_arch = bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_PROC,
- Tag_CPU_arch);
- attr_profile = bfd_elf_get_obj_attr_int (info.abfd,
- OBJ_ATTR_PROC,
- Tag_CPU_arch_profile);
+ int attr_arch
+ = bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_PROC,
+ Tag_CPU_arch);
+ int attr_profile
+ = bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_PROC,
+ Tag_CPU_arch_profile);
+
/* GCC specifies the profile for v6-M; RealView only
specifies the profile for architectures starting with
V7 (as opposed to architectures with a tag