[PATCH] Support EM_PPC machine flags
This fixes the elflint self test when the compiler is configured for PIE default. Signed-off-by: Andreas Schwab --- backends/ChangeLog| 5 + backends/ppc_init.c | 1 + backends/ppc_symbol.c | 10 ++ 3 files changed, 16 insertions(+) diff --git a/backends/ChangeLog b/backends/ChangeLog index f0d29f62e8..c5f61e85a3 100644 --- a/backends/ChangeLog +++ b/backends/ChangeLog @@ -1,3 +1,8 @@ +2017-06-15 Andreas Schwab + + * ppc_symbol.c (ppc_machine_flag_check): New function. + * ppc_init.c (ppc_init): Hook it. + 2017-05-30 Mark Wielaard * ppc64_unwind.c: New file. diff --git a/backends/ppc_init.c b/backends/ppc_init.c index c3e3ca3607..aea9f2d740 100644 --- a/backends/ppc_init.c +++ b/backends/ppc_init.c @@ -53,6 +53,7 @@ ppc_init (Elf *elf __attribute__ ((unused)), eh->name = "PowerPC"; ppc_init_reloc (eh); HOOK (eh, reloc_simple_type); + HOOK (eh, machine_flag_check); HOOK (eh, dynamic_tag_name); HOOK (eh, dynamic_tag_check); HOOK (eh, check_special_symbol); diff --git a/backends/ppc_symbol.c b/backends/ppc_symbol.c index 1273c1d299..4b32003acc 100644 --- a/backends/ppc_symbol.c +++ b/backends/ppc_symbol.c @@ -57,6 +57,16 @@ ppc_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type) } +/* Check whether machine flags are valid. */ +bool +ppc_machine_flag_check (GElf_Word flags) +{ + return ((flags &~ (EF_PPC_EMB +| EF_PPC_RELOCATABLE +| EF_PPC_RELOCATABLE_LIB)) == 0); +} + + const char * ppc_dynamic_tag_name (int64_t tag, char *buf __attribute__ ((unused)), size_t len __attribute__ ((unused))) -- 2.13.1 -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
Re: [PATCH] Support EM_PPC machine flags
On Thu, Jun 15, 2017 at 02:14:50PM +0200, Andreas Schwab wrote: > This fixes the elflint self test when the compiler is configured for PIE > default. Thanks. Pushed to master.
[Bug libdw/21602] New: dwfl_addrmodule reports bogus modules for unmapped areas
https://sourceware.org/bugzilla/show_bug.cgi?id=21602 Bug ID: 21602 Summary: dwfl_addrmodule reports bogus modules for unmapped areas Product: elfutils Version: unspecified Status: NEW Severity: normal Priority: P2 Component: libdw Assignee: unassigned at sourceware dot org Reporter: jan.kratochvil at redhat dot com CC: elfutils-devel at sourceware dot org Target Milestone: --- LD_LIBRARY_PATH=./libdw/ ./src/addr2line -p $p 0x7f7d33043000 Actual: insert: 0x55be1a359000..0x55be1a561000 i=0 segndx=-1 need_start=1 need_end=1 insert: 0x7f7d2c0e7000..0x7f7d32c8 i=2 segndx=-1 need_start=1 need_end=1 insert: 0x7f7d33046000..0x7f7d3326d000 i=4 segndx=-1 need_start=1 need_end=1 insert: 0x7ffdcf1bc000..0x7ffdcf1be000 i=6 segndx=-1 need_start=1 need_end=1 0x7f7d33043000 -> /usr/lib64/libc-2.24.so ??:0 Expected: 0x7f7d33043000 -> null ??:0 reify_segments() seems to do something wrong. That lookup_addr array seems to be wrongly built. 55be1a359000-55be1a36 r-xp fd:00 13636393 /usr/bin/sleep 55be1a55f000-55be1a56 r--p 6000 fd:00 13636393 /usr/bin/sleep 55be1a56-55be1a561000 rw-p 7000 fd:00 13636393 /usr/bin/sleep 55be1be9b000-55be1bebc000 rw-p 00:00 0 [heap] 7f7d2c0e7000-7f7d32c8 r--p fd:00 13651402 /usr/lib/locale/locale-archive 7f7d32c8-7f7d32e3d000 r-xp fd:00 13632051 /usr/lib64/libc-2.24.so 7f7d32e3d000-7f7d3303c000 ---p 001bd000 fd:00 13632051 /usr/lib64/libc-2.24.so 7f7d3303c000-7f7d3304 r--p 001bc000 fd:00 13632051 /usr/lib64/libc-2.24.so 7f7d3304-7f7d33042000 rw-p 001c fd:00 13632051 /usr/lib64/libc-2.24.so 7f7d33042000-7f7d33046000 rw-p 00:00 0 ^^^ 0x7f7d33043000 belongs here with no mapped file 7f7d33046000-7f7d3306b000 r-xp fd:00 13632665 /usr/lib64/ld-2.24.so 7f7d3323d000-7f7d3323f000 rw-p 00:00 0 7f7d33269000-7f7d3326b000 rw-p 00:00 0 7f7d3326b000-7f7d3326c000 r--p 00025000 fd:00 13632665 /usr/lib64/ld-2.24.so 7f7d3326c000-7f7d3326d000 rw-p 00026000 fd:00 13632665 /usr/lib64/ld-2.24.so -- You are receiving this mail because: You are on the CC list for the bug.
[Bug libdw/21602] dwfl_addrmodule reports bogus modules for unmapped areas
https://sourceware.org/bugzilla/show_bug.cgi?id=21602 Jan Kratochvil changed: What|Removed |Added CC||jan.kratochvil at redhat dot com --- Comment #1 from Jan Kratochvil --- Created attachment 10149 --> https://sourceware.org/bugzilla/attachment.cgi?id=10149&action=edit shown debugging output patch -- You are receiving this mail because: You are on the CC list for the bug.