https://sourceware.org/bugzilla/show_bug.cgi?id=34623
Bug ID: 34623
Summary: _init and _fini should be made local
Product: binutils
Version: 2.48 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: hjl.tools at gmail dot com
Target Milestone: ---
When _init and _fini are special functions provided to linker to define DT_INIT
and
DT_FINI in executable and shared library, they shouldn't be put in dynamic
symbol
table. But I got
[hjl@gnu-tgl-3 pr34585]$ cat crt.s
.section .fini,"ax",%progbits
.globl _fini
_fini:
.byte 4
.section .init,"ax",%progbits
.globl _init
_init:
.byte 4
.section .note.GNU-stack,"",%progbits
[hjl@gnu-tgl-3 pr34585]$ as -o crt.o crt.s
[hjl@gnu-tgl-3 pr34585]$
/export/build/gnu/tools-build/binutils/build-x86_64-linux/ld/ld-new -shared -o
libcrt.so crt.o
[hjl@gnu-tgl-3 pr34585]$ readelf --dyn-syms libcrt.so
Symbol table '.dynsym' contains 3 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000001000 0 NOTYPE GLOBAL DEFAULT 6 _init
2: 0000000000001001 0 NOTYPE GLOBAL DEFAULT 7 _fini
[hjl@gnu-tgl-3 pr34585]$
--
You are receiving this mail because:
You are on the CC list for the bug.