public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* overlapping ELF symbols and disassembly output
@ 2007-10-28 13:58 Mike Frysinger
  2007-10-29  4:19 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Frysinger @ 2007-10-28 13:58 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 895 bytes --]

it is valid in ELF to have overlapping ELF symbols right ?  so if i have a 
symbol "foo" which starts at say 0x10 and has a size of 0x100, i can have 
another symbol "moo" which starts at say 0x20 and has a size of 0x10 ?

what i'm trying to do is embed some data into a function and have objdump do 
the right thing ... so for example:
.type foo,%function
foo:
	R0 = 0;
	... some more assembly ...
.type moo,%object
moo:
	.asciz "a data string";
.size moo, . - moo
	... some more assembly ...
.size foo, . - foo

objdump on this shows proper disassembly from the start of "foo" up to the 
start of "moo", and then shows that the "moo" symbol is data, but after the 
end of "moo" to the end of "foo", the information is continued to be 
interpreted as data rather than disassembled as object code.  i imagine this 
is not normal, but can it be expected to work ? :)
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: overlapping ELF symbols and disassembly output
  2007-10-28 13:58 overlapping ELF symbols and disassembly output Mike Frysinger
@ 2007-10-29  4:19 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2007-10-29  4:19 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: binutils

On Sat, Oct 27, 2007 at 04:30:05PM -0400, Mike Frysinger wrote:
> objdump on this shows proper disassembly from the start of "foo" up to the 
> start of "moo", and then shows that the "moo" symbol is data, but after the 
> end of "moo" to the end of "foo", the information is continued to be 
> interpreted as data rather than disassembled as object code.  i imagine this 
> is not normal, but can it be expected to work ? :)

Not really.  Most tools don't support overlapping symbols.  GDB "sort
of" does.

ARM solved this problem with a separate set of mapping symbols; you
may want to look at that.  Other tools have solved it with annotations
in DWARF .debug_line data.

-- 
Daniel Jacobowitz
CodeSourcery

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-28 14:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-28 13:58 overlapping ELF symbols and disassembly output Mike Frysinger
2007-10-29  4:19 ` Daniel Jacobowitz

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 read-only IMAP folder(s) and NNTP newsgroup(s).