[Bug ld/27467] New: ld: Internal error when linking .tmp_vmlinux.btf

2021-02-25 Thread frankebay99 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27467

Bug ID: 27467
   Summary: ld: Internal error when linking .tmp_vmlinux.btf
   Product: binutils
   Version: 2.36.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: frankebay99 at gmail dot com
  Target Milestone: ---

Hi there,

While building kernel 5.11.1 (source:
https://github.com/Frogging-Family/linux-tkg) I got for the first time this
error:

-
LD [M]  drivers/gpu/drm/nouveau/nouveau.o
AR  drivers/gpu/built-in.a
AR  drivers/built-in.a
GEN .version
CHK include/generated/compile.h
LD  vmlinux.o
MODPOST vmlinux.symvers
MODINFO modules.builtin.modinfo
GEN modules.builtin
LD  .tmp_vmlinux.btf
ld: BFD (GNU Binutils) 2.36.1 internal error, aborting at
/build/binutils/src/binutils-gdb/bfd/merge.c:939 in _bfd_merged_section_offset

ld: Please report this bug.

BTF .btf.vmlinux.bin.o
pahole: .tmp_vmlinux.btf: No debugging information found
LD  .tmp_vmlinux.kallsyms1
.btf.vmlinux.bin.o: file not recognized: file format not recognized
make: *** [Makefile:1165: vmlinux] Error 1
DESCEND  objtool
DESCEND  bpf/resolve_btfids
-

I am suspecting the upgrade to 2.36.1.
However I admit I have more tests to perform to isolate my theory. I will try
this same build from a VM using 2.36.1 and also another VM using a previous
version, plus I will downgrade to previous version of BNUtils on my main
machine, if the system allows me to, and try to build the kernel again.

I do not know what other information to provide, I am not much knowledgeable
about using build tools, even worse when it comes down to troubleshoot build
errors. :(


Thanks

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


[Bug ld/27467] ld: Internal error when linking .tmp_vmlinux.btf

2021-02-25 Thread frankebay99 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27467

Frank  changed:

   What|Removed |Added

 Resolution|--- |WORKSFORME
 Status|UNCONFIRMED |RESOLVED

--- Comment #1 from Frank  ---
Well I was not able to reproduce this on a VM machine.

- I downgraded package version to 2.36 on my main machine and compiling kernel
went fine.
- I tested 2.36 on a VM and it went fine.
- I upgraded to 2.36.1 on that same VM and it also went fine.


Since I am unable to provide troubleshooting data, I have to close this and
cross fingers next time it will work on my main machine with 2.36.1 or find a
dirty way around it.

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


[Bug ld/26378] sections initialised only by linker scripts are always read/write

2021-02-25 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26378

Alan Modra  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Assignee|unassigned at sourceware dot org   |amodra at gmail dot com
   Target Milestone|--- |2.37
 Status|WAITING |RESOLVED

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


[Bug gas/27472] New: gas: Suppress "CFI instruction used without previous .cfi_startproc" if .cfi_sections is empty

2021-02-25 Thread i at maskray dot me
https://sourceware.org/bugzilla/show_bug.cgi?id=27472

Bug ID: 27472
   Summary: gas: Suppress "CFI instruction used without previous
.cfi_startproc" if .cfi_sections is empty
   Product: binutils
   Version: unspecified
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: i at maskray dot me
  Target Milestone: ---

% cat a.c
int main() {
  asm("pushl 0\n.cfi_adjust_cfa_offset 4\npop %%eax\n.cfi_adjust_cfa_offset -4"
::: "eax");
}
% gcc -m32 -c -fomit-frame-pointer -fno-asynchronous-unwind-tables a.c
a.c: Assembler messages:
a.c:3: Error: CFI instruction used without previous .cfi_startproc
a.c:5: Error: CFI instruction used without previous .cfi_startproc

-fasynchronous-unwind-tables & -fno-asynchronous-unwind-tables do not have a
predefined macro, so it is difficult for the inline asm to know whether CFI
directives should be used. For ergonomics, users just want to write CFI
directives and hope they will be silently ignored in
-fno-asynchronous-unwind-tables mode. However, GNU as errors for .cfi_* without
.cfi_startproc .

I suggest that (1) GCC emits ".cfi_sections" (no value) at the beginning, (2)
GNU as suppresses the error if no .eh_frame/.debug_frame is needed.

The place to patch is gas/dw2gencfi.c:dot_cfi and a few other functions.

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


[Bug ld/27441] Small inconsistency in between gold and bfd

2021-02-25 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=27441

--- Comment #14 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=bfece7562d62f11782ca7089310b4063be526fb2

commit bfece7562d62f11782ca7089310b4063be526fb2
Author: Alan Modra 
Date:   Fri Feb 26 13:26:19 2021 +1030

Add PR27441 testcase

PR 27441
* testsuite/ld-plugin/pr27441a.c,
* testsuite/ld-plugin/pr27441b.c,
* testsuite/ld-plugin/pr27441c.c,
* testsuite/ld-plugin/pr27441c.d: New test.
* testsuite/ld-plugin/lto.exp: Run it.

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


[Bug binutils/26945] Unsafe chown+chmod in smart_rename, possibly elsewhere

2021-02-25 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26945

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

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

commit d3edaa91d4cf7202ec14342410194841e2f67f12
Author: Alan Modra 
Date:   Fri Feb 26 11:30:32 2021 +1030

Reinstate various pieces backed out from smart_rename changes

In the interests of a stable release various last minute smart_rename
patches were backed out of the 2.36 branch.  The main reason to
reinstate some of those backed out changes here is to make necessary
followup fixes to commit 8e03235147a9 simple cherry-picks from
mainline.  A secondary reason is that ar -M support isn't fixed for
pr26945 without this patch.

PR 26945
* ar.c: Don't include libbfd.h.
(write_archive): Replace xmalloc+strcpy with xstrdup.
* arsup.c (temp_name, real_ofd): New static variables.
(ar_open): Use make_tempname and bfd_fdopenw.
(ar_save): Adjust to suit ar_open changes.
* objcopy.c: Don't include libbfd.h.
* rename.c: Rename and reorder variables.

(cherry picked from commit 95b91a043aeaeb546d2fea556d84a2de1e917770)

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


[Bug binutils/27456] Link failure due to the use of lstat in rename.c on MinGW

2021-02-25 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=27456

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

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

commit 8b69e61d4be276bb862698aaafddc3e779d23c8f
Author: Alan Modra 
Date:   Tue Feb 23 09:37:39 2021 +1030

PR27456, lstat in rename.c on MinGW

PR 27456
* rename.c: Tidy throughout.
(smart_rename): Always copy.  Remove windows specific code.

(cherry picked from commit cca8873dd5a6015d5557ea44bc1ea9c252435a29)

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


[Bug binutils/27456] Link failure due to the use of lstat in rename.c on MinGW

2021-02-25 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=27456

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

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

commit 08bdb5f4f98b6a5e1a9bdc89e7d1889933859caf
Author: Alan Modra 
Date:   Tue Feb 23 12:10:58 2021 +1030

Use make_tempname file descriptor in smart_rename

This patch makes use of the temp file descriptor in smart_rename
rather than reopening the file.  I don't believe there is a security
issue in reopening the file, but this way is one less directory
operation.  The patch also attempts to preserve S_ISUID and S_ISGID.

PR 27456
* bucomm.h (smart_rename): Update prototype.
* rename.c (smart_rename): Add fromfd and preserve_dates params.
Pass fromfd and target_stat to simple_copy.  Call set_times
when preserve_dates.
(simple_copy): Accept fromfd rather than from filename.  Add
target_stat param.  Rewind fromfd rather than opening.  Open
"to" file without O_CREAT.  Try to preserve S_ISUID and S_ISGID.
* ar.c (write_archive): Rename ofd to tmpfd.  Dup tmpfd before
closing output temp file, and pass tmpfd to smart_rename.
* arsup.c (temp_fd): Rename from real_fd.
(ar_save): Dup temp_fd and pass to smart_rename.
* objcopy.c (strip_main, copy_main): Likewise, and pass
preserve_dates.

(cherry picked from commit c42c71a1527dd70417d3966dce7ba9edbcf4bdb4)

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


[Bug binutils/27456] Link failure due to the use of lstat in rename.c on MinGW

2021-02-25 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=27456

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

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

commit 1aad0a424af288cbd7f70ad5f932664a1abd5a79
Author: Alan Modra 
Date:   Thu Feb 25 09:46:02 2021 +1030

Re: Use make_tempname file descriptor in smart_rename

PR 27456
* rename.c (simple_copy): Mark target_stat ATTRIBUTE_UNUSED.

(cherry picked from commit 40b02646ec5b197e63ba904f95ea101d95a50cf4)

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