Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1486900 > unrolled thread
| Started by | Vineet Gupta <Vineet.Gupta1@synopsys.com> |
|---|---|
| First post | 2016-09-19 23:50 +0200 |
| Last post | 2016-09-26 21:00 +0200 |
| Articles | 13 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH 0/3] ARC unwinder switch to .eh_frame Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-09-19 23:50 +0200
[PATCH 1/3] ARC: module: support R_ARC_32_PCREL relocation Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-09-19 23:50 +0200
[PATCH 2/3] ARC: dw2 unwind: factor CIE specifics for .eh_frame/.debug_frame Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-09-20 00:00 +0200
[PATCH 3/3] ARC: dw2 unwind: switch to .eh_frame based unwinding Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-09-20 00:00 +0200
Re: [PATCH 0/3] ARC unwinder switch to .eh_frame Daniel Mentz <danielmentz@google.com> - 2016-09-20 03:30 +0200
Re: [PATCH 0/3] ARC unwinder switch to .eh_frame Vineet Gupta <vgupta@synopsys.com> - 2016-09-20 08:20 +0200
Re: [PATCH 0/3] ARC unwinder switch to .eh_frame Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-09-22 22:40 +0200
modules still have .debug_* (was Re: [PATCH 0/3] ARC unwinder switch to .eh_frame) Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-09-22 23:00 +0200
Re: modules still have .debug_* (was Re: [PATCH 0/3] ARC unwinder switch to .eh_frame) Daniel Mentz <danielmentz@google.com> - 2016-09-23 00:40 +0200
Re: modules still have .debug_* (was Re: [PATCH 0/3] ARC unwinder switch to .eh_frame) Alexey Brodkin <Alexey.Brodkin@synopsys.com> - 2016-09-23 12:40 +0200
Re: modules still have .debug_* (was Re: [PATCH 0/3] ARC unwinder switch to .eh_frame) Daniel Mentz <danielmentz@google.com> - 2016-09-24 03:10 +0200
Re: modules still have .debug_* (was Re: [PATCH 0/3] ARC unwinder switch to .eh_frame) Alexey Brodkin <Alexey.Brodkin@synopsys.com> - 2016-09-26 14:40 +0200
Re: modules still have .debug_* (was Re: [PATCH 0/3] ARC unwinder switch to .eh_frame) Daniel Mentz <danielmentz@google.com> - 2016-09-26 21:00 +0200
| From | Vineet Gupta <Vineet.Gupta1@synopsys.com> |
|---|---|
| Date | 2016-09-19 23:50 +0200 |
| Subject | [PATCH 0/3] ARC unwinder switch to .eh_frame |
| Message-ID | <sjeBP-2xm-7@gated-at.bofh.it> |
Hi Daniel, Give these a shot and let me know if they work fine for you. I'm working on some more improvements to unwinder which will follow a bit later. Thx, -Vineet Vineet Gupta (3): ARC: module: support R_ARC_32_PCREL relocation ARC: dw2 unwind: factor CIE specifics for .eh_frame/.debug_frame ARC: dw2 unwind: switch to .eh_frame based unwinding arch/arc/Makefile | 2 ++ arch/arc/include/asm/elf.h | 3 +-- arch/arc/kernel/entry.S | 12 ------------ arch/arc/kernel/module.c | 19 ++++++++----------- arch/arc/kernel/unwind.c | 24 +++++++++++++++++------- arch/arc/kernel/vmlinux.lds.S | 15 +++++---------- 6 files changed, 33 insertions(+), 42 deletions(-) -- 2.7.4
[toc] | [next] | [standalone]
| From | Vineet Gupta <Vineet.Gupta1@synopsys.com> |
|---|---|
| Date | 2016-09-19 23:50 +0200 |
| Subject | [PATCH 1/3] ARC: module: support R_ARC_32_PCREL relocation |
| Message-ID | <sjeBP-2xm-15@gated-at.bofh.it> |
| In reply to | #1486900 |
Signed-off-by: Vineet Gupta <vgupta@synopsys.com> --- arch/arc/include/asm/elf.h | 3 +-- arch/arc/kernel/module.c | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/arc/include/asm/elf.h b/arch/arc/include/asm/elf.h index 51a99e25fe33..7096f97a1434 100644 --- a/arch/arc/include/asm/elf.h +++ b/arch/arc/include/asm/elf.h @@ -23,8 +23,7 @@ /* ARC Relocations (kernel Modules only) */ #define R_ARC_32 0x4 #define R_ARC_32_ME 0x1B -#define R_ARC_S25H_PCREL 0x10 -#define R_ARC_S25W_PCREL 0x11 +#define R_ARC_32_PCREL 0x31 /*to set parameters in the core dumps */ #define ELF_ARCH EM_ARCOMPACT diff --git a/arch/arc/kernel/module.c b/arch/arc/kernel/module.c index 376e04622962..576a238434a1 100644 --- a/arch/arc/kernel/module.c +++ b/arch/arc/kernel/module.c @@ -106,10 +106,12 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, */ relo_type = ELF32_R_TYPE(rel_entry[i].r_info); - if (likely(R_ARC_32_ME == relo_type)) + if (likely(R_ARC_32_ME == relo_type)) /* ME ( S + A ) */ arc_write_me((unsigned short *)location, relocation); - else if (R_ARC_32 == relo_type) + else if (R_ARC_32 == relo_type) /* ( S + A ) */ *((Elf32_Addr *) location) = relocation; + else if (R_ARC_32_PCREL == relo_type) /* ( S + A ) - PDATA ) */ + *((Elf32_Addr *) location) = relocation - location; else goto relo_err; -- 2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Vineet Gupta <Vineet.Gupta1@synopsys.com> |
|---|---|
| Date | 2016-09-20 00:00 +0200 |
| Subject | [PATCH 2/3] ARC: dw2 unwind: factor CIE specifics for .eh_frame/.debug_frame |
| Message-ID | <sjeLv-2Ar-1@gated-at.bofh.it> |
| In reply to | #1486900 |
This paves way for switching to .eh_frame based unwindiing
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
---
arch/arc/kernel/unwind.c | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c
index 0587bf121d11..4e5dbe7617a1 100644
--- a/arch/arc/kernel/unwind.c
+++ b/arch/arc/kernel/unwind.c
@@ -111,6 +111,8 @@ UNW_REGISTER_INFO};
#define DW_EH_PE_indirect 0x80
#define DW_EH_PE_omit 0xff
+#define CIE_ID 0xffffffffUL
+
typedef unsigned long uleb128_t;
typedef signed long sleb128_t;
@@ -232,6 +234,7 @@ void __init arc_unwind_init(void)
static const u32 bad_cie, not_fde;
static const u32 *cie_for_fde(const u32 *fde, const struct unwind_table *);
+static const u32 *__cie_for_fde(const u32 *fde);
static signed fde_pointer_type(const u32 *cie);
struct eh_frame_hdr_table_entry {
@@ -338,10 +341,9 @@ static void init_unwind_hdr(struct unwind_table *table,
for (fde = table->address, tableSize = table->size, n = 0;
tableSize;
tableSize -= sizeof(*fde) + *fde, fde += 1 + *fde / sizeof(*fde)) {
- /* const u32 *cie = fde + 1 - fde[1] / sizeof(*fde); */
- const u32 *cie = (const u32 *)(fde[1]);
+ const u32 *cie = __cie_for_fde(fde);
- if (fde[1] == 0xffffffff)
+ if (fde[1] == CIE_ID)
continue; /* this is a CIE */
ptr = (const u8 *)(fde + 2);
header->table[n].start = read_pointer(&ptr,
@@ -504,6 +506,16 @@ static sleb128_t get_sleb128(const u8 **pcur, const u8 *end)
return value;
}
+static const u32 *__cie_for_fde(const u32 *fde)
+{
+ const u32 *cie;
+
+ /* cie = fde + 1 - fde[1] / sizeof(*fde); */
+ cie = (u32 *) fde[1];
+
+ return cie;
+}
+
static const u32 *cie_for_fde(const u32 *fde, const struct unwind_table *table)
{
const u32 *cie;
@@ -511,19 +523,18 @@ static const u32 *cie_for_fde(const u32 *fde, const struct unwind_table *table)
if (!*fde || (*fde & (sizeof(*fde) - 1)))
return &bad_cie;
- if (fde[1] == 0xffffffff)
+ if (fde[1] == CIE_ID)
return ¬_fde; /* this is a CIE */
if ((fde[1] & (sizeof(*fde) - 1)))
/* || fde[1] > (unsigned long)(fde + 1) - (unsigned long)table->address) */
return NULL; /* this is not a valid FDE */
- /* cie = fde + 1 - fde[1] / sizeof(*fde); */
- cie = (u32 *) fde[1];
+ cie = __cie_for_fde(fde);
if (*cie <= sizeof(*cie) + 4 || *cie >= fde[1] - sizeof(*fde)
|| (*cie & (sizeof(*cie) - 1))
- || (cie[1] != 0xffffffff))
+ || (cie[1] != CIE_ID))
return NULL; /* this is not a (valid) CIE */
return cie;
}
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Vineet Gupta <Vineet.Gupta1@synopsys.com> |
|---|---|
| Date | 2016-09-20 00:00 +0200 |
| Subject | [PATCH 3/3] ARC: dw2 unwind: switch to .eh_frame based unwinding |
| Message-ID | <sjeLv-2Ar-9@gated-at.bofh.it> |
| In reply to | #1486900 |
So finally after almost 8 years of dealing with .debug_frame, we are
finally switching to .eh_frame. The reason being stripped kernel
binaries had non-functional unwinder as .debug_frame was gone.
Also, in general .eh_frame seems more common way of doing unwinding.
This also folds a revert of f52e126cc747 ("ARC: unwind: ensure that
.debug_frame is generated (vs. .eh_frame)") to ensure that we start
getting .eh_frame
Reported-by: Daniel Mentz <danielmentz@google.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
---
arch/arc/Makefile | 2 ++
arch/arc/kernel/entry.S | 12 ------------
arch/arc/kernel/module.c | 13 ++++---------
arch/arc/kernel/unwind.c | 5 ++---
arch/arc/kernel/vmlinux.lds.S | 15 +++++----------
5 files changed, 13 insertions(+), 34 deletions(-)
diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index 601ed173080b..fc6ff8f09f23 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -66,6 +66,8 @@ endif
endif
+cflags-$(CONFIG_ARC_DW2_UNWIND) += -fasynchronous-unwind-tables
+
# By default gcc 4.8 generates dwarf4 which kernel unwinder can't grok
ifeq ($(atleast_gcc48),y)
cflags-$(CONFIG_ARC_DW2_UNWIND) += -gdwarf-2
diff --git a/arch/arc/kernel/entry.S b/arch/arc/kernel/entry.S
index 2efb0625331d..741712d4d6ff 100644
--- a/arch/arc/kernel/entry.S
+++ b/arch/arc/kernel/entry.S
@@ -61,18 +61,6 @@ ENTRY(ret_from_fork)
b ret_from_exception
END(ret_from_fork)
-#ifdef CONFIG_ARC_DW2_UNWIND
-; Workaround for bug 94179 (STAR ):
-; Despite -fasynchronous-unwind-tables, linker is not making dwarf2 unwinder
-; section (.debug_frame) as loadable. So we force it here.
-; This also fixes STAR 9000487933 where the prev-workaround (objcopy --setflag)
-; would not work after a clean build due to kernel build system dependencies.
-.section .debug_frame, "wa",@progbits
-
-; Reset to .text as this file is included in entry-<isa>.S
-.section .text, "ax",@progbits
-#endif
-
;################### Non TLB Exception Handling #############################
; ---------------------------------------------
diff --git a/arch/arc/kernel/module.c b/arch/arc/kernel/module.c
index 576a238434a1..9a2849756022 100644
--- a/arch/arc/kernel/module.c
+++ b/arch/arc/kernel/module.c
@@ -22,13 +22,9 @@ static inline void arc_write_me(unsigned short *addr, unsigned long value)
*(addr + 1) = (value & 0xffff);
}
-/* ARC specific section quirks - before relocation loop in generic loader
- *
- * For dwarf unwinding out of modules, this needs to
- * 1. Ensure the .debug_frame is allocatable (ARC Linker bug: despite
- * -fasynchronous-unwind-tables it doesn't).
- * 2. Since we are iterating thru sec hdr tbl anyways, make a note of
- * the exact section index, for later use.
+/*
+ * This gets called before relocation loop in generic loader
+ * Make a note of the section index of unwinding section
*/
int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
char *secstr, struct module *mod)
@@ -40,8 +36,7 @@ int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
mod->arch.unw_info = NULL;
for (i = 1; i < hdr->e_shnum; i++) {
- if (strcmp(secstr+sechdrs[i].sh_name, ".debug_frame") == 0) {
- sechdrs[i].sh_flags |= SHF_ALLOC;
+ if (strcmp(secstr+sechdrs[i].sh_name, ".eh_frame") == 0) {
mod->arch.unw_sec_idx = i;
break;
}
diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c
index 4e5dbe7617a1..61fd1ce63c56 100644
--- a/arch/arc/kernel/unwind.c
+++ b/arch/arc/kernel/unwind.c
@@ -111,7 +111,7 @@ UNW_REGISTER_INFO};
#define DW_EH_PE_indirect 0x80
#define DW_EH_PE_omit 0xff
-#define CIE_ID 0xffffffffUL
+#define CIE_ID 0
typedef unsigned long uleb128_t;
typedef signed long sleb128_t;
@@ -510,8 +510,7 @@ static const u32 *__cie_for_fde(const u32 *fde)
{
const u32 *cie;
- /* cie = fde + 1 - fde[1] / sizeof(*fde); */
- cie = (u32 *) fde[1];
+ cie = fde + 1 - fde[1] / sizeof(*fde);
return cie;
}
diff --git a/arch/arc/kernel/vmlinux.lds.S b/arch/arc/kernel/vmlinux.lds.S
index 894e696bddaa..bb6d8c5ff2e9 100644
--- a/arch/arc/kernel/vmlinux.lds.S
+++ b/arch/arc/kernel/vmlinux.lds.S
@@ -84,7 +84,7 @@ SECTIONS
/*
* .exit.text is discard at runtime, not link time, to deal with
- * references from .debug_frame
+ * references from unwinding sections
* It will be init freed, being inside [__init_start : __init_end]
*/
.exit.text : { EXIT_TEXT }
@@ -120,18 +120,13 @@ SECTIONS
#ifdef CONFIG_ARC_DW2_UNWIND
. = ALIGN(PAGE_SIZE);
- .debug_frame : {
+ .eh_frame : {
__start_unwind = .;
- *(.debug_frame)
+ *(.eh_frame)
__end_unwind = .;
}
- /*
- * gcc 4.8 generates this for -fasynchonous-unwind-tables,
- * while we still use the .debug_frame based unwinder
- */
- /DISCARD/ : { *(.eh_frame) }
#else
- /DISCARD/ : { *(.debug_frame) }
+ /DISCARD/ : { *(.eh_frame) }
#endif
NOTES
@@ -148,7 +143,7 @@ SECTIONS
}
#ifndef CONFIG_DEBUG_INFO
- /* open-coded because we need .debug_frame seperately for unwinding */
+ /DISCARD/ : { *(.debug_frame) }
/DISCARD/ : { *(.debug_aranges) }
/DISCARD/ : { *(.debug_pubnames) }
/DISCARD/ : { *(.debug_info) }
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Daniel Mentz <danielmentz@google.com> |
|---|---|
| Date | 2016-09-20 03:30 +0200 |
| Message-ID | <sji2J-4LH-1@gated-at.bofh.it> |
| In reply to | #1486900 |
Hi Vineet, Thank you for your patches. I applied them, and verified that unwinding works with code that is compiled into the kernel image as well as kernel modules. I confirmed that the .eh_frame section is present and that the .debug_frame section is absent. I also verified that the file size of the .ko files are small enough for our embedded platform and that unnecessary sections like .debug_info, .debug_line, .debug_str etc. are also absent. Is there anything else you want me to test? Thanks Daniel On Mon, Sep 19, 2016 at 2:49 PM, Vineet Gupta <Vineet.Gupta1@synopsys.com> wrote: > Hi Daniel, > > Give these a shot and let me know if they work fine for you. > I'm working on some more improvements to unwinder which will follow > a bit later. > > Thx, > -Vineet > > Vineet Gupta (3): > ARC: module: support R_ARC_32_PCREL relocation > ARC: dw2 unwind: factor CIE specifics for .eh_frame/.debug_frame > ARC: dw2 unwind: switch to .eh_frame based unwinding > > arch/arc/Makefile | 2 ++ > arch/arc/include/asm/elf.h | 3 +-- > arch/arc/kernel/entry.S | 12 ------------ > arch/arc/kernel/module.c | 19 ++++++++----------- > arch/arc/kernel/unwind.c | 24 +++++++++++++++++------- > arch/arc/kernel/vmlinux.lds.S | 15 +++++---------- > 6 files changed, 33 insertions(+), 42 deletions(-) > > -- > 2.7.4 >
[toc] | [prev] | [next] | [standalone]
| From | Vineet Gupta <vgupta@synopsys.com> |
|---|---|
| Date | 2016-09-20 08:20 +0200 |
| Message-ID | <sjmzn-7Jp-11@gated-at.bofh.it> |
| In reply to | #1486995 |
On 09/19/2016 06:21 PM, Daniel Mentz wrote: > Hi Vineet, > > Thank you for your patches. I applied them, and verified that > unwinding works with code that is compiled into the kernel image as > well as kernel modules. > I confirmed that the .eh_frame section is present and that the > .debug_frame section is absent. I also verified that the file size of > the .ko files are small enough for our embedded platform and that > unnecessary sections like .debug_info, .debug_line, .debug_str etc. > are also absent. > Is there anything else you want me to test? > Thanks > Daniel Nope - that is it. Just wanted to make sure it is "field" tested :-) Thx, -Vineet > On Mon, Sep 19, 2016 at 2:49 PM, Vineet Gupta > <Vineet.Gupta1@synopsys.com> wrote: >> Hi Daniel, >> >> Give these a shot and let me know if they work fine for you. >> I'm working on some more improvements to unwinder which will follow >> a bit later. >> >> Thx, >> -Vineet >> >> Vineet Gupta (3): >> ARC: module: support R_ARC_32_PCREL relocation >> ARC: dw2 unwind: factor CIE specifics for .eh_frame/.debug_frame >> ARC: dw2 unwind: switch to .eh_frame based unwinding >> >> arch/arc/Makefile | 2 ++ >> arch/arc/include/asm/elf.h | 3 +-- >> arch/arc/kernel/entry.S | 12 ------------ >> arch/arc/kernel/module.c | 19 ++++++++----------- >> arch/arc/kernel/unwind.c | 24 +++++++++++++++++------- >> arch/arc/kernel/vmlinux.lds.S | 15 +++++---------- >> 6 files changed, 33 insertions(+), 42 deletions(-) >> >> -- >> 2.7.4 >> >
[toc] | [prev] | [next] | [standalone]
| From | Vineet Gupta <Vineet.Gupta1@synopsys.com> |
|---|---|
| Date | 2016-09-22 22:40 +0200 |
| Message-ID | <skiWJ-2CY-3@gated-at.bofh.it> |
| In reply to | #1487081 |
Hi Daniel, On 09/19/2016 11:13 PM, Vineet Gupta wrote: > On 09/19/2016 06:21 PM, Daniel Mentz wrote: >> > Hi Vineet, >> > >> > Thank you for your patches. I applied them, and verified that >> > unwinding works with code that is compiled into the kernel image as >> > well as kernel modules. >> > I confirmed that the .eh_frame section is present and that the >> > .debug_frame section is absent. I also verified that the file size of >> > the .ko files are small enough for our embedded platform and that >> > unnecessary sections like .debug_info, .debug_line, .debug_str etc. >> > are also absent. >> > Is there anything else you want me to test? >> > Thanks >> > Daniel > Nope - that is it. Just wanted to make sure it is "field" tested :-) > > Thx, > -Vineet FYI - I've pushed some more changes to unwinding department so that we get call-traces for memset/memcpy et al. git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc.git #for-next -Vineet
[toc] | [prev] | [next] | [standalone]
| From | Vineet Gupta <Vineet.Gupta1@synopsys.com> |
|---|---|
| Date | 2016-09-22 23:00 +0200 |
| Subject | modules still have .debug_* (was Re: [PATCH 0/3] ARC unwinder switch to .eh_frame) |
| Message-ID | <skjg6-2JH-11@gated-at.bofh.it> |
| In reply to | #1486995 |
Hi Daniel, On 09/19/2016 06:21 PM, Daniel Mentz wrote: > I confirmed that the .eh_frame section is present and that the > .debug_frame section is absent. I also verified that the file size of > the .ko files are small enough for our embedded platform and that > unnecessary sections like .debug_info, .debug_line, .debug_str etc. > are also absent. BTW it seems with my latest set of patches, modules still have .debug_*. Can you double check if your tree still has the interim patch which added a linker script for modules to strip out .debug_* http://lists.infradead.org/pipermail/linux-snps-arc/2016-September/001483.html I'm not planning to carry it and would prefer addressing the the root cause by removing the -gdwarf-2 toggle. I've added that and pushed rebased series. Care to take it for a respin please. Thx, -Vineet
[toc] | [prev] | [next] | [standalone]
| From | Daniel Mentz <danielmentz@google.com> |
|---|---|
| Date | 2016-09-23 00:40 +0200 |
| Subject | Re: modules still have .debug_* (was Re: [PATCH 0/3] ARC unwinder switch to .eh_frame) |
| Message-ID | <skkOR-3Qd-9@gated-at.bofh.it> |
| In reply to | #1489532 |
On Thu, Sep 22, 2016 at 1:59 PM, Vineet Gupta <Vineet.Gupta1@synopsys.com> wrote: > Hi Daniel, > > On 09/19/2016 06:21 PM, Daniel Mentz wrote: >> I confirmed that the .eh_frame section is present and that the >> .debug_frame section is absent. I also verified that the file size of >> the .ko files are small enough for our embedded platform and that >> unnecessary sections like .debug_info, .debug_line, .debug_str etc. >> are also absent. > > BTW it seems with my latest set of patches, modules still have .debug_*. > Can you double check if your tree still has the interim patch which added a linker > script for modules to strip out .debug_* > > http://lists.infradead.org/pipermail/linux-snps-arc/2016-September/001483.html Hi Vineet, Sorry, that was a misunderstanding. Buildroot routinely runs the strip command on .ko files before installing them on the target. I was only looking at the .ko files *after* running the strip command. No, the interim patch was not in my tree. I confirmed that your commit "ARC: dw2 unwind: don't force dwarf 2" is indeed necessary to suppress the .debug_* sections when CONFIG_DEBUG_INFO is off. But again, we're stripping .ko files anyways before installing. > I'm not planning to carry it and would prefer addressing the the root cause by > removing the -gdwarf-2 toggle. I've added that and pushed rebased series. Care to > take it for a respin please. I downloaded your latest commit e47305af57d7eedc10b4720e604d669b10c69e3b and verified that stack traces are properly displayed for code inside kernel modules as well as vmlinux. I also called memcpy() on some bad address and got a proper stack trace that involved memcpy(). I conclude that unwinding works for us. Thank You Daniel
[toc] | [prev] | [next] | [standalone]
| From | Alexey Brodkin <Alexey.Brodkin@synopsys.com> |
|---|---|
| Date | 2016-09-23 12:40 +0200 |
| Subject | Re: modules still have .debug_* (was Re: [PATCH 0/3] ARC unwinder switch to .eh_frame) |
| Message-ID | <skw3D-2sP-21@gated-at.bofh.it> |
| In reply to | #1489625 |
Hi Daniel, On Thu, 2016-09-22 at 15:37 -0700, Daniel Mentz wrote: > On Thu, Sep 22, 2016 at 1:59 PM, Vineet Gupta > <Vineet.Gupta1@synopsys.com> wrote: > > > > Hi Daniel, > > > > On 09/19/2016 06:21 PM, Daniel Mentz wrote: > > > > > > I confirmed that the .eh_frame section is present and that the > > > .debug_frame section is absent. I also verified that the file size of > > > the .ko files are small enough for our embedded platform and that > > > unnecessary sections like .debug_info, .debug_line, .debug_str etc. > > > are also absent. > > > > BTW it seems with my latest set of patches, modules still have .debug_*. > > Can you double check if your tree still has the interim patch which added a linker > > script for modules to strip out .debug_* > > > > http://lists.infradead.org/pipermail/linux-snps-arc/2016-September/001483.html > > Hi Vineet, > > Sorry, that was a misunderstanding. Buildroot routinely runs the strip > command on .ko files before installing them on the target. I was only > looking at the .ko files *after* running the strip command. No, the > interim patch was not in my tree. Well are you sure buildroot really touches modules in Linux kernel build folder? Buildroot just runs a simple "make" command in "output/build/linux-x.y". And only on installation step Buildroot strips binaries in "output/target" folder. Moreover starting from that commit https://git.buildroot.net/buildroot/commit/?id=10c4d27aef4dca01572cfc8146cbfd194a1a85e4 even on Linux installation step Buildroot reuses kernel's module stripping infrastructure but again that happens only on target. Just in case that's what I see when building MSDOSFS as module. In build folder: ----------------------------->8------------------------------- arc-linux-readelf -S build/linux-4.7.3/fs/fat/msdos.ko There are 38 section headers, starting at offset 0x2a630: Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .note.gnu.build-i NOTE 00000000 000034 000024 00 A 0 0 4 [ 2] .text PROGBITS 00000000 000058 0013a8 00 AX 0 0 4 [ 3] .rela.text RELA 00000000 01c774 000600 0c I 35 2 4 [ 4] .init.text PROGBITS 00000000 001400 000010 00 AX 0 0 4 [ 5] .rela.init.text RELA 00000000 01cd74 000018 0c I 35 4 4 [ 6] .exit.text PROGBITS 00000000 001410 000010 00 AX 0 0 4 [ 7] .rela.exit.text RELA 00000000 01cd8c 000018 0c I 35 6 4 [ 8] .rodata PROGBITS 00000000 001440 000100 00 A 0 0 64 [ 9] .rela.rodata RELA 00000000 01cda4 000078 0c I 35 8 4 [10] .modinfo PROGBITS 00000000 001540 000090 00 A 0 0 4 [11] .rodata.str1.4 PROGBITS 00000000 0015d0 000030 01 AMS 0 0 4 [12] .data PROGBITS 00000000 001600 00002c 00 WA 0 0 4 [13] .rela.data RELA 00000000 01ce1c 000030 0c I 35 12 4 [14] .gnu.linkonce.thi PROGBITS 00000000 001640 000140 00 WA 0 0 64 [15] .rela.gnu.linkonc RELA 00000000 01ce4c 00000c 0c I 35 14 4 [16] .tdata PROGBITS 00000000 001780 000000 00 WAT 0 0 1 [17] .tbss NOBITS 00000000 001780 000000 00 WAT 0 0 1 [18] .bss NOBITS 00000000 001780 000000 00 WA 0 0 1 [19] .comment PROGBITS 00000000 001780 000078 01 MS 0 0 1 [20] .note.GNU-stack PROGBITS 00000000 0017f8 000000 00 0 0 1 [21] .debug_aranges PROGBITS 00000000 0017f8 000048 00 0 0 1 [22] .rela.debug_arang RELA 00000000 01ce58 00003c 0c I 35 21 4 [23] .debug_info PROGBITS 00000000 001840 00eaa9 00 0 0 1 [24] .rela.debug_info RELA 00000000 01ce94 00a53c 0c I 35 23 4 [25] .debug_abbrev PROGBITS 00000000 0102e9 0008b3 00 0 0 1 [26] .debug_line PROGBITS 00000000 010b9c 001d4d 00 0 0 1 [27] .rela.debug_line RELA 00000000 0273d0 001818 0c I 35 26 4 [28] .debug_frame PROGBITS 00000000 0128ec 0002d8 00 0 0 4 [29] .rela.debug_frame RELA 00000000 028be8 000168 0c I 35 28 4 [30] .debug_str PROGBITS 00000000 012bc4 008485 01 MS 0 0 1 [31] .debug_loc PROGBITS 00000000 01b049 000b49 00 0 0 1 [32] .rela.debug_loc RELA 00000000 028d50 001308 0c I 35 31 4 [33] .debug_ranges PROGBITS 00000000 01bb92 0001f8 00 0 0 1 [34] .rela.debug_range RELA 00000000 02a058 000480 0c I 35 33 4 [35] .symtab SYMTAB 00000000 01bd8c 0005e0 10 36 53 4 [36] .strtab STRTAB 00000000 01c36c 000407 00 0 0 1 [37] .shstrtab STRTAB 00000000 02a4d8 000157 00 0 0 1 Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings), I (info), L (link order), O (extra OS processing required), G (group), T (TLS), C (compressed), x (unknown), o (OS specific), E (exclude), p (processor specific) ----------------------------->8------------------------------- On target: ----------------------------->8------------------------------- arc-linux-readelf -S target/lib/modules/4.7.3/kernel/fs/fat/msdos.ko There are 24 section headers, starting at offset 0x28e0: Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .note.gnu.build-i NOTE 00000000 000034 000024 00 A 0 0 4 [ 2] .text PROGBITS 00000000 000058 0013a8 00 AX 0 0 4 [ 3] .rela.text RELA 00000000 002128 000600 0c I 21 2 4 [ 4] .init.text PROGBITS 00000000 001400 000010 00 AX 0 0 4 [ 5] .rela.init.text RELA 00000000 002728 000018 0c I 21 4 4 [ 6] .exit.text PROGBITS 00000000 001410 000010 00 AX 0 0 4 [ 7] .rela.exit.text RELA 00000000 002740 000018 0c I 21 6 4 [ 8] .rodata PROGBITS 00000000 001440 000100 00 A 0 0 64 [ 9] .rela.rodata RELA 00000000 002758 000078 0c I 21 8 4 [10] .modinfo PROGBITS 00000000 001540 000090 00 A 0 0 4 [11] .rodata.str1.4 PROGBITS 00000000 0015d0 000030 01 AMS 0 0 4 [12] .data PROGBITS 00000000 001600 00002c 00 WA 0 0 4 [13] .rela.data RELA 00000000 0027d0 000030 0c I 21 12 4 [14] .gnu.linkonce.thi PROGBITS 00000000 001640 000140 00 WA 0 0 64 [15] .rela.gnu.linkonc RELA 00000000 002800 00000c 0c I 21 14 4 [16] .tdata PROGBITS 00000000 001780 000000 00 WAT 0 0 1 [17] .tbss NOBITS 00000000 001780 000000 00 WAT 0 0 1 [18] .bss NOBITS 00000000 001780 000000 00 WA 0 0 1 [19] .comment PROGBITS 00000000 001780 000078 01 MS 0 0 1 [20] .note.GNU-stack PROGBITS 00000000 0017f8 000000 00 0 0 1 [21] .symtab SYMTAB 00000000 0017f8 000540 10 22 43 4 [22] .strtab STRTAB 00000000 001d38 0003ed 00 0 0 1 [23] .shstrtab STRTAB 00000000 00280c 0000d3 00 0 0 1 Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings), I (info), L (link order), O (extra OS processing required), G (group), T (TLS), C (compressed), x (unknown), o (OS specific), E (exclude), p (processor specific) ----------------------------->8------------------------------- -Alexey
[toc] | [prev] | [next] | [standalone]
| From | Daniel Mentz <danielmentz@google.com> |
|---|---|
| Date | 2016-09-24 03:10 +0200 |
| Subject | Re: modules still have .debug_* (was Re: [PATCH 0/3] ARC unwinder switch to .eh_frame) |
| Message-ID | <skJDz-2QE-3@gated-at.bofh.it> |
| In reply to | #1489936 |
On Fri, Sep 23, 2016 at 3:38 AM, Alexey Brodkin <Alexey.Brodkin@synopsys.com> wrote: > On Thu, 2016-09-22 at 15:37 -0700, Daniel Mentz wrote: >> Sorry, that was a misunderstanding. Buildroot routinely runs the strip >> command on .ko files before installing them on the target. I was only >> looking at the .ko files *after* running the strip command. No, the >> interim patch was not in my tree. > > Well are you sure buildroot really touches modules in Linux kernel build folder? > Buildroot just runs a simple "make" command in "output/build/linux-x.y". Sorry, that was phrased badly. Buildroot does not touch the modules in the Linux kernel build folder. Modules are stripped in the target directory as you described. > And only on installation step Buildroot strips binaries in "output/target" folder. > Moreover starting from that commit > https://git.buildroot.net/buildroot/commit/?id=10c4d27aef4dca01572cfc8146cbfd194a1a85e4 > even on Linux installation step Buildroot reuses kernel's module stripping infrastructure > but again that happens only on target.
[toc] | [prev] | [next] | [standalone]
| From | Alexey Brodkin <Alexey.Brodkin@synopsys.com> |
|---|---|
| Date | 2016-09-26 14:40 +0200 |
| Subject | Re: modules still have .debug_* (was Re: [PATCH 0/3] ARC unwinder switch to .eh_frame) |
| Message-ID | <slDmp-3Pp-3@gated-at.bofh.it> |
| In reply to | #1490520 |
Hi Daniel, On Fri, 2016-09-23 at 18:04 -0700, Daniel Mentz wrote: > On Fri, Sep 23, 2016 at 3:38 AM, Alexey Brodkin > <Alexey.Brodkin@synopsys.com> wrote: > > > > On Thu, 2016-09-22 at 15:37 -0700, Daniel Mentz wrote: > > > > > > Sorry, that was a misunderstanding. Buildroot routinely runs the strip > > > command on .ko files before installing them on the target. I was only > > > looking at the .ko files *after* running the strip command. No, the > > > interim patch was not in my tree. > > > > Well are you sure buildroot really touches modules in Linux kernel build folder? > > Buildroot just runs a simple "make" command in "output/build/linux-x.y". > > Sorry, that was phrased badly. Buildroot does not touch the modules in > the Linux kernel build folder. Modules are stripped in the target > directory as you described. So every is as expected now for you or there're still thing you don't like? -Alexey
[toc] | [prev] | [next] | [standalone]
| From | Daniel Mentz <danielmentz@google.com> |
|---|---|
| Date | 2016-09-26 21:00 +0200 |
| Subject | Re: modules still have .debug_* (was Re: [PATCH 0/3] ARC unwinder switch to .eh_frame) |
| Message-ID | <slJi9-7sh-15@gated-at.bofh.it> |
| In reply to | #1491265 |
On Mon, Sep 26, 2016 at 5:38 AM, Alexey Brodkin <Alexey.Brodkin@synopsys.com> wrote: > On Fri, 2016-09-23 at 18:04 -0700, Daniel Mentz wrote: >> On Fri, Sep 23, 2016 at 3:38 AM, Alexey Brodkin >> <Alexey.Brodkin@synopsys.com> wrote: >> > >> > On Thu, 2016-09-22 at 15:37 -0700, Daniel Mentz wrote: >> > > >> > > Sorry, that was a misunderstanding. Buildroot routinely runs the strip >> > > command on .ko files before installing them on the target. I was only >> > > looking at the .ko files *after* running the strip command. No, the >> > > interim patch was not in my tree. >> > >> > Well are you sure buildroot really touches modules in Linux kernel build folder? >> > Buildroot just runs a simple "make" command in "output/build/linux-x.y". >> >> Sorry, that was phrased badly. Buildroot does not touch the modules in >> the Linux kernel build folder. Modules are stripped in the target >> directory as you described. > > So every is as expected now for you or there're still thing you don't like? Yes, everything works as expected now. Thank you for Synposys' support with this issue.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web