is there a way to adding custom sections consecutively with mingw32-gcc linker ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

is there a way to adding custom sections consecutively with mingw32-gcc linker ?

Kağan Tantan
Hi,
In my source codes, i want to define some variable under different sections and these sections can be defined in different .c files. My desire, while i am compiling and linking source code, these sections will be added consecutively in memory with linker options command or compiler options command.
For example,
In section1, i defined two integer (var1, var2) and in section2, i also defined two integer variable(var3, var4).
After compiling, if var1's address is 00403000, var3's address should be 00403008.

Does any know of a way to do those things on windows with mingw linker? Thanks in advance! and sorry for my sloppy english.

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: is there a way to adding custom sections consecutively with mingw32-gcc linker ?

Eli Zaretskii
> Date: Thu, 21 Apr 2016 17:33:00 +0300
> From: Kağan Tantan <[hidden email]>
>
> In my source codes, i want to define some variable under different sections and these sections can be defined
> in different .c files. My desire, while i am compiling and linking source code, these sections will be added
> consecutively in memory with linker options command or compiler options command.
>
> For example,
>
> In section1, i defined two integer (var1, var2) and in section2, i also defined two integer variable(var3, var4).
>
> After compiling, if var1's address is 00403000, var3's address should be 00403008.
>
> Does any know of a way to do those things on windows with mingw
> linker?

Did you try writing your own linker script by modifying the standard
one?  Binutils should come with these scripts, and their structure is
documented in the manual.

> Thanks in advance! and sorry for my sloppy english.

There's nothing wrong with your English.

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Loading...