[Bug gas/23938] should not free memory alloced in obstack by free()

2018-11-29 Thread wu.heng at zte dot com.cn
https://sourceware.org/bugzilla/show_bug.cgi?id=23938

wuheng  changed:

   What|Removed |Added

  Component|binutils|gas

-- 
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/23938] New: should not free memory alloced in obstack by free()

2018-11-29 Thread wu.heng at zte dot com.cn
https://sourceware.org/bugzilla/show_bug.cgi?id=23938

Bug ID: 23938
   Summary: should not free memory alloced in obstack by free()
   Product: binutils
   Version: 2.32 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: wu.heng at zte dot com.cn
  Target Milestone: ---

Created attachment 11420
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11420&action=edit
free obstack memory use obstack_free()

void
s_xstab (int what)
{
  int length;
  char *stab_secname, *stabstr_secname;
  static char *saved_secname, *saved_strsecname;

  /* @@ MEMORY LEAK: This allocates a copy of the string, but in most
 cases it will be the same string, so we could release the storage
 back to the obstack it came from.  */
  stab_secname = demand_copy_C_string (&length);
...
  if (saved_secname)
{
  free (saved_secname);
  free (saved_strsecname);
}
...
}

The var "saved_secname" in "s_xstab"  function which pointed to the memory
alloced in obstack, should not be freed in line 441:"free (saved_secname);".

-- 
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/23937] powerpc64le local ifunc IRELATIVE relocs are wrong

2018-11-29 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=23937

--- Comment #2 from cvs-commit at gcc dot gnu.org  ---
The binutils-2_31-branch branch has been updated by Alan Modra
:

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

commit 0f494b01431de53959dd72ccfed06a01d5172e3f
Author: Alan Modra 
Date:   Fri Nov 30 15:34:11 2018 +1030

PR23937, powerpc64le local ifunc IRELATIVE relocs are wrong

IFUNC resolvers must always be called via their global entry point.
They will be called from ld.so rather than from the local executable.

PR 23937
bfd/
* elf64-ppc.c (write_plt_relocs_for_local_syms): Don't add local
entry offset for ifuncs.
ld/
* testsuite/ld-powerpc/pr23937.d,
* testsuite/ld-powerpc/pr23937.s: New test.
* testsuite/ld-powerpc/powerpc.exp: Run it.

(cherry picked from commit ba85c15dabe144e4bcee5a1b388b32bee10729e1)

-- 
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/23937] powerpc64le local ifunc IRELATIVE relocs are wrong

2018-11-29 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=23937

--- Comment #1 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Alan Modra :

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

commit ba85c15dabe144e4bcee5a1b388b32bee10729e1
Author: Alan Modra 
Date:   Fri Nov 30 15:34:11 2018 +1030

PR23937, powerpc64le local ifunc IRELATIVE relocs are wrong

IFUNC resolvers must always be called via their global entry point.
They will be called from ld.so rather than from the local executable.

PR 23937
bfd/
* elf64-ppc.c (write_plt_relocs_for_local_syms): Don't add local
entry offset for ifuncs.
ld/
* testsuite/ld-powerpc/pr23937.d,
* testsuite/ld-powerpc/pr23937.s: New test.
* testsuite/ld-powerpc/powerpc.exp: Run it.

-- 
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/23937] powerpc64le local ifunc IRELATIVE relocs are wrong

2018-11-29 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23937

Alan Modra  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |2.32

--- Comment #3 from Alan Modra  ---
Fixed.

-- 
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/23937] powerpc64le local ifunc IRELATIVE relocs are wrong

2018-11-29 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23937

Alan Modra  changed:

   What|Removed |Added

 Target||powerpc64le-linux
 Status|NEW |ASSIGNED
   Assignee|unassigned at sourceware dot org   |amodra at gmail dot com

-- 
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/23937] New: powerpc64le local ifunc IRELATIVE relocs are wrong

2018-11-29 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23937

Bug ID: 23937
   Summary: powerpc64le local ifunc IRELATIVE relocs are wrong
   Product: binutils
   Version: 2.32 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: amodra at gmail dot com
  Target Milestone: ---

With a brand new binutils and gcc, when I compile
gcc/testsuite/gcc.dg/attr-ifunc-4.c I see the call to magic() in main() going
via a plt stub.  There's an IRELATIVE reloc on the .iplt entry used by the
stub.  That's all as expected but
the IRELATIVE reloc points at resolver+8.  It should point at resolver+0.

As it is, when ld.so calls the resolver func r2 will have ld.so's TOC pointer
value and thus calculate the wrong offset to implementation().

-- 
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/23935] New: ld.bfd does not rescan fat LTO archives to resolve plugin-added references

2018-11-29 Thread vlad at ispras dot ru
https://sourceware.org/bugzilla/show_bug.cgi?id=23935

Bug ID: 23935
   Summary: ld.bfd does not rescan fat LTO archives to resolve
plugin-added references
   Product: binutils
   Version: 2.32 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: vlad at ispras dot ru
  Target Milestone: ---

#!/bin/sh -

cat > prog.c << EOF
#include 
int main() { printf("hi\n"); return 0; }
EOF

cat > libfoo.c << EOF
#include 
int puts(const char *s) { return 0; }
EOF

gcc -c -flto -fno-builtin -ffat-lto-objects libfoo.c -o libfoo.o
ar rcs libfoo.a libfoo.o

# gold="-fuse-ld=gold"

gcc -c -flto prog.c -o prog.o
gcc $gold -Wl,-emain -L. -static -nostdlib prog.o -lfoo



>From  I gather that
in
the presence of LTO recompiled objects, the archives are supposed to be
rescanned automatically.  This does not happen in the example above.

When LTOing prog.o, GCC transforms the printf call to a puts call. I expect
this
new call to see a resolution in libfoo.a.  And it happens indeed, if one uses
Gold.  Not so for the BFD linker:

/usr/bin/ld: /tmp/ccvITLI4.ltrans0.ltrans.o: in function `main':
:(.text+0xc): undefined reference to `puts'

Notice the -ffat-lto-objects switch.  Without it, libfoo.a would contain only
LTO bytecode and both linkers would error out.  It seems, the logic is off
somewhere taking "contains LTO bytecode" for "contains only LTO bytecode".

-- 
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/23919] bfd doesn't handle ELF compressed data alignment

2018-11-29 Thread ldv at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=23919

Dmitry V. Levin  changed:

   What|Removed |Added

 CC||ldv at sourceware dot org

-- 
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/23933] gold_assert(len >= this->do_minimum_hole_size()) fails

2018-11-29 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23933

H.J. Lu  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--- Comment #1 from H.J. Lu  ---
It is caused by PR 23919 change.

-- 
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/23931] objdump -r often fails on pdp11 files

2018-11-29 Thread pkoning at equallogic dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23931

--- Comment #3 from Paul Koning  ---
Great.  I agree fixing the check is best.  I looked at the code but it wasn't
clear to me how to do that, so I did the disable as a crude test.

-- 
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/23933] New: gold_assert(len >= this->do_minimum_hole_size()) fails

2018-11-29 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23933

Bug ID: 23933
   Summary: gold_assert(len >= this->do_minimum_hole_size()) fails
   Product: binutils
   Version: 2.32 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: gold
  Assignee: ccoutant at gmail dot com
  Reporter: hjl.tools at gmail dot com
CC: ian at airs dot com
  Target Milestone: ---

GCC 8.2 triggers

gold_assert(len >= this->do_minimum_hole_size());

Breakpoint 1, gold::Output_fill_debug_info::do_write (this=0xcbbf10, 
of=0xc79010, off=12652, len=4)
at /export/gnu/import/git/sources/binutils-gdb/gold/output.cc:2063
2063  gold_assert(len >= this->do_minimum_hole_size());
(gdb) call len
$1 = 4
(gdb) p this->do_minimum_hole_size()
$2 = 11
(gdb)

-- 
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/23929] Missing .note.gnu.property with -flto

2018-11-29 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=23929

--- Comment #1 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

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

commit ffd9e4d0225d45d1603d09e06151c388589e063f
Author: H.J. Lu 
Date:   Thu Nov 29 04:44:20 2018 -0800

elf: Don't merge .note.gnu.property section in IR

.note.gnu.property section in IR inputs should be ignored.  Don't
merge them.

PR ld/23929
* elf-properties.c (_bfd_elf_link_setup_gnu_properties): Don't
merge .note.gnu.property section in IR inputs.

-- 
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/23928] ar crash within LLVMgold.so module

2018-11-29 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23928

--- Comment #4 from Nick Clifton  ---
Hi Werner

> I installed all necessary debug symbols; however, the very last call is
> still shown as `??' in the backtrace (deep in dlopened stuff).  

What about the function before the '??'.   That will probably give you a 
clue as to where the problem is occurring.


> What do you
> recommend to make ar and LLVMgold.so spit out more debugging information?

Recompile them with the -g debugging option enabled.  (I am guessing that
they were compiled without it, at least in the environment that you are using).


> BTW, what I would like to have for such situations is an option to disable
> plugins with a command line option, for example `--plugin=""'.

Sadly I do not believe that such an option exists.  You can however capture
the command line being used to invoke the plugin, and then just replay it
with the plugin options removed.


> Finally, where can I find a description of the differences between
> `LLVMgold.so' and gcc's `liblto_plugin'?  Even a more intensive search in
> the internet didn't show up anything useful...

I do not think that such a document exists.  The only real recourse is to
read the source code for each of them, and compare how they work.

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/23931] objdump -r often fails on pdp11 files

2018-11-29 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23931

Nick Clifton  changed:

   What|Removed |Added

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

--- Comment #2 from Nick Clifton  ---
Hi Paul,

  Thanks for reporting this problem.  Rather than disabling the check however,
  I thought it better to tweak it to allow for the fact that the internal
  representation of thr PDP11 relocs is larger than the external
representation.

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/23931] objdump -r often fails on pdp11 files

2018-11-29 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=23931

--- Comment #1 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=8936f76804c2908e4abe911441dd03641204df9d

commit 8936f76804c2908e4abe911441dd03641204df9d
Author: Nick Clifton 
Date:   Thu Nov 29 10:57:54 2018 +

objdump: Fix check for corrupt reloc information, to allow for the fact
that PDP11 relocs are bigger when in internal format.

PR 23931
* objdump.c (dump_relocs_in_section): When checking for an
unreasonable amount of relocs in a bfd, allow for the fact that
the internal representation of a reloc may be bigger than the
external representation.

-- 
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/23932] integer overflow causes an endless loop

2018-11-29 Thread sch...@linux-m68k.org
https://sourceware.org/bugzilla/show_bug.cgi?id=23932

Andreas Schwab  changed:

   What|Removed |Added

Summary|interger overflow causes a  |integer overflow causes an
   |endless loop|endless 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


[Bug ld/23930] Problems linking objectfiles optimized for size (-Os)

2018-11-29 Thread asavkov at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23930

--- Comment #2 from Artem Savkov  ---
The workaround fixes both the reproducer and original kernel build for me.

-- 
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