[0/2] Add initial support for Hexagon

Message ID cover.1711055228.git.quic_mathbern@quicinc.com
Headers
Series Add initial support for Hexagon |

Message

Matheus Tavares Bernardino March 21, 2024, 9:09 p.m. UTC
  The patches were inspired by
https://sourceware.org/cgit/elfutils/commit?id=13a4d1279c5b7847049ca3045d04f2705c45ce31

Related to:
https://lore.kernel.org/all/6498586d7d0ed112e6c44be98d439abc549653c7.camel@klomp.org/t/#u

Matheus Tavares Bernardino (2):
  Add support for Hexagon
  Hexagon: implement machine flag check

 backends/Makefile.am       |   6 +-
 backends/hexagon_init.c    |  52 +++++++++++++++
 backends/hexagon_reloc.def | 130 ++++++++++++++++++++++++++++++++++++
 backends/hexagon_symbol.c  |  66 +++++++++++++++++++
 libebl/eblopenbackend.c    |   2 +
 libelf/elf.h               | 131 +++++++++++++++++++++++++++++++++++++
 src/elflint.c              |   2 +-
 7 files changed, 386 insertions(+), 3 deletions(-)
 create mode 100644 backends/hexagon_init.c
 create mode 100644 backends/hexagon_reloc.def
 create mode 100644 backends/hexagon_symbol.c
  

Comments

Brian Cain March 21, 2024, 9:13 p.m. UTC | #1
cc Andrew

> -----Original Message-----
> From: Matheus Bernardino (QUIC) <quic_mathbern@quicinc.com>
> Sent: Thursday, March 21, 2024 4:09 PM
> To: elfutils-devel@sourceware.org
> Cc: Brian Cain <bcain@quicinc.com>; Sid Manning <sidneym@quicinc.com>;
> mark@klomp.org
> Subject: [PATCH 0/2] Add initial support for Hexagon
> 
> The patches were inspired by
> https://sourceware.org/cgit/elfutils/commit?id=13a4d1279c5b7847049ca30
> 45d04f2705c45ce31
> 
> Related to:
> https://lore.kernel.org/all/6498586d7d0ed112e6c44be98d439abc549653c7.
> camel@klomp.org/t/#u
> 
> Matheus Tavares Bernardino (2):
>   Add support for Hexagon
>   Hexagon: implement machine flag check
> 
>  backends/Makefile.am       |   6 +-
>  backends/hexagon_init.c    |  52 +++++++++++++++
>  backends/hexagon_reloc.def | 130
> ++++++++++++++++++++++++++++++++++++
>  backends/hexagon_symbol.c  |  66 +++++++++++++++++++
>  libebl/eblopenbackend.c    |   2 +
>  libelf/elf.h               | 131 +++++++++++++++++++++++++++++++++++++
>  src/elflint.c              |   2 +-
>  7 files changed, 386 insertions(+), 3 deletions(-)
>  create mode 100644 backends/hexagon_init.c
>  create mode 100644 backends/hexagon_reloc.def
>  create mode 100644 backends/hexagon_symbol.c
> 
> --
> 2.37.2
  
Mark Wielaard March 28, 2024, 1:45 p.m. UTC | #2
Hi Matheus,

On Thu, Mar 21, 2024 at 06:09:08PM -0300, Matheus Tavares Bernardino wrote:
> The patches were inspired by
> https://sourceware.org/cgit/elfutils/commit?id=13a4d1279c5b7847049ca3045d04f2705c45ce31
> 
> Related to:
> https://lore.kernel.org/all/6498586d7d0ed112e6c44be98d439abc549653c7.camel@klomp.org/t/#u
> 
> Matheus Tavares Bernardino (2):
>   Add support for Hexagon
>   Hexagon: implement machine flag check

In general this looks good. It is the minimal backend support to get
eu-strip --reloc-debug-sections and opening ET_REL (kernel module)
debug files with dwfl that are automatically relocated.

The only issue is that we like to keep libelf/elf.h synced with glibc
elf/elf.h. Would it be possible/make sense to submit the elf.h changes
to libc-alpha? Otherwise we should keep the new constants in some
other file (maybe libelf/elf-knowledge.h)?

Is there a public psabi for Hexagon? Then including an URL to it would
be helpful.

If possible you might want to include some simple test file. See
tests/run-strip-reloc-ko.sh

Thanks,

Mark
  
Matheus Tavares Bernardino March 28, 2024, 10:20 p.m. UTC | #3
Hi, Mark

Thanks for the comments.

On 3/28/24 8:45 AM, Mark Wielaard wrote:
> Hi Matheus,
>
> The only issue is that we like to keep libelf/elf.h synced with glibc
> elf/elf.h. Would it be possible/make sense to submit the elf.h changes
> to libc-alpha? Otherwise we should keep the new constants in some
> other file (maybe libelf/elf-knowledge.h)?

Ah, I see. We don't plan on supporting Hexagon on other libc's as of 
this moment, so it would be good if we can add these constants to 
libelf/elf-knowledge.h, like you suggested.

> Is there a public psabi for Hexagon? Then including an URL to it would
> be helpful.

Yes, it's available at: 
https://lists.llvm.org/pipermail/llvm-dev/attachments/20190916/21516a52/attachment-0001.pdf

(I'll add it to the commit message as well.)

> If possible you might want to include some simple test file. See
> tests/run-strip-reloc-ko.sh


Sure, will do!


Thanks,

Matheus