-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix "symbol in discarded section" linker error for bpf probes
Summary: Fixes gnu ld linker error where the nop code point injected by a bpf probe was being discarded at linking time. The bpf probe would add reference from the .notes section to this discared func location and a "(...) defined in discarded section (...) referenced in section .note.stapsdt" error would occur. Previously tracked by github issue: (facebookincubator/fizz#84) Reviewed By: mingtaoy Differential Revision: D42998995 fbshipit-source-id: a2d1eb0c98823fc90b9886b98e7e5e671362af63
- Loading branch information
1 parent
0916970
commit 0ea2445
Showing
7 changed files
with
53 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <fizz/util/Tracing.h> | ||
#include <folly/tracing/StaticTracepoint.h> | ||
|
||
namespace fizz { | ||
extern "C" { | ||
void fizz_probe_secret_available( | ||
long unsigned int secretSize, | ||
unsigned char* secretData, | ||
fizz::KeyLogWriter::Label nssLabel, | ||
unsigned char* clientRandom) { | ||
FOLLY_SDT( | ||
fizz, | ||
fizz_secret_available, | ||
secretSize, | ||
secretData, | ||
nssLabel, | ||
clientRandom); | ||
} | ||
} | ||
|
||
} // namespace fizz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (c) 2023-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#pragma once | ||
#include <fizz/util/KeyLogWriter.h> | ||
|
||
namespace fizz { | ||
|
||
extern "C" { | ||
void fizz_probe_secret_available( | ||
long unsigned int secretSize, | ||
unsigned char* secretData, | ||
fizz::KeyLogWriter::Label nssLabel, | ||
unsigned char* clientRandom); | ||
} | ||
|
||
} // namespace fizz |