[Bug ld/26002] New: ld: Should an unversioned undefined symbol use VER_NDX_GLOBAL instead of VER_NDX_LOCAL?

2020-05-16 Thread i at maskray dot me
https://sourceware.org/bugzilla/show_bug.cgi?id=26002

Bug ID: 26002
   Summary: ld: Should an unversioned undefined symbol use
VER_NDX_GLOBAL instead of VER_NDX_LOCAL?
   Product: binutils
   Version: 2.35 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: i at maskray dot me
  Target Milestone: ---

echo 'v1 { f; };' > a.ver
echo '.globl f_v1; .symver f_v1,f@v1; f_v1: g:' | as - -o a.o
ld.bfd -shared --version-script a.ver a.o -o a.so

echo '.symver f,f@v1; call f; call g' | as - -o a1.o
ld.bfd -shared a1.o a.so -o a1.so

% readelf -V a1.so

Version symbols section '.gnu.version' contains 2 entries:
 Addr: 0x0204  Offset: 0x000204  Link: 3 (.dynsym)
  000:   0 (*local*)   2 (v1)

Version needs section '.gnu.version_r' contains 1 entry:
 Addr: 0x0208  Offset: 0x000208  Link: 4 (.dynstr)
  00: Version: 1  File: a.so  Cnt: 1
  0x0010:   Name: v1  Flags: none  Version: 2

Should `g` be VER_NDX_GLOBAL instead of VER_NDX_LOCAL?

https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=64707334c75cdf16a0c2d317fc381c9b158beed9
may be related

-  if (v == static_cast(elfcpp::VER_NDX_LOCAL))
+  // The Sun documentation says that V can be VER_NDX_LOCAL, or
+  // VER_NDX_GLOBAL, or a version index.  The meaning of
+  // VER_NDX_LOCAL is defined as "Symbol has local scope."  The
+  // old GNU linker will happily generate VER_NDX_LOCAL for an
+  // undefined symbol.  I don't know what the Sun linker will
+  // generate.
+
+  if (v == static_cast(elfcpp::VER_NDX_LOCAL)
+  && sym.get_st_shndx() != elfcpp::SHN_UNDEF)



# The build system has some robustness problems. 
# I tried git checkout binutils-2_28; make; git checkout binutils-2_29; make;
... to iterate over recent releases. When I checkout binutils-2_33, `make` will
complain. (Deleting the build directory and regenerating it will work.) It
seems that some build artifacts from previous versions are not correctly
cleaned.

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


[Bug ld/25993] Bug in bfd causes crashes with DXVK

2020-05-16 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25993

--- Comment #6 from Alan Modra  ---
ldmain.c:add_archive_element is where we duplicate the file name pointers:
  input->filename = abfd->filename;
  input->local_sym_name = abfd->filename;

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


[Bug gas/25992] Wrong Tag_CPU_arch_profile for armv8-r

2020-05-16 Thread alfedotov at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25992

--- Comment #6 from Alexander Fedotov  ---
I see bunch of failures with testsuite. Need to fix them.

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


[Bug gold/25975] clang -fsanitze=address prints warning only with gold

2020-05-16 Thread dilyan.palauzov at aegee dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=25975

--- Comment #10 from dilyan.palauzov at aegee dot org  ---
Does it also work with the attached i.o as input?

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


Issue 21676 in oss-fuzz: binutils:fuzz_readelf: Direct-leak in xmalloc

2020-05-16 Thread sheriffbot via monorail
Updates:
Labels: -restrict-view-commit

Comment #2 on issue 21676 by sheriffbot: binutils:fuzz_readelf: Direct-leak in 
xmalloc
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21676#c2

This bug has been fixed for 30 days. It has been opened to the public.

- 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 gas/26001] PDP11 gas confuses register names and symbols

2020-05-16 Thread casner at acm dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=26001

--- Comment #1 from Stephen Casner  ---
Created attachment 12550
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12550=edit
Patch for the bug

This patch fixes the bug, but I need to add a test case and change logs.

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


[Bug gold/25975] clang -fsanitze=address prints warning only with gold

2020-05-16 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25975

--- Comment #9 from H.J. Lu  ---
 "/usr/bin/ld.gold" --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64
-dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out
/usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../../../lib64/crt1.o
/usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../../../lib64/crti.o
/usr/bin/../lib/gcc/x86_64-redhat-linux/10/crtbegin.o
-L/usr/bin/../lib/gcc/x86_64-redhat-linux/10
-L/usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../../../lib64
-L/usr/bin/../lib64 -L/lib/../lib64 -L/usr/lib/../lib64
-L/usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../.. -L/usr/bin/../lib -L/lib
-L/usr/lib --whole-archive
/usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a --no-whole-archive
--export-dynamic /tmp/x-ef8058.o --no-as-needed -lpthread -lrt -lm -ldl -lgcc
--as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed
/usr/bin/../lib/gcc/x86_64-redhat-linux/10/crtend.o
/usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../../../lib64/crtn.o

works for me on Fedora/32.

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


[Bug gas/26001] PDP11 gas confuses register names and symbols

2020-05-16 Thread casner at acm dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=26001

Stephen Casner  changed:

   What|Removed |Added

 Target||pdp11-aout

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


[Bug gas/26001] New: PDP11 gas confuses register names and symbols

2020-05-16 Thread casner at acm dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=26001

Bug ID: 26001
   Summary: PDP11 gas confuses register names and symbols
   Product: binutils
   Version: 2.35 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: casner at acm dot org
  Target Milestone: ---

Attempting to assemble the instruction

jsr pc,sprintf

results in error message "Too many operands".  This occurs because "sp" is
interpreted as a register name and so "rintf" is considered excess.  Not to
mention that "jsr pc,sp" is not a valid instruction anyway.  But the failure
would also occur with "mov r0,space" where "mov r0,sp" would be valid.

It's hard to believe that this bug was present since the PDP11 code was added
in 2001, but perhaps the C compiler always prefixes symbols with . or _ so this
bug would not have been exposed.

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


[Bug ld/25993] Bug in bfd causes crashes with DXVK

2020-05-16 Thread wgpierce17 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25993

--- Comment #5 from William Pierce  ---
I think the repro crash in DXVK could be perturbed in a few different ways, and
my previous comment was running into a few different ways it could be
perturbed. The crash also doesn't repro if I run ld under valgrind while
building. Though for a memory corruption, these could make sense.

Nick, your patch completely fixes the problem for me.

I tested the patch being very careful to not perturb the setup in wrong way as
I had seen. I very clearly saw the crash repro without your patch applied and
not repro with it applied.

I also tried out the build running with ld under valgrind with and without your
patch. Without your patch, there are many errors (but, somehow I don't observe
the crash when running the built dll as I mentioned). With your patch, there
are no errors at all (and the built dll runs fine).

Building DXVK with mingw-w64-binutils as mentioned before is sufficient to see
the memory corruption errors with ld during build time. I don't yet have an
easy example app to demonstrate the crash when using the built dll. Bayonetta
on Steam was being used for testing in the DXVK bug 
https://github.com/doitsujin/dxvk/issues/1625, but the crash happens for a
variety of D3D applications.

Thanks a ton for the fast response!

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