Page MenuHomeFreeBSD

Add support for rtld-elf on arm64
ClosedPublic

Authored by andrew on Mar 25 2015, 3:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jun 3 2024, 5:07 PM
Unknown Object (File)
May 24 2024, 9:20 PM
Unknown Object (File)
May 9 2024, 5:33 AM
Unknown Object (File)
May 9 2024, 5:32 AM
Unknown Object (File)
May 9 2024, 5:32 AM
Unknown Object (File)
Apr 26 2024, 6:25 PM
Unknown Object (File)
Apr 26 2024, 6:23 PM
Unknown Object (File)
Apr 26 2024, 6:23 PM
Subscribers

Details

Summary

This adds the MD parts of rtld for arm64.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

andrew retitled this revision from to Add support for rtld-elf on arm64.
andrew updated this object.
andrew edited the test plan for this revision. (Show Details)
andrew added reviewers: emaste, kib.
libexec/rtld-elf/aarch64/reloc.c
2 ↗(On Diff #4399)

How much of this was copied from Rui's work? It looks mostly
new.

202 ↗(On Diff #4399)

same alignment question.

206–207 ↗(On Diff #4399)

same alignment question.

210 ↗(On Diff #4399)

do you need to print out rela->r_info to help diagnose this in the future?

249 ↗(On Diff #4399)

Same alignment question as below.

251 ↗(On Diff #4399)

Above we handle a number of different types of relation in what looks to be the same list. Yet here we just punt. Do we need to handle the TLSDESC here too or no? If not, a comment about why might be useful.

265 ↗(On Diff #4399)

Why not return -1 or some other error indicator to show we need to implement this?

275 ↗(On Diff #4399)

why not return -1 or some error indicator that we'll need to implement this?

311 ↗(On Diff #4399)

why not return -1 here?

334 ↗(On Diff #4399)

Is the alignment of these two relocation types guaranteed to be sufficient we don't have to copy them?

349 ↗(On Diff #4399)

So all we do is check to see if this is not in the main program, and ignore it if it is? That seems strange.
However, looking above I see that it is handled specially there, so a pointer to that / comment here
would help.

352 ↗(On Diff #4399)

same alignment question.

Missing change?

--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -4351,8 +4351,7 @@ tls_get_addr_common(Elf_Addr **dtvp, int index, size_t offset)
        return (tls_get_addr_slow(dtvp, index, offset));
 }

-#if defined(__arm__) || defined(__aarch64__) || defined(__mips__) || \
-    defined(__powerpc__)
+#if defined(__arm__) || defined(__mips__) || defined(__powerpc__)

 /*
  * Allocate Static TLS using the Variant I method.
andrew edited edge metadata.
  • Defer symbol lookup, & fix a few issues found while adding this.
  • Use reloc_non_plt to relocate rtld
kib edited edge metadata.

It is somewhat pity that ifuncs are left out, but it is probably more important to get the initial port going.

libexec/rtld-elf/aarch64/reloc.c
148 ↗(On Diff #4519)

Shouldn't this situation also result in return (-1) ?

294 ↗(On Diff #4519)

The break is excessive.

311 ↗(On Diff #4519)

Remove the empy line.

This revision is now accepted and ready to land.Mar 31 2015, 12:15 AM
andrew updated this revision to Diff 4537.

Closed by commit rS280903 (authored by @andrew).