diff mbox

glibc: add more Imagination Meta relocation to elf.h

Message ID 1468271236-6781-1-git-send-email-ross.burton@intel.com
State Accepted
Commit 61f73ae289bf8dfe72d5f4beaac966fb4ac8dc90
Headers show

Commit Message

Ross Burton July 11, 2016, 9:07 p.m. UTC
glibc master added the EM_METAG tag but didn't add the relocation defines.
However the kernel tooling only checks for EM_METAG when defining its own values
so scripts/recordmcount ends up using R_META_* symbols without their definition.

Whilst the kernel can and should be fixed, this breaks all users of recordmcount
so patch elf.h to add the values.

Signed-off-by: Ross Burton <ross.burton@intel.com>

---
 meta/recipes-core/glibc/glibc/elf-meta.patch | 32 ++++++++++++++++++++++++++++
 meta/recipes-core/glibc/glibc_2.24.bb        |  1 +
 2 files changed, 33 insertions(+)
 create mode 100644 meta/recipes-core/glibc/glibc/elf-meta.patch

-- 
2.8.1

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Comments

Khem Raj July 12, 2016, 1:24 a.m. UTC | #1
On Mon, Jul 11, 2016 at 2:07 PM, Ross Burton <ross.burton@intel.com> wrote:
> glibc master added the EM_METAG tag but didn't add the relocation defines.

> However the kernel tooling only checks for EM_METAG when defining its own values

> so scripts/recordmcount ends up using R_META_* symbols without their definition.

>

> Whilst the kernel can and should be fixed, this breaks all users of recordmcount

> so patch elf.h to add the values.

>

> Signed-off-by: Ross Burton <ross.burton@intel.com>

> ---

>  meta/recipes-core/glibc/glibc/elf-meta.patch | 32 ++++++++++++++++++++++++++++

>  meta/recipes-core/glibc/glibc_2.24.bb        |  1 +

>  2 files changed, 33 insertions(+)

>  create mode 100644 meta/recipes-core/glibc/glibc/elf-meta.patch

>

> diff --git a/meta/recipes-core/glibc/glibc/elf-meta.patch b/meta/recipes-core/glibc/glibc/elf-meta.patch

> new file mode 100644

> index 0000000..fab66d7

> --- /dev/null

> +++ b/meta/recipes-core/glibc/glibc/elf-meta.patch

> @@ -0,0 +1,32 @@

> +Upstream-Status: Pending

> +Signed-off-by: Ross Burton <ross.burton@intel.com>

> +

> +From a495656665cd4a4f97744741a4741eafa621d65b Mon Sep 17 00:00:00 2001

> +From: Ross Burton <ross.burton@intel.com>

> +Date: Mon, 11 Jul 2016 16:57:38 +0100

> +Subject: [PATCH] elf.h: add relocations for Imagination META

> +

> +Adding EM_METAG but not the relocations means the kernel doesn't compile as it

> +guards its own declarations on the presence of EM_METAG.

> +---

> + elf/elf.h | 4 ++++

> + 1 file changed, 4 insertions(+)

> +

> +diff --git a/elf/elf.h b/elf/elf.h

> +index b6112d9..69e85a7 100644

> +--- a/elf/elf.h

> ++++ b/elf/elf.h

> +@@ -3677,6 +3677,10 @@ enum

> +

> + #define R_TILEGX_NUM          130

> +

> ++/* Imagination META relocs */

> ++#define R_METAG_ADDR32                2

> ++#define R_METAG_NONE          3

> ++


Looks ok, however if you want it to be upstreamed then

1. Move them after BPF declarations.
2. Write a ChangeLog entry, something like

 2016-07-11  Ross Burton  <xxx@yyy.zzz>

       * elf/elf.h (R_METAG_NONE, R_METAG_NONE): New.

> + /* BPF specific declarations.  */

> +

> + #define R_BPF_NONE            0       /* No reloc */

> +--

> +2.8.1

> +

> diff --git a/meta/recipes-core/glibc/glibc_2.24.bb b/meta/recipes-core/glibc/glibc_2.24.bb

> index f0c6a03..456f206 100644

> --- a/meta/recipes-core/glibc/glibc_2.24.bb

> +++ b/meta/recipes-core/glibc/glibc_2.24.bb

> @@ -37,6 +37,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \

>             file://0023-eglibc-Install-PIC-archives.patch \

>             file://0024-eglibc-Forward-port-cross-locale-generation-support.patch \

>             file://0025-Define-DUMMY_LOCALE_T-if-not-defined.patch \

> +           file://elf-meta.patch \

>  "

>

>  SRC_URI += "\

> --

> 2.8.1

>

> --

> _______________________________________________

> Openembedded-core mailing list

> Openembedded-core@lists.openembedded.org

> http://lists.openembedded.org/mailman/listinfo/openembedded-core

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Ross Burton July 12, 2016, 7:48 a.m. UTC | #2
On 12 July 2016 at 02:24, Khem Raj <raj.khem@gmail.com> wrote:

> 1. Move them after BPF declarations.

>


Sure.


> 2. Write a ChangeLog entry, something like

>


<blinks>.  Really?! :)

Ross
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox

Patch

diff --git a/meta/recipes-core/glibc/glibc/elf-meta.patch b/meta/recipes-core/glibc/glibc/elf-meta.patch
new file mode 100644
index 0000000..fab66d7
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/elf-meta.patch
@@ -0,0 +1,32 @@ 
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From a495656665cd4a4f97744741a4741eafa621d65b Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Mon, 11 Jul 2016 16:57:38 +0100
+Subject: [PATCH] elf.h: add relocations for Imagination META
+
+Adding EM_METAG but not the relocations means the kernel doesn't compile as it
+guards its own declarations on the presence of EM_METAG.
+---
+ elf/elf.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/elf/elf.h b/elf/elf.h
+index b6112d9..69e85a7 100644
+--- a/elf/elf.h
++++ b/elf/elf.h
+@@ -3677,6 +3677,10 @@ enum
+ 
+ #define R_TILEGX_NUM		130
+ 
++/* Imagination META relocs */
++#define R_METAG_ADDR32		2
++#define R_METAG_NONE		3
++
+ /* BPF specific declarations.  */
+ 
+ #define R_BPF_NONE		0	/* No reloc */
+-- 
+2.8.1
+
diff --git a/meta/recipes-core/glibc/glibc_2.24.bb b/meta/recipes-core/glibc/glibc_2.24.bb
index f0c6a03..456f206 100644
--- a/meta/recipes-core/glibc/glibc_2.24.bb
+++ b/meta/recipes-core/glibc/glibc_2.24.bb
@@ -37,6 +37,7 @@  SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
            file://0023-eglibc-Install-PIC-archives.patch \
            file://0024-eglibc-Forward-port-cross-locale-generation-support.patch \
            file://0025-Define-DUMMY_LOCALE_T-if-not-defined.patch \
+           file://elf-meta.patch \
 "
 
 SRC_URI += "\