Page MenuHomeFreeBSD

elfctl: avoid touching file if no change
ClosedPublic

Authored by emaste on May 25 2021, 2:45 PM.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

emaste created this revision.
markj added inline comments.
usr.bin/elfctl/elfctl.c
314

I am surprised that we do not use libelf to write the update.

This revision is now accepted and ready to land.May 25 2021, 3:11 PM
usr.bin/elfctl/elfctl.c
314

I am surprised that we do not use libelf to write the update.

Yeah, we could; libelf doesn't really provide much in the way of convenience functions for accessing or modifying individual notes, but we could operate on the note section in memory and use libelf to write it back out.

I briefly considered the possibility that there might want to be some sort of force flag, but I don't see a lot of value.

This revision was automatically updated to reflect the committed changes.

I briefly considered the possibility that there might want to be some sort of force flag, but I don't see a lot of value.

Yeah, I gave that some brief thought too, and couldn't see a real use.