public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Mao Han <han_mao@c-sky.com>, elfutils-devel@sourceware.org
Subject: Re: [[RESEND & PING]PATCH V3 1/1] Add backend support for C-SKY
Date: Fri, 12 Jul 2019 22:10:00 -0000	[thread overview]
Message-ID: <7d5d153ecbcee44414a72af4555c68b3e086be79.camel@klomp.org> (raw)
In-Reply-To: <ede2a66649573ab580c63a6e81c39b0414a8de6c.1559544994.git.han_mao@c-sky.com>

On Mon, 2019-06-03 at 16:16 +0800, Mao Han wrote:
> diff --git a/backends/csky_reloc.def b/backends/csky_reloc.def
> new file mode 100644
> index 0000000..1108f0c
> --- /dev/null
> +++ b/backends/csky_reloc.def
> @@ -0,0 +1,86 @@
> +/* List the relocation types for csky.  -*- C -*-
> +   Copyright (C) 2019 Hangzhou C-SKY Microsystems co.,ltd.
> +   This file is part of elfutils.
> +
> +   This file is free software; you can redistribute it and/or modify
> +   it under the terms of either
> +
> +     * the GNU Lesser General Public License as published by the Free
> +       Software Foundation; either version 3 of the License, or (at
> +       your option) any later version
> +
> +   or
> +
> +     * the GNU General Public License as published by the Free
> +       Software Foundation; either version 2 of the License, or (at
> +       your option) any later version
> +
> +   or both in parallel, as here.
> +
> +   elfutils is distributed in the hope that it will be useful, but
> +   WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   General Public License for more details.
> +
> +   You should have received copies of the GNU General Public License and
> +   the GNU Lesser General Public License along with this program.  If
> +   not, see <http://www.gnu.org/licenses/>.  */
> +
> +/*         NAME,               REL|EXEC|DYN    */
> +
> +
> +RELOC_TYPE (NONE,              REL|EXEC|DYN)
> +RELOC_TYPE (ADDR32,            REL|EXEC|DYN)

OK.

> +RELOC_TYPE (PCRELIMM8BY4,      REL)
> +RELOC_TYPE (PCRELIMM11BY2,     REL)

Do we want these two? They seem to be v1 only.

> +RELOC_TYPE (PCREL32,           REL|DYN)

This is probably wanted, but the CPU ABI document has it listed as ??.

> +RELOC_TYPE (PCRELJSR_IMM11BY2, REL)

Also v1 only?

> +RELOC_TYPE (RELATIVE,          EXEC|DYN)
> +RELOC_TYPE (COPY,              EXEC|DYN)
> +RELOC_TYPE (GLOB_DAT,          EXEC|DYN)
> +RELOC_TYPE (JUMP_SLOT,         EXEC|DYN)

OK.

> +RELOC_TYPE (GOTOFF,            REL)
> +RELOC_TYPE (GOTPC,             REL)
> +RELOC_TYPE (GOT32,             REL)
> +RELOC_TYPE (PLT32,             REL)
> +RELOC_TYPE (ADDRGOT,           REL)
> +RELOC_TYPE (ADDRPLT,           REL)

v1 only?

> +RELOC_TYPE (PCREL_IMM26BY2,    REL)
> +RELOC_TYPE (PCREL_IMM16BY2,    REL)
> +RELOC_TYPE (PCREL_IMM16BY4,    REL)
> +RELOC_TYPE (PCREL_IMM10BY2,    REL)
> +RELOC_TYPE (PCREL_IMM10BY4,    REL)
> +RELOC_TYPE (ADDR_HI16,         REL|DYN)
> +RELOC_TYPE (ADDR_LO16,         REL|DYN)
> +RELOC_TYPE (GOTPC_HI16,                REL)
> +RELOC_TYPE (GOTPC_LO16,                REL)
> +RELOC_TYPE (GOTOFF_HI16,       REL)
> +RELOC_TYPE (GOTOFF_LO16,       REL)
> +RELOC_TYPE (GOT12,             REL)
> +RELOC_TYPE (GOT_HI16,          REL)
> +RELOC_TYPE (GOT_LO16,          REL)
> +RELOC_TYPE (PLT12,             REL)
> +RELOC_TYPE (PLT_HI16,          REL)
> +RELOC_TYPE (PLT_LO16,          REL)
> +RELOC_TYPE (ADDRGOT_HI16,      REL)
> +RELOC_TYPE (ADDRGOT_LO16,      REL)
> +RELOC_TYPE (ADDRPLT_HI16,      REL)
> +RELOC_TYPE (ADDRPLT_LO16,      REL)
> +RELOC_TYPE (PCREL_JSR_IMM26BY2,        REL|DYN)
> +RELOC_TYPE (TOFFSET_LO16,      REL)
> +RELOC_TYPE (DOFFSET_LO16,      REL)
> +RELOC_TYPE (PCREL_IMM18BY2,    REL)
> +RELOC_TYPE (DOFFSET_IMM18,     REL)
> +RELOC_TYPE (DOFFSET_IMM18BY2,  REL)
> +RELOC_TYPE (DOFFSET_IMM18BY4,  REL)

R_CKCORE_GOTOFF_IMM18 is missing, but it is also missing in elf.h.

> +RELOC_TYPE (GOT_IMM18BY4,      REL)
> +RELOC_TYPE (PLT_IMM18BY4,      REL)

R_CKCORE_PCREL_IMM7BY4 missing?

> +RELOC_TYPE (PCREL_IMM7BY4,     REL)
> +RELOC_TYPE (TLS_LE32,          REL)
> +RELOC_TYPE (TLS_IE32,          REL)
> +RELOC_TYPE (TLS_GD32,          REL)
> +RELOC_TYPE (TLS_LDM32,         REL)
> +RELOC_TYPE (TLS_LDO32,         REL)
> +RELOC_TYPE (TLS_DTPMOD32,      EXEC|DYN)
> +RELOC_TYPE (TLS_DTPOFF32,      EXEC|DYN)
> +RELOC_TYPE (TLS_TPOFF32,       EXEC|DYN)

The TLS variants aren't yet listed in the CPU ABI doc, but are in
elf.h, so I assume they are OK.

We can list the v1 variants also, their numbers don't overlap.
Just checking it is done deliberately. If they can never occur in v2
ELF binaries I would leave them out.

Cheers,

Mark

  parent reply	other threads:[~2019-07-12 22:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-03  8:17 [[RESEND & PING]PATCH V3 0/1] Add C-SKY support Mao Han
2019-06-03  8:19 ` [[RESEND & PING]PATCH V3 1/1] Add backend support for C-SKY Mao Han
2019-07-10 22:11   ` Mark Wielaard
2019-07-11  3:20     ` Mao Han
2019-07-14 21:03       ` Mark Wielaard
2019-07-12 22:10   ` Mark Wielaard [this message]
2019-07-10 21:33 ` [[RESEND & PING]PATCH V3 0/1] Add C-SKY support Mark Wielaard
2019-07-11  3:13   ` Mao Han
2019-07-11 13:36     ` Mark Wielaard
2019-07-12 11:24       ` Mao Han
2019-07-12 21:20         ` Mark Wielaard
2019-07-12 21:49 ` Mark Wielaard
2019-07-15  8:56 [[RESEND & PING]PATCH V3 1/1] Add backend support for C-SKY Mao Han
2019-07-15 21:44 ` Mark Wielaard

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=7d5d153ecbcee44414a72af4555c68b3e086be79.camel@klomp.org \
    --to=mark@klomp.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=han_mao@c-sky.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).