[Bug binutils/24848] New: [Bug] When use -flto "weak symbol" are converted to "t".

2019-07-24 Thread akhilesh.k at samsung dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24848

Bug ID: 24848
   Summary: [Bug] When use -flto "weak symbol" are converted to
"t".
   Product: binutils
   Version: 2.29
Status: NEW
  Severity: critical
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: akhilesh.k at samsung dot com
  Target Milestone: ---

when i use -flto "weak symbol" are converted to "t". 

I really don't know whether this is bug or expected behavior, because in GCC
Source i am not able to find the code for this conversion. 


@akhilesh-ubuntu:~/akhilesh/lto$ gcc -flto -o nornal myapp.c; nm -C ./nornal |
grep power
00400532 t power
@akhilesh-ubuntu:~/akhilesh/lto$ gcc -o nornal myapp.c; nm -C ./nornal | grep
power
00400532 W power
@akhilesh-ubuntu:~/akhilesh/lto$ 


@akhilesh-ubuntu:~/akhilesh/lto$ cat myapp.c 
#include 
#include 
int __attribute__((weak)) power(int x);

int power(int x)
{
  return x*x;
}
int main(int argc, char **argv)
{
  printf("power() = %d\n", power(atoi(argv[1])));
  return 0;
}
=
@akhilesh-ubuntu:~/akhilesh/lto$ 

I am using gcc 8.3.0 version and binutils version is 2.29.1

@akhilesh-ubuntu:~/akhilesh/lto$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/8.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-arm-src-snapshot-8.3-2019.03/configure
--disable-multilib
Thread model: posix
gcc version 8.3.0 (Linaro GCC 8.2-2018.08~d

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/24838] /etc/ld.so.preload.d drop-in configuration folder support

2019-07-24 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24838

Nick Clifton  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||nickc at redhat dot com
 Resolution|--- |INVALID

--- Comment #1 from Nick Clifton  ---
Hi adrelanos,

  ld.so and its associated files/directories are actually part of the
  glibc project, not the binutils project.  (Despite the similarity of
  the name with ld).  So please could you refile your enhancement 
  request here:

https://sourceware.org/bugzilla/enter_bug.cgi?product=glibc

Cheers
  Nick

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/24846] gold internal error with --detect-odr-violations and -fsanitize=address,leak (dwarf_reader.cc:1656)

2019-07-24 Thread szotsaki at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24846

--- Comment #1 from Ákos Szőts  ---
I also created a core file, but its compressed size is 88 MB. If you need that,
I can upload it somewhere.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/24846] New: gold internal error with --detect-odr-violations and -fsanitize=address,leak (dwarf_reader.cc:1656)

2019-07-24 Thread szotsaki at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24846

Bug ID: 24846
   Summary: gold internal error with --detect-odr-violations and
-fsanitize=address,leak (dwarf_reader.cc:1656)
   Product: binutils
   Version: 2.32
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: gold
  Assignee: ccoutant at gmail dot com
  Reporter: szotsaki at gmail dot com
CC: ian at airs dot com
  Target Milestone: ---

Created attachment 11920
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11920=edit
GDB outputs

First, gold issues several warnings related to ASAN:

ld.gold: warning: while linking libmocklib_lib.so: symbol
'__sanitizer::StackDepotGetStats()' defined in multiple places (possible ODR
violation):
  [...]/lib64/libasan.a(sanitizer_common_libcdep.o)
  [...]/lib64/libasan.a(sanitizer_stackdepot.o)

Then when it tries to link the whole executable it fails with the following
error message:

ld.gold: internal error in read_header_prolog, at
[...]/gcc-9.1.0/gold/dwarf_reader.cc:1656

If I remove the "-Wl,--detect-odr-violations" from GCC command line, it works
fine.

Other linking-time arguments which you may find interesting (omitting the
internal libraries):

-std=c++14
-flto
-o xy_unittest
-Wl,-rpath,$ORIGIN/../../../../_solib_x86_64/
-lpthread
-lrt
-pthread
-lrt
-pthread
-fsanitize=address,leak
--sysroot=external/gnu_toolchain/
-fuse-ld=gold
-l:libstdc++.a
-l:libgcc.a
-static-libgcc
-static-libstdc++
-lm
-ldl
-fPIC
-Wl,-z,relro,-z,now
-Wl,--build-id=sha1
-Wl,--warn-execstack
-Wl,--detect-odr-violations
-L [...]
-B [...]
-Wl,--compress-debug-sections=zlib
-Wl,--gdb-index

The only change required not to fail is the removal of
"--detect-odr-violations" while keeping ASAN turned on.

Compilation-time options passed to GCC:

'--sysroot=external/gnu_toolchain/'
-isystem [...]
-m64
'-march=corei7'
'-mfpmath=sse'
-msse4.2
-fPIC
-U_FORTIFY_SOURCE
-fstack-protector
'-fdiagnostics-color=always'
-Wall
-fno-omit-frame-pointer
-ffunction-sections
-fdata-sections
-fno-canonical-system-headers
'-std=c++14'
-flto
-g3
-Og
-MD
-MF xy.d
'-frandom-seed=xy.o'
-fPIC
-D_GNU_SOURCE
-no-canonical-prefixes
'-fsanitize=address,leak'
-c xy.cpp
-o xy.pic.o

GCC version: 9.1.0

Here is a short backtrace:

#0  gold::do_gold_unreachable (filename=filename@entry=0x882f68
"/home/aki/temp/all-compile-new/objdir-gcc/../gcc-9.1.0/gold/dwarf_reader.cc",
lineno=lineno@entry=1656, function=function@entry=0x883474
"read_header_prolog") at
/home/aki/temp/all-compile-new/objdir-gcc/../gcc-9.1.0/gold/gold.cc:100
#1  0x00727805 in gold::Sized_dwarf_line_info<64,
false>::read_header_prolog (this=this@entry=0x18d0070, lineptr=)
at
/home/aki/temp/all-compile-new/objdir-gcc/../gcc-9.1.0/gold/../elfcpp/elfcpp_swap.h:377
#2  0x0072de68 in gold::Sized_dwarf_line_info<64,
false>::read_line_mappings (shndx=13, this=0x18d0070) at
/home/aki/temp/all-compile-new/objdir-gcc/../gcc-9.1.0/gold/dwarf_reader.cc:2047
#3  gold::Sized_dwarf_line_info<64, false>::read_line_mappings (this=0x18d0070,
shndx=13) at
/home/aki/temp/all-compile-new/objdir-gcc/../gcc-9.1.0/gold/dwarf_reader.cc:2047
#4  0x0072e25e in gold::Sized_dwarf_line_info<64,
false>::Sized_dwarf_line_info (this=0x18d0070, object=0x1ab3f00, read_shndx=13)
at
/home/aki/temp/all-compile-new/objdir-gcc/../gcc-9.1.0/gold/dwarf_reader.h:58
#5  0x00725ad2 in gold::Dwarf_line_info::one_addr2line
(object=0x1ab3f00, shndx=13, offset=8553296, cache_size=cache_size@entry=16,
other_lines=other_lines@entry=0x7fff2fa0) at
/home/aki/temp/all-compile-new/objdir-gcc/../gcc-9.1.0/gold/dwarf_reader.cc:2369
#6  0x00701983 in
gold::Symbol_table::linenos_from_loc[abi:cxx11](gold::Task const*,
gold::Symbol_location const&) (task=0x224ff00, loc=...) at
/home/aki/temp/all-compile-new/objdir-gcc/../gcc-9.1.0/gold/symtab.cc:3515
#7  0x007028e0 in gold::Symbol_table::detect_odr_violations
(this=, task=task@entry=0x224ff00, output_file_name=0x97ef10
"bazel-out/k8-dbg-ubsan/bin/platform/aas/pas/sysmon/blkInfoInst_unittest") at
/home/aki/temp/all-compile-new/objdir-gcc/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/ext/aligned_buffer.h:114
#8  0x0063aebe in gold::Layout_task_runner::run (this=0x224fec0,
workqueue=0x7fff3260, task=0x224ff00) at
/home/aki/temp/all-compile-new/objdir-gcc/../gcc-9.1.0/gold/options.h:1540
#9  0x007188ef in gold::Task_function::run (workqueue=0x7fff3260,
this=0x224ff00) at
/home/aki/temp/all-compile-new/objdir-gcc/../gcc-9.1.0/gold/workqueue.h:178
#10 gold::Workqueue::find_and_run_task (this=0x7fff3260, thread_number=0)
at /home/aki/temp/all-compile-new/objdir-gcc/../gcc-9.1.0/gold/workqueue.cc:319
#11 0x00718d8a in gold::Workqueue::process
(this=this@entry=0x7fff3260, thread_number=thread_number@entry=0) at

[Bug binutils/13256] AR + plugin fails with "no operation specified" error

2019-07-24 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=13256

Nick Clifton  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||nickc at redhat dot com
 Resolution|--- |FIXED

--- Comment #3 from Nick Clifton  ---
Hi Akos,

  OK, I have checked in a patch which should fix this problem.  At least
  for the case where "no operation specified" would have occurred.  There
  will still be an issue if an operation is specified, so for example:
  "ar --plugin  -c r libfoo.a foo.o" will not work because the "r" 
  option will be interpreted as a file name.  But I think that such a 
  situation is unlikely to occur in real world uses of ar.

Cheers
  Nick

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/13256] AR + plugin fails with "no operation specified" error

2019-07-24 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=13256

--- Comment #2 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Nick Clifton :

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

commit 2f86d5594071a16665711ae13da88af1cc904371
Author: Nick Clifton 
Date:   Wed Jul 24 12:17:37 2019 +0100

Fix ar so that it can correctly detect non-dash prefixed options that
appear after dash prefixed options.

PR 13256
* ar.c (decode_options): Restart option scanning if no operation
is detected and argument remain to be scanned.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/13256] AR + plugin fails with "no operation specified" error

2019-07-24 Thread szotsaki at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=13256

Ákos Szőts  changed:

   What|Removed |Added

 CC||szotsaki at gmail dot com

--- Comment #1 from Ákos Szőts  ---
Still present in 2.32.

The reason might be that in ar.c:480 getopt_long doesn't recognise additional
options followed by a long option (--plugin xy) and exits from the loop.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils