This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MIPS -gc-sections broken?


Hi Hiroki,

I've tried latest binutils-2.19.51.0.8 and gcc-4.5-20090604, and I still
have the same problem...

Humm, I'm using mips2 insn with o32.

Well I added the -mabi=32 switch to my command line to select the o32 ABI but the link still works. :-(


Exactly how was the toolchain that you are using configured ?

One thing that you might like to try is adding the -fno-common to your gcc command line. Perhaps the problem is associated with the garbage collection of common symbols.

binutils/bfd/elfxx-mips.c:_bfd_mips_elf_gc_sweep_hook() is currently
#if 0 'ed, however, other arch, such as arm, ppc reduces refcont for
plt. MIPS does not have plt count, but while sweeping away section .text.func_not_used and .rel.text.func_not_used, don't we need some
handling of relocation entries in these sections?

Possibly, although this comment in the code would seem to suggest that the MIPS toolchains are not really designed to support this kind of thing:


   /* ??? It would seem that the existing MIPS code does no sort
           of reference counting or whatnot on its GOT and PLT entries,
	   so it is not possible to garbage collect them at this time.

Maybe the issue is with the loader that you are using to start the execution of your program. Perhaps loaders for MIPS executables need to be able to ignore relocations for discarded symbols ?

Cheers
  Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]