about summary refs log tree commit diff
path: root/ldso
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2023-11-06 21:48:02 -0500
committerRich Felker <dalias@aerifal.cx>2023-11-06 21:48:02 -0500
commit039d3c34f2e3578a8b7ada42f89213b844aa7a4e (patch)
treeca5f6460bc374a8fc27c70d6f8ea473e7d741da2 /ldso
parent7b6a6516e133a4154022de4d15b3d5bc800ab3ad (diff)
downloadmusl-039d3c34f2e3578a8b7ada42f89213b844aa7a4e.tar.gz
musl-039d3c34f2e3578a8b7ada42f89213b844aa7a4e.tar.xz
musl-039d3c34f2e3578a8b7ada42f89213b844aa7a4e.zip
ldso: convert TLSDESC_BACKWARDS from "#ifdef" to "if" logic
this style is preferred because it allows the code to be
compile-checked even on archs where it is not used.
Diffstat (limited to 'ldso')
-rw-r--r--ldso/dynlink.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ldso/dynlink.c b/ldso/dynlink.c
index bb02cd3c..6ba51b0a 100644
--- a/ldso/dynlink.c
+++ b/ldso/dynlink.c
@@ -542,13 +542,13 @@ static void do_relocs(struct dso *dso, size_t *rel, size_t rel_size, size_t stri
 					+ addend;
 #endif
 			}
-#ifdef TLSDESC_BACKWARDS
 			/* Some archs (32-bit ARM at least) invert the order of
 			 * the descriptor members. Fix them up here. */
-			size_t tmp = reloc_addr[0];
-			reloc_addr[0] = reloc_addr[1];
-			reloc_addr[1] = tmp;
-#endif
+			if (TLSDESC_BACKWARDS) {
+				size_t tmp = reloc_addr[0];
+				reloc_addr[0] = reloc_addr[1];
+				reloc_addr[1] = tmp;
+			}
 			break;
 		default:
 			error("Error relocating %s: unsupported relocation type %d",