Commit graph

230 commits

Author SHA1 Message Date
David Tolnay
af144fa575 Update syn from 2.0.16 to 2.0.23
Summary: This supports new syntax added in the past months, including `c"..."` CStr literals.

Reviewed By: shayne-fletcher

Differential Revision: D47316927

fbshipit-source-id: ac0e514ca89dad282e64decd01d3a94b3bff8490
2023-07-08 14:32:40 -07:00
David Tolnay
1438ff0f2e Eliminate dependency on unmaintained node12-based action
Reviewed By: diliop

Differential Revision: D47220090

fbshipit-source-id: 0b69dcce8115db028d194746fb1fc4fa2d283ad4
2023-07-05 08:38:06 -07:00
generatedunixname89002005320047
0e08502b08 Migrate "hermetic_infra/reverie" from LLVM-12 to LLVM-15
Summary:
fbcode is migrating to LLVM-15 for safer and more up-to-date code and new compiler features. All contbuilds in your directory have passed our build test with LLVM-15, and your directory does not house any packages. This diff will migrate it to LLVM-15.

If you approve of this diff, please use the "Accept & Ship" button. If you have a blocker on building with LLVM 15, please comment on this diff. All fbcode directories will move to LLVM 15, so please start working on the fixes, testing and canary ASAP. If all tests are green, we will land this on Friday 06/23/2023.

See the [FAQ post](https://fb.workplace.com/groups/llvm15platform010/posts/749154386769776/)! Please also direct any questions to [this group](https://fb.workplace.com/groups/llvm15platform010).

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Build directives:

Reviewed By: palmje

Differential Revision: D46861414

fbshipit-source-id: 29e309e6ef24248aa49bbdd4491c3be23056411f
2023-06-28 21:17:08 -07:00
Shayne Fletcher
09a86f99f9 codemods to remove lazy static 1/N
Summary:
first in a set of diffs with the intent of removing `lazy_static!` from fbcode.

this diff changes `std::sync::Mutex` and `parking_lot::Mutex` to plain `static` initializations where possible.

Reviewed By: zertosh

Differential Revision: D46335784

fbshipit-source-id: 105848f38dcb8083be77a4ad4db267058081fe53
2023-06-05 17:01:50 -07:00
Shayne Fletcher
41880aaa0e upgrade to parking_lot-0.12.1
Summary: upgrade parking_lot from version 0.11.2 to version 0.12.1

Reviewed By: zertosh, diliop, dtolnay

Differential Revision: D46398501

fbshipit-source-id: ffae0ea188abad5253f1524216dd18ce9a53a74c
2023-06-02 18:45:03 -07:00
Pedro Rittner
e4e9b2e119 Upgrade rustls to 0.21 across all third party packages
Summary:
rustls 0.21.0 finally has support for IP addresses in certs.

Lots of other crates have (in)direct dependencies on rustls so I have to upgrade those too:

* hyper, reqwest, and auxiliary crates for those have been updated
* tonic has been updated and our local patch removed (since the relevant PR was merged upstream)

Reviewed By: zertosh

Differential Revision: D45989949

fbshipit-source-id: 658c11d29859d6d36368a412dab05e3c99313ee0
2023-05-19 12:39:46 -07:00
Andres Suarez
7dbdc85c58 update clap-3 and clap_complete-3
Summary: Update to latest versions.

Reviewed By: AndreasBackx

Differential Revision: D45947093

fbshipit-source-id: 64ac9ac86a3180e0de57b79408829ef920706c0c
2023-05-19 06:51:50 -07:00
Vladimir Makaev
0f9e04a7fd Update 'test-case' crate from 1.2 to 3.1
Summary: The version we're using is > 1 year old. I noticed the old version doesn't allow to override `assert_eq!` in a form of `use pretty_assertions::assert_eq`

Reviewed By: asm89

Differential Revision: D46010319

fbshipit-source-id: b48678e76fe907bdfbc6709ab438db992eb8d674
2023-05-19 03:09:21 -07:00
generatedunixname89002005287564
80b606d661 Daily common/rust/cargo_from_buck/bin/autocargo
Reviewed By: zertosh

Differential Revision: D45487289

fbshipit-source-id: d4a5f0f2ee4d10e8ee1c15ac34e7166945cd6aed
2023-05-02 09:19:48 -07:00
David Tolnay
e1a36ac27f Update tracing-subscriber from 0.3.16 to 0.3.17
Reviewed By: zertosh

Differential Revision: D45286804

fbshipit-source-id: bb49b1b850f150a865577411de6bb5a0d91b7a20
2023-04-25 15:59:50 -07:00
Sergey Anpilov
547ac07600 Update procfs version 0.9 to 0.10.1
Reviewed By: Imxset21

Differential Revision: D45231077

fbshipit-source-id: 9ff577c5a13e685793056bd782ac0be19f61f74b
2023-04-25 12:27:38 -07:00
Andres Suarez
859e996c28 Apply rustc fixes
Summary:
Basically `arc lint -e extra --take RUSTFIX --apply-patches` over all of
fbcode. Actually done with
`fbcode/common/rust/tools/rustfix2/scripts/rustfix_codemod`.

Some of these fixes don't actually convey the intent of the code, but I
am applying them anyway because they've been outstanding forever. This
diff actually fixes all machine fixable rustfix issues.

Manual changes:

- `fbcode/security/tools/sush2/src/lib/tw.rs` because the pattern match
  on a variable is not a thing. (There's a good Learning Rust question
  with a good answer on this)
- `fbcode/zippydb/lib/rust/rodos/lib.rs` needed the `#[cfg(test)]`,
  otherwise too many unused imports would be removed.

Reviewed By: dtolnay

Differential Revision: D44823936

fbshipit-source-id: 20a35e4977dc362f71b4f88b93b8c2b9a4a7c06a
2023-04-09 19:03:53 -07:00
Thomas Orozco
999c1698cf (reland) rust/third-party: update to futures 0.3.28
Summary:
Note: this is a re-land of D44623815, which was was reverted because of a land race with D44626072

In particular this fixes `FlattenUnordered` having a nasty deadlock, but also
some other  bugs:

```
# 0.3.28 - 2023-03-30

* Update to syn 2. This raises MSRV of utility crates to 1.56. (#2730, #2733)
* Fix bug in `FlattenUnordered` (#2726, #2728)

# 0.3.27 - 2023-03-11

* Add `TryFlattenUnordered` (#2577, #2590, #2606, #2607)
* Add `AbortHandle::is_aborted` (#2710)
* Add `AbortRegistration::handle` (#2712)
* Make `BiLock` strict-provenance compatible (#2716)

# 0.3.26 - 2023-01-30

* Add `Either::as_pin_mut` and `Either::as_pin_ref` (#2691)
* Add `Shared::ptr_eq` and `Shared::ptr_hash` (#2691)
* Implement `FusedStream` for `Buffered` (#2676)
* Implement `FusedStream` for all streams in `ReadyChunks` (#2693)
* Fix bug in `FuturesOrdered::push_front` (#2664)
* Remove `Fut::Output: Clone` bounds from some `Shared` methods (#2662)
* Remove `T: Debug` bounds from `Debug` implementations of `mpsc` and `oneshot` types (#2666, #2667)

# 0.3.25 - 2022-10-20

* Fix soundness issue in `join!` and `try_join!` macros (#2649)
* Implement `Clone` for `sink::Drain` (#2650)

# 0.3.24 - 2022-08-29

* Fix incorrect termination of `select_with_strategy` streams (#2635)

# 0.3.23 - 2022-08-14

* Work around MSRV increase due to a cargo bug.
```

Reviewed By: zertosh

Differential Revision: D44632588

fbshipit-source-id: bdd87cb02b3aef63a65b1f9b852579225adfedbd
2023-04-04 10:14:43 -07:00
Mark Isaacson
b2db0b2202 Revert D44623815: rust/third-party: update to futures 0.3.28
Differential Revision:
D44623815

Original commit changeset: 343ddb9277e1

Original Phabricator Diff: D44623815

fbshipit-source-id: 2d99e8d24fd9b13343dfeb082788b0a6258fbe8c
2023-04-03 09:25:13 -07:00
Thomas Orozco
ec3b8f6cc1 rust/third-party: update to futures 0.3.28
Summary:
In particular this fixes `FlattenUnordered` having a nasty deadlock, but also
some other  bugs:

```
# 0.3.28 - 2023-03-30

* Update to syn 2. This raises MSRV of utility crates to 1.56. (#2730, #2733)
* Fix bug in `FlattenUnordered` (#2726, #2728)

# 0.3.27 - 2023-03-11

* Add `TryFlattenUnordered` (#2577, #2590, #2606, #2607)
* Add `AbortHandle::is_aborted` (#2710)
* Add `AbortRegistration::handle` (#2712)
* Make `BiLock` strict-provenance compatible (#2716)

# 0.3.26 - 2023-01-30

* Add `Either::as_pin_mut` and `Either::as_pin_ref` (#2691)
* Add `Shared::ptr_eq` and `Shared::ptr_hash` (#2691)
* Implement `FusedStream` for `Buffered` (#2676)
* Implement `FusedStream` for all streams in `ReadyChunks` (#2693)
* Fix bug in `FuturesOrdered::push_front` (#2664)
* Remove `Fut::Output: Clone` bounds from some `Shared` methods (#2662)
* Remove `T: Debug` bounds from `Debug` implementations of `mpsc` and `oneshot` types (#2666, #2667)

# 0.3.25 - 2022-10-20

* Fix soundness issue in `join!` and `try_join!` macros (#2649)
* Implement `Clone` for `sink::Drain` (#2650)

# 0.3.24 - 2022-08-29

* Fix incorrect termination of `select_with_strategy` streams (#2635)

# 0.3.23 - 2022-08-14

* Work around MSRV increase due to a cargo bug.
```

Reviewed By: zertosh

Differential Revision: D44623815

fbshipit-source-id: 343ddb9277e1703104e516d07fe0610b5020930a
2023-04-03 08:30:49 -07:00
Andres Suarez
9e481229b3 Update tempfile from 3.4 to 3.5
Reviewed By: quark-zju

Differential Revision: D44524245

fbshipit-source-id: 167471d01b0afbbc34ced88574dbfb09799aadf6
2023-03-30 17:11:37 -07:00
Jason White
f1d651f422 Fix broken test perf::trace_other_thread
Summary:
Rust recently changed the default channel implementation, so maybe that's what triggered this failure.

This is a pretty brittle test. :/

Reviewed By: VladimirMakaev

Differential Revision: D44389514

fbshipit-source-id: 65ecc07edcab1aef99eb31dea2343d6ff4a92aa2
2023-03-25 16:12:24 -07:00
Jason White
c5786cf741 Open-source syscall scraper
Reviewed By: VladimirMakaev

Differential Revision: D44388612

fbshipit-source-id: baf5eb0a350e0c902874726689a0aacf6d585013
2023-03-25 16:12:24 -07:00
Jason White
e5e7a3a70e Delete traceviz
Reviewed By: VladimirMakaev

Differential Revision: D44387797

fbshipit-source-id: 158781fef9de3d707684bb3e79094df7b516473a
2023-03-25 16:12:24 -07:00
Jason White
8e716edec1 Publish no-std design doc
Summary: Trying to publish more of our docs and materials.

Reviewed By: VladimirMakaev

Differential Revision: D44387507

fbshipit-source-id: 32cd324db73483ec3f0dd7c2c1b0817f559fa958
2023-03-25 16:12:24 -07:00
Jason White
531faf7a34 Prepare safeptrace to be published as a crate
Summary:
* Adds a `README.md` file.
 * Adds optional features to enable memory access and the async API.

`safeptrace` depends on `reverie-process` and `reverie-memory`, so those will need to be published as crates too.

Reviewed By: VladimirMakaev

Differential Revision: D44386559

fbshipit-source-id: e74c55d5d26239aa09aedac130dca880eb5f1206
2023-03-25 16:12:24 -07:00
Jeremy Fitzhardinge
f51250f09c third-party/rust: update tempfile to 3.4
Summary:
Removes need for patch.

It had already been updated to 3.4 but this just formalizes it.

Reviewed By: jasonwhite

Differential Revision: D44274378

fbshipit-source-id: d17ecbbee06c7df30f689eb859fb31fdf07d8d44
2023-03-21 15:25:59 -07:00
Thomas Orozco
e7cdd0db8d third-party/rust: vendor a fork of perf-event
Summary:
For https://github.com/jimblandy/perf-event/pull/29 which sets CLOEXEC by
default.

Reviewed By: edward-shen

Differential Revision:
D43983384

Privacy Context Container: L1123788

fbshipit-source-id: 478c0e11bd815e916094b48ce7763b4dfc3e5f79
2023-03-15 10:34:47 -07:00
David Tolnay
b7afcb19bb Add support for clippy.toml configuration file
Summary: I am interested in running clippy under buck2 in CI for https://github.com/dtolnay/cxx, but I need it to be configured with `msrv = "..."` the same as my Cargo builds.

Reviewed By: diliop

Differential Revision: D43991741

fbshipit-source-id: c9a6a923651cebf5f24a48c6cd5daac0631cb763
2023-03-10 19:22:46 -08:00
Jeremy Fitzhardinge
d5cc9ef116 third-party/rust: remove memmap and migrate to memmap2
Summary:
`memmap` is unmaintained and hasn't been changed in over 4 years. `memmap2` is
a fork, which is regularly maintained.

Also bump dependency on `grep` as it removes the last third-party internal
reference to memmap.

Reviewed By: dtolnay

Differential Revision: D43486158

fbshipit-source-id: f763848bd295facf60ec601620afd68dfc655bea
2023-02-23 09:28:19 -08:00
Arun Thulasi
d51b9e8a1c Update libc-0.2.137 to libc-0.2.139
Reviewed By: zertosh

Differential Revision: D43203556

fbshipit-source-id: 460f339f603fec97f367967a20a4c6e7a81ad027
2023-02-12 16:30:00 -08:00
Zoltán Nagy
689731cb18 Upgrade Clap 3 to 3.2.23
Reviewed By: zertosh

Differential Revision: D43186409

fbshipit-source-id: 09583c5f6ff82c5cecf6263355c23c48ba6208f5
2023-02-10 09:18:20 -08:00
Andres Suarez
4dd84a499d Update tokio-1.21.2 to tokio-1.25.0
Reviewed By: diliop

Differential Revision: D42837228

fbshipit-source-id: 5e891cf1ff8ab1beff6e3c845b913144655778ea
2023-01-30 14:49:36 -08:00
Jason White
73dbb7dc41 Don't use include_str on the README
Summary:
This causes problems with creating a Nix package for Reverie since it is pulling the readme from a parent directory while nix is trying to isolate each package in the workspace.

Fixes https://github.com/facebookexperimental/reverie/issues/17.

Reviewed By: rrnewton

Differential Revision: D42466480

fbshipit-source-id: 8a7eef961a4477ca31b53c39cb72b57bad07f0ad
2023-01-20 10:19:06 -08:00
Richard Barnes
567988736d Remove unused variables in hermetic_infra/reverie/tests/c_tests/forkMany-blockSigchld.c
Summary:
LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.

This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: luciang

Differential Revision: D42465117

fbshipit-source-id: 64e7dec0eecaa4e3c50d4fea5ffd1c57cd8b58d7
2023-01-11 16:31:31 -08:00
Richard Barnes
894ce0fd86 Remove unused variables in hermetic_infra/reverie/tests/c_tests/forkMany.c
Summary:
LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.

This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: luciang

Differential Revision: D42465119

fbshipit-source-id: 02ad87bf0d56b6ced76912bd1d866a192dbbcbda
2023-01-11 16:27:54 -08:00
Jack Wrenn
346da4a53b Fix import in reverie_memory::LocalMemory::new doctest. (#18)
Summary:
When dba0b5b9b7 moved `LocalMemory` into the standalone `reverie-memory` crate, a doctest import was not updated.

Pull Request resolved: https://github.com/facebookexperimental/reverie/pull/18

Reviewed By: VladimirMakaev

Differential Revision: D42330995

Pulled By: jasonwhite

fbshipit-source-id: 54b4d6770a1b156f09f9feb014730dcec80f32c5
2023-01-09 10:08:24 -08:00
Jason White
dba0b5b9b7 Extract MemoryAccess into separate crate
Summary: This removes the need for `safeptrace` to depend on `reverie-syscalls`, which is a somewhat heavyweight library.

Reviewed By: VladimirMakaev

Differential Revision: D41751372

fbshipit-source-id: 36f601c7f441b070cd3a0678621649c4fb12b28e
2022-12-07 18:06:56 -08:00
Jason White
9515dfe3c2 Only compile for Linux
Summary:
Everything in Reverie is super Linux-specific, so we should just skip compilation if we're not targetting Linux.

This is helpful for consumers of the library when it gets published to crates.io. With this, they don't need to have a special case for this in the `[dependencies]` section of `Cargo.toml`.

Reviewed By: VladimirMakaev

Differential Revision: D41824410

fbshipit-source-id: be1e0a887e35ed151cfad27af8107246df30c2e5
2022-12-07 18:05:11 -08:00
Jason White
5590fdacb2 Remove unused dotslash files
Reviewed By: VladimirMakaev

Differential Revision: D41821643

fbshipit-source-id: 36dbd6c26c6986e8acb771b5825a1e09c2255340
2022-12-07 16:47:04 -08:00
Jason White
bcce15d17d safeptrace: Remove unnecessary copying of registers
Summary: Might lead to a minor speed up, but probably not due to the magic of compiler optimizations. I noticed this a while back and meant to fix it before publishing the `safeptrace` crate (so this won't be a breaking change later).

Reviewed By: VladimirMakaev

Differential Revision: D41699769

fbshipit-source-id: ef3e5f24468ddb4b69b8628e28b1da8cfdcbce7b
2022-12-07 07:38:13 -08:00
Ryan Newton
866529e6e8 refactor: move pedgree from reverie-util to detcore-model
Summary:
We want to use this in detcore, and reverie-util is slated to go away.
Detcore-model is meant to be widely depended on anyway, so this is a fine place for it.

Reviewed By: jasonwhite

Differential Revision: D41627508

fbshipit-source-id: bb477909217231d8fb6a7bafbfca1fb72a578ec2
2022-12-06 07:09:49 -08:00
Jason White
68cb6d5f3a Remove unused pedigree example
Summary: Removing this to remove another dependency on `reverie-util`, so we can eventually get rid of it.

Reviewed By: rrnewton

Differential Revision: D41629842

fbshipit-source-id: bf6d518db6e5ff9f4149936a7dabc0e912133886
2022-12-05 10:20:52 -08:00
Will Hughes
7ff30097d7 Demangle pretty stack frame by default
Summary:
We output the pretty backtrace as JSON, but demangling of symbol names only happens when a symbol is debug printed, which therefore doesn't apply to the JSON.

Instead, demangle pretty backtraces by default so this demangling applies to the output JSON

Reviewed By: jasonwhite

Differential Revision: D41687077

fbshipit-source-id: ee5919597a37664dfb8a66c4fdeda86379d024a9
2022-12-05 04:04:53 -08:00
Jason White
d9a2b94410 reverie-syscalls: Add io_uring support
Reviewed By: rrnewton

Differential Revision: D41699755

fbshipit-source-id: a16e262d5f66e7af373dea93e1e4bd349db4f841
2022-12-03 12:19:30 -08:00
Jason White
487f7b6d8b Add Guest::has_cpuid_interception
Summary: This is useful for knowing if we're able to intercept CPUID or not.

Reviewed By: rrnewton

Differential Revision: D41599743

fbshipit-source-id: 56b1ca16f028ad070ecdf4e8489b6e318e386e65
2022-11-30 11:14:39 -08:00
Will Hughes
6ac4e49ab3 Output structured report data instead of strings
Summary:
Currently the hermit analyze report json has:
1. Header, a string containing some text
2. A formatted stack trace as string for both events

Change this to a structured JSON report, with data only, so non-human consumers can decide how to render it.

Reviewed By: rrnewton

Differential Revision: D41523428

fbshipit-source-id: af689bfb04885775ed7cb60e103a3103da875849
2022-11-30 04:02:22 -08:00
Jason White
5995e04dde reverie-syscalls: Fix Sendfile missing from aarch64
Summary: `sendfile` is available on aarch64, so this was a mistake.

Differential Revision: D41590782

fbshipit-source-id: 6e704bc0c3358c232768a5382c7b5435445c3976
2022-11-29 15:58:23 -08:00
Jason White
495ffad867 Fix README commands being treated as Rust code
Summary:
Fixes the following errors:
```
---- src/lib.rs - (line 55) stdout ----
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `apt`
 --> src/lib.rs:56:6
  |
3 | sudo apt install pkg-config libunwind-devel
  |      ^^^ expected one of 8 possible tokens

error: aborting due to previous error

Couldn't compile the test.
---- src/lib.rs - (line 61) stdout ----
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `test`
 --> src/lib.rs:62:7
  |
3 | cargo test -- --test-threads=1
  |       ^^^^ expected one of 8 possible tokens

error: aborting due to previous error

Couldn't compile the test.
---- src/lib.rs - (line 66) stdout ----
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `reverie`
 --> src/lib.rs:67:4
  |
4 | cd reverie-examples
  |    ^^^^^^^ expected one of 8 possible tokens

error: aborting due to previous error
```

Reviewed By: rrnewton

Differential Revision: D41588323

fbshipit-source-id: 46d55e81f741ac3b36a25e21291b00849600b7f1
2022-11-29 15:56:13 -08:00
Jason White
7b7c638449 Fix broken doc links
Summary: Fixes broken doc links so that `cargo doc` succeeds again.

Reviewed By: rrnewton

Differential Revision: D41588324

fbshipit-source-id: ed539bef5ea2a91562ec7d03a756ea4cc3f9000a
2022-11-29 13:53:16 -08:00
Jason White
0037ec860d Remove usage of 'never_type' nightly feature
Summary: It doesn't look like the never type is going to be stabilized anytime soon, so lets just use the `never-say-never` crate instead.

Reviewed By: dtolnay

Differential Revision: D41459064

fbshipit-source-id: 6bc82377242b31171251b2393a534f76c7f3d97a
2022-11-29 12:40:44 -08:00
Jason White
8058dd4803 reverie-process: Fix remaining unnecessary usage of unsafe
Summary: Missed these in a previous diff.

Reviewed By: rrnewton

Differential Revision: D41567346

fbshipit-source-id: eba0b738a66da1823312803ed91fdc5eeaf90c57
2022-11-29 08:26:39 -08:00
Jason White
42a87f915e Add retries to early syscall injection
Summary: Our early injected syscalls could get interrupted by a signal (like `SIGWINCH`), so we should always be sure to retry them.

Reviewed By: rrnewton

Differential Revision: D41568242

fbshipit-source-id: e3026bd162619795e776198b7bf05d3e33753c05
2022-11-29 08:26:39 -08:00
Jason White
ab518fb892 Handle CPUID faulting failures gracefully
Summary: We inject a call to `arch_prctl(ARCH_SET_CPUID, 0)` to enable faulting on CPUID. This isn't supported on virtual machines, so we should gracefully handle any errors.

Reviewed By: rrnewton

Differential Revision: D41567919

fbshipit-source-id: 9623f2852d9b2e8cad0de447214c798c5b9dcb0b
2022-11-29 04:04:22 -08:00
Jason White
5478e47a25 Fix VDSO patching of small entries
Summary:
On Ubuntu 22.04, this is the disassembly of `gettimeofday` and `clock_gettime`:
```
0000000000000bd0 <__vdso_gettimeofday@LINUX_2.6>:
 bd0:   e9 4b fe ff ff          jmp    a20 <LINUX_2.6@LINUX_2.6+0xa20>
 bd5:   66 66 2e 0f 1f 84 00    data16 cs nopw 0x0(%rax,%rax,1)
 bdc:   00 00 00 00

0000000000000c10 <__vdso_clock_gettime@LINUX_2.6>:
 c10:   e9 9b fb ff ff          jmp    7b0 <LINUX_2.6@LINUX_2.6+0x7b0>
 c15:   66 66 2e 0f 1f 84 00    data16 cs nopw 0x0(%rax,%rax,1)
 c1c:   00 00 00 00
```

These implementations just `jmp` to another internal function. The dynamic symbol table reports that these functions are 5 bytes in size, but we can see that they are aligned up to 16 bytes and they are still safe to patch. Thus, our patcher should take this padding and alignment into account.

Fixes https://github.com/facebookexperimental/hermit/issues/16.

Differential Revision: D41565913

fbshipit-source-id: 164aca876abf92642e7ebf4ce96d0860b276647b
2022-11-28 16:28:02 -08:00