This is the mail archive of the binutils@sources.redhat.com 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: [RFC] Providing init_fini_syms earlier?


On Thu, Jul 07, 2005 at 02:35:22PM -0700, H. J. Lu wrote:
> On Thu, Jul 07, 2005 at 04:03:45PM -0400, Daniel Jacobowitz wrote:
> > On Thu, Jul 07, 2005 at 10:40:49AM -0700, H. J. Lu wrote:
> > > > My pleasure.
> > > > 
> > > > http://www.baldric.uwo.ca/~carlos/bug-extraNONE.tar.gz
> > > > 
> > > > Contains everything you need to test the bug in a cross link
> > > > environment. You will see that two extra R_PARISC_NONE relocs are
> > > > emitted, and they correspond to the undefined __init_array_start and
> > > > __init_array_end.
> > > > 
> > > > If the linker doesn't provide the symbols early enough the bakends can't
> > > > do the work of ignoring them? :)
> > > 
> > > That is the libc bug on hppa. __init_array_start and __init_array_end
> > > should be used ONLY for building STATIC executables. Please check out
> > > how ia32, x86-64 and ia64 handle them.
> > 
> > How can a linker generating unnecessary R_PARISC_NONE relocs be a
> > library bug?  The linker needs to behave correctly on any input.
> 
> 1. R_PARISC_NONE shouldn't cause any problems.

Correct. They cause no problems, but they take up space. If possible I
want to work towards removing them.

> 2. __init_array_start/__init_array_end are provided by linker for
> static exexcutables since DT_INIT_ARRAY isn't available.

Linking a dynamic executable adds libc_nonshared.a, which has undefined
references to __init_array_start and associated symbols.

It looks to me that the linker provides these symbols in all links,
wether static or dynamic executables.

In the later case, because the linker provides the symbol so late, it's
impossible to know if I should or shouldn't allocate space. Space is
allocated, and after the section sizes have been fixed, the linker
provides the symbols. At this point we know we don't need them, and we
don't emit a relocation. However, we can no longer resize the section.

> When __init_array_start/__init_array_end are used for non-static
> exexcutable, linker generates working outputs. I don't see a problem.

The problem is that I would like to save space by remove the extra
R_PARISC_NONE entries.

c.


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