Andes Workshop

It is currently Thu Mar 28, 2024 8:04 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Cut section (objcopy option -R)
PostPosted: Thu Mar 06, 2014 11:38 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
This is a example:
Attachment:
3.png
3.png [ 34.75 KiB | Viewed 12130 times ]

The bin file is from 0x0~0x30004, size is 0x30004 bytes. (196612 bytes)
Attachment:
2.png
2.png [ 46.21 KiB | Viewed 12131 times ]

Sample code:
Attachment:
cut-section-original.zip [22.35 KiB]
Downloaded 822 times

----------------------------------------------------------------
Remove the last section .section2 from bin file.
The new bin file is from 0x0~0x2004, size is 0x2004 bytes. (8196 bytes)
Command:
nds32le-elf-objcopy -S -O binary -R .section2 "cut-section-remove.adx" output/cut-section-remove.bin

AndeSight setting:
Attachment:
6.png
6.png [ 70.22 KiB | Viewed 12130 times ]

Attachment:
5.png
5.png [ 33.52 KiB | Viewed 12130 times ]


Attachment:
4.png
4.png [ 31.76 KiB | Viewed 12130 times ]

Sample:
Attachment:
cut-section-remove.zip [22.18 KiB]
Downloaded 747 times


Top
 Profile Send private message E-mail  
 
 Post subject: Re: Cut section (objcopy option -R)
PostPosted: Fri Mar 21, 2014 3:36 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
Another way:
Set .mybss as "@nobits!".
Code:
__attribute__((section(".mybss, \"aw\", @nobits!")))


Top
 Profile Send private message E-mail  
 
 Post subject: Re: Cut section (objcopy option -R)
PostPosted: Tue Aug 12, 2014 11:09 am 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
If you want only copy section, you can use -j option
-j --only-section <name> Only copy section <name> into the output
Attachment:
_j.png
_j.png [ 48.58 KiB | Viewed 11850 times ]


Top
 Profile Send private message E-mail  
 
 Post subject: Re: Cut section (objcopy option -R)
PostPosted: Tue Aug 12, 2014 11:20 am 
Offline

Joined: Wed Apr 13, 2011 7:44 pm
Posts: 23
Only output specific section .section1 from .adx file to .bin file.

Only section command:
nds32le-elf-objcopy -S -O binary -j .section1 "cut-section-remove.adx" output/only-section1.bin

The output "only-section1.bin" will be 0x000004d2 = 1234.


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group