[Bug gold/30187] ld.bfd and ld.gold versions in .comment section of ELF files

2023-03-15 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30187

Nick Clifton  changed:

   What|Removed |Added

  Attachment #14751|0   |1
is obsolete||

--- Comment #10 from Nick Clifton  ---
Created attachment 14754
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14754&action=edit
Proposed patch

Hi Tom,

  Found it - forcing the .comment section to load at address 0 causes the
problems.

  Please try out this revised patch and let me know if you still have issues.

Cheers
  Nick

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


[Bug binutils/30230] objdump: heap-buffer-overflow in get_sym_code_type

2023-03-15 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30230

Nick Clifton  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Assignee|unassigned at sourceware dot org   |nickc at redhat dot com
   Last reconfirmed||2023-03-15
 Status|UNCONFIRMED |ASSIGNED
 CC||nickc at redhat dot com

--- Comment #1 from Nick Clifton  ---
Investigating.

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


[Bug binutils/30230] objdump: heap-buffer-overflow in get_sym_code_type

2023-03-15 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=30230

--- 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=771860451862e89df453cd3b635a00d47d602533

commit 771860451862e89df453cd3b635a00d47d602533
Author: Nick Clifton 
Date:   Wed Mar 15 11:44:56 2023 +

Fix an illegal memory access when disassebling a corrupt ARM file.

  PR 30230
  * arm-dis.c (get_sym_code_type): Check for non-ELF symbols.

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


[Bug binutils/30230] objdump: heap-buffer-overflow in get_sym_code_type

2023-03-15 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30230

Nick Clifton  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #3 from Nick Clifton  ---
Fixed.  The issue was that the disassembler was attempting to inspect the ELF
specific information of a non-ELF, synthetic symbol.

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


[Bug binutils/30231] objdump: SEGV in cgen_bitset_intersect_p

2023-03-15 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30231

Nick Clifton  changed:

   What|Removed |Added

   Assignee|unassigned at sourceware dot org   |nickc at redhat dot com
 CC||nickc at redhat dot com
 Status|UNCONFIRMED |ASSIGNED
 Ever confirmed|0   |1
   Last reconfirmed||2023-03-15

--- Comment #1 from Nick Clifton  ---
Investigating

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


[Bug gold/30187] ld.bfd and ld.gold versions in .comment section of ELF files

2023-03-15 Thread tkacvins at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30187

--- Comment #11 from Tom Kacvinsky  ---
Hi Nick,

This worked perfectly.  The linker didn't throw the PHDR error, and the
resulting executable now has the binutils version in the .comment section.

Thank you very much for your work on this.  So you know, the impetus for this
is I build a lot of different things for my job and don't always remember to
use the linker I should for code I am building.  This will help me decipher if
I used the right linker or not.

Tom

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


[Bug binutils/30231] objdump: SEGV in cgen_bitset_intersect_p

2023-03-15 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=30231

--- 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=71f646f2b3fc6e273fd17b5fdc9ba6bae242b330

commit 71f646f2b3fc6e273fd17b5fdc9ba6bae242b330
Author: Nick Clifton 
Date:   Wed Mar 15 13:06:23 2023 +

Fix an illegal memory access when disassembling a corrupt MeP file.

  PR 30231
  * mep.opc (mep_print_insn): Check for an out of range index.

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


[Bug binutils/30231] objdump: SEGV in cgen_bitset_intersect_p

2023-03-15 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30231

Nick Clifton  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #3 from Nick Clifton  ---
Fixed

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


[Bug gold/30187] ld.bfd and ld.gold versions in .comment section of ELF files

2023-03-15 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=30187

--- Comment #12 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=2d5783fad77c2cb9cdcb396d65fe0a60e3d8938b

commit 2d5783fad77c2cb9cdcb396d65fe0a60e3d8938b
Author: Nick Clifton 
Date:   Wed Mar 15 14:27:21 2023 +

Add --enable-linker-version option to bfd linker to add an entry in the
.comment section.

   PR 30187
  * NEWS: Mention the new feature. * ld.texi: Document the new feature. *
ldgram.y: Handle LINKER_VERSION token. * ldlang.c (lang_add_version): New
function. (enable_linker_version): New global variable. * ldlang.h
(land_add_version): Prototype. (enable_linker_version): Export. * ldlex.h
(OPTION_ENABLE_LINKER_VERSION): Define. (OPTION_DISABLE_LINKER_VERSION):
Define. * ldlex.l (LINKER_VERSION): Add token. * lexsup.c (ld_options): Add
--enable-linker-version and --disable-linker-version. (parse_args): Handle the
new options. * scripttempl/arclinux.sc: Remove stabs and comment sections and
replace with inclusion of misc-sections.sc * scripttempl/avr.sc: Likewise. *
scripttempl/dlx.sc: Likewise. * scripttempl/elf.sc: Likewise. *
scripttempl/elf32cr16.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. *
scripttempl/elf32msp430.sc: Likewise. * scripttempl/elf64bpf.sc: Likewise. *
scripttempl/elf64hppa.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. *
scripttempl/elfarc.sc: Likewise. * scripttempl/elfarcv2.sc: Likewise. *
scripttempl/elfd10v.sc: Likewise. * scripttempl/elfd30v.sc: Likewise. *
scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. *
scripttempl/elfm9s12z.sc: Likewise. * scripttempl/elfmicroblaze.sc: Likewise. *
scripttempl/elfxgate.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. *
scripttempl/epiphany_4x4.sc: Likewise. * scripttempl/ft32.sc: Likewise. *
scripttempl/ip2k.sc: Likewise. * scripttempl/iq2000.sc: Likewise. *
scripttempl/mep.sc: Likewise. * scripttempl/nds32elf.sc: Likewise. *
scripttempl/pru.sc: Likewise. * scripttempl/v850.sc: Likewise. *
scripttempl/v850_rh850.sc: Likewise. * scripttempl/visium.sc: Likewise. *
scripttempl/xstormy16.sc: Likewise. * scripttempl/z80.sc: Likewise. *
testsuite/ld-scripts/script.exp: Run new tests. * scripttempl/misc-sections.sc:
New file. * testsuite/ld-scripts/ld-version-2.d: New file. *
testsuite/ld-scripts/ld-version.d: New file. *
testsuite/ld-scripts/ld-version.t: New file.

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


[Bug gold/30187] ld.bfd and ld.gold versions in .comment section of ELF files

2023-03-15 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30187

--- Comment #13 from Nick Clifton  ---
Hi Tom,

  Right - that is the bfd linker sorted.

  I am hoping that someone else will volunteer to look at the gold
  linker however, as I am not very good at C++...

Cheers
  Nick

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


[Bug gold/30217] PowerPC: R_PPC64_JMP_SLOT relocation on local std::map symbol when using -mlongcall and --version-script

2023-03-15 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=30217

--- 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=0961e631575b0a1eafccf32fbde56d456aef9169

commit 0961e631575b0a1eafccf32fbde56d456aef9169
Author: Alan Modra 
Date:   Wed Mar 15 18:07:44 2023 +1030

PR30217, dynamic relocations using local dynamic symbols

glibc's ld.so ignores local dynamic symbols.  It's been that way
forever.  We therefore can't use them on dynamic relocations.  Fixing
that problem uncovered another problem in sorting of dynamic relocs,
caused no doubt by copying make_iplt_section (where we don't want
reloc sorting by the generic gold function, we want iplt relocs last)
to make_lplt_section (where we do want sorting).

PR 30217
* powerpc.cc (branch_needs_plt_entry): New function.
(Target_powerpc::plt_off): Use it here..
(Target_powerpc::Scan::global): ..and here to correct PLT16 reloc
handling for forced-local global symbols.
(Output_data_plt_powerpc::add_entry): Rename "stash"
parameter "is_local".  Emit relative relocs for globals that
are forced local, and don't set_needs_dynsym_entry.
(Target_powerpc::make_lplt_section): Don't create a separate
reloc section, use rela_dyn.
(Target_powerpc::make_brlt_section): Likewise.

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


[Bug gold/30217] PowerPC: R_PPC64_JMP_SLOT relocation on local std::map symbol when using -mlongcall and --version-script

2023-03-15 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30217

Alan Modra  changed:

   What|Removed |Added

   Assignee|ccoutant at gmail dot com  |amodra at gmail dot com
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2023-03-16
 Ever confirmed|0   |1

--- Comment #2 from Alan Modra  ---
This should now be fixed on mainline binutils.  I'll wait a little while before
applying the fix to the 2.40 branch in case I've broken something else.  Please
do test mainline gold and confirm that the original use case is now fixed.

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