summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Zagorui <dzagorui@cisco.com>2020-11-10 18:14:12 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-11-20 10:53:21 +0000
commitb74901b816114143df1c7a87ece82fdf1368f90c (patch)
treee85252b2e81feb8bf9b20eb9b1adfe4112b795e9
parent010625f35a5f879859d149c747f721abeae42627 (diff)
downloadpoky-b74901b816114143df1c7a87ece82fdf1368f90c.tar.gz
binutils: reproducibility: reuse debug-prefix-map for stabs
powerpc 32bit Linux Kernel widely uses .stabs pseudo-op to produce debugging information in stabs format. Faced an issue that during Linux Kernel build with Yocto build system for 32bit powerpc platform resulting vmlinux contains absolute path in .stabstr section that cannot be remapped with -fdebug-prefix-map option. Yocto uses scripts/mkmakefile Linux Kernel build approach that allows to store all generated files outside of kernel source tree. With this approach each compilier invocation is performed with an absolute path to a file that will be compiled and this absolute path is recorded in init stab. There is no way to remap this path. Reuse remap_debug_filename api to make -fdebug-prefix-map flag aplicable for init stab. (From OE-Core rev: b4b79870d7946e58692adb68d1329955500d3c56) Signed-off-by: Denys Zagorui <dzagorui@cisco.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 4dce4e01cfa153fb12cfd1684d36e0432bef6741) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.35.inc1
-rw-r--r--meta/recipes-devtools/binutils/binutils/0017-gas-improve-reproducibility-for-stabs-debugging-data.patch35
2 files changed, 36 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.35.inc b/meta/recipes-devtools/binutils/binutils-2.35.inc
index 5ae9ec4226..bc9107b084 100644
--- a/meta/recipes-devtools/binutils/binutils-2.35.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.35.inc
@@ -41,5 +41,6 @@ SRC_URI = "\
41 file://0014-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \ 41 file://0014-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \
42 file://0015-sync-with-OE-libtool-changes.patch \ 42 file://0015-sync-with-OE-libtool-changes.patch \
43 file://0016-Check-for-clang-before-checking-gcc-version.patch \ 43 file://0016-Check-for-clang-before-checking-gcc-version.patch \
44 file://0017-gas-improve-reproducibility-for-stabs-debugging-data.patch \
44" 45"
45S = "${WORKDIR}/git" 46S = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0017-gas-improve-reproducibility-for-stabs-debugging-data.patch b/meta/recipes-devtools/binutils/binutils/0017-gas-improve-reproducibility-for-stabs-debugging-data.patch
new file mode 100644
index 0000000000..42e0c1c32d
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0017-gas-improve-reproducibility-for-stabs-debugging-data.patch
@@ -0,0 +1,35 @@
1From aa6586e80fc6fcd739aa959a71e4cf064cdef072 Mon Sep 17 00:00:00 2001
2From: Denys Zagorui <dzagorui@cisco.com>
3Date: Mon, 9 Nov 2020 15:39:10 +0000
4Subject: [PATCH] gas: improve reproducibility for stabs debugging data format
5
6 * config/obj-elf (obj_elf_init_stab_section): Improve
7 reproducibility for stabs debugging data format
8
9Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=0541201782c006c09d029d18a45c6e743cfea906]
10---
11 gas/config/obj-elf.c | 3 ++-
12 1 file changed, 2 insertions(+), 1 deletion(-)
13
14diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
15index de22b5a1da..2025df8542 100644
16--- a/gas/config/obj-elf.c
17+++ b/gas/config/obj-elf.c
18@@ -2374,12 +2374,13 @@ obj_elf_init_stab_section (segT seg)
19 p = frag_more (12);
20 /* Zero it out. */
21 memset (p, 0, 12);
22- file = as_where (NULL);
23+ file = remap_debug_filename (as_where (NULL));
24 stabstr_name = concat (segment_name (seg), "str", (char *) NULL);
25 stroff = get_stab_string_offset (file, stabstr_name, TRUE);
26 know (stroff == 1 || (stroff == 0 && file[0] == '\0'));
27 md_number_to_chars (p, stroff, 4);
28 seg_info (seg)->stabu.p = p;
29+ xfree ((char *) file);
30 }
31
32 #endif
33--
342.20.1
35