[PATCH] D30724: Dont emit Mapping symbols for Non allocatable sections.

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 7 18:38:07 PST 2017


t.p.northover added a comment.

> Why would you want mapping symbols for non allocatable sections anyways ? Isnt the mapping symbols meant only for proper disassembly ?

Depends entirely on usage (embedded developers in particular do really weird things and I could see them creating a non-allocatable section that they read in later for giggles). In principle I think it's reasonable that any section which contains mixed data and code needs mapping symbols. There's no other way to unambiguously know what you're looking at.

> What would be an alternative to key off ? The next option is keying off section names, but this would make it odd.

You'd keep track of whether a section contained only data and decide at the end whether you need to emit mapping symbols based on that. This actually appears to be what GCC does, if you try a .s file like this:

  @ No mapping symbols: only contains data
  .section .debug_info,"",%progbits
  .word 42
  
  @ Mixed stuff, so mapping symbols emitted
  .section .debug_lines,"",%progbits
  mov r0, #3
  .word 42


Repository:
  rL LLVM

https://reviews.llvm.org/D30724





More information about the llvm-commits mailing list