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

            Bug ID: 24151
           Summary: Regression about copy relocation of protected data
           Product: binutils
           Version: 2.31
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: robinlee.sysu at gmail dot com
  Target Milestone: ---

clang(7.0.1) does not build correct code for copy relocation of protected data.
And ld.bfd of 2.30 will refuse to link the shared object. But ld.bfd 2.31.1
will not.

I run the test program posted on
https://bugs.llvm.org/show_bug.cgi?id=26580#c0

With binutils 2.30:

clang  -O3 -c -o x.o x.c
clang  -O3 -fpic    -c -o bar.o bar.c
clang  -fuse-ld=bfd -shared -o libfoo.so bar.o
/usr/bin/ld.bfd: bar.o: relocation R_X86_64_PC32 against protected symbol `a'
can not be used when making a shared object
/usr/bin/ld.bfd: final link failed: Bad value
clang-7: error: linker command failed with exit code 1 (use -v to see
invocation)

With binutils 2.31.1, linking is completed with no error/warning.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to