[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/22269] New: Undefined weak symbols isn't resolved to 0 in static
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug ld/22269] New: Undefined weak symbols isn't resolved to 0 in static PIE |
Date: |
Fri, 06 Oct 2017 12:34:10 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=22269
Bug ID: 22269
Summary: Undefined weak symbols isn't resolved to 0 in static
PIE
Product: binutils
Version: 2.30 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: hjl.tools at gmail dot com
Depends on: 19636
Target Milestone: ---
Target: aarch64
On aarch64:
address@hidden glibc]$ cat x.s
.text
.globl _start
_start:
.byte 0
.section .data.rel.ro.local,"aw",%progbits
.weak func
.dc.a func
address@hidden glibc]$
/export/gnu/import/git/toolchain/install/compilers/aarch64-linux-gnu/bin/aarch64-glibc-linux-gnu-gcc
-c x.s
address@hidden glibc]$
/export/gnu/import/git/toolchain/install/compilers/aarch64-linux-gnu/bin/aarch64-glibc-linux-gnu-ld
-pie --no-dynamic-linker x.o
address@hidden glibc]$ readelf -r a.out
Relocation section '.rela.dyn' at offset 0x1a8 contains 1 entries:
Offset Info Type Sym. Value Sym. Name +
Addend
000000010ec8 000200000101 R_AARCH64_ABS64 0000000000000000 func + 0
address@hidden glibc]$ readelf -l a.out
Elf file type is DYN (Shared object file)
Entry point 0x1c0
There are 4 program headers, starting at offset 64
Program Headers:
Type Offset VirtAddr PhysAddr
FileSiz MemSiz Flags Align
LOAD 0x0000000000000000 0x0000000000000000 0x0000000000000000
0x00000000000001c1 0x00000000000001c1 R E 0x10000
LOAD 0x0000000000000ec8 0x0000000000010ec8 0x0000000000010ec8
0x0000000000000138 0x0000000000000138 RW 0x10000
DYNAMIC 0x0000000000000ed0 0x0000000000010ed0 0x0000000000010ed0
0x0000000000000110 0x0000000000000110 RW 0x8
GNU_RELRO 0x0000000000000ec8 0x0000000000010ec8 0x0000000000010ec8
0x0000000000000138 0x0000000000000138 R 0x1
Section to Segment mapping:
Segment Sections...
00 .hash .gnu.hash .dynsym .dynstr .rela.dyn .text
01 .data.rel.ro .dynamic .got .got.plt
02 .dynamic
03 .data.rel.ro .dynamic .got .got.plt
address@hidden glibc]$
func should be resolved to 0 by ld.
Referenced Bugs:
https://sourceware.org/bugzilla/show_bug.cgi?id=19636
[Bug 19636] -pie changes program behavior and generate unnecessary dynamic
symbols.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/22269] New: Undefined weak symbols isn't resolved to 0 in static PIE,
hjl.tools at gmail dot com <=
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, hjl.tools at gmail dot com, 2017/10/06
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, hjl.tools at gmail dot com, 2017/10/06
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, hjl.tools at gmail dot com, 2017/10/06
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, amodra at gmail dot com, 2017/10/09
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, hjl.tools at gmail dot com, 2017/10/09
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, amodra at gmail dot com, 2017/10/10
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, hjl.tools at gmail dot com, 2017/10/10
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, hjl.tools at gmail dot com, 2017/10/10
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, amodra at gmail dot com, 2017/10/10
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, hjl.tools at gmail dot com, 2017/10/10