[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/27825] New: ld: -z unique-symbol behavior when .1 exists
From: |
i at maskray dot me |
Subject: |
[Bug ld/27825] New: ld: -z unique-symbol behavior when .1 exists |
Date: |
Tue, 04 May 2021 18:45:45 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=27825
Bug ID: 27825
Summary: ld: -z unique-symbol behavior when .1 exists
Product: binutils
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: i at maskray dot me
Target Milestone: ---
[Extracted from my reply to [PATCH v4 00/10] Function Granular KASLR in
January]
mkdir -p ./a
echo 'a: a.1: a.2: nop' > ./a/a.s
echo 'a: nop' > ./a/b.s
echo 'a: nop' > ./a/c.s
gcc -c a/a.s -o a/a.o
gcc -c a/b.s -o a/b.o
gcc -c a/c.s -o a/c.o
ld-new a/a.o a/b.o a/c.o -z unique-symbol
% readelf -Ws a.out
Symbol table '.symtab' contains 13 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 FILE LOCAL DEFAULT ABS a.o
2: 0000000000401000 0 NOTYPE LOCAL DEFAULT 2 a
3: 0000000000401000 0 NOTYPE LOCAL DEFAULT 2 a.1
4: 0000000000401000 0 NOTYPE LOCAL DEFAULT 2 a.2
5: 0000000000000000 0 FILE LOCAL DEFAULT ABS b.o
6: 0000000000401001 0 NOTYPE LOCAL DEFAULT 2 a.1
7: 0000000000000000 0 FILE LOCAL DEFAULT ABS c.o
8: 0000000000401002 0 NOTYPE LOCAL DEFAULT 2 a.2
9: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND _start
10: 0000000000402000 0 NOTYPE GLOBAL DEFAULT 2 __bss_start
11: 0000000000402000 0 NOTYPE GLOBAL DEFAULT 2 _edata
12: 0000000000402000 0 NOTYPE GLOBAL DEFAULT 2 _end
Note that there are multiple a.1 and a.2, which are probably not desired.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/27825] New: ld: -z unique-symbol behavior when .1 exists,
i at maskray dot me <=