[Bug general/23901] run-backtrace-native-core returns error isntead of skip

2018-11-21 Thread mark at klomp dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=23901

--- Comment #3 from Mark Wielaard  ---
Odd, the trap on exit really should remove those.
But explicitly cleaning the test files seems to work:

diff --git a/tests/backtrace-subr.sh b/tests/backtrace-subr.sh
index ff42c6f..53c719d 100644
--- a/tests/backtrace-subr.sh
+++ b/tests/backtrace-subr.sh
@@ -85,6 +85,7 @@ check_unsupported()
   testname=$2
   if grep -q ': Unwinding not supported for this architecture$' $err; then
 echo >&2 $testname: arch not supported
+test_cleanup
 exit 77
   fi
 }

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Re: [PATCH] Add -Wtrampolines to CFLAGS.

2018-11-21 Thread Mark Wielaard
On Mon, 2018-11-19 at 11:54 +0100, Mark Wielaard wrote:
> elfutils uses nested functions a lot. This is fine unless one takes
> the
> address of such a nested function. When taking the address of a
> nested
> function a trampoline is generated that on some systems require the
> stack
> to be executable. That is bad. We never want to generate such
> trampolines.
> Add -Wtrampolines to CLAGS to make sure we don't.

Pushed to master.


Re: [PATCH] libelf: Get alignement correct when calling conversion functions.

2018-11-21 Thread Mark Wielaard
On Sun, 2018-11-18 at 15:38 +0100, Mark Wielaard wrote:
> When writing out data that needs to be converted we have to make sure
> the conversion function is called on correctly aligned buffers. When
> using mmap this might mean we have to convert into a temporarily
> buffer
> if the user wants to write out the section at a location that is not
> correctly aligned for the section type.
> 
> Older gas would generate misaligned ELF notes for the .version
> directive. When copying over such notes using mmap from files with
> a different endianness using mmap we would get the alignment of the
> conversion destination wrong.
> 
> The new testcase would fail with configure --enable-sanitize-
> undefined
> on little endian systems. The GCC undefinited sanitizer caught a
> similar
> issue with testfile1 on big endian systems.
> 
> gelf_xlate.h:47:1: runtime error: member access within misaligned
> address
> 0x7f8145d770d5 for type 'struct Elf32_Nhdr', which requires 4 byte
> alignment

Pushed to master (with the typo in the subject fixed).


[Bug backends/23902] varlocs dwarf_cfi_addrframe: unknown error

2018-11-21 Thread mark at klomp dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=23902

Mark Wielaard  changed:

   What|Removed |Added

 CC||mark at klomp dot org

--- Comment #1 from Mark Wielaard  ---
The common theme might be that these arches don't use standard .eh_frame and/or
have some non-standard section name or type for the unwind tables?

alpha does have an upstream backend, but I am not sure when it was last tested.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[Bug libelf/23903] Uses linux specifc mremap

2018-11-21 Thread mark at klomp dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=23903

Mark Wielaard  changed:

   What|Removed |Added

 CC||mark at klomp dot org

--- Comment #1 from Mark Wielaard  ---
That is a weird error. It means you could compile fine as if mremap was
available, but only during linking it is suddenly discovered that there is no
mremap?

mremap is needed for supporting ELF_C_RDWR_MMAP with ELF files that grow. See
for example the tests/run-copyadd-sections.sh and
tests/run-copymany-sections.sh testcases (and the explanation in the second why
we don't use ELF_C_RDWR_MMAP). mremap is used because it is the only way to
extend an mmap without moving it.

Even on GNU/Linux mremap might fail, in which case writing out an
ELF_C_RDWR_MMAPed ELF file might just not work (it normally works when
extending the file a little, but not when multiple pages are needed).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[Bug general/23901] run-backtrace-native-core returns error isntead of skip

2018-11-21 Thread kurt at roeckx dot be
https://sourceware.org/bugzilla/show_bug.cgi?id=23901

--- Comment #4 from Kurt Roeckx  ---
I can confirm that the patch fixes the issue for me.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[Bug general/23901] run-backtrace-native-core returns error isntead of skip

2018-11-21 Thread mark at klomp dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=23901

Mark Wielaard  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Mark Wielaard  ---
commit 628b4a93c6863b9982d817db6acaacbc4e116453
Author: Mark Wielaard 
Date:   Wed Nov 21 20:07:14 2018 +0100

tests: Call test_cleanup in backtrace-subr.sh check_unsupported.

We want to make sure all (temporary) test files are cleaned up even when
we exit 77 to skip the testcase.

https://sourceware.org/bugzilla/show_bug.cgi?id=23901

Tested-by: Kurt Roeckx 
Signed-off-by: Mark Wielaard 

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[Bug backends/23902] varlocs dwarf_cfi_addrframe: unknown error

2018-11-21 Thread kurt at roeckx dot be
https://sourceware.org/bugzilla/show_bug.cgi?id=23902

--- Comment #2 from Kurt Roeckx  ---
At least on mips I'm seeing an .eh_frame and .eh_frame_hdr section. It also has
some mips specific sections.

But note that various of the other tests say "Unwinding not supported for this
architecture". Is this just a test that also should get skipped?

PS: All arches except amd64 have "Unwinding not supported for this
architecture" in run-backtrace-data.sh, which I find a bit surprising.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[Bug libelf/23903] Uses linux specifc mremap

2018-11-21 Thread kurt at roeckx dot be
https://sourceware.org/bugzilla/show_bug.cgi?id=23903

--- Comment #2 from Kurt Roeckx  ---
Note that Debian's kfreebsd port uses glibc. Maybe they have mremap() in the
header even when it's not actually in the library?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[Bug libelf/23903] Uses linux specifc mremap

2018-11-21 Thread kurt at roeckx dot be
https://sourceware.org/bugzilla/show_bug.cgi?id=23903

--- Comment #3 from Kurt Roeckx  ---
On Hurd I get:
/usr/bin/ld: libelf_pic.a(elf32_updatefile.os): in function
`__elf32_updatemmap':
./libelf/elf32_updatefile.c:462: warning: msync is not implemented and will
always fail
/usr/bin/ld: libelf_pic.a(elf_update.os): in function `write_file':
./libelf/elf_update.c:109: undefined reference to `mremap'

-- 
You are receiving this mail because:
You are on the CC list for the bug.