OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Dec 06, 2019 8:36 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Re: why won't this PIE run?
PostPosted: Sat Mar 16, 2019 12:19 pm 
Offline
Member
Member

Joined: Thu May 17, 2007 1:27 pm
Posts: 631
That is a very stupid question, but does "gcc -pie hello.o" work? What is your hello.lds?

EDIT: The offset 0 R/W segment is quite strange - your linker script maps the file header as R/W?
EDIT2: The linker (or kernel) might also just refuse to map something as RWE.

_________________
managarm: Microkernel-based OS that is capable of running a Wayland desktop
My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions]


Top
 Profile  
 
 Post subject: Re: why won't this PIE run?
PostPosted: Sat Mar 16, 2019 1:39 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 289
Korona wrote:
EDIT: The offset 0 R/W segment is quite strange - your linker script maps the file header as R/W?

That I thought as well, but the second load segment also has file size 0. There just isn't a .data section in the file, so no reference to any file data is made. I didn't even know this could happen.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group