Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default linker script fails to support RESTART button for MDB #147

Open
beihuang00 opened this issue Mar 18, 2021 · 3 comments
Open

default linker script fails to support RESTART button for MDB #147

beihuang00 opened this issue Mar 18, 2021 · 3 comments
Assignees

Comments

@beihuang00
Copy link

Issue Summary

  • Type: Bug
  • Category: Example
  • Priority: High
  • Release Version: Specified version such as 2019.06

Bug

Development Environment

  • HOST OS
    all OS

  • TOOLCHAIN
    MWDT R-2020.12

  • BOARD
    HSDK, EMSDP

  • ARC CORE
    HS38, EM11D_DFSS

Bug Description

The default linker script for mw have a relocate 'AT >' for .data section:
at line 81 of embarc_osp-2019.06\board\linker_template_mw.ld
GROUP : { .data ALIGN(8): { _f_data = .; _f_sdata = .; *(.sdata) *(.sbss) _e_sdata = .; *(TYPE data) } .tls ALIGN(8): { *(.tls*) _e_data = .; } } > REGION_RAM AT > REGION_ROM
This results in that Metaware Linker trate .data section as read-only.

Problem is that, for HSDK and EMSDP board, .data section is relocated to the same memory space:
} > REGION_EXT_RAM AT > REGION_EXT_RAM
This causes problem for RESTART button in Metaware Debugger.
If the content for .data section was modified in last execution, when users click RESTART button to rerun the program, Debugger re-load the elf and do elf verify check for some memory address spot. The flagged .data section will not be re-loaded by Debugger during the RESTART procedure, and the modified .data section content leads to elf verify check fail - users not able to do RESTART.

This issue can be easily reproduced by example embarc_osp-2019.06\example\baremetal\arc_feature\cache on HSDK or EMSDP.


Enhancement

fix the default linker


Question

What is the design purpose of EMBARC OSP for making .data section to be relocated by default?
Is it can be fixed simply by removing the relocation 'AT >'?

@beihuang00
Copy link
Author

Bug found in a presales evaluation project. Hope to be fixed ASAP to get more chance to win this customer.

@YuguoWH YuguoWH self-assigned this Mar 18, 2021
@beihuang00
Copy link
Author

image

@YuguoWH
Copy link
Contributor

YuguoWH commented Mar 19, 2021

Hi @beihuang00 , thanks for reporting this issue. I'm fixing the issue in 748992d (tested this commit on HSDK (hs38) and EMSK (em7d) )
And for the question you raised, I suppose that was designed for XIP (execute in place) devices, which is not the case for our HSDK, EMSK, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants