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: Static linking on 64-bit PowerPC ELFv2


On Fri, Aug 11, 2017 at 01:01:07PM +0200, Sebastian Huber wrote:
> 
> 
> On 11/08/17 12:50, Alan Modra wrote:
> >On Fri, Aug 11, 2017 at 11:48:50AM +0200, Sebastian Huber wrote:
> >>Hello,
> >>
> >>I recently added 64-bit PowerPC for RTEMS using the ELFv2 ABI. On RTEMS, the
> >>applications are statically linked with the operating system. I am now a bit
> >>surprised be a linker behaviour. I have a big library containing a network
> >>stack with many features. On other targets the linker just picks individual
> >>objects from the library to resolve the dependencies. However, on the 64-bit
> >>PowerPC the linker seems to pull in the complete library somehow. I see in
> >>the linker map file lines like this:
> >>
> >>./libbsd.a(utils.c.18.o)      (print_string)
> >You're only showing part of the complete line (which is no doubt
> >split).  What you show is the reference, the line above it would be
> >the included object.
> >
> 
> I am not sure if this line is incomplete. With a bit more context I have:
> 
> ./libbsd.a(ip6_forward.c.18.o)
>                               ./libbsd.a(ip6_input.c.18.o)
> (_bsd_ip6_forward)
> ./libbsd.a(ofw_bus_if.c.18.o)
>                               ./libbsd.a(rtems-kernel-nexus.c.18.o)
> (ofw_bus_map_intr_desc)
> ./libbsd.a(mdns-hostname-default.c.18.o)
>                               ./libbsd.a(hostname.c.12.o)
> (rtems_mdns_gethostname_handler)
> ./libbsd.a(utils.c.18.o)      (print_string)
> ./libbsd.a(rtems-bsd-get-allocator-domain-size.c.18.o)
>                               ./libbsd.a(rtems-kernel-page.c.18.o)
> (rtems_bsd_get_allocator_domain_size)
> ./libbsd.a(rtems-bsd-get-task-priority.c.18.o)
>                               ./libbsd.a(rtems-kernel-init.c.18.o)
> (rtems_bsd_get_task_priority)
> 
> My interpretation is for example rtems-bsd-get-task-priority.c.18.o is
> included due to a reference to rtems_bsd_get_task_priority in
> rtems-kernel-init.c.18.o.
> 
> I don't know how to interpret the utils.c.18.o line.

I made a bad assumption.  It seems that must be a complete line after
all, but one where ld has lost the referencing object for some
reason..

-- 
Alan Modra
Australia Development Lab, IBM


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