public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Section garbage collection and function addresses
@ 2000-08-01 14:16 Chris Morrow
  2000-08-02  9:32 ` Bart Veer
  2000-08-10 11:59 ` Ling Su
  0 siblings, 2 replies; 5+ messages in thread
From: Chris Morrow @ 2000-08-01 14:16 UTC (permalink / raw)
  To: ecos-discuss

This is appears to be a compiler issue, but I thought some people here
might find this
of interest.

I'm using gdb 4.18, gcc 2.95 and binutils 2.10, all configured as
mips64-unknown-elf.

Examining a linked program with objdump show nothing out of the
ordinary. Using gdb
on the linked file in elf format mostly works, however some functions
are reported
as having an address of 0. Functions towards the start of the text
section are okay,
but after some point every function has an address of zero.

Turning off -gc-sections on the linker removes this problem.

Objdump -g also appears to be broken.

-- 
Chris Morrow	YottaYotta Inc.
email:		cmorrow@yottayotta.com
phone:		(780) 439 9000 ext 227
web:		http://www.yottayotta.com

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

* Re: [ECOS] Section garbage collection and function addresses
  2000-08-01 14:16 [ECOS] Section garbage collection and function addresses Chris Morrow
@ 2000-08-02  9:32 ` Bart Veer
  2000-08-02  9:56   ` Chris Morrow
  2000-08-10 11:59 ` Ling Su
  1 sibling, 1 reply; 5+ messages in thread
From: Bart Veer @ 2000-08-02  9:32 UTC (permalink / raw)
  To: cmorrow; +Cc: ecos-discuss

>>>>> "Chris" == Chris Morrow <cmorrow@YottaYotta.com> writes:

    Chris> This is appears to be a compiler issue, but I thought some
    Chris> people here might find this of interest.

More accurately, it sounds like a linker problem.

    Chris> I'm using gdb 4.18, gcc 2.95 and binutils 2.10, all
    Chris> configured as mips64-unknown-elf.

    Chris> Examining a linked program with objdump show nothing out of
    Chris> the ordinary. Using gdb on the linked file in elf format
    Chris> mostly works, however some functions are reported as having
    Chris> an address of 0. Functions towards the start of the text
    Chris> section are okay, but after some point every function has
    Chris> an address of zero.

    Chris> Turning off -gc-sections on the linker removes this
    Chris> problem.

    Chris> Objdump -g also appears to be broken.

The main question is, are these functions actually present in the
final executable?

The desired effect of -gc-sections is that any functions not used
directly or indirectly by the application get stripped out. It is
possible that the functions with a reported address of 0 have actually
been removed completely from the final executable, but the debug
information was not cleaned out correctly - the code and the debug
info are stored in separate parts of the object and executable files,
so there is a possibility that they can get out of sync. If a function
has been garbage collected but there is still a debug entry for it, a
reported address of 0 is quite likely.

If a function has not been garbage collected but is still reported
with an address of 0, the problem is more serious.

Anyway, I suggest reporting the problem to the binutils folks at
http://sources.redhat.com/binutils/ They may be able to help.

Bart Veer // eCos net maintainer

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

* Re: [ECOS] Section garbage collection and function addresses
  2000-08-02  9:32 ` Bart Veer
@ 2000-08-02  9:56   ` Chris Morrow
  0 siblings, 0 replies; 5+ messages in thread
From: Chris Morrow @ 2000-08-02  9:56 UTC (permalink / raw)
  To: ecos-discuss

Bart Veer wrote:
> 
> 
> The main question is, are these functions actually present in the
> final executable?
> 
objdump shows the all affected functions having reasonable address. The
program runs as well.

> 
> Anyway, I suggest reporting the problem to the binutils folks at
> http://sources.redhat.com/binutils/ They may be able to help.

This is my plan. There have been a couple patches recently in bin
utils around MIPS relocation entries which I suspect my be related.

Thanks.
> 
> Bart Veer // eCos net maintainer

-- 
Chris Morrow	YottaYotta Inc.
email:		cmorrow@yottayotta.com
phone:		(780) 439 9000 ext 227
web:		http://www.yottayotta.com

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

* Re: [ECOS] Section garbage collection and function addresses
  2000-08-01 14:16 [ECOS] Section garbage collection and function addresses Chris Morrow
  2000-08-02  9:32 ` Bart Veer
@ 2000-08-10 11:59 ` Ling Su
  2000-08-10 12:51   ` Chris Morrow
  1 sibling, 1 reply; 5+ messages in thread
From: Ling Su @ 2000-08-10 11:59 UTC (permalink / raw)
  To: Chris Morrow, ecos-discuss; +Cc: Bart Veer

Hi, Chris,

Have you successfully got the mips64 toolchain work now? I may meet the same
problem as you, I use gdb5.0, egcs-2000-5-30, and binutils 2.10, I can not
succeed in try to debugging since the main funciton has an address 0x0. I
turned off the -gc-sections option, and tried to run it in simulation
target, I still met some problem for accessing some wrong address. It is
really strange, since I knew at least Jifl and Charles use the MIPS
evaluation baord Vr4373 quite well, I almost applied the some version
binutils, gcc and gdb, how come I can not overcome that.

Hi, Bart,

If I buy the customer support from RedHat, it is possible the toolchain
problem will be solved?

Regards,
-Ling



>
> This is appears to be a compiler issue, but I thought some people here
> might find this
> of interest.
>
> I'm using gdb 4.18, gcc 2.95 and binutils 2.10, all configured as
> mips64-unknown-elf.
>
> Examining a linked program with objdump show nothing out of the
> ordinary. Using gdb
> on the linked file in elf format mostly works, however some functions
> are reported
> as having an address of 0. Functions towards the start of the text
> section are okay,
> but after some point every function has an address of zero.
>
> Turning off -gc-sections on the linker removes this problem.
>
> Objdump -g also appears to be broken.
>
> --
> Chris Morrow YottaYotta Inc.
> email: cmorrow@yottayotta.com
> phone: (780) 439 9000 ext 227
> web: http://www.yottayotta.com
>

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

* Re: [ECOS] Section garbage collection and function addresses
  2000-08-10 11:59 ` Ling Su
@ 2000-08-10 12:51   ` Chris Morrow
  0 siblings, 0 replies; 5+ messages in thread
From: Chris Morrow @ 2000-08-10 12:51 UTC (permalink / raw)
  To: egcs; +Cc: ecos-discuss

Things work for me with the tools mentioned in my message below. CFLAGS
are set to

-mips4 -EB -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef
-Woverloaded-virtual -g -O2 -fno-rtti -fno-exceptions -fvtable-gc
-finit-priorit

Linker flags are set to

-mips4 -EB -g -nostdlib -Wl,--gc-sections -Wl,-static

The -mips4 flag my not be appropriate for your board.

I'm gone tomorrow for a week, so I won't be of much more help.

Ling Su wrote:
> 
> Hi, Chris,
> 
> Have you successfully got the mips64 toolchain work now? I may meet the same
> problem as you, I use gdb5.0, egcs-2000-5-30, and binutils 2.10, I can not
> succeed in try to debugging since the main funciton has an address 0x0. I
> turned off the -gc-sections option, and tried to run it in simulation
> target, I still met some problem for accessing some wrong address. It is
> really strange, since I knew at least Jifl and Charles use the MIPS
> evaluation baord Vr4373 quite well, I almost applied the some version
> binutils, gcc and gdb, how come I can not overcome that.
> 
> Hi, Bart,
> 
> If I buy the customer support from RedHat, it is possible the toolchain
> problem will be solved?
> 
> Regards,
> -Ling
> 
> >
> > This is appears to be a compiler issue, but I thought some people here
> > might find this
> > of interest.
> >
> > I'm using gdb 4.18, gcc 2.95 and binutils 2.10, all configured as
> > mips64-unknown-elf.
> >
> > Examining a linked program with objdump show nothing out of the
> > ordinary. Using gdb
> > on the linked file in elf format mostly works, however some functions
> > are reported
> > as having an address of 0. Functions towards the start of the text
> > section are okay,
> > but after some point every function has an address of zero.
> >
> > Turning off -gc-sections on the linker removes this problem.
> >
> > Objdump -g also appears to be broken.
> >
> > --
> > Chris Morrow YottaYotta Inc.
> > email: cmorrow@yottayotta.com
> > phone: (780) 439 9000 ext 227
> > web: http://www.yottayotta.com
> >

-- 
Chris Morrow	YottaYotta Inc.
email:		cmorrow@yottayotta.com
phone:		(780) 439 9000 ext 227
web:		http://www.yottayotta.com

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

end of thread, other threads:[~2000-08-10 12:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-01 14:16 [ECOS] Section garbage collection and function addresses Chris Morrow
2000-08-02  9:32 ` Bart Veer
2000-08-02  9:56   ` Chris Morrow
2000-08-10 11:59 ` Ling Su
2000-08-10 12:51   ` Chris Morrow

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).