This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: brk(2) trouble


> The Linux versions do not enforce a __minbrk value, so getting that
> initialized is not an issue.  I think a brk(&_start) will just happily eat
> your text and data mappings in Linux.

Not quite -- Linux sys_brk(brk) first checks against brk<end_code,
where end_code is set up by the ELF loader in the kernel, as the
highest address (+1) which lies in an executable section of the ELF
file (not the interpreter).  So you could actually trash your data
segment by shrinking brk, but not the text mapping(s).

Couldn't you just let the kernel deal with __minbrk restrictions on
NetBSD, too?

Regards,
Wolfram.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]