aboutsummaryrefslogtreecommitdiff
path: root/bfd/archures.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/archures.c')
-rw-r--r--bfd/archures.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/bfd/archures.c b/bfd/archures.c
index 569876e..1e66110 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -1379,7 +1379,8 @@ FUNCTION
bfd_octets_per_byte
SYNOPSIS
- unsigned int bfd_octets_per_byte (const bfd *abfd);
+ unsigned int bfd_octets_per_byte (const bfd *abfd,
+ const asection *sec);
DESCRIPTION
Return the number of octets (8-bit quantities) per target byte
@@ -1388,10 +1389,17 @@ DESCRIPTION
*/
unsigned int
-bfd_octets_per_byte (const bfd *abfd)
+bfd_octets_per_byte (const bfd *abfd, const asection *sec)
{
- return bfd_arch_mach_octets_per_byte (bfd_get_arch (abfd),
- bfd_get_mach (abfd));
+ unsigned int opb = bfd_arch_mach_octets_per_byte (bfd_get_arch (abfd),
+ bfd_get_mach (abfd));
+
+ if (bfd_get_flavour (abfd) == bfd_target_elf_flavour
+ && sec != NULL
+ && (sec->flags & SEC_ELF_OCTETS) != 0)
+ opb = 1;
+
+ return opb;
}
/*