[Bug ld/31795] ld.bfd makes ELFs of type ET_EXEC for static PIEs when load address is non-0

2024-05-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31795 H.J. Lu changed: What|Removed |Added CC||hjl.tools at gmail dot com --- Comment #1 f

[Bug ld/31795] ld.bfd makes ELFs of type ET_EXEC for static PIEs when load address is non-0

2024-05-25 Thread mintsuki at protonmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31795 --- Comment #2 from mintsuki --- (In reply to H.J. Lu from comment #1) > It is done to ensure that PIE is loaded at the specific address which may > be required for functional, performance or security purposes. This does not match what all th

[Bug ld/31795] ld.bfd makes ELFs of type ET_EXEC for static PIEs when load address is non-0

2024-05-25 Thread mintsuki at protonmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31795 --- Comment #3 from mintsuki --- Also, when generating a shared object with -shared, without -pie, having a non-0 base address does not affect the ELF file type, which is always ET_DYN. If what you just said is true, then why is this the behav

[Bug ld/31795] ld.bfd makes ELFs of type ET_EXEC for static PIEs when load address is non-0

2024-05-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31795 --- Comment #4 from H.J. Lu --- (In reply to mintsuki from comment #2) > (In reply to H.J. Lu from comment #1) > > It is done to ensure that PIE is loaded at the specific address which may > > be required for functional, performance or securit

[Bug ld/31795] ld.bfd makes ELFs of type ET_EXEC for static PIEs when load address is non-0

2024-05-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31795 --- Comment #5 from H.J. Lu --- (In reply to mintsuki from comment #3) > Also, when generating a shared object with -shared, without -pie, having a > non-0 base address does not affect the ELF file type, which is always You can't load the mul

[Bug ld/31795] ld.bfd makes ELFs of type ET_EXEC for static PIEs when load address is non-0

2024-05-25 Thread mintsuki at protonmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31795 --- Comment #6 from mintsuki --- (In reply to H.J. Lu from comment #4) > (In reply to mintsuki from comment #2) > > (In reply to H.J. Lu from comment #1) > > > It is done to ensure that PIE is loaded at the specific address which may > > > be

[Bug ld/31795] ld.bfd makes ELFs of type ET_EXEC for static PIEs when load address is non-0

2024-05-25 Thread mintsuki at protonmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31795 --- Comment #7 from mintsuki --- (In reply to H.J. Lu from comment #5) > (In reply to mintsuki from comment #3) > > Also, when generating a shared object with -shared, without -pie, having a > > non-0 base address does not affect the ELF file

[Bug ld/31795] ld.bfd makes ELFs of type ET_EXEC for static PIEs when load address is non-0

2024-05-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31795 --- Comment #8 from H.J. Lu --- (In reply to mintsuki from comment #7) > (In reply to H.J. Lu from comment #5) > > (In reply to mintsuki from comment #3) > > > Also, when generating a shared object with -shared, without -pie, having a > > > no

[Bug ld/31795] ld.bfd makes ELFs of type ET_EXEC for static PIEs when load address is non-0

2024-05-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31795 --- Comment #9 from H.J. Lu --- (In reply to mintsuki from comment #6) > (In reply to H.J. Lu from comment #4) > > (In reply to mintsuki from comment #2) > > > (In reply to H.J. Lu from comment #1) > > > > It is done to ensure that PIE is load

[Bug ld/31795] ld.bfd makes ELFs of type ET_EXEC for static PIEs when load address is non-0

2024-05-25 Thread mintsuki at protonmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31795 --- Comment #10 from mintsuki --- (In reply to H.J. Lu from comment #8) > (In reply to mintsuki from comment #7) > > (In reply to H.J. Lu from comment #5) > > > (In reply to mintsuki from comment #3) > > > > Also, when generating a shared obje

[Bug ld/31795] ld.bfd makes ELFs of type ET_EXEC for static PIEs when load address is non-0

2024-05-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31795 --- Comment #11 from H.J. Lu --- (In reply to mintsuki from comment #10) > If this is policy, then I believe it should be properly documented Updating document won't solve your debugging issue. Why does GDB have no issues with PIE in user s

[Bug ld/31795] ld.bfd makes ELFs of type ET_EXEC for static PIEs when load address is non-0

2024-05-25 Thread mintsuki at protonmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31795 --- Comment #12 from mintsuki --- (In reply to H.J. Lu from comment #11) > (In reply to mintsuki from comment #10) > > > If this is policy, then I believe it should be properly documented > > Updating document won't solve your debugging issu

[Bug ld/31795] ld.bfd makes ELFs of type ET_EXEC for static PIEs when load address is non-0

2024-05-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31795 H.J. Lu changed: What|Removed |Added Ever confirmed|0 |1 Last reconfirmed|

[Bug ld/31795] ld.bfd makes ELFs of type ET_EXEC for static PIEs when load address is non-0

2024-05-25 Thread mintsuki at protonmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31795 --- Comment #14 from mintsuki --- (In reply to H.J. Lu from comment #13) > Does PIE with zero load address cause any real problems for you? Why not just answer the question? Whether it causes real problems for me or not should be irrelevant t

[Bug ld/31795] ld.bfd makes ELFs of type ET_EXEC for static PIEs when load address is non-0

2024-05-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31795 --- Comment #15 from H.J. Lu --- Here is the original discussion: https://lore.kernel.org/all/came9roojvfj-r3zbwpecpiulfcdrxprpayzcammxf3k7014...@mail.gmail.com/T/#m2cfa035c82e32ca865ec0f1c352b14470dcc7f39 -- You are receiving this mail bec

[Bug ld/31795] ld.bfd makes ELFs of type ET_EXEC for static PIEs when load address is non-0

2024-05-25 Thread mintsuki at protonmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31795 --- Comment #16 from mintsuki --- (In reply to H.J. Lu from comment #15) > Here is the original discussion: > > https://lore.kernel.org/all/CAMe9rOoJvfJ- > r3zbwpecpiulfcdrxprpayzcammxf3k7014...@mail.gmail.com/T/ > #m2cfa035c82e32ca865ec0f1c3

[Bug ld/31795] ld.bfd makes ELFs of type ET_EXEC for static PIEs when load address is non-0

2024-05-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31795 H.J. Lu changed: What|Removed |Added Resolution|--- |FIXED Status|WAITING

[Bug ld/31795] ld.bfd makes ELFs of type ET_EXEC for static PIEs when load address is non-0

2024-05-25 Thread mintsuki at protonmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31795 --- Comment #18 from mintsuki --- (In reply to H.J. Lu from comment #17) > Fixed in 2.43 by: > > https://sourceware.org/git/?p=binutils-gdb.git;a=commit; > h=0daa17bf187cebd5b200f4fd5405cc55e75c391f Thank you very much! I'll just finish off