1

I'm porting a MIPS assembler program (non-MIPSPro compatible syntax) that uses sect() and sectend() functions. Looks like they return the start and end addresses of the section. Seems GNU AS docs does not supports anything similar - any ideas how to code this in GAS syntax?

Here are some examples.

        la  t0,sect(.bss)
        la  t1,sectend(.bss)
    @clear:
        sw  zero,0(t0)
        addiu   t0,t0,4
        sltu    at,t0,t1
        bne at,zero,@clear
        nop

....

__text  dw  sect(.text)
__textlen   dw  sectend(.text)-sect(.text)
stats_pro
  • 11
  • 2

2 Answers2

0

You may found your answer here and here if you are using a system that run ELF executables.

Community
  • 1
  • 1
neam
  • 894
  • 9
  • 19
0

I believe you put the information (wrap the section with indicators that you can read as variables in the asm) in the linker script. That is how I have seen the .data section get copied from flash to ram, and .bss get zeroed...(using gnu tools).

old_timer
  • 69,149
  • 8
  • 89
  • 168