Project

General

Profile

Feature #9819

update sys/elf.h for recent processors like aarch64/risc-v

Added by Robert Mustacchi about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Category:
lib - userland libraries
Start date:
2018-09-09
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

The sys/elf.h header hasn't been updated for some time. There are many newer machine constants and types that would be useful to have the system understand. This change updates the header based on the most recent edition of the SYS V GABI.


To test this I went through and used elfedit to change the e_machine value and used elfdump to print all the types and then compared the set values with sys/elf.h and the values that were present in the output. This importantly tests all the wholes in the regions. To do the tests I ran something to the effect of:

for i in $(seq 1 245); do elfedit -e "ehdr:e_machine $i" ./ld.so.1 ; elfdump -e ./ld.so.1 | grep e_machine; done
for i in $(seq 1 245); do elfedit -e "ehdr:e_machine $i" ./ld.so.1 ; file ./ld.so.1; done

History

#1

Updated by Electric Monk about 1 year ago

  • Status changed from New to Closed

git commit 856f620e96e5413932a6607aea5094db2ece172f

commit  856f620e96e5413932a6607aea5094db2ece172f
Author: Robert Mustacchi <rm@joyent.com>
Date:   2018-09-24T18:35:18.000Z

    9819 update sys/elf.h for recent processors like aarch64/risc-v
    Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
    Reviewed by: Richard Lowe <richlowe@richlowe.net>
    Reviewed by: Jake Saferstein <jake.saferstein@joyent.com>
    Reviewed by: Brad Walker <bwalker@musings.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF