[Bug ld/25389] New: - -Wl,--wrap -fuse-ld=bfd not supported with LTO

2020-01-15 Thread cuilili8868 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25389

Bug ID: 25389
   Summary: - -Wl,--wrap  -fuse-ld=bfd not supported with LTO
   Product: binutils
   Version: 2.33
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: cuilili8868 at gmail dot com
  Target Milestone: ---

$ cat a.c
int w = 100;

int z = 78;

extern int foo()
{
return w + z;
}

extern int main()
{
return foo() + foo() * foo();
}

$ cat b.c
int x = 76;

int y = 87;

#define likely(z) __builtin_expect(!!(z), 1)

extern int __wrap_foo()
{
if (likely(x)) {
return __real_foo();
}
int i,s;
for (i = 0; i < 1; i++)
s = s + x * y - i;
}

$gcc -flto -fuse-ld=bfd -Wl,--wrap=foo  a.c b.c
/tmp/ccPX4lh2.ltrans0.ltrans.o: in function `__wrap_foo':
:(.text+0x6a): undefined reference to `foo'

gcc version: 7.4.0 or gcc trunk
binutils version: 2.33 or binutils trunk

I tried different configurations, this works 
gcc   -flto -fuse-ld=gold -Wl,--wrap=read -O3 a.c b.c
gcc   -flto -fuse-ld=gold -Wl,--wrap=read -O2 a.c b.c
gcc   -flto -fuse-ld=gold -Wl,--wrap=read -O1 a.c b.c


This does not work:

gcc   -flto -fuse-ld=gold -Wl,--wrap=read -O0 a.c b.c
gcc   -flto -fuse-ld=bfd  -Wl,--wrap=read -O3 a.c b.c
gcc   -flto -fuse-ld=bfd  -Wl,--wrap=read -O2 a.c b.c
gcc   -flto -fuse-ld=bfd  -Wl,--wrap=read -O1 a.c b.c
gcc   -flto -fuse-ld=bfd  -Wl,--wrap=read -O0 a.c b.c

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


[Bug ld/25389] - -Wl,--wrap -fuse-ld=bfd not supported with LTO

2020-01-15 Thread cuilili8868 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25389

cuilili  changed:

   What|Removed |Added

 CC||cuilili8868 at gmail dot com,
   ||hjl.tools at gmail dot com

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


[Bug binutils/25371] [objcopy] add support for setting SHF_EXCLUDE flag for sections

2020-01-15 Thread dsn1234 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25371

--- Comment #2 from dsn1234 at gmail dot com ---
Looks good to me.

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


[Bug ld/25384] Copy relocations and BIND_NOW on POWER ELFv1 results in crashes

2020-01-15 Thread fweimer at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25384

--- Comment #8 from Florian Weimer  ---
I believe later GCC (I tried 7) uses .data.relro with -O0 and the
__pthread_key_create-based single thread detection, not .rodata. This means
that the current toolchain is consistent and does not produce text relocations.

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


[Bug ld/25243] static linking with exceptions and iostream is broken on ARM

2020-01-15 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25243

Alan Modra  changed:

   What|Removed |Added

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

--- Comment #6 from Alan Modra  ---
Closing as fixed.

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


[Bug ld/20694] PDP11 TARGET_PAGE_SIZE is incorrect

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

--- Comment #4 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=0d1cc75df1c9a356dfa47932e9ec52fca7d8f5ab

commit 0d1cc75df1c9a356dfa47932e9ec52fca7d8f5ab
Author: Lars Brinkhoff 
Date:   Wed Jan 15 14:18:54 2020 +

Set the default page size of the PDP11 target to 8192 bytes.

PR 20694
bfd * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.

ld  * temulparams/pdp11.sh (TARGET_PAGE_SIZE): Set to 8192.

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


[Bug ld/20694] PDP11 TARGET_PAGE_SIZE is incorrect

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

Nick Clifton  changed:

   What|Removed |Added

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

--- Comment #5 from Nick Clifton  ---
Patch applied.

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


[Bug binutils/25371] [objcopy] add support for setting SHF_EXCLUDE flag for sections

2020-01-15 Thread i at maskray dot me
https://sourceware.org/bugzilla/show_bug.cgi?id=25371

Fangrui Song  changed:

   What|Removed |Added

 CC||i at maskray dot me

--- Comment #3 from Fangrui Song  ---
We don't have precedent for +flag or -flag. Isn't it an overkill to invent the
+- prefix and use +exclude and -exclude?

Other than .debug_*.dwo and an LLVM extension .linker-options, I can't think of
any use cases of SHF_EXCLUDE. Nobody will --set-section-flags on .debug_*.dwo .
I'd prefer treating 'exclude' like other flags such as
'alloc','readonly','data'... I can send a patch for this.

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