[Bug ld/27905] New: qemu: ./src/hw/megasas.c:168:(.text.megasas_process_op+0x3d): relocation

2021-05-24 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=27905

Bug ID: 27905
   Summary: qemu:
./src/hw/megasas.c:168:(.text.megasas_process_op+0x3d)
: relocation
   Product: binutils
   Version: 2.37 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: mliska at suse dot cz
  Target Milestone: ---

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

The issue happens since:

commit a7664973b24a242cd9ea17deb5eaf503065fc0bd (HEAD, refs/bisect/bad)
Author: Jan Beulich 
Date:   Mon Apr 26 10:41:35 2021 +0200

x86: correct overflow checking for 16-bit PC-relative relocs

I discussed that briefly with Jan in a private email thread. Steps to
reproduce:

$ gcc -I. 
-I/home/abuild/rpmbuild/BUILD/qemu-6.0.0/roms/seabios/builds/seabios-256k/
-Isrc -Os -MD -g -Wall -Wno-strict-aliasing -Wold-style-definition
-Wtype-limits -m32 -march=i386 -mregparm=3 -mpreferred-stack-boundary=2
-minline-all-stringops -fomit-frame-pointer -freg-struct-return -ffreestanding
-fno-delete-null-pointer-checks -ffunction-sections -fdata-sections -fno-common
-fno-merge-constants -fno-pie -fno-stack-protector -fstack-check=no
-Wno-address-of-packed-member -fcf-protection=none -Wa,-mx86-used-note=no
-DMODESEGMENT=1 -fno-defer-pop -fno-jump-tables -fno-tree-switch-conversion
-DMODE16=1 -m16 --param large-stack-frame=4 -fwhole-program -DWHOLE_PROGRAM -c
ccode16.i && ld -melf_i386 -r ccode16.o romlayout.o -o code16.o &&
/home/marxin/Programming/binutils/objdir/ld/ld-new -T rom.lds code16.o
...
code16.o: in function `mpt_scsi_process_op':
/home/abuild/rpmbuild/BUILD/qemu-6.0.0/roms/seabios/./src/hw/mpt-scsi.c:188:(.text.mpt_scsi_process_op+0x3a):
relocation truncated to fit: R_386_PC16 against
`.text.default_process_op.isra.0'
code16.o: in function `megasas_process_op':
/home/abuild/rpmbuild/BUILD/qemu-6.0.0/roms/seabios/./src/hw/megasas.c:168:(.text.megasas_process_op+0x3d):
relocation truncated to fit: R_386_PC16 against
`.text.default_process_op.isra.0'
code16.o: in function `handle_hwpic2':
/home/abuild/rpmbuild/BUILD/qemu-6.0.0/roms/seabios/./src/hw/pic.c:114:(.text.handle_hwpic2+0x1):
relocation truncated to fit: R_386_PC16 against `.text.pic_eoi2'

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


[Bug ld/27905] qemu: ./src/hw/megasas.c:168:(.text.megasas_process_op+0x3d): relocation

2021-05-24 Thread mliska at suse dot cz
https://sourceware.org/bugzilla/show_bug.cgi?id=27905

Martin Liska  changed:

   What|Removed |Added

 CC||hjl at sourceware dot org,
   ||jbeulich at suse dot com

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


[Bug ld/27905] qemu: ./src/hw/megasas.c:168:(.text.megasas_process_op+0x3d): relocation

2021-05-24 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27905

H.J. Lu  changed:

   What|Removed |Added

   Last reconfirmed||2021-05-24
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #1 from H.J. Lu  ---
The problem is that ELF32 is used as a container for 16-bit program
which caused the problem when building 16-bit program.  I can extend

commit 4c10bbaa0912742322f10d9d5bb630ba4e15dfa7
Author: H.J. Lu 
Date:   Tue Mar 15 11:07:06 2016 -0700

Add -z noreloc-overflow option to x86-64 ld

Add -z noreloc-overflow command-line option to the x86-64 ELF linker to
disable relocation overflow check.  This can be used to avoid relocation
overflow check if there will be no dynamic relocation overflow at
run-time.

to i386.

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


[Bug ld/27905] qemu: ./src/hw/megasas.c:168:(.text.megasas_process_op+0x3d): relocation

2021-05-24 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27905

H.J. Lu  changed:

   What|Removed |Added

 CC|hjl at sourceware dot org  |hjl.tools at gmail dot 
com

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


[Bug ld/27905] qemu: ./src/hw/megasas.c:168:(.text.megasas_process_op+0x3d): relocation

2021-05-24 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27905

--- Comment #2 from H.J. Lu  ---
[hjl@gnu-cfl-2 pr27905]$ cat rom.s 
.code16gcc
.text
.section.text.default_process_op.isra.0,"ax",@progbits
.type   default_process_op.isra.0, @function
default_process_op.isra.0:
ret
.section.text.mpt_scsi_process_op,"ax",@progbits
.type   mpt_scsi_process_op, @function
mpt_scsi_process_op:
jmp default_process_op.isra.0
[hjl@gnu-cfl-2 pr27905]$ cat rom.lds 
OUTPUT_FORMAT("elf32-i386")
OUTPUT_ARCH("i386")
SECTIONS
{
.text.default_process_op.isra.0 0x737c : { *(.text.default_process_op.isra.0) }
.text.mpt_scsi_process_op 0xf869 : { *(.text.mpt_scsi_process_op) }
}
[hjl@gnu-cfl-2 pr27905]$ make rom
gcc -B./ -m32 -c -o rom.o rom.s
ld -o rom -T rom.lds rom.o
rom.o: in function `mpt_scsi_process_op':
(.text.mpt_scsi_process_op+0x1): relocation truncated to fit: R_386_PC16
against `.text.default_process_op.isra.0'
make: *** [Makefile:10: rom] Error 1
[hjl@gnu-cfl-2 pr27905]$

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


[Bug ld/27905] qemu: ./src/hw/megasas.c:168:(.text.megasas_process_op+0x3d): relocation

2021-05-24 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27905

H.J. Lu  changed:

   What|Removed |Added

   Assignee|unassigned at sourceware dot org   |hjl.tools at gmail dot 
com

--- Comment #3 from H.J. Lu  ---
[hjl@gnu-cfl-2 pr27905]$ readelf -n rom.o

Displaying notes found in: .note.gnu.property
  OwnerData sizeDescription
  GNU  0x0018   NT_GNU_PROPERTY_TYPE_0
  Properties: x86 ISA used: 
x86 feature used: x86
[hjl@gnu-cfl-2 pr27905]$ 

We can add code16 to x86 feature used: and update assembler to set it
with .code16gcc.

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


[Bug ld/27833] ld-plugin/pr24406-1.c fails with GCC cross-toolchain for arm-none-eabi

2021-05-24 Thread dimitar at dinux dot eu
https://sourceware.org/bugzilla/show_bug.cgi?id=27833

--- Comment #3 from Dimitar Dimitrov  ---
Hi Nick,

Could you clarify why read() is not part of newlib for ARM?

I tested on 3 different newlib targets and I can see that "read" function is
part of newlib libc:
$ ./bin/arm-none-eabi-nm ./arm-none-eabi/lib/libc.a | grep -w read
 T read
$ ./bin/riscv32-none-elf-nm ./riscv32-none-elf/lib/libc.a | grep -w read
 T read
$ ./bin/pru-nm ./pru/lib/libc.a | grep -w read
 T read

read() seems to be defined here:
https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=newlib/libc/syscalls/sysread.c

Without -flto the test case is successfully linked for all of the 3 targets
above. Which is another indication that newlib provides the "read" function.

Regards,
Dimitar

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


[Bug gas/27906] New: doc for x86 incorrectly says that movsb is an alias for movsbq

2021-05-24 Thread sebastien at debian dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=27906

Bug ID: 27906
   Summary: doc for x86 incorrectly says that movsb is an alias
for movsbq
   Product: binutils
   Version: 2.37 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: sebastien at debian dot org
  Target Milestone: ---

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

The documentation (in i386 Dependent features, section “i386-Mnemonics”, file
c-i386.texi) says that movsb is an alias for movsbq. However, movsb is a
different instruction (byte-sized movs). The intended alias is rather movsxb.

A patch is attached for clarity.

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


Issue 31242 in oss-fuzz: binutils:fuzz_bfd: Timeout in fuzz_bfd

2021-05-24 Thread sheriffbot via monorail
Updates:
Labels: -restrict-view-commit -deadline-approaching Deadline-Exceeded

Comment #4 on issue 31242 by sheriffbot: binutils:fuzz_bfd: Timeout in fuzz_bfd
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31242#c4

This bug has exceeded our disclosure deadline. 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 ld/27905] qemu: ./src/hw/megasas.c:168:(.text.megasas_process_op+0x3d): relocation

2021-05-24 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27905

--- Comment #4 from H.J. Lu  ---
Update GNU_PROPERTY_X86_FEATURE_2_USED with

#define GNU_PROPERTY_X86_FEATURE_2_CODE16 (1U << 12)

https://groups.google.com/g/x86-64-abi/c/UvvXWeHIGMA

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


[Bug ld/27905] qemu: ./src/hw/megasas.c:168:(.text.megasas_process_op+0x3d): relocation

2021-05-24 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27905

--- Comment #5 from H.J. Lu  ---
A patch is posted at

https://sourceware.org/pipermail/binutils/2021-May/116722.html

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