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

arch: arm: aarch64: linker.ld: Fix ROM section names #22673

Merged

Conversation

stephanosio
Copy link
Member

This commit fixes the improper naming of the ROM sections.

  1. Rename the first ROM section, which was previously named using the
    _TEXT_SECTION_NAME definition, to rom_start, as this section does
    not actually represent the text section.

  2. Rename the second ROM section, which was previously named
    _TEXT_SECTION_NAME_2 which supposedly refers to the definition of
    the same name that does not exist, to _TEXT_SECTION_NAME. Note that
    this is indeed the section that contains the text section from the
    source image.

Signed-off-by: Stephanos Ioannidis root@stephanos.io

@stephanosio stephanosio added area: ARM ARM (32-bit) Architecture area: Linker Scripts labels Feb 10, 2020
@stephanosio stephanosio linked an issue Feb 10, 2020 that may be closed by this pull request
@zephyrbot zephyrbot added the area: API Changes to public APIs label Feb 10, 2020
@stephanosio stephanosio added the bug The issue is a bug, or the PR is fixing a bug label Feb 10, 2020
@stephanosio stephanosio added this to the v2.2.0 milestone Feb 10, 2020
@jhedberg
Copy link
Member

@stephanosio could you rebase? There seems to some conflict with include/arch/arm/aarch64/scripts/linker.ld

This commit cleans-up the linker.ld file for the AArch64 arch.

* Convert all TAB characters to SPACE.
* Fix insane placement of curly brackets.
* Fix overall text alignments.
* Remove the special handlings for the Cortex-M devices that were
  copied from `include/arm/aarch32/cortex_m/scripts/linker.ld`.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit fixes the improper naming of the ROM sections.

1. Rename the first ROM section, which was previously named using the
  `_TEXT_SECTION_NAME` definition, to `rom_start`, as this section does
  not actually represent the text section.

2. Rename the second ROM section, which was previously named
  `_TEXT_SECTION_NAME_2` which supposedly refers to the definition of
  the same name that does not exist, to `_TEXT_SECTION_NAME`. Note that
  this is indeed the section that contains the text section from the
  source image.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit relocates the `_vector_end` symbol that was previously
placed after the OpenOCD sections to before these sections, as the
OpenOCD debug sections are not part of the "vector table."

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
@stephanosio stephanosio force-pushed the aarch64_fix_rom_section_names branch from dd4bdc5 to 6363187 Compare February 12, 2020 02:15
@stephanosio
Copy link
Member Author

Rebased

@ioannisg ioannisg merged commit f2e2b66 into zephyrproject-rtos:master Feb 12, 2020
Abhishek-brcm added a commit to Broadcom/zephyr that referenced this pull request Feb 20, 2020
Following changes are done:
- The vector table should be placed in text segment.
- Removed Vector relay table related entries as it is
  only applicable to aarch32.
- irq_vector_table contains ISR pointers - should be placed
  in rodata segment.
- put openocd_dbg in rodata and skip adding <linker_relocate.ld>
  as CONFIG_CODE_DATA_RELOCATION is not defined for aarch64
  currently (add later if needed).

Fixes: zephyrproject-rtos#22673
Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
jhedberg pushed a commit that referenced this pull request Feb 20, 2020
Following changes are done:
- The vector table should be placed in text segment.
- Removed Vector relay table related entries as it is
  only applicable to aarch32.
- irq_vector_table contains ISR pointers - should be placed
  in rodata segment.
- put openocd_dbg in rodata and skip adding <linker_relocate.ld>
  as CONFIG_CODE_DATA_RELOCATION is not defined for aarch64
  currently (add later if needed).

Fixes: #22673
Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
@stephanosio stephanosio deleted the aarch64_fix_rom_section_names branch April 23, 2020 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: ARM ARM (32-bit) Architecture area: Linker Scripts bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

_TEXT_SECTION_NAME_2 on ARM Cortex-R
6 participants