Project

General

Profile

Feature #10071

Влияние секции section_text на расположение exception_handler

Added by Alexander Protsenko 9 months ago.

Status:
New
Priority:
Normal
Category:
Configuration
Target version:
Start date:
01/24/2020
Due date:
% Done:

0%

Estimated time:
Published in build:

Description

    section_text(:pa => 0x0000_2000, :va => 0x0000_2000) {}

    #
    # Defines .data section.
    #
    # pa: base physical address (used for memory allocation).
    # va: base virtual address (used for encoding instructions that refer to labels).
    #
    section_data(:pa => 0x0008_0000, :va => 0x0008_0000) {}

    #
    # Simple exception handler. Continues execution from the next instruction.
    #
    exception_handler {
      entry_point(:org => 0x380, :exception => ['IntegerOverflow', 'SystemCall', 'Breakpoint']) {
        trace 'Exception handler (EPC = 0x%x)', location('COP0_R', 14)
        mfc0 ra, rcop0(14)
        addi ra, ra, 4
        jr ra
        nop
      }
    }
------------------------------- Allocating code --------------------------------

Section: .text [pa=0x0000000000002000, va=0x0000000000002000]

Directive: .org 0x380
0x0000000000002380 (PA): mfc0 $31, $14 (0x401F7000)
0x0000000000002384 (PA): addi $31, $31, 0x4 (0x23FF0004)
0x0000000000002388 (PA): jr $31 (0x03E00008)
0x000000000000238c (PA): nop (0x00000000)

Возможно стоит убрать это влияние, и записывать exception_handler, например, так:

    exception_handler(:pa => 0x0000_0000, :va => 0x0000_0000) {
      entry_point(:org => 0x380, :exception => ['IntegerOverflow', 'SystemCall', 'Breakpoint']) {
        trace 'Exception handler (EPC = 0x%x)', location('COP0_R', 14)
        mfc0 ra, rcop0(14)
        addi ra, ra, 4
        jr ra
        nop
      }
    }


Files

bubble_sort.rb (2.75 KB) bubble_sort.rb Alexander Protsenko, 01/24/2020 05:15 PM
minimips_base.rb (13.2 KB) minimips_base.rb Alexander Protsenko, 01/24/2020 05:15 PM

Also available in: Atom PDF