[all-commits] [llvm/llvm-project] 292764: [MC][ELF] Do not error on parsing .debug_* section...

Tobias Burnus via All-commits all-commits at lists.llvm.org
Tue Dec 14 17:33:59 PST 2021


  Branch: refs/heads/release/13.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 29276490d13c9368b556d109353b6091404a37a2
      https://github.com/llvm/llvm-project/commit/29276490d13c9368b556d109353b6091404a37a2
  Author: Simon Atanasyan <simon at atanasyan.com>
  Date:   2021-12-14 (Tue, 14 Dec 2021)

  Changed paths:
    M llvm/lib/MC/MCParser/ELFAsmParser.cpp
    M llvm/test/MC/Mips/elf-debug-section.s

  Log Message:
  -----------
  [MC][ELF] Do not error on parsing .debug_* section directive for MIPS

MIPS .debug_* sections should have SHT_MIPS_DWARF section type to
distinguish among sections contain DWARF and ECOFF debug formats, but in
assembly files these sections have SHT_PROGBITS (@progbits) type. Now
assembler shows 'changed section type for ...' error when parsing
`.section .debug_*,"", at progbits` directive for MIPS targets.

The same problem exists for x86-64 target and this patch extends
workaround implemented in D76151. The patch adds one more case
when assembler ignores section types mismatch after `SwitchSection()`
call.

Differential Revision: https://reviews.llvm.org/D107707

(cherry picked from commit 990e8025b5fcac42da6e7ce082cd9bf81b4fbbf7)


  Commit: 5932c004778cf251302db0d46d1dfb247325ed3f
      https://github.com/llvm/llvm-project/commit/5932c004778cf251302db0d46d1dfb247325ed3f
  Author: Tobias Burnus <tobias at codesourcery.com>
  Date:   2021-12-14 (Tue, 14 Dec 2021)

  Changed paths:
    M llvm/lib/MC/MCParser/ELFAsmParser.cpp
    M llvm/test/MC/ELF/section-omitted-attributes.s

  Log Message:
  -----------
  [MC][ELF] Fix accepting abbreviated form with Type change

Follow up to D92052 and D94072, exposed due to D107707

Many assemblers to permit that only the first .section contains all
the attributes like '.lds_bss,"w", at nobits' and later section only
use the name ('.lds_bss') inheriting those attributes from the first
section.  I turned out that the case that Type changed was missed
when implementing it - and D107707 make it much more likely to hit
that issue. That's fixed by this commit.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D114717

(cherry picked from commit c01c62c76c60a5a5da0496e41faae907944c92dd)


Compare: https://github.com/llvm/llvm-project/compare/724ed207b760...5932c004778c


More information about the All-commits mailing list