OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [binutils-2.18.50/] [ld/] [testsuite/] [ld-mips-elf/] [eh-frame1.s] - Diff between revs 38 and 156

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 38 Rev 156
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
# Macros
# Macros
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
 
 
        mask = (1 << alignment) - 1
        mask = (1 << alignment) - 1
 
 
        # Output VALUE as an unaligned pointer-sized quantity.
        # Output VALUE as an unaligned pointer-sized quantity.
        .macro pbyte value
        .macro pbyte value
        .if alignment == 2
        .if alignment == 2
        .4byte          \value
        .4byte          \value
        .else
        .else
        .8byte          \value
        .8byte          \value
        .endif
        .endif
        .endm
        .endm
 
 
 
 
        # Start a new CIE, and emit everything up to the augmentation data.
        # Start a new CIE, and emit everything up to the augmentation data.
        # Use LABEL to mark the start of the entry and AUG as the augmentation
        # Use LABEL to mark the start of the entry and AUG as the augmentation
        # string.
        # string.
        .macro start_cie label,aug
        .macro start_cie label,aug
        .section        .eh_frame,"aw",@progbits
        .section        .eh_frame,"aw",@progbits
\label:
\label:
        .word           2f-1f           # Length
        .word           2f-1f           # Length
1:
1:
        .word           0                # Identifier
        .word           0                # Identifier
        .byte           1               # Version
        .byte           1               # Version
        .string         "\aug"          # Augmentation
        .string         "\aug"          # Augmentation
        .byte           1               # Code alignment
        .byte           1               # Code alignment
        .byte           4               # Data alignment
        .byte           4               # Data alignment
        .byte           31              # Return address column
        .byte           31              # Return address column
        .endm
        .endm
 
 
 
 
        # Create a dummy function of SIZE bytes in SECTION and emit the
        # Create a dummy function of SIZE bytes in SECTION and emit the
        # first four entries of an FDE for it.
        # first four entries of an FDE for it.
        .macro start_fde cie,section,size
        .macro start_fde cie,section,size
        .section        \section,"ax",@progbits
        .section        \section,"ax",@progbits
3:
3:
        .rept           \size / 4
        .rept           \size / 4
        nop
        nop
        .endr
        .endr
4:
4:
        .section        .eh_frame,"aw",@progbits
        .section        .eh_frame,"aw",@progbits
        .word           2f-1f           # Length
        .word           2f-1f           # Length
1:
1:
        .word           .-\cie          # CIE offset
        .word           .-\cie          # CIE offset
        pbyte           3b              # Initial PC
        pbyte           3b              # Initial PC
        pbyte           4b-3b           # Size of code
        pbyte           4b-3b           # Size of code
        .endm
        .endm
 
 
 
 
        # Finish a CIE or FDE entry.
        # Finish a CIE or FDE entry.
        .macro end_entry
        .macro end_entry
        .p2align        alignment,fill
        .p2align        alignment,fill
2:
2:
        .endm
        .endm
 
 
 
 
        # Start the augmentation data for a CIE that has a 'P' entry
        # Start the augmentation data for a CIE that has a 'P' entry
        # followed by EXTRA bytes.  AUGLEN is the length of augmentation
        # followed by EXTRA bytes.  AUGLEN is the length of augmentation
        # string (including zero terminator), ENCODING is the encoding to
        # string (including zero terminator), ENCODING is the encoding to
        # use for the personality routine and VALUE is the value it
        # use for the personality routine and VALUE is the value it
        # should have.
        # should have.
        .macro          persaug auglen,extra,encoding,value
        .macro          persaug auglen,extra,encoding,value
        .if (\encoding & 0xf0) == 0x50
        .if (\encoding & 0xf0) == 0x50
        .byte           (-(9 + \auglen + 3 + 2) & mask) + 2 + mask + \extra
        .byte           (-(9 + \auglen + 3 + 2) & mask) + 2 + mask + \extra
        .byte           \encoding
        .byte           \encoding
        .fill           -(9 + \auglen + 3 + 2) & mask,1,0
        .fill           -(9 + \auglen + 3 + 2) & mask,1,0
        .else
        .else
        .byte           2 + mask + \extra
        .byte           2 + mask + \extra
        .byte           \encoding
        .byte           \encoding
        .endif
        .endif
        pbyte           \value
        pbyte           \value
        .endm
        .endm
 
 
 
 
        .macro cie_basic label
        .macro cie_basic label
        start_cie       \label,""
        start_cie       \label,""
        end_entry
        end_entry
        .endm
        .endm
 
 
        .macro fde_basic cie,section,size
        .macro fde_basic cie,section,size
        start_fde       \cie,\section,\size
        start_fde       \cie,\section,\size
        end_entry
        end_entry
        .endm
        .endm
 
 
 
 
        .macro cie_zP label,encoding,value
        .macro cie_zP label,encoding,value
        start_cie        \label,"zP"
        start_cie        \label,"zP"
        persaug         3,0,\encoding,\value
        persaug         3,0,\encoding,\value
        end_entry
        end_entry
        .endm
        .endm
 
 
        .macro fde_zP cie,section,size
        .macro fde_zP cie,section,size
        start_fde        \cie,\section,\size
        start_fde        \cie,\section,\size
        .byte            0               # Augmentation length
        .byte            0               # Augmentation length
        end_entry
        end_entry
        .endm
        .endm
 
 
 
 
        .macro cie_zPR label,encoding,value
        .macro cie_zPR label,encoding,value
        start_cie        \label,"zPR"
        start_cie        \label,"zPR"
        persaug         4,1,\encoding,\value
        persaug         4,1,\encoding,\value
        .byte           0                # FDE enconding
        .byte           0                # FDE enconding
        end_entry
        end_entry
        .endm
        .endm
 
 
        .macro fde_zPR cie,section,size
        .macro fde_zPR cie,section,size
        start_fde       \cie,\section,\size
        start_fde       \cie,\section,\size
        .byte           0                # Augmentation length
        .byte           0                # Augmentation length
        end_entry
        end_entry
        .endm
        .endm
 
 
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
# Test code
# Test code
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
 
 
        cie_basic       basic1
        cie_basic       basic1
        fde_basic       basic1,.text,0x10
        fde_basic       basic1,.text,0x10
        fde_basic       basic1,.text,0x20
        fde_basic       basic1,.text,0x20
 
 
        cie_basic       basic2
        cie_basic       basic2
        fde_basic       basic2,.text,0x30
        fde_basic       basic2,.text,0x30
 
 
        cie_basic       basic3
        cie_basic       basic3
        fde_basic       basic3,.text,0x40
        fde_basic       basic3,.text,0x40
 
 
        cie_basic       basic4
        cie_basic       basic4
        fde_basic       basic4,.text,0x50
        fde_basic       basic4,.text,0x50
 
 
        cie_zP          zP_unalign1,0x00,foo
        cie_zP          zP_unalign1,0x00,foo
        fde_zP          zP_unalign1,.text,0x10
        fde_zP          zP_unalign1,.text,0x10
        fde_zP          zP_unalign1,.text,0x20
        fde_zP          zP_unalign1,.text,0x20
 
 
        cie_zP          zP_align1,0x50,foo
        cie_zP          zP_align1,0x50,foo
        fde_zP          zP_align1,.text,0x10
        fde_zP          zP_align1,.text,0x10
        fde_zP          zP_align1,.text,0x20
        fde_zP          zP_align1,.text,0x20
 
 
        cie_zPR         zPR1,0x00,foo
        cie_zPR         zPR1,0x00,foo
        fde_zPR         zPR1,.text,0x10
        fde_zPR         zPR1,.text,0x10
        fde_zPR         zPR1,.discard,0x20
        fde_zPR         zPR1,.discard,0x20
 
 
        cie_zPR         zPR2,0x00,foo
        cie_zPR         zPR2,0x00,foo
        fde_zPR         zPR2,.text,0x30
        fde_zPR         zPR2,.text,0x30
        fde_zPR         zPR2,.text,0x40
        fde_zPR         zPR2,.text,0x40
 
 
        cie_basic       basic5
        cie_basic       basic5
        fde_basic       basic5,.text,0x10
        fde_basic       basic5,.text,0x10
 
 
        .if alignment == 2
        .if alignment == 2
        .section        .gcc_compiled_long32
        .section        .gcc_compiled_long32
        .endif
        .endif
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.