* Re: reading elf section data
2007-11-12 13:36 reading elf section data Gery
@ 2007-11-12 10:55 ` Glynn Clements
2007-11-12 11:29 ` Steve Graegert
2007-11-12 18:25 ` Gery
2007-11-13 9:13 ` Kristof Provost
1 sibling, 2 replies; 11+ messages in thread
From: Glynn Clements @ 2007-11-12 10:55 UTC (permalink / raw)
To: zaphod001; +Cc: linux-c-programming
Gery wrote:
> How to read in human format data from elf section?
Can you be more specific? What kind of data? What format?
objdump and readelf can provide a lot of information about ELF files,
but they can't decode every type of data which could conceivably be
stored in an ELF file.
--
Glynn Clements <glynn@gclements.plus.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: reading elf section data
2007-11-12 10:55 ` Glynn Clements
@ 2007-11-12 11:29 ` Steve Graegert
2007-11-12 18:37 ` Gery
2007-11-12 18:25 ` Gery
1 sibling, 1 reply; 11+ messages in thread
From: Steve Graegert @ 2007-11-12 11:29 UTC (permalink / raw)
To: Glynn Clements; +Cc: zaphod001, linux-c-programming
On Nov 12, 2007 11:55 AM, Glynn Clements <glynn@gclements.plus.com> wrote:
>
> Gery wrote:
>
> > How to read in human format data from elf section?
>
> Can you be more specific? What kind of data? What format?
I stopped replying to messages like those from the OP. Demanding help
without providing a minimum of information is just annoying, but
doing so without any etiquette is simply rude.
\Steve
--
Steve Grägert
DigitalEther.de
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: reading elf section data
2007-11-12 18:37 ` Gery
@ 2007-11-12 12:07 ` Steve Graegert
2007-11-12 19:11 ` Gery
0 siblings, 1 reply; 11+ messages in thread
From: Steve Graegert @ 2007-11-12 12:07 UTC (permalink / raw)
To: zaphod001; +Cc: linux-c-programming
On Nov 12, 2007 7:37 PM, Gery <zaphod001@gmail.com> wrote:
>
> Steve Graegert wrote:
> > On Nov 12, 2007 11:55 AM, Glynn Clements <glynn@gclements.plus.com> wrote:
> >> Gery wrote:
> >>
> >>> How to read in human format data from elf section?
> >> Can you be more specific? What kind of data? What format?
> >
> > I stopped replying to messages like those from the OP. Demanding help
> > without providing a minimum of information is just annoying, but
> > doing so without any etiquette is simply rude.
> >
> > \Steve
> >
> > --
> >
> > Steve Grägert
> > DigitalEther.de
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
> Just for my understanding :)
> What is OP?
> What is it wrong w/ my etiquette?
> PLease, help me to fix my mistakes.
>
Hi Gery,
Let's start with a greeting, you'll be welcome and you're done with
50% of the "etiquette".
The OP stands for "original poster" and refers to the thread starter.
Finally I like to conclude a post with a closing formula or just a
signature including your name. That's the second part of the
"etiquette".
What I mean by rude is that questions like "How to read ELF data?"
motivates no one to answer as we have to ask for clarification first.
If you'd have asked "How do I read custom ELF sections added by GCC
using C?" everyone knows exactly what you want just by being a bit
more accurate.
Regarding your original question: try readelf first. It'll probably
do the trick.
\Steve
--
Steve Grägert
DigitalEther.de
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* reading elf section data
@ 2007-11-12 13:36 Gery
2007-11-12 10:55 ` Glynn Clements
2007-11-13 9:13 ` Kristof Provost
0 siblings, 2 replies; 11+ messages in thread
From: Gery @ 2007-11-12 13:36 UTC (permalink / raw)
To: linux-c-programming
How to read in human format data from elf section?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: reading elf section data
2007-11-12 18:25 ` Gery
@ 2007-11-12 15:56 ` Glynn Clements
2007-11-13 15:22 ` Gery
0 siblings, 1 reply; 11+ messages in thread
From: Glynn Clements @ 2007-11-12 15:56 UTC (permalink / raw)
To: zaphod001; +Cc: linux-c-programming
Gery wrote:
> i put some structure with gcc attribute to special section named ".my_sec"
> The structure is like
> struct abc {
> char *a;
> char *b;
> };
> and global variable is
> struct abc klm = { "this is 1st string", "this is 2nd string" };
Like this:
struct abc klm __attribute__ ((section (".my_sec"))) = { "this is 1st string", "this is 2nd string" };
?
> Which utility can show me just the data of that section?
$ objdump -j .my_sec -d foo.o
foo.o: file format elf32-i386
Disassembly of section .my_sec:
00000000 <klm>:
0: 00 00 00 00 13 00 00 00 ........
Bear in mind that the structure only contains the pointers, not the
strings themselves. String literals used as values are stored in the
.rodata section. If you want them elsewhere, you'll have to store them
in named variables, e.g.:
static char s1[] __attribute__ ((section (".my_sec"))) = "this is 1st string";
static char s2[] __attribute__ ((section (".my_sec"))) = "this is 2nd string";
struct abc klm __attribute__ ((section (".my_sec"))) = { s1, s2 };
$ objdump -j .my_sec -d foo.o
foo.o: file format elf32-i386
Disassembly of section .my_sec:
00000000 <s1>:
0: 74 68 69 73 20 69 73 20 31 73 74 20 73 74 72 69 this is 1st stri
10: 6e 67 00 ng.
00000013 <s2>:
13: 74 68 69 73 20 69 73 20 32 6e 64 20 73 74 72 69 this is 2nd stri
23: 6e 67 00 00 00 ng...
00000028 <klm>:
28: 00 00 00 00 13 00 00 00 ........
--
Glynn Clements <glynn@gclements.plus.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: reading elf section data
2007-11-12 10:55 ` Glynn Clements
2007-11-12 11:29 ` Steve Graegert
@ 2007-11-12 18:25 ` Gery
2007-11-12 15:56 ` Glynn Clements
1 sibling, 1 reply; 11+ messages in thread
From: Gery @ 2007-11-12 18:25 UTC (permalink / raw)
To: Glynn Clements; +Cc: linux-c-programming
Glynn Clements wrote:
> Gery wrote:
>
>
>> How to read in human format data from elf section?
>>
>
> Can you be more specific? What kind of data? What format?
>
> objdump and readelf can provide a lot of information about ELF files,
> but they can't decode every type of data which could conceivably be
> stored in an ELF file.
>
>
Ok.
i put some structure with gcc attribute to special section named ".my_sec"
The structure is like
struct abc {
char *a;
char *b;
};
and global variable is
struct abc klm = { "this is 1st string", "this is 2nd string" };
Which utility can show me just the data of that section?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: reading elf section data
2007-11-12 11:29 ` Steve Graegert
@ 2007-11-12 18:37 ` Gery
2007-11-12 12:07 ` Steve Graegert
0 siblings, 1 reply; 11+ messages in thread
From: Gery @ 2007-11-12 18:37 UTC (permalink / raw)
To: Steve Graegert; +Cc: linux-c-programming
Steve Graegert wrote:
> On Nov 12, 2007 11:55 AM, Glynn Clements <glynn@gclements.plus.com> wrote:
>> Gery wrote:
>>
>>> How to read in human format data from elf section?
>> Can you be more specific? What kind of data? What format?
>
> I stopped replying to messages like those from the OP. Demanding help
> without providing a minimum of information is just annoying, but
> doing so without any etiquette is simply rude.
>
> \Steve
>
> --
>
> Steve Grägert
> DigitalEther.de
> -
> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
Just for my understanding :)
What is OP?
What is it wrong w/ my etiquette?
PLease, help me to fix my mistakes.
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: reading elf section data
2007-11-12 12:07 ` Steve Graegert
@ 2007-11-12 19:11 ` Gery
0 siblings, 0 replies; 11+ messages in thread
From: Gery @ 2007-11-12 19:11 UTC (permalink / raw)
To: Steve Graegert; +Cc: linux-c-programming
Steve Graegert wrote:
> On Nov 12, 2007 7:37 PM, Gery <zaphod001@gmail.com> wrote:
>
>> Steve Graegert wrote:
>>
>>> On Nov 12, 2007 11:55 AM, Glynn Clements <glynn@gclements.plus.com> wrote:
>>>
>>>> Gery wrote:
>>>>
>>>>
>>>>> How to read in human format data from elf section?
>>>>>
>>>> Can you be more specific? What kind of data? What format?
>>>>
>>> I stopped replying to messages like those from the OP. Demanding help
>>> without providing a minimum of information is just annoying, but
>>> doing so without any etiquette is simply rude.
>>>
>>> \Steve
>>>
>>> --
>>>
>>> Steve Grägert
>>> DigitalEther.de
>>> -
>>> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>
>>>
>> Just for my understanding :)
>> What is OP?
>> What is it wrong w/ my etiquette?
>> PLease, help me to fix my mistakes.
>>
>>
>
> Hi Gery,
>
> Let's start with a greeting, you'll be welcome and you're done with
> 50% of the "etiquette".
> The OP stands for "original poster" and refers to the thread starter.
> Finally I like to conclude a post with a closing formula or just a
> signature including your name. That's the second part of the
> "etiquette".
>
> What I mean by rude is that questions like "How to read ELF data?"
> motivates no one to answer as we have to ask for clarification first.
> If you'd have asked "How do I read custom ELF sections added by GCC
> using C?" everyone knows exactly what you want just by being a bit
> more accurate.
>
> Regarding your original question: try readelf first. It'll probably
> do the trick.
>
> \Steve
>
> --
>
> Steve Grägert
> DigitalEther.de
>
>
Thank you, Steve.
I already tried readelf and even sectiondump utility from
elfutils-0.130/tests/
I hope there is a solution w/o coding, but may be not :(
Gery
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: reading elf section data
2007-11-12 13:36 reading elf section data Gery
2007-11-12 10:55 ` Glynn Clements
@ 2007-11-13 9:13 ` Kristof Provost
2007-11-13 16:22 ` Gery
1 sibling, 1 reply; 11+ messages in thread
From: Kristof Provost @ 2007-11-13 9:13 UTC (permalink / raw)
To: Gery; +Cc: linux-c-programming
[-- Attachment #1: Type: text/plain, Size: 175 bytes --]
On 2007-11-12 08:36:34 (-0500), Gery <zaphod001@gmail.com> wrote:
> How to read in human format data from elf section?
The readelf and objdump tools should help you.
Kristof
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: reading elf section data
2007-11-12 15:56 ` Glynn Clements
@ 2007-11-13 15:22 ` Gery
0 siblings, 0 replies; 11+ messages in thread
From: Gery @ 2007-11-13 15:22 UTC (permalink / raw)
To: Glynn Clements; +Cc: linux-c-programming
Glynn Clements wrote:
> Gery wrote:
>
>
>> i put some structure with gcc attribute to special section named ".my_sec"
>> The structure is like
>> struct abc {
>> char *a;
>> char *b;
>> };
>> and global variable is
>> struct abc klm = { "this is 1st string", "this is 2nd string" };
>>
>
> Like this:
>
> struct abc klm __attribute__ ((section (".my_sec"))) = { "this is 1st string", "this is 2nd string" };
>
> ?
>
>
>> Which utility can show me just the data of that section?
>>
>
> $ objdump -j .my_sec -d foo.o
>
> foo.o: file format elf32-i386
>
> Disassembly of section .my_sec:
>
> 00000000 <klm>:
> 0: 00 00 00 00 13 00 00 00 ........
>
> Bear in mind that the structure only contains the pointers, not the
> strings themselves. String literals used as values are stored in the
> .rodata section. If you want them elsewhere, you'll have to store them
> in named variables, e.g.:
>
> static char s1[] __attribute__ ((section (".my_sec"))) = "this is 1st string";
> static char s2[] __attribute__ ((section (".my_sec"))) = "this is 2nd string";
> struct abc klm __attribute__ ((section (".my_sec"))) = { s1, s2 };
>
> $ objdump -j .my_sec -d foo.o
>
> foo.o: file format elf32-i386
>
> Disassembly of section .my_sec:
>
> 00000000 <s1>:
> 0: 74 68 69 73 20 69 73 20 31 73 74 20 73 74 72 69 this is 1st stri
> 10: 6e 67 00 ng.
>
> 00000013 <s2>:
> 13: 74 68 69 73 20 69 73 20 32 6e 64 20 73 74 72 69 this is 2nd stri
> 23: 6e 67 00 00 00 ng...
>
> 00000028 <klm>:
> 28: 00 00 00 00 13 00 00 00 ........
>
>
Thank you very much :))
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: reading elf section data
2007-11-13 9:13 ` Kristof Provost
@ 2007-11-13 16:22 ` Gery
0 siblings, 0 replies; 11+ messages in thread
From: Gery @ 2007-11-13 16:22 UTC (permalink / raw)
To: Kristof Provost; +Cc: linux-c-programming
Kristof Provost wrote:
> On 2007-11-12 08:36:34 (-0500), Gery <zaphod001@gmail.com> wrote:
>
>> How to read in human format data from elf section?
>>
> The readelf and objdump tools should help you.
>
> Kristof
>
thank you.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2007-11-13 16:22 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-12 13:36 reading elf section data Gery
2007-11-12 10:55 ` Glynn Clements
2007-11-12 11:29 ` Steve Graegert
2007-11-12 18:37 ` Gery
2007-11-12 12:07 ` Steve Graegert
2007-11-12 19:11 ` Gery
2007-11-12 18:25 ` Gery
2007-11-12 15:56 ` Glynn Clements
2007-11-13 15:22 ` Gery
2007-11-13 9:13 ` Kristof Provost
2007-11-13 16:22 ` Gery
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).