diff options
author | Rich Felker <dalias@aerifal.cx> | 2023-11-06 21:48:02 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2023-11-06 21:48:02 -0500 |
commit | 039d3c34f2e3578a8b7ada42f89213b844aa7a4e (patch) | |
tree | ca5f6460bc374a8fc27c70d6f8ea473e7d741da2 /ldso/dynlink.c | |
parent | 7b6a6516e133a4154022de4d15b3d5bc800ab3ad (diff) | |
download | musl-039d3c34f2e3578a8b7ada42f89213b844aa7a4e.tar.gz |
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/dynlink.c')
-rw-r--r-- | ldso/dynlink.c | 10 |
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", |