-
-
Notifications
You must be signed in to change notification settings - Fork 464
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
Help with --section-order and putting sections at different addresses #1173
Comments
It's hard to debug without reproducing the issue locally. If your program is open-source, can you give me a pointer to the source code? |
Im trying to find a way but what i am seeing is the toolchain is producing 2 sections with the same name but with different flags
|
Also I have 2 sections called time_critial and time_critical_d, time_critical_d is the only one that is put at address 0x20100, time_critical is just added to the .text, but as you can see the compler has produced a new section for each function. Objdump gives
|
I have the linker linking my project, but still missing initdata and a few other problems with sections. Im plodding on |
Let me know if there's anything I can help. |
I would love some help in creating the .initdat section.
I have the SVR3 parser working and a new
sort_output_sections_by_linker_script and
set_virtual_addresses_by_linker_script which do the mapping from the
linker script, but i cannot work out where to add the initdat section
creation and where to populate this.
So what is needed if the INITDATA is in the linker script, which can be
checked by looking at a new variable in ctx.arg,
std::vector<std::string> initdata_list;
which in my test case will contain ".code_in_iccm", "data" and "bss" as
the 3 strings
1. inidat section created after sorting of the chunks
2. Match the section name against the list in initdata_list, and if
marked as as BSS append 2 longs into the initdat section,
chunk.shdr.sh_addr and -chunk.shdr.sh_size, otherwise append 2 longs,
chunk.shdr.sh_addr and chunk.shdr.sh_size, and the data in the chunk
3. Remove these chunks from the output section.
4. Append 2 longs to the initdat section, 0 and 0
5. Create 2 symbols "_initdat" with start address of section and
"_einitdat" with the end address.
…On 2024-02-17 06:59, Rui Ueyama wrote:
Let me know if there's anything I can help.
--
Reply to this email directly, view it on GitHub [1], or unsubscribe
[2].
You are receiving this because you authored the thread.Message ID:
***@***.***>
Links:
------
[1] #1173 (comment)
[2]
https://github.com/notifications/unsubscribe-auth/AAIUQ6FPEE2CP26VQQP6PA3YUBBMPAVCNFSM6AAAAABBUQHT2OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBZG4YTQMZSHA
|
So, you are extending mold to support linker script SECTION command? It seems what is needed to do to sort it is complicated, and that's why I didn't support it in the first place. So I don't have an answer to your question. Sorry. |
Thats a shame as it is only missing the INITDATA processing which would allow mold to be used on embedded projects. I will carry on and try to integrate this in the code, but its hard work.... |
Did you make all the other linker script command work for mold? |
Not 100 but most of the SVR3 works, I get a full link with all sections begin at the right addresses and the right sizes. And as I keep saying the only thing I am missing is being able to process the INITDATA option. Once this is done I need to start looking into a few parts that are not implemented, FILL/BYTE/WORD/LONG/ etc I also have a list of bits that are not working
As you see there are a lot of things that I dont need that do need to be implemented once I can finally build the image with a .initdat section. |
OK. Got my initdata section up and running BUT i need to copy the contents of the data/code segemnts into the new segment and then remove the old data from the output list. Here is the copy_buf code which gets a vector list of
So how do I get access to the data in the sections that need copied? Thanks in advance Joolz |
Trying to get mold to work with a new processor type, ARC, and also get it working in the embedded world.
What i am trying to do is use the --section-order to create the sections needed and then use arc-elf32-objcopy tool to move certain sections, .bss/.data/.fastcode, into an new initdata section so on boot we can copy this data into the correct areas.
So my cli looks a bit like this
"--section-order=EHDR PHDR =0x20000 .fastcode =0x100000 ! .vectors TEXT RODATA .ctors .dtors =0x800000 !SDA_BASE DATA !BSS_BASE BSS !_fheap .heap !_eheap .stack !_estack"
Now the problem I am finding is that the fastcode is not put into the area 0x20000, but is added at the end of the normal .text area.
Any work around for this?
The text was updated successfully, but these errors were encountered: