bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/24406] New: -Wl,--wrap= incompatible with -flto


From: dilyan.palauzov at aegee dot org
Subject: [Bug ld/24406] New: -Wl,--wrap= incompatible with -flto
Date: Mon, 01 Apr 2019 06:18:15 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=24406

            Bug ID: 24406
           Summary: -Wl,--wrap= incompatible with -flto
           Product: binutils
           Version: 2.32
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: dilyan.palauzov at aegee dot org
  Target Milestone: ---

This is t.c:
------------
#include <stdio.h>
#include <unistd.h>

ssize_t __wrap_read(int fd, void *buffer, size_t count) {
  printf("%s\n", (char*)buffer);
  return fd + count; 
}


int main() {
  int i = read(1, "abc", 5);
  printf("%i\n", i);
}

------------
I have gcc 8.3.1 20190311, ld.bfd 2.32.51.20190319, ld.gold 1.16
2.32.51.20190319 and clang 8.0.0.

This works
clang -flto -fuse-ld=gold -Wl,--wrap=read t.c
gcc         -fuse-ld=bfd  -Wl,--wrap=read t.c
gcc         -fuse-ld=gold -Wl,--wrap=read t.c
clang       -fuse-ld=bfd  -Wl,--wrap=read t.c
clang       -fuse-ld=gold -Wl,--wrap=read t.c

This fails
clang -flto -fuse-ld=bfd  -Wl,--wrap=read t.c
gcc   -flto -fuse-ld=gold -Wl,--wrap=read t.c
gcc   -flto -fuse-ld=bfd  -Wl,--wrap=read t.c

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]