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

_TEXT_SECTION_NAME_2 on ARM Cortex-R #21650

Closed
andrewboie opened this issue Jan 2, 2020 · 7 comments · Fixed by #22673
Closed

_TEXT_SECTION_NAME_2 on ARM Cortex-R #21650

andrewboie opened this issue Jan 2, 2020 · 7 comments · Fixed by #22673
Assignees
Labels
area: ARM ARM (32-bit) Architecture bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@andrewboie
Copy link
Contributor

andrewboie commented Jan 2, 2020

Describe the bug
ARM platforms define a _TEXT_SECTION_NAME_2 which ends up in the final binary.
This isn't right. We just want one text section, if stuff needs to be aligned internally we can do that within the text section itself.

Delete the exception for _TEXT_SECTION_NAME_2 in scripts/sanitycheck (=> #22675).

@andrewboie andrewboie added bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug labels Jan 2, 2020
@ioannisg ioannisg added the area: ARM ARM (32-bit) Architecture label Jan 3, 2020
@ioannisg
Copy link
Member

As far as I could see this has little to do with alignment @andrewboie , it is rather related to the code relocation work done in #10892

I wonder if we could simply rename the initial TEXT Section that contains the vector table to something else.

@ioannisg ioannisg self-assigned this Jan 10, 2020
@ioannisg
Copy link
Member

I wonder if we could simply rename the initial TEXT Section that contains the vector table to something else.

@wentongwu do you think we can do the above?

@wentongwu
Copy link
Contributor

wentongwu commented Jan 13, 2020

I wonder if we could simply rename the initial TEXT Section that contains the vector table to something else.

@wentongwu do you think we can do the above?

@ioannisg I think we can rename this section, maybe _vector_table_section.

@ioannisg
Copy link
Member

I wonder if we could simply rename the initial TEXT Section that contains the vector table to something else.

@wentongwu do you think we can do the above?

@ioannisg I think we can rename this section, maybe _vector_table_section.

@wentongwu @andrewboie I am ok with that. Actually, at least 2 other architectures, Risc-V and Nios2 have a similar thing, that is, several sections at the beginning of ROM (vector, reset exception section) followed by the text section.
This means that __image_rom_start and __image_text_start will be different. The whole thing seems trivial; I'll send a PR and we can take the discussion there. I would like to make sure we are not breaking anything by doing that.

@andrewboie
Copy link
Contributor Author

@ioannisg sounds right -- what we really have here is a special rodata section immediately before the actual program text.

Thinking out loud: could we just reverse the order of the text and rodata sections? So what we have now is:

vector table and other special rom
text section
.ARM.extab (more special ROM)
.ARM.exidx (more special ROM)
rodata section

Could we just do

rodata section (containing vector table + extab/exidx + zephyr rodata)
text section

@ioannisg
Copy link
Member

#21874 fixes this for Cortex-M, I would prefer if @stephanosio provides the fix for Cortex-R.

@ioannisg ioannisg assigned stephanosio and unassigned ioannisg Jan 16, 2020
@ioannisg ioannisg changed the title _TEXT_SECTION_NAME_2 on ARM 32-bit _TEXT_SECTION_NAME_2 on ARM Cortex-R Jan 31, 2020
@stephanosio
Copy link
Member

@ioannisg I will look into this on Monday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ARM ARM (32-bit) Architecture bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants