blob: 2874fb5815e44621ae1ec428f2339ce0631e690b [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001From 649bfb399265eb48a9fe8db1c2b5a31633c55152 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 29 Nov 2018 17:29:35 -0800
4Subject: [PATCH 29/30] inject file assembly directives
5
6Currently, non-IA builds are not reproducibile since build paths are
7being injected into the debug symbols. These are coming from the use of
8.S assembler files during the glibc build. No STT_FILE section is added
9during the assembly but when linking, ld decides to add one to aid
10debugging and ensure references between the different object files its
11linking remain clear.
12
13We can avoid this by injecting a file header into the assembler files
14ahead of time, choosing a filename which does not contain build system
15paths.
16
17This is a bit of a workaround/hack but does significantly reduce the
18build system references in target binaries for the non-IA architectures
19which use .S files.
20
21RP
222018/10/3
23
24Upstream-Status: Pending
25
26Signed-off-by: Khem Raj <raj.khem@gmail.com>
27---
28 csu/abi-note.S | 2 ++
29 sysdeps/aarch64/crti.S | 2 ++
30 sysdeps/aarch64/crtn.S | 2 ++
31 sysdeps/aarch64/dl-tlsdesc.S | 2 ++
32 sysdeps/aarch64/dl-trampoline.S | 2 ++
33 sysdeps/aarch64/start.S | 2 ++
34 sysdeps/arm/abi-note.S | 2 ++
35 sysdeps/arm/crti.S | 2 ++
36 sysdeps/arm/crtn.S | 2 ++
37 sysdeps/arm/dl-tlsdesc.S | 2 ++
38 sysdeps/arm/dl-trampoline.S | 2 ++
39 sysdeps/arm/start.S | 2 ++
40 sysdeps/mips/start.S | 2 ++
41 sysdeps/powerpc/powerpc32/dl-start.S | 2 ++
42 sysdeps/powerpc/powerpc32/start.S | 2 ++
43 sysdeps/powerpc/powerpc64/start.S | 2 ++
44 sysdeps/unix/sysv/linux/aarch64/__read_tp.S | 2 ++
45 sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S | 2 ++
46 sysdeps/unix/sysv/linux/arm/libc-do-syscall.S | 2 ++
47 sysdeps/unix/sysv/linux/powerpc/dl-brk.S | 2 ++
48 20 files changed, 40 insertions(+)
49
50diff --git a/csu/abi-note.S b/csu/abi-note.S
51index fa1f014a88..098731362a 100644
52--- a/csu/abi-note.S
53+++ b/csu/abi-note.S
54@@ -56,6 +56,8 @@ offset length contents
55 #include <config.h>
56 #include <abi-tag.h> /* OS-specific ABI tag value */
57
58+ .file "abi-note.S"
59+
60 /* The linker (GNU ld 2.8 and later) recognizes an allocated section whose
61 name begins with `.note' and creates a PT_NOTE program header entry
62 pointing at it. */
63diff --git a/sysdeps/aarch64/crti.S b/sysdeps/aarch64/crti.S
64index d4e7dfcf5c..e0218df30c 100644
65--- a/sysdeps/aarch64/crti.S
66+++ b/sysdeps/aarch64/crti.S
67@@ -50,6 +50,8 @@
68 # define PREINIT_FUNCTION_WEAK 1
69 #endif
70
71+ .file "crti.S"
72+
73 #if PREINIT_FUNCTION_WEAK
74 weak_extern (PREINIT_FUNCTION)
75 #else
76diff --git a/sysdeps/aarch64/crtn.S b/sysdeps/aarch64/crtn.S
77index 363f752460..2fb06fba62 100644
78--- a/sysdeps/aarch64/crtn.S
79+++ b/sysdeps/aarch64/crtn.S
80@@ -37,6 +37,8 @@
81 /* crtn.S puts function epilogues in the .init and .fini sections
82 corresponding to the prologues in crti.S. */
83
84+ .file "crtn.S"
85+
86 .section .init,"ax",%progbits
87 ldp x29, x30, [sp], 16
88 RET
89diff --git a/sysdeps/aarch64/dl-tlsdesc.S b/sysdeps/aarch64/dl-tlsdesc.S
90index 4abe6b82a3..8c44b2ff8a 100644
91--- a/sysdeps/aarch64/dl-tlsdesc.S
92+++ b/sysdeps/aarch64/dl-tlsdesc.S
93@@ -22,6 +22,8 @@
94 #include <tls.h>
95 #include "tlsdesc.h"
96
97+ .file "dl-tlsdesc.S"
98+
99 #define NSAVEDQREGPAIRS 16
100 #define SAVE_Q_REGISTERS \
101 stp q0, q1, [sp, #-32*NSAVEDQREGPAIRS]!; \
102diff --git a/sysdeps/aarch64/dl-trampoline.S b/sysdeps/aarch64/dl-trampoline.S
103index 19b117e8f9..38c78b5409 100644
104--- a/sysdeps/aarch64/dl-trampoline.S
105+++ b/sysdeps/aarch64/dl-trampoline.S
106@@ -21,6 +21,8 @@
107
108 #include "dl-link.h"
109
110+ .file "dl-trampoline.S"
111+
112 #define ip0 x16
113 #define ip0l PTR_REG (16)
114 #define ip1 x17
115diff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S
116index f5e9b9c223..ae3e22a6a5 100644
117--- a/sysdeps/aarch64/start.S
118+++ b/sysdeps/aarch64/start.S
119@@ -18,6 +18,8 @@
120
121 #include <sysdep.h>
122
123+ .file "start.S"
124+
125 /* This is the canonical entry point, usually the first thing in the text
126 segment.
127
128diff --git a/sysdeps/arm/abi-note.S b/sysdeps/arm/abi-note.S
129index 07bd4c4619..7213b16f27 100644
130--- a/sysdeps/arm/abi-note.S
131+++ b/sysdeps/arm/abi-note.S
132@@ -1,3 +1,5 @@
133+ .file "abi-note.S"
134+
135 /* Tag_ABI_align8_preserved: This code preserves 8-byte
136 alignment in any callee. */
137 .eabi_attribute 25, 1
138diff --git a/sysdeps/arm/crti.S b/sysdeps/arm/crti.S
139index 26dbba66a3..dd84ecd566 100644
140--- a/sysdeps/arm/crti.S
141+++ b/sysdeps/arm/crti.S
142@@ -57,6 +57,8 @@
143 .hidden PREINIT_FUNCTION
144 #endif
145
146+ .file "crti.S"
147+
148 #if PREINIT_FUNCTION_WEAK
149 .p2align 2
150 .type call_weak_fn, %function
151diff --git a/sysdeps/arm/crtn.S b/sysdeps/arm/crtn.S
152index 8f91c8d88b..a87fe49e07 100644
153--- a/sysdeps/arm/crtn.S
154+++ b/sysdeps/arm/crtn.S
155@@ -37,6 +37,8 @@
156 #define NO_THUMB
157 #include <sysdep.h>
158
159+ .file "crtn.S"
160+
161 /* crtn.S puts function epilogues in the .init and .fini sections
162 corresponding to the prologues in crti.S. */
163
164diff --git a/sysdeps/arm/dl-tlsdesc.S b/sysdeps/arm/dl-tlsdesc.S
165index a929340b42..b724c9776d 100644
166--- a/sysdeps/arm/dl-tlsdesc.S
167+++ b/sysdeps/arm/dl-tlsdesc.S
168@@ -21,6 +21,8 @@
169 #include <tls.h>
170 #include "tlsdesc.h"
171
172+ .file "dl-tlsdesc.S"
173+
174 .text
175 @ emit debug information with cfi
176 @ use arm-specific pseudos for unwinding itself
177diff --git a/sysdeps/arm/dl-trampoline.S b/sysdeps/arm/dl-trampoline.S
178index 325cfcd2ce..4bfdcbce51 100644
179--- a/sysdeps/arm/dl-trampoline.S
180+++ b/sysdeps/arm/dl-trampoline.S
181@@ -21,6 +21,8 @@
182 #include <sysdep.h>
183 #include <libc-symbols.h>
184
185+ .file "dl-trampoline.S"
186+
187 .text
188 .globl _dl_runtime_resolve
189 .type _dl_runtime_resolve, #function
190diff --git a/sysdeps/arm/start.S b/sysdeps/arm/start.S
191index a05f8a4651..2f4374fcaa 100644
192--- a/sysdeps/arm/start.S
193+++ b/sysdeps/arm/start.S
194@@ -57,6 +57,8 @@
195 NULL
196 */
197
198+ .file "start.S"
199+
200 /* Tag_ABI_align8_preserved: This code preserves 8-byte
201 alignment in any callee. */
202 .eabi_attribute 25, 1
203diff --git a/sysdeps/mips/start.S b/sysdeps/mips/start.S
204index 8638e5b545..93f6564aec 100644
205--- a/sysdeps/mips/start.S
206+++ b/sysdeps/mips/start.S
207@@ -38,6 +38,8 @@
208 #include <sgidefs.h>
209 #include <sys/asm.h>
210
211+ .file "start.S"
212+
213 #ifndef ENTRY_POINT
214 #error ENTRY_POINT needs to be defined for start.S on MIPS/ELF.
215 #endif
216diff --git a/sysdeps/powerpc/powerpc32/dl-start.S b/sysdeps/powerpc/powerpc32/dl-start.S
217index 99a10d643a..e47fc0d245 100644
218--- a/sysdeps/powerpc/powerpc32/dl-start.S
219+++ b/sysdeps/powerpc/powerpc32/dl-start.S
220@@ -18,6 +18,8 @@
221
222 #include <sysdep.h>
223
224+ .file "dl-start.S"
225+
226 /* Initial entry point code for the dynamic linker.
227 The C function `_dl_start' is the real entry point;
228 its return value is the user program's entry point. */
229diff --git a/sysdeps/powerpc/powerpc32/start.S b/sysdeps/powerpc/powerpc32/start.S
230index 172fb5a56b..ef1471b861 100644
231--- a/sysdeps/powerpc/powerpc32/start.S
232+++ b/sysdeps/powerpc/powerpc32/start.S
233@@ -35,6 +35,8 @@
234
235 #include <sysdep.h>
236
237+ .file "start.S"
238+
239 /* We do not want .eh_frame info for crt1.o since crt1.o is linked
240 before crtbegin.o, the file defining __EH_FRAME_BEGIN__. */
241 #undef cfi_startproc
242diff --git a/sysdeps/powerpc/powerpc64/start.S b/sysdeps/powerpc/powerpc64/start.S
243index 55fae68ad6..0cb608fe0f 100644
244--- a/sysdeps/powerpc/powerpc64/start.S
245+++ b/sysdeps/powerpc/powerpc64/start.S
246@@ -35,6 +35,8 @@
247
248 #include <sysdep.h>
249
250+ .file "start.S"
251+
252 /* We do not want .eh_frame info for crt1.o since crt1.o is linked
253 before crtbegin.o, the file defining __EH_FRAME_BEGIN__. */
254 #undef cfi_startproc
255diff --git a/sysdeps/unix/sysv/linux/aarch64/__read_tp.S b/sysdeps/unix/sysv/linux/aarch64/__read_tp.S
256index 30a29b9fb0..07892b383f 100644
257--- a/sysdeps/unix/sysv/linux/aarch64/__read_tp.S
258+++ b/sysdeps/unix/sysv/linux/aarch64/__read_tp.S
259@@ -18,6 +18,8 @@
260
261 #include <sysdep.h>
262
263+ .file "__read_tp.S"
264+
265 .hidden __read_tp
266 ENTRY (__read_tp)
267 mrs x0, tpidr_el0
268diff --git a/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S b/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S
269index f64c4ffe8a..2da315ab08 100644
270--- a/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S
271+++ b/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S
272@@ -39,6 +39,8 @@
273 a normal function call) in a high page of memory; tail call to the
274 helper. */
275
276+ .file "aeabi_read_tp.S"
277+
278 .hidden __aeabi_read_tp
279 ENTRY (__aeabi_read_tp)
280 #ifdef ARCH_HAS_HARD_TP
281diff --git a/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S b/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S
282index 0b6237ac55..8cda491c28 100644
283--- a/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S
284+++ b/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S
285@@ -27,6 +27,8 @@
286 ARM unwind tables for register to register moves, the actual opcodes
287 are not defined. */
288
289+ .file "libc-do-syscall.S"
290+
291 #if defined(__thumb__)
292 .thumb
293 .syntax unified
294diff --git a/sysdeps/unix/sysv/linux/powerpc/dl-brk.S b/sysdeps/unix/sysv/linux/powerpc/dl-brk.S
295index eeb96544e3..da182b28f8 100644
296--- a/sysdeps/unix/sysv/linux/powerpc/dl-brk.S
297+++ b/sysdeps/unix/sysv/linux/powerpc/dl-brk.S
298@@ -1 +1,3 @@
299+ .file "dl-brk.S"
300+
301 #include <brk.S>
302--
3032.20.1
304