[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/19609] New: Load weak undefined symbol isn't optimized
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug ld/19609] New: Load weak undefined symbol isn't optimized |
Date: |
Thu, 11 Feb 2016 11:04:31 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=19609
Bug ID: 19609
Summary: Load weak undefined symbol isn't optimized
Product: binutils
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: hjl.tools at gmail dot com
Target Milestone: ---
address@hidden weakundef-1]$ cat x.c
extern void bar (void) __attribute__((weak));
void *
_start (void)
{
return bar;
}
address@hidden weakundef-1]$ make
gcc -O2 -fPIC -c -o x.o x.c
ld -o x x.o
objdump -dw x
x: file format elf64-x86-64
Disassembly of section .text:
00000000004000f0 <_start>:
4000f0: 48 8b 05 31 00 20 00 mov 0x200031(%rip),%rax #
600128 <_start+0x200038>
4000f7: c3 retq
address@hidden weakundef-1]$
Since the address of bar won't change at run-time, mov should be optimized
to lea.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/19609] New: Load weak undefined symbol isn't optimized,
hjl.tools at gmail dot com <=
- [Bug ld/19609] Load weak undefined symbol and defined symbol in non-PIC link aren't optimized, hjl.tools at gmail dot com, 2016/02/12
- [Bug ld/19609] [2.26 Regression] Load defined symbol in non-PIC link are wrongly optimized, hjl.tools at gmail dot com, 2016/02/12
- [Bug ld/19609] [2.26 Regression] Load defined symbol in non-PIC link are wrongly optimized, hjl.tools at gmail dot com, 2016/02/12
- [Bug ld/19609] [2.26 Regression] Load defined symbol in non-PIC link are wrongly optimized, cvs-commit at gcc dot gnu.org, 2016/02/26
- [Bug ld/19609] [2.26 Regression] Load defined symbol in non-PIC link are wrongly optimized, hjl.tools at gmail dot com, 2016/02/26