[Bug gprofng/32018] Compilation of binutils 2.43 for riscv64-unknown-linux-gnu failed on CentOS 6

2024-07-29 Thread bigmagicreadsun at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32018

--- Comment #13 from bigmagicreadsun  ---
(In reply to Vladimir Mezentsev from comment #12)
> Could you try this fix on CentOS:
> 
> % diff --git a/gprofng/libcollector/hwprofile.c
> b/gprofng/libcollector/hwprofile.c
> index cfe0d84dc1e..3b7f4840aa0 100644
> --- a/gprofng/libcollector/hwprofile.c
> +++ b/gprofng/libcollector/hwprofile.c
> @@ -216,13 +216,13 @@ open_experiment (const char *exp)
>   params += 2;
>   break;
> }
> -  params = CALL_UTIL (strchr)(params, ';');
> +  params = __collector_strchr (params, ';');
>if (params)
> params++;
>  }
>if (params == NULL)  /* HWC profiling not specified */
>  return COL_ERROR_HWCINIT;
> -  char *s = CALL_UTIL (strchr)(params, (int) ';');
> +  char *s = __collector_strchr (params, (int) ';');
>int sz = s ? s - params : CALL_UTIL (strlen)(params);
>char *defstring = (char*) alloca (sz + 1);
>CALL_UTIL (strlcpy)(defstring, params, sz + 1);
> 
> 
> If this solves the problem, I will prepare a patch.

The corrected patch can solve the error problem of compiling binutils on
centos6. Thank you

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


[Bug gold/32032] dwp segfaults on hello world binary

2024-07-29 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=32032

--- Comment #1 from Sourceware Commits  ---
The master branch has been updated by Alan Modra :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=972092a9eda941a5744125f79fe58e52fb7007e4

commit 972092a9eda941a5744125f79fe58e52fb7007e4
Author: Alan Modra 
Date:   Mon Jul 29 14:25:07 2024 +0930

PR32032 dwp segfaults on hello world binary

Fixing the segfault is easy with this bandaid, but further work is
needed to teach dwp about DW_AT_dwo_name and dwo id in the cu header.
At the moment dwp only handles DW_AT_GNU_dwo_name and DW_AT_GNU_dwo_id.

PR 32032
* dwp.cc (Dwp_output_file::finalize): Return immediately on
no output file.

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


[Bug binutils/31728] dlltool generates incorrect hints in import libraries

2024-07-29 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=31728

--- Comment #23 from Sourceware Commits  ---
The master branch has been updated by Alan Modra :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fb2a924990d3595c4b39cbcd37ebc36df761a3ad

commit fb2a924990d3595c4b39cbcd37ebc36df761a3ad
Author: Pali Rohár 
Date:   Fri Jul 26 15:10:18 2024 +0930

PR 31728 testcases

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


[Bug gas/32022] Assembler shouldn't accept invalid TLS instructions

2024-07-29 Thread jbeulich at suse dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32022

Jan Beulich  changed:

   What|Removed |Added

 CC||jbeulich at suse dot com

--- Comment #5 from Jan Beulich  ---
(In reply to H.J. Lu from comment #0)
> [hjl@gnu-tgl-3 tmp]$ ld y.o
> ld: warning: cannot find entry symbol _start; defaulting to 00401000
> ld: y.o: TLS transition from R_X86_64_GOTTPOFF to R_X86_64_TPOFF32 against
> `foo' at 0x3 in section `.text' failed
> ld: final link failed: bad value

And why exactly does linking need to fail is such a situation? The TLS
transitions are optional, aren't they? Not being able to do carry one out may
indeed deserve a warning (with a control to silence), but not more.

(In reply to H.J. Lu from comment #1)
> An assembler option should be provided to control the behavior.

Having an option to control this is fine with me. Yet then, if enabled, it
should really diagnose all suspicious constructs, not just a (random) subset.

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


[Bug binutils/31728] dlltool generates incorrect hints in import libraries

2024-07-29 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31728

Alan Modra  changed:

   What|Removed |Added

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

--- Comment #24 from Alan Modra  ---
commit 6c41f7a812d84 too

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


[Bug gas/32022] Assembler shouldn't accept invalid TLS instructions

2024-07-29 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32022

--- Comment #6 from Sam James  ---
(In reply to Jan Beulich from comment #5)
> (In reply to H.J. Lu from comment #0)
> > [hjl@gnu-tgl-3 tmp]$ ld y.o
> > ld: warning: cannot find entry symbol _start; defaulting to 00401000
> > ld: y.o: TLS transition from R_X86_64_GOTTPOFF to R_X86_64_TPOFF32 against
> > `foo' at 0x3 in section `.text' failed
> > ld: final link failed: bad value
> 
> And why exactly does linking need to fail is such a situation? The TLS
> transitions are optional, aren't they? Not being able to do carry one out
> may indeed deserve a warning (with a control to silence), but not more.
> 

We would need a way to make it error out by default when invoked by GCC then,
given it exposed an x86 backend issue.

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


[Bug gas/32022] Assembler shouldn't accept invalid TLS instructions

2024-07-29 Thread jbeulich at suse dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32022

--- Comment #7 from Jan Beulich  ---
(In reply to Sam James from comment #6)
> We would need a way to make it error out by default when invoked by GCC
> then, given it exposed an x86 backend issue.

I'm afraid I can't make the connection: These are orthogonal aspects. Plus,
assuming gcc has a suitable testcase in its testsuite, a warning ought to make
that fail anyway, wouldn't it?

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


[Bug gas/32022] Assembler shouldn't accept invalid TLS instructions

2024-07-29 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32022

--- Comment #8 from Sam James  ---
Without it erroring out, how would something like
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116043 be found?

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


[Bug gas/32022] Assembler shouldn't accept invalid TLS instructions

2024-07-29 Thread jbeulich at suse dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32022

--- Comment #9 from Jan Beulich  ---
By paying attention to the warning that I indicated would better be emitted
instead. If need be (and if nothing like that exists yet), I'm sure ld could be
taught to have behavior along the lines of the compiler's -Werror.

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


[Bug gas/32022] Assembler shouldn't accept invalid TLS instructions

2024-07-29 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32022

--- Comment #10 from Sam James  ---
(In reply to Jan Beulich from comment #9)
> By paying attention to the warning that I indicated would better be emitted
> instead. 

There's no way that's going to be effective when doing mass builds of
real-world software, as I do, to find regressions.

I try to keep an eye out but it's not going to scale.

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


Issue 68710 in oss-fuzz: binutils:fuzz_as: Unexpected-exit in xexit

2024-07-29 Thread sheriffbot via monorail
Updates:
Labels: Deadline-Approaching

Comment #2 on issue 68710 by sheriffbot: binutils:fuzz_as: Unexpected-exit in 
xexit
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=68710#c2

This bug is approaching its deadline for being fixed, and will be automatically 
derestricted within 7 days. If a fix is planned within 2 weeks after the 
deadline has passed, a grace extension can be granted.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

[Bug binutils/32035] New: heap overlfow in readelf (binutils/dwarf.c:3648)

2024-07-29 Thread jaehoon.jang at kaist dot ac.kr
https://sourceware.org/bugzilla/show_bug.cgi?id=32035

Bug ID: 32035
   Summary: heap overlfow in readelf (binutils/dwarf.c:3648)
   Product: binutils
   Version: 2.42
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: jaehoon.jang at kaist dot ac.kr
  Target Milestone: ---

Created attachment 15651
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15651&action=edit
poc

readelf build (binutils-2.42)
$ wget http://ftp.gnu.org/gnu/binutils/binutils-2.42.tar.gz
$ tar xvzf binutils-2.42.tar.gz
$ cd binutils-2.42
$ CC="clang -fsanitize=address -g" CXX="clang++ -fsanitize=address -g"
./configure --disable-shared --disable-gdb
$ make

readelf version
$ binutils/readelf --version
GNU readelf (GNU Binutils) 2.42
Copyright (C) 2024 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.

triggering heap-overflow with ASAN
root@56f3beb5803c:/benchmark/project/binutils-2.42/binutils-2.42#
binutils/readelf -w ~/poc1

File: /root/poc1(main1.o)
readelf: Warning: skipping invalid relocation symbol index 0x190009 in section
.debug_info
readelf: Warning: Invalid pointer size (0) in compunit header, using 4 instead
readelf: Warning: Unexpected form in top DIE
=
==221878==ERROR: AddressSanitizer: heap-buffer-overflow on address
0x608000a4 at pc 0x0042efef bp 0x7ffcf59dbad0 sp 0x7ffcf59db290
READ of size 1 at 0x608000a4 thread T0
#0 0x42efee in strnlen
/src/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:386:5
#1 0x527e68 in skip_attribute
/benchmark/project/binutils-2.42/binutils-2.42/binutils/./dwarf.c:3648:15
#2 0x527e68 in read_bases
/benchmark/project/binutils-2.42/binutils-2.42/binutils/./dwarf.c:3715:9
#3 0x527e68 in process_debug_info
/benchmark/project/binutils-2.42/binutils-2.42/binutils/./dwarf.c:4243:8
#4 0x52459a in load_separate_debug_files
/benchmark/project/binutils-2.42/binutils-2.42/binutils/./dwarf.c:12163:11
#5 0x4d59d8 in process_object
/benchmark/project/binutils-2.42/binutils-2.42/binutils/./readelf.c:23153:27
#6 0x4d4eaf in process_archive
/benchmark/project/binutils-2.42/binutils-2.42/binutils/./readelf.c:23490:10
#7 0x4cbdaa in process_file
/benchmark/project/binutils-2.42/binutils-2.42/binutils/./readelf.c
#8 0x4cbdaa in main
/benchmark/project/binutils-2.42/binutils-2.42/binutils/./readelf.c:23651:11
error: failed to decompress '.debug_aranges', zlib is not available
error: failed to decompress '.debug_info', zlib is not available
error: failed to decompress '.debug_abbrev', zlib is not available
error: failed to decompress '.debug_line', zlib is not available
error: failed to decompress '.debug_str', zlib is not available
error: failed to decompress '.debug_loc', zlib is not available
error: failed to decompress '.debug_ranges', zlib is not available
#9 0x7f6f6a344082 in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x24082)
#10 0x41c4ad in _start
(/benchmark/project/binutils-2.42/binutils-2.42/binutils/readelf+0x41c4ad)

0x608000a4 is located 48 bytes to the right of 84-byte region
[0x60800020,0x60800074)
allocated by thread T0 here:
#0 0x498ddd in malloc
/src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3
#1 0x4c923a in get_data
/benchmark/project/binutils-2.42/binutils-2.42/binutils/./readelf.c:533:14

SUMMARY: AddressSanitizer: heap-buffer-overflow
/src/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:386:5
in strnlen
Shadow bytes around the buggy address:
  0x0c107fff7fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c107fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c107fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c107fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c107fff8000: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 04 fa
=>0x0c107fff8010: fa fa fa fa[fa]fa fa fa fa fa fa fa fa fa fa fa
  0x0c107fff8020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c107fff8030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c107fff8040: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c107fff8050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c107fff8060: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:   00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:   fa
  Freed heap region:   fd
  Stack left redzone:  f1
  Stack mid redzone:   f2
  Stack right redzone: f3
  Stack after return:  f5
  Stack use after scope:   f8
  Glob

[Bug gas/32037] RISC-V xventanacondops: Unrecognized opcode `vt.maskcn a0, a1, a0`

2024-07-29 Thread patrick at rivosinc dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32037

Patrick O'Neill  changed:

   What|Removed |Added

 CC||nelsonc1225 at sourceware dot 
org,
   ||patrick at rivosinc dot com
 Target||riscv*-*-*

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


[Bug gas/32037] New: RISC-V xventanacondops: Unrecognized opcode `vt.maskcn a0, a1, a0`

2024-07-29 Thread patrick at rivosinc dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32037

Bug ID: 32037
   Summary: RISC-V xventanacondops: Unrecognized opcode `vt.maskcn
a0, a1, a0`
   Product: binutils
   Version: 2.44 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: patrick at rivosinc dot com
  Target Milestone: ---

Binutils output:
/scratch/tmp/red-0f5881.s: Assembler messages:
/scratch/tmp/red-0f5881.s:25: Error: unrecognized opcode `vt.maskcn a0,a1,a0'

Also seeing testcases fail with vt.maskc:
Error: unrecognized opcode `vt.maskc a2,a2,a0'

I think these formats follows the spec.

xventanacondops spec:
https://github.com/ventanamicro/ventana-custom-extensions/releases/download/v1.0.0/ventana-custom-extensions-v1.0.0.pdf

Found when fuzzing clang.

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


[Bug gas/32036] RISC-V zcmp: unrecognized opcode `cm.mva01s s0,s1'

2024-07-29 Thread nelsonc1225 at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32036

--- Comment #1 from Nelson Chu  ---
The xventana cond extension are rv64 only since this patch,
https://github.com/bminor/binutils-gdb/commit/fe0f44a0caf59db09ad4bc16a46926aba96ce60d

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


[Bug gas/32037] RISC-V xventanacondops: Unrecognized opcode `vt.maskcn a0, a1, a0`

2024-07-29 Thread patrick at rivosinc dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32037

Patrick O'Neill  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|UNCONFIRMED |RESOLVED

--- Comment #1 from Patrick O'Neill  ---
Nelson commented here: https://sourceware.org/bugzilla/show_bug.cgi?id=32036#c1
> The xventana cond extension are rv64 only since this patch, 
> https://github.com/bminor/binutils-gdb/commit/fe0f44a0caf59db09ad4bc16a46926aba96ce60d

Closing as invalid. Thanks!

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


[Bug binutils/32001] Untranslated part in error message of elfxx-riscv.c:2466

2024-07-29 Thread nelsonc1225 at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32001

Nelson Chu  changed:

   What|Removed |Added

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

--- Comment #4 from Nelson Chu  ---
Marked as resolved and fixed.

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


[Bug gas/32036] RISC-V zcmp: unrecognized opcode `cm.mva01s s0,s1'

2024-07-29 Thread patrick at rivosinc dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32036

Patrick O'Neill  changed:

   What|Removed |Added

 CC||nelsonc1225 at sourceware dot 
org,
   ||patrick at rivosinc dot com
 Target||riscv*-*-*

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


[Bug gas/32036] New: RISC-V zcmp: unrecognized opcode `cm.mva01s s0,s1'

2024-07-29 Thread patrick at rivosinc dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32036

Bug ID: 32036
   Summary: RISC-V zcmp: unrecognized opcode `cm.mva01s s0,s1'
   Product: binutils
   Version: 2.44 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: patrick at rivosinc dot com
  Target Milestone: ---

Binutils output:
/tmp/cczUKUoq.s: Assembler messages:
/tmp/cczUKUoq.s:33: Error: unrecognized opcode `cm.mva01s s0,s1'
Compiler returned: 1

GCC 15 emits cm.mva01s s0,s1 which appears to match the asm in the spec:
cm.mva01s r1s', r2s'

Spec (v1.0.4-3):
https://github.com/riscvarchive/riscv-code-size-reduction/releases

Godbolt: https://godbolt.org/z/W5G48qc3h

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