elf: Add missing assignment for octets per byte

Message ID 20200216191630.26280-1-ceggers@gmx.de
State New
Headers show
Series
  • elf: Add missing assignment for octets per byte
Related show

Commit Message

Christian Eggers Feb. 16, 2020, 7:16 p.m.
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(-)

--
2.16.4

Comments

Nick Clifton March 2, 2020, 4:31 p.m. | #1
Hi Christian,

> 	* elf.c (_bfd_elf_make_section_from_shdr): Assign opb=1 when

> 	setting SEC_ELF_OCTETS.

 
Approved, please apply.

Cheers
  Nick

Patch

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)
 	    {