Skip to content

Commit e6cd7a3

Browse files
committed
Fix resolution of libs in LDCache on ARM
Since we explicitly check for the architecture of the libraries in the ldcache, we need to also check the architecture flag against the ARM constants. Signed-off-by: Evan Lezar <[email protected]>
1 parent de3d736 commit e6cd7a3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

internal/ldcache/ldcache.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ const (
4747
flagArchX8664 = 0x0300
4848
flagArchX32 = 0x0800
4949
flagArchPpc64le = 0x0500
50+
51+
// flagArch_ARM_LIBHF is the flag value for 32-bit ARM libs using hard-float.
52+
flagArch_ARM_LIBHF = 0x0900
53+
// flagArch_AARCH64_LIB64 is the flag value for 64-bit ARM libs.
54+
flagArch_AARCH64_LIB64 = 0x0a00
5055
)
5156

5257
var errInvalidCache = errors.New("invalid ld.so.cache file")
@@ -195,10 +200,14 @@ func (c *ldcache) getEntries() []entry {
195200
switch e.Flags & flagArchMask {
196201
case flagArchX8664:
197202
fallthrough
203+
case flagArch_AARCH64_LIB64:
204+
fallthrough
198205
case flagArchPpc64le:
199206
bits = 64
200207
case flagArchX32:
201208
fallthrough
209+
case flagArch_ARM_LIBHF:
210+
fallthrough
202211
case flagArchI386:
203212
bits = 32
204213
default:

0 commit comments

Comments
 (0)