Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit adff278

Browse filesBrowse files
nodejs-github-bottargos
authored andcommitted
deps,test: update postject to 1.0.0-alpha.5
PR-URL: #46934 Fixes: nodejs/postject#76 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent acfd9b8 commit adff278
Copy full SHA for adff278

File tree

Expand file treeCollapse file tree

8 files changed

+56
-23
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

8 files changed

+56
-23
lines changed
Open diff view settings
Collapse file

‎deps/postject/postject-api.h‎

Copy file name to clipboardExpand all lines: deps/postject/postject-api.h
+16-4Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#elif defined(__linux__)
1313
#include <elf.h>
1414
#include <link.h>
15-
#include <sys/auxv.h>
1615
#include <sys/param.h>
1716
#elif defined(_WIN32)
1817
#include <windows.h>
@@ -44,6 +43,16 @@ static inline bool postject_has_resource() {
4443
return sentinel[sizeof(POSTJECT_SENTINEL_FUSE)] == '1';
4544
}
4645

46+
#if defined(__linux__)
47+
static int postject__dl_iterate_phdr_callback(struct dl_phdr_info* info,
48+
size_t size,
49+
void* data) {
50+
// Snag the dl_phdr_info struct for the main program, then stop iterating
51+
*((struct dl_phdr_info*)data) = *info;
52+
return 1;
53+
}
54+
#endif
55+
4756
static const void* postject_find_resource(
4857
const char* name,
4958
size_t* size,
@@ -114,9 +123,12 @@ static const void* postject_find_resource(
114123
name = options->elf_section_name;
115124
}
116125

117-
uintptr_t p = getauxval(AT_PHDR);
118-
size_t n = getauxval(AT_PHNUM);
119-
uintptr_t base_addr = p - sizeof(ElfW(Ehdr));
126+
struct dl_phdr_info main_program_info;
127+
dl_iterate_phdr(postject__dl_iterate_phdr_callback, &main_program_info);
128+
129+
uintptr_t p = (uintptr_t)main_program_info.dlpi_phdr;
130+
size_t n = main_program_info.dlpi_phnum;
131+
uintptr_t base_addr = main_program_info.dlpi_addr;
120132

121133
// iterate program header
122134
for (; n > 0; n--, p += sizeof(ElfW(Phdr))) {
Collapse file

‎test/fixtures/postject-copy/node_modules/.package-lock.json‎

Copy file name to clipboardExpand all lines: test/fixtures/postject-copy/node_modules/.package-lock.json
+3-3Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎test/fixtures/postject-copy/node_modules/postject/dist/api.js‎

Copy file name to clipboardExpand all lines: test/fixtures/postject-copy/node_modules/postject/dist/api.js
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎test/fixtures/postject-copy/node_modules/postject/dist/cli.js‎

Copy file name to clipboardExpand all lines: test/fixtures/postject-copy/node_modules/postject/dist/cli.js
+12-2Lines changed: 12 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎test/fixtures/postject-copy/node_modules/postject/dist/postject-api.h‎

Copy file name to clipboardExpand all lines: test/fixtures/postject-copy/node_modules/postject/dist/postject-api.h
+16-4Lines changed: 16 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎test/fixtures/postject-copy/node_modules/postject/package.json‎

Copy file name to clipboardExpand all lines: test/fixtures/postject-copy/node_modules/postject/package.json
+3-4Lines changed: 3 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎test/fixtures/postject-copy/package-lock.json‎

Copy file name to clipboardExpand all lines: test/fixtures/postject-copy/package-lock.json
+4-4Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎test/fixtures/postject-copy/package.json‎

Copy file name to clipboardExpand all lines: test/fixtures/postject-copy/package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"author": "",
1111
"license": "ISC",
1212
"dependencies": {
13-
"postject": "^1.0.0-alpha.4"
13+
"postject": "^1.0.0-alpha.5"
1414
}
1515
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.