0
0
forked from aniani/nasm

subsections: don't lose the offset in the parent section

We don't want to lose the offset into the parent section when we
create a subsection, at least not for the MachO backend which is
currently the only user of subsections. Allow ofmt->herelabel() to set
a flag to copy the section offset from the previous section.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin (Intel)
2018-06-27 20:20:21 -07:00
parent 12810fac92
commit d644119ded
4 changed files with 26 additions and 8 deletions

View File

@@ -911,9 +911,14 @@ struct ofmt {
* The offset isn't passed; and may not be stable at this point.
* The subsection number is a field available for use by the
* backend. It is initialized to NO_SEG.
*
* If "copyoffset" is set by the backend then the offset is
* copied from the previous segment, otherwise the new segment
* is treated as a new segment the normal way.
*/
int32_t (*herelabel)(const char *name, enum label_type type,
int32_t seg, int32_t *subsection);
int32_t seg, int32_t *subsection,
bool *copyoffset);
/*
* This procedure is called to modify section alignment,