llvm-6502/test/MC/PowerPC/ppc64-initial-cfa.s
Ulrich Weigand c1f4a4b264 [MC/DWARF] Support .debug_frame / .debug_line code alignment factors
I've been comparing the object file output of LLVM's integrated
assembler against the external assembler on PowerPC, and one
area where differences still remain are in DWARF sections.

In particular, the GNU assembler generates .debug_frame and
.debug_line sections using a code alignment factor of 4, since
all PowerPC instructions have size 4 and must be aligned to a
multiple of 4.  However, current MC code hard-codes a code
alignment factor of 1.

This patch changes this by adding a "minimum instruction alignment"
data element to MCAsmInfo and using this as code alignment factor.

This requires passing a MCContext into MCDwarfLineAddr::Encode
and MCDwarfLineAddr::EncodeAdvanceLoc.  Note that one caller,
MCDwarfLineAddr::Write, didn't actually have that information
available.  However, it turns out that this routine is in fact
never used in the whole code base, so the patch simply removes
it.  If it turns out to be needed again at a later time, it
could be re-added with an updated interface.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183834 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-12 14:46:54 +00:00

85 lines
2.4 KiB
ArmAsm

# RUN: llvm-mc -triple=powerpc64-unknown-linux-gnu -filetype=obj -relocation-model=static %s | \
# RUN: llvm-readobj -s -sr -sd | FileCheck %s -check-prefix=STATIC
# RUN: llvm-mc -triple=powerpc64-unknown-linux-gnu -filetype=obj -relocation-model=pic %s | \
# RUN: llvm-readobj -s -sr -sd | FileCheck %s -check-prefix=PIC
.cfi_startproc
nop
.cfi_endproc
# STATIC: Section {
# STATIC: Name: .eh_frame
# STATIC-NEXT: Type: SHT_PROGBITS
# STATIC-NEXT: Flags [ (0x2)
# STATIC-NEXT: SHF_ALLOC
# STATIC-NEXT: ]
# STATIC-NEXT: Address:
# STATIC-NEXT: Offset:
# STATIC-NEXT: Size: 40
# STATIC-NEXT: Link: 0
# STATIC-NEXT: Info: 0
# STATIC-NEXT: AddressAlignment: 8
# STATIC-NEXT: EntrySize:
# STATIC-NEXT: Relocations [
# STATIC-NEXT: ]
# STATIC-NEXT: SectionData (
# STATIC-NEXT: 0000: 00000010 00000000 017A5200 04784101
# STATIC-NEXT: 0010: 1B0C0100 00000010 00000018 00000000
# STATIC-NEXT: 0020: 00000004 00000000
# STATIC-NEXT: )
# STATIC-NEXT: }
# STATIC: Section {
# STATIC: Name: .rela.eh_frame
# STATIC-NEXT: Type: SHT_RELA
# STATIC-NEXT: Flags [ (0x0)
# STATIC-NEXT: ]
# STATIC-NEXT: Address:
# STATIC-NEXT: Offset:
# STATIC-NEXT: Size: 24
# STATIC-NEXT: Link:
# STATIC-NEXT: Info:
# STATIC-NEXT: AddressAlignment: 8
# STATIC-NEXT: EntrySize: 24
# STATIC-NEXT: Relocations [
# STATIC-NEXT: 0x1C R_PPC64_REL32 .text 0x0
# STATIC-NEXT: ]
# PIC: Section {
# PIC: Name: .eh_frame
# PIC-NEXT: Type: SHT_PROGBITS
# PIC-NEXT: Flags [ (0x2)
# PIC-NEXT: SHF_ALLOC
# PIC-NEXT: ]
# PIC-NEXT: Address:
# PIC-NEXT: Offset:
# PIC-NEXT: Size: 40
# PIC-NEXT: Link: 0
# PIC-NEXT: Info: 0
# PIC-NEXT: AddressAlignment: 8
# PIC-NEXT: EntrySize: 0
# PIC-NEXT: Relocations [
# PIC-NEXT: ]
# PIC-NEXT: SectionData (
# PIC-NEXT: 0000: 00000010 00000000 017A5200 04784101
# PIC-NEXT: 0010: 1B0C0100 00000010 00000018 00000000
# PIC-NEXT: 0020: 00000004 00000000
# PIC-NEXT: )
# PIC-NEXT: }
# PIC: Section {
# PIC: Name: .rela.eh_frame
# PIC-NEXT: Type: SHT_RELA
# PIC-NEXT: Flags [ (0x0)
# PIC-NEXT: ]
# PIC-NEXT: Address:
# PIC-NEXT: Offset:
# PIC-NEXT: Size: 24
# PIC-NEXT: Link:
# PIC-NEXT: Info:
# PIC-NEXT: AddressAlignment: 8
# PIC-NEXT: EntrySize: 24
# PIC-NEXT: Relocations [
# PIC-NEXT: 0x1C R_PPC64_REL32 .text 0x0
# PIC-NEXT: ]