[Bug ld/16017] LD creates invalid PLT instructions on CORTEX-M3

2020-04-01 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=16017

--- Comment #29 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Tamar Christina
:

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

commit a7618269b727da9cf56727c22cb538ff5f0e4d25
Author: Tamar Christina 
Date:   Wed Apr 1 10:47:18 2020 +0100

Arm: Fix LSB of GOT for Thumb2 only PLT.

When you have a Thumb only PLT then the address in the GOT for PLT0 needs
to
have the Thumb bit set since the instruction used in PLTn to get there is
`ldr.w  pc` which is an inter-working instruction:

the PLT sequence in question is

0120 :
 120:   f240 0c98   movwip, #152; 0x98
 124:   f2c0 0c01   movtip, #1
 128:   44fcadd ip, pc
 12a:   f8dc f000   ldr.w   pc, [ip]
 12e:   e7fcb.n 12a 

Disassembly of section .text:

0130 :
 130:   b580push{r7, lr}
 132:   af00add r7, sp, #0
 134:   f7ff fff4   bl  120 

and previously the linker would generate

Hex dump of section '.got':
 ...
  0x000101b8 40010100   1001 @...

Which would make it jump and transition out of thumb mode and crash since
you
only have thumb mode on such cores.

Now it correctly generates

Hex dump of section '.got':
 ...
  0x000101b8 40010100   1101 @...

Thanks to Amol for testing patch and to rgujju for reporting it.

bfd/ChangeLog:

PR ld/16017
* elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
address in the GOT if in thumb only mode.

ld/ChangeLog:

PR ld/16017
* testsuite/ld-arm/arm-elf.exp (thumb-plt-got): New.
* testsuite/ld-arm/thumb-plt-got.d: New test.

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


[Bug ld/15904] ia64, ELF, 'Can't relax br (PCREL21B)' error message on --no-keep-memory

2020-04-01 Thread simonbeckwith092 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=15904

Ezra Dagan  changed:

   What|Removed |Added

 CC||simonbeckwith092 at gmail dot 
com

--- Comment #10 from Ezra Dagan  ---
Updated patch committed.
http://happy-wheelsgames.com/

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


[Bug gas/25756] New: absolute_symbol@GOTPCREL (@GOT) is mishandled

2020-04-01 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25756

Bug ID: 25756
   Summary: absolute_symbol@GOTPCREL  (@GOT) is mishandled
   Product: binutils
   Version: 2.35 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: hjl.tools at gmail dot com
  Target Milestone: ---
Target: i386, x86-64

[hjl@gnu-cfl-2 pr25754]$ cat yy.S
.text
.p2align 4
.globl  get_bar
.type   get_bar, @function
get_bar:
.cfi_startproc
movqbar@GOTPCREL(%rip), %rax
ret
.cfi_endproc
.size   get_bar, .-get_bar
bar = 0x1fff0
.section.note.GNU-stack,"",@progbits
[hjl@gnu-cfl-2 pr25754]$ gcc -c yy.S
[hjl@gnu-cfl-2 pr25754]$ readelf -r yy.o

Relocation section '.rela.text' at offset 0x1b8 contains 1 entry:
  Offset  Info   Type   Sym. ValueSym. Name +
Addend
0003  002a R_X86_64_REX_GOTP1ffec

Relocation section '.rela.eh_frame' at offset 0x1d0 contains 1 entry:
  Offset  Info   Type   Sym. ValueSym. Name +
Addend
0020  00010002 R_X86_64_PC32  .text + 0
[hjl@gnu-cfl-2 pr25754]$ clang -c yy.S
[hjl@gnu-cfl-2 pr25754]$ readelf -r yy.o

Relocation section '.rela.text' at offset 0xd8 contains 1 entry:
  Offset  Info   Type   Sym. ValueSym. Name +
Addend
0003  00010009 R_X86_64_GOTPCREL 0001fff0 bar - 4

Relocation section '.rela.eh_frame' at offset 0xf0 contains 1 entry:
  Offset  Info   Type   Sym. ValueSym. Name +
Addend
0020  00020002 R_X86_64_PC32  .text + 0
[hjl@gnu-cfl-2 pr25754]$ 

[hjl@gnu-cfl-2 pr25754]$ cat yy-32.S
.text
.p2align 4
.globl  get_bar
.type   get_bar, @function
get_bar:
.cfi_startproc
movlbar@GOT(%eax), %eax
ret
.cfi_endproc
.size   get_bar, .-get_bar
bar = 0xfff0
.section.note.GNU-stack,"",@progbits
[hjl@gnu-cfl-2 pr25754]$ gcc -c yy-32.S -m32
[hjl@gnu-cfl-2 pr25754]$ readelf -r yy-32.o

Relocation section '.rel.eh_frame' at offset 0x15c contains 1 entry:
 Offset InfoTypeSym.Value  Sym. Name
0020  0102 R_386_PC32   .text
[hjl@gnu-cfl-2 pr25754]$ clang -c yy-32.S -m32
[hjl@gnu-cfl-2 pr25754]$ readelf -r yy-32.o

Relocation section '.rel.text' at offset 0xb4 contains 1 entry:
 Offset InfoTypeSym.Value  Sym. Name
0002  0103 R_386_GOT32   fff0   bar

Relocation section '.rel.eh_frame' at offset 0xbc contains 1 entry:
 Offset InfoTypeSym.Value  Sym. Name
0020  0202 R_386_PC32   .text
[hjl@gnu-cfl-2 pr25754]$

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


[Bug gas/25756] Local absolute_symbol@GOTPCREL (@GOT) is mishandled

2020-04-01 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25756

H.J. Lu  changed:

   What|Removed |Added

Summary|absolute_symbol@GOTPCREL|Local
   |(@GOT) is mishandled|absolute_symbol@GOTPCREL
   ||(@GOT) is mishandled

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


[Bug gas/25732] test-suite failures with i386-pc-solaris2.11

2020-04-01 Thread ro at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=25732

Rainer Orth  changed:

   What|Removed |Added

   Assignee|unassigned at sourceware dot org   |ro at gcc dot gnu.org
URL||https://sourceware.org/pipe
   ||rmail/binutils/2020-April/1
   ||10483.html
 Status|WAITING |ASSIGNED

--- Comment #16 from Rainer Orth  ---
Mine, patch posted.

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


[Bug gas/25732] test-suite failures with i386-pc-solaris2.11

2020-04-01 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=25732

--- Comment #17 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Rainer Orth :

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

commit 15d47c3a70526cce7bb6a9dcdbd1c19c40247e32
Author: Rainer Orth 
Date:   Wed Apr 1 14:10:34 2020 +0200

gas: Fix some x86_64 testcases for Solaris not using R_X86_64_PLT32
[PR25732]

As reported in PR gas/25732, some testcases currently FAIL on
Solaris/x86:

FAIL: x86-64 branch 2
FAIL: x86-64 branch 3
FAIL: x86-64 MPX branch
FAIL: x86-64 branch with BND prefix
FAIL: x86-64 jump

Since https://sourceware.org/ml/binutils/2019-03/msg00163.html, gas
doesn't emit R_X86_64_PLT32 as branch marker on Solaris.  Since the
testsuite lacks a way to preprocess dump files, adjusted copies of the
affected dumps are now used on Solaris.  Unfortunately, those dumps
weren't adapted when the original testcases were changed or other
testcases started to differ between non-Solaris and Solaris targets.

The following patch fixes that, re-syncing the affected dump files or
creating new Solaris-specific ones.

Tested on i386-pc-solaris2.11, x86_64-pc-solaris2.11,
x86_64-pc-linux-gnu, and i686-pc-linux-gnu.

PR gas/25732
* testsuite/gas/i386/solaris/x86-64-branch-2.d: New file.
* testsuite/gas/i386/solaris/x86-64-branch-3.d: New file.
* testsuite/gas/i386/solaris/x86-64-jump.d: Incorporate changes to
testsuite/gas/i386/x86-64-jump.d.
* gas/testsuite/gas/i386/solaris/x86-64-mpx-branch-1.d:
Incorporate changes to
gas/testsuite/gas/i386/x86-64-mpx-branch-1.d.
* testsuite/gas/i386/solaris/x86-64-mpx-branch-2.d : Incorporate
changes to testsuite/gas/i386/x86-64-mpx-branch-2.d.
* testsuite/gas/i386/x86-64-branch-2.d: Skip on *-*-solaris*.
* testsuite/gas/i386/x86-64-branch-3.d: Likewise.

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


[Bug gas/25732] test-suite failures with i386-pc-solaris2.11

2020-04-01 Thread ro at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=25732

Rainer Orth  changed:

   What|Removed |Added

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

--- Comment #18 from Rainer Orth  ---
Fixed for binutils 2.35.

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


[Bug admin/25757] New: Moba kok analog

2020-04-01 Thread cncsistem60 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25757

Bug ID: 25757
   Summary: Moba kok analog
   Product: binutils
   Version: 2.35 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: admin
  Assignee: unassigned at sourceware dot org
  Reporter: cncsistem60 at gmail dot com
  Target Milestone: ---

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

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


[Bug gas/25756] Local absolute_symbol@GOTPCREL (@GOT) is mishandled

2020-04-01 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=25756

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

commit efc3a950394676d0781f0397655d1e8be56450bf
Author: H.J. Lu 
Date:   Wed Apr 1 05:40:45 2020 -0700

x86: Force relocation against local absolute symbol

Define TC_FORCE_RELOCATION_ABS to force relocation against local
absolute symbol.

PR gas/25756
* config/tc-i386.h (TC_FORCE_RELOCATION_ABS): New.
* testsuite/gas/i386/localpic.s: Add a test for relocation
against local absolute symbol.
* testsuite/gas/i386/x86-64-localpic.s: Likewise.
* testsuite/gas/i386/localpic.d: Updated.
* testsuite/gas/i386/x86-64-localpic.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-localpic.d: Likewise.

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


[Bug ld/25754] [ld][gold] x86: don't relax GOTPCRELX for SHN_ABS

2020-04-01 Thread yshuiv7 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25754

Yuxuan Shui  changed:

   What|Removed |Added

 CC||yshuiv7 at gmail dot com

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


[Bug gas/25756] Local absolute_symbol@GOTPCREL (@GOT) is mishandled

2020-04-01 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25756

H.J. Lu  changed:

   What|Removed |Added

   Target Milestone|--- |2.35
 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #2 from H.J. Lu  ---
Fixed for 2.35.

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


[Bug binutils/25750] GNU as has inconsistent behavior when expanding .macro that takes as input directives with arguments

2020-04-01 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25750

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

  Which version of the binutils are you using for these tests ?

  When I tried to reproduce the problem using the current development sources I
received the message "Error: too many positional arguments" for each invocation
of foo.

  I did however find a variation that worked and did not have any behavioural
inconsistencies:

.macro foo insn:vararg
\insn
.endm

foo .word (XXX) 
foo .word 0x1234
foo .section sec1

Using the :vararg suffix to tell the macro processor to use all of the text as
a single argument (inside the macro) preserves spaces and results in the output
that you would expect.

Cheers
  Nick

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


[Bug ld/25747] Give more helpful diagnostic when users try to link to foo.a with -lfoo

2020-04-01 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25747

Nick Clifton  changed:

   What|Removed |Added

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

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

  We can do that.  Patch applied. :-)

Cheers
  Nick

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


[Bug ld/25747] Give more helpful diagnostic when users try to link to foo.a with -lfoo

2020-04-01 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=25747

--- 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=77bf7b5317195e092a9f18fef993c412e2e05f53

commit 77bf7b5317195e092a9f18fef993c412e2e05f53
Author: Nick Clifton 
Date:   Wed Apr 1 17:25:28 2020 +0100

Extend the linker's error message for missing libraries if there is an
almost match.

PR ld/25747
* ldfile.c (ldfile_open_file): If a search for a library fails,
but there is a file that would match if it had a "lib" prefix to
its name, then tell the user.

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


[Bug ld/16017] LD creates invalid PLT instructions on CORTEX-M3

2020-04-01 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=16017

--- Comment #30 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Tamar Christina
:

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

commit 3ce23ca1de4c769c4b7247f0724a10ef5fb24a11
Author: Tamar Christina 
Date:   Wed Apr 1 18:31:22 2020 +0100

Arm: Skip Thumb2 PLT tests on NaCL.

NaCL does not support dynamic linking and so these tests should be
skipped under it.

ld/ChangeLog:

PR ld/16017
* testsuite/ld-arm/arm-elf.exp (thumb-plt, thumb-plt-got): Skip for
NaCL.

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


[Bug ld/25747] Give more helpful diagnostic when users try to link to foo.a with -lfoo

2020-04-01 Thread jwakely.gcc at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25747

--- Comment #3 from Jonathan Wakely  ---
That was quick, thanks!

N.B. the new diagnostic says "use use".

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


Issue 20984 in oss-fuzz: binutils:fuzz_bfd: Out-of-memory in fuzz_bfd

2020-04-01 Thread sheriffbot via monorail
Updates:
Labels: -restrict-view-commit

Comment #2 on issue 20984 by sheriffbot: binutils:fuzz_bfd: Out-of-memory in 
fuzz_bfd
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20984#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.

Issue 20954 in oss-fuzz: binutils:fuzz_bfd: Stack-overflow in vms_traverse_index

2020-04-01 Thread sheriffbot via monorail
Updates:
Labels: -restrict-view-commit

Comment #3 on issue 20954 by sheriffbot: binutils:fuzz_bfd: Stack-overflow in 
vms_traverse_index
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20954#c3

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.

Issue 20960 in oss-fuzz: binutils:fuzz_bfd: Direct-leak in bfd_realloc

2020-04-01 Thread sheriffbot via monorail
Updates:
Labels: -restrict-view-commit

Comment #3 on issue 20960 by sheriffbot: binutils:fuzz_bfd: Direct-leak in 
bfd_realloc
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20960#c3

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 admin/25762] New: asdfagfgaufas

2020-04-01 Thread skeeznsys at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25762

Bug ID: 25762
   Summary: asdfagfgaufas
   Product: binutils
   Version: 2.33
Status: UNCONFIRMED
  Severity: critical
  Priority: P2
 Component: admin
  Assignee: unassigned at sourceware dot org
  Reporter: skeeznsys at gmail dot com
  Target Milestone: ---

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

asdadhafgauygsf

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


[Bug binutils/25750] GNU as has inconsistent behavior when expanding .macro that takes as input directives with arguments

2020-04-01 Thread caij2003 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25750

--- Comment #2 from Jian Cai  ---
Hi Nick,

Thank you for the information. I used gas 2.33.1

$ as -v
GNU assembler version 2.33.1 (aarch64-linux-gnu) using BFD version (GNU
Binutils for Debian) 2.33.1

Does :vararg work for multiple arguments? Thanks.

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


[Bug ld/25749] Non-const relocation against SHN_ABS symbol in PIE or shared library should be disallowed

2020-04-01 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=25749

--- Comment #4 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=382aae06322799a25ea52fe61b243cbca4db8d66

commit 382aae06322799a25ea52fe61b243cbca4db8d66
Author: H.J. Lu 
Date:   Wed Apr 1 14:31:47 2020 -0700

x86: Only allow S + A relocations against absolute symbol

Since value of non-preemptible absolute symbol (SHN_ABS) won't change,
only relocations, which can be resolved as absolute value + addend, and
GOTPCREL relocations, where absolute value + addend is stored in the GOT
slot, against non-preemptible absolute symbol are allowed in PIE and
shared library.

Also convert load relocation to R_386_32, R_X86_64_32S or R_X86_64_32 for
relocation against non-preemptible absolute symbol.  Don't convert to
R_X86_64_32S nor R_X86_64_32 for non-preemptible absolute symbol if they
overflow.

bfd/

PR ld/25749
PR ld/25754
* elf32-i386.c (elf_i386_convert_load_reloc): Convert load
relocation to R_386_32 for relocation against non-preemptible
absolute symbol.
(elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p.  Don't
allocate dynamic relocation for non-preemptible absolute symbol.
(elf_i386_relocate_section): Pass sec to
GENERATE_DYNAMIC_RELOCATION_P.
* elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
(elf_x86_64_convert_load_reloc): Covert load relocation to
R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
absolute symbol.  Don't convert to R_X86_64_32S nor R_X86_64_32
for non-preemptible absolute symbol if they overflow.
(elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p.  Set
tls_type for GOT slot to GOT_ABS for non-preemptible absolute
symbol.  Don't allocate dynamic relocation for non-preemptible
absolute symbol.
(elf_x86_64_relocate_section): Don't generate relative relocation
for GOTPCREL relocations aganst local absolute symbol.  Pass sec
to GENERATE_DYNAMIC_RELOCATION_P.
* elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
against non-preemptible absolute symbol.
(_bfd_elf_x86_valid_reloc_p): New function.
(_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
GOT_ABS GOT slot.
* elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
argument.  Don't generate dynamic relocation against
non-preemptible absolute symbol.
(ABS_SYMBOL_P): New.
(GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
against non-preemptible absolute symbol.
(GOT_ABS): New.
(R_X86_64_converted_reloc_bit): New.  Moved from elf64-x86-64.c.
(_bfd_elf_x86_valid_reloc_p): New.

ld/

PR ld/25749
PR ld/25754
* testsuite/ld-elf/linux-x86.exp: Run ld/25749 tests.
* testsuite/ld-elf/pr25749-1.c: New file.
* testsuite/ld-elf/pr25749-1a.c: Likewise.
* testsuite/ld-elf/pr25749-1b.c: Likewise.
* testsuite/ld-elf/pr25749-1b.err: Likewise.
* testsuite/ld-elf/pr25749-1c.c: Likewise.
* testsuite/ld-elf/pr25749-1d.c: Likewise.
* testsuite/ld-elf/pr25749-2.c: Likewise.
* testsuite/ld-elf/pr25749-2a.s: Likewise.
* testsuite/ld-elf/pr25749-2b.s: Likewise.
* testsuite/ld-elf/pr25749.rd: Likewise.
* testsuite/ld-elf/pr25754-1a.c: Likewise.
* testsuite/ld-elf/pr25754-1b.s: Likewise.
* testsuite/ld-elf/pr25754-2a.c: Likewise.
* testsuite/ld-elf/pr25754-2b.err: Likewise.
* testsuite/ld-elf/pr25754-2b.s: Likewise.
* testsuite/ld-elf/pr25754-3a.c: Likewise.
* testsuite/ld-elf/pr25754-3b.s: Likewise.
* testsuite/ld-elf/pr25754-4a.c: Likewise.
* testsuite/ld-elf/pr25754-4b.s: Likewise.
* testsuite/ld-elf/pr25754-4c.s: Likewise.
* testsuite/ld-elf/pr25754-5a.c: Likewise.
* testsuite/ld-elf/pr25754-5b.s: Likewise.
* testsuite/ld-elf/pr25754-5c.s: Likewise.
* testsuite/ld-elf/pr25754-6a.c: Likewise.
* testsuite/ld-elf/pr25754-6b.s: Likewise.
* testsuite/ld-x86-64/pr19609-6a.d: Don't expect linker error.

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


[Bug ld/25754] [ld][gold] x86: don't relax GOTPCRELX for SHN_ABS

2020-04-01 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=25754

--- 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=382aae06322799a25ea52fe61b243cbca4db8d66

commit 382aae06322799a25ea52fe61b243cbca4db8d66
Author: H.J. Lu 
Date:   Wed Apr 1 14:31:47 2020 -0700

x86: Only allow S + A relocations against absolute symbol

Since value of non-preemptible absolute symbol (SHN_ABS) won't change,
only relocations, which can be resolved as absolute value + addend, and
GOTPCREL relocations, where absolute value + addend is stored in the GOT
slot, against non-preemptible absolute symbol are allowed in PIE and
shared library.

Also convert load relocation to R_386_32, R_X86_64_32S or R_X86_64_32 for
relocation against non-preemptible absolute symbol.  Don't convert to
R_X86_64_32S nor R_X86_64_32 for non-preemptible absolute symbol if they
overflow.

bfd/

PR ld/25749
PR ld/25754
* elf32-i386.c (elf_i386_convert_load_reloc): Convert load
relocation to R_386_32 for relocation against non-preemptible
absolute symbol.
(elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p.  Don't
allocate dynamic relocation for non-preemptible absolute symbol.
(elf_i386_relocate_section): Pass sec to
GENERATE_DYNAMIC_RELOCATION_P.
* elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
(elf_x86_64_convert_load_reloc): Covert load relocation to
R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
absolute symbol.  Don't convert to R_X86_64_32S nor R_X86_64_32
for non-preemptible absolute symbol if they overflow.
(elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p.  Set
tls_type for GOT slot to GOT_ABS for non-preemptible absolute
symbol.  Don't allocate dynamic relocation for non-preemptible
absolute symbol.
(elf_x86_64_relocate_section): Don't generate relative relocation
for GOTPCREL relocations aganst local absolute symbol.  Pass sec
to GENERATE_DYNAMIC_RELOCATION_P.
* elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
against non-preemptible absolute symbol.
(_bfd_elf_x86_valid_reloc_p): New function.
(_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
GOT_ABS GOT slot.
* elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
argument.  Don't generate dynamic relocation against
non-preemptible absolute symbol.
(ABS_SYMBOL_P): New.
(GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
against non-preemptible absolute symbol.
(GOT_ABS): New.
(R_X86_64_converted_reloc_bit): New.  Moved from elf64-x86-64.c.
(_bfd_elf_x86_valid_reloc_p): New.

ld/

PR ld/25749
PR ld/25754
* testsuite/ld-elf/linux-x86.exp: Run ld/25749 tests.
* testsuite/ld-elf/pr25749-1.c: New file.
* testsuite/ld-elf/pr25749-1a.c: Likewise.
* testsuite/ld-elf/pr25749-1b.c: Likewise.
* testsuite/ld-elf/pr25749-1b.err: Likewise.
* testsuite/ld-elf/pr25749-1c.c: Likewise.
* testsuite/ld-elf/pr25749-1d.c: Likewise.
* testsuite/ld-elf/pr25749-2.c: Likewise.
* testsuite/ld-elf/pr25749-2a.s: Likewise.
* testsuite/ld-elf/pr25749-2b.s: Likewise.
* testsuite/ld-elf/pr25749.rd: Likewise.
* testsuite/ld-elf/pr25754-1a.c: Likewise.
* testsuite/ld-elf/pr25754-1b.s: Likewise.
* testsuite/ld-elf/pr25754-2a.c: Likewise.
* testsuite/ld-elf/pr25754-2b.err: Likewise.
* testsuite/ld-elf/pr25754-2b.s: Likewise.
* testsuite/ld-elf/pr25754-3a.c: Likewise.
* testsuite/ld-elf/pr25754-3b.s: Likewise.
* testsuite/ld-elf/pr25754-4a.c: Likewise.
* testsuite/ld-elf/pr25754-4b.s: Likewise.
* testsuite/ld-elf/pr25754-4c.s: Likewise.
* testsuite/ld-elf/pr25754-5a.c: Likewise.
* testsuite/ld-elf/pr25754-5b.s: Likewise.
* testsuite/ld-elf/pr25754-5c.s: Likewise.
* testsuite/ld-elf/pr25754-6a.c: Likewise.
* testsuite/ld-elf/pr25754-6b.s: Likewise.
* testsuite/ld-x86-64/pr19609-6a.d: Don't expect linker error.

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


[Bug ld/25749] Non-const relocation against SHN_ABS symbol in PIE or shared library should be disallowed

2020-04-01 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25749

H.J. Lu  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Target Milestone|--- |2.35
 Status|NEW |RESOLVED

--- Comment #5 from H.J. Lu  ---
Fixed for 2.35.

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


[Bug gold/25754] [gold] x86: don't relax GOTPCRELX for SHN_ABS

2020-04-01 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25754

H.J. Lu  changed:

   What|Removed |Added

 CC||ian at airs dot com
 Ever confirmed|0   |1
Summary|[ld][gold] x86: don't relax |[gold] x86: don't relax
   |GOTPCRELX for SHN_ABS   |GOTPCRELX for SHN_ABS
  Component|ld  |gold
   Last reconfirmed||2020-04-01
 Status|UNCONFIRMED |NEW
   Assignee|unassigned at sourceware dot org   |ccoutant at gmail dot 
com

--- Comment #2 from H.J. Lu  ---
Fixed in ld for 2.35.

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