public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug target/51880] New: protected visibility does not link
@ 2012-01-17 12:18 rguenth at gcc dot gnu.org
2012-01-17 12:33 ` [Bug target/51880] " rguenth at gcc dot gnu.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-01-17 12:18 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51880
Bug #: 51880
Summary: protected visibility does not link
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: rguenth@gcc.gnu.org
Target: x86_64-*-*
__attribute__((visibility("protected")))
void * foo (void) { return (void *)foo; }
does not link:
> gcc t1.c -o libt1.so -shared -fPIC
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld:
t1.o: relocation R_X86_64_PC32 against protected symbol `foo' can not be used
when making a shared object
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld:
final link failed: Bad value
collect2: error: ld returned 1 exit status
which is because we assemble to:
.globl foo
.protected foo
.type foo, @function
foo:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
leaq foo(%rip), %rax
ICC otoh generates
.protected foo
.globl foo
foo:
..B1.1: # Preds ..B1.0
..___tag_value_foo.1: #1.60
movq foo@GOTPCREL(%rip), %rax #1.77
and properly
6: 00000000000005b0 16 FUNC GLOBAL PROTECTED 11 foo
I'm using binutils 2.22 in case this is an assembler problem.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/51880] protected visibility does not link 2012-01-17 12:18 [Bug target/51880] New: protected visibility does not link rguenth at gcc dot gnu.org @ 2012-01-17 12:33 ` rguenth at gcc dot gnu.org 2012-01-17 12:37 ` rguenth at gcc dot gnu.org ` (2 subsequent siblings) 3 siblings, 0 replies; 5+ messages in thread From: rguenth at gcc dot gnu.org @ 2012-01-17 12:33 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51880 Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Known to fail| |3.4.0, 4.7.0 --- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-17 12:14:26 UTC --- Assembler seems to be the same since forever. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/51880] protected visibility does not link 2012-01-17 12:18 [Bug target/51880] New: protected visibility does not link rguenth at gcc dot gnu.org 2012-01-17 12:33 ` [Bug target/51880] " rguenth at gcc dot gnu.org @ 2012-01-17 12:37 ` rguenth at gcc dot gnu.org 2012-01-17 12:50 ` rguenth at gcc dot gnu.org 2012-01-17 20:08 ` pinskia at gcc dot gnu.org 3 siblings, 0 replies; 5+ messages in thread From: rguenth at gcc dot gnu.org @ 2012-01-17 12:37 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51880 --- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-17 12:15:58 UTC --- GAS can assemble the ICC assembly just fine and we can then link it just fine. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/51880] protected visibility does not link 2012-01-17 12:18 [Bug target/51880] New: protected visibility does not link rguenth at gcc dot gnu.org 2012-01-17 12:33 ` [Bug target/51880] " rguenth at gcc dot gnu.org 2012-01-17 12:37 ` rguenth at gcc dot gnu.org @ 2012-01-17 12:50 ` rguenth at gcc dot gnu.org 2012-01-17 20:08 ` pinskia at gcc dot gnu.org 3 siblings, 0 replies; 5+ messages in thread From: rguenth at gcc dot gnu.org @ 2012-01-17 12:50 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51880 --- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-17 12:33:07 UTC --- bas/ld bug: http://sourceware.org/bugzilla/show_bug.cgi?id=13600 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/51880] protected visibility does not link 2012-01-17 12:18 [Bug target/51880] New: protected visibility does not link rguenth at gcc dot gnu.org ` (2 preceding siblings ...) 2012-01-17 12:50 ` rguenth at gcc dot gnu.org @ 2012-01-17 20:08 ` pinskia at gcc dot gnu.org 3 siblings, 0 replies; 5+ messages in thread From: pinskia at gcc dot gnu.org @ 2012-01-17 20:08 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51880 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |DUPLICATE --- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-17 20:00:27 UTC --- Dup of 19520 *** This bug has been marked as a duplicate of bug 19520 *** ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-01-17 20:00 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2012-01-17 12:18 [Bug target/51880] New: protected visibility does not link rguenth at gcc dot gnu.org 2012-01-17 12:33 ` [Bug target/51880] " rguenth at gcc dot gnu.org 2012-01-17 12:37 ` rguenth at gcc dot gnu.org 2012-01-17 12:50 ` rguenth at gcc dot gnu.org 2012-01-17 20:08 ` pinskia at gcc dot gnu.org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).