[Mesa-dev] [Mesa-stable] [PATCH 1/3] amd: Add relocation type and relocation target type to reloc structure

Marek Olšák maraeo at gmail.com
Tue Jun 4 04:20:55 UTC 2019


This series will probably conflict with the new linker, which will also
handle relocations and more:
https://patchwork.freedesktop.org/series/60255/

Marek

On Mon, Jun 3, 2019 at 10:39 PM Jan Vesely <jan.vesely at rutgers.edu> wrote:

> Cc: mesa-stable at lists.freedesktop.org
> Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
> ---
>  src/amd/common/ac_binary.c | 2 ++
>  src/amd/common/ac_binary.h | 2 ++
>  2 files changed, 4 insertions(+)
>
> diff --git a/src/amd/common/ac_binary.c b/src/amd/common/ac_binary.c
> index 8f4755ebe16..18dc72c61f0 100644
> --- a/src/amd/common/ac_binary.c
> +++ b/src/amd/common/ac_binary.c
> @@ -102,6 +102,8 @@ static void parse_relocs(Elf *elf, Elf_Data *relocs,
> Elf_Data *symbols,
>                 reloc->offset = rel.r_offset;
>                 strncpy(reloc->name, symbol_name, sizeof(reloc->name)-1);
>                 reloc->name[sizeof(reloc->name)-1] = 0;
> +               reloc->type = GELF_R_TYPE(rel.r_info);
> +               reloc->target_type = GELF_ST_TYPE(symbol.st_info);
>         }
>  }
>
> diff --git a/src/amd/common/ac_binary.h b/src/amd/common/ac_binary.h
> index 735e3932055..7541f19fb8e 100644
> --- a/src/amd/common/ac_binary.h
> +++ b/src/amd/common/ac_binary.h
> @@ -34,6 +34,8 @@ extern "C" {
>  struct ac_shader_reloc {
>         char name[32];
>         uint64_t offset;
> +       int type;
> +       int target_type;
>  };
>
>  struct ac_shader_binary {
> --
> 2.21.0
>
> _______________________________________________
> mesa-stable mailing list
> mesa-stable at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-stable
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190604/fd3af6e8/attachment.html>


More information about the mesa-dev mailing list