Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 1 | From b0124f3c4f2a353506621d387135ebea6b8c6609 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Thu, 29 Oct 2020 22:40:53 -0700 |
| 4 | Subject: [PATCH] crt: Add .file directive |
| 5 | |
| 6 | Musl linked binaries come out to be not reproducible because |
| 7 | absolute build path is seen in debug info of crti.o and crtn.o |
| 8 | This is due to the fact that these objects are built from assembly |
| 9 | source files and they are missing .file directive |
| 10 | if we add .file <filename>.s in them then debug info encodes this |
| 11 | value instead of absolute path in debug_line section |
| 12 | |
| 13 | Upstream-Status: Pending |
| 14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 15 | --- |
| 16 | crt/aarch64/crti.s | 1 + |
| 17 | crt/aarch64/crtn.s | 1 + |
| 18 | crt/arm/crti.s | 1 + |
| 19 | crt/arm/crtn.s | 1 + |
| 20 | crt/i386/crti.s | 1 + |
| 21 | crt/i386/crtn.s | 1 + |
| 22 | crt/microblaze/crti.s | 1 + |
| 23 | crt/microblaze/crtn.s | 1 + |
| 24 | crt/mips/crti.s | 1 + |
| 25 | crt/mips/crtn.s | 1 + |
| 26 | crt/mips64/crti.s | 1 + |
| 27 | crt/mips64/crtn.s | 1 + |
| 28 | crt/mipsn32/crti.s | 1 + |
| 29 | crt/mipsn32/crtn.s | 1 + |
| 30 | crt/or1k/crti.s | 1 + |
| 31 | crt/or1k/crtn.s | 1 + |
| 32 | crt/powerpc/crti.s | 1 + |
| 33 | crt/powerpc/crtn.s | 1 + |
| 34 | crt/powerpc64/crti.s | 1 + |
| 35 | crt/powerpc64/crtn.s | 1 + |
| 36 | crt/s390x/crti.s | 1 + |
| 37 | crt/s390x/crtn.s | 1 + |
| 38 | crt/sh/crti.s | 1 + |
| 39 | crt/sh/crtn.s | 1 + |
| 40 | crt/x32/crti.s | 1 + |
| 41 | crt/x32/crtn.s | 1 + |
| 42 | crt/x86_64/crti.s | 1 + |
| 43 | crt/x86_64/crtn.s | 1 + |
| 44 | 28 files changed, 28 insertions(+) |
| 45 | |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 46 | diff --git a/crt/aarch64/crti.s b/crt/aarch64/crti.s |
| 47 | index 775df0ac..0f7c23a9 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 48 | --- a/crt/aarch64/crti.s |
| 49 | +++ b/crt/aarch64/crti.s |
| 50 | @@ -1,3 +1,4 @@ |
| 51 | +.file "crti.s" |
| 52 | .section .init |
| 53 | .global _init |
| 54 | .type _init,%function |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 55 | diff --git a/crt/aarch64/crtn.s b/crt/aarch64/crtn.s |
| 56 | index 73cab692..d62fc129 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 57 | --- a/crt/aarch64/crtn.s |
| 58 | +++ b/crt/aarch64/crtn.s |
| 59 | @@ -1,3 +1,4 @@ |
| 60 | +.file "crtn.s" |
| 61 | .section .init |
| 62 | ldp x29,x30,[sp],#16 |
| 63 | ret |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 64 | diff --git a/crt/arm/crti.s b/crt/arm/crti.s |
| 65 | index 18dc1e41..8df72979 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 66 | --- a/crt/arm/crti.s |
| 67 | +++ b/crt/arm/crti.s |
| 68 | @@ -1,3 +1,4 @@ |
| 69 | +.file "crti.s" |
| 70 | .syntax unified |
| 71 | |
| 72 | .section .init |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 73 | diff --git a/crt/arm/crtn.s b/crt/arm/crtn.s |
| 74 | index dc020f92..7451355b 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 75 | --- a/crt/arm/crtn.s |
| 76 | +++ b/crt/arm/crtn.s |
| 77 | @@ -1,3 +1,4 @@ |
| 78 | +.file "crtn.s" |
| 79 | .syntax unified |
| 80 | |
| 81 | .section .init |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 82 | diff --git a/crt/i386/crti.s b/crt/i386/crti.s |
| 83 | index d2682a20..2823fc3b 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 84 | --- a/crt/i386/crti.s |
| 85 | +++ b/crt/i386/crti.s |
| 86 | @@ -1,3 +1,4 @@ |
| 87 | +.file "crti.s" |
| 88 | .section .init |
| 89 | .global _init |
| 90 | _init: |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 91 | diff --git a/crt/i386/crtn.s b/crt/i386/crtn.s |
| 92 | index f3b61e01..04fb1646 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 93 | --- a/crt/i386/crtn.s |
| 94 | +++ b/crt/i386/crtn.s |
| 95 | @@ -1,3 +1,4 @@ |
| 96 | +.file "crtn.s" |
| 97 | .section .init |
| 98 | add $12,%esp |
| 99 | ret |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 100 | diff --git a/crt/microblaze/crti.s b/crt/microblaze/crti.s |
| 101 | index ed1c2fa4..29ee4733 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 102 | --- a/crt/microblaze/crti.s |
| 103 | +++ b/crt/microblaze/crti.s |
| 104 | @@ -1,3 +1,4 @@ |
| 105 | +.file "crti.s" |
| 106 | .section .init |
| 107 | .global _init |
| 108 | .align 2 |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 109 | diff --git a/crt/microblaze/crtn.s b/crt/microblaze/crtn.s |
| 110 | index 1e02c984..c2083749 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 111 | --- a/crt/microblaze/crtn.s |
| 112 | +++ b/crt/microblaze/crtn.s |
| 113 | @@ -1,3 +1,4 @@ |
| 114 | +.file "crtn.s" |
| 115 | .section .init |
| 116 | lwi r15, r1, 0 |
| 117 | rtsd r15, 8 |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 118 | diff --git a/crt/mips/crti.s b/crt/mips/crti.s |
| 119 | index 39dee380..0211764e 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 120 | --- a/crt/mips/crti.s |
| 121 | +++ b/crt/mips/crti.s |
| 122 | @@ -1,3 +1,4 @@ |
| 123 | +.file "crti.s" |
| 124 | .set noreorder |
| 125 | |
| 126 | .section .init |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 127 | diff --git a/crt/mips/crtn.s b/crt/mips/crtn.s |
| 128 | index 506a04b7..606490cf 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 129 | --- a/crt/mips/crtn.s |
| 130 | +++ b/crt/mips/crtn.s |
| 131 | @@ -1,3 +1,4 @@ |
| 132 | +.file "crtn.s" |
| 133 | .set noreorder |
| 134 | |
| 135 | .section .init |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 136 | diff --git a/crt/mips64/crti.s b/crt/mips64/crti.s |
| 137 | index c962dd09..f2c19cdd 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 138 | --- a/crt/mips64/crti.s |
| 139 | +++ b/crt/mips64/crti.s |
| 140 | @@ -1,3 +1,4 @@ |
| 141 | +.file "crti.s" |
| 142 | .set noreorder |
| 143 | |
| 144 | .section .init |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 145 | diff --git a/crt/mips64/crtn.s b/crt/mips64/crtn.s |
| 146 | index f3930b24..68903ffa 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 147 | --- a/crt/mips64/crtn.s |
| 148 | +++ b/crt/mips64/crtn.s |
| 149 | @@ -1,3 +1,4 @@ |
| 150 | +.file "crtn.s" |
| 151 | .set noreorder |
| 152 | |
| 153 | .section .init |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 154 | diff --git a/crt/mipsn32/crti.s b/crt/mipsn32/crti.s |
| 155 | index 14fa28d9..a35387d3 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 156 | --- a/crt/mipsn32/crti.s |
| 157 | +++ b/crt/mipsn32/crti.s |
| 158 | @@ -1,3 +1,4 @@ |
| 159 | +.file "crti.s" |
| 160 | .set noreorder |
| 161 | .section .init |
| 162 | .global _init |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 163 | diff --git a/crt/mipsn32/crtn.s b/crt/mipsn32/crtn.s |
| 164 | index dccd7e89..bdb6e561 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 165 | --- a/crt/mipsn32/crtn.s |
| 166 | +++ b/crt/mipsn32/crtn.s |
| 167 | @@ -1,3 +1,4 @@ |
| 168 | +.file "crtn.s" |
| 169 | .set noreorder |
| 170 | .section .init |
| 171 | ld $gp, 16($sp) |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 172 | diff --git a/crt/or1k/crti.s b/crt/or1k/crti.s |
| 173 | index 7e741459..919369ca 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 174 | --- a/crt/or1k/crti.s |
| 175 | +++ b/crt/or1k/crti.s |
| 176 | @@ -1,3 +1,4 @@ |
| 177 | +.file "crti.s" |
| 178 | .section .init |
| 179 | .global _init |
| 180 | _init: |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 181 | diff --git a/crt/or1k/crtn.s b/crt/or1k/crtn.s |
| 182 | index 4185a027..d670b327 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 183 | --- a/crt/or1k/crtn.s |
| 184 | +++ b/crt/or1k/crtn.s |
| 185 | @@ -1,3 +1,4 @@ |
| 186 | +.file "crtn.s" |
| 187 | .section .init |
| 188 | l.lwz r9,0(r1) |
| 189 | l.jr r9 |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 190 | diff --git a/crt/powerpc/crti.s b/crt/powerpc/crti.s |
| 191 | index 60461ca4..b748ca48 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 192 | --- a/crt/powerpc/crti.s |
| 193 | +++ b/crt/powerpc/crti.s |
| 194 | @@ -1,3 +1,4 @@ |
| 195 | +.file "crti.s" |
| 196 | .section .init |
| 197 | .align 2 |
| 198 | .global _init |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 199 | diff --git a/crt/powerpc/crtn.s b/crt/powerpc/crtn.s |
| 200 | index 2d14a6f0..d989e36f 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 201 | --- a/crt/powerpc/crtn.s |
| 202 | +++ b/crt/powerpc/crtn.s |
| 203 | @@ -1,3 +1,4 @@ |
| 204 | +.file "crtn.s" |
| 205 | .section .init |
| 206 | .align 2 |
| 207 | lwz 0,36(1) |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 208 | diff --git a/crt/powerpc64/crti.s b/crt/powerpc64/crti.s |
| 209 | index 9f712f0e..d3323a67 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 210 | --- a/crt/powerpc64/crti.s |
| 211 | +++ b/crt/powerpc64/crti.s |
| 212 | @@ -1,3 +1,4 @@ |
| 213 | +.file "crti.s" |
| 214 | .section .init |
| 215 | .align 2 |
| 216 | .global _init |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 217 | diff --git a/crt/powerpc64/crtn.s b/crt/powerpc64/crtn.s |
| 218 | index a7a9f4a0..5e71ae66 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 219 | --- a/crt/powerpc64/crtn.s |
| 220 | +++ b/crt/powerpc64/crtn.s |
| 221 | @@ -1,3 +1,4 @@ |
| 222 | +.file "crtn.s" |
| 223 | .section .init |
| 224 | .align 2 |
| 225 | addi 1, 1, 32 |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 226 | diff --git a/crt/s390x/crti.s b/crt/s390x/crti.s |
| 227 | index f453205b..3da3c5e1 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 228 | --- a/crt/s390x/crti.s |
| 229 | +++ b/crt/s390x/crti.s |
| 230 | @@ -1,3 +1,4 @@ |
| 231 | +.file "crti.s" |
| 232 | .section .init |
| 233 | .align 2 |
| 234 | .global _init |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 235 | diff --git a/crt/s390x/crtn.s b/crt/s390x/crtn.s |
| 236 | index 06066dc9..bfd55caf 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 237 | --- a/crt/s390x/crtn.s |
| 238 | +++ b/crt/s390x/crtn.s |
| 239 | @@ -1,3 +1,4 @@ |
| 240 | +.file "crtn.s" |
| 241 | .section .init |
| 242 | .align 2 |
| 243 | lmg %r14, %r15, 272(%r15) |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 244 | diff --git a/crt/sh/crti.s b/crt/sh/crti.s |
| 245 | index d99bfd5c..77d61c51 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 246 | --- a/crt/sh/crti.s |
| 247 | +++ b/crt/sh/crti.s |
| 248 | @@ -1,3 +1,4 @@ |
| 249 | +.file "crti.s" |
| 250 | .section .init |
| 251 | .global _init |
| 252 | .type _init, @function |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 253 | diff --git a/crt/sh/crtn.s b/crt/sh/crtn.s |
| 254 | index 958ce951..29deb5be 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 255 | --- a/crt/sh/crtn.s |
| 256 | +++ b/crt/sh/crtn.s |
| 257 | @@ -1,3 +1,4 @@ |
| 258 | +.file "crtn.s" |
| 259 | .section .init |
| 260 | lds.l @r15+, pr |
| 261 | mov.l @r15+, r14 |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 262 | diff --git a/crt/x32/crti.s b/crt/x32/crti.s |
| 263 | index 4788968b..8668b7c7 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 264 | --- a/crt/x32/crti.s |
| 265 | +++ b/crt/x32/crti.s |
| 266 | @@ -1,3 +1,4 @@ |
| 267 | +.file "crti.s" |
| 268 | .section .init |
| 269 | .global _init |
| 270 | _init: |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 271 | diff --git a/crt/x32/crtn.s b/crt/x32/crtn.s |
| 272 | index 29198b77..ef73d295 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 273 | --- a/crt/x32/crtn.s |
| 274 | +++ b/crt/x32/crtn.s |
| 275 | @@ -1,3 +1,4 @@ |
| 276 | +.file "crtn.s" |
| 277 | .section .init |
| 278 | pop %rax |
| 279 | ret |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 280 | diff --git a/crt/x86_64/crti.s b/crt/x86_64/crti.s |
| 281 | index 4788968b..8668b7c7 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 282 | --- a/crt/x86_64/crti.s |
| 283 | +++ b/crt/x86_64/crti.s |
| 284 | @@ -1,3 +1,4 @@ |
| 285 | +.file "crti.s" |
| 286 | .section .init |
| 287 | .global _init |
| 288 | _init: |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 289 | diff --git a/crt/x86_64/crtn.s b/crt/x86_64/crtn.s |
| 290 | index 29198b77..ef73d295 100644 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 291 | --- a/crt/x86_64/crtn.s |
| 292 | +++ b/crt/x86_64/crtn.s |
| 293 | @@ -1,3 +1,4 @@ |
| 294 | +.file "crtn.s" |
| 295 | .section .init |
| 296 | pop %rax |
| 297 | ret |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 298 | -- |
| 299 | 2.29.1 |
| 300 | |