This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] elf: Add missing assignment for octets per byte
- From: Christian Eggers <ceggers at gmx dot de>
- To: binutils at sourceware dot org
- Cc: Christian Eggers <ceggers at gmx dot de>
- Date: Sun, 16 Feb 2020 20:16:30 +0100
- Subject: [PATCH] elf: Add missing assignment for octets per byte
When setting SEC_ELF_OCTETS, also opb should be set to 1. Shouldn't make
much difference in this case as sh_addr, p_paddr and p_vaddr are usually
0 for .debug sections. Just for completeness.
* elf.c (_bfd_elf_make_section_from_shdr): Assign opb=1 when
setting SEC_ELF_OCTETS.
Signed-off-by: Christian Eggers <ceggers@gmx.de>
---
bfd/elf.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/bfd/elf.c b/bfd/elf.c
index 4ceb28f9ada..10db091856a 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1101,7 +1101,10 @@ _bfd_elf_make_section_from_shdr (bfd *abfd,
if (strncmp (name, ".debug", 6) == 0
|| strncmp (name, ".gnu.linkonce.wi.", 17) == 0
|| strncmp (name, ".zdebug", 7) == 0)
- flags |= SEC_DEBUGGING | SEC_ELF_OCTETS;
+ {
+ flags |= SEC_DEBUGGING | SEC_ELF_OCTETS;
+ opb = 1;
+ }
else if (strncmp (name, GNU_BUILD_ATTRS_SECTION_NAME, 21) == 0
|| strncmp (name, ".note.gnu", 9) == 0)
{
--
2.16.4