File tree Expand file tree Collapse file tree
crates/brioche-autopack/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -439,13 +439,16 @@ fn autopack_kind(path: &Path) -> eyre::Result<Option<AutopackKind>> {
439439 return Ok ( None ) ;
440440 } ;
441441
442- // Only ET_EXEC and ET_DYN can potentially be packed
442+ // Only ET_EXEC and ET_DYN can potentially be packed.
443+ // Check if it's a library first. A shared library can
444+ // have an interpreter section and it should be packed
445+ // as SharedLibrary, not DynamicBinary.
443446 match elf_object. header . e_type {
444447 goblin:: elf:: header:: ET_EXEC | goblin:: elf:: header:: ET_DYN => {
445- if elf_object. interpreter . is_some ( ) {
446- Ok ( Some ( AutopackKind :: DynamicBinary ) )
447- } else if elf_object. is_lib {
448+ if elf_object. is_lib {
448449 Ok ( Some ( AutopackKind :: SharedLibrary ) )
450+ } else if elf_object. interpreter . is_some ( ) {
451+ Ok ( Some ( AutopackKind :: DynamicBinary ) )
449452 } else {
450453 Ok ( None )
451454 }
You can’t perform that action at this time.
0 commit comments