public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Paul Iannetta <piannetta@kalrayinc.com>
To: Michael Matz <matz@suse.de>
Cc: Nick Clifton <nickc@redhat.com>, binutils@sourceware.org
Subject: Re: [PATCH 0/7] kvx: New port.
Date: Wed, 26 Jul 2023 23:46:28 +0200	[thread overview]
Message-ID: <20230726214628.akx2j253cesm5w4b@ws2202.lin.mbt.kalray.eu> (raw)
In-Reply-To: <alpine.LSU.2.20.2307261327460.25429@wotan.suse.de>

Hi Michael,
On Wed, Jul 26, 2023 at 01:32:56PM +0000, Michael Matz wrote:
> Hello,
> 
> On Wed, 26 Jul 2023, Paul Iannetta via Binutils wrote:
> 
> > > Most of the remaining failures appear to be due to this error:
> > > 
> > >  error: PHDR segment not covered by LOAD segment
> > > 
> > > Which I am guessing is due to some kind of issue with the built in linker script
> > > for the KVX target.  Although I am not sure exactly what the issue might be.
> > > 
> > This one is due to the fact that we do not generate a PHDR at all
> > since we only support a very primitive form of dynamic loading (only
> > through calls to dlopen/dlsym), we do not need a PHDR.
> 
> You are using the ELF file format right?  In the gABI a program header 
> table is actually non-optional for executables and shared libs.  
> Obviously a psABI can do mostly whatever it likes, but not having PHDRs is 
> _very_ unusual.  They aren't specific to dynamic linking: after all, even 
> static executables need to be loaded somewhere, by kernel or boot loader 
> or ROM or $othermagic, and the program headers describe what and where to 
> load.  So, you really might want to reconsider.  At least one PT_LOAD 
> segment covering the whole file would be good.

I was not very clear sorry.  We have actually have 2 main usages of ELF
files:
  - one for bare-metal programs -- a program is linked with a bare-metal
OS into a final standalone free standing executable ELF file which
contains an OS, a libc and the userland program.  Those bare-metal
programs can use a dlopen/dlsym-like API to load ELF blobs which have
been deposed in the DDR by some other means. In that case, we don't
need a PHDR, even for the ELF blobs which are dynamically loaded, the
information in the ELF header are enough since we do not support PIE
in this mode and the information in the PHDR is mostly useful for the
dynamic loader.

 - one for linux programs.  In that case, all exec/shared libs have a
   PHDR, and iirc we follow the gABI.

When I was writing the previous mail, I had the first case in my head,
which is indeed a pretty unusual scenario.

Regards,
Paul





  reply	other threads:[~2023-07-26 21:46 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-21  7:49 Paul Iannetta
2023-07-21  7:49 ` [PATCH 1/7] kvx: Add bf files Paul Iannetta
2023-07-21  7:49 ` [PATCH 2/7] kvx: Add binutils files Paul Iannetta
2023-07-21  7:49 ` [PATCH 3/7] kvx: Add gas file Paul Iannetta
2023-07-21  7:49 ` [PATCH 4/7] kvx: Add ld files Paul Iannetta
2023-07-21  7:49 ` [PATCH 5/7] kvx: Add include files Paul Iannetta
2023-07-21  7:49 ` [PATCH 6/7] kvx: Add opcodes file Paul Iannetta
2023-07-21  7:49 ` [PATCH 7/7] kvx: Add toplevel files Paul Iannetta
2023-07-21  8:29 ` [PATCH 0/7] kvx: New port Nick Clifton
     [not found]   ` <20230721090932.pspnpq2q2wjnshrh@ws2202.lin.mbt.kalray.eu>
     [not found]     ` <2050791e-38ee-5719-037f-c03c456f3e3d@redhat.com>
2023-07-21 16:47       ` Paul Iannetta
2023-07-21 17:00       ` Paul Iannetta
2023-07-21  8:57 ` YunQiang Su
2023-07-21 16:51   ` Paul Iannetta
2023-07-24  9:04 ` Nick Clifton
2023-07-24  9:38   ` Paul Iannetta
2023-07-24  9:28 ` Nick Clifton
2023-07-24 12:33   ` Paul Iannetta
2023-07-24 14:30     ` Paul Iannetta
2023-07-25 14:13     ` Nick Clifton
2023-07-26  7:36       ` Paul Iannetta
2023-07-26 13:32         ` Michael Matz
2023-07-26 21:46           ` Paul Iannetta [this message]
2023-07-26 21:24         ` [PATCH v2] " Paul Iannetta
2023-07-31 14:52           ` Nick Clifton
2023-08-02 14:38             ` [PATCH v3] " Paul Iannetta
2023-08-16 13:24               ` Nick Clifton
2023-08-17  9:45                 ` Luis Machado
2023-08-17 15:09                   ` Paul Iannetta
2023-08-17 16:28                     ` Luis Machado
2023-08-17 23:20                     ` Alan Modra
2023-08-18  7:13                       ` Paul Iannetta
2023-08-17 12:46                 ` Paul Iannetta
2023-07-24  9:53 ` [PATCH 0/7] " Nick Clifton
2023-07-24 12:27   ` Paul Iannetta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230726214628.akx2j253cesm5w4b@ws2202.lin.mbt.kalray.eu \
    --to=piannetta@kalrayinc.com \
    --cc=binutils@sourceware.org \
    --cc=matz@suse.de \
    --cc=nickc@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).