1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:48:12 +00:00

LibELF: Handle DT_SONAME dynamic entries

Store the offset in the string table for the DT_SONAME entry. Now that
the build uses cmake, cmake is helpfully passing --Wl,-soname to the
linker for shared objects. This makes the LinkDemo run again.
This commit is contained in:
Andrew Kaster 2020-05-15 14:46:53 -06:00 committed by Andreas Kling
parent 3d153e5ed3
commit e5ad6a491e
2 changed files with 12 additions and 0 deletions

View file

@ -59,6 +59,9 @@ void DynamicObject::dump() const
return IterationDecision::Continue;
});
if (m_has_soname)
builder.appendf("DT_SONAME: %s\n", soname()); // FIXME: Valdidate that this string is null terminated?
dbgprintf("Dynamic section at address 0x%x contains %zu entries:\n", m_dynamic_address.as_ptr(), num_dynamic_sections);
dbgprintf(builder.to_string().characters());
}
@ -135,6 +138,10 @@ void DynamicObject::parse()
case DT_TEXTREL:
m_dt_flags |= DF_TEXTREL; // This tag seems to exist for legacy reasons only?
break;
case DT_SONAME:
m_soname_index = entry.val();
m_has_soname = true;
break;
default:
dbgprintf("DynamicObject: DYNAMIC tag handling not implemented for DT_%s\n", name_for_dtag(entry.tag()));
printf("DynamicObject: DYNAMIC tag handling not implemented for DT_%s\n", name_for_dtag(entry.tag()));