-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix make_elf
on systems with GNU ld 2.39+
#2141
Conversation
51e1506
to
708593e
Compare
Pylint is failing because the existing error ( |
d20ec6a
to
c611be9
Compare
Sorry for the commit/CI spam - I'm not able to reproduce the particular failiure locally |
914043a
to
c611be9
Compare
This appears to be a duplicate of #2098 |
c611be9
to
7025319
Compare
Since the author of that PR hasnt responded, I've applied @Diff-fusion's suggestion of checking the return code of |
Nice, this looks more robust now. The same ld version introduced a warning about executable stacks too, so maybe adding |
I didn't include that one here, as the release notes specify that the warning will not be issued if an executable stack is specifically requested ( We could add it unconditionally, but it's possible (while unlikely) some distros will compile with one flag but not the other. |
# https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob_plain;f=ld/NEWS;hb=refs/heads/binutils-2_39-branch | ||
proc = subprocess.run(ld + ["--no-warn-rwx-segments", "--help"], capture_output=True) | ||
if proc.returncode == 0: | ||
arguments.append("--no-warn-rwx-segments") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see the recommendation in #2140
Fixes #2140
GNU ld 2.39 introduces a new warning which is always invoked by
ELF.from_bytes
and similar functions.This PR detects affected versions of
ld
and adds an argument which ignores the warning.